Пример #1
0
 public function manage()
 {
     $expertId = Session::get('expert_id');
     if (!isset($expertId)) {
         return Redirect::to('/');
     }
     $appointment_count = Appointment::where('expert_id', '=', $expertId)->where('status', '=', 'booked')->where('appointment_date', '>=', date('Y-m-d H:i:s'))->count();
     $availability_count = Appointment::where('expert_id', '=', $expertId)->where('status', '=', 'pending')->where('appointment_date', '>=', date('Y-m-d H:i:s'))->count();
     return View::make('expert.dashboard')->with('appointment_count', $appointment_count)->with('availability_count', $availability_count);
 }
 public function getPatientAppointmentsHistory($patient)
 {
     if (Payment::VeryPayment() == false) {
         return View::make('clinic.payment.renews-payment');
     }
     $doctor = Doctor::doctorLogin();
     $Agenda = Agenda::where('doctor_id', $doctor)->first();
     $Appointment = Appointment::where('patient_id', $patient)->where('agenda_id', $Agenda->id)->get();
     return View::make('clinic.doctor.patients.history')->with('Appointment', $Appointment);
 }
Пример #3
0
 public function verifyAppointment()
 {
     $otp = Input::get('otp');
     $email = Input::get('email');
     $phone = Input::get('phone');
     try {
         $appointment = Appointment::where('otp', '=', $otp)->where('email', '=', $email)->where('phone', '=', $phone)->firstOrFail();
         $appointment->verified = 1;
         $appointment->save();
         return Response::data($appointment);
     } catch (ModelNotFoundException $e) {
         return Response::invalid();
     }
 }
 public function showAll($requestID = null)
 {
     $user = Confide::user();
     $patient = Patient::find($requestID);
     $patient = Patient::join('user', 'user.id', '=', 'patient.user_id')->where('patient.user_id', '=', $user->id)->first();
     if ($user->isStaff() && $requestID !== null) {
         // If weare requesting a patient's appointments and we are Staff
         $appointments = Appointment::where('patient_id', '=', $requestID)->get();
         $patient = Patient::join('user', 'user.id', '=', 'patient.user_id')->where('patient.user_id', '=', $requestID)->first();
     } else {
         $appointments = Appointment::where('patient_id', '=', $user->id)->get();
     }
     foreach ($appointments as $appointment) {
         $doctor = User::find($appointment->staff_id);
         $appointment->doctor = $doctor->first_name . ' ' . $doctor->last_name;
     }
     return View::make('home/appointment/show-all', compact('user', 'appointments', 'patient'));
 }
Пример #5
0
 public function dataCancelledAppointments()
 {
     $id = Session::get('institute_id');
     $appointments = Appointment::where('institute_id', '=', $id)->where('status', '=', 'cancelled')->get();
     return $appointments;
 }
 public function getAgendaDay()
 {
     if (Payment::VeryPayment() == false) {
         return View::make('clinic.payment.renews-payment');
     }
     $id = Doctor::doctorLogin();
     $agenda = Agenda::where('doctor_id', $id)->first();
     $dt = Carbon::now();
     $bussi = Business::where('agenda_id', $agenda->id)->first()->id;
     if ($dt->dayOfWeek == 0) {
         $dia = 'Sunday';
     } elseif ($dt->dayOfWeek == 1) {
         $dia = 'Monday';
     } elseif ($dt->dayOfWeek == 2) {
         $dia = 'Tuesday';
     } elseif ($dt->dayOfWeek == 3) {
         $dia = 'Wednesday';
     } elseif ($dt->dayOfWeek == 4) {
         $dia = 'Thursday';
     } elseif ($dt->dayOfWeek == 5) {
         $dia = 'Friday';
     } else {
         $dia = 'Saturday';
     }
     $CustomDay = CustomDay::where('agenda_id', $agenda->id)->get();
     $Configday = Configday::where('day', $dia)->where('agenda_id', $agenda->id)->first();
     $AgendaAppo = Appointment::where('agenda_id', $agenda->id)->get();
     return View::make('clinic.doctor.Appointments.AppointmentsDay')->with('agendaAppo', $AgendaAppo)->with('configday', $Configday)->with('customddays', $CustomDay)->with('bussi', $bussi)->with('agenda', $agenda);
 }
 public function getAppointmentsOfDoctor($userid)
 {
     $apps = $this->appointment->where('doctor_id', $userid)->get();
     return $this->getAppointments($apps);
 }
Пример #8
0
 public function getFreeSlots()
 {
     $id = Input::get('id');
     // Get Employee id
     $date = Input::get('date');
     // Get selected date
     $day = date('l', strtotime($date));
     // Get day name from date
     $duty_day = Dutyday::where('employee_id', $id)->where('day', $day)->get()->first();
     if ($duty_day) {
         $slot = null;
         $appointments = Appointment::where('date', $date)->where('employee_id', $id)->get();
         if (count($appointments) > 0) {
             $timeslots = Timeslot::where('dutyday_id', $duty_day->id)->where('employee_id', $id);
             foreach ($appointments as $appointment) {
                 $slot = $timeslots->where('slot', '!=', $appointment->time)->get()->toJson();
             }
         } else {
             $slot = Timeslot::where('dutyday_id', $duty_day->id)->get()->toJson();
         }
         return JsonResponse::create($slot);
     }
     return 'false';
 }
Пример #9
0
     }
     $flag = "check_fee";
     return View::make('appointment_based_data.appointments', compact('appointments', 'flag'));
 });
 /* Route::get('app_view_vendor', function(){
        if(Auth::user()->role == "Accountant"){
            $vendor = Vendor::all();
       }else{
            $vendor = Vendor::has('vendor')->get();
        }
        $flag = "view_vendor";
        return View::make('vendors.index', compact('vendors', 'flag'));
    });*/
 Route::get('app_test_fee', function () {
     if (Input::get('id') !== null) {
         $appointments = Appointment::where('patient_id', Input::get('id'))->get();
     } else {
         $appointments = Appointment::has('labtests')->get();
     }
     $flag = "test_fee";
     return View::make('appointment_based_data.appointments', compact('appointments', 'flag'));
 });
 Route::resource('checkupfees', 'CheckupfeesController');
 Route::resource('testfees', 'TestfeesController');
 // PDF Reports
 Route::any('print_pres', ['uses' => 'HomeController@print_pres']);
 // Prescription PDF
 Route::any('print_test', ['uses' => 'HomeController@print_test']);
 // Test Report PDF
 // Prints
 Route::get('app_pres_print', function () {
Пример #10
0
Route::get('forgot_password', 'RemindersController@getRemind');
Route::post('forgot_password', 'RemindersController@postRemind');
Route::get('reset_password/{token}', 'RemindersController@getReset');
Route::post('reset_password/{token}', 'RemindersController@postReset');
Route::any('cities/{id}', 'PagesController@Cities');
Route::any('countries/', 'PagesController@Countries');
Route::any('insurances/', 'PagesController@Incuranses');
Route::controller('action', 'PagesController');
# Autentificacion
Route::get('logout', ['as' => 'logout', 'uses' => 'SessionsController@destroy']);
Route::resource('sessions', 'SessionsController', ['only' => ['create', 'store', 'destroy']]);
Route::get('test', function () {
    $in_start = date('Y-m-d', Input::get('start'));
    $date = $in_start;
    $states = array('confirmed', 'delayed', 'pending', 'in-progress', 'served', 'old');
    $appointment = Appointment::where('day', $date)->whereIn('state', $states)->get();
    dd(count($appointment));
});
# Solo Pacientes Pacientes
Route::group(['before' => 'auth|standardUser'], function () {
    Route::get('userProtected', 'StandardUserController@getUserProtected');
    Route::resource('profiles', 'UsersController', ['only' => ['show', 'edit', 'update']]);
});
# Solo Admin
Route::group(['prefix' => '/admin', 'before' => 'auth|admin'], function () {
    Route::get('/', ['as' => 'admin_dashboard', 'uses' => 'AdminController@getHome']);
    Route::get('/clinic', ['as' => 'admin_patient', 'uses' => 'AdminController@getClinic']);
    Route::resource('profiles', 'AdminUsersController', ['only' => ['index', 'show', 'edit', 'update', 'destroy']]);
    Route::get('/send', ['as' => 'admin_send', 'uses' => 'GcmController@send']);
});
App::missing(function ($exception) {