当前位置: 首页>>代码示例>>PHP>>正文


PHP Appointment::all方法代码示例

本文整理汇总了PHP中Appointment::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Appointment::all方法的具体用法?PHP Appointment::all怎么用?PHP Appointment::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Appointment的用法示例。


在下文中一共展示了Appointment::all方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Display a listing of appointments
  *
  * @return Response
  */
 public function index()
 {
     if (Auth::user()->role == 'Doctor') {
         $appointments = Auth::user()->appointments()->get();
     } else {
         $appointments = Appointment::all();
     }
     return View::make('appointments.index', compact('appointments'));
 }
开发者ID:saqibtalib,项目名称:EMR-ex-,代码行数:14,代码来源:AppointmentsController.php

示例2: getAppointments

 public function getAppointments()
 {
     $appointments = Appointment::all();
     $calendarAppointments = array();
     foreach ($appointments as $a) {
         $customer = Customer::find($a['customer_id']);
         $customer = $customer->first_name . ' ' . $customer->last_name;
         $event = array('title' => 'Appointment with ' . $customer, 'start' => $a['appointment_datetime']);
         array_push($calendarAppointments, $event);
     }
     return View::make('admin/appointments')->with('appointments', $calendarAppointments);
 }
开发者ID:RetinaInc,项目名称:booking-app,代码行数:12,代码来源:AdminController.php

示例3: index

 /**
  * @before _secure
  */
 public function index()
 {
     $this->seo(array("title" => "Appointments Scheduled", "view" => $this->getLayoutView()));
     $view = $this->getActionView();
     $appointments = array();
     $page = RequestMethods::get("page", 1);
     $limit = RequestMethods::get("limit", 10);
     $count = Appointment::count(array("user_id" => $this->user->id));
     $as = Appointment::all(array("user_id =?" => $this->user->id, "live = ?" => 1), array("id", "service_id", "start", "end", "patient_id"), "start", "asc", $limit, $page);
     foreach ($as as $a) {
         $service = Service::first(array("id = ?" => $a->service_id), array("property", "property_id", "organization_id", "charge"));
         $organization = Organization::first(array("id = ?" => $service->organization_id), array("id", "name"));
         $model = ucfirst($service->property);
         $item = $model::first(array("id = ?" => $service->property_id), array("title"));
         $patient = User::first(array("id = ?" => $a->patient_id), array("name"));
         array_push($appointments, array("item" => $item->title, "organization_id" => $organization->id, "organization_name" => $organization->name, "patient" => $patient->name, "start" => $a->start, "end" => $a->end, "id" => $a->id, "charge" => $service->charge));
     }
     $view->set("appointments", $appointments);
     $view->set("page", $page);
     $view->set("limit", $limit);
     $view->set("count", $count);
 }
开发者ID:HLitmus,项目名称:WebApp,代码行数:25,代码来源:patient.php

示例4: transactions

 public static function transactions($center, $member)
 {
     if ($centre_id == NULL) {
         $where = array("organization_id = ?" => $member->organization_id);
     } else {
         $where = array("organization_id = ?" => $member->organization_id, "centre_id = ?" => $center);
     }
     $appointments = \Appointment::all($where);
     $result = [];
     if ($member->designation == 'admin') {
         return $appointments;
     }
     if (!$center) {
         throw new \Exception("Invalid Arguments supplied", 1);
     }
     foreach ($appointments as $a) {
         if ($a->centre_id == $center) {
             $result[] = $a;
         }
     }
     return $result;
 }
开发者ID:HLitmus,项目名称:WebApp,代码行数:22,代码来源:vendor.php

示例5: payments

 /**
  * @before _secure, _vendor, _admin
  */
 public function payments()
 {
     $this->seo(array("title" => "Vendor Profile", "view" => $this->getLayoutView()));
     $view = $this->getActionView();
     $where["organization_id = ?"] = $this->organization->id;
     $period = RequestMethods::get("period", "total");
     switch ($period) {
         case 'year':
             $year = strftime("%Y-%m-%d", strtotime('-1 year'));
             $where["created > ?"] = $year;
             break;
         case 'week':
             $week = strftime("%Y-%m-%d", strtotime('-1 year'));
             $where["created > ?"] = $week;
             break;
         case 'day':
             $day = strftime("%Y-%m-%d", strtotime('-1 day'));
             $where["created > ?"] = $day;
             break;
     }
     $centres = Centre::all(array("organization_id = ?" => $this->organization->id), array("id", "location_id"));
     $revenue = 0;
     $cash = 0;
     $online = 0;
     $appointments = Appointment::all($where);
     foreach ($appointments as $a) {
         $order = Order::first(array("id = ?" => $a->order_id), array("amount"));
         $revenue += $order->amount;
         switch ($order->mode) {
             case 'cash':
                 $cash += $order->amount;
                 break;
             default:
                 $online += $order->amount;
                 break;
         }
     }
     if (RequestMethods::get("action") == "invoice") {
         $this->paymentsInvoice($this->organization, $appointments, $revenue, $cash, $online, "show");
     }
     $view->set("appointments", $appointments);
     $view->set("period", $period);
     $view->set("revenue", $revenue);
     $view->set("cash", $cash);
     $view->set("online", $online);
     $view->set("centres", $centres);
 }
开发者ID:HLitmus,项目名称:WebApp,代码行数:50,代码来源:finance.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $appointments = $this->appointment->all();
     return View::make('appointments.index', compact('appointments'));
 }
开发者ID:achyut,项目名称:Medico-backend,代码行数:10,代码来源:AppointmentsController.php

示例7: generateinvoice

 public function generateinvoice($order_id, $instamojo_id = "not found", $action = "gen")
 {
     if ($instamojo_id == "not found") {
         $this->redirect("/patient/profile");
     }
     $view = new Framework\View(array("file" => APP_PATH . "/application/views/layouts/others/invoice.html"));
     $order = Order::first(array("id = ?" => $order_id));
     $instamojo = Instamojo::first(array("id = ?" => $instamojo_id));
     $patient = User::first(array("id = ?" => $order->user_id));
     $appointments = Appointment::all(array("order_id = ?" => $order->id));
     $view->set("order", $order);
     $view->set("patient", $patient);
     $view->set("appointments", $appointments);
     $view->set("instamojo", $instamojo);
     if (!file_exists(APP_PATH . "/public/assets/uploads/files/orders/{$order->id}.pdf")) {
         $this->generatepdf($view->render(), $order->id);
     }
     if ($action == "show") {
         $this->redirect("/public/assets/uploads/files/orders/{$order->id}.pdf");
     }
 }
开发者ID:HLitmus,项目名称:WebApp,代码行数:21,代码来源:appointments.php

示例8: compact

     if (Input::get('id') !== null) {
         $appointments = Appointment::where('patient_id', Input::get('id'))->get();
     } else {
         $appointments = Appointment::all();
     }
     $flag = "test";
     return View::make('appointment_based_data.appointments', compact('appointments', 'flag'));
 });
 Route::get('app_proc', function () {
     $appointments = Appointment::has('diagonosticprocedure', '=', 0)->get();
     $flag = "proc";
     return View::make('appointment_based_data.appointments', compact('appointments', 'flag'));
 });
 Route::get('app_check_fee', function () {
     if (Auth::user()->role == "Accountant") {
         $appointments = Appointment::all();
     } else {
         $appointments = Appointment::has('checkupfee', '=', 0)->get();
     }
     $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'));
    });*/
开发者ID:saqibtalib,项目名称:EMR-ex-,代码行数:31,代码来源:routes.php

示例9: reports

 /**
  * @before _secure, _vendor
  */
 public function reports()
 {
     $this->seo(array("title" => "Test Report", "view" => $this->getLayoutView()));
     $view = $this->getActionView();
     $centre_id = RequestMethods::get("centre_id", $this->member->centre_id);
     $appointments = Appointment::all(array("centre_id = ?" => $centre_id), array("id", "patient_id", "user_id", "service_id", "start"));
     $view->set("appointments", $appointments);
     if (RequestMethods::post("action") == "report") {
         $appt_id = RequestMethods::post("appointment_id");
         if (!array_key_exists($appt_id, $appointments)) {
             $view->set("message", "Invalid request!!");
             return;
         }
         $appt = $appointments[$appt_id];
         $job = Job::first(array("appointment_id = ?" => $appt->id));
         if (!$job) {
             $view->set("message", "Invalid Request!!");
             return;
         }
         // find emails
         $user = User::first(array("id = ?" => $appt->user_id), array("email"));
         $patient = User::first(array("id = ?" => $appt->patient_id), array("email"));
         if (!$user->email && !$patient->email) {
             $view->set("message", "No email to send message to");
             return;
         } elseif (!$patient->email) {
             $emails = $user->email;
         } else {
             $emails = array($user->email, $patient->email);
             $emails = array_unique($emails);
         }
         // upload file
         $file = $this->_upload('file', "files", array("extensions" => "pdf"));
         if (!$file) {
             $view->set("message", "File upload failed!!");
             return;
         }
         $file_path = APP_PATH . '/public/assets/uploads/files/' . $file;
         $name = $this->organization->name;
         Shared\Services\Mail::notify(array("emails" => $emails, "delivery" => "sendgrid", "template" => "sendReport", "lab" => $name, "apptime" => \Framework\StringMethods::datetime_to_text($appt->start), "subject" => RequestMethods::post("report_detail"), "attachment" => $file_path));
         unlink($file_path);
         $job->live = 1;
         $job->save();
         $view->set("message", "Sent Successfully");
     }
 }
开发者ID:HLitmus,项目名称:WebApp,代码行数:49,代码来源:lab.php

示例10: appointments

 /**
  * @before _secure, _doctor
  */
 public function appointments()
 {
     $this->seo(array("title" => "My Appointments", "view" => $this->getLayoutView()));
     $this->getLayoutView()->set("cal", true);
     $view = $this->getActionView();
     $appointments = array();
     $page = RequestMethods::get("page", 1);
     $limit = RequestMethods::get("limit", 10);
     $count = Appointment::count(array("user_id" => $this->user->id));
     $as = Appointment::all(array("user_id =?" => $this->user->id, "live = ?" => 1), array("id", "service_id", "start", "end", "patient_id"), "start", "asc", $limit, $page);
     foreach ($as as $a) {
         $service = Service::first(array("id = ?" => $a->service_id), array("property", "property_id", "organization_id", "charge"));
         $organization = Organization::first(array("id = ?" => $service->organization_id), array("id", "name"));
         $model = ucfirst($service->property);
         $item = $model::first(array("id = ?" => $service->property_id), array("title"));
         $patient = User::first(array("id = ?" => $a->patient_id), array("name"));
         array_push($appointments, array("item" => $item->title, "organization_id" => $organization->id, "organization_name" => $organization->name, "patient" => $patient->name, "start" => $a->start, "end" => $a->end, "id" => $a->id, "charge" => $service->charge));
     }
     $organization = Registry::get("session")->get("organization");
     if (RequestMethods::post("action") == "capacity") {
         \Slot::saveRecord($this->user, $organization);
         $view->set("message", "Slots Saved Successfully");
     }
     $view->set("appointments", $appointments);
     $days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
     $view->set("days", $days);
     $view->set("slots", Shared\Services\Doctor::slots($this->user));
 }
开发者ID:HLitmus,项目名称:WebApp,代码行数:31,代码来源:doctor.php

示例11: index

 /**
  * Display a listing of Appointments under the Currently Logged User.
  *
  * @return Response
  *
  */
 public function index()
 {
     $appointments = Appointment::all();
     return Response::json($appointments);
 }
开发者ID:homeski,项目名称:csc436_sched,代码行数:11,代码来源:AppointmentAPIController.php


注:本文中的Appointment::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。