Skip to content
Snippets Groups Projects
Commit 17552077 authored by Dzarrrr's avatar Dzarrrr
Browse files

melakukan pembenahan pada laman order. Data sudah dapat dimasukkan ke dalam database

parent 165bce7a
Branches
No related merge requests found
images/carifont.PNG

6.15 KiB

<?php
$servername = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "projek_db";
// Create Connectiom
$conn = new mysqli($servername, $dbusername, $dbpassword, $dbname);
//Check Connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO dummyorder (pickingPoint, destination, preferredDriver)
VALUES ('$pickingPoint', '$destination', '$preferredDriver')";
if ($conn->query($sql) === TRUE) {
echo "Thank you! Your data has been entered into the database";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
\ No newline at end of file
......@@ -104,6 +104,7 @@ div.stars {
height: 50px;
margin: auto;
display: block;
padding.right:75px;
}
input.star { display: none; }
......@@ -115,8 +116,96 @@ label.star {
color: #444;
}
.header-wrapper {
margin-top: 50px;
width: 500px;
text-align: center;
margin-left: auto;
margin-right: auto;
font-size: 0;
border: 1px solid black;
}
.user-logo {
margin-top: 6px;
margin-left: 6px;
margin-right: 6px;
text-align: justify;
}
.pr-ojek-logo {
display: inline-block;
text-align: left;
font-size: initial;
width: 50%;
padding-left: 3px;
box-sizing: border-box;
}
.logo {
font-size: 2rem;
}
.pr {
color: rgb(2, 112, 44);
}
.ojek {
color: rgb(213, 0, 39);
}
.slogan {
color: rgb(70, 112, 2);
font-size: initial;
}
.user-wrapper {
display: inline-block;
text-align: right;
font-size: initial;
width: 50%;
vertical-align: top;
padding-right: 3px;
box-sizing: border-box;
}
.username {
font-weight: bold;
font-size: initial;
}
.menu-wrapper {
margin: 6px;
}
.menu-buttons {
display: inline-block;
font-size: initial;
width: 33%;
padding: 7px 0;
font-weight: bold;
border: 1px solid;
background: rgb(255,255,255);
color: rgb(51,51,51);
}
.menu-buttons-clicked {
display: inline-block;
font-size: initial;
width: 33%;
padding: 8px 0;
font-weight: bold;
border: 1px solid;
background: rgb(70,93,67);
color: rgb(255,255,255);
}
.loadable {
font-size: 2rem;
}
input.star:checked ~ label.star:before {
content: '\f005';
content: "★";
color: rgb(249,174,14);
transition: all .25s;
}
......@@ -128,8 +217,7 @@ input.star-5:checked ~ label.star:before {
input.star-1:checked ~ label.star:before { color: rgb(249,174,14); }
label.star:before {
content: '\f006';
font-family: FontAwesome;
content: "★";
}
.userComment{
......
<!DOCTYPE html>
<html>
<head>
<title>Laman order complete PR-OJEK</title>
<link rel="stylesheet" type="text/css" href="orderComplete.css">
<link href="https://fonts.googleapis.com/css?family=Oswald:600" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lora" rel="stylesheet">
</head>
<body onload="buttonHighlight('order')">
<div class="header-wrapper">
<div class="user-logo">
<div class="pr-ojek-logo">
<div class="logo">
<span class="pr">PR</span>-<span class="ojek">OJEK</span>
</div>
<div class="slogan">
wushh... wushh... ngeeeeeenggg...
</div>
</div>
<div class="user-wrapper">
Hi, <span class="username">bocanhesen</span> ! <br>
<a href="#">Logout</a>
</div>
</div>
<div class="menu-wrapper">
<button type="button" buttonHighlight('order')" id="order" class="menu-buttons">ORDER</button>
<button type="button" buttonHighlight('history')" id="history" class="menu-buttons">HISTORY</button>
<button type="button" buttonHighlight('profile')" id="profile" class="menu-buttons">MY PROFILE</button>
</div>
</div>
<div class="containerLuarOrderComplete">
<div class = "containerTitle">
<span id = "orderTitle"> MAKE AN ORDER </span>
</div>
<div class = "containerSelection">
<div id = "containerSelectDestination">
<div class = "circle"> 1 </div>
<div class = "containerOrderMenubar"> Select Destination </div>
</div>
<div id = "containerSelectDriver">
<div class = "circle"> 2 </div>
<div class = "containerOrderMenubar"> Select a Driver </div>
</div>
<div id = "containerCompleteOrder">
<div class = "circle"> 3 </div>
<div class = "containerOrderMenubar"> Complete your order </div>
</div>
</div>
<div id = "containerDataDriver">
<div id = "containerTeks">HOW WAS IT?</div>
<div id = "containerProfilDriver">
<div id = "fotoDriver"> <img src = "../images/carifont.png" alt = "placeholderFotoProfil" height = 65px width = 65px id = "fotoProfil"> </div>
<div id = "userNameDriver">
<?php
$servername = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "projek_db";
$conn = new mysqli($servername, $dbusername, $dbpassword, $dbname);
$dataquery = "SELECT * FROM temporarydriver WHERE nomorUrutDriver=(SELECT MAX(nomorUrutDriver) FROM temporarydriver)";
$result = $conn->query($dataquery);
$rowresult = $result->fetch_assoc();
$hasil = $rowresult['uname'];
echo "$hasil";
;
?>
</div>
<div id = "namaDriver">
<?php
$dataquery = "SELECT * FROM temporarydriver WHERE nomorUrutDriver=(SELECT MAX(nomorUrutDriver) FROM temporarydriver)";
$result = $conn->query($dataquery);
$rowresult = $result->fetch_assoc();
$hasil = $rowresult['uname'];
$dataquery = "SELECT * FROM users WHERE uname = '$hasil'";
$result = $conn->query($dataquery);
$rowresult = $result->fetch_assoc();
$nama = $rowresult['userRealName'];
echo "$nama";
?></div>
<div id = "ratingDriver">
<div class="stars">
<form action="" id="formBintang" required>
<input class="star star-5" id="star-5" type="radio" name="star"/>
<label class="star star-5" for="star-5"></label>
<input class="star star-4" id="star-4" type="radio" name="star"/>
<label class="star star-4" for="star-4"></label>
<input class="star star-3" id="star-3" type="radio" name="star"/>
<label class="star star-3" for="star-3"></label>
<input class="star star-2" id="star-2" type="radio" name="star"/>
<label class="star star-2" for="star-2"></label>
<input class="star star-1" id="star-1" type="radio" name="star"/>
<label class="star star-1" for="star-1"></label>
</form>
</div>
</div>
</div>
</div>
<div id ="containerComment">
<form action="">
<textarea class="userComment" name = "userComment" placeholder="Your comment..."></textarea>
<form>
</div>
<div id ="containerButtonComplete">
<div id="containerButtonCompleteKecil">
<button id="buttonCompleteOrder" type = "button">COMPLETE ORDER</button>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -155,8 +155,8 @@ echo '
<div class = "containerOrderMenubar"> Complete your order </div>
</div>
</div>
<form id="formOrder" method="POST" action="postDataPemesanan.php">
<div id = "containerForm">
<form id="formOrder">
<table id="tableOrder">
<tr class = "tableRow">
<td class = "leftColumn">
......@@ -179,17 +179,22 @@ echo '
Preferred Driver
</td>
<td class = "rightColumn">
<input type = "text" name = "orderPickingPoint" placeholder="(optional)" class = "orderForm">
<input type = "text" name = "preferredDriver" placeholder="(optional)" class = "orderForm">
</td>
</tr>
</table>
</form>
</div>
<div id = "containerTombolSubmit">
<div id = "tombolNext">
<button type = "button" id="buttonOrder">NEXT</button>
<button type = "submit" id="buttonOrder" onclick="changePage()">NEXT</button>
</div>
</div>
</form>
</div>
<script>
function changePage(){
document.location.href = "orderSelectDriver.php";
}
</script>
'
?>
\ No newline at end of file
.containerLuarOrderComplete{
width : 500px;
margin-left:auto;
margin-right:auto;
height : 500px;
}
#orderTitle{
font-family: 'Oswald', sans-serif;
font-size: 35px;
}
#containerSelectedDriver{
height: 130px;
}
#containerFotoSelectedDriver {
height: 80px;
width: 80px;
margin-top: 2px;
margin-left: 10px;
background-color: green;
margin-bottom: 2px;
float:left;
}
#containerUsernameSelectedDriver{
float: left;
margin-left: 5px;
margin-top: 2px;
height: 40px;
width: 300px;
}
#containerButtonSelectedDriver{
float: right;
width: 30%;
height: 30px;
margin-top: 10px;
margin-right: 5px;
}
#spanUsername{
font-family: "Lora", serif;
font-size:20px;
}
#containerForNothing{
font-family: sans-serif;
font-size: 20px;
color: gray;
height: 70px;
text-align: center;
margin-top: 20px;
}
.containerSelection{
margin-top: 2px;
height:40px;
width:100%;
}
#containerNoPreferredDriver{
margin-top: 10px;
height : 80px;
background-color: black;
}
#containerPreferredDriver{
border : 1px solid black;
border-radius: 5px;
}
#containerOtherDriver{
border : 1px solid black;
border-radius: 5px;
}
.containerOrderMenubar{
float:left;
width:75px;
height: 30px;
font-size: 14px;
}
#containerSelectDestination{
font-family: 'Lora', serif;
float : left;
margin-top: 2px;
margin-bottom: 2px;
display:inline-block;
border : 1px solid black;
width : 25%;
height: 35px;
}
#containerSelectDriver{
font-family: 'Lora', serif;
margin-left: 50px;
margin-right:50px;
margin-top: 2px;
margin-bottom: 2px;
float:left;
display:inline-block;
border : 1px solid black;
width : 25%;
height: 35px;
background-color: rgb(255,254,159);
}
.circle{
float:left;
text-align:center;
border-radius:50%;
line-height: 30px;
height:30px;
width:30px;
margin-top: 2px;
margin-bottom: 2px;
margin-left: 2px;
margin-right: 5px;
background-color : rgb(217,217,217);
}
#buttonChooseYou{
font-family: "Lora", serif;
font-size:15px;
font-weight: bold;
border-radius: 10px;
border-radius: 10px;
margin:auto;
width: 100%;
height: 100%;
background-color: rgb(130,216,0);
border: 0.5px solid black;
}
#formBintang{
padding-right:53px;
}
div.stars {
width: 300px;
height: 50px;
margin: auto;
display: block;
}
.userComment{
border: 1px solid gray;
font-family: sans-serif;
padding-top:0;
margin:auto;
width: 95%;
align:top;
height: 60px;
}
#fotoProfil{
border: 2px solid rgb(58,58,58);
border-radius: 50%;
-moz-border-radius:50%;
margin-left: auto;
margin-right: auto;
display: block;
margin-top: 3px;
margin-bottom: auto;
}
#fotoDriver{
height: 80px;
width: 100%;
margin-left: auto;
margin-right: auto;
}
#userNameDriver{
font-family: 'Lora', serif;
font-weight: bold;
text-align: center;
width: 100%;
height: 25px;
margin-left: auto;
margin-right: auto;
}
#namaDriver{
font-family: 'Lora', serif;
text-align: center;
width: 100%;
height: 25px;
margin-left: auto;
margin-right: auto;
}
#preferredDriverText{
font-family: 'Oswald', sans-serif;
font-size: 20px;
margin-left:10px;
}
#otherDriverText{
font-family: 'Oswald', sans-serif;
font-size: 20px;
margin-left:10px;
}
#ratingDriver{
width: 100%;
height: 50px;
margin-left: auto;
margin-right: auto;
}
#containerProfilDriver{
width: 60%;
height: 190px;
margin-left: auto;
margin-right: auto;
}
#containerTeks{
font-size:22px;
font-family: 'Oswald', sans-serif;
margin-top: 20px;
height: 35px;
width: 25%;
}
#containerCompleteOrder{
font-family: 'Lora', serif;
margin-top: 2px;
margin-bottom: 2px;
float:left;
display:inline-block;
width : 25%;
height: 35px;
background-color: white;
border: 1px solid black;
}
.header-wrapper {
margin-top: 50px;
width: 500px;
text-align: center;
margin-left: auto;
margin-right: auto;
font-size: 0;
border: 1px solid black;
}
.user-logo {
margin-top: 6px;
margin-left: 6px;
margin-right: 6px;
text-align: justify;
}
.pr-ojek-logo {
display: inline-block;
text-align: left;
font-size: initial;
width: 50%;
padding-left: 3px;
box-sizing: border-box;
}
.logo {
font-size: 2rem;
}
.pr {
color: rgb(2, 112, 44);
}
.ojek {
color: rgb(213, 0, 39);
}
.slogan {
color: rgb(70, 112, 2);
font-size: initial;
}
.user-wrapper {
display: inline-block;
text-align: right;
font-size: initial;
width: 50%;
vertical-align: top;
padding-right: 3px;
box-sizing: border-box;
}
.username {
font-weight: bold;
font-size: initial;
}
.menu-wrapper {
margin: 6px;
}
.menu-buttons {
display: inline-block;
font-size: initial;
width: 33%;
padding: 7px 0;
font-weight: bold;
border: 1px solid;
background: rgb(255,255,255);
color: rgb(51,51,51);
}
.menu-buttons-clicked {
display: inline-block;
font-size: initial;
width: 33%;
padding: 8px 0;
font-weight: bold;
border: 1px solid;
background: rgb(70,93,67);
color: rgb(255,255,255);
}
.loadable {
font-size: 2rem;
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>
PR-OJEK
</title>
<link rel="stylesheet" type="text/css" href="orderSelectDriver.css">
<link href="https://fonts.googleapis.com/css?family=Oswald:600" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lora" rel="stylesheet">
</head>
<body onload = "buttonHighlight('order')">
<div class="header-wrapper">
<div class="user-logo">
<div class="pr-ojek-logo">
<div class="logo">
<span class="pr">PR</span>-<span class="ojek">OJEK</span>
</div>
<div class="slogan">
wushh... wushh... ngeeeeeenggg...
</div>
</div>
<div class="user-wrapper">
Hi, <span class="username">bocanhesen</span> ! <br>
<a href="#">Logout</a>
</div>
</div>
<div class="menu-wrapper">
<button type="button" buttonHighlight('order')" id="order" class="menu-buttons">ORDER</button>
<button type="button" buttonHighlight('history')" id="history" class="menu-buttons">HISTORY</button>
<button type="button" buttonHighlight('profile')" id="profile" class="menu-buttons">MY PROFILE</button>
</div>
</div>
<div class="containerLuarOrderComplete">
<div class = "containerTitle">
<span id = "orderTitle"> MAKE AN ORDER </span>
</div>
<div class = "containerSelection">
<div id = "containerSelectDestination">
<div class = "circle"> 1 </div>
<div class = "containerOrderMenubar"> Select Destination </div>
</div>
<div id = "containerSelectDriver">
<div class = "circle"> 2 </div>
<div class = "containerOrderMenubar"> Select a Driver </div>
</div>
<div id = "containerCompleteOrder">
<div class = "circle"> 3 </div>
<div class = "containerOrderMenubar"> Complete your order </div>
</div>
</div>
<?php
echo'<form id = "formPilihDriver" method = "POST" action = "postDataPilihDriver.php">';
?>
<div id = "containerPreferredDriver">
<span id="preferredDriverText">PREFERRED DRIVERS : </span>
<?php
$servername = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "projek_db";
$conn = new mysqli($servername, $dbusername, $dbpassword, $dbname);
$dataquery = "SELECT * FROM temporaryordertable WHERE urutanOrder=(SELECT MAX(urutanOrder) FROM temporaryordertable)";
$result = $conn->query($dataquery);
$rowresult = $result->fetch_assoc();
$hasil = $rowresult['preferredDriver'];
$lokasiPickup = $rowresult['pickingPoint'];
$destinasi = $rowresult['destination'];
if ($hasil == ""){
echo '<div id = "containerForNothing">
Nothing to display :(
</div>';
} else {
$dataquery = "SELECT * FROM users WHERE uname = '$hasil'";
$result = $conn->query($dataquery);
$rowresult = $result->fetch_assoc();
$username = $rowresult['uname'];
echo "<div id = 'containerSelectedDriver'>
<div id = 'containerFotoSelectedDriver'>
<img src = '../images/carifont.png' height='100%' width = '100%'>
</div>
<div id = 'containerUsernameSelectedDriver'>
<span id = 'spanUsername'>$username</span> <br>
<span id = 'spanRating'>Placeholder Rating</span>
</div>
<div id = 'containerButtonSelectedDriver'>
<div id = 'tombolNext'>
<button type = 'submit' name='buttonChooseYou' id='buttonChooseYou' value=";
echo"'$username'>I CHOOSE YOU !</button>
</div>
</div>
</div>";
}
;
?>
</div>
<div id = "containerOtherDriver">
<span id="otherDriverText">OTHER DRIVERS : </span>
<?php
$servername = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "projek_db";
$conn = new mysqli($servername, $dbusername, $dbpassword, $dbname);
$dataquery = "SELECT * FROM temporaryordertable WHERE urutanOrder=(SELECT MAX(urutanOrder) FROM temporaryordertable)";
$result = $conn->query($dataquery);
$rowresult = $result->fetch_assoc();
$hasil = $rowresult['preferredDriver'];
$lokasiPickup = $rowresult['pickingPoint'];
$destinasi = $rowresult['destination'];
$dataquery = "SELECT * FROM userprefloc WHERE (prefloc = '$lokasiPickup') OR (prefloc = '$destinasi')";
$result = $conn->query($dataquery);
while ($row = $result->fetch_assoc()){
$username = $row['uname'];
echo "
<div id = 'containerSelectedDriver'>
<div id = 'containerFotoSelectedDriver'>
<img src = '../images/carifont.png' height='100%' width = '100%'>
</div>
<div id = 'containerUsernameSelectedDriver'>
<span id = 'spanUsername'>$username</span> <br>
<span id = 'spanRating'>Placeholder Rating</span>
</div>
<div id = 'containerButtonSelectedDriver'>
<div id = 'tombolNext'>
<button type = 'submit' name='buttonChooseYou' id='buttonChooseYou' value=";
echo"'$username'>I CHOOSE YOU !</button>
</div>
</div>
</div>
";
}
?>
</div>
</div>
<?php
echo'</form>';
?>
</body>
</html>
\ No newline at end of file
<?php
$servername = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "projek_db";
$pickingPoint = $_POST['orderPickingPoint'];
$destination = $_POST['orderDestination'];
$preferredDriver = $_POST['preferredDriver'];
// Create Connectiom
$conn = new mysqli($servername, $dbusername, $dbpassword, $dbname);
//Check Connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo '<script type="text/javascript">
window.location = "orderSelectDriver.php"
</script>';
$sql = "INSERT INTO temporaryordertable (pickingPoint, destination, preferredDriver)
VALUES ('$pickingPoint', '$destination', '$preferredDriver')";
if ($conn->query($sql) === TRUE) {
echo "Thank you! Your data has been entered into the database";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
\ No newline at end of file
<?php
$servername = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "projek_db";
$uname = $_POST['buttonChooseYou'];
// Create Connectiom
$conn = new mysqli($servername, $dbusername, $dbpassword, $dbname);
//Check Connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo '<script type="text/javascript">
window.location = "orderComplete.php"
</script>';
$sql = "INSERT INTO temporaryDriver (uname)
VALUES ('$uname')";
if ($conn->query($sql) === TRUE) {
echo "Thank you! Your data has been entered into the database";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
\ 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