diff --git a/Controller/istTeilController.php b/Controller/istTeilController.php new file mode 100644 index 0000000..3aece25 --- /dev/null +++ b/Controller/istTeilController.php @@ -0,0 +1,21 @@ + db = new istTeilModel(); + + } + + public function getBestellung(){ + $result = $this->db->getBestellung(); + + return json_encode($result); + } +} +?> diff --git a/Model/istTeilModel.php b/Model/istTeilModel.php new file mode 100644 index 0000000..7e93cd2 --- /dev/null +++ b/Model/istTeilModel.php @@ -0,0 +1,45 @@ + linkDB(); + + $sql = "SELECT bid FROM istTeil"; + + try { + $stmt = $pdo->prepare($sql); + }catch (\PDOException $e){ + //nur zum Testen: + //new Msg(true,null,$e); + //echo $e; + return false; + } + return $stmt->fetchAll(\PDO::FETCH_ASSOC); + } + + + public function InsertIstTeil($data){ + $pdo = $this -> linkDB(); + + $sql = "INSERT INTO istTeil(bid, gid)"; + + + + try { + $stmt = $pdo->prepare($sql); + }catch (\PDOException $e){ + //nur zum Testen: + //new Msg(true,null,$e); + //echo $e; + return false; + } + return $stmt->fetchAll(\PDO::FETCH_ASSOC); + } +} +?> \ No newline at end of file