diff --git a/app/public/add_entry.php b/app/public/add_entry.php new file mode 100644 index 0000000..6938719 --- /dev/null +++ b/app/public/add_entry.php @@ -0,0 +1,55 @@ + + + + + + + + Eintrag eintragen + + +
> +
+
+ + +
+ +
+ +
+ +
+ +
+ + +
+
+ +
+
+
+ + \ No newline at end of file diff --git a/app/public/statistik.php b/app/public/statistik.php index cd6bdb4..d0d641a 100644 --- a/app/public/statistik.php +++ b/app/public/statistik.php @@ -5,8 +5,8 @@ include("../scripts/functions.php"); $user_data = check_login($con); - if(isset($_POST['stationen'])) { - $_SESSION['select-statistics'] = $_POST['stationen']; + if(isset($_GET['stationen'])) { + $_SESSION['select-statistics'] = $_GET['stationen']; } echo file_get_contents("html/header.html"); @@ -14,20 +14,27 @@
-
- +
+ rowCount() > 0) { + echo "
+ + +
"; + } + + ?>
prepare("SELECT M.* FROM Mannschaft M WHERE M.m_id NOT IN (SELECT P.m_id FROM Punkte P WHERE P.s_id = :s_id)"); + $stmt->execute(['s_id' => $s_id]); + $stmt->setFetchMode(PDO::FETCH_ASSOC); + return $stmt; + } catch(PDOException $e) { + handle_pdo_excepiton($e); + } +} + +function station_exists($con, $s_id) { + try { + $stmt = $con->prepare("SELECT s_id FROM Station WHERE s_id = :s_id"); + $stmt->execute(['s_id' => $s_id]); + if($stmt->rowCount() > 0) { + return true; + } else { + return false; + } + } catch(PDOException $e) { + handle_pdo_exception($e); + } +} + +function write_points($con, $s_id, $m_id, $points, $time) { + try { + $stmt = $con->prepare("INSERT INTO Punkte (m_id, s_id, punkte, zeit) VALUES (?, ?, ?, ?)"); + $stmt->bindParam(1, $m_id, PDO::PARAM_INT); + $stmt->bindParam(2, $s_id, PDO::PARAM_INT); + $stmt->bindParam(3, $points, PDO::PARAM_INT); + $stmt->bindParam(4, $time, PDO::PARAM_STR); + $stmt->execute(); + } 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 243d202..f68c3c4 100644 --- a/app/scripts/functions.php +++ b/app/scripts/functions.php @@ -108,4 +108,13 @@ function load_station_table($con, $s_id) { echo "\n"; } echo "\n"; +} + +function load_teams_no_points($con, $s_id) { + if (station_exists($con, $s_id)) { + $stmt = get_teams_no_points($con, $s_id); + foreach($stmt->fetchAll() as $option) { + echo ""; + } + } } \ No newline at end of file