Initial commit with updated Auth and media ignored
This commit is contained in:
30
ride/rate/add.php
Normal file
30
ride/rate/add.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../../connect.php';
|
||||
|
||||
$passenger_id = filterRequest("passenger_id");
|
||||
$driverID = filterRequest("driverID");
|
||||
$rideId = filterRequest("rideId");
|
||||
$rating = filterRequest("rating");
|
||||
$comment = filterRequest("comment");
|
||||
|
||||
$sql = "INSERT INTO `ratingPassenger` (
|
||||
`passenger_id`, `driverID`, `rideId`, `rating`, `comment`
|
||||
) VALUES (
|
||||
:passenger_id, :driverID, :rideId, :rating, :comment
|
||||
)";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindParam(':passenger_id', $passenger_id);
|
||||
$stmt->bindParam(':driverID', $driverID);
|
||||
$stmt->bindParam(':rideId', $rideId);
|
||||
$stmt->bindParam(':rating', $rating);
|
||||
$stmt->bindParam(':comment', $comment);
|
||||
|
||||
$stmt->execute();
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
jsonSuccess(null, "Rate inserted successfully");
|
||||
} else {
|
||||
jsonError("Failed to save rating information");
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user