本文整理汇总了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 {