Initial commit with updated Auth and media ignored
This commit is contained in:
25
ride/driverPayment/add.php
Normal file
25
ride/driverPayment/add.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../../connect.php';
|
||||
|
||||
$amount = filterRequest("amount");
|
||||
$paymentMethod = filterRequest("payment_method");
|
||||
$driverID = filterRequest("driverID");
|
||||
|
||||
$sql = "INSERT INTO `paymentsDriverPoints` (`amount`, `payment_method`, `driverID`)
|
||||
VALUES ('$amount', '$paymentMethod', '$driverID')";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute();
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
|
||||
$insertedID = $con->lastInsertId(); // Get the last inserted ID
|
||||
jsonSuccess($message = $insertedID);
|
||||
} else {
|
||||
$response = array(
|
||||
"success" => false,
|
||||
"message" => "Failed to save payment data"
|
||||
);
|
||||
echo json_encode($response);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user