diff --git a/css/order.css b/css/order.css index 36db29d3350757574574910400b6d7b6ea8b9827..b79bd3369bba25e52ecddd8fa0c7b22a154c6aad 100755 --- a/css/order.css +++ b/css/order.css @@ -1,3 +1,63 @@ +.frame > h1 { + text-align: left; +} + +.submenu_container { + width: 360px; + display: inline-flex; + margin-left: auto; + margin-right: auto; +} + +.submenu { + width: 100px; + height: 40px; + float: left; + border: 0.5px solid black; + font-size: 15px; + text-align: center; +} + +.submenu.left { + float: left; +} + +.submenu.mid { + margin-left: 29px; + margin-right: 29px; +} + +.submenu.right { + float: right; +} + +.content { + width: 350px; + margin-top: 20px; + margin-left: 5px; + margin-right: 5px; +} + +.content > div { + margin: 5px 0px 5px 0px; +} + +.content > div > span { + float: left; +} + +.content > div > input[type="text"] { + width: 200px; + float: right; +} + +#select_driver div { + border: 0.5px solid black; +} + +#preferred_driver { +} + #order_link { background-color: #465d43; } \ No newline at end of file diff --git a/order/order.php b/order/order.php index bad9b61694b66c246d485ea038567f1d9479e654..fef8dc16bd8d72ad6e07fce6aa31df11c39dc53d 100644 --- a/order/order.php +++ b/order/order.php @@ -27,29 +27,76 @@ <div class="menu_container"> <?php include'../template/menu.php';?> </div> + + <h1>Make an Order</h1> + <div class="submenu_container"> + <a href="order/select_location.html"> + <div class="submenu left"> + Select Destination + </div> + </a> - <div> - <h1>MAKE AN ORDER</h1> - <div style="background-color: white; max-width: 600px; margin-left: auto; margin-right: auto"> - <a href="order/select_location.html"> - <div style="width:150px; float: left; margin-left: 5%; border: 5px solid black"> - Select Destination + <a id="xxx"> + <div class="submenu mid" id="xxx"> + Select a Driver + </div> + </a> + + <a href="order/complete_order.html"> + <div class="submenu right"> + Complete Order + </div> + </a> + </div> + <form method="post"> + <div class="content" id="select_destination"> + <div> + <div> + <span>Picking point</span> + <input type="text" name="picking_point"> </div> - </a> - - <a href="order/select_driver.html"> - <div style="width:150px; float: left; margin-left: 5px; margin-right: 5px; border: 5px solid black"> - Select Driver + <div> + <span>Destination</span> + <input type="text" name="destination"> </div> - </a> - - <a href="order/complete_order.html"> - <div style="width:150px; float: left; margin-right: 5%; border: 5px solid black"> - Complete Order + <div> + <span>Preferred driver</span> + <input type="text" name="preferred_driver"> </div> - </a> + </div> + <div class="button green" id="next"> + Next + </div> </div> - </div> + <div class="content" id="select_driver" style="display: none;"> + <div id="preferred_driver"> + <h2>Preferred driver</h2> + </div> + <div id="other_driver"> + <h2>Other drivers</h2> + </div> + <div id="selected_driver" style="display: none"> + <input type="text" name="selected_driver"> + </div> + </div> + <div class="content" id="complete_order" style="display: none;"> + <h2> + How was it? + </h2> + <input class="button green" type="submit" name="submit" value="Complete Order"> + </div> + </form> </div> + + <script type="text/javascript"> + var element = document.getElementById('next'); + // element.onclick = function () { + // alert('hi'); + // }; + element.onclick = function () { + document.getElementById('select_destination').style.display='none'; + document.getElementById('select_driver').style.display='inline'; + } + </script> </body> </html> diff --git a/order/select_location.html b/order/select_location.php old mode 100755 new mode 100644 similarity index 100% rename from order/select_location.html rename to order/select_location.php diff --git a/profile/edit_location.php b/profile/edit_location.php index a4798f936b3e9ec5bfd757a38321dc1dc75cb3db..a7f7f92eb2c54b4cc148adbb918ff34e25fc77dd 100644 --- a/profile/edit_location.php +++ b/profile/edit_location.php @@ -32,9 +32,9 @@ </div> <div class="add_loc_frame"> <h2> Add New Location</h2> - <form name="add_location" action=""> + <form name="add_location" action="updateLocation.php" method="POST"> <input type="text" name="new_location"> - <input type="text" name="hidden_userid" style="display: none;"> + <input type="text" id="hidden_userid" name="hidden_userid" style="display: none;"> <input type="submit" value="ADD" class="button green add"> </form> </div> diff --git a/profile/profile.php b/profile/profile.php index 7b747df9b30f5d12c2f37ae2f73ac371e6f421d7..4ea93cd7dec7961f4a800ab472af3169ead90090 100644 --- a/profile/profile.php +++ b/profile/profile.php @@ -40,7 +40,9 @@ echo "</br><strong>".$row['username']."</strong></br>"; echo $row['name']."</br>"; if ($row['status'] == "driver") { - echo "driver | Rating (xxx Votes)</br>"; + echo "Driver | Rating (xxx Votes)</br>"; + } else { + echo "No-Driver</br>"; } echo $row['email']."</br>"; echo $row['phone']."</br>"; diff --git a/profile/updateLocation.php b/profile/updateLocation.php index fd64cf6069c4b273785f5f999a7c85f4fe9a3541..e2468caf320c99242ffaeb26bd018df6245248df 100644 --- a/profile/updateLocation.php +++ b/profile/updateLocation.php @@ -4,9 +4,9 @@ include '../database/dbconnect.php'; $user_id = $_POST['hidden_userid']; $new_loc = $_POST['new_location']; - $query = mysqli_query($con,"INSERT INTO user (driver_id,pref_loc) VALUES ('$user_id', '$new_loc')") or die(mysqli_error()); + $query = mysqli_query($con,"INSERT INTO driver_prefloc (driver_id,pref_loc) VALUES ('$user_id', '$new_loc')") or die(mysqli_error($con)); if ($query) { - header("Location: ../profile/profile.php?id=$user_id"); + header("Location: edit_location.php?id=$user_id"); } } }