Files
PunkteSystem-KSP/app/public/add_station.php
2022-09-18 19:05:46 +02:00

46 lines
1.5 KiB
PHP

<?php
session_start();
include("../scripts/connection.php");
include("../scripts/functions.php");
$user_data = check_login($con);
if($_SERVER['REQUEST_METHOD'] == "POST") {
if(isset($_POST['save'])){
$station_name = sanitize_input($_POST['station_name']);
$station_pos = sanitize_input($_POST['station_pos']);
write_station($con, $station_name, $station_pos);
}
header("Location: stationen.php");
die;
}
include("header_footer/header.php");
?>
<body>
<div class="center">
<div class="headline">
<h2>Station hinzufügen</h2>
</div>
<div class="form_div">
<form method="post">
<div class="txt_field">
<input class="input_field" id="station_name" type="text" name="station_name" required/>
<span></span>
<label for="station_name">Name</label>
</div>
<div class="txt_field">
<input class="input_field" id="station_pos" type="text" name="station_pos" required/>
<span></span>
<label for="station_pos">Standort</label>
</div>
<input id="button" type="submit" value="Hinzufügen" class="btn-confirm" name="save"/>
<a href="stationen.php" class="btn-close">Schließen</a>
</form>
</div>
</div>
</body>
<?php
$con = null;
echo file_get_contents("header_footer/footer.html");
?>