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


PHP Schedule::checkSchedule方法代码示例

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


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

示例1: Connection

 function get_Schedule($id, $ident)
 {
     global $globalDebug;
     // Get schedule here, so it's done only one time
     $Connection = new Connection();
     $dbc = $Connection->db;
     $Spotter = new Spotter($dbc);
     $Schedule = new Schedule($dbc);
     $Translation = new Translation($dbc);
     $operator = $Spotter->getOperator($ident);
     if ($Schedule->checkSchedule($operator) == 0) {
         $operator = $Translation->checkTranslation($ident);
         if ($Schedule->checkSchedule($operator) == 0) {
             $schedule = $Schedule->fetchSchedule($operator);
             if (count($schedule) > 0) {
                 if ($globalDebug) {
                     echo "-> Schedule info for " . $operator . " (" . $ident . ")\n";
                 }
                 $this->all_flights[$id] = array_merge($this->all_flights[$id], array('departure_airport_time' => $schedule['DepartureTime']));
                 $this->all_flights[$id] = array_merge($this->all_flights[$id], array('arrival_airport_time' => $schedule['ArrivalTime']));
                 // FIXME : Check if route schedule = route from DB
                 if ($schedule['DepartureAirportIATA'] != '') {
                     if ($this->all_flights[$id]['departure_airport'] != $Spotter->getAirportIcao($schedule['DepartureAirportIATA'])) {
                         $airport_icao = $Spotter->getAirportIcao($schedule['DepartureAirportIATA']);
                         if ($airport_icao != '') {
                             $this->all_flights[$id]['departure_airport'] = $airport_icao;
                             if ($globalDebug) {
                                 echo "-> Change departure airport to " . $airport_icao . " for " . $ident . "\n";
                             }
                         }
                     }
                 }
                 if ($schedule['ArrivalAirportIATA'] != '') {
                     if ($this->all_flights[$id]['arrival_airport'] != $Spotter->getAirportIcao($schedule['ArrivalAirportIATA'])) {
                         $airport_icao = $Spotter->getAirportIcao($schedule['ArrivalAirportIATA']);
                         if ($airport_icao != '') {
                             $this->all_flights[$id]['arrival_airport'] = $airport_icao;
                             if ($globalDebug) {
                                 echo "-> Change arrival airport to " . $airport_icao . " for " . $ident . "\n";
                             }
                         }
                     }
                 }
                 $Schedule->addSchedule($operator, $this->all_flights[$id]['departure_airport'], $this->all_flights[$id]['departure_airport_time'], $this->all_flights[$id]['arrival_airport'], $this->all_flights[$id]['arrival_airport_time'], $schedule['Source']);
             }
         }
     }
     //$Connection->db = null;
 }
开发者ID:sysrun,项目名称:FlightAirMap,代码行数:49,代码来源:class.SpotterImport.php

示例2: get_Schedule

 static function get_Schedule($id, $ident)
 {
     global $globalDebug;
     // Get schedule here, so it's done only one time
     $operator = Spotter::getOperator($ident);
     if (Schedule::checkSchedule($operator) == 0) {
         $operator = Translation::checkTranslation($ident);
         if (Schedule::checkSchedule($operator) == 0) {
             $schedule = Schedule::fetchSchedule($operator);
             if (count($schedule) > 0) {
                 if ($globalDebug) {
                     echo "-> Schedule info for " . $operator . " (" . $ident . ")\n";
                 }
                 self::$all_flights[$id] = array_merge(self::$all_flights[$id], array('departure_airport_time' => $schedule['DepartureTime']));
                 self::$all_flights[$id] = array_merge(self::$all_flights[$id], array('arrival_airport_time' => $schedule['ArrivalTime']));
                 // FIXME : Check if route schedule = route from DB
                 if ($schedule['DepartureAirportIATA'] != '') {
                     if (self::$all_flights[$id]['departure_airport'] != Spotter::getAirportIcao($schedule['DepartureAirportIATA'])) {
                         $airport_icao = Spotter::getAirportIcao($schedule['DepartureAirportIATA']);
                         if ($airport_icao != '') {
                             self::$all_flights[$id]['departure_airport'] = $airport_icao;
                             if ($globalDebug) {
                                 echo "-> Change departure airport to " . $airport_icao . " for " . $ident . "\n";
                             }
                         }
                     }
                 }
                 if ($schedule['ArrivalAirportIATA'] != '') {
                     if (self::$all_flights[$id]['arrival_airport'] != Spotter::getAirportIcao($schedule['ArrivalAirportIATA'])) {
                         $airport_icao = Spotter::getAirportIcao($schedule['ArrivalAirportIATA']);
                         if ($airport_icao != '') {
                             self::$all_flights[$id]['arrival_airport'] = $airport_icao;
                             if ($globalDebug) {
                                 echo "-> Change arrival airport to " . $airport_icao . " for " . $ident . "\n";
                             }
                         }
                     }
                 }
                 Schedule::addSchedule($operator, self::$all_flights[$id]['departure_airport'], self::$all_flights[$id]['departure_airport_time'], self::$all_flights[$id]['arrival_airport'], self::$all_flights[$id]['arrival_airport_time'], $schedule['Source']);
             }
         }
     }
 }
开发者ID:kletellier,项目名称:FlightAirMap,代码行数:43,代码来源:class.SBS.php

示例3: array

Route::get('/employee/clocking', array('before' => 'auth', 'as' => 'employeeTimesheet', 'uses' => 'EmployeesController@showEmployeeTimesheet'));
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;
    }
开发者ID:jarciga,项目名称:Euler2015Alpha,代码行数:31,代码来源:routes_20150428.php

示例4: hasSchedule

function hasSchedule()
{
    $employeeId = Session::get('userEmployeeId');
    $userId = Session::get('userId');
    $schedule = new Schedule();
    $hasSchedule = $schedule->checkSchedule($employeeId, date('Y-m-d'));
    $getSchedule = $schedule->getSchedule($employeeId, date('Y-m-d'));
    if ($hasSchedule && strtotime($getSchedule[0]->start_time) !== '') {
        return true;
    } else {
        //check workShift table default schedule if no schedule in the schedule table
        return false;
    }
}
开发者ID:jarciga,项目名称:Euler2015Alpha,代码行数:14,代码来源:helpers_alpha.php

示例5: 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]);
 }
开发者ID:jarciga,项目名称:Euler2015Alpha,代码行数:19,代码来源:EmployeesController20150706.php

示例6: ajaxCheck

 public function ajaxCheck($request, $response)
 {
     $content = $request->c;
     header("Content-Type: text/html; charset=GBK");
     if (empty($content)) {
         echo 'empty content';
         exit;
     } else {
         $content = mb_convert_encoding($content, 'gbk', 'UTF-8');
         $result = '';
         $schedule = Schedule::checkSchedule($content);
         if (isset($schedule['error']) && !empty($schedule['error'])) {
             $result = '0';
             foreach ($schedule['error'] as $value) {
                 $result .= $value;
                 $result .= "<br/>";
             }
         } else {
             if (isset($schedule['right']) && !empty($schedule['right'])) {
                 $result = '1';
                 foreach ($schedule['right'] as $value) {
                     $value[0] = str_replace(',', ' ', $value[0]);
                     $result .= str_replace("({$value['1']})", '', $value[0]);
                     $result .= "<br/>";
                 }
             }
         }
         echo $result;
         exit;
     }
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:31,代码来源:schedulecontroller.php

示例7: doLogin


//.........这里部分代码省略.........
                         //return 'true';
                     }
                     //return strtotime($currentDate). ' - ' .strtotime($cutoff['dateFrom'][1]);
                     //die();
                     //2nd CutOff - e.g 26-10
                     $startTime2 = strtotime($cutoff['dateFrom'][2]);
                     $endTime2 = strtotime($cutoff['dateTo'][2]);
                     // Loop between timestamps, 1 day at a time
                     //$cutoffArr2 = array();
                     $cutoffArr2[] = date('Y-m-d', $startTime2);
                     do {
                         $startTime2 = strtotime('+1 day', $startTime2);
                         $cutoffArr2[] = date('Y-m-d', $startTime2);
                     } while ($startTime2 < $endTime2);
                     if (in_array($currentDate, $cutoffArr2)) {
                         $currentCutoff = 2;
                     }
                 }
             }
             /*return $currentCutoff;
             		die();*/
             //return dd( 'Current Cutoff: '. $currentCutoff.' From '.$cutoff['dateFrom'][2] .' - To:'. $cutoff['dateTo'][2] );
             //die();
             $schedule = new Schedule();
             $workShift = new Workshift();
             if ($currentCutoff === 1) {
                 ////1st CutOff - e.g 11-25
                 //Check employee timesheet table if has the current date.
                 $getDayDateResult = DB::table('employee_timesheet')->where('employee_id', $employeeInfo[0]->id)->where('daydate', $currentDate)->get();
                 if (empty($getDayDateResult)) {
                     foreach ($cutoffArr1 as $dayDate) {
                         //return dd(date('l', strtotime($dayDate)));
                         $dayOfTheWeek = date('l', strtotime($dayDate));
                         $checkSchedule = $schedule->checkSchedule($employeeInfo[0]->id, $dayDate);
                         $getSchedule = $schedule->getSchedule($employeeInfo[0]->id, $dayDate);
                         //$employeeWorkShift = $workShift->getWorkShiftByEmployeeId($employeeInfo[0]->id);
                         $getWorkShiftByDayOfTheWeek = $workShift->getWorkShiftByDayOfTheWeek($employeeInfo[0]->id, $dayOfTheWeek, 1);
                         if ($checkSchedule) {
                             $schedule['start_time'] = date('H:i:s', strtotime($getSchedule[0]->start_time));
                             $schedule['end_time'] = date('H:i:s', strtotime($getSchedule[0]->end_time));
                         } elseif (!$checkSchedule) {
                             if (!empty($getWorkShiftByDayOfTheWeek)) {
                                 $schedule['start_time'] = date('H:i:s', strtotime($getWorkShiftByDayOfTheWeek[0]->start_time));
                                 $schedule['end_time'] = date('H:i:s', strtotime($getWorkShiftByDayOfTheWeek[0]->end_time));
                             } else {
                                 $schedule['start_time'] = '';
                                 $schedule['end_time'] = '';
                             }
                         }
                         $timesheetId = DB::table('employee_timesheet')->insertGetId(array('employee_id' => $employeeInfo[0]->id, 'daydate' => $dayDate, 'schedule_in' => $schedule['start_time'], 'schedule_out' => $schedule['end_time'], 'night_shift_time_out' => 0, 'clocking_status' => 'open'));
                         for ($i = 1; $i <= 3; $i++) {
                             DB::table('overtime')->insert(array('employee_id' => $employeeInfo[0]->id, 'timesheet_id' => $timesheetId, 'seq_no' => $i, 'shift' => $i));
                         }
                         DB::table('employee_summary')->insert(array('employee_id' => $employeeInfo[0]->id, 'daydate' => $dayDate));
                     }
                 } else {
                     foreach ($cutoffArr1 as $dayDate) {
                         //return 'debug.io';
                         //return dd(date('l', strtotime($dayDate)));
                         $dayOfTheWeek = date('l', strtotime($dayDate));
                         $checkSchedule = $schedule->checkSchedule($employeeInfo[0]->id, $dayDate);
                         $getSchedule = $schedule->getSchedule($employeeInfo[0]->id, $dayDate);
                         //$employeeWorkShift = $workShift->getWorkShiftByEmployeeId($employeeInfo[0]->id);
                         $getWorkShiftByDayOfTheWeek = $workShift->getWorkShiftByDayOfTheWeek($employeeInfo[0]->id, $dayOfTheWeek, 1);
                         if ($checkSchedule) {
                             $schedule['start_time'] = date('H:i:s', strtotime($getSchedule[0]->start_time));
开发者ID:jarciga,项目名称:Euler2015Alpha,代码行数:67,代码来源:UsersController.php


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