diff --git a/css/profile.css b/css/profile.css index d4eab3cf0570d95ba2f379453a53fa262bafaa4d..e343acb4e8ae7430161d21940b539dc62bb74fe8 100755 --- a/css/profile.css +++ b/css/profile.css @@ -21,6 +21,11 @@ .profile_data_container { height: 100px; } +.profile_data_container p { + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} .prefloc_container { height: 50%; } diff --git a/database/PR-Ojek.sql b/database/PR-Ojek.sql index 5387feebc62d6fb24e69adbf9a8977027d5dada2..1fed134203cf63d4a4b6dea4a6fe636a4408c07f 100755 --- a/database/PR-Ojek.sql +++ b/database/PR-Ojek.sql @@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS `user` ( CREATE TABLE IF NOT EXISTS `driver` ( `driver_id` INT NOT NULL, `total_score` DOUBLE(50,1) NOT NULL DEFAULT '0.0', - `votes` DOUBLE(50,1) NOT NULL DEFAULT '0.0', + `votes` INT NOT NULL DEFAULT '0', CONSTRAINT `driver_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `user` (`user_id`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; diff --git a/profile/edit_profile.php b/profile/edit_profile.php index 7c3c1703ab2fe7ce34772ac2c7821efdd361343d..58e19a280713f54220ed2a69b9bb8eeb7d5de8e8 100644 --- a/profile/edit_profile.php +++ b/profile/edit_profile.php @@ -74,21 +74,20 @@ <div class="edit_profile_nav"> <a href=<?php echo 'profile.php?id='.$user_id; ?>><div class="button red back" style="float: left; margin-left: 20px;">BACK</div></a> <input type="submit" value="SAVE" style="float: right;" class="button green save"> - <input id="hidden_userid" name="hidden_userid" type="text" style="display:none;"> + <input name="hidden_userid" type="hidden" value= <?php echo $user_id ?>> </div> </form> </div> </div> <?php if ($current_stat == "driver") { - echo "<script>document.getElementById('current_name').value = '".$row['name']."';</script>"; + echo "<script>document.getElementById('current_stat').checked = true;</script>"; } + echo "<script>document.getElementById('current_name').value = '".$row['name']."';</script>"; echo "<script>document.getElementById('current_phone').value = '".$row['phone']."';</script>"; - echo "<script>document.getElementById('current_stat').checked = true;</script>"; if (isset($row['pict'])) { echo "<script>document.getElementById('current_profile_pict').src ='getProfilePict.php?id=".$user_id."'</script>"; } - echo "<script>document.getElementById('hidden_userid').value =".$user_id."</script>"; ?> <script> function showFileName(inputFile) { diff --git a/profile/profile.php b/profile/profile.php index b3a91e379116f3666dfe63fecd501d9b09a8db93..dbc538826ee72cb8c4156ebe9a553f7dbbf41818 100644 --- a/profile/profile.php +++ b/profile/profile.php @@ -36,15 +36,15 @@ </div> <div class="profile_data_container"> <?php - echo "</br><strong>".$row['username']."</strong></br>"; - echo $row['name']."</br>"; + echo "</br><p><strong>".$row['username']."</strong></p>"; + echo "<p>".$row['name']."</p>"; if ($row['status'] == "driver") { - echo "Driver | Rating (xxx Votes)</br>"; + echo "<p>Driver | <span id='driver_rating'>Rating (xxx Votes)</span></p>"; } else { - echo "No-Driver</br>"; + echo "<p>Non-Driver</p>"; } - echo $row['email']."</br>"; - echo $row['phone']."</br>"; + echo "<p>".$row['email']."</p>"; + echo "<p>".$row['phone']."</p>"; if (isset($row['pict'])) { echo "<script>document.getElementById('profile_pict').src ='getProfilePict.php?id=".$user_id."'</script>"; } @@ -52,13 +52,16 @@ </div> </div> </div> - <div class="prefloc_container"> + <div id="display_prefloc" class="prefloc_container"> <div class="subheader"> <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 + if ($row['status'] != "driver") { + echo '<script>document.getElementById("display_prefloc").style.display = "none";</script>'; + } $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)