本文整理汇总了PHP中Employee::getEmployeeInfoById方法的典型用法代码示例。如果您正苦于以下问题:PHP Employee::getEmployeeInfoById方法的具体用法?PHP Employee::getEmployeeInfoById怎么用?PHP Employee::getEmployeeInfoById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Employee
的用法示例。
在下文中一共展示了Employee::getEmployeeInfoById方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editgroup
public function editgroup($id)
{
$employeeId = Session::get('userEmployeeId');
$employee = new Employee();
$employeeInfo = $employee->getEmployeeInfoById($employeeId);
// Show details of a user.
$group = Group::findOrFail($id);
$perms = array("view" => 1, "create" => 2, "update" => 3, "delete" => 4);
$permissions = Permission::all();
return View::make('admin.editgroup')->with('group', $group)->with('perms', $perms)->with('permissions', $permissions)->with('employeeInfo', $employeeInfo);
}
示例2: trim
$JobTitle = JobTitle::find($id);
$JobTitle->name = trim(ucwords($data['job_title_name']));
if ($JobTitle->save()) {
$message = 'Updated Successfully.';
//return Redirect::to('/admin/company/new/'.$id)->with('message', $message);
return Redirect::to('/admin/jobtitle/new/')->with('message', $message);
}
}
}));
//DELETE: EXISTING COMPANY
Route::get('/admin/jobtitle/delete/{id}', array('as' => 'adminDeleteJobTitle', 'uses' => function ($id) {
$id = (int) $id;
$employeeId = Session::get('userEmployeeId');
$userId = Session::get('userId');
$employee = new Employee();
$employeeInfo = $employee->getEmployeeInfoById($employeeId);
//return 'Update Company';
return View::make('admin.jobtitledelete', array('id' => $id, 'employeeInfo' => $employeeInfo));
}));
//DELETE: EXISTING COMPANY
Route::post('/admin/jobtitle/delete/{id}', array('as' => 'adminProcessDeleteJobTitle', 'uses' => function ($id) {
$data = Input::all();
$id = (int) $id;
$JobTitle = JobTitle::find($id);
if ($JobTitle->delete()) {
$message = 'Deleted Successfully.';
return Redirect::route('adminNewJobTitle')->with('message', $message);
}
}));
//----------------------- Ibyang's Routes ------------------------ //
//routes for Group Module
示例3: doLogin
public function doLogin()
{
/**
* @Todo: Server side validation
*/
$employeeno = Input::get('employeeno');
$password = Input::get('password');
/*$data['employeeno'] = $employeeno;
$data['password'] = $password;
$rules = array(
'employee_number' => 'required',
'password' => 'required'
);
$validator = Validator::make($data, $rules);
if ( $validator->fails() ) {
$messages = $validator->messages();
return Redirect::to('users/login')->withErrors($validator);
} else {*/
/*$userdata = array(
'employee_number' => $employeeno,
'password' => $password
);*/
// Login credentials
$credentials = array('employee_number' => $employeeno, 'password' => $password);
try {
// Authenticate the user
$user = Sentry::authenticate($credentials, false);
/*if($user){
return Redirect::to('/employee/clocking');
} else {
return View::make('users.index'); //Return back to login page
}*/
//if ( Auth::attempt($userdata) ) {
if ($user) {
// validation successful!
// redirect them to the secure section or whatever
// return Redirect::to('secure');
// for now we'll just echo success (even though echoing in a controller is bad)
//echo 'SUCCESS!';
//return $user->employee_id;
Session::put('userEmployeeId', $user->employee_id);
Session::put('userId', $user->id);
Session::put('email', $user->email);
$user['employeeId'] = $user->employee_id;
/*$emplooyeeSetting = new Setting;
$getEmployeeSettingByEmployeeId = $emplooyeeSetting->getEmployeeSettingByEmployeeId();
return dd($getEmployeeSettingByEmployeeId); //If no setting found the result will be NULL
break;*/
$employee = new Employee();
$employeeInfo = $employee->getEmployeeInfoById($user['employeeId']);
$workShift = new Workshift();
//$employeeWorkShift = $workShift->getWorkShiftByEmployeeId($user['employeeId']);
//$dayOfTheWeek = date('l', strtotime($dayDate));
//$getWorkShiftByDayOfTheWeek = $workShift->getWorkShiftByDayOfTheWeek($employeeInfo[0]->id, $dayOfTheWeek);
$adminCutoff = new AdminCutoff();
$adminCutoffConfig = new Cutoffsetting();
$getAllCutoffSetting = $adminCutoffConfig->getAllCutoffSetting();
$cutoff['id'] = $adminCutoff->getCutoffbyYearMonth()->id;
$cutoff['year'] = $adminCutoff->getCutoffbyYearMonth()->year;
$cutoff['month'] = $adminCutoff->getCutoffbyYearMonth()->month;
$cutoff['type'] = $adminCutoff->getCutoffbyYearMonth()->cutoff_type;
$cutoff['dateFrom'][1] = $adminCutoff->getCutoffbyYearMonth()->cutoff_date_from_1;
$cutoff['dateTo'][1] = $adminCutoff->getCutoffbyYearMonth()->cutoff_date_to_1;
$cutoff['dateFrom'][2] = $adminCutoff->getCutoffbyYearMonth()->cutoff_date_from_2;
$cutoff['dateTo'][2] = $adminCutoff->getCutoffbyYearMonth()->cutoff_date_to_2;
$cutoffConfig['cutoff_type'] = $getAllCutoffSetting[0]->cutoff_type;
$cutoffConfig['cutoff_options'] = $getAllCutoffSetting[0]->cutoff_options;
$currentDate = date('Y-m-d');
$currentMonth = date('M');
$currentCutoff = '';
$getSchedule = '';
if ($cutoff['type'] === 'Monthly') {
// Monthly
} elseif ($cutoff['type'] === 'Semi Monthly') {
if ($cutoffConfig['cutoff_options'] === 1) {
// 1st and 2nd cutoff same within the month
// 1st and 2nd cutoff same within the month
//return 'debug.io';
//exit;
$currentDate = date('Y-m-d');
//1st CutOff - e.g 11-25
$startTime1 = strtotime($cutoff['dateFrom'][1]);
$endTime1 = strtotime($cutoff['dateTo'][1]);
// Loop between timestamps, 1 day at a time
//$cutoffArr1 = array();
$cutoffArr1[] = date('Y-m-d', $startTime1);
do {
$startTime1 = strtotime('+1 day', $startTime1);
$cutoffArr1[] = date('Y-m-d', $startTime1);
//.........这里部分代码省略.........
示例4: showAdminEmployeeTimesheet
public function showAdminEmployeeTimesheet()
{
$employeeId = Session::get('userEmployeeId');
//$employeeId = Auth::user()->employee_id;
$currentDate = date('Y-m-d');
$employee = new Employee();
$employeeInfo = $employee->getEmployeeInfoById($employeeId);
$workShift = new Workshift();
$employeeWorkShift = $workShift->getWorkShiftByEmployeeId($employeeId);
$timesheet = new Timesheet();
$employeeTimesheet = $timesheet->getAllRows($employeeId);
$getTimesheetById = $timesheet->getTimesheetById($employeeId, $currentDate);
$timesheetPerMonth = $timesheet->getTimesheetPerMonth($employeeId, Session::get('dayDateArr'));
$schedule = new Schedule();
$checkSchedule = $schedule->checkSchedule($employeeId, $currentDate);
$getSchedule = $schedule->getSchedule($employeeId, $currentDate);
//Admin view
return View::make('employees.admin.clocking', ['employeeInfo' => $employeeInfo, 'employeeWorkShift' => $employeeWorkShift, 'employeeTimesheet' => $employeeTimesheet, 'getTimesheetById' => $getTimesheetById, 'timesheetPerMonth' => $timesheetPerMonth]);
}
示例5: create
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
// Show the create employee form.
$employeeId = Session::get('userEmployeeId');
$employee = new Employee();
$employeeInfo = $employee->getEmployeeInfoById($employeeId);
return View::make('admin.createpermission')->with('employeeInfo', $employeeInfo);
}