当前位置: 首页>>代码示例>>PHP>>正文


PHP JsonResponse::message方法代码示例

本文整理汇总了PHP中JsonResponse::message方法的典型用法代码示例。如果您正苦于以下问题:PHP JsonResponse::message方法的具体用法?PHP JsonResponse::message怎么用?PHP JsonResponse::message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JsonResponse的用法示例。


在下文中一共展示了JsonResponse::message方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: elseif

         if ($patientUp) {
             // change status of emergency table of emergency patient from 1 to 2;
             //create new Editinfo for updating emergency to enable rollback functionality.
             $status = 2;
             $emergencyreg = $patient_id;
             $change = 0;
             if ($result != 0) {
                 $change = $patientController->changeEmergencyStatus($emergencyreg, 2);
             }
             // var_dump($result);
             if ($change == 0 || $change == 1 || $result == 0) {
                 if ($change != 0) {
                     echo JsonResponse::message(1, "Emergency Patient sucessfully upgraded");
                 }
                 if ($result == 0) {
                     echo JsonResponse::message(1, "Patient sucessfully updated");
                 }
                 exit;
             }
         } else {
             //        print_r($_REQUEST);
             echo JsonResponse::error("Error upgrading patient.");
             exit;
         }
     } else {
         echo JsonResponse::error("Patient not set");
     }
 } elseif ($intent == 'getRegNos') {
     $patientController = new PatientController();
     $regNos = $patientController->getExistingPatientRegNos();
     if (is_array($regNos)) {
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_patient.php

示例2: elseif

        $response = $warden->deleteBed($_POST[BedTable::bed_id]);
        if (is_array($response)) {
            echo JsonResponse::error($response[P_MESSAGE]);
            exit;
        } else {
            echo JsonResponse::message(STATUS_OK, "Bed successfully deleted!");
            exit;
        }
    } else {
        echo JsonResponse::error("Incomplete request parameters!");
        exit;
    }
} elseif ($intent == 'deleteWard') {
    if (isset($_POST[WardRefTable::ward_ref_id])) {
        $warden = new WardController();
        $response = $warden->deleteWard($_POST[WardRefTable::ward_ref_id]);
        if (is_array($response)) {
            echo JsonResponse::error($response[P_MESSAGE]);
            exit;
        } else {
            echo JsonResponse::message(STATUS_OK, "Ward deletion successful!");
            exit;
        }
    } else {
        echo JsonResponse::error("Incomplete request parameters!");
        exit;
    }
} else {
    echo JsonResponse::error("Invalid intent!");
    exit;
}
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_ward.php

示例3: array

        $change = $authenticator->changePassword($_REQUEST['userid'], $_REQUEST['passcode'], $status);
        if ($change) {
            //DESTROY SESSION TO LOG USER OUT
            CxSessionHandler::destroy();
            //CONSTRUCT RESPONSE
            $response = array();
            $response[P_MESSAGE] = "Password change successful!";
            //SET MESSAGE FOR USER ON NEXT LOGIN
            CxSessionHandler::setViewBag("You just changed your password. Log in again with your new password.");
            //ECHO RESPONSE
            echo JsonResponse::success($response);
            exit;
        } else {
            echo JsonResponse::error("Unable to change password! Please try again.");
            exit;
        }
    } else {
        echo JsonResponse::error('Incomplete request parameters!');
        exit;
    }
} elseif ($intent == "logout") {
    $authenticator = new AuthenticationController();
    $userid = CxSessionHandler::getItem(UserAuthTable::userid);
    $authenticator->flagUserOffline($userid);
    CxSessionHandler::destroy();
    echo JsonResponse::message(STATUS_OK, "Logout successful");
    exit;
} else {
    echo JsonResponse::error('Invalid intent!');
    exit;
}
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_auth.php

示例4: elseif

    }
} elseif ($intent == 'restoreStaff') {
    // check that userid of staff to be deleted is specified
    if (!isset($_POST['userid'])) {
        echo JsonResponse::error("Incomplete parameters for restoring user!");
        exit;
    }
    $userid = $_POST['userid'];
    $userController = new UserController();
    $feedback = $userController->restoreUser($userid);
    if (is_array($feedback) && $feedback[JsonResponse::P_STATUS] == STATUS_ERROR) {
        echo JsonResponse::error($feedback[JsonResponse::P_MESSAGE]);
        exit;
    }
    if ($feedback) {
        echo JsonResponse::message(STATUS_OK, "Successfully restored user!");
        exit;
    } else {
        echo JsonResponse::error("Could not restore this user. Try again!");
        exit;
    }
} elseif ($intent == 'addProfile') {
    if (isset($_REQUEST['profileInfo'])) {
        $profileInfo = $_REQUEST['profileInfo'];
        $userController = new UserController();
        if ($userController->addProfile($profileInfo)) {
            echo JsonResponse::success("Profile Successfully Added!");
            exit;
        } else {
            echo JsonResponse::error("Could not update Profile. Please try again!");
            exit;
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_admin.php

示例5: RoleController

    if (isset($_REQUEST['permission_role_id'])) {
        $conductor = new RoleController();
        $response = $conductor->dismissRole($_REQUEST['permission_role_id']);
        if ($response[P_STATUS] == STATUS_OK) {
            echo JsonResponse::message(STATUS_OK, 'Role assignment removed successfully!');
            exit;
        } else {
            //die(var_dump($response));
            echo JsonResponse::error($response[P_MESSAGE]);
            exit;
        }
    } else {
        echo JsonResponse::error('Incomplete request parameters!');
        exit;
    }
} elseif ($intent == "updatePermission") {
    if (isset($_REQUEST['permission_role_id'], $_REQUEST['staff_permission_id'])) {
        $conductor = new RoleController();
        $response = $conductor->updatePermission($_REQUEST['permission_role_id'], $_REQUEST['staff_permission_id']);
        if ($response[P_STATUS] == STATUS_OK) {
            echo JsonResponse::message(STATUS_OK, 'Permission update successful!');
            exit;
        } else {
            echo JsonResponse::error($response[P_MESSAGE]);
            exit;
        }
    } else {
        echo JsonResponse::error('Incomplete request parameters!');
        exit;
    }
}
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_role.php

示例6: VitalsController

if ($intent == 'addVitals') {
    if (isset($_POST[VitalsTable::patient_id], $_POST[VITALS])) {
        $added_by = CxSessionHandler::getItem(UserAuthTable::userid);
        $vitals_data = $_POST[VITALS];
        $valid_vitals = VitalsController::validateVitals($vitals_data);
        if (is_array($valid_vitals)) {
            $vitals_data = $valid_vitals;
        } else {
            echo JsonResponse::error("Invalid vitals data!");
            exit;
        }
        $vitals_data[VitalsTable::patient_id] = $_POST[VitalsTable::patient_id];
        $nurse = new VitalsController();
        $response = $nurse->addVitals($vitals_data, $added_by);
        if ($response) {
            echo JsonResponse::message(STATUS_OK, "Vitals added successfully!");
            exit;
        } else {
            echo JsonResponse::error("Unable to add vitals!");
            exit;
        }
    } else {
        echo JsonResponse::error("Incomplete request parameters!");
        exit;
    }
} elseif ($intent == 'getVitals') {
    if (isset($_REQUEST[VitalsTable::patient_id])) {
        $nurse = new VitalsController();
        $response = $nurse->getVitals($_REQUEST[VitalsTable::patient_id]);
        if (is_array($response)) {
            if (isset($response[P_STATUS])) {
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_vitals.php

示例7: elseif

        } else {
            echo JsonResponse::error("Unable to mark message as read!");
            exit;
        }
    } else {
        echo JsonResponse::error("Incomplete request parameters!");
        exit;
    }
} elseif ($intent == 'markAsUnread') {
    if (isset($_REQUEST[CommunicationTable::msg_id])) {
        $userid = CxSessionHandler::getItem(UserAuthTable::userid);
        /*$userid = 2;*/
        $announcer = new CommunicationController();
        $response = $announcer->markAsUnread($userid, $_REQUEST[CommunicationTable::msg_id]);
        if ($response) {
            echo JsonResponse::message(STATUS_OK, "Successfully marked as unread!");
            exit;
        } else {
            echo JsonResponse::error("Unable to mark message as unread!");
            exit;
        }
    } else {
        echo JsonResponse::error("Incomplete request parameters!");
        exit;
    }
} elseif ($intent == 'searchContact') {
    if (isset($_REQUEST['term'])) {
        $userid = CxSessionHandler::getItem(UserAuthTable::userid);
        $name = $_REQUEST["term"];
        $controller = new UserController();
        $response = $controller->searchByName($userid, $name);
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_communication.php

示例8: elseif

        exit;
    }
} elseif ($intent == 'pollQueue') {
    if (isset($_REQUEST[LMT])) {
        $lmt = $_REQUEST[LMT];
        $usher = new ArrivalController();
        $change = false;
        for ($i = 0; $i < MAX_NUM_POLL; $i++) {
            $change = $usher->changeInQueue($lmt);
            if ($change) {
                echo JsonResponse::message(STATUS_OK, "Patient queue modified!");
                exit;
            }
            sleep(POLLING_SLEEP_TIME);
            $i += 1;
        }
        if ($usher->changeInQueue($lmt)) {
            echo JsonResponse::message(STATUS_OK, "Patient queue modified!");
            exit;
        } else {
            echo JsonResponse::error("No change in queue!");
            exit;
        }
    } else {
        echo JsonResponse::error("Incomplete request parameters!");
        exit;
    }
} else {
    echo JsonResponse::error("Invalid intent");
    exit;
}
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_patient_arrival.php

示例9: elseif

        if ($response) {
            echo JsonResponse::message(STATUS_OK, "Admission request successful!");
            exit;
        } else {
            echo JsonResponse::error("Unable to request admission!");
            exit;
        }
    } else {
        echo JsonResponse::error("Incomplete request parameters!");
        exit;
    }
} elseif ($intent == 'getAdmissionRequests') {
    $response = AdmissionController::admissionRequests();
    if (is_array($response)) {
        if (isset($response[P_MESSAGE])) {
            echo JsonResponse::message($response[P_STATUS], $response[P_MESSAGE]);
            exit;
        } else {
            echo JsonResponse::success($response[P_DATA]);
            exit;
        }
    } else {
        echo JsonResponse::error("Unable to get pending admission requests!");
        exit;
    }
} elseif ($intent == 'searchAdmissionRequests') {
    if (isset($_REQUEST[TERM])) {
        $warden = new AdmissionController();
        $patient_details = $warden->searchAdmissionRequests($_REQUEST[TERM]);
        if (is_array($patient_details)) {
            echo json_encode($patient_details);
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_admission_request.php

示例10: elseif

        $response = $warden->logEncounter($personnel_id, $_REQUEST[AdmissionTable::patient_id], $_REQUEST[AdmissionTable::admission_id], $_REQUEST[EncounterTable::comments], $vitals_data);
        if ($response) {
            echo JsonResponse::message(STATUS_OK, "Encounter logged successfully!");
            exit;
        } else {
            echo JsonResponse::error("Unable to log encounter!");
            exit;
        }
    } else {
        echo JsonResponse::error("Incomplete request parameters!");
        exit;
    }
} elseif ($intent == 'switchBed') {
    if (isset($_POST[AdmissionBedTable::admission_id], $_POST[AdmissionBedTable::bed_id])) {
        $warden = new AdmissionController();
        $response = $warden->switchBed($_POST[AdmissionBedTable::admission_id], $_POST[AdmissionBedTable::bed_id]);
        if (is_array($response)) {
            echo JsonResponse::error($response[P_MESSAGE]);
            exit;
        } else {
            echo JsonResponse::message(STATUS_OK, "Bed successfully assigned!");
            exit;
        }
    } else {
        echo JsonResponse::error("Incomplete request parameters!");
        exit;
    }
} else {
    echo JsonResponse::error("Invalid intent!");
    exit;
}
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_admission.php

示例11: array

require_once '../_core/global/_require.php';
Crave::requireAll(GLOBAL_VAR);
Crave::requireFiles(UTIL, array('SqlClient', 'JsonResponse', 'CxSessionHandler'));
Crave::requireFiles(MODEL, array('BaseModel', 'UserModel'));
Crave::requireFiles(CONTROLLER, array('LookoutController', 'AuthenticationController'));
if (isset($_REQUEST['intent'])) {
    $intent = $_REQUEST['intent'];
} else {
    echo JsonResponse::error("Intent not set!");
    exit;
}
if ($intent == 'markPresence') {
    $userid = CxSessionHandler::getItem(UserAuthTable::userid);
    if ($userid == NULL) {
        echo JsonResponse::error("User not logged in!");
        exit;
    }
    $inspector = new LookoutController();
    $marked = $inspector->markPresence($userid);
    if ($marked) {
        echo JsonResponse::message(STATUS_OK, "User marked present!");
        exit;
    } else {
        echo JsonResponse::error("Unable to mark user present!");
        exit;
    }
} elseif ($intent == 'sweep') {
    $sweepResult = LookoutController::sweep();
    var_dump($sweepResult);
}
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:30,代码来源:phase_lookout.php


注:本文中的JsonResponse::message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。