예제 #1
0
 public static function getDepartmentArrayWithUnknown()
 {
     $department = department::all();
     $results = array();
     $results['0'] = 'ไม่ระบุ';
     foreach ($department as $d) {
         $results[$d->departmentId] = $d->departmentName;
     }
     return $results;
 }
예제 #2
0
 public function addHospitalStaffShow()
 {
     $department = department::all();
     $depList = array();
     foreach ($department as $item) {
         $depList[$item['departmentId']] = $item['departmentName'];
     }
     return view('staff/addStaffByStaff')->with('department', $depList);
 }
예제 #3
0
 public function createAppointmentByStaffShow($patientId)
 {
     $patient = patient::where('userId', $patientId)->first();
     $department = department::all();
     $depList = array();
     $depList['0'] = 'ไม่ระบุ';
     foreach ($department as $item) {
         $depList[$item['departmentId']] = $item['departmentName'];
     }
     $doctor = department::getDoctorArray();
     return view('staff.createAppointmentForPatient2')->with('patient', $patient)->with('department', $depList)->with('doctor', $doctor);
 }
 public static function getDepartmentsOptions()
 {
     $departments = department::all();
     $output = "<option value = ''>Any department</option>";
     foreach ($departments as $department) {
         $selected = isset($_POST['department']) && $_POST['department'] == $department->id ? "selected" : "";
         $output .= "<option " . $selected . " value = '" . $department->id . "'>" . $department->department . "</option>";
     }
     echo $output;
 }