27 lines
627 B
PHP
27 lines
627 B
PHP
<?php
|
|
|
|
include "../connect.php";
|
|
|
|
// Retrieve and sanitize input parameters
|
|
$driverId = filterRequest("driverId");
|
|
$notes = filterRequest("notes");
|
|
|
|
|
|
// SQL query to insert a new note into the notesForDriverService table
|
|
$sql = "INSERT INTO `welcomeDriverCall`( `driverId`, `isCall`, `notes`) VALUES ('$driverId','1','$notes')";
|
|
|
|
// Prepare the SQL statement
|
|
$stmt = $con->prepare($sql);
|
|
|
|
|
|
$stmt->execute();
|
|
|
|
if ($stmt->rowCount() > 0) {
|
|
// Print a success message
|
|
printSuccess($message = "note inserted successfully");
|
|
} else {
|
|
// Print a failure message
|
|
printFailure($message = "Failed to insert note");
|
|
}
|
|
?>
|