Exemplo n.º 1
0
 public function for_print_rpt1_non_gov_drop_grad($id)
 {
     $user = Auth::user();
     $region = Region::findOrFail($user->region_id);
     $report_date = ReportDate::findOrFail($id);
     $rpt1 = new RTAReport1NonGovernment($report_date->id, $user->region_id);
     // get occupations
     $occupations = Occupation::whereIn('id', DropoutGraduate::select('occupation_id')->where('report_date_id', $id)->whereIn('institution_id', Institution::select('id')->where('region_id', $region->id)->where('ownership', '!=', 'Public')->lists('id'))->lists('occupation_id'))->orderBy('name')->get();
     // get sectors
     $sectors = Sector::whereIn('id', Subsector::select('sector_id')->whereIn('id', $occupations->lists('subsector_id'))->get())->get();
     // get subsectors
     $subsectors = Subsector::whereIn('id', $occupations->lists('subsector_id'))->get();
     return view('rtaadmin.print_rpt1nongov_7', compact('rpt1', 'region', 'report_date', 'sectors', 'subsectors', 'occupations'));
 }