本文整理汇总了PHP中Appointment类的典型用法代码示例。如果您正苦于以下问题:PHP Appointment类的具体用法?PHP Appointment怎么用?PHP Appointment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Appointment类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
}
}
}
开发者ID:Nishikanto,项目名称:Website,代码行数:34,代码来源:PatientAppointment.php
示例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)));
}
}
开发者ID:nidhhoggr,项目名称:mycoachingoffice,代码行数:60,代码来源:actions.class.php
示例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();
}
开发者ID:radicaldesigns,项目名称:amp,代码行数:10,代码来源:Appointment.inc.php
示例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);
}
开发者ID:jakedorst,项目名称:ch3-dev-preview,代码行数:14,代码来源:AppointmentController.php
示例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'));
}
开发者ID:saqibtalib,项目名称:EMR-ex-,代码行数:12,代码来源:DiagonosticproceduresController.php
示例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);
}
开发者ID:homeski,项目名称:csc436_sched,代码行数:32,代码来源:AppointmentAPIController.php
示例7: get_instance
public static function get_instance()
{
if (self::$appointment == NULL) {
self::$appointment = new Appointment();
}
return self::$appointment;
}
开发者ID:junctiontech,项目名称:dbho,代码行数:7,代码来源:class_appointment.php
示例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'));
}
开发者ID:saqibtalib,项目名称:EMR-ex-,代码行数:13,代码来源:PrescriptionsController.php
示例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'));
}
开发者ID:joreyesl,项目名称:calendar,代码行数:9,代码来源:CalendarController.php
示例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);
}
开发者ID:jnicolasbc,项目名称:admin_swp_com,代码行数:10,代码来源:PatientsController.php
示例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);
}
开发者ID:ashutoshpandey,项目名称:dicom,代码行数:10,代码来源:ExpertController.php
示例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);
}
开发者ID:RetinaInc,项目名称:booking-app,代码行数:12,代码来源:AdminController.php
示例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;
}
}
开发者ID:samundrak,项目名称:Practise,代码行数:13,代码来源:Appointment.php
示例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;
}
开发者ID:rajsanjib,项目名称:HealthPortal,代码行数:13,代码来源:appointment.php
示例16: getObject
public static function getObject($mxdFilters = array())
{
$objApp = new Appointment();
$db = Zend_Registry::get('dbAdapter');
$objSelect = $db->select()->from('appointments');
if (is_string($mxdFilters)) {
$objSelect->where($mxdFilters);
} else {
if (is_array($mxdFilters)) {
foreach ($mxdFilters as $fieldName => $mxdValue) {
// set the default operator to ==
$fieldOperator = '=';
$fieldValue = '';
if (is_array($mxdValue)) {
$ctr = count($mxdValue);
// if empty array, just continue to the next item
if ($ctr < 1) {
continue;
} else {
switch ($ctr) {
case 1:
$fieldValue = array_pop($mxdValue);
break;
case 2:
if (isset($mxdValue['operator'])) {
$fieldOperator = $mxdValue['operator'];
unset($mxdValue['operator']);
$fieldValue = array_pop($mxdValue);
} else {
// use the first element of the array as its operator
$fieldOperator = array_shift($mxdValue);
// use the 2nd element of the array as its value
$fieldValue = array_shift($mxdValue);
}
break;
default:
continue;
break;
}
}
}
if ($fieldValue == '') {
continue;
}
$objSelect->where("{$fieldName} {$fieldOperator} ?", $fieldValue);
}
}
}
$objIterator = $objApp->getIterator($objSelect);
return $objIterator;
}
开发者ID:dragonlet,项目名称:clearhealth,代码行数:51,代码来源:Appointment.php
示例17: verifyAppointment
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();
}
}
开发者ID:shubhomoy,项目名称:evolve,代码行数:14,代码来源:AppointmentController.php
示例18: getdataAction
public function getdataAction()
{
$this->view->disable();
if ($this->request->isPost()) {
$infos = $this->request->getPost();
$appointment = new Appointment();
$appointment->custName = $infos['res_custName'];
$appointment->mobile = $infos['res_mobile'];
$appointment->telephone = $infos['res_telephone'];
$appointment->email = $infos['res_email'];
$appointment->postcode = $infos['res_postcode'];
$appointment->custsex = $infos['res_custSex'];
$appointment->address = $infos['res_address'];
$appointment->type = 0;
$appointment->time = time();
if ($appointment->save()) {
echo true;
} else {
echo false;
}
} else {
$this->response->redirect("index/index");
}
}
开发者ID:lookingatsky,项目名称:zhonghewanbang,代码行数:24,代码来源:IndexController.php
示例19: run
public function run()
{
User::create(['id' => 1, 'cedula' => '1014777780', 'name' => 'Administrador', 'password' => \Hash::make('1014777780'), 'email' => 'admin@mansion_mascota.com', 'phone' => '2621244', 'type' => 'admin']);
User::create(['id' => 2, 'cedula' => '0812757578', 'name' => 'Usuario de pruebas', 'password' => \Hash::make('0812757578'), 'email' => 'test@mansion_mascota.com', 'phone' => '2621244', 'type' => 'admin']);
$faker = Faker::create();
foreach (range(1, 10) as $index) {
$user = User::create(['cedula' => $faker->randomNumber(10), 'name' => $faker->name, 'password' => \Hash::make('123456'), 'email' => $faker->email, 'phone' => $faker->phoneNumber, 'type' => 'user']);
foreach (range(1, $faker->numberBetween(1, 2)) as $date) {
$pet = Pet::create(['user_id' => $user->id, 'name' => $faker->firstName(), 'type' => $faker->randomElement(['perro', 'gato', 'pajaro', 'otro'])]);
}
foreach (range(1, $faker->numberBetween(1, 3)) as $date) {
Appointment::create(['user_id' => $user->id, 'pet_id' => $pet->id, 'date' => $faker->dateTimeBetween('now', '+3 months'), 'note' => $faker->text(100 + $faker->numberBetween(10, 150))]);
}
}
}
开发者ID:jairom0704,项目名称:dental_office,代码行数:15,代码来源:UserTableSeeder.php
示例20: showAll
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'));
}
开发者ID:carlosqueiroz,项目名称:medical-management-system,代码行数:18,代码来源:AppointmentController.php
注:本文中的Appointment类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论