當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DbHandler::getSpot方法代碼示例

本文整理匯總了PHP中DbHandler::getSpot方法的典型用法代碼示例。如果您正苦於以下問題:PHP DbHandler::getSpot方法的具體用法?PHP DbHandler::getSpot怎麽用?PHP DbHandler::getSpot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DbHandler的用法示例。


在下文中一共展示了DbHandler::getSpot方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: function

});
$app->post('/reportSpotIssue', function () use($app) {
    verifyRequiredParams(array('userId', 'spotId', 'airdata', 'seadata', 'cam'));
    $response = array();
    // reading post params
    //$email = $app->request()->post('email');
    //$user_id = $app->request()->post('userId');
    $spotId = $app->request()->post('spotId');
    $airdata = $app->request()->post('airdata');
    $seadata = $app->request()->post('seadata');
    $cam = $app->request()->post('cam');
    //global $user_id;
    $db = new DbHandler();
    //$res = $db->toggleFavourite($email, $spotId);
    $res = $db->reportIssue($user_id, $spotId, $airdata, $seadata, $cam);
    $spot = $db->getSpot($spotId);
    $user = $db->getUserById($user_id);
    $response = array();
    $response["airdata"] = $airdata;
    $response["seadata"] = $seadata;
    $response["cam"] = $cam;
    if ($res == ISSUE_LOGGED_SUCCESSFULLY) {
        //try send email here
        sendErrorReport($user, $spot, $airdata, $seadata, $cam);
        $response["error"] = false;
        $response["message"] = "Thanks for letting us know there's a problem.<br>We'll contact you should we require more details.";
    } else {
        if ($res == ISSUE_LOG_FAILED) {
            $response["error"] = true;
            $response["message"] = 'Oops! We are unable to log an issue for this spot.';
        } else {
開發者ID:AshKetchumza,項目名稱:Wavey,代碼行數:31,代碼來源:index.php


注:本文中的DbHandler::getSpot方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。