function dayPeriod_list() { $data['owner'] = $this->owner; $data['system'] = $this->system; if ($this->owner == 1) { $subject_owner = Subject::where('nstp', 0)->where(function ($query) { $query->where('owner', 1)->orWhere('gessubject', 1); })->where('computersubject', 0)->where('nstp', 0)->get(); } elseif ($this->system->employeeid == Auth::user()->id) { $subject_owner = Subject::where('gesubject', 0)->where(function ($query) { $query->where('computersubject', 1)->orWhere('nstp', 1); })->get(); } else { $subject_owner = Subject::where('nstp', 0)->where('owner', $this->owner)->where('computersubject', 0)->where('gesubject', 0)->get(); } $data['subject'] = $subject_owner; if ($this->system->classallocationstatus != 3) { $data['val'] = 'class not init'; } else { $s = DB::table('tbl_completion')->where('stage', 4)->where('completedby', Auth::user()->id)->count(); if ($s > 1) { $data['val'] = 'attested'; } else { $data['sub'] = Classallocation::getAlloc($this->owner, $this->system); } } $t = Academicterm::find($this->system->phaseterm); $term = DB::table('tbl_term')->where('id', $t->term)->first(); $data['acam'] = $t->systart . ' - ' . $t->syend . ' Term: ' . $term->shortname; return view('dean.add_day_period', $data); }
function index() { $status = $this->system->classallocationstatus; $data['system'] = $this->system; if ($status == 99) { if (Auth::user()->id != $this->system->employeeid) { $data['college'] = DB::table('tbl_college')->where('id', $this->owner)->first(); } $data['instruc'] = $this->instructors(); $otherAcademic = DB::table('tbl_academic')->where('college', '!=', '')->where('college', '!=', $this->owner)->select('id')->get(); $otherAdminist = DB::select("SELECT a.id as id FROM tbl_administration a,tbl_office b WHERE a.office = b.id AND b.college != ''"); $data['otherInst'] = array_merge($otherAcademic, $otherAdminist); $data['acam'] = Academicterm::find(Session::get('phaseterm')); $data['sy'] = Academicterm::orderBy('systart')->orderBy('term')->get(); $data['classes'] = Classallocation::getAlloc($this->owner, $this->system); $data['val'] = 'valid'; } else { $data['val'] = 'not valid status'; } return view(Api::getView(), $data); }