本文整理汇总了PHP中Appointment类的典型用法代码示例。如果您正苦于以下问题:PHP Appointment类的具体用法?PHP Appointment怎么用?PHP Appointment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Appointment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: makeAppointment
/**
* Display the specified resource.
* GET /patientappointment/{id}
*
* @param int $id
* @return Response
*/
public function makeAppointment()
{
$patient = null;
$rules = ['patient_id' => 'required', 'doctor_id' => 'required', 'date' => 'required', 'time' => 'required'];
$data = Input::all();
$validator = Validator::make(Input::all(), $rules);
$patient = DB::table('patients')->where('id', $data['patient_id'])->first();
if ($validator->fails()) {
return View::make('PatientViews/appointment')->with('title', 'Appointment')->with('id', $data['patient_id'])->with('name', $patient->name)->withErrors($validator);
} else {
$doctor = DB::table('doctors')->where('id', $data['doctor_id'])->pluck('working_hourse');
$doctor_name = DB::table('doctors')->where('id', $data['doctor_id'])->pluck('name');
$appointmentCount = 0;
$appointment = DB::table('appointments')->where('schedule', $data['date'])->get();
$appointmentCount = count($appointment);
$hourse = $doctor;
$appointment = new Appointment();
$appointment->patients_id = $data['patient_id'];
$appointment->doctors_id = $data['doctor_id'];
$appointment->schedule = $data['time'];
if ($appointment->save()) {
return View::make('PatientViews/appointmentComplete')->with('title', 'appointment_complete')->with('patient_name', $patient->name)->with('patient_id', $data['patient_id'])->with('doctor_name', $doctor_name)->with('appointment_date', $data['date'])->with('appointment_time', $data['time']);
} else {
return View::make('PatientViews/appointment')->with('title', 'Appointment')->with('id', $data['patient_id'])->with('name', $patient_name)->withErrors("Something Went Wrong, please try again");
}
}
}
示例2: executeQuery
public function executeQuery(sfWebRequest $request)
{
if ($request->isXmlHttpRequest()) {
if ($request->isMethod(sfRequest::GET)) {
$startDate = $request->getGetParameter('startDate');
$endDate = $request->getGetParameter('endDate');
$page = $request->getGetParameter('page');
$start = $request->getGetParameter('start');
$limit = $request->getGetParameter('limit');
$this->convertParamToDateTime($startDate);
$this->convertParamToDateTime($endDate);
$result = Doctrine_Core::getTable('Appointment')->getBetween($startDate, $endDate);
$response = $this->buildResponse($result, "Loading Record");
} else {
if ($request->isMethod(sfRequest::POST)) {
$form_data = json_decode(file_get_contents('php://input'));
$location = $form_data->loc;
$title = $form_data->title;
$notes = $form_data->notes;
$url = $form_data->url;
$reminder = $form_data->rem;
$cid = $form_data->cid;
$startDate = str_replace('T', ' ', $form_data->start);
$endDate = str_replace('T', ' ', $form_data->end);
$this->convertParamToDateTime($startDate, 'Y-m-d H:i:s');
$this->convertParamToDateTime($endDate, 'Y-m-d H:i:s');
$a = new Appointment();
$a->fromArray(array('coach_id' => 1, 'client_id' => 1, 'calendar_type_id' => $cid, 'scheduled' => $startDate, 'started_at' => $startDate, 'finished_at' => $endDate, 'title' => $title, 'location' => $location, 'notes' => $notes, 'web_link' => $url, 'reminder' => $reminder));
$a->save();
$response = $this->buildResponse($a, "Creating Record");
} else {
if ($request->isMethod(sfRequest::PUT)) {
$form_data = json_decode(file_get_contents('php://input'));
$location = $form_data->loc;
$title = $form_data->title;
$notes = $form_data->notes;
$url = $form_data->url;
$reminder = $form_data->rem;
$cid = $form_data->cid;
$startDate = str_replace('T', ' ', $form_data->start);
$endDate = str_replace('T', ' ', $form_data->end);
$this->convertParamToDateTime($startDate, 'Y-m-d H:i:s');
$this->convertParamToDateTime($endDate, 'Y-m-d H:i:s');
$a = Doctrine_Core::getTable('Appointment')->find(array($request->getParameter('id')));
$a->fromArray(array('coach_id' => 1, 'client_id' => 1, 'calendar_type_id' => $cid, 'scheduled' => $startDate, 'started_at' => $startDate, 'finished_at' => $endDate, 'title' => $title, 'location' => $location, 'notes' => $notes, 'web_link' => $url, 'reminder' => $reminder));
$a->save();
$response = $this->buildResponse($a, "Updating Record");
} else {
if ($request->isMethod(sfRequest::DELETE)) {
$app = Doctrine_Core::getTable('Appointment')->find(array($request->getParameter('id')));
$app->delete();
$response = array('success' => true, 'message' => 'Destroyed Record', 'data' => array());
}
}
}
}
sfConfig::set('sf_web_debug', false);
return $this->renderPartial('global/ajax', array('ajax' => json_encode($response)));
}
}
示例3: deleteData
function deleteData($id)
{
$action = new Appointment($this->dbcon, $id);
$result = parent::deleteData($id);
if (!$action->getData('action_id')) {
return $result;
}
$item = new ScheduleItem($this->dbcon, $action->getData('action_id'));
return $result && $item->updateStatus();
}
示例4: ajaxMarkAppointmentAction
public function ajaxMarkAppointmentAction()
{
$appointmentId = (int) $this->_getParam('appointmentId');
$mark = $this->_getParam('mark');
$app = new Appointment();
$app->appointmentId = $appointmentId;
$app->populate();
//todo: compare provided mark against eligible in matching enumeration
$app->appointmentCode = $mark;
$app->persist();
$json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
$json->suppressExit = true;
$json->direct(true);
}
示例5: create
/**
* Show the form for creating a new diagonosticprocedure
*
* @return Response
*/
public function create()
{
$appointment = Appointment::find(Input::get('id'));
$patient_id = $appointment->patient->id;
$patient_id = Input::get('id');
return View::make('diagonosticprocedures.create', compact('appointment', 'patient_id'));
}
示例6: update
/**
* Update the specified appointment in storage.
*
* @param int $appointment_id
* @return Response
*
*/
public function update($appointment_id)
{
$appointment = Appointment::find($appointment_id);
$input = Input::all();
if (isset($input['category_id'])) {
$appointment->category_id = $input['category_id'];
}
if (isset($input['title'])) {
$appointment->title = $input['title'];
}
if (isset($input['start'])) {
$appointment->start = Carbon::parse($input['start'])->toDateTimeString();
}
if (isset($input['end'])) {
$appointment->end = Carbon::parse($input['end'])->toDateTimeString();
}
$start = Carbon::parse($appointment->start);
$end = Carbon::parse($appointment->end);
// Check that start is before end
if ($start->gt($end)) {
return Response::json(array('message' => 'Start can not be after end'), 400);
}
$appointment->save();
return Response::json($appointment);
}
示例7: get_instance
public static function get_instance()
{
if (self::$appointment == NULL) {
self::$appointment = new Appointment();
}
return self::$appointment;
}
示例8: create
/**
* Show the form for creating a new prescription
*
* @return Response
*/
public function create()
{
$appointment = Appointment::find(Input::get('id'));
$patient_id = $appointment->patient->id;
$doctors = Employee::where('role', 'Doctor')->where('status', 'Active')->get();
$medicines = Medicine::all()->lists('name', 'id');
return View::make('prescriptions.create', compact('medicines', 'appointment', 'patient_id', 'doctors'));
}
示例9: postDelete
public function postDelete($id)
{
$event = Appointment::find($id);
if ($event) {
$event->delete();
return Response::json(array('status' => 'success'));
}
return Response::json(array('status' => 'error'));
}
示例10: actionIndex
public function actionIndex()
{
$apps = Appointment::model()->DIT(Appointment::DIT_BOOKED)->passed()->findAll();
foreach ($apps as $app) {
$this->log('Booking follow up for app id=' . $app->app_id);
$followUp = $app->bookDITFollowUp();
$this->log('newly created follow up id=' . $followUp->app_id);
}
}
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:9,代码来源:CronCreateFollowupsForPassedDITAppointmentsCommand.php
示例11: getPatientAppointmentsHistory
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);
}
示例12: manage
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);
}
示例13: 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);
}
示例14: verification
public function verification()
{
$query = "SELECT `id` FROM `appoinment` WHERE `patient_user`='" . $this->getPatientUser() . "' AND `doctor`='" . $this->getDoctor() . "' AND `date`='" . $this->getDate() . "' AND `time`='" . $this->getTime() . "' AND `is_approved`='1'";
$result = $this->db->query(" SELECT * FROM `appointment` ");
if ($result->num_rows >= 0) {
self::$message = "Appointment registered you will inform soon";
return true;
//is empty
} else {
self::$message = 'An appointment with this doctor of same time has been already registred!';
return false;
}
}
示例15: __construct
function __construct()
{
parent::__construct();
// Models
$this->load->model('Doctor_model');
$this->load->model('User_model');
$this->load->library('calendar');
$this->load->model('Appointment_model');
// Initialize static variables
Appointment::$user_id = $this->User_model->get_user_id();
$this->date = now();
$this->doctor_id = 1;
}