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