Esempio n. 1
0
 public static function detailInfo($claimdetailid)
 {
     $detail = Claims_Detail::find($claimdetailid);
     $data['claimid'] = $detail->claimid;
     $data['detaildate'] = date('d/m/Y', strtotime($detail->detaildate));
     $data['detaildesc'] = $detail->detaildesc;
     $data['detailfrom'] = $detail->detailfrom;
     $data['detailto'] = $detail->detailto;
     $data['detailmile'] = $detail->detailmile;
     $data['detailtoll'] = $detail->detailtoll;
     $data['detailpark'] = $detail->detailpark;
     return $data;
 }
Esempio n. 2
0
 public function post_deleteDetail()
 {
     $input = Input::get();
     Claims_Detail::find($input['id'])->delete();
     $files = Claims_Receipt::where('claimdetailid', '=', $input['id'])->where('claimid', '=', $input['claimid'])->get();
     foreach ($files as $record) {
         $fileLoc = path('storage') . $record->recpath;
         if (file_exists($fileLoc)) {
             unlink($fileLoc);
         }
     }
     Claims_Receipt::where('claimdetailid', '=', $input['id'])->where('claimid', '=', $input['claimid'])->delete();
     return Claims_App::listDetails($input['claimid']);
 }