diff --git a/TugasBesar2_2017/WebApp/src/main/webapp/WEB-INF/order.jsp b/TugasBesar2_2017/WebApp/src/main/webapp/WEB-INF/order.jsp index 12e66d6e3eaf1e96b940c0f50aaa6c945e51ad9a..19d030134302b3e7e771e49edaefca96377dd015 100644 --- a/TugasBesar2_2017/WebApp/src/main/webapp/WEB-INF/order.jsp +++ b/TugasBesar2_2017/WebApp/src/main/webapp/WEB-INF/order.jsp @@ -1,6 +1,7 @@ <%@ include file="/component/header.html" %> <%@ include file="/component/nav.html" %> -<div class="container"> + +<div class="container" ng-app="orderApp"> <div class="wrapper row"> <div> <div class="page-title row txt-center height-fit float-container"> @@ -29,25 +30,24 @@ </li> </ul> </div> - <div class="order-form"> + <div class="order-form" ng-controller="OrderController"> <form action="find_driver" onsubmit="return validateForm(this)" method="get"> <table> <tr> <td>Picking Point</td> - <td><input type="text" name="pickUp" class="form-input" placeholder="Required"></td> + <td><input type="text" name="pickUp" class="form-input" placeholder="Required" ng-model="pickingPoint"></td> </tr> <tr> <td>Destination</td> - <td><input type="text" name="destination" class="form-input" placeholder="Required"></td> + <td><input type="text" name="destination" class="form-input" placeholder="Required" ng-model="destination"></td> </tr> <tr> <td>Preferred Driver</td> - <td><input type="text" name="preferredDriver" class="form-input" placeholder="Optional" - optional></td> + <td><input type="text" name="preferredDriver" class="form-input" placeholder="Optional" optional ng-model="preferredDriver"></td> </tr> </table> <div class="txt-center"> - <button type="submit" class="form-input submit-button">OK</button> + <button type="submit" class="form-input submit-button" ng-click="makeOrder()">OK</button> </div> </form> </div> @@ -55,6 +55,18 @@ </div> <%@ include file="/component/footer.html" %> + +<script src="js/converse.js"></script> +<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> <script> window.onload = toggleActive("nav-order"); </script> +<script> + angular.module('orderApp', []) + .service('ConverseService', converse) + .controller('OrderController', function ($scope, $q, ConverseService) { + $scope.makeOrder = function() { + + } + }) +</script> diff --git a/TugasBesar2_2017/WebApp/src/main/webapp/WEB-INF/order_driver.jsp b/TugasBesar2_2017/WebApp/src/main/webapp/WEB-INF/order_driver.jsp index 0d4b662489b7e3f92d9e7251849281440afed0d5..e51415c9268ff59e1b1e4ad13e211d3a5050b37b 100644 --- a/TugasBesar2_2017/WebApp/src/main/webapp/WEB-INF/order_driver.jsp +++ b/TugasBesar2_2017/WebApp/src/main/webapp/WEB-INF/order_driver.jsp @@ -3,7 +3,7 @@ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<div ng-app= "orderApp" class="container"> +<div class="container" ng-app="orderApp" > <div class="wrapper row"> <div> <div class="page-title row txt-center height-fit float-container"> @@ -14,7 +14,7 @@ </div> <div class="order-form" ng-controller="OrderController"> <div class="txt-center"> - <h2 ng-show="textFind" class="inline-block">Finding Order....</h2> + <h2 class="inline-block" ng-show="textFind">Finding Order....</h2> </div> <div class="txt-center"> <button class="form-input find-button" ng-hide="buttonFind" ng-click="activateFind()">FIND ORDER</button> @@ -39,7 +39,7 @@ let canceller - $scope.activateFind = function() { + $scope.activateFind = function () { $scope.textFind = true; $scope.buttonClose = true; $scope.buttonFind = true; @@ -47,9 +47,12 @@ canceller = $q.defer() account.waitAsync(canceller) + .then(function (userId) { + alert(userId) + }) } - $scope.activateClose = function() { + $scope.activateClose = function () { $scope.textFind = false; $scope.buttonFind = false; $scope.buttonClose = false; diff --git a/TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js b/TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js index 9a7dab5d49dc5c2b128f50b0d6985cf5aa10af9e..374e2359d708c538662f0ac7c908c6464b45823b 100644 --- a/TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js +++ b/TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js @@ -63,7 +63,7 @@ let converse = function ($http) { timeout: timeout }) - return response.data.driver_id + return response.data.user_id } }