diff --git a/.DS_Store b/.DS_Store index 005c3f1..826ad72 100755 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/controllers/customer/.DS_Store b/controllers/customer/.DS_Store index 35a2249..f4ba934 100644 Binary files a/controllers/customer/.DS_Store and b/controllers/customer/.DS_Store differ diff --git a/controllers/customer/DineinLoginController.php b/controllers/customer/DineinLoginController.php index 5c23b84..5390607 100644 --- a/controllers/customer/DineinLoginController.php +++ b/controllers/customer/DineinLoginController.php @@ -8,7 +8,7 @@ class DineinLoginController extends Controller public function __construct() { - require './models/customer/OnlineOrderLoginModel.php'; + require './models/customer/DineinLoginModel.php'; $this->DineinLoginModelModel = new DineinLoginModel(); } @@ -22,7 +22,7 @@ function submitLogin($token, $otp) echo $row["phone"]; $_SESSION['user_phone'] = $row["phone"]; echo ''; - header('Location: /online'); + header('Location: /dinein'); } else { $this->triggerError('Login Failed!'); } diff --git a/css/dineinorderstyles.css b/css/dineinorderstyles.css index 8436960..de87d57 100644 --- a/css/dineinorderstyles.css +++ b/css/dineinorderstyles.css @@ -27,6 +27,10 @@ body { /* FAB */ +.icon{ + margin-top: 12px; +} + .popout { position: absolute; bottom: 3rem; diff --git a/index.html b/index.html index 16deb2e..6794358 100755 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@ diff --git a/js/index.js b/js/index.js index c100389..2c228b6 100755 --- a/js/index.js +++ b/js/index.js @@ -10,4 +10,33 @@ async function registerServiceWorker(){ console.log("Service Worker Registration Failed"); } } -}; \ No newline at end of file +}; + + +let deferredPrompt; // Allows to show the install prompt +const installButton = document.getElementById("install_button"); + +window.addEventListener("beforeinstallprompt", (e) => { + //TODO + console.log("beforeinstallprompt fired"); + e.preventDefault(); + deferredPrompt = e; + installButton.hidden = false; + installButton.addEventListener("click", installApp); +}); + +function installApp() { + deferredPrompt.prompt(); + installButton.disabled = true; + deferredPrompt.userChoice.then(choiceResult => { + if (choiceResult.outcome === "accepted") { + console.log("PWA setup accepted"); + installButton.hidden = true; + } else { + console.log("PWA setup rejected"); + } + installButton.disabled = false; + deferredPrompt = null; + }); + } + \ No newline at end of file diff --git a/manifest.webmanifest b/manifest.webmanifest index dafdc5f..632eac6 100644 --- a/manifest.webmanifest +++ b/manifest.webmanifest @@ -4,6 +4,7 @@ "start_url": ".", "display": "standalone", "background_color": "#fff", + "theme_color":"#f5a540", "description": "The next generation reataurant maagement system", "icons": [{ "src": "img/icon-512x512.png", diff --git a/serviceWorker.js b/serviceWorker.js index 4a3057c..0b4dbe4 100644 --- a/serviceWorker.js +++ b/serviceWorker.js @@ -17,6 +17,7 @@ self.addEventListener("activate", (e) => { self.clients.claim(); }); + self.addEventListener("fetch", async (event) => { const req = event.request; const url = new URL(req.url); diff --git a/views/customer/dinein.php b/views/customer/dinein.php index bcc42b4..ecf4e28 100755 --- a/views/customer/dinein.php +++ b/views/customer/dinein.php @@ -1,7 +1,8 @@

Order Summery

- -
- -
- +

Total Amount

@@ -191,7 +188,8 @@ function addToOrder(itemId){ function updateCartQty(itemId){ let qtyDiv = 'item-qty-'+itemId; - let itemPriceDiv = 'item-price-'+itemId; + let itemPriceDiv = 'price-'+itemId; + let itemPriceDivCart = 'item-price-'+itemId; let increasedQty = order[itemId] - document.getElementById(qtyDiv).value; //TODO @@ -207,7 +205,8 @@ function updateCartQty(itemId){ order[itemId] = document.getElementById(qtyDiv).value; document.getElementById('order-array').value = JSON.stringify(order); - + document.getElementById(itemPriceDivCart).innerHTML = 'LKR ' + (order[itemId] * parseInt(document.getElementById(itemPriceDiv).innerHTML.replace(/\D/g,''))) + //TODO console.log(order); } diff --git a/views/customer/dineinlogin.php b/views/customer/dineinlogin.php index 2be37d7..709bb9d 100755 --- a/views/customer/dineinlogin.php +++ b/views/customer/dineinlogin.php @@ -1,5 +1,5 @@ Send OTP
-
- +
Find More at Trip Advisor
diff --git a/views/customer/dineinsignup.php b/views/customer/dineinsignup.php deleted file mode 100755 index e69de29..0000000 diff --git a/views/customer/onlinecustomerprofile.php b/views/customer/onlinecustomerprofile.php index 9d8a00a..c4934c0 100644 --- a/views/customer/onlinecustomerprofile.php +++ b/views/customer/onlinecustomerprofile.php @@ -111,9 +111,18 @@
Order Items
-
Payment
- +
+
+
Payment
+ +
+
+
Lakshan is on his way!
+
+94771655198
+
+
+
@@ -133,8 +142,13 @@
Order Items
-
Payment
- +
+
+
Payment
+ +
+
+
@@ -155,8 +169,13 @@
Order Items
-
Payment
- +
+
+
Payment
+ +
+
+
diff --git a/views/customer/onlineorder.php b/views/customer/onlineorder.php index eb5796f..e1dae48 100755 --- a/views/customer/onlineorder.php +++ b/views/customer/onlineorder.php @@ -2,12 +2,12 @@ session_start(); ob_start(); - if(!isset($_SERVER['HTTP_REFERER'])){ - header('Location: /online/login'); - } - if(!isset($_SESSION['user_phone'])){ - header('Location: /online/login'); - } + // if(!isset($_SERVER['HTTP_REFERER'])){ + // header('Location: /online/login'); + // } + // if(!isset($_SESSION['user_phone'])){ + // header('Location: /online/login'); + // } require_once './controllers/customer/OnlineOrderController.php'; //Initiate an instance of controller @@ -105,12 +105,8 @@

Order Summery

- - - -

Total Amount

@@ -191,7 +187,8 @@ function addToOrder(itemId){ function updateCartQty(itemId){ let qtyDiv = 'item-qty-'+itemId; - let itemPriceDiv = 'item-price-'+itemId; + let itemPriceDiv = 'price-'+itemId; + let itemPriceDivCart = 'item-price-'+itemId; let increasedQty = order[itemId] - document.getElementById(qtyDiv).value; //TODO @@ -207,7 +204,8 @@ function updateCartQty(itemId){ order[itemId] = document.getElementById(qtyDiv).value; document.getElementById('order-array').value = JSON.stringify(order); - + document.getElementById(itemPriceDivCart).innerHTML = 'LKR ' + (order[itemId] * parseInt(document.getElementById(itemPriceDiv).innerHTML.replace(/\D/g,''))) + //TODO console.log(order); } diff --git a/views/customer/onlineordersummery.php b/views/customer/onlineordersummery.php index fcd27c1..c639597 100644 --- a/views/customer/onlineordersummery.php +++ b/views/customer/onlineordersummery.php @@ -157,7 +157,7 @@
-

Delivery Charges:

+

Delivery Fee:

100.00