本文整理汇总了PHP中Staff类的典型用法代码示例。如果您正苦于以下问题:PHP Staff类的具体用法?PHP Staff怎么用?PHP Staff使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Staff类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: accessCheck
public function accessCheck()
{
$da = $this->get("we_data_access");
$da_im = $this->get('we_data_access_im');
$request = $this->getRequest();
//访问权限校验
$api = new ApiController();
$api->setContainer($this->container);
$isWeFaFaDomain = $api->checkWWWDomain();
if (!$isWeFaFaDomain) {
$token = $api->checkAccessToken($request, $da);
if (!$token) {
$re = array("returncode" => "9999");
$re["code"] = "err0105";
$re["msg"] = "参数Appid或Openid或Access_token未指定或无效.";
return $re;
}
}
$openid = $request->get("openid");
$staffinfo = new Staff($da, $da_im, $openid, $this->get("logger"), $this->container);
$staffdata = $staffinfo->getInfo();
if (empty($staffdata)) {
return Utils::WrapResultError("无效操作帐号");
}
return Utils::WrapResultOk($staffinfo);
}
示例2: daftarPekerjaPost2
public function daftarPekerjaPost2()
{
if (Request::ajax()) {
$data = Input::all();
$noPekerja_ = 10000;
$noPekerja = DB::table('staff')->where('noPekerja', '>=', 10000)->orderBy('noPekerja', 'desc')->first();
// dd($noPekerja);
if (isset($noPekerja)) {
$noPekerja_ = $noPekerja->noPekerja + 1;
}
// dd($noPekerja_);
$staff = new Staff();
$staff->noPekerja = $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->noPhone = $data['noPhone'];
$staff->status = $data['status'];
$staff->catatan = $data['catatan'];
if ($staff->save()) {
return $noPekerja_;
} else {
return $noPekerja_;
}
}
}
示例3: testCreatePair
function testCreatePair()
{
$staff_1 = new Staff();
$staff_1->set(array('first_name' => 'First', 'last_name' => 'User'));
$staff_1->save();
$staff_2 = new Staff();
$staff_2->set(array('first_name' => 'Second', 'last_name' => 'User'));
$staff_2->save();
$h = new Hour();
$h->set(array('hours' => 6, 'staff_id' => $staff_1->id, 'pair_id' => $staff_2->id));
$h->updateOrCreateWithPair();
$this->assertTrue($h->id, 'should have an id');
$this->assertTrue($h->get('pair_hour_id'), 'should have a pair hour id');
$h2 = $h->getPairHour();
$this->assertIsA($h2, 'Hour');
$this->assertTrue($h2->id, 'should have an hour id');
$this->assertEqual($h2->get('hours'), 6);
$h->set(array('hours' => 7));
$h->updateOrCreateWithPair();
$h3 = $h->getPairHour();
$this->assertEqual($h2->id, $h3->id);
$this->assertEqual($h3->get('hours'), 7);
$this->assertEqual($h3->getPairName(), $staff_1->getName());
$this->assertEqual($h->getPairName(), $staff_2->getName());
}
示例4: approve
function approve($id)
{
if ($_POST) {
$rs = new Staff($id);
$rs->from_array($_POST);
$rs->save();
}
}
示例5: list_drop
function list_drop()
{
$staff = new Staff();
$staff->get();
foreach ($staff as $row) {
$data[''] = '[ Staffs ]';
$data[$row->staff_id] = $row->staff_name;
}
return $data;
}
示例6: index
public function index()
{
$staff = new Staff();
$data['q'] = $this->input->get('q');
$data['title'] = 'Payroll';
$data['results'] = $data['q'] == '' ? '' : 'Search result for "' . $this->input->get('q') . '"';
if ($data['q'] != '') {
$rs = $staff->or_like('staff_name', '%' . $data['q'] . '%')->or_like('staff_cabang', '%' . $data['q'] . '%')->or_like('staff_departement', '%' . $data['q'] . '%')->or_like('staff_jabatan', '%' . $data['q'] . '%');
}
$data['search_list'] = $staff->get();
$this->load->view('searches', $data);
}
示例7: 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;
}
示例8: getTeamLead
function getTeamLead()
{
if (!$this->lead && $this->getLeadId()) {
$this->lead = Staff::lookup($this->getLeadId());
}
return $this->lead;
}
示例9: 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';
}
}
}
示例10: GetStaff
public static function GetStaff()
{
if (!self::Is_Set("sid") || !self::Is_Set("secret")) {
return null;
}
return Staff::Load(self::GetStaffID());
}
示例11: getStaff
function getStaff()
{
if (!isset($this->_staff) && $this->staff_id) {
$this->_staff = Staff::lookup($this->staff_id);
}
return $this->_staff;
}
示例12: 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 '';
}
}
}
示例13: configure
public function configure()
{
$this->unsetTimestampable();
if (!$this->getCurrentUser()->isSuperAdmin()) {
$this->setDefault('staff_id', Staff::loggedIn());
}
}
示例14: getValidTimeLogTypes
public function getValidTimeLogTypes()
{
$staff_id = Staff::loggedInId();
$table = Doctrine_Core::getTable('TimeLogType');
$tlt = $this->getLastTimeLogTypeByStaffId($staff_id);
$ci = $table->getClockInById($tlt);
return $table->getByClockIn($ci);
}
示例15: AllStaff
public function AllStaff()
{
$params = $this->getRequest()->params();
$teamURL = $params['team'];
$teamURL = strtolower(str_replace('_', ' ', $teamURL));
$staff = Staff::get()->filter('Team.Title', $teamURL);
return $staff;
}