Compare commits

..

No commits in common. "3f5bd9b1bc2a9dd583b21d5740634140a2ac6d5e" and "f0caeb3cfca278bb096fce1a86729eb3cc2e45e2" have entirely different histories.

7 changed files with 38 additions and 61 deletions

View File

@ -1,7 +1,7 @@
<?php
// Programmiert durch Samuel Wolff
// Getestet durch: Samuel Wolff
// Getestet durch: Nicht getestet
namespace ppb\Controller;

View File

@ -1,5 +1,5 @@
<?php
//Programmiert von: Max Heer, Getestet von: Samuel Wolff
//Programmiert von: Max Heer, Getestet von:
namespace ppb\Controller;

View File

@ -1,37 +1,23 @@
<?php
//Programmiert von: Max Heer, Getestet von: Samuel Wolff
//Programmiert von: Max Heer, Getestet von:
namespace ppb\Controller;
namespace VPR_Schnittstelle\Controller;
use ppb\Libary\Msg;
use ppb\Model\TagesplanModel;
use VPR_Schnittstelle\Libary\Msg;
use VPR_Schnittstelle\Model\TagesplanModel;
class TagesplanController
{
private $db;
public function __construct()
{
$this->db = new TagesplanModel();
}
public function getTagesplan()
{
public function getTagesplan(){
$result=$this->db->getTagesplan();
return json_encode($result);
}
public function writeTagesplan($data)
{
public function insertTagesplan($data){
$result=$this->db->insertTagesplan($data);
return json_encode($result);
}
public function deleteTagesplan($id)
{
public function deleteTagesplan($id){
$result=$this->db->deleteTagesplan($id);
return json_encode($result);
}
}
?>

View File

@ -1,5 +1,5 @@
<?php
// Erstellt durch Stefan Groß - Getestet von Samuel Wolff
// Erstellt durch Stefan Groß - Nicht getestet
namespace ppb\Controller;
use ppb\Model\IstTeilModel;

View File

@ -1,7 +1,5 @@
<?php
//Programmiert von: Max Heer, Getestet von: Samuel Wolff
namespace ppb\Model;
use ppb\Library\Msg;

View File

@ -1,5 +1,4 @@
<?php
// Programmiert von Max Heer
// Getestet von Samuel Wolff
namespace ppb\Model;

View File

@ -1,22 +1,18 @@
<?php
//Programmiert von: Max Heer, Getestet von: Samuel Wolff
//Programmiert von: Max Heer, Getestet von:
namespace ppb\Model;
namespace VPR_Schnittstelle\EnthaeltModel;
use VPR_Schnittstelle\Library\Msg;
use ppb\Library\Msg;
class TagesplanModel extends Database
{
public function getTagesplan()
{
public function getTagesplan(){
$pdo=$this->linkDB();
$sql = "SELECT * FROM Tagesplan";
try{
$stmt = $pdo->prepare($sql);
$stmt->execute();
} catch (\PDOException $e) {
}
catch(\PDOExeption $e){
return false;
}
$result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
@ -24,8 +20,7 @@ class TagesplanModel extends Database
return $result;
}
public function insertTagesplan($data)
{
public function insertTagesplan($data){
$pdo=$this->linkDB();
$params = array();
$sql = "INSERT INTO Tagesplan (";
@ -35,7 +30,7 @@ class TagesplanModel extends Database
$sql = substr($sql,0,strlen($sql)-1).") VALUES (";
foreach($data as $index=>$value){
$sql .= ":" . $index . ",";
$sql .= "':".$index."',";
$params[":".$index] = $value;
}
@ -45,14 +40,13 @@ class TagesplanModel extends Database
$stmt = $pdo->prepare($sql);
$stmt->execute($params);
return true;
} catch (\PDOException $e) {
echo $sql;
}
catch(\PDOExeption $e){
return false;
}
}
public function deleteTagesplan($id)
{
public function delteTagesplan($id){
$pdo=$this->linkDB();
$params = array();
$sql = "DELETE FROM Tagesplan WHERE id=:id";
@ -61,9 +55,9 @@ class TagesplanModel extends Database
$stmt = $pdo->prepare($sql);
$stmt->execute($params);
return true;
} catch (\PDOException $e) {
}
catch(\PDOExeption $e){
return false;
}
}
}
?>