Skip to content
Snippets Groups Projects
Commit 0a9d5b66 authored by Akmal Fadlurohman's avatar Akmal Fadlurohman
Browse files
parents fdab1dae 98b4b8f2
1 merge request!45OneHundred - 13515005 - Husnulzaki Wibisono Haryadi
...@@ -13,6 +13,11 @@ ...@@ -13,6 +13,11 @@
INSERT INTO `order`(dest_city, pick_city, score, comment, driver_id, cust_id, date) INSERT INTO `order`(dest_city, pick_city, score, comment, driver_id, cust_id, date)
VALUES ('".$dest_city."', '".$pick_city."', '".$score."', '".$comment."', '".$driver_id."', '".$cust_id."', '".$date."') VALUES ('".$dest_city."', '".$pick_city."', '".$score."', '".$comment."', '".$driver_id."', '".$cust_id."', '".$date."')
") or die(mysqli_error($con)); ") or die(mysqli_error($con));
$modify1_driver_query = mysqli_query($con,"
UPDATE `driver`
SET votes = votes + 1, total_score = total_score + $score
WHERE driver_id = '$driver_id'
") or die(mysqli_error($con));
mysqli_close($con); mysqli_close($con);
......
...@@ -154,7 +154,6 @@ ...@@ -154,7 +154,6 @@
<div id="driver_table_container"> <div id="driver_table_container">
<form method="post" id="submit_select_drv" action=<?php echo "complete_order.php?id=".$user_id ?>> <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">
......
...@@ -65,25 +65,43 @@ ...@@ -65,25 +65,43 @@
</div> </div>
<form method="post" action=<?php echo "select_driver.php?id=" . $user_id;?>> <form method="post" id="submit_select_loc" name="submit_select_loc" action=<?php echo "select_driver.php?id=" . $user_id;?> onsubmit="return checkValidity();">
<div class="content" id="select_destination"> <div class="content" id="select_destination">
<div> <div>
<span class="loc_form_label">Picking point</span> <span class="loc_form_label">Picking point</span>
<input type="text" name="picking_point"> <input type="text" name="picking_point" id="picking_point">
</div> </div>
<div> <div>
<span class="loc_form_label">Destination</span> <span class="loc_form_label">Destination</span>
<input type="text" name="destination"> <input type="text" name="destination" id="destination">
</div> </div>
<div> <div>
<span class="loc_form_label">Preferred driver</span> <span class="loc_form_label">Preferred driver</span>
<input type="text" name="preferred_driver" placeholder="(optional)"> <input type="text" name="preferred_driver" placeholder="(optional)">
</div> </div>
<input type="submit" name="submit_select_loc" class="button green" id="loc_button" value="Next"> <div class="button green" onclick="checkValidity();">
Next
</div>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</body> </body>
<script type="text/javascript">
window.alert('weo');
function checkValidity() {
var form = document.getElementById('submit_select_loc');
var PPfield = document.getElementById('picking_point');
var Dfield = document.getElementById('destination');
var isValid = (PPfield.value == "" || Dfield.value == "") ? false : true;
if (!isValid) {
window.alert("Please fill both picking point and destination fields");
} else {
form.submit();
}
}
</script>
</html> </html>
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