$postreview = true; } if (isset($_POST['rating']) && $_POST['rating'] != '') { $postreview = true; } if (isset($_GET['products_id']) && $_GET['products_id'] != '') { $isproduct = true; $product['id'] = $_GET['products_id']; } else { $product['id'] = ''; $isproduct = false; } if ($postreview) { $allowrev = false; $temp = $_POST; if (postReview($temp)) { $error = false; $allowrev = false; } else { $error = true; $allowrev = true; } } //This is a product page so reviews are possible if ($isproduct) { //if (ONE_REVIEW_AT_A_TIME == 'true') { /****************************************************\ * Check cookie if this article has been * * reviewed yet. If it has, don't allow * * a new review. * \****************************************************/
DESCRIPTION: Used for all the different kinds of queries the SplitRide application would require. Each Query is a different function of request in the file. */ //Connect Connection Script include "connection.php"; ini_set('display_errors', 'On'); error_reporting(E_ALL | E_STRICT); //determine the which query to form $query_func = $_REQUEST['q']; switch ($query_func) { case 'post_review': $reviewer = $_COOKIE['userID']; $driver = $_REQUEST['driver']; $content = $_REQUEST['content']; $rating = $_REQUEST['rating']; echo postReview($driver, $reviewer, $content, $rating); break; case 'get_reviews': $driver = $_REQUEST['driver']; echo getReviews($driver); break; case 'get_user_recent_trips': $userID = $_COOKIE['userID']; $trips = getUserRecentTrips($userID); echo $trips; break; case 'search': $words = $_REQUEST['words']; echo searchALL($words); break; case 'start_following':