diff --git a/public/order.js b/public/order.js index 4f0b517aa3d9b3fb9296c5850e26bdc52265d36e..955b590549c1df16c3954125fd6c737f9e0c664b 100755 --- a/public/order.js +++ b/public/order.js @@ -14,7 +14,7 @@ function makeOrder() { var data = "id="+customerID+"&pickup="+orderPickup+"&destination="+orderDestination+"&driver="+orderPreferredDriver; if (orderPickup.trim() == "" || orderDestination.trim() == "") { - alert("Sorce and destination is required!"); + alert("Source and destination is required!"); return; } @@ -31,7 +31,7 @@ function makeOrder() { } }; - xhttp.open("POST", "/main/order/new", true); + xhttp.open("POST", "/index.php/main/order/new", true); xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhttp.send(data); } @@ -144,11 +144,11 @@ function completeOrder(id) { alert("Fail completing your order"); } else { alert("Thanks for your order :D"); - window.location.href = "/main/order?u="+customerID; + window.location.href = "/index.php/main/order?u="+customerID; } } }; - xhttp.open("POST", "/main/order/finish?u", true); + xhttp.open("POST", "/index.php/main/order/finish?u", true); xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhttp.send(data); diff --git a/public/profil_edit.js b/public/profil_edit.js index 66c774a3ceb0d9c6bb9bc459db370a18031da2df..f9af165ecf23232652d735cb121c38c5775f8905 100644 --- a/public/profil_edit.js +++ b/public/profil_edit.js @@ -83,13 +83,13 @@ function saveLocation(location, newlocation) { xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { if (this.responseText == "Success") { - window.location.href = "/main/profil/location/edit?u="+id; + window.location.href = "/index.php/main/profil/location/edit?u="+id; } else { alert(this.responseText); } } }; - xhttp.open("POST", "/main/profil/location/edit/data", true); + 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 diff --git a/src/controller/LoginController.php b/src/controller/LoginController.php index 00a3cb10dc482980d8033d9f14ee673c5df4a4b5..6f6547534244e01ff1b36000ab0af9073999ef34 100644 --- a/src/controller/LoginController.php +++ b/src/controller/LoginController.php @@ -32,7 +32,10 @@ class LoginController if ($userData !== null && $userData instanceof User) { if ($userData->password === $password) { $_SESSION['username'] = $username; - echo "<script type='application/javascript'> alert('Login berhasil'); </script>"; + + $userPage = simpleCrypt($userData->id); + header("Location: /index.php/main/profil?u=$userPage"); + //echo "<script type='application/javascript'> alert('Login berhasil'); </script>"; } else { echo "<script type='application/javascript'> alert('Password salah.'); </script>"; } diff --git a/src/view/order.php b/src/view/order.php index 2a0760e021a5a3077c7f5185664fc092319b8b86..62c1c0cd4c39cb3129952e32ed59023f10d119ad 100644 --- a/src/view/order.php +++ b/src/view/order.php @@ -15,9 +15,9 @@ </div> </div> <div class="row"> - <a class="col-2 tab text-center active" href="/main/order?u=<?=$id?>">ORDER</a> - <a class="col-2 tab text-center" href="/main/hostory?u=<?=$id?>">HISTORY</a> - <a class="col-2 tab text-center" href="/main/profil?u=<?=$id?>">MY PROFILE</a> + <a class="col-2 tab text-center active" href="/index.php/main/order?u=<?=$id?>">ORDER</a> + <a class="col-2 tab text-center" href="/index.php/main/history?u=<?=$id?>">HISTORY</a> + <a class="col-2 tab text-center" href="/index.php/main/profil?u=<?=$id?>">MY PROFILE</a> </div> <div class="row"> <div class="col-6"><h1>MAKE AN ORDER</h1></div> diff --git a/src/view/profil.php b/src/view/profil.php index 7e1204240af893ebedb2165ddec6538f0d171604..a060cf229f765ee89acce0c7073aa6a628c85e60 100644 --- a/src/view/profil.php +++ b/src/view/profil.php @@ -15,13 +15,13 @@ </div> </div> <div class="row"> - <a class="col-2 tab text-center" href="/main/order?u=<?=$id?>">ORDER</a> - <a class="col-2 tab text-center" href="/main/hostory?u=<?=$id?>">HISTORY</a> - <a class="col-2 tab text-center active" href="/main/profil?u=<?=$id?>">MY PROFILE</a> + <a class="col-2 tab text-center" href="/index.php/main/order?u=<?=$id?>">ORDER</a> + <a class="col-2 tab text-center" href="/index.php/main/hostory?u=<?=$id?>">HISTORY</a> + <a class="col-2 tab text-center active" href="/index.php/main/profil?u=<?=$id?>">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="/main/profil/edit?u=<?=$id?>"></a></div> + <div class="col-1 text-right"><a class="edit" href="/index.php/main/profil/edit?u=<?=$id?>"></a></div> </div> <div class="text-center profil"> <img class="img-circle" src="<?=$user->photo?>"/><br> @@ -38,7 +38,7 @@ <?php if ($user->isDriver) : ?> <div class="row"> <div class="col-5"><h2>PREFERED LOCATIONS</h2></div> - <div class="col-1 text-right"><a class="edit" href="/main/profil/location/edit?u=<?=$id?>"></a></div> + <div class="col-1 text-right"><a class="edit" href="/index.php/main/profil/location/edit?u=<?=$id?>"></a></div> </div> <div class="row"> <?php if ($location_count == 0): ?> diff --git a/src/view/profil_edit.php b/src/view/profil_edit.php index 12da5e7900f74b4121f40adf01aab02b5a63d803..a8e48a2c1b7c45ef86b95659f70b56ae5c2ef3ed 100644 --- a/src/view/profil_edit.php +++ b/src/view/profil_edit.php @@ -15,7 +15,7 @@ </div> </div> <div class="row"> - <form action="/main/profil/edit/save?u=<?=$id?>" method="post" enctype="multipart/form-data" onsubmit="return validateProfileEdit()"> + <form action="/index.php/main/profil/edit/save?u=<?=$id?>" method="post" enctype="multipart/form-data" onsubmit="return validateProfileEdit()"> <div class="container" style="width: 65%"> <div class="row"> <div class="col-6 text-left"> @@ -73,7 +73,7 @@ <br> <div class="row"> <div class="col-3 text-left"> - <a class="btn red" href="/main/profil?u=<?=$id?>">BACK</a> + <a class="btn red" href="/index.php/main/profil?u=<?=$id?>">BACK</a> </div> <div class="col-3 text-right"> <input class="btn green" type="submit" value="SAVE"> diff --git a/src/view/profil_edit_location.php b/src/view/profil_edit_location.php index 9a21605a4e0e7ecf95faaa23d93194d7a14701e9..4a1710d7346a29a2f81f2fb400b2ef480a5a67d3 100644 --- a/src/view/profil_edit_location.php +++ b/src/view/profil_edit_location.php @@ -42,7 +42,7 @@ <input id="input-location-<?=$no-1?>" class="input-location" type="text" style="width: 100%; line-height: 24px; padding-left:3px; font-size: medium; display: none;"></td> <td style="text-align: center"> <a id="action-edit-<?=$no-1?>" class="action-edit" onclick="editLocation(<?=$no-1?>)" data="<?=$no-1?>"></a> - <a class="action-delete" href="/main/profil/location/delete?u=<?=$id?>&name=<?=$data['location']?>" onclick="return confirm('Are you sure want to delete?')"></a> + <a class="action-delete" href="/index.php/main/profil/location/delete?u=<?=$id?>&name=<?=$data['location']?>" onclick="return confirm('Are you sure want to delete?')"></a> </td> </tr> <?php endforeach;?> @@ -61,7 +61,7 @@ <div class="row"> <div class="col-1"></div> <div class="col-4"> - <form action="/main/profil/location/add?u=<?=$id?>" method="post" onsubmit="return validateLocationEdit()"> + <form action="/index.php/main/profil/location/add?u=<?=$id?>" method="post" onsubmit="return validateLocationEdit()"> <input id="locationInput" type="text" name="location" style="width:76%;height: 30px; font-size: medium"> <input class="btn green" type="submit" value="ADD" style="width:20%;margin-left: 10px"> </form> @@ -72,13 +72,13 @@ <div class="row"> <div class="col-1"></div> <div class="col-4"> - <a class="btn red" href="/main/profil?u=<?=$id?>">BACK</a> + <a class="btn red" href="/index.php/main/profil?u=<?=$id?>">BACK</a> </div> <div class="col-1"></div> </div> </div> </div> </div> -<script type="text/javascript" src="/profil_edit.js"></script> +<script type="text/javascript" src="/index.php/profil_edit.js"></script> </body> </html> \ No newline at end of file