first commit

This commit is contained in:
Hamza-Ayed
2026-06-09 08:40:31 +03:00
commit d8901e1a87
3161 changed files with 536187 additions and 0 deletions

32
backend/ride/tips/add.php Executable file
View File

@@ -0,0 +1,32 @@
<?php
require_once __DIR__ . '/../../connect.php';
// استلام المتغيرات
$passengerID = filterRequest("passengerID");
$driverID = filterRequest("driverID");
$rideID = filterRequest("rideID");
$tipAmount = filterRequest("tipAmount");
// تحقق من صحة قيمة البقشيش
if (!is_numeric($tipAmount) || $tipAmount < 0 || $tipAmount > 99999999.99) {
jsonError("Invalid tip amount.");
exit();
}
// إدراج بيانات البقشيش
$sql = "INSERT INTO `tips` (`driverID`, `passengerID`, `rideID`, `tipAmount`)
VALUES (:driverID, :passengerID, :rideID, :tipAmount)";
$stmt = $con->prepare($sql);
$stmt->bindParam(':driverID', $driverID);
$stmt->bindParam(':passengerID', $passengerID);
$stmt->bindParam(':rideID', $rideID);
$stmt->bindParam(':tipAmount', $tipAmount);
// تنفيذ العملية
if ($stmt->execute() && $stmt->rowCount() > 0) {
jsonSuccess(null, "Tip inserted successfully");
} else {
jsonError("Failed to save tip information");
}
?>