function printDisciplineTrimestre($abs1, $abs2, $sequences) { $col = [0, 11, 6, 18, 18, 7, 7, 21, 20]; $ordretrimestre = 3; if ($sequences[0]['ORDRE'] === 1) { $ordretrimestre = 1; } elseif ($sequences[0]['ORDRE'] === 3) { $ordretrimestre = 2; } $corps = '<table><tr style="background-color:#CCC;font-weight:bold;text-align:center;font-size:8px">' . '<td border="1" width="' . $col[1] . '%" style="background-color:#FFF">DISCIPLINE</td>' . '<td border="1" align="center" width="' . $col[5] . '%">T.ABS</td>' . '<td border="1" align="center" width="' . $col[5] . '%">Retard</td>' . '<td colspan="3" border="1" align="center" width="' . $col[3] . '%">ABS. Justifiées</td>' . '<td colspan="3" border="1" align="center" width="' . $col[4] . '%">Consignes</td>' . '<td border="1" align="center" width="' . $col[7] . '%">Conseil de classe</td>' . '<td border="1" align="center" width="' . $col[8] . '%">Observation</td>' . '</tr>' . '<tr align="center" style="text-align:center;font-size:10px; font-weight:bold;"><td></td>' . '<td border="1" style="line-height:21px" rowspan="2" width="' . $col[5] . '%">' . ($abs1['TOTALABS'] + $abs2['TOTALABS']) . '</td>' . '<td style="line-height:21px" border="1" rowspan="2" width="' . $col[5] . '%">0</td>' . '<td border="1" width="' . $col[2] . '%" style="font-size:6px;">SEQ' . $sequences[0]['ORDRE'] . '</td>' . '<td border="1" width="' . $col[2] . '%" style="font-size:6px;">SEQ' . $sequences[1]['ORDRE'] . '</td>' . '<td border="1" width="' . $col[2] . '%" style="font-size:6px;">TRIM' . $ordretrimestre . '</td>' . '<td border="1" width="' . $col[2] . '%" style="font-size:6px;">SEQ' . $sequences[0]['ORDRE'] . '</td>' . '<td border="1" width="' . $col[2] . '%" style="font-size:6px;">SEQ' . $sequences[1]['ORDRE'] . '</td>' . '<td border="1" width="' . $col[2] . '%" style="font-size:6px;">TRIM' . $ordretrimestre . '</td>' . '<td border="1" rowspan="2" width="' . $col[7] . '%">' . getConseilClasseConduite($abs1['ABSINJUST'] + $abs2['ABSINJUST']) . '</td>' . '<td border="1" rowspan="2" width="' . $col[8] . '%"></td></tr>'; $corps .= '<tr align="center"><td></td>' . '<td border="1">' . $abs1['ABSJUST'] . '</td>' . '<td border="1">' . $abs2['ABSJUST'] . '</td>' . '<td border="1">' . ($abs1['ABSJUST'] + $abs2['ABSJUST']) . '</td>' . '<td border="1">' . $abs1['CONSIGNE'] . '</td>' . '<td border="1">' . $abs2['CONSIGNE'] . '</td>' . '<td border="1">' . ($abs1['CONSIGNE'] + $abs2['CONSIGNE']) . '</td>' . '</tr>'; $corps .= '</table>'; return $corps; }
function printDisciplineAnnuel($disc) { $cold = array(); $cold[0] = 8; $cold[1] = 6; $cold[2] = 6; $cold[3] = 18; $str = '<table style="text-align:center;"><tr style="font-weight:bold;line-height:12px;font-size:8px"><td width="' . $cold[0] . '%"></td>'; for ($i = 1; $i <= 6; $i++) { $str .= '<td border="1" width="' . $cold[1] . '%">Seq' . $i . '</td>'; } $str .= '<td border="1" width="' . $cold[2] . '%" >Total</td> <td border="1" width="' . $cold[3] . '%">Discipline</td></tr> <tr style="font-weight:bold;line-height:12px;font-size:8px"> <td border="1" width="' . $cold[0] . '%"> T.Abs</td>'; $total = 0; $just = 0; for ($i = 1; $i <= 6; $i++) { $str .= '<td border="1" width="' . $cold[1] . '%">' . (isset($disc["ABS" . $i]) ? $disc["ABS" . $i] : "") . '</td>'; $total += isset($disc["ABS" . $i]) ? $disc["ABS" . $i] : 0; $just += isset($disc['JUST' . $i]) ? $disc['JUST' . $i] : 0; } $str .= '<td border="1" width="' . $cold[2] . '%">' . $total . '</td> <td rowspan="3" border="1">' . getConseilClasseConduite($total - $just) . '</td></tr>'; $str .= '<tr style="font-weight:bold;line-height:12px;font-size:8px"><td width="' . $cold[0] . '%" border="1">Abs.J</td>'; for ($i = 1; $i <= 6; $i++) { $str .= '<td border="1" width="' . $cold[1] . '%">' . (isset($disc['JUST' . $i]) ? $disc['JUST' . $i] : "") . '</td>'; } $str .= '<td width="' . $cold[2] . '%" border="1">' . $just . '</td></tr>'; $str .= '<tr style="font-weight:bold;line-height:12px;font-size:8px"><td border="1" width="' . $cold[0] . '%">Cons</td>'; $total = 0; for ($i = 1; $i <= 6; $i++) { $str .= '<td border="1" width="' . $cold[1] . '%">' . (isset($disc['CONS' . $i]) ? $disc['CONS' . $i] : "") . '</td>'; $total += isset($disc['CONS' . $i]) ? $disc['CONS' . $i] : ""; } $str .= '<td border="1" width="' . $cold[2] . '%"></td></tr>'; $str .= '</table>'; return $str; }