本文整理匯總了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 {