/
var
/
www
/
html
/
gte
/
blocks
/
course_report
/
Upload File
HOME
<?php set_time_limit(600); require_once('../../config.php'); require_once('classes/report.php'); require_once('classes/excel.php'); global $DB; require_login(); $context = context_course::instance(1); if (!has_capability('block/course_report:myaddinstance', $context)){ $PAGE->set_title('Permissão Negada!'); echo $OUTPUT->header(); echo html_writer::start_div("row-fluid", array('style' => 'text-align: center;')); echo html_writer::tag("h2", get_string("permissaonegada", "block_course_report")); echo html_writer::empty_tag("br"); echo html_writer::link($CFG->wwwroot, "(Clique aqui para voltar)"); echo html_writer::end_div(); echo $OUTPUT->footer(); } else{ //Pega ID do curso $courseid = optional_param_array('id', array(), PARAM_INT); //Pega ID do relatorio $rid = optional_param('rid', '0', PARAM_INT); $PAGE->set_url('/blocks/course_report/index.php'); $PAGE->set_context($context); $PAGE->set_pagelayout('report'); $PAGE->requires->js( new moodle_url($CFG->wwwroot . "/blocks/course_report/js/default.js")); $PAGE->set_title('Relatórios Customizados - EFAP'); print '<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>'; echo $OUTPUT->header(); if (count($DB->get_records('block_course_report_de')) == 0){ include ('ajax/carregade.php'); } if ($rid == 0){ print html_writer::tag('h4', 'Selecione o tipo de relatório'); print html_writer::start_tag('form', array('action' => 'index.php', 'method' => 'post')); print html_writer::tag('input', get_string('ratividades', 'block_course_report') . '<br>', array('type' => 'radio', 'value' => '1', 'name' => 'rid')); print html_writer::tag('input', get_string('rcursista', 'block_course_report') . '<br>', array('type' => 'radio', 'value' => '2', 'name' => 'rid')); print html_writer::tag('input', get_string('raprovacao', 'block_course_report') . '<br>', array('type' => 'radio', 'value' => '3', 'name' => 'rid')); print html_writer::tag('input', get_string('rcertificado', 'block_course_report') . '<br>', array('type' => 'radio', 'value' => '4', 'name' => 'rid')); print html_writer::empty_tag('hr'); print html_writer::tag('h4', 'Selecione o(s) curso(s)'); print html_writer::start_tag('select', array('name' => 'id[]', 'id' => 'slccurso', 'multiple' => '')); $lista_cursos = $DB->get_records('course', null, 'fullname ASC'); foreach($lista_cursos as $curso){ if ($curso->id != 1){ // if (count($courseid) > 0 && ($courseid[0] == $curso->id)) { // print html_writer::tag('option', $curso->fullname, array('value' => $curso->id, 'selected' => '')); // } // else{ print html_writer::tag('option', $curso->fullname, array('value' => $curso->id)); // } } } print html_writer::end_tag('select'); print html_writer::div('', 'carrega-turmas', array('id' => 'turmas')); print html_writer::empty_tag('input', array('type' => 'submit','name' => 'Gerar', 'value' => 'Gerar relatório')); print html_writer::end_tag('form'); } else{ $rel = new report(); print $rel->montaRelatorio($rid); } echo $OUTPUT->footer(); }