diff --git a/ReadMe.md b/ReadMe.md index 971a8e0..44d42e0 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1 +1,4 @@ # Projekt Datenerfassung für AST Kanister + +Onsen UI Tutorial: https://onsen.io/v2/guide/pwa/tutorial.html#onsen-ui-pwa-tutorial + diff --git a/test/config.php b/test/config.php new file mode 100644 index 0000000..0fa2dbf --- /dev/null +++ b/test/config.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/test/onsen_ui/employee.php b/test/onsen_ui/employee.php new file mode 100644 index 0000000..16790aa --- /dev/null +++ b/test/onsen_ui/employee.php @@ -0,0 +1,44 @@ +"; + echo "IdFirst nameLast nameFunctionAuthE-MailPhoneMobile"; + echo "" . PHP_EOL; + + while($row = mysqli_fetch_array($result)) { + echo ""; + echo "" . $row['id'] . "" . PHP_EOL; + echo "" . $row['first_name'] . "" . PHP_EOL; + echo "" . $row['last_name'] . "" . PHP_EOL; + echo "" . $row['function'] . "" . PHP_EOL; + echo "" . $row['authorization'] . "" . PHP_EOL; + echo "" . $row['email'] . "" . PHP_EOL; + echo "" . $row['phone'] . "" . PHP_EOL; + echo "" . $row['mobile'] . "" . PHP_EOL; + echo ""; + } + + mysqli_close($con); + + break; + default: + echo "no cmd"; + break; + } + +?> \ No newline at end of file diff --git a/test/onsen_ui/favicon.ico b/test/onsen_ui/favicon.ico deleted file mode 100644 index 3bf1189..0000000 Binary files a/test/onsen_ui/favicon.ico and /dev/null differ diff --git a/test/onsen_ui/index.html b/test/onsen_ui/index.html index ddbcdcd..f446845 100644 --- a/test/onsen_ui/index.html +++ b/test/onsen_ui/index.html @@ -1,12 +1,54 @@ + + + Onsen UI Test + - Click this + + + +
Home
+
+ +
+
+ Hallo wach + Click this + Load data + + Employees +
list of employees will be loaded here
+
+
\ No newline at end of file diff --git a/test/onsen_ui/manifest.json b/test/onsen_ui/manifest.json new file mode 100644 index 0000000..dc85d50 --- /dev/null +++ b/test/onsen_ui/manifest.json @@ -0,0 +1,17 @@ +{ + "name": "AST Kanister App", + "short_name": "AST App", + "start_url": "/", + "display": "standalone", + "theme_color": "#ef4e2a", + "background_color": "#fff", + "icons": [{ + "src": "https://via.placeholder.com/192x192", + "sizes": "192x192", + "type": "image/png" + },{ + "src": "https://via.placeholder.com/512x512", + "sizes": "512x512", + "type": "image/png" + }] + } \ No newline at end of file diff --git a/test/onsen_ui/sw.js b/test/onsen_ui/sw.js new file mode 100644 index 0000000..a11a40b --- /dev/null +++ b/test/onsen_ui/sw.js @@ -0,0 +1,37 @@ +// Service Worker +// hier wird alles lokal gespeichert +// der "install" event wird beim ServiceWorker Startup aufgerufen + +self.addEventListener('install', function(e) { + console.log('install'); + + // waitUntil tells the browser that the install event is not finished until we have + // cached all of our files + e.waitUntil( + // Here we call our cache "myonsenuipwa", but you can name it anything unique + caches.open('myonsenuipwa').then(cache => { + // If the request for any of these resources fails, _none_ of the resources will be + // added to the cache. + return cache.addAll([ + '/', + '/index.html', + '/manifest.json', + 'https://unpkg.com/onsenui/css/onsenui.min.css', + 'https://unpkg.com/onsenui/css/onsen-css-components.min.css', + 'https://unpkg.com/onsenui/js/onsenui.min.js' + ]); + }) + ); + +}); + + +// der fetch event wird abgefangen und stattdessen die lokale Datei geliefert + +self.addEventListener('fetch', function(e) { + console.log('fetch'); + e.respondWith( + caches.match(e.request) + .then(response => response || fetch(e.request)) + ); +}); \ No newline at end of file diff --git a/test/onsen_ui/test.php b/test/onsen_ui/test.php new file mode 100644 index 0000000..c880668 --- /dev/null +++ b/test/onsen_ui/test.php @@ -0,0 +1,5 @@ + \ No newline at end of file