Skip to content
Snippets Groups Projects
Commit dbfd078c authored by Muhammad Umar Fariz Tumbuan's avatar Muhammad Umar Fariz Tumbuan
Browse files
parents 325f4432 81288053
1 merge request!45OneHundred - 13515005 - Husnulzaki Wibisono Haryadi
...@@ -21,7 +21,15 @@ ...@@ -21,7 +21,15 @@
$username = $row['username']; $username = $row['username'];
include("../template/header.php"); include("../template/header.php");
} }
mysqli_close($con);
//==================================================
$ppoint = $_POST['picking_point'];
$dest = $_POST['destination'];
$seldrv = $_POST['selected_driver'];
$driverinfo_query = mysqli_query($con, "SELECT * FROM driver WHERE driver_id ='".$seldrv."'") or die(mysqli_error());
$driverinfo = mysqli_fetch_assoc($driverinfo_query);
?> ?>
</div> </div>
<div class="menu_container"> <div class="menu_container">
...@@ -43,13 +51,16 @@ ...@@ -43,13 +51,16 @@
</div> </div>
</div> </div>
<form method="post"> <form method="post">
<div class="content" id="complete_order" style="display: none;"> <div class="content" id="complete_order">
<h2> <h2>
How was it? How was it?
</h2> </h2>
<img class='driver_pict' src='../profile/getProfilePict.php?id='.<?php $user_id?>>
<p> @<?php echo $ppoint.$dest;?></p>
<input class="button green" type="submit" name="submit" value="Complete Order"> <input class="button green" type="submit" name="submit" value="Complete Order">
</div> </div>
</form> </form>
<?php mysqli_close($con); ?>
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
$ppoint = $_POST['picking_point']; $ppoint = $_POST['picking_point'];
$dest = $_POST['destination']; $dest = $_POST['destination'];
$prefdrv = $_POST['preferred_driver']; $prefdrv = $_POST['preferred_driver'];
echo $prefdrv;
function ShowPrefDrv($prefdrv, $con) function ShowPrefDrv($prefdrv, $con)
{ {
...@@ -36,7 +35,7 @@ ...@@ -36,7 +35,7 @@
while ($row = mysqli_fetch_assoc($pdQuery)) { while ($row = mysqli_fetch_assoc($pdQuery)) {
$driver_id = $row['driver_id']; $driver_id = $row['driver_id'];
$driver_name = $row['username']; $driver_name = $row['name'];
$driver_votes = $row['votes']; $driver_votes = $row['votes'];
$driver_rating = ($driver_votes == 0) ? 0 : $row['total_score']/$row['votes']; $driver_rating = ($driver_votes == 0) ? 0 : $row['total_score']/$row['votes'];
echo echo
...@@ -44,12 +43,12 @@ ...@@ -44,12 +43,12 @@
<table id='tbl_pref_driver'> <table id='tbl_pref_driver'>
<tr> <tr>
<td> <td>
<img class='history_pict' src='../profile/getProfilePict.php?id=".$driver_id."' <img class='driver_pict' src='../profile/getProfilePict.php?id=".$driver_id."'
</td> </td>
<td> <td>
<p class='driver_username'>".$driver_name."</p> <p class='driver_username'>".$driver_name."</p>
<p class='driver_rating'>&starf;".$driver_rating." (".$driver_votes." votes)</p> <p class='driver_rating'>&starf;".$driver_rating." (".$driver_votes." votes)</p>
<div class='button green' onclick=''> <div class='button green' onclick='chooseDriver(".$driver_id.")'>
I CHOOSE YOU I CHOOSE YOU
</div> </div>
</td> </td>
...@@ -83,7 +82,8 @@ ...@@ -83,7 +82,8 @@
Complete Order Complete Order
</div> </div>
</div> </div>
<form method="post" action="complete_order.php"> <form method="post" id="submit_select_drv" action=<?php echo "complete_order.php?id=".$user_id ?>>
<?php echo $ppoint . $dest; ?>
<div class="content" id="select_driver"> <div class="content" id="select_driver">
<div id="preferred_driver"> <div id="preferred_driver">
<h2>Preferred driver</h2> <h2>Preferred driver</h2>
...@@ -92,11 +92,19 @@ ...@@ -92,11 +92,19 @@
<div id="other_driver"> <div id="other_driver">
<h2>Other drivers</h2> <h2>Other drivers</h2>
</div> </div>
<input type="hidden" name="selected_driver"> <input type="hidden" name="picking_point" value=<?php echo $ppoint ?>>
<input type="submit" name="submit_select_drv" style="display: none;"> <input type="hidden" name="destination" value=<?php echo $dest?>>
<input type="hidden" name="selected_driver" id="selected_driver">
</div> </div>
</form> </form>
<?php mysqli_close($con) ?> <?php mysqli_close($con) ?>
</div> </div>
</body> </body>
<script type="text/javascript">
function chooseDriver(driver_id) {
document.getElementById('selected_driver').value = driver_id;
var form = document.getElementById('submit_select_drv');
form.submit();
}
</script>
</html> </html>
\ 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