Minor - format code.

1.9.x
Julio Montoya 11 years ago
parent 5701f76e79
commit cd61a51e69
  1. 19
      main/attendance/attendance_controller.php
  2. 1
      main/attendance/index.php
  3. 16
      main/inc/lib/pdf.lib.php

@ -389,11 +389,11 @@
/**
* It's used to print attendance sheet
* @param string action
* @param int attendance id
* @param string $action
* @param int $attendance_id
*/
public function attendance_sheet_export_to_pdf($action, $attendance_id, $student_id = 0, $course_id = '') {
public function attendance_sheet_export_to_pdf($action, $attendance_id, $student_id = 0, $course_id = '')
{
$attendance = new Attendance();
$courseInfo = CourseManager::get_course_information($course_id);
@ -429,12 +429,9 @@
$data_array['user_id'] = $user_id;
}
$data_array['next_attendance_calendar_id'] = $attendance->get_next_attendance_calendar_id($attendance_id);
//Set headers pdf
// Set headers pdf.
$courseCategory = CourseManager::get_course_category($courseInfo['category_code']);
$teacherInfo = CourseManager::get_teacher_list_from_course_code($courseInfo['code']);
$teacherName = null;
@ -444,21 +441,17 @@
$teacherName.= $dados['firstname']." ".$dados['lastname'];
}
// Get data table - Marco - ordenacao fixa - just fullname
// Get data table
$data_table = array();
$head_table = array('#', get_lang('Name'));
foreach ($data_array['attendant_calendar'] as $class_day) {
//$head_table[] = api_format_date($class_day['date_time'], DATE_FORMAT_SHORT).' <br />'.api_format_date($class_day['date_time'], TIME_NO_SEC_FORMAT);
$head_table[] = api_format_date($class_day['date_time'], DATE_FORMAT_NUMBER_NO_YEAR);
}
$data_table[] = $head_table;
$dataClass = array();
$max_dates_per_page = 10;
$data_attendant_calendar = $data_array['attendant_calendar'];
$data_users_presence = $data_array['users_presence'];
$count = 1;

@ -1,5 +1,4 @@
<?php
/* For licensing terms, see /license.txt */
/**

@ -46,12 +46,24 @@ class PDF
$this->params['course_code'] = isset($params['course_code']) ? $params['course_code'] : api_get_course_id();
$this->params['add_signatures'] = isset($params['add_signatures']) ? $params['add_signatures'] : false;
$this->pdf = new mPDF('UTF-8', $page_format, '', '', $params['left'], $params['right'], $params['top'], $params['bottom'], 8, 8, $orientation);
$this->pdf = new mPDF(
'UTF-8',
$page_format,
'',
'',
$params['left'],
$params['right'],
$params['top'],
$params['bottom'],
8,
8,
$orientation
);
}
/**
* Export the given HTML to PDF, using a global template
* @param string the HTML content
* @param string $content the HTML content
* @uses export/table_pdf.tpl
*/
public function html_to_pdf_with_template($content)

Loading…
Cancel
Save