function __construct()
 {
     parent::__construct();
     // Models
     $this->load->model('Doctor_model');
     $this->load->model('Schedule_model');
     $this->load->model('user_model');
     // Initialize static variables
     appointments::$user_id = $this->User_model->get_user_id();
     appointments::$date = $this->date();
 }
Exemplo n.º 2
0
         }
     }
     $returnList = substr($returnList, 0, -1);
     echo $returnList;
     break;
 case "resize":
     $htmlID = $_POST['htmlID'];
     // format timeslotsThursday23-10-200809:30
     $end = $_POST['end'];
     // format is 10:30
     $start = '06:00';
     // just need to pass in a dummy, not used
     $datetimes = convertDateTimes($htmlID, $start, $end);
     $end = $datetimes['end'];
     // first check that the resize doesn't go over any other appointments
     $checkEndDate = new appointments();
     $queryCheckEndDate = 'username="******" AND appt_start <= "' . $end . '" AND appt_end >= "' . $end . '" AND htmlid <> "' . $htmlID . '"';
     $checkEndArray = $checkEndDate->Find($queryCheckEndDate);
     if (count($checkEndArray) > 0) {
         // die("0:" . $queryCheckStartDate. "::" . $queryCheckEndDate ."::" . count($checkStartArray) .'::'. count($checkEndArray) );
         die("0:Failure to save");
     }
     $resizeQuery = 'UPDATE appointments SET appt_end = "' . $end . '" WHERE username = "******" AND htmlid = "' . $htmlID . '"';
     $ok = $DB->Execute($resizeQuery);
     if (!$ok) {
         $err = $DB->ErrorMsg();
         die($err);
     }
     echo 'SUCCESS: resized successfully.';
     break;
 case "returnInitialHTML":