Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 public static function getInstructorsSched($id)
 {
     $sy = Session::get('phaseterm');
     $classes = Classallocation::where('academicterm', $sy)->where('instructor', $id)->get();
     $data = [];
     foreach ($classes as $class) {
         $d = self::where('classallocation', $class->id)->get();
         foreach ($d as $dd) {
             $data[] = $dd;
         }
     }
     return $data;
 }
Exemplo n.º 3
0
 public function getSchedRoom($room, $system)
 {
     $classes = Classallocation::where('academicterm', $system->phaseterm)->get();
     foreach ($classes as $class) {
         if ($this->ctr > count($this->color) - 1) {
             $this->ctr = 0;
         }
         $dayperiods = Day_period::where('classallocation', $class->id)->where('classroom', $room)->get();
         $this->getSched($dayperiods, $class);
         $this->ctr++;
     }
     return $this->returnCollection();
 }
Exemplo n.º 4
0
 public function show($id)
 {
     $inst = Party::find($id);
     if ($inst instanceof ModelNotFoundException) {
         return view('errors.404');
     }
     $data['instructor'] = $inst;
     $data['classes'] = Classallocation::where('academicterm', $this->system->phaseterm)->where('instructor', $id);
     $data['days'] = Day::where('id', '!=', 8)->get();
     $data['times'] = Time::all();
     $schedCollection = new SchedCollection();
     $data['table_day'] = $schedCollection->getSchedInstructor($id, $this->system);
     return view('instructor.sched', $data);
 }
Exemplo n.º 5
0
 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);
 }
Exemplo n.º 6
0
 function init()
 {
     $data['val'] = '';
     if ($this->system->phaseterm == env('FIN')) {
         $stat = $this->system->classallocationstatus;
         if ($stat == 2 or $stat == 1) {
             $c = DB::table('tbl_completion')->where('stage', 2)->where('academicterm', $system->phaseterm)->where('status', 'O');
             if ($c == env('COLLEGE_COUNT')) {
                 // update the systemvalues
                 DB::table('tbl_systemvalues')->update(['classallocationstatus' => 3]);
                 // delete classallocation for this phaseterm
                 Classallocation::where('academicterm', $system->phaseterm)->delete();
                 $sec = DB::table('out_section')->get();
                 foreach ($sec as $section) {
                     // if the section is zero it will not satisfy this condition
                     for ($i = 1; $i <= $section->section; $i++) {
                         $class = new Classallocation();
                         $class->academicterm = $section->academicterm;
                         $class->coursemajor = $section->coursemajor;
                         $class->subject = $section->subject;
                         $class->instructor = 0;
                         $class->reserved = 0;
                         $class->enrolled = 0;
                         $class->save();
                     }
                 }
                 $data['val'] = 'OK';
             } else {
                 $data['val'] = 'college count';
             }
         } else {
             $data['val'] = 'cannot run';
         }
     } else {
         $data['val'] = 'cannot run in this phase';
     }
     return view('edp.initClass', $data);
 }