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 @@