public function index() { $data['classes'] = Classallocation::where('academicterm', $this->system->currentacademicterm)->where('instructor', Auth::user()->id)->get(); $data['system'] = $this->system; $data['acam'] = Academicterm::find($this->system->currentacademicterm); return view(Api::getView(), $data); }
public function index() { $data['system'] = $this->system; $data['acam'] = Academicterm::findOrFail($this->system->phaseterm); $data['rooms'] = Classroom::paginate(15); return view(Api::getView(), $data); }
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 out_section() { DB::table('out_section')->truncate(); $tt = Academicterm::find($this->system->phaseterm); $term = $tt->term; $acamd = Academicterm::where('systart', '<=', $tt->systart)->orderBy('systart', 'DESC')->orderBy('term', 'ASC')->get(); }
function manage_curriculum() { $c = DB::table('tbl_coursemajor')->get(); $acam = Academicterm::all(); $owner = Api::getCollege(); $cur = DB::select("SELECT a.id as cur_id, a.description as cur_description, a.academicterm as cur_academicterm,\n b.description as c_description\n FROM tbl_curriculum a, tbl_course b, tbl_coursemajor c\n WHERE a.coursemajor = c.id AND b.id = c.course AND b.college = {$owner}"); return view(Api::getView(), ['c' => $c, 'acam' => $acam, 'cur' => $cur]); }
function login($request) { $username = $request->username; $password = $request->password; $validator = Validator::make($request->all(), ['username' => 'required', 'password' => 'required']); if (!$validator->fails()) { if (Auth::attempt(['username' => $username, 'password' => $password])) { $system = Api::systemValue(); $sy = Academicterm::find($system->currentacademicterm); $ses = ['current_sy' => $sy->systart . '-' . $sy->syend, 'term' => $sy->term, 'phaseterm' => $system->phaseterm]; Session::put($ses); return redirect('/'); } else { return view('index', ['error' => htmlAlert('Authentication Failed')]); } } else { return view('index', ['error' => '']); } }
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); }