function transaksiSubmit()
 {
     $data = Input::all();
     $flag = $data['flag'];
     print_r($data);
     $schedule = Travelschedule::findschedule($data['TRAVEL_SCHEDULE_ID'])->first();
     unset($data['_token']);
     $schedule_id = $data['TRAVEL_SCHEDULE_ID'];
     unset($data['_token'], $data['flag']);
     $costumer = $data;
     unset($data['COSTUMER_EMAIL'], $data['COSTUMER_NAME'], $data['COSTUMER_TELP']);
     if (!is_null(Session::get('id')) and Session::get('hak') == 'COSTUMER') {
         $data['MEMBER_ID'] = Session::get('id');
     } else {
         unset($costumer['TRAVEL_SCHEDULE_ID'], $costumer['TRAVEL_TRANSACTION_PASSENGER'], $costumer['TRAVEL_TRANSACTION_PRICE']);
         Costumer::insert($costumer);
         $id = DB::getPdo()->lastInsertId();
         $data['COSTUMER_ID'] = $id;
     }
     $data['TRAVEL_TRANSACTION_STATUS_ID'] = 1;
     Traveltransaction::insert($data);
     $idtransaksi = DB::getPdo()->lastInsertId();
     $code = DB::select('select travel_code() as code');
     $code = $code[0]->code;
     $code_transaksi = ['TRAVEL_TRANSACTION_CODE' => $code];
     $transaksi = Traveltransaction::where('TRAVEL_TRANSACTION_ID', '=', $idtransaksi);
     $transaksi->update($code_transaksi);
     if ($flag == 1) {
         return redirect::back();
     } else {
         return redirect::to('/');
     }
 }
 function transaksiSubmit()
 {
     $data = Input::all();
     $schedule = Rentschedule::findRentschedule($data['RENT_SCHEDULE_ID'])->first();
     unset($data['_token']);
     $schedule_id = $data['RENT_SCHEDULE_ID'];
     unset($data['RENT_SCHEDULE_ID']);
     $costumer = $data;
     $data['RENT_TRANSACTION_PRICE'] = $schedule['RENT_SCHEDULE_PRICE'];
     unset($data['_token']);
     $data['RENT_TRANSACTION_DATE'] = date('y-m-d');
     $data['RENT_TRANSACTION_CREATEBY'] = Session::get('id');
     unset($data['COSTUMER_EMAIL'], $data['COSTUMER_NAME'], $data['COSTUMER_TELP']);
     $data['RENT_TRANSACTION_PRICE'] = Session::get('duration');
     if (!is_null(Session::get('id')) and Session::get('hak') == 'COSTUMER') {
         $data['MEMBER_ID'] = Session::get('id');
     } else {
         Costumer::insert($costumer);
         $id = DB::getPdo()->lastInsertId();
         $data['COSTUMER_ID'] = $id;
     }
     Renttransaction::insert($data);
     $detail_transaksi = ['RENT_TRANSACTION_ID' => DB::getPdo()->lastInsertId(), 'RENT_SCHEDULE_ID' => $schedule_id];
     Renttransactiondetail::insert($detail_transaksi);
     return redirect::to('/');
 }