本文整理汇总了PHP中Schedule::getSchedule方法的典型用法代码示例。如果您正苦于以下问题:PHP Schedule::getSchedule方法的具体用法?PHP Schedule::getSchedule怎么用?PHP Schedule::getSchedule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schedule
的用法示例。
在下文中一共展示了Schedule::getSchedule方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: viewDetailSchedule
public function viewDetailSchedule()
{
$employees = Employee::getAllEmployees();
$schedule = Schedule::getSchedule($_GET['id']);
$db = Database::getInstance();
$sql = "Select employee.firstName, employee.lastName, day.shiftDate, day.startTime, day.id as day_id from day left join week on day.weekId = week.id left join employee on week.empId = employee.id\n\t\t\t\t\tWHERE day.shiftDate >= :start AND day.shiftDate <= :end ORDER BY employee.firstName, day.shiftDate; ";
$result = $db->prepare($sql);
$result->execute(array(":start" => $schedule['startDate'], ":end" => date('Y-m-d', strtotime("+6 day", strtotime($schedule['startDate'])))));
$allEmpSchedule = $result->fetchAll(PDO::FETCH_ASSOC);
require_once 'views/schedule_detail_view.php';
}
示例2: createDays
public static function createDays($schId)
{
$db = Database::getInstance();
$weekId = Week::getLastId();
$schedule = Schedule::getSchedule($schId);
$sql = "INSERT INTO day (weekId, startTime, shiftDate) VALUES (:weekId, :startTime, :shiftDate)";
for ($i = 0; $i < 7; $i++) {
$shift = date('Y-m-d', strToTime("+" . $i . " days", strToTime($schedule['startDate'])));
$result = $db->prepare($sql);
$result->execute(array(":weekId" => $weekId, ":startTime" => null, ":shiftDate" => $shift));
}
}
示例3: save
/**
* Save the user, both in the DB and in the session
*
*/
function save(Schedule $schedule, $userID)
{
$userID = $this->clean($userID);
// Remove all the hours of the user
$query = 'DELETE * FROM ' . self::TABLE_SCHEDULE . ' WHERE userID = ' . $userID;
$this->getDB()->query($query);
// Add all the new hours
foreach ($schedule->getSchedule() as $day => $hours) {
foreach ($hours as $h) {
$save = array('userID' => $userID, 'day' => $day, 'hour' => $h);
$this->getDB()->insert(self::TABLE_SCHEDULE, $save);
}
}
}
示例4: array
Route::post('/employee/clocking', array('as' => 'timeClocking', 'uses' => function () {
$data = Input::all();
echo Session::put('timeclocking', $data['timeclocking']);
$workShift = new Workshift();
$getWorkShift = $workShift->getWorkShiftByEmployeeId(Auth::user()->employee_id);
$todayDate = date('Y-m-d');
$holiday = new Holiday();
$getHolidayByDate = $holiday->getHolidayByDate($todayDate);
//var_dump($employeeClocking);
//$employeeId = Auth::user()->employee_id;
//$workShift = DB::table('work_shift')->where('employee_id', $employeeId)->get();
$timesheet = new Timesheet();
$getTimesheetById = $timesheet->getTimesheetById(Auth::user()->employee_id, date('Y-m-d'));
$schedule = new Schedule();
$hasSchedule = $schedule->checkSchedule(Auth::user()->employee_id, date('Y-m-d'));
$getSchedule = $schedule->getSchedule(Auth::user()->employee_id, date('Y-m-d'));
//Deduction Model
$deduction = new Deduction();
$hasNightShiftStartTimeThreshold = true;
$nightShiftStartTimeThreshold = 5;
//It should be bigger;
//get schedule
//Check if there is assign schedule today
//if ( $hasSchedule && strtotime($getSchedule[0]->start_time) !== strtotime('00:00:00')) {
if ($hasSchedule && strtotime($getSchedule[0]->start_time) !== '') {
$hasTodaySchedule = true;
} else {
//check workShift table default schedule if no schedule in the schedule table
$hasTodaySchedule = false;
}
//Computation Setting
示例5: getDataFromDB
//.........这里部分代码省略.........
}
if (isset($temp_array['airline_iata']) && $temp_array['airline_iata'] != '') {
$acars_array = $ACARS->getLiveAcarsData($temp_array['airline_iata'] . substr($temp_array['ident'], 3));
//$acars_array = ACARS->getLiveAcarsData('BA40YL');
if (count($acars_array) > 0) {
$temp_array['acars'] = $acars_array;
//print_r($acars_array);
}
}
if ($temp_array['registration'] != "" || $globalIVAO && $temp_array['aircraft_type'] != '') {
if ($globalIVAO) {
if (isset($temp_array['airline_icao'])) {
$image_array = $Image->getSpotterImage('', $temp_array['aircraft_type'], $temp_array['airline_icao']);
} else {
$image_array = $Image->getSpotterImage('', $temp_array['aircraft_type']);
}
} else {
$image_array = $Image->getSpotterImage($temp_array['registration']);
}
if (count($image_array) > 0) {
$temp_array['image'] = $image_array[0]['image'];
$temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
$temp_array['image_source'] = $image_array[0]['image_source'];
$temp_array['image_source_website'] = $image_array[0]['image_source_website'];
if ($temp_array['image_source_website'] == '' && $temp_array['image_source'] == 'planespotters') {
$planespotter_url_array = explode("_", $temp_array['image']);
$planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]);
$temp_array['image_source_website'] = 'http://www.planespotters.net/Aviation_Photos/photo.show?id=' . $planespotter_id;
}
$temp_array['image_copyright'] = $image_array[0]['image_copyright'];
}
}
if (!isset($globalIVAO) || !$globalIVAO) {
$schedule_array = $Schedule->getSchedule($temp_array['ident']);
//print_r($schedule_array);
if (count($schedule_array) > 0) {
if ($schedule_array['departure_airport_icao'] != '') {
$row['departure_airport_icao'] = $schedule_array['departure_airport_icao'];
$temp_array['departure_airport'] = $row['departure_airport_icao'];
}
if ($schedule_array['arrival_airport_icao'] != '') {
$row['arrival_airport_icao'] = $schedule_array['arrival_airport_icao'];
$temp_array['arrival_airport'] = $row['arrival_airport_icao'];
}
$temp_array['departure_airport_time'] = $schedule_array['departure_airport_time'];
$temp_array['arrival_airport_time'] = $schedule_array['arrival_airport_time'];
}
}
//if ($row['departure_airport_icao'] != '' && $row['departure_airport_name'] == '') {
if ($row['departure_airport_icao'] != '') {
$departure_airport_array = $this->getAllAirportInfo($row['departure_airport_icao']);
if (!isset($departure_airport_array[0]['name'])) {
$departure_airport_array = $this->getAllAirportInfo('NA');
}
/*
} elseif ($row['departure_airport_name'] != '') {
$temp_array['departure_airport_name'] = $row['departure_airport_name'];
$temp_array['departure_airport_city'] = $row['departure_airport_city'];
$temp_array['departure_airport_country'] = $row['departure_airport_country'];
$temp_array['departure_airport_icao'] = $row['departure_airport_icao'];
*/
} else {
$departure_airport_array = $this->getAllAirportInfo('NA');
}
if (isset($departure_airport_array[0]['name'])) {
$temp_array['departure_airport_name'] = $departure_airport_array[0]['name'];
示例6: getWorkHours
function getWorkHours($clockingIn, $clockingOut, $shiftEnd)
{
$employeeId = Session::get('userEmployeeId');
$userId = Session::get('userId');
$schedule = new Schedule();
$getSchedule = $schedule->getSchedule($employeeId, date('Y-m-d'));
$workShift = new Workshift();
$getWorkShiftByEmployeeId = $workShift->getWorkShiftByEmployeeId($employeeId);
$setting = new Setting();
$employeeSetting = $setting->getEmployeeSettingByEmployeeId($employeeId);
if (!empty($getSchedule)) {
$schedule['start_time'] = $getSchedule[0]->start_time;
$schedule['end_time'] = $getSchedule[0]->end_time;
$schedule['hours_per_day'] = $getSchedule[0]->hours_per_day;
$halfOfhoursPerDay = $schedule['hours_per_day'] / 2;
// e.g 8.00 without break
} elseif (!empty($getWorkShiftByEmployeeId)) {
$workShift['start_time'] = $getWorkShiftByEmployeeId[0]->start_time;
$workShift['end_time'] = $getWorkShiftByEmployeeId[0]->end_time;
$workShift['hours_per_day'] = $getWorkShiftByEmployeeId[0]->hours_per_day;
$halfOfhoursPerDay = $workShift['hours_per_day'] / 2;
// e.g 8.00 without break
}
if (!empty($employeeSetting->hours_per_day)) {
$halfOfhoursPerDay = $employeeSetting->hours_per_day / 2;
// e.g 8.00 without break
$setting['break_time'] = $employeeSetting->break_time;
}
//$interval = getDateTimeDiffInterval($clockingIn, $shiftEnd);
$interval = getDateTimeDiffInterval($clockingIn, $clockingOut);
$days = $interval->format('%a');
$days = (int) $days;
if ($days !== 0) {
$hhToDays = $days * 24;
$hh = (int) $hhToDays;
} else {
$hh = (int) $interval->format('%h');
}
$mm = (int) $interval->format('%i');
$ss = (int) $interval->format('%s');
if ($setting['break_time'] === 1) {
list($breakTimeHh, $breakTimeMm, $breakTimeSs) = explode(':', $setting['break_time']);
$breakTime = getTimeToDecimalHours($breakTimeHh, $breakTimeMm, $breakTimeSs);
$workHours = getTimeToDecimalHours($hh, $mm, $ss);
//number_format($hours, 2);
if ($workHours > $halfOfhoursPerDay) {
$workHours = $workHours - $breakTime;
} else {
$workHours = getTimeToDecimalHours($hh, $mm, $ss);
}
} else {
$workHours = getTimeToDecimalHours($hh, $mm, $ss);
//number_format($hours, 2);
}
return number_format($workHours, 2);
}
示例7: 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]);
}
示例8: 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);
//.........这里部分代码省略.........
示例9: getSchedule
function getSchedule($team)
{
$schedule = new Schedule();
echo $schedule->getSchedule($team);
}
示例10: Schedule
<?php
$schedule = new Schedule();
if (!$schedule->isEnabled()) {
throw new NotFoundException('Schedule is disabled');
}
header('Content-Type: application/json');
if ($conference->isClosed()) {
echo '{}';
} else {
echo json_encode($schedule->getSchedule(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
}