Corrected table display
This commit is contained in:
@@ -14,18 +14,20 @@ $judokas = getJudokasInTraining($dbConnection, "inTraining");
|
||||
$lastAttendances = getLastAttendances($dbConnection);
|
||||
$lastAttendancesAssocArray = array();
|
||||
foreach($lastAttendances as $a){
|
||||
if(!isset($lastAttendances[$a['date']]))
|
||||
if(!array_key_exists( $a['date'], $lastAttendancesAssocArray)){
|
||||
$lastAttendancesAssocArray[$a['date']] = array();
|
||||
$lastAttendancesAssocArray[$a['date']][] = array( $a );
|
||||
}
|
||||
array_push( $lastAttendancesAssocArray[ $a['date'] ], $a );
|
||||
}
|
||||
|
||||
if($_POST['action']){
|
||||
giveJudokasAttendence($dbConnection, $_POST['attandanceDate'], $_POST['judokaIdsInTraining']);
|
||||
header("Location: .");
|
||||
}
|
||||
|
||||
$dateLastWendsday = new DateTime("last wednesday");
|
||||
$dateLastFriday = new DateTime("last friday");
|
||||
$lastTrainingDay = min($dateLastWendsday, $dateLastFriday);
|
||||
$lastTrainingDay = max($dateLastWendsday, $dateLastFriday);
|
||||
|
||||
?>
|
||||
<html>
|
||||
@@ -38,9 +40,9 @@ $lastTrainingDay = min($dateLastWendsday, $dateLastFriday);
|
||||
</select>
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
<?php foreach($lastAttendancesAssocArray as $date => $attendees);{
|
||||
<?php foreach($lastAttendancesAssocArray as $date => $attendees){
|
||||
echo("<h2>".$date."</h2>");
|
||||
echo("<table>");
|
||||
echo("<table border=\"1\">");
|
||||
echo("<tr>");
|
||||
echo("<th>name</th>");
|
||||
echo("<th>vorname</th>");
|
||||
@@ -50,11 +52,11 @@ $lastTrainingDay = min($dateLastWendsday, $dateLastFriday);
|
||||
echo("</tr>");
|
||||
foreach($attendees as $a){
|
||||
echo("<tr>");
|
||||
echo("<td>".$a[0]['name']."</td>");
|
||||
echo("<td>".$a[0]['vorname']."</td>");
|
||||
echo("<td>".$a[0]['corona_PLZ']."</td>");
|
||||
echo("<td>".$a[0]['corona_telephon']."</td>");
|
||||
echo("<td>".$a[0]['corona_eMail']."</td>");
|
||||
echo("<td>".$a['name']."</td>");
|
||||
echo("<td>".$a['vorname']."</td>");
|
||||
echo("<td>".$a['corona_PLZ']."</td>");
|
||||
echo("<td>".$a['corona_telephon']."</td>");
|
||||
echo("<td>".$a['corona_eMail']."</td>");
|
||||
echo("</tr>");
|
||||
}
|
||||
echo("</table>");
|
||||
|
||||
Reference in New Issue
Block a user