diff --git a/css/profile.css b/css/profile.css index 67b7397be081e9bd17ff8096b4888c9251c8dd53..d4eab3cf0570d95ba2f379453a53fa262bafaa4d 100755 --- a/css/profile.css +++ b/css/profile.css @@ -24,6 +24,9 @@ .prefloc_container { height: 50%; } +.prefloc_container ul { + list-style-type: none; +} .edit_prefloc_button { float: right; margin-top: 10px; diff --git a/profile/profile.php b/profile/profile.php index 4ea93cd7dec7961f4a800ab472af3169ead90090..b3a91e379116f3666dfe63fecd501d9b09a8db93 100644 --- a/profile/profile.php +++ b/profile/profile.php @@ -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>