public static function listDetailsHistory($claimsId) { $allClaims = Claims_App::find($claimsId)->detail()->paginate(10); $datagrid = new Datagrid(); $datagrid->setFields(array('detaildate' => 'Date')); $datagrid->setFields(array('detaildesc' => 'Description')); $datagrid->setFields(array('detailfrom' => 'Distance From')); $datagrid->setFields(array('detailto' => 'Distance To')); $datagrid->setFields(array('detailmile' => 'Milage')); $datagrid->setFields(array('detailtoll' => 'Toll')); $datagrid->setFields(array('detailpark' => 'Parking')); $datagrid->setAction('receipt', 'uploadResit', true, array('claimdetailid')); $datagrid->setTable('claimsDetails', 'table table-bordered table-hover table-striped table-condensed'); $datagrid->build($allClaims, 'claimdetailid'); return $datagrid->render(); }
public function post_addDetail() { $input = Input::get(); $claimID = $input['claimid']; $detailID = $input['detailId']; $input['detaildate'] = date('Y-m-d', strtotime($input['detaildate'])); // echo "<pre>";print_r($input);die; unset($input['claimid']); unset($input['detailId']); if (!isset($detailID) || $detailID == NULL) { $claimDetails = Claims_App::find($claimID); $claimDetails->detail()->insert($input); } else { $claimDetails = Claims_Detail::find($detailID); $claimDetails->fill($input); $claimDetails->save(); } return Claims_App::listDetails($claimID); }