2023-12-06 08:33:25 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Programmiert durch Samuel Wolff
|
|
|
|
// Getestet durch: Nicht getestet
|
|
|
|
|
2023-12-14 16:59:16 +01:00
|
|
|
namespace ppb\Controller;
|
2023-12-06 08:33:25 +01:00
|
|
|
|
2023-12-14 16:59:16 +01:00
|
|
|
use ppb\Library\Msg;
|
|
|
|
use ppb\Model\BenutzerModel;
|
2023-12-06 08:33:25 +01:00
|
|
|
|
2023-12-18 08:16:21 +01:00
|
|
|
class BenutzerController
|
|
|
|
{
|
2023-12-06 08:33:25 +01:00
|
|
|
|
|
|
|
private $db;
|
|
|
|
|
2023-12-18 08:16:21 +01:00
|
|
|
public function __construct()
|
|
|
|
{
|
2023-12-06 08:33:25 +01:00
|
|
|
$this->db = new BenutzerModel();
|
|
|
|
}
|
|
|
|
|
2023-12-11 15:35:38 +01:00
|
|
|
// Updated einen Benutzer
|
2023-12-18 08:16:21 +01:00
|
|
|
public function updateBenutzer($elternId, $data)
|
|
|
|
{
|
2023-12-06 08:33:25 +01:00
|
|
|
|
2023-12-18 08:16:21 +01:00
|
|
|
$result = $this->db->updateBenutzer($elternId, $data);
|
2023-12-06 08:33:25 +01:00
|
|
|
|
|
|
|
return json_encode($result);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-12-11 15:35:38 +01:00
|
|
|
// Fügt einen Benutzer in die Datenbank hinzu
|
2023-12-18 08:16:21 +01:00
|
|
|
public function insertBenutzer($data)
|
|
|
|
{
|
|
|
|
$result = $this->db->insertBenutzer($data);
|
2023-12-06 08:33:25 +01:00
|
|
|
|
|
|
|
return json_encode($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-12-18 08:16:21 +01:00
|
|
|
?>
|