Skip to content
Snippets Groups Projects
Commit a2a71a13 authored by Muhammad Umar Fariz Tumbuan's avatar Muhammad Umar Fariz Tumbuan
Browse files

fixed local conflict

parents b7fd416f 2571fd57
1 merge request!45OneHundred - 13515005 - Husnulzaki Wibisono Haryadi
<?php
header('Location: select_location.php')
$user_id = $_GET['id'];
header("Location: ../order/select_location.php?id=$user_id");
die();
?>
......@@ -14,11 +14,7 @@
VALUES ('".$dest_city."', '".$pick_city."', '".$score."', '".$comment."', '".$driver_id."', '".$cust_id."', '".$date."')
") or die(mysqli_error($con));
header("Location : order.php");
if ($insert_order_query) {
} else {
echo 'wrong hole';
}
mysqli_close($con);
header("Location: order.php?id=$cust_id");
?>
\ No newline at end of file
......@@ -30,14 +30,54 @@
function ShowPrefDrv($prefdrv, $con)
{
if (!(is_null($prefdrv))) {
$pdQuery = mysqli_query($con, "SELECT * FROM driver RIGHT OUTER JOIN (SELECT * FROM user WHERE name='" . $prefdrv . "') AS usert ON user_id = driver_id") or die(mysqli_error($con));
$pdQuery = mysqli_query($con, "SELECT * FROM driver INNER JOIN user ON driver_id = user_id WHERE name='$prefdrv'") or die(mysqli_error($con));
if (mysqli_num_rows($pdQuery)!=0) {
while ($row = mysqli_fetch_assoc($pdQuery)) {
$driver_id = $row['driver_id'];
$driver_name = $row['name'];
$driver_votes = $row['votes'];
$driver_rating = ($driver_votes == 0) ? 0 : $row['total_score']/$row['votes'];
if ($driver_id != $user_id) {
echo
"
<table class='driver_table'>
<colgroup>
<col style='width: 20%;'>
<col style='width: 80%;'>
</colgroup>
<tr>
<td>
<img class='driver_pict' src='../profile/getProfilePict.php?id=".$driver_id."'
</td>
<td class='driver_column'>
<p class='driver_username'>".$driver_name."</p>
<p class='driver_rating'>&starf;".$driver_rating." (".$driver_votes." votes)</p>
<div class='choose_driver green' onclick='chooseDriver(".$driver_id.")'>
I CHOOSE YOU
</div>
</td>
</tr>
</table>
";
}
}
}
else
{
echo "<h3>Nothing to display :(</h3>";
}
}
function ShowRegDrv($con, $user_id)
{
$rdQuery = mysqli_query($con, "SELECT * FROM driver INNER JOIN user ON driver_id = user_id") or die(mysqli_error($con));
while ($row = mysqli_fetch_assoc($rdQuery)) {
$driver_id = $row['driver_id'];
$driver_name = $row['name'];
$driver_votes = $row['votes'];
$driver_rating = ($driver_votes == 0) ? 0 : $row['total_score']/$row['votes'];
if ($driver_id != $user_id) {
echo
"
<table class='driver_table'>
......@@ -61,10 +101,6 @@
";
}
}
else
{
echo "<h2>Nothing to display :(</h2>";
}
}
?>
</div>
......@@ -120,6 +156,7 @@
</div>
<div id="other_driver">
<h2>Other drivers</h2>
<?php ShowRegDrv($con, $user_id) ?>
</div>
<input type="hidden" name="picking_point" value=<?php echo $ppoint ?>>
<input type="hidden" name="destination" value=<?php echo $dest?>>
......
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