From b5b623afcb90bf7c1c8a656ed2a418146d1a06d7 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Thu, 4 Feb 2021 14:59:33 +0100 Subject: [PATCH] Added Test-code: Table loading --- ReadMe.md | 3 +++ test/config.php | 8 ++++--- test/onsen_ui/employee.php | 44 ++++++++++++++++++++++++++++++++++++++ test/onsen_ui/index.html | 14 ++++++++++++ test/onsen_ui/test.php | 5 +++++ 5 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 test/onsen_ui/employee.php create mode 100644 test/onsen_ui/test.php 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 index 087aeb0..0fa2dbf 100644 --- a/test/config.php +++ b/test/config.php @@ -1,7 +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..d0fb8f3 --- /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/index.html b/test/onsen_ui/index.html index 665247a..96d6a25 100644 --- a/test/onsen_ui/index.html +++ b/test/onsen_ui/index.html @@ -15,6 +15,18 @@ .then(() => console.log('Service worker registered')) .catch(e => console.log(e)); } + + function loadData() { + var xmlhttp = new XMLHttpRequest(); + xmlhttp.onreadystatechange = function() { + if(this.readyState == 4 && this.status == 200) { + document.getElementById("employeeList").innerHTML = this.responseText; + } + }; + xmlhttp.open("GET", "employee.php?op=load", true); + xmlhttp.send(); + } + @@ -25,6 +37,8 @@ Hallo wach Click this + Load data +
list of employees will be loaded here
\ 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