示例#1
0
function RegisterUser($inputArr)
{
    try {
        global $db;
        foreach ($inputArr as $key => $key_value) {
            $keyArr[$key] = $key_value;
        }
        //print_r($keyArr);
        $docObj = new Doctor($db);
        $r_user = $docObj->getDocDetails($keyArr['mobile_num']);
        //print_r($r_user);
        if (is_array($r_user) && sizeof($r_user) > 0) {
            $arr = array('status' => "Mobile Number already exits!");
        } else {
            $row_doc = $docObj->insertDocDetails($keyArr);
            if ($row_doc > 0) {
                $arr = array('status' => 1);
            } else {
                $arr = array('status' => 0);
            }
        }
        return $arr;
    } catch (Exception $e) {
        echo 'Caught exception: ', $e->getMessage(), "\n";
    }
}
 public function activate($code, Doctor $doctor)
 {
     if ($doctor->activateAccount($code)) {
         return 'Akun pasien Anda berhasil diaktivasi';
     }
     return 'Akun pasien Anda gagal diaktivasi';
 }
示例#3
0
 public function get_by_ambulatory($amb)
 {
     $conn = $this->db->conn;
     try {
         $query = $conn->prepare("\n\t\t\t\t\t\t\t\t\t\tSELECT D.ID, D.FirstName , D.LastName , D.Curriculum, D.Birthday, D.Gender, D.Image\n\t\t\t\t\t\t\t\t\t\tFROM Ambulatories as A \n\t\t\t\t\t\t\t\t\t\tINNER JOIN AmbulatoriesDoctors as AD ON A.ID = AD.AmbulatoryID\n\t\t\t\t\t\t\t\t\t\tINNER JOIN Doctors as D ON AD.DoctorID = D.ID\n\t\t\t\t\t\t\t\t\t\tINNER JOIN Contents as C ON A.NameContentID = C.ID \n\t\t\t\t\t\t\t\t\t\tWHERE A.ID = ? AND C.Lang = ? AND D.Active = 1\n\t\t\t\t\t\t\t\t\t");
         $query->execute(array($amb, $this->db->lang));
     } catch (PDOException $e) {
         echo "Error: " . $e;
     }
     while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
         $doctor = new Doctor($this->db);
         $doctor->update_class($row);
         array_push($this->doctors, $doctor);
     }
 }
 public function get($id)
 {
     $doctor = Doctor::with(['companions', 'episodes'])->find($id);
     $ratings = Rating::getRating('doctor', $id);
     $comments = Comment::where('item_id', $id)->where('item_type', 'doctor')->with('user')->orderBy('created_at', 'desc')->get();
     return View::make('items.doctor', ['doctor' => $doctor, 'ratings' => $ratings, 'comments' => $comments]);
 }
 public function select_schedule()
 {
     $doctor = Doctor::find(Input::get('doctor_id'));
     if (!isset($doctor)) {
         // ..
     }
     $schedules = $doctor->schedules()->with('periods')->get();
     if (!isset($schedules)) {
         // ..
     }
     $schedules_map = array();
     foreach ($schedules as $schedule) {
         if (!array_key_exists($schedule->date, $schedules_map)) {
             $schedules_map[$schedule->date] = array();
         }
         $schedules_map[$schedule->date][$schedule->period] = array('id' => $schedule->id, 'status' => false);
         foreach ($schedule->periods as $period) {
             if ($period->current < $period->total) {
                 $schedules_map[$schedule->date][$schedule->period]['status'] = true;
                 break;
             }
         }
     }
     $schedules_all = array();
     $date_from = 0;
     $date_to = 7;
     $current_date = date_create();
     for ($i = $date_from; $i < $date_to; ++$i) {
         $schedules_all[$i] = array('date' => date_format(date_create('@' . strtotime('+' . $i . ' day')), 'Y-m-d'));
     }
     return View::make('register.select_schedule', array('doctor' => array('name' => $doctor->name, 'photo' => $doctor->photo, 'title' => $doctor->title, 'department' => $doctor->department->name, 'hospital' => $doctor->department->hospital->name), 'schedules' => $schedules_all, 'schedules_map' => $schedules_map));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getDoctorHistory()
 {
     $id = Doctor::doctorLogin();
     $doctor = Doctor::where('id', $id)->first();
     $payments = Userpayment::where('user_id', $doctor->user_id)->where('paid', 1)->get();
     return View::make('clinic.doctor.Payment.History')->with('payments', $payments);
 }
 public function run()
 {
     DB::table('doctors')->delete();
     Doctor::create(array('name' => 'Christopher Eccleston', 'number' => '9', 'description' => 'The sole survivor of the Last Great Time War, scarred by the terrible things he’d seen and done, the Ninth Doctor was an intense and emotional incarnation. Hiding his psychological trauma behind madcap wit and frivolity, he took Rose Tyler to see the end of the world, inspired Charles Dickens and showed that for once, everybody could live. He was still capable of great cruelty and anger though, killing Cassandra and torturing a lone Dalek into submission. After Rose defeated the Daleks using the power of the time vortex, the Doctor saved her by transferring that dangerous power into his own body. The strain destroyed his every cell and as Rose watched, his body exploded with raging energy...', 'image' => 'http://thedoctor.coderfaire/assets/img/doctors/9.png'));
     Doctor::create(array('name' => 'David Tennant', 'number' => '10', 'description' => 'Waking on Christmas Day in his new form, the Doctor fought the Sycorax high above London, where he lost a hand but grew a new one with remnant regenerative power. Travelling with Rose and Mickey he battled Cybermen, werewolves and possibly, the Devil itself. Losing Rose in a parallel universe – but later leaving her with a half-human clone of himself – the Doctor travelled on. He hid as a human schoolmaster to spare the Family of Blood his wrath, he defeated his nemesis the Master once more and met River Song for the first time. Told that he would die when someone knocked four times, the Doctor remained defiant, but to no avail. Reeling from his confrontation with the Time Lords and fatally dosed with radiation, the Tenth Doctor’s song ended, as his violent regeneration burned the TARDIS and sent it crashing through space...', 'image' => 'http://thedoctor.coderfaire/assets/img/doctors/10.png'));
     Doctor::create(array('name' => 'Matt Smith', 'number' => '11', 'description' => 'Hugely energetic, occasionally flirtatious, and by his own admission, "a mad man", the Eleventh Doctor combined youthful looks with an old soul. Crashing into the lives of Amy Pond, and her boyfriend (later, husband) Rory, he solved the mystery of the time-erasing cracks in the universe, escaped his own death, restarted reality and even found time to marry River Song. A broken man after Amy and Rory were sent back in time by a Weeping Angel, and a Victorian-era Clara fell to her death, he decided to disappear. But it wasn\'t long before the lure of "the woman twice dead" brought the Doctor out of retirement. Finding his own tomb on the embattled Trenzalore and meeting a shameful, hidden past incarnation, started him on a path of redemption, teaming up with the Tenth Doctor to save Gallifrey rather than burn it. After sacrificing his life to defend Trenzalore, and granted a whole new cycle of incarnations by the Time Lords, the Doctor regenerated once more...', 'image' => 'http://thedoctor.coderfaire/assets/img/doctors/11.png'));
     Doctor::create(array('name' => 'Peter Capaldi', 'number' => '12', 'description' => 'Granted a whole new regenerative cycle by the Time Lords, the Doctor experienced an explosive and unprecedented thirteenth regeneration, ending the Siege of Trenzalore. A new Doctor - with a sharp face, bushy brows and boggle eyes - faced a bewildered Clara, across the console. A Doctor who has seemingly forgotten how to fly the TARDIS… Though little is yet known of this Doctor’s journeys, at some point in his future, he helped his previous incarnations freeze Gallifrey in a pocket universe.', 'image' => 'http://thedoctor.coderfaire/assets/img/doctors/12.png'));
 }
 public function run()
 {
     Doctor::create(['name' => 'Rodolfo A. Aldana Camacho', 'phone' => '', 'email' => '', 'picture' => 'img/doctorPhotos/defaultPhoto.jpg', 'website' => '', 'comment' => '']);
     Doctor::create(['name' => 'Benjamin San Ibarra', 'phone' => '', 'email' => '', 'picture' => 'img/doctorPhotos/defaultPhoto.jpg', 'website' => '', 'comment' => '']);
     Doctor::create(['name' => 'J. Abraham Flores Cardoza', 'phone' => '', 'email' => '', 'picture' => 'img/doctorPhotos/defaultPhoto.jpg', 'website' => '', 'comment' => '']);
     Doctor::create(['name' => 'Jaime F. Hernandez Zuñiga', 'phone' => '', 'email' => '', 'picture' => 'img/doctorPhotos/defaultPhoto.jpg', 'website' => '', 'comment' => '']);
     Doctor::create(['name' => 'Monica Cuadras', 'phone' => '', 'email' => '', 'picture' => 'img/doctorPhotos/defaultPhoto.jpg', 'website' => '', 'comment' => '']);
 }
示例#9
0
 public function run()
 {
     Eloquent::unguard();
     DB::table('doctors')->delete();
     Doctor::create(['name' => 'Shubhomoy', 'reg_id' => '12345', 'photo' => 'shubho.jpg', 'address' => 'Delhi', 'email' => 'biswas', 'description' => 'biswas']);
     Doctor::create(['name' => 'Agam', 'reg_id' => '345t3', 'photo' => 'agam.jpg', 'address' => 'Bhilai', 'email' => 'agam', 'description' => 'gupto']);
     Doctor::create(['name' => 'Shubhakar', 'reg_id' => 'c343', 'photo' => 'shubha.jpg', 'address' => 'Kolkatta', 'email' => 'shubha', 'description' => 'shubha']);
 }
示例#10
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Doctor the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Doctor::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
示例#11
0
文件: doctor.php 项目: HLitmus/WebApp
 public function __construct($options = array())
 {
     parent::__construct($options);
     if (empty(self::$_specialities)) {
         $m = $this->mongod();
         self::$_specialities = $m->get('specialities');
     }
 }
 public function index()
 {
     $doctors = Doctor::take(4)->orderBy('number')->get();
     $companions = Companion::take(4)->get();
     $enemies = Enemy::take(4)->get();
     $episodes = Episode::take(4)->get();
     return View::make('index', ['doctors' => $doctors, 'companions' => $companions, 'enemies' => $enemies, 'episodes' => $episodes]);
 }
 public function account()
 {
     $doctor = Doctor::where('user_id', Session::get('user.id'))->first();
     $hospital_id = $doctor->department->hospital_id;
     $default_department = $doctor->department_id;
     $departments = Department::where('hospital_id', $hospital_id)->get();
     $render_data = array('name' => $doctor->name, 'photo' => $doctor->photo, 'title' => $doctor->title, 'specialty' => strip_tags($doctor->specialty), 'description' => strip_tags($doctor->description), 'default_department' => $doctor->department_id, 'departments' => $departments, 'top_photo' => Session::get('doctor.photo'));
     return View::make('doctor.account', $render_data);
 }
 protected function can_be_registered($doctor_id)
 {
     $periods = Doctor::find($doctor_id)->schedules()->with('periods')->get();
     foreach ($periods as $period) {
         if ($period->current < $period->total) {
             return true;
         }
     }
     return false;
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Payment::VeryPayment() == false) {
         return View::make('clinic.payment.renews-payment');
     }
     $id = Doctor::doctorLogin();
     $agenda = Agenda::where('doctor_id', $id)->first();
     $CustomDay = CustomDay::where('agenda_id', $agenda->id)->get();
     return View::make('clinic.doctor.customDay.customDay')->with('customddays', $CustomDay)->with('agendaID', $agenda->id);
 }
示例#16
0
 public function actionIndex()
 {
     $doctors = Doctor::model()->findAll();
     $patient = new Patient('search');
     $patient->unsetAttributes();
     // clear any default values
     if (isset($_GET['Patient'])) {
         $patient->attributes = $_GET['Patient'];
     }
     $this->render('index', compact('doctors', 'patient'));
 }
示例#17
0
 public static function VeryTypeDoctor()
 {
     if ($user = Sentry::getUser()) {
         $doctors = Doctor::where('user_id', $user->id)->first();
         if ($doctors) {
             if ($doctors->clinic_id > 0) {
                 return true;
             }
         }
     }
 }
示例#18
0
 public static function doctorNegocios()
 {
     $user = Sentry::getUser();
     $doctors = Doctor::where('user_id', $user->id)->first();
     $business = BusinessDoctor::where('doctor_id', $doctors->id)->get();
     if ($business) {
         return $business;
     } else {
         return false;
     }
 }
示例#19
0
 public static function getVeryAgenda($agenda_id)
 {
     $user = Sentry::getUser();
     $doctor = Doctor::where('user_id', $user->id)->first();
     $agenda = Agenda::find($agenda_id);
     if ($agenda->doctor_id == $doctor->id) {
         return true;
     } else {
         return false;
     }
 }
示例#20
0
 public function login()
 {
     $name = Input::get('name');
     $reg_id = Input::get('reg_id');
     try {
         $doctor = Doctor::where('name', '=', $name)->where('reg_id', '=', $reg_id)->firstOrFail();
         return Response::data($doctor);
     } catch (ModelNotFoundException $e) {
         return Response::unauthorized();
     }
 }
 public function login()
 {
     require_once 'model/doctor.php';
     //echo "in login";
     //session_start();
     $user_name = $_POST['username'];
     $pwd = $_POST['password'];
     //$encpwd = sha1($password);
     //echo $username . $password;
     Doctor::auth($user_name, $pwd);
     // var_dump("yay");
     header('location: view/doctor/profile.php');
 }
 public function run()
 {
     DB::table('doctors')->delete();
     $common_specialty = '<p>专业特长:妇科腹腔镜、宫腔镜微创肿瘤切除手术,腹腔镜治疗不孕症手术。阴式微创子宫切除术及各类妇科产科阴暗危重病症。妇科内分泌疾病与生殖内分泌。</p>';
     $common_description = '<p>葛菲,女,院长助理兼妇科主任,主任医师,留美归国学着。中华医学会海南省分会妇产科专业委员会常务委员,省医学会医疗事故、司法医学,计划生育医疗技术鉴定专家。先后获得海口市科技进步奖一等奖和二等奖,海南省科技进步四等奖。已经主持完成海口市重点科技计划项目一项,目前主持海口市重点科技计划项目一项。</p>';
     Doctor::create(array('name' => '葛菲', 'photo' => '/images/hospital/doc_pic.png', 'specialty' => $common_specialty, 'description' => $common_description, 'is_chief' => true, 'is_consultable' => true, 'department_id' => 1, 'title' => '主任医师', 'register_fee' => 0.2, 'user_id' => 1));
     Doctor::create(array('name' => '王磊', 'photo' => '/images/hospital/doc.png', 'specialty' => $common_specialty, 'description' => $common_description, 'is_chief' => false, 'is_consultable' => false, 'department_id' => 1, 'title' => '副主任医师', 'register_fee' => 0.1, 'user_id' => 2));
     Doctor::create(array('name' => '葛天', 'photo' => '/images/hospital/doc_pic.png', 'specialty' => $common_specialty, 'description' => $common_description, 'is_chief' => true, 'is_consultable' => true, 'department_id' => 2, 'title' => '主任医师', 'register_fee' => 0.2, 'user_id' => 3));
     Doctor::create(array('name' => '张三', 'photo' => '/images/hospital/doc.png', 'specialty' => $common_specialty, 'description' => $common_description, 'is_chief' => false, 'is_consultable' => true, 'department_id' => 2, 'title' => '副主任医师', 'register_fee' => 0.1, 'user_id' => 4));
     Doctor::create(array('name' => '李四', 'photo' => '/images/hospital/doc.png', 'specialty' => $common_specialty, 'description' => $common_description, 'is_chief' => true, 'is_consultable' => true, 'department_id' => 6, 'title' => '主任医师', 'register_fee' => 0.2, 'user_id' => 5));
     Doctor::create(array('name' => '王五', 'photo' => '/images/hospital/doc.png', 'specialty' => $common_specialty, 'description' => $common_description, 'is_chief' => false, 'is_consultable' => true, 'department_id' => 6, 'title' => '副主任医师', 'register_fee' => 0.1, 'user_id' => 6));
     Doctor::create(array('name' => '嘉丽', 'photo' => '/images/hospital/doc_pic.png', 'specialty' => $common_specialty, 'description' => $common_description, 'is_chief' => true, 'is_consultable' => false, 'department_id' => 8, 'title' => '主任医师', 'register_fee' => 0.2, 'user_id' => 7));
     Doctor::create(array('name' => '阿登', 'photo' => '/images/hospital/doc.png', 'specialty' => $common_specialty, 'description' => $common_description, 'is_chief' => false, 'is_consultable' => true, 'department_id' => 8, 'title' => '副主任医师', 'register_fee' => 0.1, 'user_id' => 8));
 }
 public function getConfigDay()
 {
     if (Payment::VeryPayment() == false) {
         return View::make('clinic.payment.renews-payment');
     }
     $doctor = Doctor::doctorLogin();
     $agenda = Agenda::where('doctor_id', $doctor)->first()->id;
     $configDay = Configday::where('agenda_id', $agenda)->get();
     if ($configDay->isEmpty()) {
         return View::make('clinic.doctor.config.ConfigDay')->with('agenda', $agenda);
     } else {
         return View::make('clinic.doctor.config.ConfigDay')->with('agenda', $agenda)->with('configDay', $configDay);
     }
 }
 public function run()
 {
     DB::table('enemies')->delete();
     DB::table('doctor_enemy')->delete();
     // Pull up the doctors to attach to companions
     $doctorNine = Doctor::where('number', 9)->first();
     $doctorTen = Doctor::where('number', 10)->first();
     $doctorEleven = Doctor::where('number', 11)->first();
     $doctorTwelve = Doctor::where('number', 12)->first();
     Enemy::create(array('name' => 'Cybermen', 'description' => 'Originally born on Earth’s twin planet Mondas, the Cybermen were created as the Mondasians replaced parts of their dying bodies with plastic and steel. Eventually they added emotional inhibitors, supressing all feelings – love, hate, even fear. Cybermen can convert humans wherever they go, and take orders from a Cyberleader, whose data can be downloaded to a drone if the leader is destroyed. Like the Daleks, the Cybermen have dogged the Doctor through space and time. He has prevented them destroying Earth’s weather system, getting their hands on the Nemesis statue and taking over Victorian London with their Cyber-King. The Tenth Doctor visited a parallel universe, where Cybus Industries had developed Cybermen to prolong John Lumic’s dwindling life.', 'image' => 'http://thedoctor.coderfaire/assets/img/enemies/cybermen.png'))->doctors()->attach([$doctorTen->id, $doctorEleven->id]);
     Enemy::create(array('name' => 'Daleks', 'description' => 'The Doctor first encountered the Daleks on the radiation-soaked planet of Skaro, waging war with the peaceful Thals. The Daleks were the mangled and mutated remains of the Kaled people, placed in metal war machines by the Kaled’s chief scientist Davros. Pursuing the Doctor across space and time, the Daleks invaded the Earth, developed the Reality Bomb and tried to imprison the Doctor in the Pandorica. They fought the Time Lords in The Last Great Time War – a conflict so powerful and destructive that the universe was said to convulse. In an effort to save reality, the Doctor used ‘the Moment’ to annihilate both races. But that wasn’t the end of the Daleks...', 'image' => 'http://thedoctor.coderfaire/assets/img/enemies/daleks.png'))->doctors()->attach([$doctorNine->id, $doctorTen->id, $doctorEleven->id, $doctorTwelve->id]);
     Enemy::create(array('name' => 'Sontarans', 'description' => 'An aggressive clone-warrior race from Sontar, who travel in spherical ships, the Sontarans were engaged in a war lasting many thousands of years with the Rutans. In pursuit of the advantage, Commander Linx of the Fifth Sontaran Battle Group tried to invade 13th century Earth, until repelled by the Third Doctor. Later meetings with the Doctor saw the Sontarans invading the Time Lord home planet of Gallifrey, forcing the Sixth Doctor to build them a time travel machine, and trying to covert Earth’s atmosphere into one suitable for warrior cloning using the ATMOS machines. Sarah Jane Smith later encountered – and defeated – the last survivor of that invasion, Commander Kaagh.', 'image' => 'http://thedoctor.coderfaire/assets/img/enemies/sontarans.png'))->doctors()->attach([$doctorTen->id, $doctorEleven->id]);
     Enemy::create(array('name' => 'The Silence', 'description' => 'Rather than a specific race, The Silence are a religious order. Their agents on Earth have been there since before the dawn of mankind, directing human evolution. They use post-hypnotic suggestion to make people who see them instantly forget their existence. They believe that silence must fall when the oldest Question in the universe is asked. It will be asked at “the fall of the Eleventh” on the Fields of Trenzalore, and is hidden in plain sight. As a result, the Silence have tried to stop the Doctor reaching Trenzalore. They used their agent Madame Kovarian to kidnap Melody Pond, and raised her as the Doctor’s perfect assassin. Despite the failure of this plan, the Silence remain at large, determined to stop the Question ever being asked.', 'image' => 'http://thedoctor.coderfaire/assets/img/enemies/the-silence.png'))->doctors()->attach([$doctorEleven->id]);
     Enemy::create(array('name' => 'Weeping Angels', 'description' => 'Known as “The Lonely Assassins”, the Weeping Angels are quantum-locked alien killers, as old as the universe itself. Little is known of their origins or culture. When observed, they freeze like stone, but in the blink of an eye they can move vast distances. The touch of an Angel hurls their victim back in time – allowing the Angel to feast on the energy of their unlived days. Initially, the Tenth Doctor encountered four Angels, who sent him back to 1969. He left clues for Sally Sparrow to find and help trap them – releasing him and the TARDIS. Later encounters have seen a whole mausoleum of statues, tiny cherubs and even the Statue of Liberty transformed into Weeping Angels. Both Amy and Rory were trapped by a Weeping Angel, when it sent them back to 1938 to live out their lives together. In the 51st Century, the Doctor trapped the Angels in a crack in time, erasing them from history.', 'image' => 'http://thedoctor.coderfaire/assets/img/enemies/weeping-angels.png'))->doctors()->attach([$doctorTen->id, $doctorEleven->id]);
 }
示例#25
0
 /**
  * Display a listing of the resource.
  * GET /accounts
  *
  * @return Response
  */
 public function doctorsAccountCreate()
 {
     if (Auth::user()->access_level == '1') {
         // Build the validation constraint set.
         $rules = array('field_email' => 'required|email', 'field_password' => 'required|min:3|confirmed', 'field_password' => 'required|min:3', 'field_name' => 'required', 'field_dob' => 'required', 'field_gender' => 'required', 'field_specialty' => 'required', 'field_workingHours' => 'required', 'availabilty' => 'required');
         $data = Input::all();
         // Create a new validator instance.
         $validator = Validator::make($data, $rules);
         if ($validator->passes()) {
             $user = new User();
             $user->email = Input::get('field_email');
             $user->password = Hash::make(Input::get('field_password'));
             $user->access_level = '2';
             if ($user->save()) {
                 $doctor = new Doctor();
                 $doctor->name = Input::get('field_name');
                 $doctor->dob = Input::get('field_dob');
                 $doctor->gender = Input::get('field_gender');
                 $doctor->specialty = Input::get('field_specialty');
                 $doctor->working_hourse = Input::get('field_workingHours');
                 $doctor->unavailability = Input::get('availabilty');
                 $doctor->user_id = $user->id;
                 if ($doctor->save()) {
                     return Redirect::route('user.registration_form', array('whose' => 'doctors_form'))->with('success', 'Registration Successful');
                 } else {
                     return Redirect::route('user.registration_form', array('whose' => 'doctors_form'))->withErrors($doctor);
                 }
             } else {
                 return Redirect::route('user.registration_form', array('whose' => 'doctors_form'))->withErrors($user);
             }
         }
         return Redirect::route('user.registration_form', array('whose' => 'doctors_form'))->withErrors($validator);
     } else {
         return 'You dont have access to this level';
     }
 }
示例#26
0
 public function actionRecent()
 {
     $doctors = Doctor::model()->findAll();
     $recentOutpatients = new MedicalRecord('search');
     $recentOutpatients->unsetAttributes();
     if (isset($_GET['MedicalRecord'])) {
         $recentOutpatients->attributes = $_GET['MedicalRecord'];
     }
     $recentSurgeries = new SurgeryRecord('search');
     $recentSurgeries->unsetAttributes();
     if (isset($_GET['SurgeryRecord'])) {
         $recentSurgeries->attributes = $_GET['SurgeryRecord'];
     }
     $this->render('index', compact('recentOutpatients', 'recentSurgeries', 'doctors'));
 }
 public function invoke()
 {
     if (isset($_POST['CheckCustomer'])) {
         $user = new User();
         $doctorID = $user->getID();
         $customer = new Customer();
         $customerID = $customer->getIDByNationalNb();
         $customerName = $customer->getNameByNationalNb();
         $doctor = new Doctor();
         $myResult = $doctor->getTreatmentsByCustomerNationalNb();
         $myResult1 = $doctor->getTreatmentsByCustomerNationalNb();
         $exaView = new ExaminationView();
         if ($row = mysql_fetch_assoc($myResult)) {
             $exaView->showTreatments($myResult1, $doctorID, $customerID, $customerName);
         } else {
             $myResult = $customer->getInfoByNationalNb();
             if ($row = mysql_fetch_assoc($myResult)) {
                 $exaView->showCustomerInfo($row, $doctorID, $customerID, $customerName);
             } else {
                 $exaView->showUnavailable();
             }
         }
     }
 }
示例#28
0
 public function run()
 {
     DB::table('ratings')->delete();
     // Going to randomize all our ratings for our users, so throw everything in
     // an array.
     $toRate = array(array('item' => Doctor::where('number', 9)->first(), 'type' => 'doctor'), array('item' => Doctor::where('number', 10)->first(), 'type' => 'doctor'), array('item' => Doctor::where('number', 11)->first(), 'type' => 'doctor'), array('item' => Doctor::where('number', 12)->first(), 'type' => 'doctor'), array('item' => Enemy::where('name', 'Cybermen')->first(), 'type' => 'enemy'), array('item' => Enemy::where('name', 'Daleks')->first(), 'type' => 'enemy'), array('item' => Enemy::where('name', 'Sontarans')->first(), 'type' => 'enemy'), array('item' => Enemy::where('name', 'The Silence')->first(), 'type' => 'enemy'), array('item' => Enemy::where('name', 'Weeping Angels')->first(), 'type' => 'enemy'), array('item' => Companion::where('name', 'Amy Pond')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Captain Jack')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Clara Oswald')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Donna Noble')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Martha Jones')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Mickey Smith')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'River Song')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Rory Williams')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Rose Tyler')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Wilfred Mott')->first(), 'type' => 'companion'), array('item' => Episode::where('season', 1)->where('episode', 1)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 1)->where('episode', 6)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 1)->where('episode', 10)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 1)->where('episode', 12)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 2)->where('episode', 5)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 2)->where('episode', 12)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 3)->where('episode', 9)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 3)->where('episode', 10)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 4)->where('episode', 4)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 4)->where('episode', 13)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 5)->where('episode', 3)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 5)->where('episode', 4)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 5)->where('episode', 12)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 6)->where('episode', 1)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 6)->where('episode', 10)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 6)->where('episode', 13)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 7)->where('episode', 5)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 7)->where('episode', 12)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 8)->where('episode', 2)->first(), 'type' => 'episode'));
     $users = User::get();
     // Loop through our users
     foreach ($users as $user) {
         // Loop through things to be rated
         foreach ($toRate as $item) {
             $rating = rand(1, 5);
             Rating::create(array('user_id' => $user->id, 'item_id' => $item['item']->id, 'item_type' => $item['type'], 'rating' => $rating));
         }
     }
 }
 public function actionUpdate($id)
 {
     $model = $this->loadModel($id);
     $patient = $model->patient;
     $doctors = Doctor::model()->findAll();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['SurgeryRecord'])) {
         $model->attributes = $_POST['SurgeryRecord'];
         if ($model->save()) {
             Yii::app()->user->setFlash('success', '儲存成功.');
             $this->redirect($this->createUrl('/patient/update/', array('id' => $patient->id)));
         }
     }
     $this->render('update', array('patient' => $patient, 'model' => $model, 'doctors' => $doctors));
 }
 /**
  * Authenticates a user.
  * @return boolean whether authentication succeeds.
  */
 public function authenticate()
 {
     if ($this->user_type == 1 || $this->user_type == 2) {
         $criteria = new CDbCriteria();
         $criteria->condition = 'LOWER(mid)=' . strtolower($this->username) . ' AND management_user_level_id=' . $this->user_type;
         $user = Management::model()->find($criteria);
     } else {
         if ($this->user_type == 4) {
             $user = Doctor::model()->find('LOWER(did)=?', array(strtolower($this->username)));
         } else {
             if ($this->user_type == 3) {
                 $user = Patient::model()->find('LOWER(pid)=?', array(strtolower($this->username)));
             } else {
                 $user = Nurses::model()->find('LOWER(nid)=?', array(strtolower($this->username)));
             }
         }
     }
     if ($user === null) {
         $this->errorCode = self::ERROR_USERNAME_INVALID;
     } else {
         if (!($user->pass == $this->password)) {
             $this->errorCode = self::ERROR_PASSWORD_INVALID;
         } else {
             if ($this->user_type == 1 || $this->user_type == 2) {
                 $this->_id = $user->mid;
                 $this->username = $user->mid;
             } else {
                 if ($this->user_type == 4) {
                     $this->_id = $user->did;
                     $this->username = $user->did;
                 } else {
                     if ($this->user_type == 3) {
                         $this->_id = $user->pid;
                         $this->username = $user->pid;
                     } else {
                         $this->_id = $user->nid;
                         $this->username = $user->nid;
                     }
                 }
             }
             $this->_type = $this->user_type;
             $this->errorCode = self::ERROR_NONE;
             $this->setState("type", $this->_type);
         }
     }
     return $this->errorCode == self::ERROR_NONE;
 }