コード例 #1
0
ファイル: Api.php プロジェクト: Jheysoon/lcis-2
 public static function checkInstructor($instructor, $time, $day)
 {
     $instructor_sched = Day_period::getInstructorsSched($instructor);
     $subject_time = explode(' / ', $time);
     $subject_day = explode(' / ', $day);
     foreach ($instructor_sched as $sched) {
         if (!in_array('TBA', $subject_day)) {
             $inst_day = Day::find($sched->day);
             if (!in_array($inst_day, $subject_day)) {
                 $from = Time::find($sched->from_time);
                 $to = Time::find($sched->to_time);
                 foreach ($subject_time as $key) {
                     $keys = explode('-', $key);
                     $isConflict = intersectCheck($from->time, $keys[0], $to->time, $keys[1]);
                     if ($isConflict) {
                         return true;
                     }
                 }
             }
         }
     }
     return false;
 }
コード例 #2
0
 public function stop($id)
 {
     $time = \App\Time::find($id);
     $time->touch();
     return \Redirect::route('projects.tickets.show', ['project_id' => $time->ticket->project->id, 'ticket_id' => $time->ticket->id]);
 }
コード例 #3
0
ファイル: TimeController.php プロジェクト: todayqq/TodayBlog
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $time = Time::find($id);
     if (file_exists(public_path() . '/uploads/' . $time->image && $time->image)) {
         unlink(public_path() . '/uploads/' . $time->image);
     }
     $time->delete();
     return Redirect::to('Today/time');
 }