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

Membuat bagian untuk menampilkan list preferred location

parent 862fa11d
1 merge request!45OneHundred - 13515005 - Husnulzaki Wibisono Haryadi
......@@ -24,6 +24,9 @@
.prefloc_container {
height: 50%;
}
.prefloc_container ul {
list-style-type: none;
}
.edit_prefloc_button {
float: right;
margin-top: 10px;
......
......@@ -20,7 +20,6 @@
$username = $row['username'];
include("../template/header.php");
}
mysqli_close($con);
?>
</div>
<div class="menu_container">
......@@ -58,6 +57,30 @@
<div class="title"><h1>Preferred Locations</h1></div>
<div class="edit_prefloc_button"><a href=<?php echo 'edit_location.php?id='.$user_id; ?>>✎</a></div>
</div>
<div class="prefloc_list">
<?php
$query=mysqli_query($con,"SELECT pref_loc FROM driver_prefloc WHERE driver_id='".$user_id."'") or die(mysqli_error());
$numrows = mysqli_num_rows($query);
if($numrows !=0)
{
$i = 1;
$buffer = '<ul>';
while ($row=mysqli_fetch_assoc($query)) {
if ($i != $numrows) {
$buffer .= '<li>►'.$row['pref_loc'].'</li><ul>';
$i++;
} else {
$buffer .= '<li>►'.$row['pref_loc'].'</li>';
}
}
for ($i = 0;$i <= $row; $i++) {
$buffer .= '</ul>';
}
echo $buffer;
}
mysqli_close($con);
?>
</div>
</div>
</div>
</body>
......
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