From 9d107d342301afd2a46023ade4bc8ccee3da231f Mon Sep 17 00:00:00 2001 From: DanielKirchmeier Date: Sun, 8 Jan 2023 22:45:34 +0100 Subject: [PATCH] Upload zu git.itlabs.at --- .idea/.gitignore | 8 +++++ .idea/bildungdb.iml | 8 +++++ .idea/deployment.xml | 28 +++++++++++++++ .idea/modules.xml | 8 +++++ .idea/vcs.xml | 6 ++++ api/.idea/.gitignore | 8 +++++ api/.idea/.name | 1 + api/.idea/api.iml | 8 +++++ api/.idea/deployment.xml | 14 ++++++++ api/.idea/modules.xml | 8 +++++ api/apprentice_add.php | 17 +++++++++ api/apprentice_list.php | 24 +++++++++++++ api/db_config.php | 16 +++++++++ api/group_add.php | 16 +++++++++ api/group_data.php | 27 ++++++++++++++ api/index.php | 26 ++++++++++++++ api/kompetenzen.php | 29 +++++++++++++++ api/login.php | 40 +++++++++++++++++++++ api/modul.php | 20 +++++++++++ api/profession.php | 28 +++++++++++++++ api/pruefung.php | 20 +++++++++++ api/pruefungsergebnis.php | 20 +++++++++++ api/registration.php | 27 ++++++++++++++ api/tst.php | 3 ++ api/user.php | 20 +++++++++++ bildungdb.code-workspace | 7 ++++ bildungsdb | 1 + worktree/master/bildungsdb.worktrees/master | 1 + 28 files changed, 439 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/bildungdb.iml create mode 100644 .idea/deployment.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 api/.idea/.gitignore create mode 100644 api/.idea/.name create mode 100644 api/.idea/api.iml create mode 100644 api/.idea/deployment.xml create mode 100644 api/.idea/modules.xml create mode 100644 api/apprentice_add.php create mode 100644 api/apprentice_list.php create mode 100644 api/db_config.php create mode 100644 api/group_add.php create mode 100644 api/group_data.php create mode 100644 api/index.php create mode 100644 api/kompetenzen.php create mode 100644 api/login.php create mode 100644 api/modul.php create mode 100644 api/profession.php create mode 100644 api/pruefung.php create mode 100644 api/pruefungsergebnis.php create mode 100644 api/registration.php create mode 100644 api/tst.php create mode 100644 api/user.php create mode 100644 bildungdb.code-workspace create mode 160000 bildungsdb create mode 160000 worktree/master/bildungsdb.worktrees/master diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/bildungdb.iml b/.idea/bildungdb.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/bildungdb.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..c4a5fa4 --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..2be9857 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..eaddf28 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/api/.idea/.gitignore b/api/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/api/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/api/.idea/.name b/api/.idea/.name new file mode 100644 index 0000000..70c679d --- /dev/null +++ b/api/.idea/.name @@ -0,0 +1 @@ +pruefung.php \ No newline at end of file diff --git a/api/.idea/api.iml b/api/.idea/api.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/api/.idea/api.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/api/.idea/deployment.xml b/api/.idea/deployment.xml new file mode 100644 index 0000000..80cd07f --- /dev/null +++ b/api/.idea/deployment.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/api/.idea/modules.xml b/api/.idea/modules.xml new file mode 100644 index 0000000..d50cf45 --- /dev/null +++ b/api/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/api/apprentice_add.php b/api/apprentice_add.php new file mode 100644 index 0000000..eb14201 --- /dev/null +++ b/api/apprentice_add.php @@ -0,0 +1,17 @@ +firstname . "','" . $post->lastname . "',"; +$sql .= $post->groupid . ", '" . $post->sex . "','" . $post->date_of_birth . "', '" . $post->date_joined . "',''"; +$result = $mysqli->query($sql); + +$sql = "SELECT * FROM apprentice Order by apprenticeid desc LIMIT 1"; +$result = $mysqli->query($sql); +$data = $result->fetch_assoc(); + +echo json_encode($data); +?> + diff --git a/api/apprentice_list.php b/api/apprentice_list.php new file mode 100644 index 0000000..539e44f --- /dev/null +++ b/api/apprentice_list.php @@ -0,0 +1,24 @@ +query($sql); +if ($result != null) +{ + while($row = $result->fetch_assoc()){ + $json[] = $row; + } + + $data['apprentice'] = $json; + $result = mysqli_query($mysqli,$sql); + echo json_encode($data); +} +else + echo json_encode("keine Daten empfangen!"); + +?> + diff --git a/api/db_config.php b/api/db_config.php new file mode 100644 index 0000000..40be9ff --- /dev/null +++ b/api/db_config.php @@ -0,0 +1,16 @@ +groupname . "','" . $post->date . "')"; +$result = $mysqli->query($sql); + +$sql = "SELECT * FROM group Order by groupid desc LIMIT 1"; +$result = $mysqli->query($sql); +$data = $result->fetch_assoc(); + +echo json_encode($data); +?> + diff --git a/api/group_data.php b/api/group_data.php new file mode 100644 index 0000000..7f06120 --- /dev/null +++ b/api/group_data.php @@ -0,0 +1,27 @@ +query($sql); +if ($result != null) +{ + while($row = $result->fetch_assoc()){ + $json[] = $row; + } + + $data['data'] = $json; + $result = mysqli_query($mysqli,$sql); + echo json_encode($data); +} +else + echo "

keine Daten empfangen!

"; +?> diff --git a/api/index.php b/api/index.php new file mode 100644 index 0000000..208ee1c --- /dev/null +++ b/api/index.php @@ -0,0 +1,26 @@ + + AngularJS Simple CRUD Application - W3Adda + + + + + + + + + + + + + + + + + + + +
+ +
+ + diff --git a/api/kompetenzen.php b/api/kompetenzen.php new file mode 100644 index 0000000..2eff912 --- /dev/null +++ b/api/kompetenzen.php @@ -0,0 +1,29 @@ +query($sql); +if ($result != null) +{ + while($row = $result->fetch_assoc()){ + $json[] = $row; + } + + $data = $json; + $result = mysqli_query($mysqli,$sql); + echo json_encode($data); +} +else + echo json_encode(['success' => 0, 'message' => 'keine Daten empfangen!']); +?> + diff --git a/api/login.php b/api/login.php new file mode 100644 index 0000000..81df62f --- /dev/null +++ b/api/login.php @@ -0,0 +1,40 @@ +password)); + $email = mysqli_real_escape_string($mysqli, trim($request->username)); + $sql=''; + $sql = "SELECT * FROM user where (login='$email' OR email = '$email') and password='" . password($pwd) . "';"; + + echo $sql; + + if($result = mysqli_query($mysqli,$sql)) + { + $rows = array(); + while($row = mysqli_fetch_assoc($result)) + { + $rows[] = $row; + } + + // echo json_encode($rows); + + echo json_encode( + array( + "id" => $rows[0].id, + "login" => $rows[0].login, + "name" => $rows[0].name, + "email" => $rows[0].email, + "token" => uniqid() + )); + } + else + { + http_response_code(401); + } +} + diff --git a/api/modul.php b/api/modul.php new file mode 100644 index 0000000..9c651c8 --- /dev/null +++ b/api/modul.php @@ -0,0 +1,20 @@ +query($sql); +if ($result != null) { + while ($row = $result->fetch_assoc()) { + $json[] = $row; + } + + $data['modul'] = $json; + $result = mysqli_query($mysqli, $sql); + echo json_encode($data); +} else + echo "

keine Daten empfangen!

"; + +?> \ No newline at end of file diff --git a/api/profession.php b/api/profession.php new file mode 100644 index 0000000..9c85219 --- /dev/null +++ b/api/profession.php @@ -0,0 +1,28 @@ +query($sql); +if ($result != null) +{ + while($row = $result->fetch_assoc()){ + $json[] = $row; + } + + $data = $json; + $result = mysqli_query($mysqli,$sql); + echo json_encode($data); +} +else + echo json_encode(['success' => 0, 'message' => 'keine Daten empfangen!']); +?> + diff --git a/api/pruefung.php b/api/pruefung.php new file mode 100644 index 0000000..32c8b92 --- /dev/null +++ b/api/pruefung.php @@ -0,0 +1,20 @@ +query($sql); +if ($result != null) { + while ($row = $result->fetch_assoc()) { + $json[] = $row; + } + + $data['exam'] = $json; + $result = mysqli_query($mysqli, $sql); + echo json_encode($data); +} else + echo "

keine Daten empfangen!

"; + +?> \ No newline at end of file diff --git a/api/pruefungsergebnis.php b/api/pruefungsergebnis.php new file mode 100644 index 0000000..74c0cd0 --- /dev/null +++ b/api/pruefungsergebnis.php @@ -0,0 +1,20 @@ +query($sql); +if ($result != null) +{ + while($row = $result->fetch_assoc()){ + $json[] = $row; + } + + $data = $json; + $result = mysqli_query($mysqli,$sql); + echo json_encode($data); +} +else + echo json_encode(['success' => 0, 'message' => 'keine Daten empfangen!']); +?> diff --git a/api/registration.php b/api/registration.php new file mode 100644 index 0000000..6548e37 --- /dev/null +++ b/api/registration.php @@ -0,0 +1,27 @@ +name)); + $pwd = mysqli_real_escape_string($mysqli, (int)$request->pwd); + $email = mysqli_real_escape_string($mysqli, trim($request->email)); + $datum = now(); + $sql = "INSERT INTO user(login, name, password,email,created) VALUES ('{$login}',' {$name}','". password($pwd) . "','{$email}','{$datum}')"; + echo $sql; + if ($mysqli->query($sql) === TRUE) { + + + $authdata = [ + 'name' => $name, + 'pwd' => '', + 'email' => $email, + 'login' => $login, + 'Id' => mysqli_insert_id($mysqli) + ]; + echo json_encode($authdata); + + } +} + diff --git a/api/tst.php b/api/tst.php new file mode 100644 index 0000000..4a05122 --- /dev/null +++ b/api/tst.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/api/user.php b/api/user.php new file mode 100644 index 0000000..7e54774 --- /dev/null +++ b/api/user.php @@ -0,0 +1,20 @@ +query($sql); + +if ($result != null) { + while ($row = $result->fetch_assoc()) { + $json[] = $row; + } + + $data['konto'] = $json; + $result = mysqli_query($mysqli, $sql); + echo json_encode($data); +} else + echo "keine Daten empfangen!"; + +?> diff --git a/bildungdb.code-workspace b/bildungdb.code-workspace new file mode 100644 index 0000000..92d6abc --- /dev/null +++ b/bildungdb.code-workspace @@ -0,0 +1,7 @@ +{ + "folders": [ + { + "path": "bildungsdb" + } + ] +} \ No newline at end of file diff --git a/bildungsdb b/bildungsdb new file mode 160000 index 0000000..10ef83c --- /dev/null +++ b/bildungsdb @@ -0,0 +1 @@ +Subproject commit 10ef83c26a252d73390cdcc4731a2c9336592339 diff --git a/worktree/master/bildungsdb.worktrees/master b/worktree/master/bildungsdb.worktrees/master new file mode 160000 index 0000000..10ef83c --- /dev/null +++ b/worktree/master/bildungsdb.worktrees/master @@ -0,0 +1 @@ +Subproject commit 10ef83c26a252d73390cdcc4731a2c9336592339