diff --git a/Tubes2/build/web/META-INF/MANIFEST.MF b/Tubes2/build/web/META-INF/MANIFEST.MF new file mode 100644 index 0000000000000000000000000000000000000000..59499bce4a2bd51cba227b7c00fcf745b19c95a4 --- /dev/null +++ b/Tubes2/build/web/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/Tubes2/build/web/WEB-INF/classes/.netbeans_automatic_build b/Tubes2/build/web/WEB-INF/classes/.netbeans_automatic_build new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Tubes2/build/web/WEB-INF/classes/.netbeans_update_resources b/Tubes2/build/web/WEB-INF/classes/.netbeans_update_resources new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Tubes2/build/web/WEB-INF/classes/controller/ControllerServlet.class b/Tubes2/build/web/WEB-INF/classes/controller/ControllerServlet.class new file mode 100644 index 0000000000000000000000000000000000000000..afe367a627adfd59a0a1f0f158629daa52597080 Binary files /dev/null and b/Tubes2/build/web/WEB-INF/classes/controller/ControllerServlet.class differ diff --git a/Tubes2/build/web/WEB-INF/classes/controller/HistoryServlet.class b/Tubes2/build/web/WEB-INF/classes/controller/HistoryServlet.class new file mode 100644 index 0000000000000000000000000000000000000000..4ad6f1d45ba03dbca1e1ec691eb73b5e605c24ac Binary files /dev/null and b/Tubes2/build/web/WEB-INF/classes/controller/HistoryServlet.class differ diff --git a/Tubes2/build/web/WEB-INF/classes/controller/LoginServlet.class b/Tubes2/build/web/WEB-INF/classes/controller/LoginServlet.class new file mode 100644 index 0000000000000000000000000000000000000000..9b7abc396e489a6150ebaad91d8df48c6a296af4 Binary files /dev/null and b/Tubes2/build/web/WEB-INF/classes/controller/LoginServlet.class differ diff --git a/Tubes2/build/web/WEB-INF/classes/controller/ProfileServlet.class b/Tubes2/build/web/WEB-INF/classes/controller/ProfileServlet.class new file mode 100644 index 0000000000000000000000000000000000000000..fb527ef0f8f1427fa5b6760cb216f44028c3a7e7 Binary files /dev/null and b/Tubes2/build/web/WEB-INF/classes/controller/ProfileServlet.class differ diff --git a/Tubes2/build/web/WEB-INF/classes/controller/RegistrasiServlet.class b/Tubes2/build/web/WEB-INF/classes/controller/RegistrasiServlet.class new file mode 100644 index 0000000000000000000000000000000000000000..4d5dcf33d58c2f19569d8152012ca900060413d0 Binary files /dev/null and b/Tubes2/build/web/WEB-INF/classes/controller/RegistrasiServlet.class differ diff --git a/Tubes2/build/web/WEB-INF/glassfish-web.xml b/Tubes2/build/web/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000000000000000000000000000000000000..d3a6f1e55d76d7682aa7d4e166245866991b7cd2 --- /dev/null +++ b/Tubes2/build/web/WEB-INF/glassfish-web.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd"> +<glassfish-web-app error-url=""> + <context-root>/</context-root> + <class-loader delegate="true"/> + <jsp-config> + <property name="keepgenerated" value="true"> + <description>Keep a copy of the generated servlet class' java code.</description> + </property> + </jsp-config> +</glassfish-web-app> diff --git a/Tubes2/build/web/WEB-INF/jspf/Footer.jspf b/Tubes2/build/web/WEB-INF/jspf/Footer.jspf new file mode 100644 index 0000000000000000000000000000000000000000..36ed5dbf6284e479dd45458c0d432e3f70ab3b6b --- /dev/null +++ b/Tubes2/build/web/WEB-INF/jspf/Footer.jspf @@ -0,0 +1,7 @@ + <div class="footer"> + <div>Dayu <br /> 13500000</div> + <div>Marvin <br /> 1350000</div> + <div>Adrian HP <br /> 13515091</div> + </div> + </body> +</html> diff --git a/Tubes2/build/web/WEB-INF/jspf/Header.jspf b/Tubes2/build/web/WEB-INF/jspf/Header.jspf new file mode 100644 index 0000000000000000000000000000000000000000..de3d5ab95d5610e37c3fd296960cb57e92a06b4a --- /dev/null +++ b/Tubes2/build/web/WEB-INF/jspf/Header.jspf @@ -0,0 +1,41 @@ +<%-- + Document : HeaderWithMenu + Created on : Nov 4, 2017, 11:23:12 AM + Author : nim_13515091 +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<!DOCTYPE html> +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <link rel="stylesheet" href="css/profile.css"/> + <link rel="stylesheet" href="css/style.css"/> + </head> + <body> + <div> + <header class="header-box"> + <div class="col-header-left"> + <div> + <span class='logo-title'>MotoRaido</span><br /> + <span class='tagline'>Anata to issho ni noru mÅtÄ</span> + </div> + </div> + <div class="col-header-right"> + <div> + Hi, <b><?php echo $this->user; ?></b> ! + </div> + <div> + <a href="/Login">Logout</a> + </div> + </div> + </header> + <div class='menu'> + <div class="menu-column"></div> + <div class="menu-column"></div> + <div class="menu-column"></div> + <div id="orderheader" class="menu-cell"><a href="/Order" class="text-link">ORDER</a></div> + <div id="historyheader" class="menu-cell"><a href="/History" class="text-link">HISTORY</a></div> + <div id="profileheader" class="menu-cell"><a href="/Profile" class="text-link">MY PROFILE</a></div> + </div> + </div> \ No newline at end of file diff --git a/Tubes2/build/web/WEB-INF/view/CompleteOrder.jsp b/Tubes2/build/web/WEB-INF/view/CompleteOrder.jsp new file mode 100644 index 0000000000000000000000000000000000000000..9ac61413d2afd552640f07890dae353e0569ab09 --- /dev/null +++ b/Tubes2/build/web/WEB-INF/view/CompleteOrder.jsp @@ -0,0 +1,43 @@ +<div class="edit-profile-header"> + Make an order +</div> +<div class="progress-container"> + <div class="progress"> + <div class="progress-num">1</div> Select Destination + </div> + <div class="progress"> + <div class="progress-num">2</div> Select a driver + </div> + <div class="progress selected"> + <div class="progress-num selected">3</div> Complete your order + </div> +</div> +<div class="edit-profile-header"> + How was it? +</div> +<form action="/order/<?php echo $this->user; ?>/completeorder/finish" method="post" name="completeorder-form"> + <div class="completeorder-container"> + <input type='hidden' name='driver' value='<?php echo $this->driver; ?>'> + <input type='hidden' name='from' value='<?php echo $this->from; ?>'> + <input type='hidden' name='dest' value='<?php echo $this->dest; ?>'> + <img class="driver-completeorder-pic" src="<?php echo $this->image; ?>" alt=""> + <div class="driver-name-disp">@<?php echo $this->driver; ?></div> + <div class="driver-fullname-disp"><?php echo $this->drivername; ?></div> + <span class="starRating"> + <input id="rating5" type="radio" name="rating" value="5"> + <label for="rating5">5</label> + <input id="rating4" type="radio" name="rating" value="4"> + <label for="rating4">4</label> + <input id="rating3" type="radio" name="rating" value="3"> + <label for="rating3">3</label> + <input id="rating2" type="radio" name="rating" value="2"> + <label for="rating2">2</label> + <input id="rating1" type="radio" name="rating" value="1"> + <label for="rating1">1</label> + </span> + <textarea cols="5" placeholder="Your comment..." name="comment"></textarea> + </div> + <div class="right-align"> + <input class="accept-button select-driver-btn completeorder-btn" type="submit" value="Complete Order"> + </div> +</form> \ No newline at end of file diff --git a/Tubes2/build/web/WEB-INF/view/EditPrefLoc.jsp b/Tubes2/build/web/WEB-INF/view/EditPrefLoc.jsp new file mode 100644 index 0000000000000000000000000000000000000000..bbfa7a673a01a1a62ec0377362bdfa84be0c63b8 --- /dev/null +++ b/Tubes2/build/web/WEB-INF/view/EditPrefLoc.jsp @@ -0,0 +1,46 @@ +<div class="container"> + <h1 class="header"><?php echo $this->title; ?></h1> + <form action=<?php echo '/preferred-loc/' . $this->user . '/edit'; ?> method="post"> + <table style="width:100%"> + <tr> + <th>No</th> + <th>Location</th> + <th>Actions</th> + </tr> + <?php + $count = 0; + foreach($this->prefLoc as $loc) { + $count = $count + 1; + echo "<tr class='rows'>"; + echo "<td id='count'>" . $count . "</td>"; + echo "<td><div name='location'>" . $loc['location'] . "</div></td>"; + echo "<td id='action'><img class=\"pref-button\" name=\"edit-button\" src='" . IMG . "/edit.png' /><a href='/preferred-loc/" . $this->user . "/delete/" . $loc['location'] . "'><img class=\"pref-button\" src='" . IMG . "/delete.png' /></td></a>"; + echo "</tr>"; + } + ?> + </table> + </form> + <form action=<?php echo '/preferred-loc/' . $this->user . '/finish'; ?> method='post' enctype="multipart/form-data"> + <div class="edit-profile-btm"> + <h2 class="header">Add new Location:</h2> + <div class="form-input"> + <input type="text" id="next-button-text" name="location" /> + <input class="next-button" type="submit" value="Add" /> + </div> + </div> + </form> +</div> +<script> + var edit = Array.prototype.slice.call(document.getElementsByName('edit-button')); + var locs = document.getElementsByName('location'); + var rows = document.getElementsByClassName('rows'); + + edit.map(function(x, i) { + var loc = locs[i].innerHTML; + x.addEventListener('click', function (event) { + event.preventDefault(); + rows[i].cells[1].innerHTML = '<input type="text" name="location_new" value="' + loc + '" /><input type="hidden" name="location_old" value="' + loc + '"/>'; + rows[i].cells[2].innerHTML = '<input type="submit" value="Save" />'; + }); + }); +</script> \ No newline at end of file diff --git a/Tubes2/build/web/WEB-INF/view/EditProfile.jsp b/Tubes2/build/web/WEB-INF/view/EditProfile.jsp new file mode 100644 index 0000000000000000000000000000000000000000..f1aae6f8fb28139adbd3771e4ecaf9618aaadeba --- /dev/null +++ b/Tubes2/build/web/WEB-INF/view/EditProfile.jsp @@ -0,0 +1,31 @@ +<div class="edit-profile-container"> + <form action='/editprofile/<?php echo $this->user; ?>/finish' method='post' onsubmit="return editProfileValidation();" enctype="multipart/form-data" name="editprofile-form"> + <h1 class="edit-profile-header">Edit Profile Information</h1> + <img id="profile-pic" src="<?php echo $this->image; ?>" alt=""> + <div class="img-chooser"> + <p>Update profile picture</p> + <input type="file" name="image" accept="image/jpeg, image/png"> + </div> + <div class="edit-profile-btm"> + <div class="form-editprofile"> + <label for="your-name">Your Name</label> + <input class="ep-textarea" type="text" name="your-name" value="<?php echo $this->name; ?>"> + </div> + <div class="form-editprofile"> + <label for="phone-number">Phone</label> + <input class="ep-textarea" type="text" name="phone-number" value="<?php echo $this->phone; ?>"> + </div> + <div class="button-form"> + <div> + Status driver + </div> + <label class="switch"> + <input type="checkbox" name="is-driver" <?php echo $this->isDriver; ?>> + <span class="slider round"></span> + </label> + </div> + <a href='/profile/<?php echo $this->user; ?>'><input class="cancel-button" value="Back"></a> + <input class="accept-button" id="save-profile" type="submit" value="Save"> + </div> + </form> +</div> \ No newline at end of file diff --git a/Tubes2/build/web/WEB-INF/view/History.jsp b/Tubes2/build/web/WEB-INF/view/History.jsp new file mode 100644 index 0000000000000000000000000000000000000000..5687ca8551b476bb57cd33343c3a6f3ad03986af --- /dev/null +++ b/Tubes2/build/web/WEB-INF/view/History.jsp @@ -0,0 +1,69 @@ +<div class="subtitle-cont subtitle-history"> + TRANSACTION HISTORY +</div> +<div class="body-container"> + <div class='menu'> + <div class="menu-column"></div> + <div class="menu-column"></div> + <div id="user-his" class="menu-cell" onclick="tabActive('user');">MY PREVIOUS ORDERS</div> + <div id="driver-his" class="menu-cell" onclick="tabActive('driver');">DRIVER HISTORY</div> + </div> +</div> + +<div id="history-container"> + <ol class="history-list order-list"> + <?php foreach($this->historyUser as $history): ?> + <li class="list-text-his"> + <div class="history-pic-div"> + <img class="profile-pic-his" src=<?php echo $this->image . $history[1]; ?> alt=""> + </div> + <span class="hide"> + <a href=<?php echo "/history/". $history[0] . "/update/" . $history[1] . "/" . rawurlencode($history[4]); ?>>HIDE</a> + </span> + <div class="his-text"> + <div class="date-his"><?php echo htmlentities($history[4]); ?></div> + <div class="name-his"><b><?php echo $history[1]; ?></b></div> + <div><?php echo $history[5]; ?> - <?php echo $history[6]; ?></div> + <div> + You rated : ?<?php echo $history[2]; ?> + <div> + <div> + You commented: + <div class="comment"> + <?php echo $history[3]; ?> + </div> + </div> + </div> + </li> + <?php endforeach; ?> + </ol> + + <ol class="history-list driver-list"> + + <?php foreach($this->historyDriver as $history): ?> + <li class="list-text-his"> + <div class="history-pic-div"> + <img class="profile-pic-his" src=<?php echo $this->image . $history[0]; ?> alt="" /> + </div> + <span class="hide"> + <a href=<?php echo "/history/". $history[0] . "/update/" . $history[1] . "/" . rawurlencode($history[4]); ?>>HIDE</a> + </span> + <div class="his-text"> + <div class="date-his"><?php echo $history[4]; ?></div> + <div><b><?php echo $history[0]; ?></b></div> + <div><?php echo $history[5]; ?> - <?php echo $history[6]; ?></div> + <div> + gave <span><?php echo $history[2]; ?></span> stars for this order + <div> + <div> + and left comment: + <div class="comment"> + <?php echo $history[3]; ?> + </div> + </div> + </div> + </li> + <?php endforeach; ?> + </ol> +</div> +<script src=<?php echo $this->script; ?>></script> \ No newline at end of file diff --git a/Tubes2/build/web/WEB-INF/view/Login.jsp b/Tubes2/build/web/WEB-INF/view/Login.jsp new file mode 100644 index 0000000000000000000000000000000000000000..e225c1d399cc6b5123612f7098a35085b6c34074 --- /dev/null +++ b/Tubes2/build/web/WEB-INF/view/Login.jsp @@ -0,0 +1,27 @@ +<section class="content-layout"> + <header class="title"> + <div> + <hr> + <h1><?php echo $this->title; ?></h1> + <hr> + </div> + </header> + <section class="form-layout"> + <form action="/Profile" method="post" name="loginform" onsubmit="return loginValidation();"> + <div class="form-input"> + <div>Username</div> + <input id="username" type="text" name="username"> + </div> + <div class="form-input"> + <div>Password</div> + <input type="password" name="password"> + </div> + <div id="button-layout"> + <div> + <a href="/Signup">Don't have an account?</a> + </div> + <input id="register-button" type="submit" value="GO!"> + </div> + </form> + </section> +</section> \ No newline at end of file diff --git a/Tubes2/build/web/WEB-INF/view/Order.jsp b/Tubes2/build/web/WEB-INF/view/Order.jsp new file mode 100644 index 0000000000000000000000000000000000000000..158580d5cb7030220c90e39196f6479895a91dc4 --- /dev/null +++ b/Tubes2/build/web/WEB-INF/view/Order.jsp @@ -0,0 +1,35 @@ +<div class="container"> + <div class="edit-profile-header"> + Make an order + </div> + <div class="progress-container"> + <div class="progress selected"> + <div class="progress-num">1</div> Select Destination + </div> + <div class="progress"> + <div class="progress-num">2</div> Select a driver + </div> + <div class="progress"> + <div class="progress-num">3</div> Complete your order + </div> + </div> + <form action="/SelectDriver" method='post'> + <div class="edit-profile-btm"> + <div class="form-input"> + <label for="pick-point">Picking point</label> + <input class="ep-textarea" type="text" name="pick-point" /> + </div> + <div class="form-input"> + <label for="destination">Destination</label> + <input class="ep-textarea" type="text" name="destination" /> + </div> + <div class="form-input"> + <label for="pref-driver">Preferred Driver</label> + <input class="ep-textarea" type="text" name="pref-driver" placeholder="(Optional)"/> + </div> + <div class="right-align"> + <input class="accept-button select-driver-btn" id="save-profile" type="submit" value="Next" /> + </div> + </div> + </form> +</div> \ No newline at end of file diff --git a/Tubes2/build/web/WEB-INF/view/Profile.jsp b/Tubes2/build/web/WEB-INF/view/Profile.jsp new file mode 100644 index 0000000000000000000000000000000000000000..d9f7ab2f2e54da6c036b74d5d5ab6e06f7f1fcef --- /dev/null +++ b/Tubes2/build/web/WEB-INF/view/Profile.jsp @@ -0,0 +1,45 @@ +<div id="info-profile"> + <div class="subtitle-cont"> + <div class="subtitle-profile"> + MY PROFILE + </div> + <a href="/EditProfile" > + <div id="edit-pen-div"> + <img class="edit-pen" src=<?php echo $this->edit; ?>> + </div> + </a> + </div> + <div id="profile-pic-div"> + <img class="profile-picture" src=<?php echo $this->image; ?>> + </div> + <div id="info-text"> + <ol id="list-info"> + <li><b><?php echo $this->username; ?></b></li> + <li><?php echo $this->name; ?></li> + <?php if($this->isdriver == 'Driver'): ?> + <li><?php echo $this->isdriver; ?> | <?php for($i = 0; $i<floor($this->rating); $i++) { echo "?"; } ?> (<?php echo $this->rating; ?> rating from <?php echo $this->votes; ?> votes)</li> + <?php endif; ?> + <li><?php echo $this->email; ?></i></li> + <li><?php echo $this->phone; ?></i></li> + </ol> + </div> +</div> +<div> + <div class="subtitle-cont"> + <?php if($this->isdriver == 'Driver'): ?> + <div id="prefer-loc-title" class="subtitle-profile"> + PREFERRED LOCATIONS: + </div> + <a href="/EditPrefLoc"> + <div id="edit-pen-div"> + <img class="edit-pen" src=<?php echo $this->edit; ?>> + </div> + </a> + </div> + <?php foreach ($this->preferredloc as $loc): ?> + <div id="info-pref-text"> + <span class="loc-list"><?php echo " " . $loc[1] ?><span> + </div> + <?php endforeach; ?> + <?php endif; ?> +</div> \ No newline at end of file diff --git a/Tubes2/build/web/WEB-INF/view/SelectDriver.jsp b/Tubes2/build/web/WEB-INF/view/SelectDriver.jsp new file mode 100644 index 0000000000000000000000000000000000000000..356ed7840a62df3f2c314de9e7eccb4ededf6ca6 --- /dev/null +++ b/Tubes2/build/web/WEB-INF/view/SelectDriver.jsp @@ -0,0 +1,25 @@ +<div class="edit-profile-header"> + Make an order +</div> +<div class="progress-container"> + <div class="progress"> + <div class="progress-num">1</div> Select Destination + </div> + <div class="progress selected"> + <div class="progress-num">2</div> Select a driver + </div> + <div class="progress"> + <div class="progress-num">3</div> Complete your order + </div> +</div> +<div id="pref-driver" class="select-driver"> + <div class= "selectdriver-header"> + Preferred Drivers: + </div> + </div> +<div id="other-driver" class="select-driver"> + <div class="selectdriver-header"> + Other Drivers: + </div> +</div> +<script src="js/selectdriver.js"></script> \ No newline at end of file diff --git a/Tubes2/build/web/WEB-INF/view/Signup.jsp b/Tubes2/build/web/WEB-INF/view/Signup.jsp new file mode 100644 index 0000000000000000000000000000000000000000..5f97a7eac6547e7a85490394b720c0b70e40012d --- /dev/null +++ b/Tubes2/build/web/WEB-INF/view/Signup.jsp @@ -0,0 +1,49 @@ +<section class="content-layout"> + <header class="title"> + <div> + <hr> + <h1><?php echo $this->title; ?></h1> + <hr> + </div> + </header> + <section class="form-layout"> + <form action="/Profile" method="post" name="signupform" onsubmit="return signupValidation()"> + <div class="form-input"> + <div>Your Name</div> + <input id="your-name" type="text" name="your-name"> + </div> + <div class="form-input checked-input"> + <div>Username</div> + <input id="username" type="text" name="username" onKeyUp="checkData('username','username-check')"> + <span id="username-check"></span> + </div> + <div class="form-input checked-input"> + <div>Email</div> + <input id="email" type="text" name="email" onKeyUp="checkData('email','email-check')"> + <span id="email-check"></span> + </div> + <div class="form-input"> + <div>Password</div> + <input id="password" type="password" name="password"> + </div> + <div class="form-input"> + <div>Confirm Password</div> + <input id="confirm-password" type="password" name="confirm-password"> + </div> + <div class="form-input"> + <div>Phone Number</div> + <input id="phone" type="text" name="phone-number"> + </div> + <div class="driver-checkbox"> + <input id="isdriver" type="checkbox" name="driver"> + <div>Also sign me up as a driver!</div> + </div> + <div id="button-layout"> + <div> + <a href="/Login">Already have an account</a> + </div> + <input id="register-button" type="submit" value="Register"> + </div> + </form> + </section> +</section> \ No newline at end of file diff --git a/Tubes2/build/web/WEB-INF/web.xml b/Tubes2/build/web/WEB-INF/web.xml new file mode 100644 index 0000000000000000000000000000000000000000..049039080d0056c6d56999a779d0866d8f8d98e9 --- /dev/null +++ b/Tubes2/build/web/WEB-INF/web.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"> + <session-config> + <session-timeout> + 30 + </session-timeout> + </session-config> + <jsp-config> + <jsp-property-group> + <description>header and footer setting</description> + <url-pattern>/index.jsp</url-pattern> + <url-pattern>/WEB-INF/view/*</url-pattern> + <include-prelude>/WEB-INF/jspf/Header.jspf</include-prelude> + <include-coda>/WEB-INF/jspf/Footer.jspf</include-coda> + </jsp-property-group> + </jsp-config> +</web-app> diff --git a/Tubes2/build/web/css/.gitkeep b/Tubes2/build/web/css/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Tubes2/build/web/css/fonts/geo.woff2 b/Tubes2/build/web/css/fonts/geo.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..4c1d8680a68afc90ed228ae5c313f9002255b7b2 Binary files /dev/null and b/Tubes2/build/web/css/fonts/geo.woff2 differ diff --git a/Tubes2/build/web/css/fonts/mukta1.woff2 b/Tubes2/build/web/css/fonts/mukta1.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..dfa6d95388c06078e73dc1ccc0df0cdd8c152c4b Binary files /dev/null and b/Tubes2/build/web/css/fonts/mukta1.woff2 differ diff --git a/Tubes2/build/web/css/fonts/mukta2.woff2 b/Tubes2/build/web/css/fonts/mukta2.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..ed0d8a0451ef90b479b036e337f741573dfa55bb Binary files /dev/null and b/Tubes2/build/web/css/fonts/mukta2.woff2 differ diff --git a/Tubes2/build/web/css/fonts/mukta3.woff2 b/Tubes2/build/web/css/fonts/mukta3.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..b6d906226264df96ac57ba02427ae5043bfd031f Binary files /dev/null and b/Tubes2/build/web/css/fonts/mukta3.woff2 differ diff --git a/Tubes2/build/web/css/profile.css b/Tubes2/build/web/css/profile.css new file mode 100644 index 0000000000000000000000000000000000000000..7bf19a4f7d989ea396720a3c92bd8cb9cce368d7 --- /dev/null +++ b/Tubes2/build/web/css/profile.css @@ -0,0 +1,154 @@ +.profile-picture { + width: 150px; + height: 150px; + border: 5px solid black; + float: left; + border-radius: 500px; + clear: both; +} + +#info-profile { + margin: 20px 0px; + height: auto; +} + +.edit-pen { + float: right; + height: 30px; + +} + +.subtitle-profile { + float: left; + width: 200px; + font-size: 2em; + font-weight: bold; + font-family: 'Mutka', sans-serif; +} + +#profile-pic-div { + margin: auto; + width: 160px; + height: 160px; +} + +#edit-pen-div { + margin: auto; + height: auto; +} + +.subtitle-cont { + margin-bottom: 20px; + height: 37px; +} + +#info-text { + margin: auto; + font-size: 1.2em; +} + +#list-info { + list-style: none; + text-align: center; + padding: 0px; +} + +#prefer-loc-title { + font-size: 1.5em; + width: 400px; +} + +.fa-star-o{ + color: red; +} + +#info-pref-text { + font-size: 1.2em; +} + +.subtitle-history { + float: left; + font-size: 2em; + font-weight: bold; + font-family: 'Mutka', sans-serif; + margin-top: 20px; +} + +.history-pic-div { + width: 120px; + height: 120px; + margin: 0px 20px; + float: left; +} + +.profile-pic-his { + width: 110px; + height: 110px; + border: 1px solid black; + float: left; +} + +.history-list { + margin-top: 20px; + list-style: none; + padding: 0px; + height: auto; +} + +.order-list { + display: none; +} + +.driver-list { + display: none; +} + +.active-list { + display:block; +} + +.comment { + margin-left: 180px; +} + +.hide{ + width: auto; + padding: 10px 15px; + border: 1px solid black; + border-radius: 10px; + background-color: red; + position: absolute; + right: 0; +} + +.his-text>span { + display: inline-block; +} + +.list-text-his { + height: auto; + position: relative; + clear: both; +} + +.date-his { + color: gray; +} + +.name-his { + font-size: 1.2em; +} + +.tab-active { + display: block; +} + +.active { + color: #ffffff; + border-color: #000000; + background-color: #5A1E83; +} + +.hide-element { + display: none; +} \ No newline at end of file diff --git a/Tubes2/build/web/css/style.css b/Tubes2/build/web/css/style.css new file mode 100644 index 0000000000000000000000000000000000000000..ae7bb6a41858edde4cdc42187c4481c84a4a3473 --- /dev/null +++ b/Tubes2/build/web/css/style.css @@ -0,0 +1,628 @@ +@charset "UTF-8"; + +body { + width: 470px; + margin: auto; + font-family: 'Mutka', sans-serif; +} + +textarea { + resize: none; + width: 100%; + margin-bottom: 10px; +} + +/* Order Header */ + .progress-container { + width: fit-content; + border-collapse:separate; + border-spacing: 10px 10px; + display: table; + } + + .progress { + width: 30%; + height: 50px; + font-size: 105%; + border: 1px solid black; + text-align: left; + vertical-align: middle; + display: table-cell; + } + + .progress-num { + display:inline-block; + background-color: #DDD; + width: 35px; + height: 35px; + border-radius: 100%; + margin: 0px 5px; + line-height: 200%; + text-align: center; + vertical-align: middle; + float: left; + } + + .selected { + background-color: #FFFF44; + } + +/* Header style */ + +.header-box { + height: fit-content content-box; + width: fit-content content-box; + margin-left: auto; + margin-right: auto; + margin-top: none; + margin-bottom: none; + font-family: 'Mutka', sans-serif; + column-count: 2; + -moz-column-count: 2; + -webkit-column-count: 2; + -webkit-column-span: all; /* Chrome, Safari, Opera */ + column-span: all; + column-gap: 40px; +} + +.col-header-left { + width: 50% content-box; + float: left; + vertical-align: middle; +} + +.logo-title { + font-family: 'Geo', sans-serif; + font-weight: bold; + font-size: 250%; + color: #5A1E83; +} + +.tagline { + color: #311B92; +} + +.col-header-right { + width: 50% content-box; + float: right; + text-align: right; + vertical-align: middle; + line-height: 2; +} + +/* Menu style */ + +.menu { + width: 100%; + display: table; + table-layout: fixed; +} + +.menu > div.menu-column { + display: table-column; +} + +.menu > div.menu-cell { + display: table-cell; + font-family: 'Mukta', sans-serif; + vertical-align: middle; + line-height: 50px; + text-align: center; + font-weight: bold; + border-style: solid; + border-width: 1px; +} + +.menu > div:hover, .menu > div.selected { + color: #ffffff; + border-color: #000000; + background-color: #5A1E83; +} + +/* Footer style */ +.footer { + column-count: 3; + -moz-column-count: 3; + -webkit-column-count: 3; + -webkit-column-span: all; + column-span: all; + -moz-column-gap: 2em; + -webkit-column-gap: 2em; + column-gap: 1.5em; + column-rule-style: solid; + border-style: solid; + border-width: 2px; +} + +.footer > div { + width: fit-content content-box; + text-align: center; + font-weight: bold; + font-family: 'Mukta', sans-serif; + vertical-align: middle; +} + +.img-chooser { + padding-top: 20px; +} + +.text-link { + text-decoration: none; + font-size: 120%; + font-weight: bold; + color: black; +} + + + +/* Container */ +.container { + width: inherit; +} + +.header { + line-height: 1.5; + text-transform: uppercase; +} + +.selectdriver-header { + text-transform: uppercase; + font-weight: bold; +} + +.edit-profile-container { + font-family: Verdana; +} + +.edit-profile-header { + text-transform: uppercase; + font-weight: bold; + width: 100%; + font-size: 170%; +} + +.edit-profile-btm { + clear: both; +} + +.form-editprofile{ + margin: 5px 0; +} + +.ep-textarea{ + width: 60%; + float: right; + clear: both; +} + +.content-layout { + background-color: rgb(124, 206, 43); + padding: 50px; + border: 10px solid rgb(10, 127, 10); + border-radius: 100px; + width: 350px; +} + +.title { + height: 27px; + padding: 0px 20px; +} + +.title>div>h1 { + text-align: center; + margin-top: 0px; + width: 100px; + float: left; +} + +.title>div>hr { + float:left; + position: relative; + width: 100px; + top: 5px; + background-color: rgb(10, 127, 10); + height: 5px; + border: none; +} + +.form-layout { + clear: left; +} + +.form-input { + width: 350px; + margin-bottom: 5px; +} + +.form-input>div { + float: left; + width: 135px; +} + +.form-input>input { + width: 198px; +} + +.checked-input>input { + width: 170px; +} + +.driver-checkbox { + margin: 20px 0px; +} + +.driver-checkbox>input { + float: left; + margin-left: 0px; +} + + +.cancel-button { + width: 75px; + height: 30px; + text-align: center; + text-transform: uppercase; + letter-spacing: 1px; + border: 1px solid black; + background-color: #D2002E; + border-radius: 10px; +} + +.accept-button { + width: 75px; + height: 30px; + text-transform: uppercase; + letter-spacing: 1px; + border: 1px solid black; + background-color: #83D535; + border-radius: 10px; +} + +.driver-completeorder-pic { + height: 100px; + width: 100px; + margin: 10px; + border-radius: 100%; + border: 3px solid #5A1E83; +} + +.completeorder-container { + text-align: center; + clear: both; +} + +.right-align { + width: 100%; + text-align: right; +} + +.driver-fullname-disp { + font-size: 105%; + font-weight: bold; + margin-top: 5px; +} + +/*Select driver*/ +.select-driver { + width: auto; + padding: 0 10px; + border-radius: 12px; + border: 1px solid black; + margin: 10px 0; +} + +.driver-content { + height: 120px; + overflow: hidden; +} + +.driver-pic { + height: 100px; + width: 100px; + margin: 10px; + border-radius: 100%; + border: 3px solid #5A1E83; + float: left; +} + +.driver-name-disp { + font-size: 160%; + font-weight: bold; + margin-top: 10px; +} + +.driver-rating-disp { + color: orange; + font-size: 110%; +} + +.driver-not-found { + color: grey; + height: 70px; + text-align: center; + text-transform: none; + line-height: 70px; + vertical-align: middle; +} + +.vote-disp { + color: black; +} + +.select-driver-btn { + width: auto; + color: white; + background-color: #5A1E83; + letter-spacing: 0.5px; + float: right; +} + +.order-btn { + float: none; + clear: both; +} + +#profile-pic { + width: 150px; + height: 150px; + border: 1px solid black; + float: left; + margin-right: 25px; + margin-bottom: 30px; +} + +#save-profile { + float: right; + margin-right: 120px; +} + +#register-button { + background-color: #4CAF50; + border: 5px solid rgb(10, 127, 10); + border-radius: 20px; + color: white; + padding: 15px 32px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + margin: 4px 2px; + cursor: pointer; +} + +#button-layout>div { + float: left; + width: 200px; + height: 66px; +} + +#button-layout a { + position: relative; + top: 20px; +} + + +.button-form { + text-align: right; + width: 350px; +} + +.button-form div { + float: left; +} + +.completeorder-btn { + width: 100px; + height: 50px; + float: none; +} + + /* The switch - the box around the slider */ + .switch { + position: relative; + display: inline-block; + + width: 50px; + height: 25px; +} + +/* Hide default HTML checkbox */ +.switch input {display:none;} + +/* The slider */ +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + -webkit-transition: .4s; + transition: .4s; +} + +.slider:before { + position: absolute; + content: ""; + height: 19px; + width: 19px; + left: 4px; + bottom: 3px; + background-color: white; + -webkit-transition: .4s; + transition: .4s; +} + +input:checked + .slider { + background-color: #1E7B25; +} + +input:focus + .slider { + box-shadow: 0 0 1px #1E7B25; +} + +input:checked + .slider:before { + -webkit-transform: translateX(23px); + -ms-transform: translateX(23px); + transform: translateX(23px); +} + +/* Rounded sliders */ +.slider.round { + border-radius: 34px; +} + +.slider.round:before { + border-radius: 50%; +} + +/* Menu Order */ +.menu-order { + height: 100%; + width: 100%; + position: relative; + font-size: 12px; + border-spacing: 20px 12px; +} + +.menu-order-column { + height: 100%; +} + +.menu-order-cell { + display: table-cell; + position: relative; + text-align: left; + font-weight: bold; +} + +.menu-order-number +{ + position: relative; + display: block; + width: 50px; + height: 50px; + border-radius: 25px; /* or 50% */ + text-align: center; + margin-left: auto; + margin-right: auto; + background-color: #311B92; + color: #ffffff; + line-height: 50px; +} + +.menu-order-title +{ + position: relative; + display: inline-block; +} + +#next-button-text { + line-height: 20px; + width: 75%; + padding-right: 1px; +} + +input.next-button { + width: 20%; + height: 30px; + line-height: 20px; + text-transform: uppercase; + letter-spacing: 1px; + border: 1px solid black; + background-color: #83D535; + border-radius: 10px; + display: inline-block; +} + +table, th, td { + table-layout: auto !important; + width: 100% auto !important; + max-width:100%; + white-space:nowrap; + border: 1px solid black; + border-collapse: collapse; +} + +.pref-button { + width: 21px; + height: 21px; + vertical-align: middle; + border: none; + display: inline-block; +} + +/** Rating **/ +.starRating:not(old){ + display : inline-block; + width : 7.5em; + height : 1.5em; + overflow : hidden; + vertical-align : bottom; +} + +.starRating:not(old) > input{ + margin-right : -100%; + opacity : 0; +} + +.starRating:not(old) > label{ + display : block; + float : right; + position : relative; + background : url('../img/star-off.svg'); + background-size : contain; +} + +.starRating:not(old) > label:before{ + content : ''; + display : block; + width : 1.5em; + height : 1.5em; + background : url('../img/star-on.svg'); + background-size : contain; + opacity : 0; + transition : opacity 0.2s linear; +} + +.starRating:not(old) > label:hover:before, +.starRating:not(old) > label:hover ~ label:before, +.starRating:not(:hover) > :checked ~ label:before{ + opacity : 1; +} + +/* Font customization */ +/* latin */ +@font-face { + font-family: 'Geo'; + font-style: normal; + font-weight: 400; + src: local('Geo'), local('Geo-Regular'), url(./fonts/geo.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; +} + +/* devanagari */ +@font-face { + font-family: 'Mukta'; + font-style: normal; + font-weight: 400; + src: local('Mukta Regular'), local('Mukta-Regular'), url(./fonts/mukta1.woff2) format('woff2'); + unicode-range: U+02BC, U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200B-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB; +} +/* latin-ext */ +@font-face { + font-family: 'Mukta'; + font-style: normal; + font-weight: 400; + src: local('Mukta Regular'), local('Mukta-Regular'), url(./fonts/mukta1.woff2) format('woff2'); + unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Mukta'; + font-style: normal; + font-weight: 400; + src: local('Mukta Regular'), local('Mukta-Regular'), url(./fonts/mukta1.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; +} diff --git a/Tubes2/build/web/css/style_old.css b/Tubes2/build/web/css/style_old.css new file mode 100644 index 0000000000000000000000000000000000000000..7ee8d5f20ad0ad8b49088c590ce18c398f09c1d8 --- /dev/null +++ b/Tubes2/build/web/css/style_old.css @@ -0,0 +1,614 @@ +@charset "UTF-8"; + +/* Font customization */ +/* latin */ +@font-face { + font-family: 'Geo'; + font-style: normal; + font-weight: 400; + src: local('Geo'), local('Geo-Regular'), url(./fonts/geo.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; +} + +/* devanagari */ +@font-face { + font-family: 'Mukta'; + font-style: normal; + font-weight: 400; + src: local('Mukta Regular'), local('Mukta-Regular'), url(./fonts/mukta1.woff2) format('woff2'); + unicode-range: U+02BC, U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200B-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB; +} +/* latin-ext */ +@font-face { + font-family: 'Mukta'; + font-style: normal; + font-weight: 400; + src: local('Mukta Regular'), local('Mukta-Regular'), url(./fonts/mukta1.woff2) format('woff2'); + unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Mukta'; + font-style: normal; + font-weight: 400; + src: local('Mukta Regular'), local('Mukta-Regular'), url(./fonts/mukta1.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; +} + +/* Body style */ + +body { + width: 470px; + margin: auto; + font-family: 'Mutka', sans-serif; +} + +textarea { + resize: none; + width: 100%; + margin-bottom: 10px; +} + +/* Order Header */ + .progress-container { + width: fit-content; + border-collapse:separate; + border-spacing: 10px 10px; + display: table; + } + + .progress { + width: 30%; + height: 50px; + font-size: 105%; + border: 1px solid black; + text-align: left; + vertical-align: middle; + display: table-cell; + } + + .progress-num { + display:inline-block; + background-color: #DDD; + width: 35px; + height: 35px; + border-radius: 100%; + margin: 0px 5px; + line-height: 200%; + text-align: center; + vertical-align: middle; + } + + .selected { + background-color: #FFFF44; + } + +/* Header style */ + +.header-box { + height: fit-content content-box; + width: fit-content content-box; + margin-left: auto; + margin-right: auto; + margin-top: none; + margin-bottom: none; + column-count: 2; + -moz-column-count: 2; + -webkit-column-count: 2; + -webkit-column-span: all; /* Chrome, Safari, Opera */ + column-span: all; + column-gap: 40px; +} + +.col-header-left { + width: 50% content-box; + float: left; + vertical-align: middle; +} + +.logo-title { + font-family: 'Geo', sans-serif; + font-weight: bold; + font-size: 250%; + color: #5A1E83; +} + +.tagline { + color: #311B92; +} + +.col-header-right { + width: 50% content-box; + float: right; + text-align: right; + vertical-align: middle; + line-height: 2; +} + +/* Menu style */ + +.menu { + width: 100%; + display: table; + table-layout: fixed; +} + +.menu > div.menu-column { + display: table-column; +} + +.menu > div.menu-cell { + display: table-cell; + font-family: 'Mukta', sans-serif; + vertical-align: middle; + line-height: 50px; + text-align: center; + font-weight: bold; + border-style: solid; + border-width: 1px; +} + +.menu-item:hover, .menu-item#selected { + color: #ffffff; + border-color: #000000; + background-color: #5A1E83; +} + +/* Footer style */ +.footer { + width: 100% fit-content; + display: inline-block; + column-count: 3; + column-span: all; + column-gap: 1.5em; + column-rule-style: solid; + border-style: solid; + border-width: 2px; + margin: auto; +} + +.footer > div { + text-align: center; + font-weight: bold; + font-family: 'Mukta', sans-serif; + vertical-align: middle; +} + +.img-chooser { + padding-top: 20px; +} + +/* Container */ +.container { + width: inherit; +} + +.header { + line-height: 1.5; + text-transform: uppercase; +} + +.selectdriver-header { + text-transform: uppercase; + font-weight: bold; +} + +.edit-profile-container { + font-family: Verdana; +} + +.edit-profile-header { + text-transform: uppercase; + font-weight: bold; + width: 100%; + font-size: 170%; +} + +.edit-profile-btm { + clear: both; +} + +.form-editprofile{ + margin: 5px 0; +} + + + +.ep-textarea{ + width: 60%; + float: right; + clear: both; +} + +.content-layout { + background-color: rgb(124, 206, 43); + padding: 50px; + border: 10px solid rgb(10, 127, 10); + border-radius: 100px; + width: 350px; +} + +.title { + height: 27px; + padding: 0px 20px; +} + +.title>div>h1 { + text-align: center; + margin-top: 0px; + width: 100px; + float: left; +} + +.title>div>hr { + float:left; + position: relative; + width: 100px; + top: 5px; + background-color: rgb(10, 127, 10); + height: 5px; + border: none; +} + +.form-layout { + clear: left; +} + +.form-input { + width: 350px; + margin-bottom: 5px; +} + +.form-input>div { + float: left; + width: 130px; +} + +.form-input>input { + width: 198px; +} + +.driver-checkbox { + margin: 20px 0px; +} + +.driver-checkbox>input { + float: left; + margin-left: 0px; +} + + +.cancel-button { + width: 75px; + height: 30px; + text-align: center; + text-transform: uppercase; + letter-spacing: 1px; + border: 1px solid black; + background-color: #D2002E; + border-radius: 10px; +} + +.accept-button { + width: 75px; + height: 30px; + text-transform: uppercase; + letter-spacing: 1px; + border: 1px solid black; + background-color: #83D535; + border-radius: 10px; +} + + +.driver-completeorder-pic { + height: 100px; + width: 100px; + margin: 10px; + border-radius: 100%; + border: 3px solid #5A1E83; +} + +.completeorder-container { + text-align: center; + clear: both; +} + +.right-align { + width: 100%; + text-align: right; +} + +.driver-fullname-disp { + font-size: 105%; + font-weight: bold; + margin-top: 5px; +} + +/*Select driver*/ +.select-driver { + width: fit-content; + padding: 0 10px; + border-radius: 12px; + border: 1px solid black; + margin: 10px 0; +} + +.driver-content { + height: 120px; + overflow: hidden; +} + +.driver-pic { + height: 100px; + width: 100px; + margin: 10px; + border-radius: 100%; + border: 3px solid #5A1E83; + float: left; +} + +.driver-name-disp { + font-size: 160%; + font-weight: bold; + margin-top: 10px; +} + +.driver-rating-disp { + color: orange; + font-size: 110%; +} + +.driver-not-found { + color: grey; + height: 70px; + text-align: center; + text-transform: none; + line-height: 70px; + vertical-align: middle; +} + +.vote-disp { + color: black; +} + +.select-driver-btn { + width: auto; + color: white; + background-color: #5A1E83; + letter-spacing: 0.5px; + float: right; +} + +.order-btn { + float: none; + clear: both; +} + +#profile-pic { + width: 150px; + height: 150px; + border: 1px solid black; + float: left; + margin-right: 25px; + margin-bottom: 30px; +} + +#save-profile { + float: right; +} + +#register-button { + background-color: #4CAF50; + border: 5px solid rgb(10, 127, 10); + border-radius: 20px; + color: white; + padding: 15px 32px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + margin: 4px 2px; + cursor: pointer; +} + +#button-layout>div { + float: left; + width: 200px; + height: 66px; +} + +#button-layout a { + position: relative; + top: 20px; +} + + +.button-form { + text-align: right; + width: 100%; +} + +.button-form div { + float: left; +} + +.completeorder-btn { + width: 100px; + height: 50px; + float: none; +} + + /* The switch - the box around the slider */ + .switch { + position: relative; + display: inline-block; + + width: 50px; + height: 25px; +} + +/* Hide default HTML checkbox */ +.switch input {display:none;} + +/* The slider */ +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + -webkit-transition: .4s; + transition: .4s; +} + +.slider:before { + position: absolute; + content: ""; + height: 19px; + width: 19px; + left: 4px; + bottom: 3px; + background-color: white; + -webkit-transition: .4s; + transition: .4s; +} + +input:checked + .slider { + background-color: #1E7B25; +} + +input:focus + .slider { + box-shadow: 0 0 1px #1E7B25; +} + +input:checked + .slider:before { + -webkit-transform: translateX(23px); + -ms-transform: translateX(23px); + transform: translateX(23px); +} + +/* Rounded sliders */ +.slider.round { + border-radius: 34px; +} + +.slider.round:before { + border-radius: 50%; +} + +/* Menu Order */ +.menu-order { + height: 100%; + width: 100%; + position: relative; + font-size: 12px; + border-spacing: 20px 12px; +} + +.menu-order-column { + height: 100%; +} + +.menu-order-cell { + display: table-cell; + position: relative; + text-align: left; + font-weight: bold; +} + +.menu-order-number +{ + position: relative; + display: block; + width: 50px; + height: 50px; + border-radius: 25px; /* or 50% */ + text-align: center; + margin-left: auto; + margin-right: auto; + background-color: #311B92; + color: #ffffff; + line-height: 50px; +} + +.menu-order-title +{ + position: relative; + display: inline-block; +} + +#next-button-text { + line-height: 20px; + width: 75%; + padding-right: 1px; +} + +input.next-button { + width: 20%; + height: 30px; + line-height: 20px; + text-transform: uppercase; + letter-spacing: 1px; + border: 1px solid black; + background-color: #83D535; + border-radius: 10px; + display: inline-block; +} + +table, th, td { + table-layout: auto !important; + width: 100% auto !important; + max-width:100%; + white-space:nowrap; + border: 1px solid black; + border-collapse: collapse; +} + +.pref-button { + width: 21px; + height: 21px; + vertical-align: middle; + border: none; + display: inline-block; +} + +/** Rating **/ +.starRating:not(old){ + display : inline-block; + width : 7.5em; + height : 1.5em; + overflow : hidden; + vertical-align : bottom; +} + +.starRating:not(old) > input{ + margin-right : -100%; + opacity : 0; +} + +.starRating:not(old) > label{ + display : block; + float : right; + position : relative; + background : url('../img/star-off.svg'); + background-size : contain; +} + +.starRating:not(old) > label:before{ + content : ''; + display : block; + width : 1.5em; + height : 1.5em; + background : url('../img/star-on.svg'); + background-size : contain; + opacity : 0; + transition : opacity 0.2s linear; +} + +.starRating:not(old) > label:hover:before, +.starRating:not(old) > label:hover ~ label:before, +.starRating:not(:hover) > :checked ~ label:before{ + opacity : 1; +} diff --git a/Tubes2/build/web/gfv3ee6.dpf b/Tubes2/build/web/gfv3ee6.dpf new file mode 100644 index 0000000000000000000000000000000000000000..d3a6f1e55d76d7682aa7d4e166245866991b7cd2 --- /dev/null +++ b/Tubes2/build/web/gfv3ee6.dpf @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd"> +<glassfish-web-app error-url=""> + <context-root>/</context-root> + <class-loader delegate="true"/> + <jsp-config> + <property name="keepgenerated" value="true"> + <description>Keep a copy of the generated servlet class' java code.</description> + </property> + </jsp-config> +</glassfish-web-app> diff --git a/Tubes2/build/web/img/.gitkeep b/Tubes2/build/web/img/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Tubes2/build/web/img/a b/Tubes2/build/web/img/a new file mode 100644 index 0000000000000000000000000000000000000000..33aea4c0776f5cb48d23fab288743ca549d3092e Binary files /dev/null and b/Tubes2/build/web/img/a differ diff --git a/Tubes2/build/web/img/admin b/Tubes2/build/web/img/admin new file mode 100644 index 0000000000000000000000000000000000000000..dd3fea2721dfc529ad21300b36bada01e362032d Binary files /dev/null and b/Tubes2/build/web/img/admin differ diff --git a/Tubes2/build/web/img/delete.png b/Tubes2/build/web/img/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..f8998a18f10f6e0e754cdf3f06794b299e90a1b9 Binary files /dev/null and b/Tubes2/build/web/img/delete.png differ diff --git a/Tubes2/build/web/img/driver1 b/Tubes2/build/web/img/driver1 new file mode 100644 index 0000000000000000000000000000000000000000..8de4beb39862ac7125f2339dcb1c9b32ab7f90f8 Binary files /dev/null and b/Tubes2/build/web/img/driver1 differ diff --git a/Tubes2/build/web/img/edit.png b/Tubes2/build/web/img/edit.png new file mode 100644 index 0000000000000000000000000000000000000000..919913bc0052626f61433d69128dc17ac739450b Binary files /dev/null and b/Tubes2/build/web/img/edit.png differ diff --git a/Tubes2/build/web/img/images.jpg b/Tubes2/build/web/img/images.jpg new file mode 100644 index 0000000000000000000000000000000000000000..30b7ce2cd13386017b2fa5d56503d42e4c25ea1d Binary files /dev/null and b/Tubes2/build/web/img/images.jpg differ diff --git a/Tubes2/build/web/img/motaraido.png b/Tubes2/build/web/img/motaraido.png new file mode 100644 index 0000000000000000000000000000000000000000..2b72f7e2abdd5f8ea4d11911d7c6ad9260be5262 Binary files /dev/null and b/Tubes2/build/web/img/motaraido.png differ diff --git a/Tubes2/build/web/img/pen.png b/Tubes2/build/web/img/pen.png new file mode 100644 index 0000000000000000000000000000000000000000..d2bcdf9ca880be6a8d6d687245ec080d4d711240 Binary files /dev/null and b/Tubes2/build/web/img/pen.png differ diff --git a/Tubes2/build/web/img/profilepic.png b/Tubes2/build/web/img/profilepic.png new file mode 100644 index 0000000000000000000000000000000000000000..2b72f7e2abdd5f8ea4d11911d7c6ad9260be5262 Binary files /dev/null and b/Tubes2/build/web/img/profilepic.png differ diff --git a/Tubes2/build/web/img/star-off.svg b/Tubes2/build/web/img/star-off.svg new file mode 100644 index 0000000000000000000000000000000000000000..9a393aa40d139025bf2324aec47830757facb84a --- /dev/null +++ b/Tubes2/build/web/img/star-off.svg @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"> + <path fill="#fff" stroke="#ccc" d="M 12,2.5 14.4,9.5 21.5,9.5 15.8,13.75 18.5,21.5 12,16.625 5.5,21.5 8.2,13.75 2.5,9.5 9.6,9.5 z"/> +</svg> diff --git a/Tubes2/build/web/img/star-on.svg b/Tubes2/build/web/img/star-on.svg new file mode 100644 index 0000000000000000000000000000000000000000..fac31ff43ec2ba8dff2f36a3b0ae43d92b312533 --- /dev/null +++ b/Tubes2/build/web/img/star-on.svg @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"> + <path fill="#311B92" stroke="#000" d="M 12,2.5 14.4,9.5 21.5,9.5 15.8,13.75 18.5,21.5 12,16.625 5.5,21.5 8.2,13.75 2.5,9.5 9.6,9.5 z"/> +</svg> diff --git a/Tubes2/build/web/img/tes1 b/Tubes2/build/web/img/tes1 new file mode 100644 index 0000000000000000000000000000000000000000..7352b27d5a4202c3849d34614463b6e94eee7285 Binary files /dev/null and b/Tubes2/build/web/img/tes1 differ diff --git a/Tubes2/build/web/img/winarto b/Tubes2/build/web/img/winarto new file mode 100644 index 0000000000000000000000000000000000000000..33aea4c0776f5cb48d23fab288743ca549d3092e Binary files /dev/null and b/Tubes2/build/web/img/winarto differ diff --git a/Tubes2/build/web/img/yowinarto b/Tubes2/build/web/img/yowinarto new file mode 100644 index 0000000000000000000000000000000000000000..8de4beb39862ac7125f2339dcb1c9b32ab7f90f8 Binary files /dev/null and b/Tubes2/build/web/img/yowinarto differ diff --git a/Tubes2/build/web/index.jsp b/Tubes2/build/web/index.jsp new file mode 100644 index 0000000000000000000000000000000000000000..23a64713d7d5d883ffc7461b34beca3eb94cba5a --- /dev/null +++ b/Tubes2/build/web/index.jsp @@ -0,0 +1,23 @@ +<%-- + Document : index + Created on : Nov 4, 2017, 9:23:05 AM + Author : nim_13515091 +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<!DOCTYPE html> +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>JSP Page</title> + </head> + <body> + <h1>Hello World!</h1> + + <form name="Name Input Form" action="/Login" method='post'> + Enter Your Name: + <input type="text" name="name" value="" /> + <input type="submit" value="OK" /> + </form> + </body> +</html> diff --git a/Tubes2/build/web/js/.gitkeep b/Tubes2/build/web/js/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Tubes2/build/web/js/app.js b/Tubes2/build/web/js/app.js new file mode 100644 index 0000000000000000000000000000000000000000..dbea0f5c367dec9b0cb20f3b11c4ce40644838a3 --- /dev/null +++ b/Tubes2/build/web/js/app.js @@ -0,0 +1,102 @@ +function loginValidation() { + var username = document.forms["loginform"]["username"]; + var pwd = document.forms["loginform"]["password"]; + var usrVerify = Validate(username, "empty"); + var pwdVerify = Validate(pwd, "empty"); + return (usrVerify && pwdVerify); +} + +function editProfileValidation() { + var name = document.forms["editprofile-form"]["your-name"]; + var phone = document.forms["editprofile-form"]["phone-number"]; + var nameVerify = Validate(name, "empty", 0, 20, "length"); + var phoneVerify = Validate(phone, "empty", 9, 12, "length"); + return (nameVerify && phoneVerify); +} + +function Validate(inputArea, type1, min = 0, max = 0, type2 = null, type3 = null) { + var error = GetErrorMessage(inputArea.value, type1, min, max); + if(error === "") { + if (type2 != null) { + error = GetErrorMessage(inputArea.value, type2, min, max); + console.log(type2 + "length"); + } + if (error === "") { + if (type3 != null) { + error = GetErrorMessage(inputArea.value, type3, min, max); + } + } + } + if(error !== "" && inputArea.nextElementSibling === null) { + var errorEl = document.createElement("p"); + errorEl.innerHTML = error; + errorEl.className = "error"; + insertAfterElement(errorEl, inputArea); + + inputArea.addEventListener("blur", function() { + var error = GetErrorMessage(inputArea.value, type1, min, max); + if(error === "") { + if (type2 != null) { + error = GetErrorMessage(inputArea.value, type2, min, max); + } + if (error === "") { + if (type3 != null) { + error = GetErrorMessage(inputArea.value, type3, min, max); + } + } + } + if (error === ""){ + this.nextSibling.remove(); + } + },true); + } + return (error === ""); +} + +function insertAfterElement(el, src) { + src.parentNode.insertBefore(el, src.nextSibling); +} + + +function GetErrorMessage(textArea, type, min = 0, max = 0) { + var validateText = ""; + switch(type) { + case "empty" : + if(isEmpty(textArea)) { + validateText = "Fill in the field"; + } + break; + case "email" : + if(!isEmail(textArea)) { + validatedText = "Invalid Email Address"; + } + break; + case "number" : + if(isNumber(textArea)){ + validateText = "Fill in with only number"; + } + break; + case "length" : + if (!isLengthEqual(textArea,min,max)){ + validateText = "Character must be between " + min.toString() + " and " + max.toString() + " long"; + } + break; + } + return validateText; +} + +function isEmpty(textArea) { + return (textArea.match(/^s+$/) || textArea == ""); +} + +function isNumber(textArea) { + return (!isNaN(textArea)); +} + +function isLengthEqual(textArea, min, max){ + return (textArea.length >= min && textArea.length <= max); +} + +function isEmail(textArea) { + return (textArea.match(/^([a-zA-Z0-9])+([.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-]+)+/)); +} \ No newline at end of file diff --git a/Tubes2/build/web/js/history.js b/Tubes2/build/web/js/history.js new file mode 100644 index 0000000000000000000000000000000000000000..4e4b3f528dfb96a699cdbb10ad6ba0b731005f5a --- /dev/null +++ b/Tubes2/build/web/js/history.js @@ -0,0 +1,41 @@ + +function tabActive(tag) { + var tabUser = document.getElementById('user-his'); + var tabDriver = document.getElementById('driver-his'); + var order = document.getElementsByClassName('order-list'); + var driver = document.getElementsByClassName('driver-list'); + + if (tag == 'user') { + order[0].classList.add("active-list"); + driver[0].classList.remove("active-list"); + tabUser.classList.add('active'); + tabDriver.classList.remove('active'); + } + else { + driver[0].classList.add("active-list"); + order[0].classList.remove("active-list"); + tabDriver.classList.add('active'); + tabUser.classList.remove('active'); + } +} + +tabActive('user'); + +function hideThis(user) { + updateHide(user); + console.log(user[0]); +} + +function updateHide(history) +{ + var data = "user=" + history[0] + "&driver=" + history[1] + "&date=" + history[4]; + var xhr; + if (window.XMLHttpRequest) { + xhr = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + xhr = new ActiveXObject("Microsoft.XMLHTTP"); + } + xhr.open("GET", "/history/update", true); + xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + xhr.send(data); +} \ No newline at end of file diff --git a/Tubes2/build/web/js/selectdriver.js b/Tubes2/build/web/js/selectdriver.js new file mode 100644 index 0000000000000000000000000000000000000000..a79086fcb10aaafe22c9f1c7f7c35640d0517442 --- /dev/null +++ b/Tubes2/build/web/js/selectdriver.js @@ -0,0 +1,97 @@ +var prefDriver = document.getElementById("pref-driver"); +var otherDriver = document.getElementById("other-driver"); +var driverSumRating = []; +var driverCountRating = []; +var driverNameList = []; + +for (var i = 0; i < driverArr.length; i++) { + for(var j = 0; j < ratingArr.length; j++) { + if(driverArr[i] === ratingArr[j]["usernameDriver"]){ + driverSumRating[driverArr[i]] = (driverSumRating[driverArr[i]] === undefined) ? parseFloat(ratingArr[j]["rating"]) : driverSumRating[driverArr[i]] + parseFloat(ratingArr[j]["rating"]); + driverCountRating[driverArr[i]] = (driverCountRating[driverArr[i]] === undefined) ? 1 : driverCountRating[driverArr[i]]+1; + } + } + for(var k = 0; k < driverNameArr.length; k++) { + if(driverArr[i] === driverNameArr[k]["username"]){ + driverNameList[driverArr[i]] = driverNameArr[k]["fullname"]; + break; + } + } +} + +for(var j = 0; j < ratingArr.length; j++) { + if(preferredDriver === ratingArr[j]["usernameDriver"]){ + driverSumRating[preferredDriver] = (driverSumRating[preferredDriver] === undefined) ? parseFloat(ratingArr[j]["rating"]) : driverSumRating[preferredDriver] + parseFloat(ratingArr[j]["rating"]); + driverCountRating[preferredDriver] = (driverCountRating[preferredDriver] === undefined) ? 1 : driverCountRating[preferredDriver]+1; + } +} +for(var k = 0; k < driverNameArr.length; k++) { + if(preferredDriver === driverNameArr[k]["username"]){ + driverNameList[preferredDriver] = driverNameArr[k]["fullname"]; + break; + } +} + +if(preferredDriver !== "") { + CreateDriverDisplay(prefDriver, preferredDriver); +} else { + CreateNotFoundDisplay(prefDriver); +} + +if(driverArr.length > 0) { + for (var i = 0; i < driverArr.length; i++) { + CreateDriverDisplay(otherDriver, driverArr[i]); + } +} else { + CreateNotFoundDisplay(otherDriver); +} + +function CreateDriverDisplay(driverType, driverUsrName) { + var newForm = driverType.appendChild(document.createElement("form")); + var newContainer = newForm.appendChild(document.createElement("div")); + var newImg = newContainer.appendChild(document.createElement("img")); + var newName = newContainer.appendChild(document.createElement("div")); + var newRating = newContainer.appendChild(document.createElement("div")); + var postUsrName = newContainer.appendChild(document.createElement("input")); + var newPickLoc = newContainer.appendChild(document.createElement("input")); + var newDest = newContainer.appendChild(document.createElement("input")); + var newBtn = newContainer.appendChild(document.createElement("input")); + + + var avgRating = (driverSumRating[driverUsrName]/driverCountRating[driverUsrName]).toFixed(1).toString(); + + newForm.setAttribute('method', 'post'); + newForm.setAttribute('action', '/CompleteOrder'); + newContainer.classList.add("driver-content"); + + newImg.classList.add("driver-pic"); + newImg.setAttribute('src', '/public/img/' + driverUsrName); + + newName.classList.add("driver-name-disp"); + newName.innerHTML = driverNameList[driverUsrName]; + + newRating.classList.add("driver-rating-disp"); + newRating.innerHTML = "★" + avgRating + " <span class='vote-disp'>(" + driverCountRating[driverUsrName] + " votes)</span>"; + + postUsrName.setAttribute('type', 'hidden'); + postUsrName.setAttribute('name', 'driver-username'); + postUsrName.setAttribute('value', driverUsrName); + + newPickLoc.setAttribute('type','hidden'); + newPickLoc.setAttribute('name','pickLoc'); + newPickLoc.setAttribute('value', pickLoc); + newDest.setAttribute('type','hidden'); + newDest.setAttribute('name','dest'); + newDest.setAttribute('value', dest); + + newBtn.classList.add("accept-button"); + newBtn.classList.add("select-driver-btn"); + newBtn.setAttribute('type','submit'); + newBtn.setAttribute('value','Select Driver'); +} + +function CreateNotFoundDisplay(driverType) { + var newContainer = driverType.appendChild(document.createElement("div")); + newContainer.classList.add("driver-not-found"); + newContainer.innerHTML = "Nothing to display."; +} \ No newline at end of file diff --git a/Tubes2/build/web/js/signup.js b/Tubes2/build/web/js/signup.js new file mode 100644 index 0000000000000000000000000000000000000000..43a9342a95538b30e1b8bf663cf3fc0a0b62718f --- /dev/null +++ b/Tubes2/build/web/js/signup.js @@ -0,0 +1,44 @@ +function checkData(name, element) +{ + var data = "?" + name + "=" + document.forms["signupform"][name].value; + var xhr; + if (window.XMLHttpRequest) { + xhr = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + xhr = new ActiveXObject("Microsoft.XMLHTTP"); + } + + xhr.open("GET", "/validation" + data, true); + xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + xhr.send(null); + xhr.onload = function() { + if (xhr.readyState == 4) { + if (xhr.status == 200) { + if (xhr.responseText === 'OK') { + document.getElementById(element).innerHTML = "√"; + } else { + document.getElementById(element).innerHTML = "X"; + } + } + else { + alert('There was a problem with the request.'); + } + } + } +} + +function signupValidation() { + var username = document.forms["signupform"]["username"]; + var password = document.forms["signupform"]["password"]; + var cpassword = document.forms["signupform"]["confirm-password"]; + var email = document.forms["signupform"]["email"]; + var fullname = document.forms["signupform"]["your-name"]; + var phone = document.forms["signupform"]["phone"]; + var usrVerify = Validate(username, "empty"); + var pwdVerify = Validate(password, "empty"); + var cpwdVerify = Validate(cpassword, "empty"); + var emailVerify = Validate(email, "empty", 0, 0, "email"); + var fullnameVerify = Validate(fullname, "empty", 0, 20, "length"); + var phoneVerify = Validate(phone, "empty", 9, 12, "length"); + return (usrVerify && pwdVerify && cpwdVerify && emailVerify && fullnameVerify && phoneVerify); +} \ No newline at end of file diff --git a/Tubes2/nbproject/private/private.xml b/Tubes2/nbproject/private/private.xml new file mode 100644 index 0000000000000000000000000000000000000000..475096252cac3c06d37436d2d3de93d8858d0452 --- /dev/null +++ b/Tubes2/nbproject/private/private.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> + <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> +</project-private> diff --git a/Tubes2/src/java/controller/ControllerServlet.java b/Tubes2/src/java/controller/ControllerServlet.java index 5b7311724a1e5a460381733379dd34dc34f99b40..f73fb57182f45082b9608654af71d783418e53e1 100644 --- a/Tubes2/src/java/controller/ControllerServlet.java +++ b/Tubes2/src/java/controller/ControllerServlet.java @@ -68,7 +68,7 @@ public class ControllerServlet extends HttpServlet { } else if (userPath.equals("/CompleteOrder")) { // TODO: Implement purchase action - userPath = "/confirmation"; + userPath = "/Order"; } // use RequestDispatcher to forward request internally diff --git a/Tubes2/src/java/controller/HistoryServlet.java b/Tubes2/src/java/controller/HistoryServlet.java new file mode 100644 index 0000000000000000000000000000000000000000..f45a41f14ee2fc07b2c7c7d1e9666afaad6b24fc --- /dev/null +++ b/Tubes2/src/java/controller/HistoryServlet.java @@ -0,0 +1,76 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package controller; + +import java.io.IOException; +import java.io.PrintWriter; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * + * @author nim_13515091 + */ +@WebServlet(name = "HistoryServlet", urlPatterns = {"/History"}) +public class HistoryServlet extends HttpServlet { + + /** + * Handles the HTTP <code>GET</code> method. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + String userPath = request.getServletPath(); + + // use RequestDispatcher to forward request internally + String url = "/WEB-INF/view" + userPath + ".jsp"; + + try { + request.getRequestDispatcher(url).forward(request, response); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Handles the HTTP <code>POST</code> method. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + String userPath = request.getServletPath(); + + // if addToCart action is called + if (userPath.equals("/History")) { + // TODO: Implement add product to cart action + + // if updateCart action is called + } + + // use RequestDispatcher to forward request internally + String url = "/WEB-INF/view" + userPath + ".jsp"; + + try { + request.getRequestDispatcher(url).forward(request, response); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + +} diff --git a/Tubes2/src/java/controller/LoginServlet.java b/Tubes2/src/java/controller/LoginServlet.java new file mode 100644 index 0000000000000000000000000000000000000000..a213944e42c9ad575538958a24a198a3ba48e400 --- /dev/null +++ b/Tubes2/src/java/controller/LoginServlet.java @@ -0,0 +1,76 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package controller; + +import java.io.IOException; +import java.io.PrintWriter; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * + * @author nim_13515091 + */ +@WebServlet(name = "LoginServlet", urlPatterns = {"/Login"}) +public class LoginServlet extends HttpServlet { + + /** + * Handles the HTTP <code>GET</code> method. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + String userPath = request.getServletPath(); + + // use RequestDispatcher to forward request internally + String url = "/WEB-INF/view" + userPath + ".jsp"; + + try { + request.getRequestDispatcher(url).forward(request, response); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Handles the HTTP <code>POST</code> method. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + String userPath = request.getServletPath(); + + // if addToCart action is called + if (userPath.equals("/Login")) { + // TODO: Implement add product to cart action + + // if updateCart action is called + } + + // use RequestDispatcher to forward request internally + String url = "/WEB-INF/view" + userPath + ".jsp"; + + try { + request.getRequestDispatcher(url).forward(request, response); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + +} diff --git a/Tubes2/src/java/controller/ProfileServlet.java b/Tubes2/src/java/controller/ProfileServlet.java new file mode 100644 index 0000000000000000000000000000000000000000..514d159f14afe2458cb864c13209852f77307759 --- /dev/null +++ b/Tubes2/src/java/controller/ProfileServlet.java @@ -0,0 +1,84 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package controller; + +import java.io.IOException; +import java.io.PrintWriter; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * + * @author nim_13515091 + */ +@WebServlet(name = "ProfileServlet", urlPatterns = {"/Profile", "/EditProfile", "/EditPrefLoc"}) +public class ProfileServlet extends HttpServlet { + + /** + * Handles the HTTP <code>GET</code> method. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + String userPath = request.getServletPath(); + + // use RequestDispatcher to forward request internally + String url = "/WEB-INF/view" + userPath + ".jsp"; + + try { + request.getRequestDispatcher(url).forward(request, response); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Handles the HTTP <code>POST</code> method. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + String userPath = request.getServletPath(); + + // if addToCart action is called + if (userPath.equals("/Profile")) { + // TODO: Implement add product to cart action + + // if updateCart action is called + } else if (userPath.equals("/EditProf")) { + // TODO: Implement update cart action + + // if purchase action is called + } else if (userPath.equals("/EditPrefLoc")) { + // TODO: Implement purchase action + + userPath = "/Order"; + } + + // use RequestDispatcher to forward request internally + String url = "/WEB-INF/view" + userPath + ".jsp"; + + try { + request.getRequestDispatcher(url).forward(request, response); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + +} diff --git a/Tubes2/src/java/controller/RegistrasiServlet.java b/Tubes2/src/java/controller/RegistrasiServlet.java new file mode 100644 index 0000000000000000000000000000000000000000..b1f34de7ad3d5a77a1a47f9f2aa07d219fbfe46a --- /dev/null +++ b/Tubes2/src/java/controller/RegistrasiServlet.java @@ -0,0 +1,76 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package controller; + +import java.io.IOException; +import java.io.PrintWriter; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * + * @author nim_13515091 + */ +@WebServlet(name = "RegistrasiServlet", urlPatterns = {"/Signup"}) +public class RegistrasiServlet extends HttpServlet { + + /** + * Handles the HTTP <code>GET</code> method. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + String userPath = request.getServletPath(); + + // use RequestDispatcher to forward request internally + String url = "/WEB-INF/view" + userPath + ".jsp"; + + try { + request.getRequestDispatcher(url).forward(request, response); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Handles the HTTP <code>POST</code> method. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + String userPath = request.getServletPath(); + + // if addToCart action is called + if (userPath.equals("/Signup")) { + // TODO: Implement add product to cart action + + // if updateCart action is called + } + + // use RequestDispatcher to forward request internally + String url = "/WEB-INF/view" + userPath + ".jsp"; + + try { + request.getRequestDispatcher(url).forward(request, response); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + +} diff --git a/Tubes2/web/WEB-INF/jspf/Header.jspf b/Tubes2/web/WEB-INF/jspf/Header.jspf index 08500a2b6d688079f46e1977239da737a060a4f9..de3d5ab95d5610e37c3fd296960cb57e92a06b4a 100644 --- a/Tubes2/web/WEB-INF/jspf/Header.jspf +++ b/Tubes2/web/WEB-INF/jspf/Header.jspf @@ -26,7 +26,7 @@ Hi, <b><?php echo $this->user; ?></b> ! </div> <div> - <a href="/login">Logout</a> + <a href="/Login">Logout</a> </div> </div> </header> @@ -34,8 +34,8 @@ <div class="menu-column"></div> <div class="menu-column"></div> <div class="menu-column"></div> - <div id="orderheader" class="menu-cell"><a href="/order/<?php echo $this->user; ?>" class="text-link">ORDER</a></div> - <div id="historyheader" class="menu-cell"><a href="/history/<?php echo $this->user; ?>" class="text-link">HISTORY</a></div> - <div id="profileheader" class="menu-cell"><a href="/profile/<?php echo $this->user; ?>" class="text-link">MY PROFILE</a></div> + <div id="orderheader" class="menu-cell"><a href="/Order" class="text-link">ORDER</a></div> + <div id="historyheader" class="menu-cell"><a href="/History" class="text-link">HISTORY</a></div> + <div id="profileheader" class="menu-cell"><a href="/Profile" class="text-link">MY PROFILE</a></div> </div> </div> \ No newline at end of file diff --git a/Tubes2/web/WEB-INF/view/EditPrefLoc.jsp b/Tubes2/web/WEB-INF/view/EditPrefLoc.jsp new file mode 100644 index 0000000000000000000000000000000000000000..bbfa7a673a01a1a62ec0377362bdfa84be0c63b8 --- /dev/null +++ b/Tubes2/web/WEB-INF/view/EditPrefLoc.jsp @@ -0,0 +1,46 @@ +<div class="container"> + <h1 class="header"><?php echo $this->title; ?></h1> + <form action=<?php echo '/preferred-loc/' . $this->user . '/edit'; ?> method="post"> + <table style="width:100%"> + <tr> + <th>No</th> + <th>Location</th> + <th>Actions</th> + </tr> + <?php + $count = 0; + foreach($this->prefLoc as $loc) { + $count = $count + 1; + echo "<tr class='rows'>"; + echo "<td id='count'>" . $count . "</td>"; + echo "<td><div name='location'>" . $loc['location'] . "</div></td>"; + echo "<td id='action'><img class=\"pref-button\" name=\"edit-button\" src='" . IMG . "/edit.png' /><a href='/preferred-loc/" . $this->user . "/delete/" . $loc['location'] . "'><img class=\"pref-button\" src='" . IMG . "/delete.png' /></td></a>"; + echo "</tr>"; + } + ?> + </table> + </form> + <form action=<?php echo '/preferred-loc/' . $this->user . '/finish'; ?> method='post' enctype="multipart/form-data"> + <div class="edit-profile-btm"> + <h2 class="header">Add new Location:</h2> + <div class="form-input"> + <input type="text" id="next-button-text" name="location" /> + <input class="next-button" type="submit" value="Add" /> + </div> + </div> + </form> +</div> +<script> + var edit = Array.prototype.slice.call(document.getElementsByName('edit-button')); + var locs = document.getElementsByName('location'); + var rows = document.getElementsByClassName('rows'); + + edit.map(function(x, i) { + var loc = locs[i].innerHTML; + x.addEventListener('click', function (event) { + event.preventDefault(); + rows[i].cells[1].innerHTML = '<input type="text" name="location_new" value="' + loc + '" /><input type="hidden" name="location_old" value="' + loc + '"/>'; + rows[i].cells[2].innerHTML = '<input type="submit" value="Save" />'; + }); + }); +</script> \ No newline at end of file diff --git a/Tubes2/web/WEB-INF/view/EditProfile.jsp b/Tubes2/web/WEB-INF/view/EditProfile.jsp new file mode 100644 index 0000000000000000000000000000000000000000..f1aae6f8fb28139adbd3771e4ecaf9618aaadeba --- /dev/null +++ b/Tubes2/web/WEB-INF/view/EditProfile.jsp @@ -0,0 +1,31 @@ +<div class="edit-profile-container"> + <form action='/editprofile/<?php echo $this->user; ?>/finish' method='post' onsubmit="return editProfileValidation();" enctype="multipart/form-data" name="editprofile-form"> + <h1 class="edit-profile-header">Edit Profile Information</h1> + <img id="profile-pic" src="<?php echo $this->image; ?>" alt=""> + <div class="img-chooser"> + <p>Update profile picture</p> + <input type="file" name="image" accept="image/jpeg, image/png"> + </div> + <div class="edit-profile-btm"> + <div class="form-editprofile"> + <label for="your-name">Your Name</label> + <input class="ep-textarea" type="text" name="your-name" value="<?php echo $this->name; ?>"> + </div> + <div class="form-editprofile"> + <label for="phone-number">Phone</label> + <input class="ep-textarea" type="text" name="phone-number" value="<?php echo $this->phone; ?>"> + </div> + <div class="button-form"> + <div> + Status driver + </div> + <label class="switch"> + <input type="checkbox" name="is-driver" <?php echo $this->isDriver; ?>> + <span class="slider round"></span> + </label> + </div> + <a href='/profile/<?php echo $this->user; ?>'><input class="cancel-button" value="Back"></a> + <input class="accept-button" id="save-profile" type="submit" value="Save"> + </div> + </form> +</div> \ No newline at end of file diff --git a/Tubes2/web/WEB-INF/view/History.jsp b/Tubes2/web/WEB-INF/view/History.jsp new file mode 100644 index 0000000000000000000000000000000000000000..5687ca8551b476bb57cd33343c3a6f3ad03986af --- /dev/null +++ b/Tubes2/web/WEB-INF/view/History.jsp @@ -0,0 +1,69 @@ +<div class="subtitle-cont subtitle-history"> + TRANSACTION HISTORY +</div> +<div class="body-container"> + <div class='menu'> + <div class="menu-column"></div> + <div class="menu-column"></div> + <div id="user-his" class="menu-cell" onclick="tabActive('user');">MY PREVIOUS ORDERS</div> + <div id="driver-his" class="menu-cell" onclick="tabActive('driver');">DRIVER HISTORY</div> + </div> +</div> + +<div id="history-container"> + <ol class="history-list order-list"> + <?php foreach($this->historyUser as $history): ?> + <li class="list-text-his"> + <div class="history-pic-div"> + <img class="profile-pic-his" src=<?php echo $this->image . $history[1]; ?> alt=""> + </div> + <span class="hide"> + <a href=<?php echo "/history/". $history[0] . "/update/" . $history[1] . "/" . rawurlencode($history[4]); ?>>HIDE</a> + </span> + <div class="his-text"> + <div class="date-his"><?php echo htmlentities($history[4]); ?></div> + <div class="name-his"><b><?php echo $history[1]; ?></b></div> + <div><?php echo $history[5]; ?> - <?php echo $history[6]; ?></div> + <div> + You rated : ?<?php echo $history[2]; ?> + <div> + <div> + You commented: + <div class="comment"> + <?php echo $history[3]; ?> + </div> + </div> + </div> + </li> + <?php endforeach; ?> + </ol> + + <ol class="history-list driver-list"> + + <?php foreach($this->historyDriver as $history): ?> + <li class="list-text-his"> + <div class="history-pic-div"> + <img class="profile-pic-his" src=<?php echo $this->image . $history[0]; ?> alt="" /> + </div> + <span class="hide"> + <a href=<?php echo "/history/". $history[0] . "/update/" . $history[1] . "/" . rawurlencode($history[4]); ?>>HIDE</a> + </span> + <div class="his-text"> + <div class="date-his"><?php echo $history[4]; ?></div> + <div><b><?php echo $history[0]; ?></b></div> + <div><?php echo $history[5]; ?> - <?php echo $history[6]; ?></div> + <div> + gave <span><?php echo $history[2]; ?></span> stars for this order + <div> + <div> + and left comment: + <div class="comment"> + <?php echo $history[3]; ?> + </div> + </div> + </div> + </li> + <?php endforeach; ?> + </ol> +</div> +<script src=<?php echo $this->script; ?>></script> \ No newline at end of file diff --git a/Tubes2/web/WEB-INF/view/Login.jsp b/Tubes2/web/WEB-INF/view/Login.jsp new file mode 100644 index 0000000000000000000000000000000000000000..e225c1d399cc6b5123612f7098a35085b6c34074 --- /dev/null +++ b/Tubes2/web/WEB-INF/view/Login.jsp @@ -0,0 +1,27 @@ +<section class="content-layout"> + <header class="title"> + <div> + <hr> + <h1><?php echo $this->title; ?></h1> + <hr> + </div> + </header> + <section class="form-layout"> + <form action="/Profile" method="post" name="loginform" onsubmit="return loginValidation();"> + <div class="form-input"> + <div>Username</div> + <input id="username" type="text" name="username"> + </div> + <div class="form-input"> + <div>Password</div> + <input type="password" name="password"> + </div> + <div id="button-layout"> + <div> + <a href="/Signup">Don't have an account?</a> + </div> + <input id="register-button" type="submit" value="GO!"> + </div> + </form> + </section> +</section> \ No newline at end of file diff --git a/Tubes2/web/WEB-INF/view/Order.jsp b/Tubes2/web/WEB-INF/view/Order.jsp index 90e429e371cc87c4bc15e6e5ae64f728cf05a730..158580d5cb7030220c90e39196f6479895a91dc4 100644 --- a/Tubes2/web/WEB-INF/view/Order.jsp +++ b/Tubes2/web/WEB-INF/view/Order.jsp @@ -13,7 +13,7 @@ <div class="progress-num">3</div> Complete your order </div> </div> - <form action="SelectDriver.jsp" method='post'> + <form action="/SelectDriver" method='post'> <div class="edit-profile-btm"> <div class="form-input"> <label for="pick-point">Picking point</label> diff --git a/Tubes2/web/WEB-INF/view/Profile.jsp b/Tubes2/web/WEB-INF/view/Profile.jsp new file mode 100644 index 0000000000000000000000000000000000000000..d9f7ab2f2e54da6c036b74d5d5ab6e06f7f1fcef --- /dev/null +++ b/Tubes2/web/WEB-INF/view/Profile.jsp @@ -0,0 +1,45 @@ +<div id="info-profile"> + <div class="subtitle-cont"> + <div class="subtitle-profile"> + MY PROFILE + </div> + <a href="/EditProfile" > + <div id="edit-pen-div"> + <img class="edit-pen" src=<?php echo $this->edit; ?>> + </div> + </a> + </div> + <div id="profile-pic-div"> + <img class="profile-picture" src=<?php echo $this->image; ?>> + </div> + <div id="info-text"> + <ol id="list-info"> + <li><b><?php echo $this->username; ?></b></li> + <li><?php echo $this->name; ?></li> + <?php if($this->isdriver == 'Driver'): ?> + <li><?php echo $this->isdriver; ?> | <?php for($i = 0; $i<floor($this->rating); $i++) { echo "?"; } ?> (<?php echo $this->rating; ?> rating from <?php echo $this->votes; ?> votes)</li> + <?php endif; ?> + <li><?php echo $this->email; ?></i></li> + <li><?php echo $this->phone; ?></i></li> + </ol> + </div> +</div> +<div> + <div class="subtitle-cont"> + <?php if($this->isdriver == 'Driver'): ?> + <div id="prefer-loc-title" class="subtitle-profile"> + PREFERRED LOCATIONS: + </div> + <a href="/EditPrefLoc"> + <div id="edit-pen-div"> + <img class="edit-pen" src=<?php echo $this->edit; ?>> + </div> + </a> + </div> + <?php foreach ($this->preferredloc as $loc): ?> + <div id="info-pref-text"> + <span class="loc-list"><?php echo " " . $loc[1] ?><span> + </div> + <?php endforeach; ?> + <?php endif; ?> +</div> \ No newline at end of file diff --git a/Tubes2/web/WEB-INF/view/SelectDriver.jsp b/Tubes2/web/WEB-INF/view/SelectDriver.jsp index d8106748f411b9c73c53488a6929904b0faa165b..356ed7840a62df3f2c314de9e7eccb4ededf6ca6 100644 --- a/Tubes2/web/WEB-INF/view/SelectDriver.jsp +++ b/Tubes2/web/WEB-INF/view/SelectDriver.jsp @@ -1,5 +1,5 @@ <div class="edit-profile-header"> - Make an order + Make an order </div> <div class="progress-container"> <div class="progress"> diff --git a/Tubes2/web/WEB-INF/view/Signup.jsp b/Tubes2/web/WEB-INF/view/Signup.jsp new file mode 100644 index 0000000000000000000000000000000000000000..5f97a7eac6547e7a85490394b720c0b70e40012d --- /dev/null +++ b/Tubes2/web/WEB-INF/view/Signup.jsp @@ -0,0 +1,49 @@ +<section class="content-layout"> + <header class="title"> + <div> + <hr> + <h1><?php echo $this->title; ?></h1> + <hr> + </div> + </header> + <section class="form-layout"> + <form action="/Profile" method="post" name="signupform" onsubmit="return signupValidation()"> + <div class="form-input"> + <div>Your Name</div> + <input id="your-name" type="text" name="your-name"> + </div> + <div class="form-input checked-input"> + <div>Username</div> + <input id="username" type="text" name="username" onKeyUp="checkData('username','username-check')"> + <span id="username-check"></span> + </div> + <div class="form-input checked-input"> + <div>Email</div> + <input id="email" type="text" name="email" onKeyUp="checkData('email','email-check')"> + <span id="email-check"></span> + </div> + <div class="form-input"> + <div>Password</div> + <input id="password" type="password" name="password"> + </div> + <div class="form-input"> + <div>Confirm Password</div> + <input id="confirm-password" type="password" name="confirm-password"> + </div> + <div class="form-input"> + <div>Phone Number</div> + <input id="phone" type="text" name="phone-number"> + </div> + <div class="driver-checkbox"> + <input id="isdriver" type="checkbox" name="driver"> + <div>Also sign me up as a driver!</div> + </div> + <div id="button-layout"> + <div> + <a href="/Login">Already have an account</a> + </div> + <input id="register-button" type="submit" value="Register"> + </div> + </form> + </section> +</section> \ No newline at end of file diff --git a/Tubes2/web/index.jsp b/Tubes2/web/index.jsp index f0d6d8208f99c203f66a3cbe780e3e3f3343b6ad..23a64713d7d5d883ffc7461b34beca3eb94cba5a 100644 --- a/Tubes2/web/index.jsp +++ b/Tubes2/web/index.jsp @@ -14,7 +14,7 @@ <body> <h1>Hello World!</h1> - <form name="Name Input Form" action="/Order" method='post'> + <form name="Name Input Form" action="/Login" method='post'> Enter Your Name: <input type="text" name="name" value="" /> <input type="submit" value="OK" /> diff --git a/Tubes2/web/js/selectdriver.js b/Tubes2/web/js/selectdriver.js index 2d7b38f4833461051ad76f37a3eac112a88b0156..a79086fcb10aaafe22c9f1c7f7c35640d0517442 100644 --- a/Tubes2/web/js/selectdriver.js +++ b/Tubes2/web/js/selectdriver.js @@ -61,7 +61,7 @@ function CreateDriverDisplay(driverType, driverUsrName) { var avgRating = (driverSumRating[driverUsrName]/driverCountRating[driverUsrName]).toFixed(1).toString(); newForm.setAttribute('method', 'post'); - newForm.setAttribute('action', '/order/' + user + '/completeorder'); + newForm.setAttribute('action', '/CompleteOrder'); newContainer.classList.add("driver-content"); newImg.classList.add("driver-pic");