Skip to content
Snippets Groups Projects
Commit 3a10cd5f authored by Akmal Fadlurohman's avatar Akmal Fadlurohman
Browse files

Menambah fitur delete preferred location dari tabel

parent cdae9625
1 merge request!45OneHundred - 13515005 - Husnulzaki Wibisono Haryadi
<?php
include '../database/dbconnect.php';
$user_id = $_GET['id'];
$deletedLoc = $_GET['loc'];
$query = mysqli_query($con,"DELETE FROM driver_prefloc WHERE user_id='".$user_id."' AND pref_loc='".$deletedLoc."'") or die(mysqli_error($con));
mysqli_close($con);
if ($query) {
header("Location: edit_location.php?id=$user_id");
}
?>
......@@ -45,9 +45,9 @@
while($row=mysqli_fetch_assoc($query)) {
echo ' <tr>
<td>'.$i.'</td>
<td>'.$row['pref_loc'].'</td>
<td><div class="edit_button">✎</div><div class="delete_button"></div></td>
</tr>';
<td>'.$row['pref_loc'].'</td>
<td><div class="edit_button">✎</div><div class="delete_button"><a href="'deletePrefLoc.php?id='.$user_id.'%26&loc='.$row['pref_loc']'">✖</a></div></td>
</tr>';
$i++;
}
}
......
......@@ -5,6 +5,7 @@
$user_id = $_POST['hidden_userid'];
$new_loc = $_POST['new_location'];
$query = mysqli_query($con,"INSERT INTO driver_prefloc (driver_id,pref_loc) VALUES ('$user_id', '$new_loc')") or die(mysqli_error($con));
mysqli_close($con);
if ($query) {
header("Location: edit_location.php?id=$user_id");
}
......
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