Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Showing
with 1673 additions and 0 deletions
<%--
Created by IntelliJ IDEA.
User: fadhilimamk
Date: 07/11/17
Time: 3:02
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Login | Ojek Online</title>
<link rel="stylesheet" type="text/css" href="/style/style.css">
</head>
<body>
<form method="post" action="/login">
<div class="login-container">
<div class="row">
<div class="col-6 text-center">
<h1 style="color: #007c30; font-size: 3em">LOGIN<br>
</div>
</div>
<br>
<br>
<div class="row">
<div class="col-2">
<span style="font-size: 1.3em; line-height: 40px">Username</span>
</div>
<div class="col-4">
<input style="margin-left:10px; width:95%; height: 30px; padding-left: 5px" class="login-input" type="text" placeholder="Username" name="username">
</div>
</div>
<div class="row">
<div class="col-2">
<span style="font-size: 1.3em; line-height: 40px">Password</span>
</div>
<div class="col-4">
<input style="margin-left:10px;width:95%;height: 30px; padding-left: 5px" class="login-input" type="password" placeholder="Password" name="password">
</div>
</div>
<br>
<br>
<br>
<div class="row">
<div class="col-4 text-left">
<a style="float: left; font-size: 0.8em" class="login-link" href="/index.php/register">Don't have an account?</a>
</div>
<div class="col-2 text-right">
<input class="btn login-button" type="submit" value="GO!">
</div>
</div>
<br>
<br>
<br>
<br>
</div>
</form>
</body>
</html>
<%--
Created by IntelliJ IDEA.
User: fadhilimamk
Date: 07/11/17
Time: 11:36
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>DAGO-JEK | Order</title>
<link rel="stylesheet" type="text/css" href="/style/style.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-3"><span class="logo"></span></div>
<div class="col-3 text-right">
<p class="user-action">
Hi, <b>fadhilimamk</b> !<br>
<a href="/">Logout</a>
</p>
</div>
</div>
<div class="row">
<a class="col-2 tab text-center active" href="/main/order">ORDER</a>
<a class="col-2 tab text-center" href="/main/history">HISTORY</a>
<a class="col-2 tab text-center" href="/main/profil">MY PROFILE</a>
</div>
<div class="row">
<div class="col-6"><h1>MAKE AN ORDER</h1></div>
<span id="customer-id" style="display: none"><?=$id?></span>
</div>
<div class="row">
<div class="col-2">
<div id="page-tab-location" class="page-tab selected">
<div class="page-tab-image">
<div class="circle">1</div>
</div>
<div class="page-tab-content">
Select Destination
</div>
</div>
</div>
<div class="col-2">
<div id="page-tab-driver" class="page-tab">
<div class="page-tab-image">
<div class="circle">2</div>
</div>
<div class="page-tab-content">
Select a Driver
</div>
</div>
</div>
<div class="col-2">
<div id="page-tab-finish" class="page-tab">
<div class="page-tab-image">
<div class="circle">3</div>
</div>
<div class="page-tab-content">
Complete your order
</div>
</div>
</div>
</div>
<br>
<br>
<div id="order-page-location">
<form id="orderForm">
<div class="row">
<div class="col-2" style="line-height: 40px">
<span style="padding-left: 30%;">Picking Point</span> <br>
</div>
<div class="col-4" style="line-height: 30px">
<input id="orderPickup" style="width: 80%;height: 30px;padding-left: 5px;font-size: medium" type="text" name="picking_point" placeholder="Pick up point">
</div>
</div>
<div class="row">
<div class="col-2" style="line-height: 40px">
<span style="padding-left: 30%">Destination</span> <br>
</div>
<div class="col-4" style="line-height: 30px">
<input id="orderDestination" style="width: 80%; height: 30px;padding-left: 5px;font-size: medium" type="text" name="destination" placeholder="Destination">
</div>
</div>
<div class="row">
<div class="col-2" style="line-height: 40px">
<span style="padding-left: 30%">Preferred Driver</span>
</div>
<div class="col-4">
<input id="orderPreferredDriver" style="width: 80%;height: 30px;padding-left: 5px;font-size: medium" type="text" name="driver" placeholder="(optional)"><br>
</div>
</div>
<br>
<br>
<br>
<div class="row text-center">
<a href="#" class="btn green" style="font-size: 2em" onclick="makeOrder()">Next</a>
</div>
</form>
</div>
<div id="order-page-driver">
<div style="width: 100%; border: 1px solid black; border-radius: 10px;">
<h2 style="margin-left: 10px; margin-top: 0px">PREFERRED DRIVERS: </h2>
<div id="driver-preferred-result" style="margin: 0 30px 30px 30px">
<p id="driver-preferred-empty" class="text-center" style="font-size: large; color: #989898; margin: 30px">Nothing to display :(</p>
</div>
</div>
<br>
<div style="width: 100%; border: 1px solid black; border-radius: 10px;">
<h2 style="margin-left: 10px; margin-top: 0px">OTHER DRIVERS: </h2>
<div id="driver-search-result" style="margin: 0 30px 30px 30px">
<p id="driver-preferred-empty" class="text-center" style="font-size: large; color: #989898; margin: 30px">Nothing to display :(</p>
</div>
</div>
</div>
<div id="order-page-finish" style="width: 100%;">
<h2 style="margin-left: 10px; margin-top: 0px">HOW WAS IT? </h2>
<div id="driver-finish-order" class="text-center profil" style="padding-bottom: 60px">
<p id="driver-preferred-empty" class="text-center" style="font-size: large; color: #989898; margin: 30px">Nothing to display :(</p>
</div>
</div>
</div>
<script type="text/javascript" src="/script/order.js"></script>
</body>
</html>
<%--
Created by IntelliJ IDEA.
User: fadhilimamk
Date: 07/11/17
Time: 11:28
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>DAGO-JEK | Profil</title>
<link rel="stylesheet" type="text/css" href="/style/style.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-3"><span class="logo"></span></div>
<div class="col-3 text-right">
<p class="user-action">
Hi, <b>fadhilimamk</b> !<br>
<a href="/logout">Logout</a>
</p>
</div>
</div>
<div class="row">
<a class="col-2 tab text-center" href="/main/order">ORDER</a>
<a class="col-2 tab text-center" href="/main/history">HISTORY</a>
<a class="col-2 tab text-center active" href="/main/profil">MY PROFILE</a>
</div>
<div class="row">
<div class="col-5"><h1>MY PROFILE</h1></div>
<div class="col-1 text-right"><a class="edit" href="/edit/profil"></a></div>
</div>
<div class="text-center profil">
<img class="img-circle" src="#"/><br>
<h2>@fadhilimamk</h2>
<p>Fadhil Imam</p>
<p>Driver | <span class="text-orange"><b><i class="icon icon-star"></i> 4.15</b></span> (122 votes)</p>
<p><i class="icon icon-mail"></i> 13515146@std.stei.itb.ac.id</p>
<p><i class="icon icon-phone"></i> 085797490039</p>
</div>
<div class="row">
<div class="col-5"><h2>PREFERED LOCATIONS</h2></div>
<div class="col-1 text-right"><a class="edit" href="/edit/location"></a></div>
</div>
<div class="row">
<ul class="location-list">
<li style="margin-left: 0px"><b>Cipaganti</b></li>
<li style="margin-left: 35px"><b>Dago Pojok</b></li>
<li style="margin-left: 70px"><b>Tubagus</b></li>
<li style="margin-left: 105px"><b>Unpad</b></li>
</ul>
</div>
</div>
</body>
</html>
function getHistoryAsCustomer() {
var userID = document.getElementById('customer-id').innerHTML;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
resultData = JSON.parse(this.responseText);
bindCustomerResult(resultData);
console.log(resultData);
}
}
xhttp.open('POST', '/index.php/main/history/customer?u='+userID, true);
xhttp.send();
}
function getHistoryAsDriver() {
var userID = document.getElementById('customer-id').innerHTML;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
resultData = JSON.parse(this.responseText);
bindDriverResult(resultData);
console.log(resultData);
}
}
xhttp.open('POST', '/index.php/main/history/driver?u='+userID, true);
xhttp.send();
}
function bindDriverResult(data) {
var html = '';
var customerNames = data.customerNames;
var results = data.history;
if (results != null && results.length != 0) {
results.forEach(function (driverItem) {
html += '' +
'<div class="row" id="'+driverItem.id_order+'">\n' +
' <img src="'+customerNames[driverItem.id_driver].photo+'" style="float: left; border: 1px solid black; margin: 10px" width="120" height="125">\n' +
' <h3><small>'+driverItem[7]+'</small><br>' +
' '+customerNames[driverItem.id_driver].name+'<br>' +
' </h3>' +
' <h5>'+driverItem[3]+'-'+driverItem[4]+'<br>' +
' You Rated: '+driverItem.rating+'<br>' +
' You Commented: "'+driverItem.comment+'"</h5>' +
' <a href="#" class="btn red" style="float: right; margin: 10px" onclick="hideElement(\''+driverItem.id_order+'\')">HIDE</a>\n' +
'</div>';
});
document.getElementById('driver-search-result').innerHTML = html;
}
}
function bindCustomerResult(data) {
var html = '';
var driverNames = data.driverNames;
var results = data.history;
if (results != null && results.length != 0) {
results.forEach(function (driverItem) {
html += '' +
'<div class="row" id="'+driverItem.id_order+'">\n' +
' <img src="'+driverNames[driverItem.id_driver].photo+'" style="float: left; border: 1px solid black; margin: 10px" width="120" height="125">\n' +
' <h3><small>'+driverItem[7]+'</small><br>' +
' '+driverNames[driverItem.id_driver].name+'<br>' +
' </h3>' +
' <h5>'+driverItem[3]+'-'+driverItem[4]+'<br>' +
' gave '+driverItem.rating+' rating<br>' +
' and said, "'+driverItem.comment+'"</h5>' +
' <a href="#" class="btn red" style="float: right; margin: 10px" onclick="hideElement(\''+driverItem.id_order+'\')">HIDE</a>\n' +
'</div>';
});
document.getElementById('driver-search-result').innerHTML = html;
}
}
function hideElement(elmtID) {
document.getElementById(elmtID).style.display = 'none';
}
// Subpage Navigation
document.getElementById('page-tab-customer').onclick = function () {
showCustomerPage();
getHistoryAsCustomer();
};
document.getElementById('page-tab-driver').onclick = function () {
showDriverPage();
getHistoryAsDriver();
};
function showCustomerPage() {
var driverPage = document.getElementById('history-page-driver');
driverPage.style.display = 'none';
var customerPage = document.getElementById('history-page-customer');
customerPage.style.display = 'block';
document.getElementById('page-tab-driver').classList.remove("active");
document.getElementById('page-tab-customer').classList.add("active");
}
function showDriverPage() {
var customerPage = document.getElementById('history-page-customer');
customerPage.style.display = 'none';
var driverPage = document.getElementById('history-page-driver');
driverPage.style.display = 'block';
document.getElementById('page-tab-customer').classList.remove("active");
document.getElementById('page-tab-driver').classList.add("active");
}
\ No newline at end of file
// Hide other page section
(function() {
showLocationPage();
})();
var resultData;
function makeOrder() {
var customerID = document.getElementById('customer-id').innerHTML;
var orderPickup = document.getElementById('orderPickup').value;
var orderDestination = document.getElementById('orderDestination').value;
var orderPreferredDriver = document.getElementById('orderPreferredDriver').value;
var data = "id="+customerID+"&pickup="+orderPickup+"&destination="+orderDestination+"&driver="+orderPreferredDriver;
if (orderPickup.trim() == "" || orderDestination.trim() == "") {
alert("Source and destination is required!");
return;
}
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
resultData = JSON.parse(this.responseText);
bindSearchResult(JSON.parse(this.responseText));
showDriverPage();
document.getElementById('orderPickup').disabled = true;
document.getElementById('orderDestination').disabled = true;
document.getElementById('orderPreferredDriver').disabled = true;
}
};
xhttp.open("POST", "/index.php/main/order/new", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send(data);
}
function bindSearchResult(data) {
var preferred = data.preferred;
if (preferred != null) {
var vote = (preferred.sum_order > 1) ? 'votes' : 'vote';
document.getElementById('driver-preferred-result').innerHTML = '' +
'<div class="row">\n' +
' <img src="'+preferred.photo+'" style="float: left; border: 1px solid black; margin: 10px" width="120" height="125">\n' +
' <p style="font-size: 1.4em; margin:20px 10px 3px 10px">'+preferred.name+'</p>\n' +
' <p style="margin-top: 0"><span class="text-orange"><b><i class="icon icon-star"></i> '+preferred.rating+'</b></span> ('+preferred.sum_order+' '+vote+')</p>\n' +
' <span class="btn green" style="float: right; margin: 10px" onclick="finishOrder(\''+preferred.id+'\')">I CHOOSE YOU!</span>\n' +
'</div>';
}
var html = '';
var results = data.result;
if (results != null && results.length != 0) {
results.forEach(function (driverItem) {
var vote = (driverItem.sum_order > 1) ? 'votes' : 'vote';
html += '' +
'<div class="row">\n' +
' <img src="'+driverItem.photo+'" style="float: left; border: 1px solid black; margin: 10px" width="120" height="125">\n' +
' <p style="font-size: 1.4em; margin:20px 10px 3px 10px">'+driverItem.name+'</p>\n' +
' <p style="margin-top: 0"><span class="text-orange"><b><i class="icon icon-star"></i> '+driverItem.rating+'</b></span> ('+driverItem.sum_order+' '+vote+')</p>\n' +
' <a href="#" class="btn green" style="float: right; margin: 10px" onclick="finishOrder(\''+driverItem.id+'\')">I CHOOSE YOU!</a>\n' +
'</div>';
});
document.getElementById('driver-search-result').innerHTML = html;
}
}
function finishOrder(id) {
var photo;
var name;
var username;
var preferred = resultData.preferred;
if (preferred != null && preferred.id == id) {
photo = preferred.photo;
name = preferred.name;
username = preferred.username;
} else {
var results = resultData.result;
var i = 0;
while (results[i].id != id) {
i++;
}
photo = results[i].photo;
name = results[i].name;
username = results[i].username;
}
bindFinishPage(id, name, photo, username);
showFinishPage();
}
function bindFinishPage(id, name, photo, username) {
document.getElementById('driver-finish-order').innerHTML = '' +
'<img class="img-circle" src="'+photo+'"/><br>\n' +
'<h2 style="margin-bottom: 0px">@'+username+'</h2>\n' +
'<p style="margin-top: 10px">'+name+'</p>\n' +
'<i id="star-1" class="icon icon-star-full big" onclick="setRating(1)"></i>\n' +
'<i id="star-2" class="icon icon-star-full big" onclick="setRating(2)"></i>\n' +
'<i id="star-3" class="icon icon-star-full big" onclick="setRating(3)"></i>\n' +
'<i id="star-4" class="icon icon-star-full big" onclick="setRating(4)"></i>\n' +
'<i id="star-5" class="icon icon-star-full big" onclick="setRating(5)"></i>\n' +
'<input type="hidden" id="order-rating" value="0"> \n' +
'<br>\n' +
'<br>\n' +
'<br>\n' +
'<textarea id="order-comment" style="width: 100%; height: 100px; padding: 10px; resize: none" placeholder="Your comment..." ></textarea>\n' +
'<a class="btn green" style="float: right; margin: 10px" onclick="completeOrder(\''+id+'\')">COMPLETE<br>ORDER</a>'
}
function setRating(val) {
for (var i = 1; i <= 5; i++) {
if (i <= val) {
document.getElementById('star-'+i).style.color = "orange";
} else {
document.getElementById('star-'+i).style.color = "#c2c2c2";
}
}
document.getElementById('order-rating').value = val;
}
function completeOrder(id) {
var customerID = document.getElementById('customer-id').innerHTML;
var orderPickup = document.getElementById('orderPickup').value;
var orderDestination = document.getElementById('orderDestination').value;
var rating = document.getElementById('order-rating').value;
var comment = document.getElementById('order-comment').value;
var data = 'id='+id+'&id_customer='+customerID+'&source='+orderPickup+'&destination='+orderDestination+'&rating='+rating+'&comment='+comment;
if (rating == 0) {
alert("You must give rating to your driver");
return;
}
if (comment.trim() == "") {
alert("You must give feedback to your driver");
return;
}
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
if (this.responseText == "Error") {
alert("Fail completing your order");
} else {
alert("Thanks for your order :D");
window.location.href = "/index.php/main/order?u="+customerID;
}
}
};
xhttp.open("POST", "/index.php/main/order/finish?u", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send(data);
}
function showLocationPage() {
var finishPage = document.getElementById('order-page-finish');
finishPage.style.display = 'none';
var driverPage = document.getElementById('order-page-driver');
driverPage.style.display = 'none';
var locationPage = document.getElementById('order-page-location');
locationPage.style.display = 'block';
document.getElementById('page-tab-driver').classList.remove("selected");
document.getElementById('page-tab-finish').classList.remove("selected");
document.getElementById('page-tab-location').classList.add("selected");
}
function showDriverPage() {
var locationPage = document.getElementById('order-page-location');
locationPage.style.display = 'none';
var finishPage = document.getElementById('order-page-finish');
finishPage.style.display = 'none';
var driverPage = document.getElementById('order-page-driver');
driverPage.style.display = 'block';
document.getElementById('page-tab-driver').classList.add("selected");
document.getElementById('page-tab-finish').classList.remove("selected");
document.getElementById('page-tab-location').classList.remove("selected");
}
function showFinishPage() {
var locationPage = document.getElementById('order-page-location');
locationPage.style.display = 'none';
var driverPage = document.getElementById('order-page-driver');
driverPage.style.display = 'none';
var finishPage = document.getElementById('order-page-finish');
finishPage.style.display = 'block';
document.getElementById('page-tab-driver').classList.remove("selected");
document.getElementById('page-tab-finish').classList.add("selected");
document.getElementById('page-tab-location').classList.remove("selected");
}
\ No newline at end of file
function validateProfileEdit() {
var inputName = document.getElementById('inputName').value;
var inputPhone = document.getElementById('inputPhone').value;
if (inputName.trim() == "" || inputPhone.trim() == "") {
alert("Name and Phone can't empty!");
return false;
}
return true;
}
function validateLocationEdit() {
var input = document.getElementById('locationInput').value;
if (input.trim() == "") {
alert('Location is empty!');
return false;
}
return true;
}
var inputs = document.querySelectorAll( '.input-photo' );
Array.prototype.forEach.call( inputs, function( input ) {
var label = input.nextElementSibling,
labelVal = label.innerHTML;
input.addEventListener( 'change', function( e ) {
var fileName = '';
if( this.files && this.files.length > 1 )
fileName = ( this.getAttribute( 'data-multiple-caption' ) || '' ).replace( '{count}', this.files.length );
else
fileName = e.target.value.split( '\\' ).pop();
if( fileName )
label.querySelector( '.input-photo-result' ).innerHTML = fileName;
else
label.innerHTML = labelVal;
});
});
function editLocation(id) {
var inputs = document.getElementsByClassName('input-location');
for (var i = 0; i < inputs.length; i++) {
inputs[i].style.display = 'none';
inputs[i].previousElementSibling.style.display = 'inline';
}
var buttons = document.getElementsByClassName('action-edit');
for (var i = 0; i < buttons.length; i++) {
buttons[i].style.backgroundImage = 'url(\'/img/ic_edit.jpg\')';
buttons[i].setAttribute( "onClick", "javascript: editLocation("+buttons[i].getAttribute("data")+");" );
}
var locationSpan = document.getElementById('location-'+id);
var locationInput = document.getElementById('input-location-'+id);
var actionEdit = document.getElementById('action-edit-'+id);
locationInput.value = locationSpan.innerHTML;
locationSpan.style.display = 'none';
// change action Edit icon
actionEdit.style.backgroundImage = 'url(\'/img/ic_save.png\')';
actionEdit.style.backgroundSize = '20px 20px';
actionEdit.style.width = '20px';
actionEdit.style.height = '20px';
actionEdit.onclick = function () {
if (locationInput.value.trim() == "") {
alert("Location can not empty!");
return;
}
saveLocation(locationSpan.innerHTML, locationInput.value);
}
locationInput.style.display = 'block';
locationInput.focus();
}
function saveLocation(location, newlocation) {
var id = document.getElementById('driver-id').innerHTML;
var data = 'id='+id+'&location='+location+'&newlocation='+newlocation;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
if (this.responseText == "Success") {
window.location.href = "/index.php/main/profil/location/edit?u="+id;
} else {
alert(this.responseText);
}
}
};
xhttp.open("POST", "/index.php/main/profil/location/edit/data", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send(data);
}
\ No newline at end of file
function checkAvailability(string, elmtID, dataCollection) {
var field = document.getElementById(elmtID);
if (string.length === 0) {
field.classList.remove("available");
field.classList.remove("unavailable");
return;
} else {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (this.readyState === 4 && this.status === 200) {
if (this.responseText === "available") {
field.classList.remove("unavailable");
field.classList.add("available");
document.getElementById(elmtID+'-status').src = '/img/ic_check.png';
} else {
field.classList.remove("available");
field.classList.add("unavailable");
document.getElementById(elmtID+'-status').src = '/img/ic_close.png';
}
}
};
xmlhttp.open("GET", dataCollection + "?q=" + string, true);
xmlhttp.send();
}
}
function checkRequiredField(elmtID) {
var field = document.getElementById(elmtID);
if (field.value === "") {
field.classList.add("empty-required");
return false;
} else {
field.classList.remove("empty-required");
return true;
}
}
var isNameFilled = false;
var isUsernameFilled = false;
var isPasswordFilled = false;
var isEmailFilled = false;
var isPhoneFilled = false;
var isPasswordMatch = false;
var isUsernameAvailable = false;
var isEmailAvailable = false;
document.getElementById("confirm-password").onkeyup = function () {
var confirmField = document.getElementById("confirm-password");
var passwordField = document.getElementById("password");
if (confirmField.value !== passwordField.value) {
confirmField.classList.add("not-match");
passwordField.classList.add("not-match");
isPasswordMatch = false;
} else {
confirmField.classList.remove("not-match");
passwordField.classList.remove("not-match");
isPasswordMatch = true;
}
};
document.getElementById("name").onkeyup = function () {
isNameFilled = checkRequiredField("name");
};
document.getElementById("username").onkeyup = function () {
isUsernameFilled = checkRequiredField("username");
checkAvailability(this.value, "username", '/index.php/register/validate/username');
isUsernameAvailable = this.classList.contains("available");
};
document.getElementById("password").onkeyup = function () {
isPasswordFilled = checkRequiredField("password");
};
document.getElementById("email").onkeyup = function () {
isEmailFilled = checkRequiredField("email");
checkAvailability(this.value, "email", '/index.php/register/validate/email');
isEmailAvailable = this.classList.contains("available");
};
document.getElementById("phone").onkeyup = function () {
isPhoneFilled = checkRequiredField("phone");
};
document.getElementById("register-form").onkeyup = function () {
var submitBtn = document.getElementById("sign-up-btn");
if (isNameFilled &&
isUsernameFilled &&
isPasswordFilled &&
isEmailFilled &&
isPhoneFilled &&
isPasswordMatch &&
isUsernameAvailable &&
isEmailAvailable) {
submitBtn.removeAttribute("disabled");
} else {
submitBtn.setAttribute("disabled", "true");
}
};
\ No newline at end of file
/* ------------------------- GENERAL -------------------------*/
body {
background-color: #F5F5F5;
font-family: KacstOffice, sans-serif;
}
.container {
width: 80%;
max-width: 700px;
margin: 50px auto;
background-color: white;
padding: 20px;
border-radius: 5px;
}
.row:before,
.row:after {
content: "";
display: table;
clear: both;
}
[class*='col-'] {
float: left;
min-height: 1px;
width: 16.66%;
}
.col-1 {
width: 16.66%;
}
.col-2 {
width: 33.33%;
}
.col-3 {
width: 50%;
}
.col-4 {
width: 66.66%;
}
.col-5 {
width: 83.33%;
}
.col-6 {
width: 100%;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
.text-orange {
color: orange;
}
.btn {
border-radius: 5px;
border: 1px solid black;
padding: 5px 15px;
color: black;
text-decoration: none;
font-size: medium;
}
.red {
background-color: #DA0000;
}
.green {
background-color: #58F100;
}
.line-height-medium {
line-height: 30px;
}
/* ------------------------- HEADER -------------------------*/
.logo:after {
background-image: url('/img/logo.jpg');
background-size: 210px 40px;
display: inline-block;
width: 210px;
height: 40px;
content: "";
margin-bottom: 5px;
}
.user-action {
margin-top: 0px;
}
.tab {
outline: 1px solid #004D40;
padding-top: 15px;
padding-bottom: 15px;
font-weight: 900;
color: black;
text-decoration: none;
}
.tab.active {
background-color: #426344;
color: #FAFAFA;
}
.tab:hover {
background-color: #426344;
color: #FAFAFA;
}
/* ------------------------- ICON -------------------------*/
@font-face {
font-family: 'icon';
src: url("/font/typicons.eot");
src: url("/font/typicons.eot?#iefix") format('embedded-opentype'),
url("/font/typicons.woff") format('woff'),
url("/font/typicons.ttf") format('truetype'),
url("/font/typicons.svg#typicons") format('svg');
font-weight: normal;
font-style: normal;
}
.icon:before {
font-family: 'icon';
font-style: normal;
font-weight: normal;
speak: none;
display: inline-block;
text-decoration: inherit;
width: 1em;
height: 1em;
font-size: 1em;
text-align: center;
-webkit-font-smoothing: antialiased;
font-smoothing: antialiased;
text-rendering: optimizeLegibility
}
.icon.big {
font-size: 3em;
color: #c2c2c2;
}
.icon.icon-mail:before {
content: '\e0a5'
}
.icon.icon-phone:before {
content: '\e0c5'
}
.icon.icon-star:before {
content: '\e108'
}
.icon.icon-star-full:before{
content:'\e105'
}
/* ------------------------- PROFIL -------------------------*/
.img-circle {
width: 170px;
height: 170px;
border-radius: 50%;
border: 3px solid black;
}
.img-profile {
width: 130px;
height: 130px;
outline: 3px solid black;
}
.profil > p {
line-height: 50%;
}
.location-list {
line-height: 1.9em;
list-style-image: url('/img/ic_triangle.png');
}
.edit:after {
background-image: url('/img/ic_edit.jpg');
background-size: 45px 45px;
display: inline-block;
width: 45px;
height: 45px;
content: "";
}
a.edit:after {
margin: 15px;
}
table {
border-collapse: collapse;
}
table, th, td {
border: 1px solid #c2c2c2;
}
.action-edit {
background-image: url('/img/ic_edit.jpg');
background-size: 25px 25px;
display: inline-block;
width: 25px;
height: 20px;
content: "";
margin-right: 10px;
cursor: pointer;
}
.action-save {
background-image: url('/img/ic_edit.jpg');
background-size: 25px 25px;
display: inline-block;
width: 25px;
height: 20px;
content: "";
margin-right: 10px;
cursor: pointer;
}
.action-delete {
background-image: url('/img/ic_close.png');
background-size: 17px 17px;
display: inline-block;
width: 17px;
height: 17px;
content: "";
}
/* The switch - the box around the slider */
.switch {
position: relative;
display: inline-block;
width: 40px;
height: 22px;
}
/* Hide default HTML checkbox */
.switch input {display:none;}
.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: 15px;
width: 15px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #008C14;
}
input:focus + .slider {
box-shadow: 0 0 1px #008C14;
}
input:checked + .slider:before {
-webkit-transform: translateX(17px);
-ms-transform: translateX(17px);
transform: translateX(17px);
}
.slider.round {
border-radius: 22px;
}
.slider.round:before {
border-radius: 50%;
}
.input-photo {
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: absolute;
z-index: -1;
}
.input-photo + label {
display: inline-block;
cursor: pointer;
width: 100%;
line-height: 33px;
}
.input-photo + label > .input-photo-button {
color: black;
float: right;
font-size: 0.75em;
width: 27%;
background-color: #ccc;
text-align: center;
}
.input-photo + label > .input-photo-result {
float: left;
font-size: 0.75em;
width: 70%;
height: 32px;
padding-left: 5px;
border: solid 1px black;
margin-right: 2px;
}
.input-photo:focus + label > .input-photo-button,
.input-photo + label > .input-photo-button:hover {
background-color: #999aa3;
}
.input-photo:focus + label > .input-photo-button {
outline: 1px dotted #000;
outline: -webkit-focus-ring-color auto 5px;
}
/* ------------------------- ORDER -------------------------*/
.small-circle {
width: 30px;
height: 30px;
border-radius: 50%;
background-color: #c2c2c2;
font-size: large;
vertical-align: middle;
margin: 0;
}
.page-tab {
width: 180px;
height: 50px;
border: 1px solid black;
margin: 0 auto;
display: table;
box-sizing: border-box;
vertical-align: middle;
}
.page-tab.selected {
background-color: #f4fe96;
}
.page-tab > .page-tab-image {
float: left;
width: 30%;
height:100%;
text-align: center;
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
}
.page-tab >.page-tab-image >.circle {
border-radius: 50%;
width: 40px;
height: 40px;
margin: auto;
background-color: #d7d7d7;
padding: auto;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
}
.page-tab > .page-tab-content {
float: right;
width: 70%;
height:100%;
display: inline-block;
display: flex;
flex-direction: column;
justify-content: center;
}
/* Login Page */
.login-input {
margin: 5px 0 5px 0;
}
.login-link {
float: right;
margin-top: 10px;
}
.login-button {
padding: 10px 20px;
background-color: #58f100;
}
.login-container {
width: 60%;
max-width: 300px;
margin: 50px auto;
background-color: #74d034;
padding-left: 30px;
padding-right: 30px;
border-radius: 50px;
border: solid 10px #007c30;
color: #007c30;
}
/* Register Page */
#sign-up-btn {
float: right;
}
.register-link {
float: left;
margin-top: 8px;
}
.checkbox {
margin: 10px 0 10px 0;
}
.available {
background-color: greenyellow;
}
.unavailable, .empty-required, .not-match {
background-color: orangered;
}
.not-match::-webkit-input-placeholder, .empty-required::-webkit-input-placeholder, .unavailable::-webkit-input-placeholder {
color: whitesmoke;
}
\ No newline at end of file
<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="ValidExternallyBoundObject" enabled="false" level="ERROR" enabled_by_default="false" />
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectKey">
<option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8 (1)" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="WebServicesPlugin" addRequiredLibraries="true" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/intellij.iml" filepath="$PROJECT_DIR$/intellij.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<template>
<input-field default="com.company">IJ_BASE_PACKAGE</input-field>
</template>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>
\ No newline at end of file
-- MySQL dump 10.16 Distrib 10.1.19-MariaDB, for Win32 (AMD64)
--
-- Host: localhost Database: localhost
-- ------------------------------------------------------
-- Server version 10.1.19-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `pref_loc`
--
DROP TABLE IF EXISTS `pref_loc`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pref_loc` (
`IDDriver` int COLLATE utf8_unicode_ci NOT NULL,
`Location` varchar(30) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `pref_loc`
--
LOCK TABLES `pref_loc` WRITE;
/*!40000 ALTER TABLE `pref_loc` DISABLE KEYS */;
INSERT INTO `pref_loc` VALUES ('1','Bandung'),('1','Jakarta'),('2','Bandung'),('1','kucing'),('1',''),('1','hhdhdhdhd'),('1','wwww'),('1','wwww'),('1','singapur'),('1','mmmmmmmmmmmmmmmmmmmmmmmmmmmm');
/*!40000 ALTER TABLE `pref_loc` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `transaction`
--
DROP TABLE IF EXISTS `transaction`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `transaction` (
`IDTransaksi` int COLLATE utf8_unicode_ci NOT NULL,
`IDDriver` int COLLATE utf8_unicode_ci NOT NULL,
`IDPenumpang` int(10) COLLATE utf8_unicode_ci NOT NULL,
`LokasiAwal` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
`LokasiTujuan` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
`Rating` int(11) NOT NULL,
`Comment` varchar(120) COLLATE utf8_unicode_ci NOT NULL,
`IsHide` tinyint(1) NOT NULL,
`DatePosted` date NOT NULL,
PRIMARY KEY (`IDTransaksi`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `transaction`
--
LOCK TABLES `transaction` WRITE;
/*!40000 ALTER TABLE `transaction` DISABLE KEYS */;
/*!40000 ALTER TABLE `transaction` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `rating_driver`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rating_driver` (
`IDDriver` int COLLATE utf8_unicode_ci NOT NULL,
`rating` float NOT NULL,
`totalvote` int(11) NOT NULL,
PRIMARY KEY (`IDDriver`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user`
--
LOCK TABLES `rating_driver` WRITE;
/*!40000 ALTER TABLE `rating_driver` DISABLE KEYS */;
INSERT INTO `rating_driver` VALUES (0,0,0),(1,4.10526,19),(2,4.66667,3);
/*!40000 ALTER TABLE `rating_driver` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2017-10-06 13:44:39
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
package com.informatika.ojek.webservice;
public class Account {
private int id;
private String name;
private String username;
private String email;
private String password;
private String phone;
private String photo;
private boolean isDriver;
public Account(int _id, String _name, String _username, String _email, String _password, String _phone, String _photo, Boolean _isDriver){
id = _id;
name = _name;
username = _username;
email = _email;
password = _password;
phone = _phone;
photo = _photo;
isDriver = _isDriver;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getPhoto() {
return photo;
}
public void setPhoto(String photo) {
this.photo = photo;
}
public boolean isIsDriver() {
return isDriver;
}
public void setIsDriver(boolean isDriver) {
this.isDriver = isDriver;
}
}
package com.informatika.ojek.webservice;
import javax.jws.WebService;
import java.util.Date;
@WebService(endpointInterface = "com.informatika.ojek.webservice.IHistory")
public class History implements IHistory {
@Override
public Transaction[] getDriverHistory(String accessToken) {
boolean isTokenValid = true; //request identity service
int id = 1; //request identity service
if (isTokenValid) {
//QUERY getTransaction idDriver = id
int idTransaction = 1;
int idPenumpang = 1;
String lokasiAwal = "a";
String lokasiTujuan = "b";
int rating = 5;
String comment = "no comment";
boolean isHide = true;
Date datePosted = new Date(2017, 7, 10);
boolean isDriver = true;
Transaction trx = new Transaction(idTransaction, id, idPenumpang, lokasiAwal, lokasiTujuan, rating, comment, isHide, datePosted);
return new Transaction[]{trx};
} else {
return null;
}
}
@Override
public Transaction[] getPenumpangHistory(String accessToken) {
boolean isTokenValid = true; //request identity service
int id = 1; //request identity service
if (isTokenValid) {
//QUERY getTransaction idPenumpang = id
int idTransaction = 1;
int idDriver = 1;
String lokasiAwal = "a";
String lokasiTujuan = "b";
int rating = 5;
String comment = "no comment";
boolean isHide = true;
Date datePosted = new Date(2017, 7, 10);
boolean isDriver = true;
Transaction trx = new Transaction(idTransaction, idDriver, id, lokasiAwal, lokasiTujuan, rating, comment, isHide, datePosted);
return new Transaction[]{trx};
} else {
return null;
}
}
@Override
public boolean hideHistory(String accessToken, int idTransaction) {
boolean isTokenValid = true; //request identity service
int id = 1; //request identity service
if (isTokenValid) {
//QUERY hideTransaction
return true;
} else {
return false;
}
}
}
package com.informatika.ojek.webservice;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
//Service Endpoint Interface
@WebService
@SOAPBinding(style = Style.RPC)
public interface IHistory {
@WebMethod public Transaction[] getDriverHistory(String accessToken);
@WebMethod public Transaction[] getPenumpangHistory(String accessToken);
@WebMethod public boolean hideHistory(String accessToken, int idTransaction);
}
\ No newline at end of file
package com.informatika.ojek.webservice;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
//Service Endpoint Interface
@WebService
@SOAPBinding(style = Style.RPC)
public interface IOrder {
@WebMethod public Account[] getPrefferedDriver(String access_token, String preffered_driver, String picking_point, String destination);
@WebMethod public Account[] getNonPrefferedDriver(String access_token, String preffered_driver, String picking_point, String destination);
@WebMethod public boolean PuttransactionDetails(String access_token, int id_driver, String picking_point, String Destination, int rating, String comment);
}
\ No newline at end of file