Merge pull request 'dev' (#4) from dev into main
Reviewed-on: #4
This commit was merged in pull request #4.
This commit is contained in:
@@ -5,14 +5,16 @@
|
||||
$user_data=check_login($con);
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] == "GET") {
|
||||
$row = get_result($con, $_GET["m_id"], $_GET['s_id'])->fetch();
|
||||
$m_id = intval(sanitize_input($_GET['m_id']));
|
||||
$s_id = intval(sanitize_input($_GET['s_id']));
|
||||
$row = get_result($con, $m_id, $s_id)->fetch();
|
||||
include("header_footer/header.php");
|
||||
}
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
if(isset($_POST['button'])) {
|
||||
$m_id = intval(sanitize_input($_POST['m_id']));
|
||||
$s_id = intval(sanitize_input($_POST['s_id']));
|
||||
$s_id = intval(sanitize_input($_POST['s_id']));
|
||||
$m_id = intval(sanitize_input($_POST['m_id']));
|
||||
if(isset($_POST['save']) && get_direct_points($con, $s_id)->fetch()['direkte_punkte'] == 1) {
|
||||
$points = intval(sanitize_input($_POST['points']));
|
||||
$minutes = intval(sanitize_input($_POST['minutes']));
|
||||
$seconds = intval(sanitize_input($_POST['seconds']));
|
||||
@@ -36,6 +38,9 @@
|
||||
$time = "00:" . $minutes . ":" . $seconds . "." . $millis;
|
||||
change_time($con, $m_id, $s_id, $time);
|
||||
}
|
||||
} elseif(isset($_POST['save'])) {
|
||||
$result = intval(sanitize_input($_POST['result']));
|
||||
update_result($con, $s_id, $m_id, $result);
|
||||
}
|
||||
header("Location: statistik.php");
|
||||
die;
|
||||
@@ -50,31 +55,58 @@
|
||||
<form method="post">
|
||||
<label class="information">Mannschaftsname: <?php echo $row['name']?></label><br>
|
||||
<label for="fire_department" class="information">Feuerwehr: <?php echo $row["feuerwehr"]?></label><br>
|
||||
<div class="number_field">
|
||||
<label for="points">Punkte:</label>
|
||||
<input type="number" min="0" max="15" name="points" value="<?php echo $row['punkte']?>"/>
|
||||
<?php
|
||||
if (get_direct_points($con, $s_id)->fetch()['direkte_punkte'] == 1){
|
||||
echo "<div class=\"number_field\">
|
||||
<label for=\"points\">Punkte:</label>
|
||||
<input type=\"number\" min=\"0\" max=\"15\" name=\"points\" value=\"" . $row['punkte'] . "\"/>
|
||||
</div>
|
||||
<div class="headline">
|
||||
<div class=\"headline\">
|
||||
<h3>Zeit</h3>
|
||||
</div>
|
||||
<div id="time">
|
||||
<?php $time_set = check_time($con, $row['m_id'], $row['s_id']);?>
|
||||
<div class="number_field">
|
||||
<label for="minutes">Minuten:</label>
|
||||
<input name="minutes" type="number" min="0" max="60" value=<?php if(!$time_set){echo "\"0\"";} else {echo "\"" . get_minutes($con, $row['m_id'], $row['s_id'])->fetch()['minutes'] . "\""; }?>/>
|
||||
<div id=\"time\">";
|
||||
$time_set = check_time($con, $m_id, $s_id);
|
||||
echo "<div class=\"number_field\">
|
||||
<label for=\"minutes\">Minuten:</label>
|
||||
<input name=\"minutes\" type=\"number\" min=\"0\" max=\"60\" value=";
|
||||
if(!$time_set){
|
||||
echo "\"0\"";
|
||||
} else {
|
||||
echo "\"" . get_minutes($con, $m_id, $s_id)->fetch()['minutes'] . "\"";
|
||||
}
|
||||
echo "/>
|
||||
</div>
|
||||
<div class="number_field">
|
||||
<label for="seconds">Sekunden</label>
|
||||
<input name="seconds" type="number" min="0" max="60" value=<?php if(!$time_set){echo"\"0\"";} else { echo "\"" . get_seconds($con, $row['m_id'], $row['s_id'])->fetch()['seconds'] . "\""; }?>/>
|
||||
<div class=\"number_field\">
|
||||
<label for=\"seconds\">Sekunden</label>
|
||||
<input name=\"seconds\" type=\"number\" min=\"0\" max=\"60\" value=";
|
||||
if(!$time_set){
|
||||
echo"\"0\"";
|
||||
} else {
|
||||
echo "\"" . get_seconds($con, $m_id, $s_id)->fetch()['seconds'] . "\""; }
|
||||
echo"/>
|
||||
</div>
|
||||
<div class="number_field">
|
||||
<label for="millis">Millisekunden</label>
|
||||
<input name="millis" type="number" min="0" max="99" value=<?php if(!$time_set){echo"\"0\"";} else { echo "\"" . get_millis($con, $row['m_id'], $row['s_id'])->fetch()['millis'] / 1e4 . "\""; }?>/>
|
||||
<div class=\"number_field\">
|
||||
<label for=\"millis\">Millisekunden</label>
|
||||
<input name=\"millis\" type=\"number\" min=\"0\" max=\"99\" value=";
|
||||
if(!$time_set) {
|
||||
echo"\"0\"";
|
||||
} else {
|
||||
$millis = get_millis($con, $m_id, $s_id)->fetch()['millis'] / 1e4;
|
||||
echo "\"" . $millis . "\"";
|
||||
}
|
||||
echo"/>
|
||||
</div>
|
||||
</div>
|
||||
<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"/>
|
||||
</div>";
|
||||
} else {
|
||||
echo "<div class=\"number_field\">
|
||||
<label for=\"result\">Ergebnis: </label>
|
||||
<input name=\"result\" type=\"number\" min=\"0\" max=\"65535\" value=";
|
||||
echo "\"" . get_result_team_station($con, $s_id, $m_id) . "\"";
|
||||
echo "</div>";
|
||||
}?>
|
||||
<input type="hidden" name="m_id" value=<?php echo $m_id ?>/>
|
||||
<input type="hidden" name="s_id" value=<?php echo $s_id ?>/>
|
||||
<input name="save" type="submit" value="Speichern" class="btn-confirm"/>
|
||||
<input type="submit" name="close" value="Schließen" class="btn-confirm"/>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user