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


PHP Staff::where方法代码示例

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


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

示例1: carian2

 public function carian2($carian)
 {
     if (Request::ajax()) {
         if ($carian != '') {
             $users = Staff::where('nama', 'like', '%' . $carian . '%')->get();
             $count = 1;
             $output = '<table class="table table-striped table-bordered responsive">
                             <thead>
                             <tr>
                                 <th>Bil</th>
                                 <th>Nama</th>
                                 <th>Sambungan</th>
                                 <th>Speed Dial</th>
                                 <th>Jawatan</th>
                             </tr>
                             </thead>
                             <tbody>';
             foreach ($users as $user) {
                 $kemaskini = URL::route('staff-kemaskini') . '/' . $user->noPekerja;
                 $output .= '<tr>
                                     <td>' . $count++ . '</td>
                                     <td class="center"><b>' . $user->nama . '</b></td>
                                     <td class="center"><b>' . $user->sambungan . '</b></td>';
                 $speedDial = '';
                 if (strlen($user->speedDial) < 4) {
                     $speedDial = '# ' . $user->speedDial;
                 } else {
                     $speedDial = $user->speedDial;
                 }
                 $output .= '   <td class="center"><b>' . $speedDial . '</b></td>
                                     <td class="center"><b>' . $user->jawatan . '</b></td>
                                 </tr>';
             }
             $output .= '    </tbody>
                         </table>';
             if ($users->count() == 0) {
                 $output = '<table class="table table-striped table-bordered responsive">
                             <thead>
                             <tr>
                                 <th>Bil</th>
                                 <th>Nama</th>
                                 <th>No Telefon</th>
                                 <th>Speed Dial</th>
                                 <th>No Faks</th>
                                 <th>Alamat</th>
                             </tr>
                             </thead>
                             <tbody>
                             <tr>
                                     <td colspan="6"><font color="red">Tiada Maklumat</font></td>
                                 </tr>
                             </tbody>
                             </table>';
             }
             return $output;
         } else {
             return '';
         }
     }
 }
开发者ID:suhairi,项目名称:e-direktori,代码行数:60,代码来源:HomeController.php

示例2: senaraiSpeedDial2

 public function senaraiSpeedDial2()
 {
     $staff = Staff::where('speedDial', '<>', '0')->where('speedDial', '<>', '')->orderBy('speedDial', 'asc')->get();
     $syarikat = Syarikat::where('speedDial', '<>', '')->where('speedDial', '<>', '0')->orderBy('speedDial', 'asc')->get();
     $speedDialData[] = '';
     foreach ($staff as $staf) {
         $speedDialData[$staf->speedDial] = ['nama' => $staf->nama, 'bahagian' => $staf->bahagian, 'speedDial' => $staf->speedDial, 'noPhone' => $staf->noPhone];
     }
     foreach ($syarikat as $sykt) {
         $speedDialData[$sykt->speedDial] = ['nama' => $sykt->nama, 'bahagian' => $sykt->alamat, 'speedDial' => $sykt->speedDial, 'noPhone' => $sykt->noTel];
     }
     echo '<pre>', var_dump($speedDialData), '</pre>';
     foreach ($speedDialData as $data) {
         echo $data->nama;
     }
     return 'done';
     return View::make('/admin/senarai/speedDial2')->with('title', 'Senarai Speed Dial')->with('data', $speedDialData);
 }
开发者ID:suhairi,项目名称:e-direktori,代码行数:18,代码来源:SenaraiController.php

示例3: apiSearch

 public function apiSearch($username)
 {
     $users = Staff::where('nama', 'like', '%' . $username . '%')->get();
     return $users = json_encode($users);
 }
开发者ID:suhairi,项目名称:e-direktori,代码行数:5,代码来源:SearchController.php

示例4: show

 public function show($id)
 {
     $this->breadcrumb->append_crumb('Home', base_url());
     $this->breadcrumb->append_crumb('Staff Detail', base_url() . '');
     $staff = new Staff();
     $data['staff'] = $staff->where('staff_id', $id)->get();
     $family = new Family();
     $data['families'] = $family->where('staff_fam_staff_id', $data['staff']->staff_id)->get();
     $work = new Work();
     $data['works'] = $work->where('staff_id', $data['staff']->staff_id)->get();
     $education = new Education();
     $data['educations'] = $education->where('staff_id', $data['staff']->staff_id)->get();
     $medical = new Medical();
     $data['medicals'] = $medical->where('staff_id', $data['staff']->staff_id)->get();
     $asset_detail = new Asset_Detail();
     $data['asset_details'] = $asset_detail->where('staff_id', $data['staff']->staff_id)->get();
     $data['btn_back'] = anchor('staffs/', 'Back');
     $data['btn_edit'] = anchor('staffs/edit/' . $data['staff']->staff_id, 'Edit');
     $this->load->view('staffs/show', $data);
 }
开发者ID:anggadjava,项目名称:payroll,代码行数:20,代码来源:staffs.php

示例5: Staff

 function get_count_dep($cb, $dept)
 {
     $staff = new Staff();
     $query = $staff->where('staff_cabang', 'Bandung')->where('staff_departement', 'Accounting')->count();
     return $query;
 }
开发者ID:anggadjava,项目名称:payroll,代码行数:6,代码来源:welcome.php


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