Ejemplo n.º 1
0
// Table header.
$examstable->head = array(get_string("examdetails", "mod_emarking"), " ");
// CSS classes for each column in the table.
$examstable->colclasses = array("exams_examname", null);
$examstable->data[] = array(get_string("examname", "mod_emarking"), $exam->name);
$details = html_writer::start_tag("div", array("class" => "printdetails"));
if ($exam->headerqr) {
    $details .= html_writer::div($OUTPUT->pix_icon("qr-icon", get_string("headerqr", "mod_emarking"), "mod_emarking"));
}
if ($exam->printlist) {
    $details .= html_writer::div($OUTPUT->pix_icon("i/grades", get_string("printlist", "mod_emarking")));
}
if ($exam->printrandom) {
    $details .= html_writer::div($OUTPUT->pix_icon("shuffle", get_string("printrandom", "mod_emarking"), "mod_emarking"));
}
$details .= emarking_enrolments_div($exam);
$details .= html_writer::end_tag("div");
$examstable->data[] = array(get_string("examdate", "mod_emarking"), date("l jS F Y, g:ia", usertime($exam->examdate)));
if ($usercangrade) {
    $examstatus = emarking_exam_status_string($exam);
    $examstable->data[] = array(get_string("comment", "mod_emarking"), $exam->comment);
    $examstable->data[] = array(get_string("status", "mod_emarking"), $examstatus);
    $examstable->data[] = array(get_string("details", "mod_emarking"), $details);
    $examstable->data[] = array(get_string("sent", "mod_emarking"), emarking_time_ago($exam->timecreated));
    $originals = $exam->totalpages + $exam->extrasheets;
    $copies = $exam->totalstudents + $exam->extraexams;
    $totalsheets = $originals * $copies;
    $examstable->data[] = array(get_string('originals', 'mod_emarking'), $originals);
    $examstable->data[] = array(get_string('copies', 'mod_emarking'), $copies);
    $examstable->data[] = array(get_string('totalpagesprint', 'mod_emarking'), $totalsheets);
    $user = $DB->get_record("user", array("id" => $exam->requestedby));
Ejemplo n.º 2
0
    // Change cost configuration.
    $urlcost = new moodle_url('/mod/emarking/reports/exammodification.php', array('exam' => $exam->id, 'category' => $categoryid, 'status' => $statusicon));
    $actions .= html_writer::end_tag("div");
    // Calculating date differences to identify exams that are late, are for today and so on.
    if (date("d/m/y", $exam->examdate) === date("d/m/y", $currentdate)) {
        $examstable->rowclasses[$current] = 'examtoday';
    } else {
        if ($currentdate < $exam->examdate) {
            $examstable->rowclasses[$current] = 'examisok';
        } else {
            $examstable->rowclasses[$current] = 'examislate';
        }
    }
    $notification = $exam->notified ? $OUTPUT->pix_icon('t/approve', get_string('printnotificationsent', 'mod_emarking')) : '<a href="' . $CFG->wwwroot . '/mod/emarking/print/sendprintnotification.php?id=' . $exam->id . '">' . $OUTPUT->pix_icon('i/email', get_string('printsendnotification', 'mod_emarking')) . '</a>';
    $enrolments = html_writer::start_tag("div", array("class" => "printdetails"));
    $enrolments .= emarking_enrolments_div($exam);
    $enrolments .= html_writer::end_tag("div");
    $examstable->data[] = array(date("l jS F g:ia", $exam->examdate), $exam->name, $OUTPUT->action_link($urlcourse, $exam->coursefullname), $exam->category . '<br/>' . $enrolments, $OUTPUT->action_link($urlprofile, $exam->userfullname), '$' . number_format($exam->cost) . $OUTPUT->action_icon($urlcost, new pix_icon("i/edit", get_string("downloadform", "mod_emarking"))), $statusicon == 1 ? emarking_time_ago($exam->timecreated) : emarking_time_ago($exam->printdate), $statusicon == 1 ? $pagestoprint : $actions, $statusicon == 1 ? $actions : $notification);
    $current++;
}
echo $OUTPUT->header();
echo $OUTPUT->heading($pagetitle . ' ' . $category->name);
$activetab = $statusicon == 1 ? 'printorders' : 'printordershistory';
echo $OUTPUT->tabtree(emarking_printoders_tabs($category), $activetab);
if (count($exams) > 0) {
    echo core_text::strtotitle(get_string("filter")) . "&nbsp;&nbsp;";
    echo html_writer::tag("input", null, array("id" => "searchInput"));
    echo html_writer::table($examstable);
    // Print the table.
    echo $OUTPUT->paging_bar($examscount, $page, $perpage, $CFG->wwwroot . '/mod/emarking/print/printorders.php?category=' . $categoryid . '&status=' . $statusicon . '&page=');
} else {