public static function getDepartmentArrayWithUnknown() { $department = department::all(); $results = array(); $results['0'] = 'ไม่ระบุ'; foreach ($department as $d) { $results[$d->departmentId] = $d->departmentName; } return $results; }
public function addHospitalStaffShow() { $department = department::all(); $depList = array(); foreach ($department as $item) { $depList[$item['departmentId']] = $item['departmentName']; } return view('staff/addStaffByStaff')->with('department', $depList); }
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; }