function make_attendance_table_detail($a) { global $_CONF; $yid = $_SESSION[$_CONF['sess_name'] . '_current_school_year']; $sid = $_SESSION[$_CONF['sess_name'] . '_myCenter']; $terms = get_terms($yid, $sid); $termsArray = make_assoc_array_from_sql($terms, 'term_id', 'my'); $term = current($termsArray); $minutes = 0; $ret = "\r\n <center>\r\n <table border=0 cellspacing=1 cellpadding=3 bgcolor=black width=90%>\r\n <tr bgcolor=white><th colspan=5 align=left>" . $term['term_name'] . " : " . make_date_nice($term['term_start_date']) . " - " . make_date_nice($term['term_end_date']) . "</th></tr>\r\n <tr bgcolor=white><th></th><th align=left>Date</th><th align=left>Type</th><th align=left>Course</th><th align=left>Comment</th></tr>"; /** * $a is a date in YYYY-MM-DD format */ $minutes = $a['minutes']; foreach ($a as $abdate => $ab) { foreach ($ab as $date => $info) { //$minutes += $info['minutes']; if ($abdate > $term['term_end_date']) { $colcount = 0; $term = next($termsArray); $ret .= "\r\n <tr bgcolor=white><th colspan=5 align=left>" . $term['term_name'] . " : " . make_date_nice($term['term_start_date']) . " - " . make_date_nice($term['term_end_date']) . "</th></tr>"; } $ret .= "\r\n <tr bgcolor=white>\r\n <td width=10%> </td>\r\n <td align=left>" . $date . "</td>\r\n <td>" . $info['type'] . "</td>\r\n <td>" . $info['class'] . "</td>\r\n <td>" . htmlentities($info['note'], ENT_QUOTES) . "</td>\r\n </tr>"; } } $ret .= "\r\n <tr bgcolor=white>\r\n <td colspan=5 align=right>Instructional Time = " . (int) ($minutes / 60) . " hours and " . $minutes % 60 . " mintues.</td>\r\n </tr>\r\n </table>\r\n </center>"; return $ret; }
$termHead = $term['term_name'] . " : " . make_date_nice($term['term_start_date']) . " - " . make_date_nice($term['term_end_date']); $pdf->Cell($pw, $th, $termHead, 0, 0, 'L', 1); $y_coord += $th; $pdf->SetXY($x_coord, $y_coord); $pdf->SetFont('Times', '', 12); $colCount = 0; $minutes = $att['minutes']; unset($att['minutes']); foreach ($att as $date => $info) { if ($date > $term['term_end_date']) { $term = next($termsArray); $x_coord = $lm; $y_coord += $rh; $pdf->SetXY($x_coord + 0.5, $y_coord); $pdf->SetFont('Times', 'B', 15); $termHead = $term['term_name'] . " : " . make_date_nice($term['term_start_date']) . " - " . make_date_nice($term['term_end_date']); $pdf->Cell($pw, $th, $termHead, 0, 0, 'L', 1); $y_coord += $th; $pdf->SetXY($x_coord, $y_coord); $pdf->SetFont('Times', '', 12); $colCount = 0; } if ($colCount % 4 == 0 && $colCount > 0) { $x_coord = $lm; $y_coord += $rh; $pdf->SetXY($x_coord, $y_coord); $colCount = 0; } foreach ($info as $day => $extra) { //$extra['code'] = ex or time for tardy //$extra['note'] = note from office , tardy mostly