From 0690eaec964e72d99010468caafb62349c4ece47 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 17 Jul 2019 14:27:24 +0200 Subject: [PATCH] Minor - Remove unused code --- main/gradebook/lib/fe/exportgradebook.php | 135 ---------------------- 1 file changed, 135 deletions(-) diff --git a/main/gradebook/lib/fe/exportgradebook.php b/main/gradebook/lib/fe/exportgradebook.php index 249f8aa5d7..316afd0ff9 100755 --- a/main/gradebook/lib/fe/exportgradebook.php +++ b/main/gradebook/lib/fe/exportgradebook.php @@ -90,141 +90,6 @@ a:active {text-decoration: none; font-weight : bold; color : black;} return $printdata; } -/** - * This function get a content html for export inside a pdf file. - * - * @param array table headers - * @param array table body - * @param array pdf headers - * @param array pdf footers - */ -function export_pdf_attendance($headers_table, $data_table, $headers_pdf, $footers_pdf, $title_pdf) -{ - $mpdf = new mPDF('UTF-8', 'A4-L', '', '', 15, 10, 35, 20, 4, 2, 'L'); - $mpdf->useOnlyCoreFonts = true; - $mpdf->mirrorMargins = 0; - - // Use different Odd/Even headers and footers and mirror margins - if (is_array($headers_pdf)) { - // preparing headers pdf - $header = ' - - - - - - - - - - - - - - - - - - - - -
- - -

'.$title_pdf.'

-
'.$headers_pdf[0][0].' '.$headers_pdf[0][1].''.$headers_pdf[1][0].' '.$headers_pdf[1][1].'
'.$headers_pdf[2][0].' '.$headers_pdf[2][1].''.$headers_pdf[3][0].' '.$headers_pdf[3][1].'
'.$headers_pdf[4][0].' '.$headers_pdf[4][1].''.$headers_pdf[5][0].' '.$headers_pdf[5][1].'
'; - } - - // preparing footer pdf - $footer = ''; - if (is_array($footers_pdf)) { - $footer .= ''; - foreach ($footers_pdf as $foot_pdf) { - $footer .= ''; - } - $footer .= ''; - } - $footer .= '
'.$foot_pdf.'
'; - $footer .= '
{PAGENO}/{nb}
'; - - // preparing content pdf - $css_file = api_get_path(SYS_CSS_PATH).'themes/'.api_get_setting('stylesheets').'/print.css'; - - if (file_exists($css_file)) { - $css = @file_get_contents($css_file); - } else { - $css = ''; - } - - if (count($data_table) > 30) { - $items_per_page = (count($data_table) / 2); - } else { - $items_per_page = count($data_table); - } - - $count_pages = ceil(count($data_table) / $items_per_page); - $content_table = ''; - for ($x = 0; $x < $count_pages; $x++) { - $content_table .= ''; - // header table - $content_table .= ''; - $i = 0; - if (is_array($headers_table)) { - foreach ($headers_table as $head_table) { - if (!empty($head_table[0])) { - $width = (!empty($head_table[1]) ? $head_table[1].'%' : ''); - $content_table .= ''; - $i++; - } - } - } - $content_table .= ''; - // body table - if (is_array($data_table) && count($data_table) > 0) { - $offset = $x * $items_per_page; - $data_table = array_slice($data_table, $offset, count($data_table)); - $i = 1; - $item = $offset + 1; - foreach ($data_table as $data) { - $content_table .= ''; - $content_table .= ''; - foreach ($data as $key => $content) { - if (isset($content)) { - $key == 1 ? $align = 'align="left"' : $align = 'align="center"'; - $content_table .= ''; - } - } - $content_table .= ''; - $i++; - $item++; - if ($i > $items_per_page) { - break; - } - } - } else { - $content_table .= ''; - } - $content_table .= '
'.$head_table[0].'
'.($item < 10 ? '0'.$item : $item).''.$content.'
'.get_lang('Empty').'
'; - if ($x < ($count_pages - 1)) { - $content_table .= ''; - } - } - $html = $content_table; - - // set attributes for pdf - $mpdf->SetHTMLHeader($header); - $mpdf->SetHTMLFooter($footer); - if (!empty($css)) { - $mpdf->WriteHTML($css, 1); - $mpdf->WriteHTML($html, 2); - } else { - $mpdf->WriteHTML($html); - } - $mpdf->Output(api_replace_dangerous_char($title_pdf.'.pdf'), 'D'); - - exit; -} - /** * This function get a content html for export inside a pdf file. *