Compare commits
3 Commits
506982f1b1
...
ca6549280f
| Author | SHA1 | Date | |
|---|---|---|---|
| ca6549280f | |||
|
|
55e51a8214 | ||
|
|
0a3beeeaec |
@@ -5,30 +5,32 @@
|
||||
$user_data = check_login($con);
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||
$points = sanitize_input($_POST['points']);
|
||||
$minutes = sanitize_input($_POST['minutes']);
|
||||
$seconds = sanitize_input($_POST['seconds']);
|
||||
$miliseconds = sanitize_input($_POST['miliseconds']);
|
||||
$s_id = sanitize_input($_GET['station']);
|
||||
$m_id = sanitize_input($_POST['team']);
|
||||
if(isset($_POST['save'])){
|
||||
$points = sanitize_input($_POST['points']);
|
||||
$minutes = sanitize_input($_POST['minutes']);
|
||||
$seconds = sanitize_input($_POST['seconds']);
|
||||
$miliseconds = sanitize_input($_POST['miliseconds']);
|
||||
$s_id = sanitize_input($_GET['station']);
|
||||
$m_id = sanitize_input($_POST['team']);
|
||||
|
||||
if($minutes == 0 && $seconds == 0 && $miliseconds == 0){
|
||||
$time = null;
|
||||
} else {
|
||||
if ($minutes < 10) {
|
||||
$minutes = "0" . $minutes;
|
||||
}
|
||||
if($minutes == 0 && $seconds == 0 && $miliseconds == 0){
|
||||
$time = null;
|
||||
} else {
|
||||
if ($minutes < 10) {
|
||||
$minutes = "0" . $minutes;
|
||||
}
|
||||
|
||||
if ($seconds < 10) {
|
||||
$seconds = "0" . $seconds;
|
||||
}
|
||||
if ($seconds < 10) {
|
||||
$seconds = "0" . $seconds;
|
||||
}
|
||||
|
||||
if ($miliseconds < 10) {
|
||||
$miliseconds = "0" . $miliseconds;
|
||||
if ($miliseconds < 10) {
|
||||
$miliseconds = "0" . $miliseconds;
|
||||
}
|
||||
$time = "00:" . $minutes . ":" . $seconds . "." . $miliseconds;
|
||||
}
|
||||
$time = "00:" . $minutes . ":" . $seconds . "." . $miliseconds;
|
||||
write_points($con, $s_id, $m_id, $points, $time);
|
||||
}
|
||||
write_points($con, $s_id, $m_id, $points, $time);
|
||||
header("Location: statistik.php");
|
||||
die;
|
||||
}
|
||||
@@ -71,7 +73,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<input id="button" type="submit" value="Eintragen" class="btn-confirm"/>
|
||||
<input id="button" type="submit" value="Eintragen" class="btn-confirm" name="save"/>
|
||||
<input id="close" type="submit" value="Schließen" class="btn-confirm" name="close">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -5,9 +5,11 @@
|
||||
$user_data = check_login($con);
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||
$station_name = sanitize_input($_POST['station_name']);
|
||||
$station_pos = sanitize_input($_POST['station_pos']);
|
||||
write_station($con, $station_name, $station_pos);
|
||||
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;
|
||||
}
|
||||
@@ -23,16 +25,17 @@
|
||||
<div class="form_div">
|
||||
<form method="post">
|
||||
<div class="txt_field">
|
||||
<input id="station_name" type="text" name="station_name" required/>
|
||||
<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 id="station_pos" type="text" name="station_pos" required/>
|
||||
<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"/>
|
||||
<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>
|
||||
|
||||
@@ -5,9 +5,11 @@
|
||||
$user_data = check_login($con);
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||
$team_name = sanitize_input($_POST['team_name']);
|
||||
$fire_department = sanitize_input($_POST['fire_department']);
|
||||
write_team($con, $team_name, $fire_department);
|
||||
if(isset($_POST['save'])) {
|
||||
$team_name = sanitize_input($_POST['team_name']);
|
||||
$fire_department = sanitize_input($_POST['fire_department']);
|
||||
write_team($con, $team_name, $fire_department);
|
||||
}
|
||||
header("Location: mannschaft.php");
|
||||
die;
|
||||
}
|
||||
@@ -37,7 +39,8 @@
|
||||
<span></span>
|
||||
<label for="fire_department">Feuerwehr</label>
|
||||
</div>
|
||||
<input id="button" type="submit" value="Hinzufügen" class="btn-confirm"/>
|
||||
<input id="button" type="submit" value="Hinzufügen" class="btn-confirm" name="save"/>
|
||||
<a href="mannschaft.php">Schließen</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
</select>
|
||||
</div>
|
||||
<input type="submit" value="Hinzufügen" class="btn-confirm"/>
|
||||
<a href="manage_user.php">Schließen</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -130,6 +130,10 @@ form .txt_field{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.btn-close a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.form_div {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
|
||||
@@ -11,25 +11,27 @@
|
||||
}
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||
$station_id = sanitize_input($_POST['station_id']);
|
||||
$station_name = sanitize_input($_POST['station_name']);
|
||||
$station_pos = sanitize_input($_POST['station_pos']);
|
||||
$station_gewertet = sanitize_input($_POST['gewertet']);
|
||||
$station = get_station_all($con, $station_id)->fetch();
|
||||
$s_id = intval($station['s_id']);
|
||||
$name = strval($station['name']);
|
||||
$standort = strval($station['standort']);
|
||||
$gewertet = intval($station['gewertet']);
|
||||
if($name != $station_name) {
|
||||
update_station_name($con, $s_id, $station_name);
|
||||
}
|
||||
if(!isset($_POST['close'])){
|
||||
$station_id = sanitize_input($_POST['station_id']);
|
||||
$station_name = sanitize_input($_POST['station_name']);
|
||||
$station_pos = sanitize_input($_POST['station_pos']);
|
||||
$station_gewertet = sanitize_input($_POST['gewertet']);
|
||||
$station = get_station_all($con, $station_id)->fetch();
|
||||
$s_id = intval($station['s_id']);
|
||||
$name = strval($station['name']);
|
||||
$standort = strval($station['standort']);
|
||||
$gewertet = intval($station['gewertet']);
|
||||
if($name != $station_name) {
|
||||
update_station_name($con, $s_id, $station_name);
|
||||
}
|
||||
|
||||
if($standort != $station_pos) {
|
||||
update_station_pos($con, $s_id, $station_pos);
|
||||
}
|
||||
if($standort != $station_pos) {
|
||||
update_station_pos($con, $s_id, $station_pos);
|
||||
}
|
||||
|
||||
if($gewertet != $station_gewertet) {
|
||||
update_station_gewertet($con, $s_id, $station_gewertet);
|
||||
if($gewertet != $station_gewertet) {
|
||||
update_station_gewertet($con, $s_id, $station_gewertet);
|
||||
}
|
||||
}
|
||||
header("Location: stationen.php");
|
||||
die;
|
||||
@@ -61,7 +63,10 @@
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="station_id" <?php echo "value=\"" . $row ['s_id'] . "\""?>/>
|
||||
<input type="submit" value="Speichern" class="btn-confirm"/>
|
||||
<div>
|
||||
<input type="submit" value="Speichern" class="btn-confirm"/>
|
||||
<input type="submit" value="Schließen" class="btn-confirm" name="close">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,32 +10,33 @@
|
||||
}
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$m_id = intval(sanitize_input($_POST['m_id']));
|
||||
$s_id = intval(sanitize_input($_POST['s_id']));
|
||||
$points = intval(sanitize_input($_POST['points']));
|
||||
$minutes = intval(sanitize_input($_POST['minutes']));
|
||||
$seconds = intval(sanitize_input($_POST['seconds']));
|
||||
$millis = intval(sanitize_input($_POST['millis']));
|
||||
if (get_points($con, $m_id, $s_id)->fetch()['punkte'] != $points) {
|
||||
change_points($con, $m_id, $s_id, $points);
|
||||
if(isset($_POST['button'])) {
|
||||
$m_id = intval(sanitize_input($_POST['m_id']));
|
||||
$s_id = intval(sanitize_input($_POST['s_id']));
|
||||
$points = intval(sanitize_input($_POST['points']));
|
||||
$minutes = intval(sanitize_input($_POST['minutes']));
|
||||
$seconds = intval(sanitize_input($_POST['seconds']));
|
||||
$millis = intval(sanitize_input($_POST['millis']));
|
||||
if (get_points($con, $m_id, $s_id)->fetch()['punkte'] != $points) {
|
||||
change_points($con, $m_id, $s_id, $points);
|
||||
}
|
||||
|
||||
if (get_minutes($con, $m_id, $s_id)->fetch()['minutes'] != $minutes || get_seconds($con, $m_id, $s_id)->fetch()['seconds'] != $seconds || get_millis($con, $m_id, $s_id)->fetch()['millis'] != $millis) {
|
||||
if ($millis < 10) {
|
||||
$millis = "0" . $millis;
|
||||
}
|
||||
|
||||
if ($minutes < 10) {
|
||||
$minutes = "0" . $minutes;
|
||||
}
|
||||
|
||||
if ($seconds < 10) {
|
||||
$seconds = "0" . $seconds;
|
||||
}
|
||||
$time = "00:" . $minutes . ":" . $seconds . "." . $millis;
|
||||
change_time($con, $m_id, $s_id, $time);
|
||||
}
|
||||
}
|
||||
|
||||
if (get_minutes($con, $m_id, $s_id)->fetch()['minutes'] != $minutes || get_seconds($con, $m_id, $s_id)->fetch()['seconds'] != $seconds || get_millis($con, $m_id, $s_id)->fetch()['millis'] != $millis) {
|
||||
if ($millis < 10) {
|
||||
$millis = "0" . $millis;
|
||||
}
|
||||
|
||||
if ($minutes < 10) {
|
||||
$minutes = "0" . $minutes;
|
||||
}
|
||||
|
||||
if ($seconds < 10) {
|
||||
$seconds = "0" . $seconds;
|
||||
}
|
||||
$time = "00:" . $minutes . ":" . $seconds . "." . $millis;
|
||||
change_time($con, $m_id, $s_id, $time);
|
||||
}
|
||||
|
||||
header("Location: statistik.php");
|
||||
die;
|
||||
}
|
||||
@@ -74,6 +75,7 @@
|
||||
<input type="hidden" name="m_id" value=<?php echo $row['m_id'] ?>/>
|
||||
<input type="hidden" name="s_id" value=<?php echo $row['s_id'] ?>/>
|
||||
<input name="button" type="submit" value="Speichern" class="btn-confirm"/>
|
||||
<input type="submit" name="close" value="Schließen" class="btn-confirm"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -11,36 +11,37 @@
|
||||
}
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||
$id = sanitize_input($_POST['id']);
|
||||
$user = get_user($con, $id)->fetch();
|
||||
$user_group = sanitize_input($_POST['user_group']);
|
||||
$user_name = sanitize_input($_POST['user_name']);
|
||||
$bind_station = sanitize_input($_POST['bind_station']);
|
||||
$password = sanitize_input($_POST['password']);
|
||||
|
||||
if($user['user_name'] != $user_name) {
|
||||
change_user_name($con, $id, $user_name);
|
||||
}
|
||||
|
||||
if($user['user_group'] != $user_group) {
|
||||
if($user_group == "station") {
|
||||
change_user_group($con, $id, $user_group, $bind_station);
|
||||
} else {
|
||||
change_user_group($con, $id, $user_group, NULL);
|
||||
if(isset($_POST['save'])){
|
||||
$id = sanitize_input($_POST['id']);
|
||||
$user = get_user($con, $id)->fetch();
|
||||
$user_group = sanitize_input($_POST['user_group']);
|
||||
$user_name = sanitize_input($_POST['user_name']);
|
||||
$bind_station = sanitize_input($_POST['bind_station']);
|
||||
$password = sanitize_input($_POST['password']);
|
||||
|
||||
if($user['user_name'] != $user_name) {
|
||||
change_user_name($con, $id, $user_name);
|
||||
}
|
||||
|
||||
if($user['user_group'] != $user_group) {
|
||||
if($user_group == "station") {
|
||||
change_user_group($con, $id, $user_group, $bind_station);
|
||||
} else {
|
||||
change_user_group($con, $id, $user_group, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if($user['s_id'] != $bind_station) {
|
||||
if ($user_group == "station") {
|
||||
change_s_id($con, $id, $bind_station);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($password)) {
|
||||
$phash = generate_password_hash($password, $user['salt']);
|
||||
change_password($con, $id, $phash);
|
||||
}
|
||||
}
|
||||
|
||||
if($user['s_id'] != $bind_station) {
|
||||
if ($user_group == "station") {
|
||||
change_s_id($con, $id, $bind_station);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($password)) {
|
||||
$phash = generate_password_hash($password, $user['salt']);
|
||||
change_password($con, $id, $phash);
|
||||
}
|
||||
|
||||
header("Location: manage_user.php");
|
||||
die;
|
||||
}
|
||||
@@ -84,7 +85,8 @@
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" value=<?php echo "\"" . $row['id'] . "\""?> name="id"/>
|
||||
<input type="submit" value="ändern" class="btn-confirm"/>
|
||||
<input type="submit" value="Speichern" class="btn-confirm" name="save"/>
|
||||
<input type="submit" value="Schließen" class="btn-confirm" name="close"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,12 +9,13 @@
|
||||
<link rel="stylesheet" href="css/edit.css">
|
||||
<script src="js/navbar.js" defer></script>
|
||||
<script src="js/edit_table.js"></script>
|
||||
<script src="js/add_entries.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav class="navbar">
|
||||
<div id="logo">
|
||||
Punktesystem-KSP
|
||||
Punktesystem-Kreispokalwettbewerb
|
||||
</div>
|
||||
<a href="#" class="toggle-button">
|
||||
<span class="bar"></span>
|
||||
@@ -32,9 +33,9 @@
|
||||
echo "<li><a href=\"stationen.php\">Stationen</a></li>\n";
|
||||
}
|
||||
if ($_SESSION['user_group'] == 'statistics') {
|
||||
echo "<li><a href=\"statistik.php\">Ergebnisse</a></li>";
|
||||
echo "<li><a href=\"statistik.php\">Ergebnis</a></li>";
|
||||
} else {
|
||||
echo "<li><a href=\"statistik.php\">Ergebnisse eintragen</a></li>";
|
||||
echo "<li><a href=\"statistik.php\">Ergebnis eintragen</a></li>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
<body>
|
||||
<div class="center">
|
||||
<div class="headline">
|
||||
<h1><span>Punktesystem Kreispokalwettbewerb Altdorf</span></h1>
|
||||
<h1><span>Punktesystem Kreispokalwettbewerb</span></h1>
|
||||
</div>
|
||||
<div class="home">
|
||||
<h2>Gesamtergebniss</h2>
|
||||
<h2>Gesamtergebnis</h2>
|
||||
</div>
|
||||
<div class="home-menu-table table-div">
|
||||
<table id="table">
|
||||
|
||||
@@ -41,11 +41,11 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="css/login.css">
|
||||
<title>Punktesystem-KSP</title>
|
||||
<title>Punktesystem-KPW</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="center">
|
||||
<h1>PUNKTESYSTEM-KSP</h1>
|
||||
<h1>PUNKTESYSTEM-KPW</h1>
|
||||
<form method="post">
|
||||
<div class="txt_field">
|
||||
<input id="user_name" type="text" name="user_name" required/>
|
||||
|
||||
Reference in New Issue
Block a user