add teams to teams table and fix for login
This commit is contained in:
@@ -165,4 +165,25 @@ function write_station($con, $station_name, $station_pos) {
|
||||
} catch(PDOException $e) {
|
||||
handle_pdo_exceptio($e);
|
||||
}
|
||||
}
|
||||
|
||||
function get_fire_departments($con) {
|
||||
try {
|
||||
$stmt = $con->prepare("SELECT DISTINCT feuerwehr FROM Mannschaft");
|
||||
$stmt->execute();
|
||||
return $stmt;
|
||||
} catch(PDOException $e) {
|
||||
handle_pdo_exception($e);
|
||||
}
|
||||
}
|
||||
|
||||
function write_team($con, $team_name, $fire_department) {
|
||||
try {
|
||||
$stmt = $con->prepare("INSERT INTO Mannschaft (name, feuerwehr) VALUES (?, ?)");
|
||||
$stmt->bindParam(1, $team_name, PDO::PARAM_STR);
|
||||
$stmt->bindParam(2, $fire_department, PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
} catch(PDOEXCEPTION $e) {
|
||||
handle_pdo_exception($e);
|
||||
}
|
||||
}
|
||||
@@ -117,4 +117,11 @@ function load_teams_no_points($con, $s_id) {
|
||||
echo "<option value=\"" . $option['m_id'] . "\">" . $option['name'] . " " . $option['feuerwehr'] . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function load_fire_departments($con) {
|
||||
$stmt = get_fire_departments($con);
|
||||
foreach($stmt->fetchAll() as $option) {
|
||||
echo "<option>".$option['feuerwehr']."</option>\n";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user