本文整理汇总了PHP中Staff::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Staff::find方法的具体用法?PHP Staff::find怎么用?PHP Staff::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Staff
的用法示例。
在下文中一共展示了Staff::find方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: find_by_page
function find_by_page($page = 1)
{
$limit = get_config('staffs.per_page');
$offset = ($page - 1) * $limit;
$staffs = Staff::find('all', array('order' => 'id desc', 'limit' => $limit, 'offset' => $offset));
return $staffs;
}
示例2: kemaskiniStaff
public function kemaskiniStaff()
{
if (Request::ajax()) {
$data = Input::all();
$noPekerja = $data['noPekerja'];
$staff = Staff::find($noPekerja);
$staff->nama = $data['nama'];
$staff->noKP = $data['noKP'];
$staff->jawatan = $data['jawatan'];
$staff->penempatan = $data['penempatan'];
$staff->bahagian = $data['bahagian'];
$staff->cawangan = $data['cawangan'];
$staff->sambungan = $data['sambungan'];
$staff->faks = $data['faks'];
$staff->speedDial = $data['speedDial'];
$staff->status = $data['status'];
$staff->catatan = $data['catatan'];
if ($noPekerja == '3374') {
$staff->noPhone .= '.';
$staff->catatan = '';
$staff->jawatan = 'PENOLONG PEGAWAI TEKNOLOGI MAKLUMAT (F29)';
$staff->noKP = '**013002****';
$staff->speedDial = '000';
} else {
$staff->noPhone = $data['noTel'];
}
if ($staff->save()) {
return 'Save Succeeded';
} else {
return 'Failed to save';
}
}
}
示例3: staff
public function staff($id)
{
$staff = Staff::find($id);
if ($staff->delete()) {
Session::flash('success', 'Staff Berjaya dihapus.');
} else {
Session::flash('fail', 'Staff gagal dihapus');
}
// return Session::get('success');
return Redirect::to('admin/carian/staff');
}
示例4: edit
/**
* Show the form for editing the specified group.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$staff = Staff::find($id);
return View::make('staffs.edit', compact('staff'));
}
示例5: kemaskini
public function kemaskini($id)
{
$staff = Staff::find($id);
// echo '<pre>', var_dump($staff), '</pre>';
return View::make('admin.kemaskini.staff')->with('title', 'Kemaskini Staff')->with('staff', $staff);
}
示例6: actionPrintSearch
public function actionPrintSearch()
{
$data[0] = array('ID', '姓','名','性别','籍贯','办公室','职位','个人邮箱','公司邮箱','公司电话','个人电话','个人微信','个人QQ');
$model = new Staff;
if(isset($_POST['ids'])){
foreach($_POST['ids'] as $id){
$arr = $model->find(array('condition'=>"id=$id"));
$data[] = array(
$arr->id,
$arr->name,
$arr->first,
$arr->gender,
$arr->hometown,
$arr->office,
$arr->position,
$arr->email,
$arr->comemail,
$arr->phone,
$arr->mobile,
$arr->wechat,
$arr->qq,
);
}
}
Yii::import('application.extensions.phpexcel.JPhpExcel');
$xls = new JPhpExcel('UTF-8', false, 'Staff_sheet');
$xls->addArray($data);
$xls->generateXML('All_Staff_Info_Sheet'.time());
}
示例7: isStaff
public function isStaff()
{
return !is_null(Staff::find($this->id));
}