public function show($id) { $data = array('menu' => 'report', 'title' => 'Laporan', 'description' => '', 'breadcrumb' => array('Laporan' => route('admin.report'))); $data['report'] = Report::with(array('user', 'event', 'socialaction', 'socialtarget'))->where('id', $id)->first(); // return $data; return View::make('admin.pages.report.show')->with($data); }
function pdf($report_id = false) { $this->pdf = new Pdf(); File::requireOnce(app_path() . '/library/SVGGraph/SVGGraph.php'); $this->margins = $this->pdf->getMargins(); $this->pdf_w = $this->pdf->getPageWidth(); //check if loading existing PDF if ($report_id !== false) { $report = json_decode(Report::with('answers')->find($report_id), true); if (count($report['answers']) != 6) { return Redirect::route('assesment.page1'); } foreach ($report['answers'] as $answer) { $answers = json_decode($answer['answers'], true); if ($answer['section'] == 'page1') { $this->guest_name = $answers['s1']; $this->guest_company = $answers['s2']; } if ($answer['section'] == 'page2') { $this->intent_score = $answers['intent_score']; } if ($answer['section'] == 'page3') { $this->data_score = $answers['data_score']; } if ($answer['section'] == 'page4') { $this->tech_score = $answers['technology_score']; } if ($answer['section'] == 'page5') { $this->people_score = $answers['people_score']; } if ($answer['section'] == 'page6') { $this->process_score = $answers['process_score']; } } } else { $this->rData = Session::get('report'); $this->guest_name = $this->rData['page1']['s1']; $this->guest_company = $this->rData['page1']['s2']; $this->intent_score = $this->rData['page2']['intent_score']; $this->data_score = $this->rData['page3']['data_score']; $this->tech_score = $this->rData['page4']['technology_score']; $this->people_score = $this->rData['page5']['people_score']; $this->process_score = $this->rData['page6']['process_score']; } $this->overall_score = ($this->intent_score + $this->data_score + $this->tech_score + $this->people_score + $this->process_score) / 5; $this->getPDF(); }
public function index() { // init $data = array('menu' => $this->_menu, 'title' => 'Dashboard', 'description' => '', 'breadcrumb' => array('Dashboard' => '/')); // New payment that need confirmation $data['payments'] = Payment::with(array('user', 'donations'))->where('status', '=', 0)->get(); // New social target that need confirmation $data['social_targets'] = SocialTarget::with(array('city', 'category', 'user'))->where('status', '=', 0)->get(); // New action action that need confirmation $data['social_actions'] = SocialAction::with(array('city', 'category', 'user'))->where('status', '=', 0)->get(); // New event that need confirmation $data['events'] = Events::with(array('city', 'category', 'user'))->where('status', '=', 0)->get(); // New report that need confirmation $reports = Report::with(array('user'))->where('have_responded', '=', 0)->get(); foreach ($reports as $report) { $report->setAppends(array('type')); } $data['reports'] = $reports; // return $data; return View::make('admin.pages.dashboard')->with($data); }
public function getReadReport($id) { $report = Report::with('user')->find($id); $report->solved = '1'; $report->save(); return View::make('admin/reports/read')->with('title', 'Full Report')->with('report', $report); }
public function action_index() { $per_page = 5; $reports = Report::with('project')->order_by('date', 'desc')->paginate($per_page); return View::make('report.index')->with('reports', $reports); }