コード例 #1
0
ファイル: tema.php プロジェクト: andersongimino/area51
     $this->load->library('util');
     $data['redirect_delay'] = $this->util->redirect_delay(1, 'redigge/tema/notas/' . $tipo . '/' . $fk_redigge, 1);
     $this->load->view($this->load->getUrlTema(), $data);
 }
 public function notas($tipo, $fk_redigge)
 {
     $data = $this->getParametroVisao();
     $data['print'] = filter_input(INPUT_GET, 'print', FILTER_VALIDATE_INT);
     $data['page'] = 'home';
     $data['tema'] != '' ? $this->load->setTheme($data['tema']) : '';
     $data['abaAtiva'] = 21;
     $data['abaPage'] = 'notas';
     $data['alias'] = 'notas';
     $sqlRedigge = new SqlRedigge();
     $result = $sqlRedigge->get_tema($fk_redigge);
     $tipo = $result[0]['tipo'] == 1 ? 'Ensino Fundamental' : 'Ensino Médio';
     $_SESSION['tema_titulo'] = $result[0]['titulo'] . ' (' . $tipo . ')';
     $sqlRedigge = new SqlRedigge();
     $result = $sqlRedigge->listar_notas($tipo, $fk_redigge, $data['ano_letivo']);
     $data['total'] = $result['total'];
     if ($result['total'] > 0) {
         $sqlRedigge = new SqlRedigge();
         $resultado = $sqlRedigge->checa_processamento_tema($fk_redigge);
         if (empty($resultado)) {
             redirect(base_url() . 'redigge/tema/processar_tema/' . $this->uri->segment(4) . '/' . $fk_redigge);
         }
     }
     if ($result['total'] > 0) {
         $this->load->library('table');
         $arrHead[] = 'Posição<br />geral';
         $arrHead[] = 'Posição<br />unidade';
         $arrHead[] = 'Posição<br />série';
         $arrHead[] = 'Posição<br />turma';
         $arrHead[] = 'Alunos';
         $arrHead[] = 'Turmas';
         $arrHead[] = 'Notas';
         $_SESSION['posicao_redacao'] = 0;
         if ($data['idTipoUsuario'] == 1 || $data['idTipoUsuario'] == 2 || $data['idTipoUsuario'] == 3) {
             $arrHead[] = '';
         }
         $this->table->set_heading($arrHead);
         $count = 0;
         foreach ($result['registros'] as $row) {
             $count++;
             $tmpl = Util::zebrar($count, count($result['registros']));
             if ($data['idTipoUsuario'] == 1 || $data['idTipoUsuario'] == 2 || $data['idTipoUsuario'] == 3) {
                 $cell_1 = array('data' => $row['ranking_geral'], 'class' => 'tcenter');
                 $cell_2 = array('data' => $row['ranking_unidade'], 'class' => 'tcenter');
                 $cell_3 = array('data' => $row['ranking_serie'], 'class' => 'tcenter');
                 $cell_4 = array('data' => $row['ranking_turma'], 'class' => 'tcenter');
                 $notas = array('data' => $row['nota'], 'class' => 'tcenter');
                 $this->table->add_row($cell_1, $cell_2, $cell_3, $cell_4, $row['nome'], $row['turma_nome'], $notas, '<a href="' . base_url() . $this->uri->segment(1) . '/' . $this->uri->segment(2) . '/excluir_aluno" ' . View::getParamExcluirItemTabela($row['fk_redigge'], $row['fk_usuario'], 0, '', 'Excluir aluno', 'Deseja excluir o usuário ' . $row['nome'] . '') . '   class="excluirItemTabela"><div class="tooltip icon_delete" data-tooltip="Exclusão"></div></a>');
             } else {
                 $this->table->add_row($dataEnvio, $titulo, $vencedor);
             }
             $_SESSION['posicao_redacao'] = $row['nota'];
         }
         $this->table->set_template($tmpl);
     } else {
         $data['msg'] = '<div class="alert informacao">Não há ainda alunos incluídos no tema escolhido.</div>';
     }
     $config['base_url'] = base_url() . $this->uri->segment(1) . '/' . $this->uri->segment(2) . '/' . $this->uri->segment(3) . '/';