set_pagelayout('standard'); $strverify = get_string('verifycertificate', 'block_verify_certificate'); $PAGE->set_url('/blocks/verify_certificate/index.php', array('certnumber' => $id)); $context = get_context_instance(CONTEXT_SYSTEM); $PAGE->set_context($context); /// Print the header $PAGE->navbar->add($strverify); $PAGE->set_title($strverify); $PAGE->set_heading($strverify); $PAGE->requires->css('/blocks/verify_certificate/printstyle.css'); echo $OUTPUT->header(); $certificate = $DB->get_records_sql("SELECT s.* FROM {certificate_issues} s WHERE s.code = ?", array($id)); if (! $certificate) { echo $OUTPUT->box_start('generalbox boxaligncenter'); echo get_string('notfound', 'block_verify_certificate'); echo $OUTPUT->box_end(); } else { echo $OUTPUT->box_start('generalbox boxaligncenter'); echo "
"; echo "
"; /// Print Section foreach ($certificate as $certrecord) { $certificatedate = userdate($certrecord->timecreated); echo '

' . get_string('certificate', 'block_verify_certificate') . ' ' . $certrecord->code . '

'; echo '

' . get_string('to', 'block_verify_certificate') . ': ' . $certrecord->studentname . '
'; echo '

' . get_string('course', 'block_verify_certificate') . ': ' . $certrecord->classname . '
'; echo '

' . get_string('date', 'block_verify_certificate') . ': ' . $certificatedate . '

'; if ($certrecord->reportgrade != null) { echo '

' . get_string('grade', 'block_verify_certificate') . ': ' . $certrecord->reportgrade . '

'; } } echo $OUTPUT->box_end(); } echo $OUTPUT->footer();