当前位置: 首页>>代码示例>>PHP>>正文


PHP Company::all方法代码示例

本文整理汇总了PHP中app\models\Company::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Company::all方法的具体用法?PHP Company::all怎么用?PHP Company::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Company的用法示例。


在下文中一共展示了Company::all方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Session::get('level') == '1' && Session::get('fingerprint') == md5($_SERVER['HTTP_USER_AGENT'] . $_SERVER['REMOTE_ADDR'])) {
         $data = Company::all();
         return View::make('company.index', array('data' => $data));
     } else {
         return Redirect::to('/');
     }
 }
开发者ID:themesanasang,项目名称:nth_supplier,代码行数:14,代码来源:CompanyController.php

示例2: create

 public function create($id, $tech_number = 1)
 {
     if (Auth::user()->can('create-service')) {
         $data['title'] = $tech_number == 1 ? "Create Service ~ " . $tech_number . " technician" : "Create Service ~ " . $tech_number . " technicians";
         $data['companies'] = Company::all();
         $data['company_id'] = $id;
         $data['contacts'] = CompanyPersonController::API()->all(["where" => ["company_person.company_id|=|" . $id], "order" => ["people.last_name|ASC", "people.first_name|ASC"], "paginate" => "false"]);
         $data['technicians'] = CompanyPersonController::API()->all(["where" => ["company_person.company_id|=|" . ELETTRIC80_COMPANY_ID], "order" => ["people.last_name|ASC", "people.first_name|ASC"], "paginate" => "false"]);
         $data['divisions'] = Division::orderBy("name")->get();
         $data['hotels'] = Hotel::where('company_id', $id)->orderBy("name")->get();
         $tech_number = $tech_number < 1 ? 1 : $tech_number;
         $tech_number = $tech_number > 5 ? 5 : $tech_number;
         $data['technician_number'] = $tech_number;
         foreach ($data['hotels'] as &$hotel) {
             $hotel['name_address'] = $hotel['name'] . " @ " . $hotel['address'];
         }
         return view('services/create', $data);
     } else {
         return redirect()->back()->withErrors(['Access denied to service create page']);
     }
 }
开发者ID:pinkynrg,项目名称:convergence2.0,代码行数:21,代码来源:ServicesController.php

示例3: EditView

 public function EditView($id)
 {
     if (!is_null($id)) {
         if (Auth::check()) {
             if (in_array('ADD_EDIT_USER', $this->permission)) {
                 $user_obj = User::with('getCompany')->find($id);
                 if (User::isSuperAdmin()) {
                     $company_obj = Company::all();
                     $role_obj = Role::get();
                 } else {
                     $company_obj = User::with('getCompany')->find(Auth::user()->id);
                     $role_obj = Role::where('id', '>', 1)->get();
                 }
                 return view('user.edit')->with('user_obj', $user_obj)->with('company_obj', $company_obj)->with('role_obj', $role_obj);
             }
             return \Redirect::back()->withErrors(['success' => false, 'msg' => 'You don\'t have permission']);
         }
         return Redirect::to(url('user/login'));
     }
     return \Redirect::back()->withErrors(['success' => false, 'msg' => 'somethings went wrongs']);
 }
开发者ID:bluelinemango,项目名称:mango,代码行数:21,代码来源:UsersController.php

示例4: getIndex

 /**
  * Returns view to display listing of companies.
  *
  * @author [Abdullah Alansari] [<ahimta@gmail.com>]
  * @since [v1.8]
  * @return View
  */
 public function getIndex()
 {
     return View::make('companies/index')->with('companies', Company::all());
 }
开发者ID:dmeltzer,项目名称:snipe-it,代码行数:11,代码来源:CompaniesController.php


注:本文中的app\models\Company::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。