Upload zu git.itlabs.at

This commit is contained in:
DanielKirchmeier 2023-01-08 22:45:34 +01:00
commit 9d107d3423
28 changed files with 439 additions and 0 deletions

8
.idea/.gitignore vendored Normal file
View File

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

8
.idea/bildungdb.iml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

28
.idea/deployment.xml Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false">
<serverData>
<paths name="Bolt">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="LAPAuftrag">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="sportverein">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
</serverData>
</component>
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/bildungdb.iml" filepath="$PROJECT_DIR$/.idea/bildungdb.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/bildungsdb" vcs="Git" />
</component>
</project>

8
api/.idea/.gitignore vendored Normal file
View File

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

1
api/.idea/.name Normal file
View File

@ -0,0 +1 @@
pruefung.php

8
api/.idea/api.iml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

14
api/.idea/deployment.xml Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false">
<serverData>
<paths name="fsvertrieb-api">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
</serverData>
</component>
</project>

8
api/.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/api.iml" filepath="$PROJECT_DIR$/.idea/api.iml" />
</modules>
</component>
</project>

17
api/apprentice_add.php Normal file
View File

@ -0,0 +1,17 @@
<?php
require './db_config.php';
$post = file_get_contents('php://input');
$post = json_decode($post);
$sql = "INSERT INTO apprentice (firstname, lastname, groupid, sex, date_of_birth, date_joined, date_leave) VALUES ('" . $post->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);
?>

24
api/apprentice_list.php Normal file
View File

@ -0,0 +1,24 @@
<?php
require './db_config.php';
$sql = "SELECT apprenticeid, firstname, lastname, a.groupid, groupname, sex, date_of_birth, date_joined, date_leave ";
$sql .= "FROM apprentice a left join gruppe g on a.groupid = g.groupid ";
$result = $mysqli->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!");
?>

16
api/db_config.php Normal file
View File

@ -0,0 +1,16 @@
<?php
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: PUT, GET, POST, DELETE");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
const DB_USER = "root";
const DB_PASSWORD = "";
const DB_DATABASE = "bildungsdb";
const DB_HOST = "localhost";
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
if(mysqli_connect_errno()){
echo mysqli_connect_error();
}

16
api/group_add.php Normal file
View File

@ -0,0 +1,16 @@
<?php
require './db_config.php';
$post = file_get_contents('php://input');
$post = json_decode($post);
$sql = "INSERT INTO group (groupname,date_started) VALUES ('" . $post->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);
?>

27
api/group_data.php Normal file
View File

@ -0,0 +1,27 @@
<?php
require 'db_config.php';
if(isset($_GET["id"]))
{
$id = $_GET["id"];
$sql = "SELECT `groupid`, `groupname`, `date_started`, `Anmerkung` FROM `gruppe` WHERE groupid = " . $id . ";";
}
else
{
$sql = "SELECT `groupid`, `groupname`, `date_started`, `Anmerkung` FROM `gruppe`;";
}
$result = $mysqli->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 "<br><br>keine Daten empfangen!<br><br>";
?>

26
api/index.php Normal file
View File

@ -0,0 +1,26 @@
<head>
<title>AngularJS Simple CRUD Application - W3Adda</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>
<!-- Angular JS -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular-route.min.js"></script>
<!-- My App -->
<script src="app/routes.js"></script>
<script src="app/helper/myHelper.js"></script>
<!-- App Controller -->
<script src="app/controllers/PostController.js"></script>
</head>
<body ng-app="main-App">
<div class="container">
<ng-view></ng-view>
</div>
</body>
</html>

29
api/kompetenzen.php Normal file
View File

@ -0,0 +1,29 @@
<?php
require 'db_config.php';
if(isset($_GET["id"]))
{
$id = $_GET["id"];
$sql = "SELECT competenceid, competence, competencedescription, dauer from competence WHERE competenceid = " . $id . ";";
}
else
{
$sql = "SELECT competenceid, competence, competencedescription, dauer FROM competence;";
}
$result = $mysqli->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!']);
?>

40
api/login.php Normal file
View File

@ -0,0 +1,40 @@
<?php
include_once("db_config.php");
$postdata = file_get_contents("php://input");
echo $postdata;
$request = json_decode($postdata);
$apiergebnis = array();
if(isset($postdata) && !empty($postdata))
{
$pwd = mysqli_real_escape_string($mysqli, trim($request->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);
}
}

20
api/modul.php Normal file
View File

@ -0,0 +1,20 @@
<?php
require './db_config.php';
$sql = "SELECT * FROM `module`";
$result = $mysqli->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 "<br><br>keine Daten empfangen!<br><br>";
?>

28
api/profession.php Normal file
View File

@ -0,0 +1,28 @@
<?php
require 'db_config.php';
if(isset($_GET["id"]))
{
$id = $_GET["id"];
$sql = "SELECT professionid, professionname, description, apprenticeship from profession WHERE professionid = " . $id . ";";
}
else
{
$sql = "SELECT professionid, professionname, description, apprenticeship from profession;";
}
$result = $mysqli->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!']);
?>

20
api/pruefung.php Normal file
View File

@ -0,0 +1,20 @@
<?php
require './db_config.php';
$sql = "SELECT * FROM `exam`";
$result = $mysqli->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 "<br><br>keine Daten empfangen!<br><br>";
?>

20
api/pruefungsergebnis.php Normal file
View File

@ -0,0 +1,20 @@
<?php
require 'db_config.php';
$sql = "SELECT a.apprenticeid, firstname, lastname, groupname, examid, date_of_exam, acquired FROM `apprentice` a left join apprenticeexam e on a.apprenticeid=e.apprenticeid left join gruppe g on a.groupid = g.groupid";
$result = $mysqli->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!']);
?>

27
api/registration.php Normal file
View File

@ -0,0 +1,27 @@
<?php
include_once("db_config.php");
$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
if(isset($postdata) && !empty($postdata))
{
$name = mysqli_real_escape_string($mysqli, trim($request->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);
}
}

3
api/tst.php Normal file
View File

@ -0,0 +1,3 @@
<?php
phpinfo();
?>

20
api/user.php Normal file
View File

@ -0,0 +1,20 @@
<?php
require './db_config.php';
$sql = 'SELECT login, password, email, created FROM user ';
$result = $mysqli->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!";
?>

7
bildungdb.code-workspace Normal file
View File

@ -0,0 +1,7 @@
{
"folders": [
{
"path": "bildungsdb"
}
]
}

1
bildungsdb Submodule

@ -0,0 +1 @@
Subproject commit 10ef83c26a252d73390cdcc4731a2c9336592339

@ -0,0 +1 @@
Subproject commit 10ef83c26a252d73390cdcc4731a2c9336592339