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 new_student() { $data['courses'] = Course::all(); $data['majors'] = DB::table('tbl_major')->get(); $data['religions'] = DB::table('tbl_religion')->get(); return view(Api::getView(), $data); }
function save_instructor(Request $request) { $acam = Session::get('phaseterm'); $instructor = $request->instructor; $class_id = $request->cl_id; // no point if the instructor = 0 if ($instructor != 0) { $time = Time::getPeriod($class_id); $day = Day::getShortDay($class_id); $conflict = Api::checkInstructor($instructor, $time, $day); if ($conflict == false) { $class = Classallocation::find($class_id); $class->instructor = $instructor; $class->save(); if ($request->ajax == 0) { Session::flashdata('message', htmlAlert('Successfully Assigned', 'success')); return back(); } } else { if ($request->ajax == 0) { Session::flashdata('message', htmlAlert('Conflict')); return back(); } else { echo 'conflict'; } } } else { if ($request->ajax == 0) { Session::flashdata('message', htmlAlert('Please Select a instructor')); return back(); } else { echo 'no'; } } }
public function index() { $data['system'] = $this->system; $data['acam'] = Academicterm::findOrFail($this->system->phaseterm); $data['rooms'] = Classroom::paginate(15); return view(Api::getView(), $data); }
public function index() { $common = $this->commonQuery(); $data['courses'] = $common['course']; $data['majors'] = $common['majors']; $data['religions'] = $common['religions']; return view(Api::getView(), $data); }
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 show($id) { $subject_id = Subjects::findOrFail($id); $owner = Api::getCollege(); if ($subject_id instanceof ModelNotFoundException) { return view('errors.404'); } return view('dean.subject', ['subject' => $subject_id, 'owner' => $owner]); }
public function store(Request $request) { // TODO: recent coursemajor must not match wil the current coursemajor $system = Api::systemValue(); $coursemajor = DB::table('tbl_coursemajor')->where('course', $request->course)->where('major', $request->major)->first(); $registration = new Registration(); $registration->coursemajor = $coursemajor->id; $registration->student = $request->student; $registration->academicterm = $system->currentacademicterm; $registration->status = 'P'; $registration->curriculum = Curriculum::getCurrentCurriculum($request->course, $request->major, $system); $registration->datecreated = date('Y-m-d'); $registration->save(); Session::flashdata('message', htmlAlert('Successfully Saved', 'success')); return redirect('shift_student'); }
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' => '']); } }
public function index() { $status = $this->system->classallocationstatus; $data['system'] = $this->system; if ($status == 4) { $c = DB::table('tbl_completion')->where('academicterm', $this->system->phaseterm)->where('stage', 4)->where('status', 'O')->count(); if ($c == env('COLLEGE_COUNT')) { $data['val'] = 'ok'; $data['class'] = Classallocation::where('academicterm', $this->system->phaseterm)->get(); } else { $data['colleges'] = DB::table('tbl_college')->where('id', '!=', 6)->get(); $data['val'] = 'you cannot continue'; } } elseif ($status == 3) { $data['colleges'] = DB::table('tbl_college')->where('id', '!=', 6)->get(); $data['val'] = 'you cannot continue'; } else { $data['colleges'] = DB::table('tbl_college')->where('id', '!=', 6)->get(); $data['val'] = 'not yet'; } return view(Api::getView(), $data); }
function __construct() { $this->system = Api::systemValue(); $this->owner = Api::getCollege(); }
public function index() { $data['registrations'] = Registration::pending()->paginate(15); return view(Api::getView(), $data); }
function __construct() { $this->middleware('auth'); $this->system = Api::systemValue(); }
function __construct() { $this->middleware('auth'); $this->owner = Api::getCollege(); $this->system = Api::systemValue(); }
function __construct() { $this->system_value = Api::systemValue(); }