diff --git a/app/public/edit_statistics.php b/app/public/edit_statistics.php new file mode 100644 index 0000000..96162b0 --- /dev/null +++ b/app/public/edit_statistics.php @@ -0,0 +1,26 @@ +fetch(); + include("header_footer/header.php"); + } +?> + +
+

Ergebniss bearbeiten

+
+
+
+ + +
+
+ + \ No newline at end of file diff --git a/app/public/header_footer/header.php b/app/public/header_footer/header.php index 4208c0e..0b25e36 100644 --- a/app/public/header_footer/header.php +++ b/app/public/header_footer/header.php @@ -6,11 +6,10 @@ - +
-
-
diff --git a/app/public/statistik.php b/app/public/statistik.php index fb9ce65..289d776 100644 --- a/app/public/statistik.php +++ b/app/public/statistik.php @@ -41,11 +41,21 @@ echo " - "; + \n"; } ?> + + + + + + + "; + } ?>
prepare("SELECT M.name as Name, M.feuerwehr as Feuerwehr, P.punkte as Punkte, P.zeit as Zeit FROM Punkte as P, Station as S, Mannschaft as M WHERE P.s_id = S.s_id AND S.s_id = :s_id AND M.m_id = P.m_id ORDER BY Punkte DESC"); + $stmt = $con->prepare("SELECT P.m_id as m_id, M.name as Name, M.feuerwehr as Feuerwehr, P.punkte as Punkte, P.zeit as Zeit FROM Punkte as P, Station as S, Mannschaft as M WHERE P.s_id = S.s_id AND S.s_id = :s_id AND M.m_id = P.m_id ORDER BY Punkte DESC"); $stmt->execute(['s_id' => $s_id]); $stmt->setFetchMode(PDO::FETCH_ASSOC); return $stmt; @@ -232,7 +232,7 @@ function change_user_name($con, $id, $user_name) { $stmt->bindParam(1, $user_name, PDO::PARAM_STR); $stmt->bindParam(2, $id, PDO::PARAM_STR); $stmt->execute(); - } catch(PDOExeption $e) { + } catch(PDOException $e) { handle_pdo_exception($e); } } @@ -244,7 +244,7 @@ function change_user_group($con, $id, $user_group, $s_id) { $stmt->bindParam(2, $s_id, PDO::PARAM_INT); $stmt->bindParam(3, $id, PDO::PARAM_INT); $stmt->execute(); - } catch(PDOExeption $e) { + } catch(PDOException $e) { handle_pdo_exception($e); } } @@ -255,7 +255,19 @@ function change_password($con, $id, $password) { $stmt->bindParam(1, $password, PDO::PARAM_STR); $stmt->bindParam(2, $id, PDO::PARAM_STR); $stmt->execute(); - } catch(PDOExeption $e) { + } catch(PDOException $e) { + handle_pdo_exception($e); + } +} + +function get_result($con, $m_id, $s_id) { + try { + $stmt = $con->prepare("SELECT P.*, M.name as name, M.feuerwehr as feuerwehr FROM Punkte P, Mannschaft M WHERE M.m_id = P.m_id AND P.m_id = ? AND P.s_id = ?"); + $stmt->bindParam(1, $m_id, PDO::PARAM_INT); + $stmt->bindParam(2, $s_id, PDO::PARAM_INT); + $stmt->execute(); + return $stmt; + } catch(PDOException $e) { handle_pdo_exception($e); } } \ No newline at end of file diff --git a/app/scripts/functions.php b/app/scripts/functions.php index 007d1dc..741c0a4 100644 --- a/app/scripts/functions.php +++ b/app/scripts/functions.php @@ -102,7 +102,7 @@ function load_station_table($con, $s_id) { \n"; $stmt = get_station($con, $s_id); foreach($stmt->fetchAll() as $row) { - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n";
" . $row['Name'] . "" . $row['Feuerwehr'] . "" . $row['Punkte'] . "