add entries to statistics
This commit is contained in:
55
app/public/add_entry.php
Normal file
55
app/public/add_entry.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
session_start();
|
||||
include("../scripts/connection.php");
|
||||
include("../scripts/functions.php");
|
||||
if($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||
$points = $_POST['points'];
|
||||
$minutes = $_POST['minutes'];
|
||||
$seconds = $_POST['seconds'];
|
||||
$miliseconds = $_POST['miliseconds'];
|
||||
|
||||
if($minutes == 0 && $seconds == 0 && $miliseconds == 0){
|
||||
$time = null;
|
||||
} else {
|
||||
$time = $minutes . ":" . $seconds . "." . $miliseconds;
|
||||
}
|
||||
write_points($con, $_GET['station'], $_POST['team'], $points, $time);
|
||||
header("Location: statistik.php");
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Eintrag eintragen</title>
|
||||
</head>
|
||||
<body>
|
||||
<div <?php if(!station_exists($con, $_GET['station'])) { echo "hidden=\"true\"";}?>>
|
||||
<form action="" method="post">
|
||||
<div id="team-div">
|
||||
<label for="team">Mannschaft</label>
|
||||
<select name="team" id="team">
|
||||
<?php load_teams_no_points($con, $_GET['station'])?>
|
||||
</select>
|
||||
</div>
|
||||
<label for="points">Punkte: </label>
|
||||
<input name="points" id="points" type="number" max="15" min="0" value="0"/><br>
|
||||
<label for="zeit">Zeit: </label>
|
||||
<div id="zeit">
|
||||
<label for="minutes">Minuten</label>
|
||||
<input name="minutes" id="minutes" type="number" max="60" min="0" value="0"/><br>
|
||||
<label for="seconds">Sekunden</label>
|
||||
<input name="seconds" id="seconds" type="number" max="60" min="0" value="0"/><br>
|
||||
<label for="miliseconds">Millisekunden</label>
|
||||
<input name="miliseconds" id="miliseconds" type="number" max="99" min="0" value="0"/>
|
||||
</div>
|
||||
<div>
|
||||
<input id="button" type="submit" value="Eintragen"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user