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; }
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]); }
/** * 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'); }