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

View File

@@ -0,0 +1,33 @@
<?php
require_once __DIR__ . '/../connect.php';
// Sanitize and retrieve input parameters
$driverId = filterRequest("driverId");
$notes = filterRequest("notes");
// SQL: Insert or Update if already exists
$sql = "INSERT INTO `welcomeDriverCall` (`driverId`, `isCall`, `notes`)
VALUES (:driverId, '1', :notes)
ON DUPLICATE KEY UPDATE
`isCall` = '1',
`notes` = VALUES(`notes`),
`createdAt` = NOW()";
// Prepare the statement
$stmt = $con->prepare($sql);
// Bind parameters
$stmt->bindParam(':driverId', $driverId);
$stmt->bindParam(':notes', $notes);
// Execute the statement
$success = $stmt->execute();
if ($success) {
jsonSuccess(null, "Record inserted/updated successfully");
} else {
jsonError("Failed to insert or update record");
}
?>