/**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(DoctorRequest $request)
 {
     //
     $doctor = new Doctor($request->all());
     $doctor->save();
     return redirect('pis/doctor');
 }
示例#2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     DB::beginTransaction();
     $request['role'] = 'doctor';
     $result = $this->register($request);
     $value = $result->getData();
     if (property_exists($value, 'error')) {
         return $result;
     } else {
         $doctor = new Doctor();
         $doctor['userId'] = $value->result->id;
         $doctor['contactNumber'] = $request->input('contactNumber');
         $doctor['firstname'] = $request->input('firstname');
         $doctor['lastname'] = $request->input('lastname');
         try {
             $doctor->save();
         } catch (\Exception $e) {
             DB::rollback();
             return response()->json(['error' => ['message' => 'Error while saving Doctor', 'code' => 400]]);
         }
         DB::commit();
         $finalResult['id'] = $value->result->id;
         $finalResult['token'] = $value->result->token;
         return response()->json(['result' => $finalResult]);
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     $data = $request->except('_token');
     $rules = ['name' => 'required', 'email' => 'email|unique:users,email|required', 'city' => 'required'];
     $message = ['required' => 'The :attribute field is required.', 'unique' => 'Existing Mail.'];
     $validator = Validator::make($data, $rules, $message);
     if ($validator->fails()) {
         $messages = $validator->messages();
         return Redirect::route('doctor.create')->withErrors($validator)->withInput();
     }
     $doctors = new Doctor();
     $file = $data['filefield'];
     $extension = $file->getClientOriginalExtension();
     $filename = $file->getFilename() . '.' . $extension;
     //Storage::disk('local')->put($file->getFilename().'.'.$extension,  File::get($file));
     $destination = 'images/';
     $file->move($destination, $filename);
     $doctors->doctor_name = $data["name"];
     $doctors->doctor_address = $data["address"];
     $doctors->doctor_ph = $data['phone'];
     $doctors->doctor_email = $data['email'];
     $doctors->city_id = $data['city'];
     $doctors->degree = $data['degree'];
     $doctors->specialist = $data['special'];
     $doctors->mime = $file->getClientMimeType();
     $doctors->photo = $file->getFilename() . '.' . $extension;
     $doctors->save();
     $alldoc = DB::select(DB::raw("select doctors.*,cities.city_name from doctors inner join cities on doctors.city_id=cities.id "));
     return View::make('doctors.all')->with(compact('alldoc'));
 }
示例#4
0
 public static function storeDoctor($request)
 {
     $newLead = new Doctor();
     $newLead->name = $request->get('name');
     $newLead->field = $request->get('field');
     $newLead->save();
     return redirect()->back()->with('message', 'Doctor was successfuly saved');
 }
示例#5
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('doctors')->delete();
     $doctor = new Doctor(['empId' => '2001', 'deptId' => '1', 'salary' => '90000']);
     $doctor->save();
     $doctor = new Doctor(['empId' => '2002', 'deptId' => '1', 'salary' => '120000']);
     $doctor->save();
     $doctor = new Doctor(['empId' => '2003', 'deptId' => '2', 'salary' => '85000']);
     $doctor->save();
     $doctor = new Doctor(['empId' => '2004', 'deptId' => '3', 'salary' => '90000']);
     $doctor->save();
 }
示例#6
0
 /**
  * Show the application welcome screen to the user.
  *
  * Api for the application
  * 
  * @return Json response
  */
 public function index()
 {
     if (Request::get('task') == "doctorCity") {
         $city = Request::get('city');
         if (is_null($city)) {
             return response()->json(['message' => 'you should pass the paramater city', 'code' => 'error']);
         }
         $doctors = null;
         $doctors = Doctor::where('city', 'LIKE', "%{$city}%")->select('first_name', 'last_name', 'specialization', 'hospital', 'phone')->get();
         return response()->json(['doctors' => $doctors, 'code' => 'ok', 'count' => sizeof($doctors)]);
     } elseif (Request::get('task') == "doctorspecialization") {
         $specialization = Request::get('specialization');
         if (is_null($specialization)) {
             return response()->json(['message' => 'you should pass the paramater specialization', 'code' => 'error']);
         }
         $doctors = null;
         $doctors = Doctor::where('specialization', 'LIKE', "%{$specialization}%")->select('first_name', 'last_name', 'specialization', 'hospital', 'phone')->get();
         return response()->json(['doctors' => $doctors, 'code' => 'ok', 'count' => sizeof($doctors)]);
     } elseif (Request::get('task') == "doctorhospital") {
         $hospital = Request::get('hospital');
         if (is_null($hospital)) {
             return response()->json(['message' => 'you should pass the paramater hospital', 'code' => 'error']);
         }
         $doctors = null;
         $doctors = Doctor::where('hospital', 'LIKE', "%{$hospital}%")->select('first_name', 'last_name', 'specialization', 'hospital', 'phone')->get();
         return response()->json(['doctors' => $doctors, 'code' => 'ok', 'count' => sizeof($doctors)]);
     } else {
         return response()->json(['message' => 'you should pass the paramater task', 'code' => 'error']);
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $province_id = Input::get('province_id');
     $city_id = Input::get('city_id');
     $specialization_id = Input::get('specialization_id');
     $verified = Input::get('verified');
     $data = array();
     if (empty($province_id) && empty($city_id) && empty($specialization_id) && empty($verified)) {
         //menampilkan semua gender
         $data['content'] = \App\Doctor::all();
         $data['province_id'] = null;
         $data['city_id'] = null;
         $data['specialization_id'] = null;
         $data['verified'] = null;
     } else {
         $data['content'] = $data['province_id'] = $province_id;
         $data['city_id'] = $city_id;
         $data['specialization_id'] = $specialization_id;
         $data['verified'] = $verified;
     }
     $data['list_province'] = \App\Province::lists('name', 'id');
     $data['list_city'] = \App\City::lists('name', 'id');
     $data['list_specialization'] = \App\Specialization::lists('name', 'id');
     return view('pages.admin.clinic.doctor.index')->with('data', $data);
 }
示例#8
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     if (App::environment() === 'production') {
         exit('Do not seed in production environment');
     }
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     // disable foreign key constraints
     DB::table('users')->truncate();
     DB::table('volunteers')->truncate();
     DB::table('doctors')->truncate();
     User::create(['id' => 1, 'name' => 'admin', 'email' => '*****@*****.**', 'password' => '$2y$10$zJxQkCB6UNr9zzLIgve71ekLMEcOWue/lKuyCtunV559qN2NDV1ra', 'roleId' => 2]);
     User::create(['id' => 2, 'name' => 'volunteer1', 'email' => '*****@*****.**', 'password' => '$2y$10$zJxQkCB6UNr9zzLIgve71ekLMEcOWue/lKuyCtunV559qN2NDV1ra', 'roleId' => 5]);
     User::create(['id' => 3, 'name' => 'Arun', 'email' => '*****@*****.**', 'password' => '$2y$10$zJxQkCB6UNr9zzLIgve71ekLMEcOWue/lKuyCtunV559qN2NDV1ra', 'roleId' => 4]);
     User::create(['id' => 4, 'name' => 'Biswas', 'email' => '*****@*****.**', 'password' => '$2y$10$zJxQkCB6UNr9zzLIgve71ekLMEcOWue/lKuyCtunV559qN2NDV1ra', 'roleId' => 4]);
     User::create(['id' => 5, 'name' => 'Sunil', 'email' => '*****@*****.**', 'password' => '$2y$10$zJxQkCB6UNr9zzLIgve71ekLMEcOWue/lKuyCtunV559qN2NDV1ra', 'roleId' => 4]);
     User::create(['id' => 6, 'name' => 'volunteer2', 'email' => '*****@*****.**', 'password' => '$2y$10$zJxQkCB6UNr9zzLIgve71ekLMEcOWue/lKuyCtunV559qN2NDV1ra', 'roleId' => 5]);
     Volunteer::create(['userId' => 3, 'firstname' => 'volunteer1', 'lastname' => 'volunteer1', 'contactNumber' => '9717017651', 'isVerified' => true]);
     Volunteer::create(['userId' => 6, 'firstname' => 'volunteer2', 'lastname' => 'volunteer2', 'contactNumber' => '9717017650', 'isVerified' => true]);
     Doctor::create(['userId' => 3, 'firstname' => 'Arun', 'lastname' => 'Jain', 'contactNumber' => '9717017650', 'specialization' => 1, 'location' => 'Delhi', 'isVerified' => true]);
     Doctor::create(['userId' => 4, 'firstname' => 'Biswas', 'lastname' => 'Rao', 'contactNumber' => '9717017651', 'specialization' => 2, 'location' => 'Bangalore', 'isVerified' => true]);
     Doctor::create(['userId' => 5, 'firstname' => 'Sunil', 'lastname' => 'Jain', 'contactNumber' => '9717017651', 'specialization' => 2, 'location' => 'Bangalore', 'isVerified' => true]);
     DB::statement('SET FOREIGN_KEY_CHECKS = 1');
     // enable foreign key constraints
 }
示例#9
0
 public function edit_indoor_patient_report($id)
 {
     $indoor_report = Indoor_patient::whereId($id)->firstOrFail();
     $doctors = Doctor::all();
     $gender = $indoor_report->gender;
     $xray = $indoor_report->digital_xray;
     $ultra = $indoor_report->ultrasonogram;
     $ecg = $indoor_report->ecg;
     $decg = $indoor_report->digital_ecg;
     $endoccopy = $indoor_report->endoscopy;
     $bloodgrp = $indoor_report->blood_grouping;
     $bloodcs = $indoor_report->blood_cs;
     $bloodcbc = $indoor_report->blood_cbc;
     $urine = $indoor_report->urine;
     $hbsnrmal = $indoor_report->hbs_normal;
     $ctscan = $indoor_report->ct_scan;
     $stool = $indoor_report->stool;
     $operation_bill = $indoor_report->operation_bill;
     $dr_bill = $indoor_report->dr_bill;
     $service_bill = $indoor_report->service_bill;
     $medicine_bill = $indoor_report->medicine_bill;
     $cabin_bill = $indoor_report->cabin_bill;
     $others_bill = $indoor_report->others_bill;
     return view('Indoor.edit_report', compact('indoor_report', 'total', 'commision_amount', 'gender', 'ind_patient_id', 'xray', 'ultra', 'ecg', 'decg', 'endoccopy', 'bloodgrp', 'bloodcs', 'bloodcbc', 'urine', 'hbsnrmal', 'ctscan', 'stool', 'doctors', 'id'));
 }
示例#10
0
 public function util_keepresult(Request $request)
 {
     $docname = $request->newdocname;
     $docdep = $request->newdocdep;
     $doctorsarray = Doctor::where(['doctor_name' => $docname, 'department_id' => $docdep])->get();
     return view('admin/doctor/doctor')->with('doctors', $doctorsarray);
 }
 public function loginDoctor(Request $request)
 {
     try {
         $doctor = new Doctor();
         $doctor->strUsername = $request->strUsername;
         $doctor->strPassword = $request->strPassword;
         $status = $doctor->login();
         if ($status === "success") {
             session()->put('doctorId', $doctor->getIdByUsername());
             return redirect()->action('PatientController@getAllPatient');
         } else {
             return view('landing');
         }
     } catch (Exception $e) {
         dd($e);
     }
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $doctors = Doctor::select(DB::raw("CONCAT(doctor_fname,' ', doctor_mname,' ',doctor_lname,' - ',(select med_specialty from medspecialties where id = medspecialty_id) ) AS full_name, id"))->lists('full_name', 'id');
     $beds = Bed::vacant();
     $visit_type = array('in_patient' => 'in patient', 'out_patient' => 'out patient');
     //dd($doctors,$beds);
     return view('pages.Visit.admit', compact('doctors', 'beds', 'visit_type'));
 }
示例#13
0
 public function activateAccount($code)
 {
     $doctor = Doctor::where('activation_code', $code)->first();
     if ($doctor) {
         $doctor->update(['verified' => 1, 'activation_code' => NULL]);
         Auth::login($doctor);
         return true;
     }
 }
示例#14
0
 public function approveDoctor($doctorId)
 {
     try {
         Doctor::where('userId', $doctorId)->update(['isVerified' => true]);
     } catch (\Exception $e) {
         return array('error' => ['message' => 'Error in updating object', 'code' => 101]);
     }
     return response()->json(['result' => 'success']);
 }
示例#15
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $data = [];
     $data['article'] = ArticleCategory::with('articles')->get();
     $data['content'] = Schedule::find($id);
     $data['doctor'] = Doctor::whereHas('clinics', function ($q) {
         $q->where('clinic.id', Auth::user()->clinic->id);
     })->orderBy('name')->get();
     return view('frontend.pages.clinic.schedule-update', compact('data'));
 }
示例#16
0
 public function fuzzyQuery(Request $request)
 {
     $this->validate($request, ['keyword' => 'required|max:255']);
     $keyword = $request->get('keyword');
     $hospitals = Hospital::where('hospital_name', 'like', "%{$keyword}%")->orwhere('city', 'like', "%{$keyword}%")->orwhere('hospital_level', 'like', "%{$keyword}%")->orwhere('description', 'like', "%{$keyword}%")->get();
     $departments = Department::where('department_name', 'like', "%{$keyword}%")->orwhere('department_description', 'like', "%{$keyword}%")->get();
     $doctors = Doctor::where('doctor_name', 'like', "%{$keyword}%")->orwhere('doctor_level', 'like', "%{$keyword}%")->orwhere('doctor_description', 'like', "%{$keyword}%")->get();
     $response = ['hospitals' => $hospitals, 'department' => $departments, 'doctors' => $doctors];
     return json_encode($response);
 }
示例#17
0
 public function searchProfile($name)
 {
     $name = urldecode($name);
     $data = array();
     $data['article'] = \App\ArticleCategory::with('articles')->get();
     $data['content'] = \App\Doctor::where('name', 'like', '%' . $name . '%')->first();
     if (empty($data['content'])) {
         return redirect()->route('home');
     }
     $data['schedule'] = [];
     for ($i = 0; $i <= 7; $i++) {
         $data['schedule'][$i] = [];
     }
     $schedules = \App\Schedule::where('doctor_id', $data['content']->id)->whereBetween('date', array(date("Y-m-d"), date("Y-m-d", strtotime("+1 week"))))->orderBy('date', 'asc')->orderBy('schedule_start', 'asc')->get();
     foreach ($schedules as $schedule) {
         $len = 60 * 60 * 24;
         $now = date("Y-m-d");
         $tmp = $schedule->date;
         if ((strtotime($tmp) - strtotime($now)) / $len == 0) {
             array_push($data['schedule'][0], $schedule);
         } else {
             if ((strtotime($tmp) - strtotime($now)) / $len == 1) {
                 array_push($data['schedule'][1], $schedule);
             } else {
                 if ((strtotime($tmp) - strtotime($now)) / $len == 2) {
                     array_push($data['schedule'][2], $schedule);
                 } else {
                     if ((strtotime($tmp) - strtotime($now)) / $len == 3) {
                         array_push($data['schedule'][3], $schedule);
                     } else {
                         if ((strtotime($tmp) - strtotime($now)) / $len == 4) {
                             array_push($data['schedule'][4], $schedule);
                         } else {
                             if ((strtotime($tmp) - strtotime($now)) / $len == 5) {
                                 array_push($data['schedule'][5], $schedule);
                             } else {
                                 if ((strtotime($tmp) - strtotime($now)) / $len == 6) {
                                     array_push($data['schedule'][6], $schedule);
                                 } else {
                                     if ((strtotime($tmp) - strtotime($now)) / $len == 7) {
                                         array_push($data['schedule'][7], $schedule);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return view('frontend.pages.home.search-profile', compact('data'));
 }
 public function post_register(DoctorRegRequest $request)
 {
     //
     $input = $request->all();
     $password = bcrypt($request->input('password'));
     $input['password'] = $password;
     $input['activation_code'] = str_random(60) . $request->input('email');
     $register = \App\Doctor::create($input);
     $data = ['first_name' => $input['first_name'], 'last_name' => $input['last_name'], 'code' => $input['activation_code']];
     $this->sendEmail($data, $input);
     Session::flash('success', "Cek email untuk mengaktivasi akun");
     return redirect()->route('doctor.register');
 }
示例#19
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($lead)
 {
     // send pusher event
     if ($lead->active == 0) {
         event(new LeadAccessed($lead));
     }
     // update lead's active to 1
     $lead->active = 1;
     $lead->save();
     $doctors = Doctor::all();
     $dispositions = Disposition::all();
     return view('lead.show', compact('lead', 'doctors', 'dispositions'));
 }
示例#20
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $wanted = user::where('id', $id)->first();
     if (is_null($wanted)) {
         return "Not Found";
     } else {
         $doctor = Doctor::where('email', '=', $wanted->email)->first();
         $count = tickets::where('userid', $wanted->id)->count();
         $countAppointment = doctorSchedule::where('uid', '=', $wanted->id)->count();
         if (is_null($doctor)) {
             return view('user.profileview')->with('user', Session::get('user'))->with('viewing', $wanted)->with('ticketCount', $count)->with('appointmentCount', $countAppointment);
         } else {
             return view('user.profileview')->with('user', Session::get('user'))->with('viewing', $wanted)->with('doctor', $doctor)->with('ticketCount', $count)->with('appointmentCount', $countAppointment);
         }
     }
 }
 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     $doctor = \App\Doctor::find($this->route()->getParameter('doctor'));
     switch ($this->method()) {
         case 'GET':
         case 'DELETE':
             return [];
         case 'POST':
             return [];
         case 'PUT':
         case 'PATCH':
             return ['registration_number' => 'required|min:3', 'registration_year' => 'required', 'photo' => 'image', 'name' => 'required|min:5', 'email' => 'required|email|unique:users,email,' . $doctor->user_id, 'gender' => 'required', 'mobile' => 'required', 'address' => 'required|min:5'];
         default:
             break;
     }
 }
示例#22
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     $data = \App\User::create(['first_name' => 'Super', 'last_name' => 'Administrator', 'gender' => 'L', 'email' => '*****@*****.**', 'password' => Hash::make('1234'), 'enabled' => '1', 'verified' => '1', 'mobile' => '0812345', 'telephone' => '0312345']);
     $data->roles()->attach(1);
     $data = \App\User::create(['first_name' => 'Joko', 'last_name' => 'Lianto', 'gender' => 'L', 'email' => '*****@*****.**', 'password' => Hash::make('1234'), 'enabled' => '1', 'verified' => '1', 'mobile' => '0812345', 'telephone' => '0312345']);
     $data->roles()->attach(3);
     $data = \App\User::create(['email' => '*****@*****.**', 'password' => Hash::make('1234'), 'enabled' => '1', 'verified' => '1', 'telephone' => '0315998314']);
     \App\Clinic::create(['user_id' => $data->id, 'city_id' => 1, 'name' => 'Medical Center ITS', 'address' => 'Kompleks Poliklinik Kampus ITS Jl. Arif Rahman Hakim Surabaya', 'latitude' => '-7.2902946', 'longitude' => '112.7928178', 'telephone' => $data->telephone, 'email' => $data->email, 'password' => $data->password]);
     $data->roles()->attach(4);
     $data = \App\User::create(['email' => '*****@*****.**', 'password' => Hash::make('1234'), 'enabled' => '1', 'verified' => '1', 'telephone' => '0315998314']);
     $doctor = \App\Doctor::create(['user_id' => $data->id, 'city_id' => 1, 'specialization_id' => '1', 'name' => 'dr. Joko Lianto', 'address' => 'Kompleks Poliklinik Kampus ITS Jl. Arif Rahman Hakim Surabaya', 'latitude' => '-7.2902946', 'longitude' => '112.7928178', 'telephone' => $data->telephone]);
     $data->roles()->attach(2);
     $doctor->clinics()->attach(1);
     \App\DoctorEducation::create(['doctor_id' => $doctor->id, 'year' => '2016', 'name' => 'S1 Teknik Informatika ITS']);
 }
示例#23
0
 public function edit_report($patient_id)
 {
     $report = Patient::wherePatient_id($patient_id)->firstOrFail();
     $doctors = Doctor::all();
     $gender = $report->gender;
     $xray = $report->digital_xray;
     $ultra = $report->ultrasonogram;
     $ecg = $report->ecg;
     $decg = $report->digital_ecg;
     $endoccopy = $report->endoscopy;
     $bloodgrp = $report->blood_grouping;
     $bloodcs = $report->blood_cs;
     $bloodcbc = $report->blood_cbc;
     $urine = $report->urine;
     $hbsnrmal = $report->hbs_normal;
     $ctscan = $report->ct_scan;
     $stool = $report->stool;
     $commision = $report->commision;
     return view('outdoor.edit_report', compact('report', 'gender', 'patient_id', 'xray', 'ultra', 'ecg', 'decg', 'endoccopy', 'bloodgrp', 'bloodcs', 'bloodcbc', 'urine', 'hbsnrmal', 'ctscan', 'stool', 'doctors'));
 }
 /**
  * Shows the page of a specific Treatment to the user.
  *
  * @return show view
  */
 public function show($id)
 {
     $treatment = DoctorTreatment::findOrFail($id);
     $user = Session::get('user');
     $doctor = Doctor::findOrFail($treatment->doctor_id);
     $image1 = 1;
     $image2 = 1;
     $image3 = 1;
     $image4 = 1;
     if ($treatment->image1 == 'NONE') {
         $image1 = 0;
     }
     if ($treatment->image2 == 'NONE') {
         $image2 = 0;
     }
     if ($treatment->image3 == 'NONE') {
         $image3 = 0;
     }
     if ($treatment->image4 == 'NONE') {
         $image4 = 0;
     }
     return View::make('treatment.show')->with('treatment', $treatment)->with('user', $user)->with('image1', $image1)->with('image2', $image2)->with('image3', $image3)->with('image4', $image4)->with('doctor', $doctor);
 }
示例#25
0
 /**
  *
  * show the available slots for spefic doctor
  * @return view
  */
 public function show($id)
 {
     $doctor = null;
     $userRequested = null;
     $doctor = Doctor::where('id', $id)->first();
     if (!is_null($doctor)) {
         $userRequested = user::where('email', '=', $doctor->email)->first();
         if (!is_null($userRequested)) {
             $timeSlots = Timeslots::where('doctor_id', '=', $doctor->id)->first();
             if (!is_null($timeSlots) && $doctor->available == 1) {
                 //getting the time period
                 $period = explode(".", $timeSlots->period);
                 if (count($period) != 2) {
                     return view('user.appointmetns.place')->with('user', Session::get('user'))->with('userReq', $userRequested)->with('doctor', $doctor);
                 }
                 $periodMinutes = $period[1];
                 $periodHours = $period[0];
                 $periodMinutes = $periodMinutes + $periodHours * 60;
                 // end of the processing the time format initialiation
                 $dt = Carbon::now('Asia/Colombo');
                 $dt->second = 0;
                 //$dt = Carbon::parse('2012-9-6 23:26:11.123789');
                 $dayCount = 0;
                 $dt->addDays(2);
                 $timetable = array();
                 $timevals = array();
                 while ($dayCount < 7) {
                     $day = array();
                     if ($dt->dayOfWeek == 1) {
                         //echo "monday<br>";
                         $day = $this->stringDateToArray($timeSlots->monday);
                     } elseif ($dt->dayOfWeek == 2) {
                         $day = $this->stringDateToArray($timeSlots->tuesday);
                         //echo "tuesday<br>";
                     } elseif ($dt->dayOfWeek == 3) {
                         $day = $this->stringDateToArray($timeSlots->wednesday);
                         //echo "wedensday<br>";
                     } elseif ($dt->dayOfWeek == 4) {
                         $day = $this->stringDateToArray($timeSlots->thursday);
                         //echo "Thursday<br>";
                     } elseif ($dt->dayOfWeek == 5) {
                         $day = $this->stringDateToArray($timeSlots->friday);
                         //echo "Friday<br>";
                     } elseif ($dt->dayOfWeek == 6) {
                         $day = $this->stringDateToArray($timeSlots->saturday);
                         //echo "Saturday<br>";
                     } elseif ($dt->dayOfWeek == 0) {
                         $day = $this->stringDateToArray($timeSlots->sunday);
                         //echo "Sunday<br>";
                     }
                     if (count($day) != 4) {
                         $dt->addDay();
                         $dayCount++;
                         continue;
                     }
                     $cancelTimeDb = cancelSlots::where('did', '=', $doctor->id)->where('slotdate', '=', $dt->toDateString())->first();
                     $tempCancel = $this->stringDateToArray("0.00-0.00");
                     if (!is_null($cancelTimeDb)) {
                         $tempCancel = $this->stringDateToArray($cancelTimeDb->time);
                         if (count($tempCancel) != 4) {
                             $tempCancel = $this->stringDateToArray("0.00-0.00");
                         }
                     }
                     $key = $dt->toDateString();
                     $returnArray = array();
                     $returnArray = $this->timeCal($day, $tempCancel, $periodMinutes, $dt, $doctor->id);
                     //$timetable[$key]=$this->timeCal($day,$tempCancel,$periodMinutes,$dt,$doctor->id);
                     $timetable[$key] = $returnArray['times'];
                     $timevals[$key] = $returnArray['vals'];
                     $dt->addDay();
                     $dayCount++;
                 }
                 Session::put('requestedDoctor', $doctor->id);
                 Session::put('timeval', $timevals);
                 return view('user.appointmetns.place')->with('user', Session::get('user'))->with('userReq', $userRequested)->with('doctor', $doctor)->with('timetable', $timetable)->with('timevals', $timevals);
             } else {
                 return view('user.appointmetns.place')->with('user', Session::get('user'))->with('userReq', $userRequested)->with('doctor', $doctor);
             }
             return view('user.appointmetns.place')->with('user', Session::get('user'))->with('userReq', $userRequested)->with('doctor', $doctor);
         }
     }
     return view('user.appointmetns.place')->with('user', Session::get('user'));
 }
 public function getIdByUsername()
 {
     $doctor = Doctor::where('strUsername', $this->strUsername)->first();
     return $doctor->doctorId;
 }
示例#27
0
 public function delete_doctor($dr_id)
 {
     $doctor = Doctor::whereDr_id($dr_id)->firstOrFail();
     $doctor->delete();
     return redirect('/all_doctors')->with('status', 'Information of doctor has been deleted!');
 }
示例#28
0
 public function experience($id)
 {
     $doctor = \App\Doctor::find($id);
     return view('frontend.pages.clinic.doctor.experience', compact('doctor'));
 }
示例#29
0
 /**
  * Get all popular doctors.
  *
  * @param Request $request
  *
  * @return string
  */
 public function getPopular(Request $request)
 {
     $this->validate($request, ['num' => 'integer|min:1']);
     $num = $request->get('num');
     if (empty($num)) {
         $num = 10;
     }
     return Doctor::popular($num)->get();
 }
 public function fullname($id)
 {
     $doctor = Doctor::select(\DB::raw("CONCAT(doctor_fname,' ', doctor_mname,' ',doctor_lname) AS full_name"))->where('id', '=', $id)->lists('full_name')->first();
     return $doctor;
 }