How can this be implemented? Color is optional.
Already have a base with a score of students. I only 1 can not figure out how to display the assessment under this date. Help me please.
1 answer
First, we create an array with dates ($ dates). Then we form another array:
$users['ФИО']['Дата'] = оценка;
Then we form the table:
$t = '<table>'; $t .= '<tr>'; $t .= '<td> </td>'; foreach($dates as $date){ $t .= '<td>'.$date.'</td>'; } $t .= '</tr>'; foreach($users as $fio => $null) { $t .= '<tr>'; $t .= '<td>'.$fio.'</td>'; foreach($dates as $date) { $t .= '<td>'; $t .= !empty($users[$fio][$date]) ? $users[$fio][$date] : ' '; $t .= '</td>'; } $t .= '</tr>'; } $t .= '</table>'; echo $t;
something like this.
- Thank you so much! - trane294
|