Fixes
This commit is contained in:
@@ -8,30 +8,34 @@ namespace ppb\Controller;
|
||||
use ppb\Library\Msg;
|
||||
use ppb\Model\BenutzerModel;
|
||||
|
||||
class BenutzerController{
|
||||
class BenutzerController
|
||||
{
|
||||
|
||||
private $db;
|
||||
|
||||
public function __construct(){
|
||||
public function __construct()
|
||||
{
|
||||
$this->db = new BenutzerModel();
|
||||
}
|
||||
|
||||
// Updated einen Benutzer
|
||||
public function updateBenutzer($elternId, $data){
|
||||
public function updateBenutzer($elternId, $data)
|
||||
{
|
||||
|
||||
$result = $this->db->updateBenutzer($benutzerId, $data);
|
||||
$result = $this->db->updateBenutzer($elternId, $data);
|
||||
|
||||
return json_encode($result);
|
||||
|
||||
}
|
||||
|
||||
// Fügt einen Benutzer in die Datenbank hinzu
|
||||
public function insertBenutzer($data){
|
||||
$result = $this->db->insertBenutzer($data)
|
||||
public function insertBenutzer($data)
|
||||
{
|
||||
$result = $this->db->insertBenutzer($data);
|
||||
|
||||
return json_encode($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,20 +1,31 @@
|
||||
<?php
|
||||
//Programmiert von: Max Heer, Getestet von:
|
||||
//Programmiert von: Max Heer, Getestet von:
|
||||
|
||||
namespace kindergartenverwaltung\Controller;
|
||||
namespace kindergartenverwaltung\Controller;
|
||||
|
||||
use kindergartenverwaltung\Libary\Msg;
|
||||
use kindergartenverwaltung\Model\EnthaeltModel;
|
||||
use kindergartenverwaltung\Libary\Msg;
|
||||
use kindergartenverwaltung\Model\EnthaeltModel;
|
||||
|
||||
class EnthaeltController(){
|
||||
public function getInhaltsstoffe($gerichtId){
|
||||
$result=$this->db->getEnthaelt($gerichtId);
|
||||
return json_encode($result);
|
||||
}
|
||||
class EnthaeltController
|
||||
{
|
||||
|
||||
public function insertEnthaelt($data){
|
||||
$result=$this->db->insertEnthaelt($data);
|
||||
return json_encode($result);
|
||||
}
|
||||
private $db;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->db = new EnthaeltModel();
|
||||
}
|
||||
|
||||
public function getInhaltsstoffe($gerichtId)
|
||||
{
|
||||
$result = $this->db->getEnthaelt($gerichtId);
|
||||
return json_encode($result);
|
||||
}
|
||||
|
||||
public function insertEnthaelt($data)
|
||||
{
|
||||
$result = $this->db->insertEnthaelt($data);
|
||||
return json_encode($result);
|
||||
}
|
||||
}
|
||||
?>
|
@@ -8,38 +8,44 @@ namespace ppb\Controller;
|
||||
use ppb\Library\Msg;
|
||||
use ppb\Model\KindModel;
|
||||
|
||||
class KindController{
|
||||
class KindController
|
||||
{
|
||||
|
||||
private $db;
|
||||
|
||||
public function __construct(){
|
||||
public function __construct()
|
||||
{
|
||||
$this->db = new KindModel();
|
||||
}
|
||||
|
||||
// $parentId ist standardmäßig auf false und gibt damit alle Kinder aus,
|
||||
// das setzen gibt nur Kinder eines bestimmten Benutzerkontos aus.
|
||||
public function getKind($parentId = false){
|
||||
public function getKind($parentId = false)
|
||||
{
|
||||
$result = $this->db->getKind($parentId);
|
||||
|
||||
return json_encode($result);
|
||||
}
|
||||
|
||||
// Updated ein Kind
|
||||
public function updateKind($kindId, $data){
|
||||
public function updateKind($kindId, $data)
|
||||
{
|
||||
$result = $this->db->updateKind($kindId, $data);
|
||||
|
||||
return json_encode($result);
|
||||
}
|
||||
|
||||
// Fügt ein Kind hinzu
|
||||
public function addKind($data){
|
||||
public function addKind($data)
|
||||
{
|
||||
$result = $this->db->addKind($data);
|
||||
|
||||
return json_encode($data);
|
||||
}
|
||||
|
||||
// Löscht ein Kind
|
||||
public function deleteKind($kindId){
|
||||
public function deleteKind($kindId)
|
||||
{
|
||||
$result = $this->db->deleteKind($kindId);
|
||||
|
||||
return $result;
|
||||
|
Reference in New Issue
Block a user