public function autocompletedoctorAction()
 {
     $term = $this->_request->getParam('term');
     $doctorModel = new DoctorModel();
     $covenants = $doctorModel->fetchAll($doctorModel->getPersonByDoctor($term));
     $json = '[';
     $first = true;
     foreach ($covenants as $row) {
         if (!$first) {
             $json .= ',';
         } else {
             $first = false;
         }
         $json .= json_encode(array("id" => $row['cddoctor'], "value" => $row['nmperson']));
     }
     $json .= ']';
     echo $json;
 }
Example #2
0
include "lib/" . $dbtype . "/inputCheck.php";
// getting all possible and valid action URL
$possible_url = array("get_casetype", "get_all_doctor", "get_doctor_info", "get_all_patient", "get_patient_dtl", "get_appt_lst", "get_appt_dtl", "save_appt_dtl", "upd_appt_dtl", "get_all_calendar", "appt_cleanup");
$value = "An error has occurred getting JSON value.";
if (isset($_GET["action"]) && in_array($_GET["action"], $possible_url)) {
    switch ($_GET["action"]) {
        case "get_all_doctor":
            $DoctorModel = new DoctorModel($conn);
            $value = $DoctorModel->get_all_doctor($_GET["term"]);
            break;
        case "get_doctor_info":
            $DoctorModel = new DoctorModel($conn);
            $value = $DoctorModel->get_doctor_info($_GET["id"]);
            break;
        case "get_casetype":
            $DoctorModel = new DoctorModel($conn);
            $value = $DoctorModel->get_casetype($_GET["id"]);
            break;
        case "get_all_patient":
            $PatientModel = new PatientModel($conn);
            $value = $PatientModel->get_all_patient($_GET["typ"], $_GET["term"]);
            break;
        case "get_patient_dtl":
            $PatientModel = new PatientModel($conn);
            $value = $PatientModel->get_patient_dtl($_GET["patid"]);
            break;
        case "appt_cleanup":
            $CalendarModel = new CalendarModel($conn);
            $value = $CalendarModel->appt_cleanup();
            break;
        case "get_appt_lst":