3
0
mirror of http://git.frickel.earth/Tysox/BOS-Pinneberg.git synced 2025-12-15 22:34:22 +01:00

[+] fixed Bugs ins FrontEnd

This commit is contained in:
2018-03-02 11:50:13 +01:00
parent b4569550f0
commit a1ed1d6c80
8 changed files with 49 additions and 81 deletions

View File

@@ -36,26 +36,29 @@ if ($_POST) {
if (isset($_POST['org'])) {
if(strcmp($_POST['org'], "ff")) {
if (isset($_POST['ort']) && isset($_POST['name']) && isset($_POST['number']) && isset($_POST['type'])) {
if ($_POST['ort'] AND $_POST['name'] AND $_POST['number'] AND $_POST['type']) {
$insert = $pdo->prepare("INSERT INTO feuerwehr (id, OrtID, Organistationskennung, Fahrzeugkennung, Fahrzeugtyp) VALUES (?,?,?,?,?)");
$select = $pdo->prepare("SELECT COUNT(OrtID) FROM feuerwehr WHERE OrtID = ?");
if ($select->execute(array($_POST ['ort']))) {
$count = $select->fetch();
while ($row = $select->fetch()) {
if ($count <= 9) {
$count = $_POST['ort'] . "0" . $count;
} else {
$count = $_POST['ort'] . $count;
if ($row <= 9) {
$row = $_POST['ort'] . "0" . $row;
} else {
$row = $_POST['ort'] . $row;
}
}
}
$insert->bindParam(1, $count);
$insert->bindParam(2, $_POST['ort']);
$insert->bindParam(3, $_POST['name']);
$insert->bindParam(4, $_POST['number']);
$insert->bindParam(5, $_POST['type']);
$insert->execute();
echo "Eintrag vom Fahrzeug erfolgreich";
$insert->bindParam(1, $row);
$insert->bindParam(2, $_POST['ort']);
$insert->bindParam(3, $_POST['name']);
$insert->bindParam(4, $_POST['number']);
$insert->bindParam(5, $_POST['type']);
$insert->execute();
echo "Eintrag vom Fahrzeug erfolgreich";
}
}
}