Ejemplo n.º 1
0
 function scheduleSearchRentang()
 {
     $data = Input::all();
     $city = City::all();
     $data = Input::all();
     $tanggal = $data['RENT_SCHEDULE_DATE'];
     $start = date('Y-m-d', strtotime(' -7 day', strtotime($tanggal)));
     $finish = date('Y-m-d', strtotime(' +7 day', strtotime($tanggal)));
     $vehicle = Rentschedule::rentScheduleRentang($data['CITY_ID'], $start, $finish)->distinct()->get();
     $duration = 1;
     Session(['duration' => $duration]);
     //print_r($vehicle);
     return view('rentpage::hasil-search', compact('vehicle', 'city', 'duration'));
 }
Ejemplo n.º 2
0
 function addJadwalHarian()
 {
     $data = Input::all();
     unset($data['_token']);
     $data['RENT_SCHEDULE_CREATEBY'] = Session::get('id');
     $flag = Rentschedule::whereDate('RENT_SCHEDULE_DATE', '=', date('Y-m-d', strtotime($data['RENT_SCHEDULE_DATE'])))->where('VEHICLE_ID', '=', $data['VEHICLE_ID'])->count();
     if ($flag == 0) {
         Rentschedule::insert($data);
     } else {
         Session::flash("error", "Ada jadwal yang bentrok, mohon periksa kembali");
     }
     return Redirect::back();
 }