Compare commits
	
		
			9 Commits
		
	
	
		
			getBenutze
			...
			555b475b69
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 555b475b69 | |||
| 93e3b8e0c8 | |||
| 64b6aa2716 | |||
| 34ae68bfdc | |||
| 1f2789eead | |||
| 40b6c85eb9 | |||
| bbb5ebcbac | |||
| e730377103 | |||
| add9a27630 | 
@@ -56,6 +56,13 @@ class BenutzerController
 | 
				
			|||||||
        return json_encode($result);
 | 
					        return json_encode($result);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function anmeldeVersuch()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $result = $this->db->anmeldeVersuch();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return json_encode($result);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
?>
 | 
					?>
 | 
				
			||||||
@@ -33,5 +33,11 @@ class TagesplanController
 | 
				
			|||||||
        $result = $this->db->deleteTagesplan($id);
 | 
					        $result = $this->db->deleteTagesplan($id);
 | 
				
			||||||
        return json_encode($result);
 | 
					        return json_encode($result);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function getGerichteOnTag()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $result = $this->db->getGerichteOnTag();
 | 
				
			||||||
 | 
					        return json_encode($result);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
?>
 | 
					?>
 | 
				
			||||||
@@ -111,6 +111,7 @@ class BenutzerModel extends Database
 | 
				
			|||||||
            $stmt = $pdo->prepare($sql);
 | 
					            $stmt = $pdo->prepare($sql);
 | 
				
			||||||
            $stmt->execute($params);
 | 
					            $stmt->execute($params);
 | 
				
			||||||
        } catch (\PDOException $e) {
 | 
					        } catch (\PDOException $e) {
 | 
				
			||||||
 | 
					            echo "Faulty Sql? " . $sql;
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -130,6 +131,7 @@ class BenutzerModel extends Database
 | 
				
			|||||||
            $stmt = $pdo->prepare($sql);
 | 
					            $stmt = $pdo->prepare($sql);
 | 
				
			||||||
            $stmt->execute();
 | 
					            $stmt->execute();
 | 
				
			||||||
        } catch (\PDOException $e) {
 | 
					        } catch (\PDOException $e) {
 | 
				
			||||||
 | 
					            echo "Faulty Sql? " . $sql;
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -138,6 +140,34 @@ class BenutzerModel extends Database
 | 
				
			|||||||
        return $result;
 | 
					        return $result;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function anmeldeVersuch()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $pdo = $this->linkDB();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $params = array();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $params[":Benutzername"] = $_GET["Benutzername"];
 | 
				
			||||||
 | 
					        $params[":passwort"] = $_GET["passwort"];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $sql = "SELECT * FROM Benutzerkonto WHERE name = :Benutzername AND passwort = :passwort";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            $stmt = $pdo->prepare($sql);
 | 
				
			||||||
 | 
					            $stmt->execute($params);
 | 
				
			||||||
 | 
					        } catch (\PDOException $e) {
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $result = $stmt->fetchALL(\PDO::FETCH_ASSOC);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (count($result) > 0)
 | 
				
			||||||
 | 
					            return true;
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
?>
 | 
					?>
 | 
				
			||||||
@@ -65,5 +65,28 @@ class TagesplanModel extends Database
 | 
				
			|||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function getGerichteOnTag()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $pdo = $this->linkDB();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $datum = $_GET["datum"];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $sql = "SELECT Gericht.id, Gericht.name, Gericht.preis, Gericht.beschreibung FROM Gericht LEFT JOIN GibtsAm ON Gericht.id = GibtsAm.gid LEFT JOIN Tagesplan ON GibtsAm.tid = Tagesplan.id WHERE Tagesplan.datum = '$datum'";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            $stmt = $pdo->prepare($sql);
 | 
				
			||||||
 | 
					            $stmt->execute();
 | 
				
			||||||
 | 
					        } catch (\PDOException $e) {
 | 
				
			||||||
 | 
					            echo $sql . " This do be faulty";
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return $result;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
?>
 | 
					?>
 | 
				
			||||||
		Reference in New Issue
	
	Block a user