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


PHP JsonResponse::error方法代码示例

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


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

示例1: datesIncluded

 public static function datesIncluded()
 {
     if (!isset($_REQUEST[START_DATE], $_REQUEST[END_DATE])) {
         echo JsonResponse::error("Incomplete request parameters!");
         exit;
     }
 }
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:7,代码来源:ReportController.php

示例2: elseif

        if ($response) {
            echo JsonResponse::success("Profile Successfully Updated!");
            exit;
        } else {
            echo JsonResponse::error("Could not update Profile. Please try again!");
            exit;
        }
    } else {
        echo JsonResponse::error("Profile data not set");
        exit;
    }
} elseif ($intent == 'getProfile') {
    if (isset($_REQUEST['userid'])) {
        $userid = $_REQUEST['userid'];
        $userController = new UserController();
        $profile = $userController->getUserProfile($userid);
        if ($profile && is_array($profile)) {
            echo JsonResponse::success($profile);
            exit;
        } else {
            echo JsonResponse::error("Could not fetch user profile. Please try again later.");
            exit;
        }
    } else {
        echo JsonResponse::error("Expected parameter not set");
        exit;
    }
} else {
    echo JsonResponse::error('Invalid intent!');
    exit;
}
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_profile.php

示例3: 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

示例4: elseif

        } else {
            echo JsonResponse::error("No test found for this patient");
            exit;
        }
    } else {
        echo JsonResponse::error("Please select a lab type");
        exit;
    }
} elseif ($intent == 'labRequest') {
    if (isset($_REQUEST['labType'])) {
        $type = $_REQUEST['labType'];
        $doctorId = intval(CxSessionHandler::getItem('userid'));
        $treatmentId = intval($_REQUEST['treatmentId']);
        $encounterId = isset($_REQUEST['encounterId']) ? $_REQUEST['encounterId'] : 0;
        $description = isset($_REQUEST['description']) ? $_REQUEST['description'] : "";
        $lab = new LaboratoryController();
        $result = $lab->requestLabTest($type, $doctorId, $treatmentId, $encounterId, $description);
        if ($result) {
            echo JsonResponse::success("Request successful");
            exit;
        } else {
            echo JsonResponse::error("Request unsuccessful. Try again!");
            exit;
        }
    } else {
        echo JsonResponse::error("Please select a lab type");
        exit;
    }
} else {
    JsonResponse::error("No intent set");
}
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_treatment.php

示例5: elseif

    if (is_array($result)) {
        echo JsonResponse::success($result);
        exit;
    } else {
        echo JsonResponse::error("Unable to retrieve in-patient report for the specified dates!");
        exit;
    }
} elseif ($intent == 'consultationReport') {
    ReportController::datesIncluded();
    $result = ReportController::consultationReport();
    if (is_array($result)) {
        echo JsonResponse::success($result);
        exit;
    } else {
        echo JsonResponse::error("Unable to retrieve consultation report for the specified dates!");
        exit;
    }
} elseif ($intent == 'patientDiagnosis') {
    ReportController::datesIncluded();
    $result = ReportController::patientDiagnosis();
    if (is_array($result)) {
        echo JsonResponse::success($result);
        exit;
    } else {
        echo JsonResponse::error("Unable to retrieve patient diagnosis report for the specified dates!");
        exit;
    }
} else {
    echo JsonResponse::error("Invalid request intent!");
    exit;
}
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_report.php

示例6: 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

示例7: JsonResponse

<?php

$response = new JsonResponse();
try {
    if (!filter_var(r('email'), FILTER_VALIDATE_EMAIL)) {
        throw new Exception("Please provide valid email address!");
    }
    if (!($subscriber = LingopandaSubscribers::findRow('email = ?', r('email')))) {
        $subscriber = new LingopandaSubscribers();
        $subscriber->email = r('email');
        $subscriber->firstname = r('firstname');
        $subscriber->lastname = r('lastname');
        $subscriber->created = dbtime();
        $subscriber->id = $subscriber->insert();
    }
    $response->data = $subscriber;
    $response->send();
} catch (Exception $e) {
    $response->error($e->getMessage());
}
开发者ID:avramishin,项目名称:lingopanda,代码行数:20,代码来源:add.php

示例8: elseif

    }
} 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);
            exit;
        } else {
            echo JsonResponse::error("No patients match the search parameter!");
            exit;
        }
    } else {
        echo JsonResponse::error("Incomplete request parameters!");
        exit;
    }
}
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_admission_request.php

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