2023-12-06 09:26:20 +01:00
|
|
|
<?php
|
2024-01-14 18:30:05 +01:00
|
|
|
//Programmiert von: Max Heer, Getestet von: Samuel Wolff
|
2023-12-06 09:26:20 +01:00
|
|
|
|
2023-12-18 08:45:12 +01:00
|
|
|
namespace ppb\Controller;
|
2023-12-06 09:26:20 +01:00
|
|
|
|
2023-12-18 08:45:12 +01:00
|
|
|
use ppb\Libary\Msg;
|
|
|
|
use ppb\Model\InhaltsstoffModel;
|
2023-12-06 09:26:20 +01:00
|
|
|
|
2023-12-18 08:45:12 +01:00
|
|
|
class InhaltsstoffController
|
|
|
|
{
|
|
|
|
|
|
|
|
private $db;
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->db = new InhaltsstoffModel();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function getInhaltsstoff()
|
|
|
|
{
|
|
|
|
$result = $this->db->getInhaltsstoff();
|
2023-12-18 08:22:45 +01:00
|
|
|
return json_encode($result);
|
|
|
|
}
|
|
|
|
|
2024-01-14 17:51:11 +01:00
|
|
|
public function writeInhaltsstoff($data)
|
2023-12-18 08:45:12 +01:00
|
|
|
{
|
|
|
|
$result = $this->db->insertInhaltsstoff($data);
|
2023-12-18 08:22:45 +01:00
|
|
|
return json_encode($result);
|
|
|
|
}
|
|
|
|
|
2023-12-18 08:45:12 +01:00
|
|
|
public function deleteInhaltsstoff($id)
|
|
|
|
{
|
|
|
|
$result = $this->db->deleteInhaltsstoff($id);
|
2023-12-18 08:22:45 +01:00
|
|
|
return json_encode($result);
|
|
|
|
}
|
2023-12-18 08:45:12 +01:00
|
|
|
}
|
2023-12-06 09:26:20 +01:00
|
|
|
?>
|