示例#1
0
    }
    if (sizeof($userLessons) > 0) {
        $averages['lessons'] = formatScore(round(array_sum($lessonsScores) / sizeof($lessonsScores), 2));
    }
    $smarty->assign("T_AVERAGES", $averages);
}
$smarty->assign("T_EMPLOYEE_FORM_CAPTION", _USERFORM . ": " . formatLogin($editedUser->user['login']));
if (isset($_GET['pdf'])) {
    $pdf = new EfrontPdf(_EMPLOYEEFORM . ": " . formatLogin($editedUser->user['login']));
    try {
        $avatarFile = new EfrontFile($infoUser->user['avatar']);
    } catch (Exception $e) {
        $avatarFile = new EfrontFile(G_SYSTEMAVATARSPATH . "unknown_small.png");
    }
    $info = array(array(_NAME, formatLogin($editedUser->user['login'])), array(_BIRTHDAY, formatTimestamp($editedEmployee->employee['birthday'])), array(_ADDRESS, $editedEmployee->employee['address']), array(_CITY, $editedEmployee->employee['city']), array(_HIREDON, formatTimestamp($editedEmployee->employee['hired_on'])), array(_LEFTON, formatTimestamp($editedEmployee->employee['left_on'])));
    $pdf->printInformationSection(_GENERALUSERINFO, $info, $avatarFile);
    $info = array();
    foreach ($jobs as $value) {
        $info[] = array($value['name'], strip_tags($value['description']) . ($value['supervisor'] ? _SUPERVISOR : ''));
    }
    $pdf->printInformationSection(_PLACEMENTS, $info);
    $info = array();
    foreach ($evaluations as $value) {
        $info[] = array(formatLogin($value['author']) . ' ' . formatTimestamp($value['timestamp']), strip_tags($value['specification']));
    }
    $pdf->printInformationSection(_EVALUATIONS, $info);
    $info = array();
    foreach ($skills_sorted as $cat_id => $skills) {
        $info[] = array('category' => $skill_categories[$cat_id]);
        foreach ($skills as $value) {
            $info[] = array($value['description'] . ' ', $value['specification'] . ' ' . ($value['score'] ? "({$value['score']}%)" : ''));
     } else {
         if ($user['user_type'] == "professor") {
             $professors[$user['login']] = $user;
         }
     }
 }
 if ($groupname || $branchName) {
     $studentsSize = sizeof($students);
     $professorsSize = sizeof($professors);
 } else {
     $studentsSize = sizeof($infoLesson->getUsers('student'));
     $professorsSize = sizeof($infoLesson->getUsers('professor'));
 }
 $pdf = new EfrontPdf($reportTitle);
 $info = array(array(_LESSON, $infoLesson->lesson['name']), array(_CATEGORY, $directionsPaths[$infoLesson->lesson['directions_ID']]), array(_STUDENTS, $studentsSize), array(_PROFESSORS, $professorsSize), array(_LANGUAGE, $languages[$infoLesson->lesson['languages_NAME']]), array(_ACTIVENEUTRAL, $infoLesson->lesson['active'] ? _YES : _NO));
 $pdf->printInformationSection(_BASICINFO, $info);
 if ($lessonInfo['comments'] || $lessonInfo['messages']) {
     $info = array(array(_COMMENTS, $lessonInfo['comments']), array(_MESSAGES, $lessonInfo['messages']));
     $pdf->printInformationSection(_LESSONPARTICIPATIONINFO, $info);
 }
 $info = array(array(_THEORY, $lessonInfo['theory']), array(_EXAMPLES, $lessonInfo['examples']));
 if (EfrontUser::isOptionVisible('projects')) {
     $info[] = array(_PROJECTS, $lessonInfo['projects']);
 }
 if (EfrontUser::isOptionVisible('tests')) {
     $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) {
            }
        }
    }
    $workBook->send('export_' . $infoUser->user['login'] . '.xls');
    $workBook->close();
    exit;
} else {
    if (isset($_GET['pdf']) && $_GET['pdf'] == 'user') {
        $pdf = new EfrontPdf(_REPORT . ": " . formatLogin($infoUser->user['login']));
        try {
            $avatarFile = new EfrontFile($infoUser->user['avatar']);
        } catch (Exception $e) {
            $avatarFile = new EfrontFile(G_SYSTEMAVATARSPATH . "unknown_small.png");
        }
        $info = array(array(_USERNAME, $userInfo['general']['fullname']), array(_USERTYPE, $userInfo['general']['user_types_ID'] ? $userInfo['general']['user_types_ID'] : $roles[$userInfo['general']['user_type']]), array(_ACTIVE, $userInfo['general']['active'] ? _YES : _NO), array(_JOINED, $userInfo['general']['joined_str']), array(_TOTALLOGINTIME, $userInfo['general']['total_login_time']['time_string']));
        $pdf->printInformationSection(_GENERALUSERINFO, $info, $avatarFile);
        $info = array(array(_FORUMPOSTS, sizeof($userInfo['communication']['forum_messages'])), array(_FORUMLASTMESSAGE, formatTimestamp($userInfo['communication']['last_message']['timestamp'])), array(_PERSONALMESSAGES, sizeof($userInfo['communication']['personal_messages'])), array(_MESSAGESFOLDERS, sizeof($userInfo['communication']['personal_folders'])), array(_FILES, sizeof($userInfo['communication']['files'])), array(_FOLDERS, sizeof($userInfo['communication']['folders'])), array(_TOTALSIZE, $userInfo['communication']['total_size'] . _KB), array(_COMMENTS, sizeof($userInfo['communication']['comments'])));
        if (!EfrontUser::isOptionVisible('forum')) {
            unset($info[_FORUMPOSTS]);
            unset($info[_FORUMLASTMESSAGE]);
        }
        if (!EfrontUser::isOptionVisible('messages')) {
            unset($info[_PERSONALMESSAGES]);
            unset($info[_MESSAGESFOLDERS]);
        }
        if (!EfrontUser::isOptionVisible('comments')) {
            unset($info[_COMMENTS]);
        }
        $pdf->printInformationSection(_USERCOMMUNICATIONINFO, $info);
        $meanDuration = $timesReport->formatTimeForReporting($userInfo['usage']['mean_duration'] * 60);
        $monthDuration = $timesReport->formatTimeForReporting($userInfo['usage']['month_mean_duration'] * 60);
         /*Do nothing if branch filters are not specified*/
     }
 }
 #cpp#endif
 $reportTitle = _REPORT . ": " . $infoCourse->course['name'];
 if ($groupname) {
     $reportTitle .= " " . _FORGROUP . ": " . $groupname;
     !$branchName or $reportTitle .= _ANDBRANCH . ": " . $branchName;
 } elseif ($branchName) {
     $reportTitle .= " " . _FORBRANCH . ": " . $branchName;
 }
 //	$directionName = eF_getTableData("directions", "name", "id=".$infoLesson -> lesson['directions_ID']);
 $languages = EfrontSystem::getLanguages(true);
 $pdf = new EfrontPdf($reportTitle);
 $info = array(array(_COURSE, $infoCourse->course['name']), array(_CATEGORY, str_replace(" → ", " -> ", $directionsPaths[$infoCourse->course['directions_ID']])), array(_LESSONS, $infoCourse->course['num_lessons']), array(_LANGUAGE, $languages[$infoCourse->course['languages_NAME']]));
 $pdf->printInformationSection(_BASICINFO, $info);
 $roles = EfrontLessonUser::getLessonsRoles(true);
 $formatting = array(_USER => array('width' => '20%', 'fill' => false), _COURSEROLE => array('width' => '20%', 'fill' => false), _PERCENTAGE => array('width' => '20%', 'fill' => false), _ENROLLEDON => array('width' => '10%', 'fill' => false), _COMPLETED => array('width' => '10%', 'fill' => false), _SCORE => array('width' => '20%', 'fill' => false, 'align' => 'R'));
 $data = array();
 $constraints = array('table_filters' => $stats_filters);
 $constraints['return_objects'] = false;
 $users = $infoCourse->getCourseUsersAggregatingResults($constraints);
 $courseLessons = $infoCourse->getCourseLessons(array('active' => 1, 'archive' => 0, 'return_objects' => false));
 foreach ($courseLessons as $lesson) {
     $lesson_ids[] = $lesson['id'];
 }
 $status = array();
 $result = eF_getTableData("users_to_lessons", "users_LOGIN,lessons_ID,completed", "lessons_ID in (" . implode(",", $lesson_ids) . ")");
 foreach ($result as $value) {
     $status[$infoCourse->course['id']][$value['users_LOGIN']][$value['lessons_ID']] = $value;
 }