Skip to content
Snippets Groups Projects
Commit 5dfbf5e9 authored by adyanf's avatar adyanf
Browse files

add delete and update location handler

parent 798924e8
No related merge requests found
<?php
require("includes/config.php");
if (isset($_GET["delete"])){
$id = $_GET["id_active"];
$location = $_GET["delete"];
$sql = "DELETE FROM driver_locations WHERE ID = $id AND location = '$location'";
if ($conn->query($sql) === TRUE) {
header("Refresh:0; url=editpreferredlocations.php?id_active=" . $id);
exit;
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
}
if (isset($_GET["update"])){
$id = $_GET["id_active"];
$location = $_GET["location"];
$update = $_GET["update"];
$sql = "UPDATE driver_locations SET location='$update' WHERE ID=$id AND location='$location'";
if ($conn->query($sql) === TRUE) {
header("Refresh:0; url=editpreferredlocations.php?id_active=" . $id);
exit;
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
}
?>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment