fixed typo and added close button to edit pages

This commit is contained in:
Grisu
2022-09-16 09:49:36 +02:00
parent 506982f1b1
commit 0a3beeeaec
7 changed files with 103 additions and 92 deletions

View File

@@ -10,19 +10,20 @@
}
if($_SERVER['REQUEST_METHOD'] == "POST") {
$m_id = sanitize_input($_POST['m_id']);
$team_name = sanitize_input($_POST['team_name']);
$fire_department = sanitize_input($_POST['fire_department']);
$row = get_team($con, $m_id)->fetch();
if($_POST['team_name'] != $row['name']) {
update_team_name($con, $m_id, $team_name);
if(isset($_POST['save'])) {
$m_id = sanitize_input($_POST['m_id']);
$team_name = sanitize_input($_POST['team_name']);
$fire_department = sanitize_input($_POST['fire_department']);
$row = get_team($con, $m_id)->fetch();
if($_POST['team_name'] != $row['name']) {
update_team_name($con, $m_id, $team_name);
}
if($_POST['fire_department'] != $row['feuerwehr']) {
update_team_fire_department($con, $m_id, $fire_department);
}
}
if($_POST['fire_department'] != $row['feuerwehr']) {
update_team_fire_department($con, $m_id, $fire_department);
}
header("Location: mannschaft.php");
die;
}
@@ -52,7 +53,8 @@
<label for="fire_department">Feuerwehr</label>
</div>
<input type="hidden" name="m_id" <?php echo "value=\"" . $row['m_id'] . "\""?> />
<input type="submit" value="Speichern" class="btn-confirm"/>
<input type="submit" value="Speichern" class="btn-confirm" name="save"/>
<input type="submit" nam="close" value="Schließen" class="btn-confirm"/>
</form>
</div>
</div>