$info[] = array(_TESTS, $lessonInfo['tests']);
 }
 $pdf->printInformationSection(_LESSONCONTENTINFO, $info);
 $formatting = array(_USER => array('width' => '20%', 'fill' => false), _TIMEINLESSON => array('width' => '10%', 'fill' => false), _REGISTRATIONDATE => array('width' => '10%', 'fill' => false), _CONTENT => array('width' => '10%', 'fill' => false, 'align' => 'C'), _TESTS => array('width' => '10%', 'fill' => false, 'align' => 'C'), _PROJECTS => array('width' => '10%', 'fill' => false, 'align' => 'C'), _COMPLETED => array('width' => '10%', 'fill' => false), _SCORE => array('width' => '10%', 'fill' => false, 'align' => 'R'), _LASTLOGIN => array('width' => '10%', 'fill' => false));
 $data = array();
 foreach ($students as $user) {
     if ($GLOBALS['configuration']['time_reports']) {
         $tag = _ACTIVETIMEINLESSON;
         $val = $user['active_time_in_lesson']['time_string'];
     } else {
         $tag = _TIMEINLESSON;
         $val = $user['time_in_lesson']['time_string'];
     }
     $data[] = array(_USER => formatLogin($user['login']), $tag => $val, _REGISTRATIONDATE => formatTimestamp($user['timestamp']), _CONTENT => formatScore($user['overall_progress']['percentage']) . "%", _TESTS => formatScore($user['test_status']['mean_score']) . "%", _PROJECTS => formatScore($user['project_status']['mean_score']) . "%", _COMPLETED => $user['completed'] ? _YES . ', ' . _ON . ' ' . formatTimestamp($user['timestamp_completed']) : _NO, _SCORE => formatScore($user['score']) . "%", _LASTLOGIN => formatTimestamp($user['last_login'], true));
 }
 $pdf->printDataSection(_USERSINFO, $data, $formatting);
 $data = array();
 foreach ($professors as $user) {
     $data[] = array(_USER => formatLogin($user['login']), _REGISTRATIONDATE => formatTimestamp($user['timestamp']));
 }
 $pdf->printDataSection(_PROFESSORSINFO, $data, $formatting);
 if (EfrontUser::isOptionVisible('tests')) {
     $formatting = array(_USER => array('width' => '25%', 'fill' => false), _SCORE => array('width' => '15%', 'fill' => false));
     foreach ($testsInfo as $id => $info) {
         $data = array();
         foreach ($info['done'] as $results) {
             $avgScore[] = $results['active_score'] ? $results['active_score'] : $results['score'];
             $data[] = array(_USER => formatLogin($results['users_LOGIN']), _SCORE => formatScore(round($results['active_score'] ? $results['active_score'] : $results['score'], 2)) . "%");
         }
         if (!empty($data)) {
             $data[] = array(_USER => _AVERAGESCORE, _SCORE => formatScore(round(array_sum($avgScore) / sizeof($avgScore), 2)) . "%");
Exemple #2
0
             														  _STATUS	=> array('width' => '13%', 'fill' => true, 'align' => 'C'),
             														  _SCORE	=> array('width' => '9%',  'fill' => true, 'align' => 'R'));
             						$testsSubSectionData = array();
             						foreach ($userDoneTests[$value['id']] as $test) {
             							$testsSubSectionData[] = array(_TESTNAME => $test['name'],
             														   _STATUS   => $test['status'],
             														   _SCORE 	 => formatScore($test['score']).'%');
             						}
             						$testSubSections[$lessonId] = array('data' => $testsSubSectionData, 'formatting' => $testSubsectionFormatting, 'title' => _TESTSFORLESSON.': '.$courseLesson['name']);
             					}
             */
         }
         $subSections[$courseId] = array('data' => $subSectionData, 'formatting' => $subsectionFormatting, 'title' => _LESSONSFORCOURSE . ': ' . $value['name'], 'subSections' => $testSubSections);
     }
 }
 $pdf->printDataSection(_TRAINING . ': ' . _COURSES, $data, $formatting, $subSections);
 $data = $subSections = array();
 foreach ($userLessons as $lessonId => $value) {
     $data[$lessonId] = array(_NAME => $value['name'], _CATEGORY => str_replace(" → ", " -> ", $directionsPathStrings[$value['directions_ID']]), _REGISTRATIONDATE => formatTimestamp($value['active_in_lesson']), _COMPLETED => $value['completed'] ? _YES . ($value['timestamp_completed'] ? ', ' . _ON . ' ' . formatTimestamp($value['timestamp_completed']) : '') : '-', _SCORE => formatScore($value['score']) . '%');
     /*
     			if (isset($userDoneTests[$value['id']])) {
     				$subsectionFormatting = array(_TESTNAME	=> array('width' => '78%', 'fill' => true),
     											  _STATUS	=> array('width' => '13%', 'fill' => true, 'align' => 'C'),
     											  _SCORE	=> array('width' => '9%',  'fill' => true, 'align' => 'R'));
     				$subSectionData = array();
     				foreach ($userDoneTests[$value['id']] as $test) {
     					$subSectionData[] = array(_TESTNAME	=> $test['name'],
     											  _STATUS   => $test['status'],
     											  _SCORE 	=> formatScore($test['score']).'%');
     				}
     				$subSections[$lessonId] = array('data' => $subSectionData, 'formatting' => $subsectionFormatting, 'title' => _TESTSFORLESSON.': '.$value['name']);
            foreach ($result as $value) {
                $userBranches[$value['users_login']][] = $value['name'];
            }
            foreach ($userBranches as $login => $value) {
                $userBranches[$login] = implode(",", $value);
            }
            $formatting = array(_USER => array('width' => '16%', 'fill' => false), _COURSEROLE => array('width' => '16%', 'fill' => false), _BRANCH => array('width' => '16%', 'fill' => false), _PERCENTAGE => array('width' => '16%', 'fill' => false), _ENROLLEDON => array('width' => '10%', 'fill' => false), _COMPLETED => array('width' => '11%', 'fill' => false), _SCORE => array('width' => '11%', 'fill' => false, 'align' => 'R'));
        }
        #cpp#endif
        foreach ($users as $login => $info) {
            if ($info['completed'] && $info['to_timestamp']) {
                $completedString = _YES . ', ' . _ON . ' ' . formatTimestamp($info['to_timestamp']);
            } elseif ($info['completed']) {
                $completedString = _YES;
            } else {
                $completedString = _NO;
            }
            if (G_VERSIONTYPE == 'enterprise') {
                #cpp#ifdef ENTERPRISE
                $data[] = array(_USER => formatLogin($info['login']), _COURSEROLE => $roles[$info['role']], _BRANCH => $userBranches[$login], _PERCENTAGE => $rolesBasic[$info['user_type']] == 'student' ? $info['lesson_percentage'] . "%" : "", _ENROLLEDON => formatTimestamp($info['enrolled_on']), _COMPLETED => $completedString, _SCORE => formatScore($info['score']) . "%");
            } else {
                #cpp#else
                $data[] = array(_USER => formatLogin($info['login']), _COURSEROLE => $roles[$info['role']], _PERCENTAGE => $rolesBasic[$info['user_type']] == 'student' ? $info['lesson_percentage'] . "%" : "", _ENROLLEDON => formatTimestamp($info['enrolled_on']), _COMPLETED => $completedString, _SCORE => formatScore($info['score']) . "%");
            }
            #cpp#endif
        }
        $pdf->printDataSection(_USERSINFO, $data, $formatting);
        $pdf->OutputPdf('course_form_' . $infoCourse->course['name'] . '.pdf');
        exit;
    }
}