public function overview()
 {
     $departments = Department::select('id', 'name', 'icon')->where('hospital_id', $this->hospital_id)->get();
     if ($departments) {
         $this->set_template('hospital.department.overview');
         $this->set_data(array('departments' => $departments));
     } else {
         $this->set_error_code($this->not_found_error_code);
     }
     return $this->response();
 }
Ejemplo n.º 2
0
 public static function getCollPrograms($collegeid)
 {
     $departments = Department::select('unitid')->where('parentunitid', $collegeid)->groupBy('unitid')->get();
     $departmentids = [];
     foreach ($departments as $department) {
         array_push($departmentids, $department->unitid);
     }
     $programs = Program::select('programid')->whereIn('unitid', $departmentids)->where('degreelevel', 'U')->groupBy('programid')->get();
     $programids = [];
     foreach ($programs as $program) {
         array_push($programids, $program->programid);
     }
     return $programids;
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $batches = [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009];
     $allStudents = [];
     $departments = Department::select('unitid')->get();
     foreach ($departments as $department) {
         $departmentid = $department->unitid;
         foreach ($batches as $batch) {
             $allStudents[$batch] = Studentterm::getBatchStudentsDepartment($batch * 100000, $departmentid);
         }
         $this->seedEmployment($batches, $allStudents, $departmentid);
         $this->seedGrades($batches, $allStudents, $departmentid);
         $this->seedStbracket($batches, $allStudents, $departmentid);
         $this->seedRegion($batches, $allStudents, $departmentid);
         $this->seedUnemployment($batches, $allStudents, $departmentid);
         $this->seedHighGrades($batches, $allStudents, $departmentid);
         $this->seedOverload($batches, $allStudents, $departmentid);
         $this->seedUnits($batches, $allStudents, $departmentid);
     }
 }
Ejemplo n.º 4
0
 public function department()
 {
     $pages = Department::select(array('id_dept', 'nm_dept'));
     return Datatables::of($pages)->make();
 }