/** * Display a listing of the resource. * * @return Response */ public function index() { $evidences = Evidence::newest()->orderBy('title')->paginate(self::$per_page); $custody = Custody::orderBy('signature', 'ASC')->paginate(self::$per_page); $evidencesCount = count($evidences); $custodyCount = count($custody); return View::make('evidences.index', ['evidences' => $evidences, 'evidencesCount' => $evidencesCount, 'custody' => $custody, 'custodyCount' => $custodyCount]); }
protected function getView($template = null) { if (empty($template)) { $template = $this->template; } $settings = ['title' => Setting::get('ex_title'), 'customer' => Setting::get('ex_customer'), 'date' => Setting::get('ex_date'), 'version' => Setting::get('ex_version'), 'disclaimer' => Setting::get('ex_disclaimer_html')]; return View::make($template, ['project_name' => Setting::get('project_name'), 'generated_at' => date('d-m-Y H:i'), 'users' => static::getUsers(), 'logbooks' => static::getLogbooks($this->logbooks), 'logbooksAll' => static::getLogbooks('all'), 'entriesAll' => Entry::all(), 'attachments' => static::getAttachments($this->logbooks), 'attachmentsAll' => Attachment::all(), 'evidences' => Evidence::all(), 'custody' => Custody::all(), 'suspects' => Suspect::all(), 'legals' => Legal::where('active', 1)->get(), 'settings' => $settings]); }
public function returnedUpdate($custody_id, $custody_hash) { try { $custody = Custody::findOrFail($custody_id); if ($custody['return'] == 1 && $custody['returned'] == 0) { $custody->fill(Input::only(['returned_remark'])); $custody['returned_hash'] = md5(uniqid(rand(), true)); //Create new hash $custody['returned'] = 1; $custody['returned_remark'] = Input::get('signature_remark'); $custody['html_returned_remark'] = Markdown::string($custody['returned_remark']); $custody['returned_sign'] = Input::get('signed_sign'); $custody['returned_ip'] = Request::getClientIp(); $custody['returned_date'] = date('Y-m-d'); $custody['returned_time'] = date('Y-m-d H:m:s'); if ($custody->save()) { return View::make('custody.view', ['custody' => $custody]); } } else { if ($custody['signed'] == 1 && $custody['signature'] == 1) { return Redirect::to(route('evidences.index'))->with('message', ['content' => 'Chain of Custody al retour naar opdrachtgever!', 'class' => 'danger']); } else { return Redirect::to(route('evidences.index'))->with('message', ['content' => 'Chain of Custody kan niet worden ondertekend!', 'class' => 'danger']); } } } catch (ModelNotFoundException $e) { return Redirect::to(route('evidences.index'))->with('message', ['content' => 'Chain of Custody kan niet worden ondertekend!', 'class' => 'danger']); } }