public function ranking_pesquisa_turma($pk_pesquisa_cat, $pk_serie, $pk_turma) { $data = $this->getParametroVisao(); $data['page'] = 'home'; $data['tema'] != '' ? $this->load->setTheme($data['tema']) : ''; $data['msg'] = $this->getMsg(); $data['abaAtiva'] = 8; $data['abaPage'] = 'ranking_pesquisa_turma'; $data['alias'] = 'ranking_pesquisa_turma'; $data['total'] = 0; $sqlGrade = new SqlGrade(); $result = $sqlGrade->get_turma($pk_turma); $data['turma_nome'] = $result[0]['turma_nome']; $data['migalha_pao'] = '<p> <a class="link" href="' . base_url() . 'fap/pesquisa/listar_pes_pesquisas">Índice</a> » <a class="link" href="' . base_url() . 'fap/pesquisa/ranking_pesquisa_cat/' . $this->uri->segment(4) . '">Ranking geral</a> » <a class="link" href="' . base_url() . 'fap/pesquisa/ranking_pesquisa/' . $this->uri->segment(4) . '/' . $this->uri->segment(5) . '">Ranking por série</a> » Ranking por turma </p>'; // INDICADORES GERAIS $sqlPesquisa = new SqlPesquisa(); $result = $sqlPesquisa->ranking_pesquisa_turma($pk_pesquisa_cat, $pk_turma, $data['ano_letivo']); $data['total'] = $result['total']; $tabela = ''; if ($result['total'] > 0) { $tabela .= '<table>'; $count = 0; foreach ($result['registros'] as $row) { $count++; $conceito = View::bgConceito($row['indicadorgeral']); $tabela .= '<tr>'; $tabela .= '<td class="' . $conceito['class'] . '">' . number_format($row['indicadorgeral'], 1) . '</td>'; $tabela .= '<td>' . $count . '</td>'; $tabela .= '<td><a rel="shadowbox[mixed]" class="link" href="' . base_url() . 'fap/pesquisa/graficos_pesquisa_fap/' . $row['fk_usuario'] . '/' . $row['fk_usuario_professor'] . '?pk_pesquisa=' . $row['fk_pesquisa'] . '&shadowbox=1">' . $row['nome'] . '</a></td>'; $tabela .= '<td>' . $row['materia_nome'] . '</td>'; $tabela .= '</tr>'; $indicador_geral = $row['conceito_geral']; } $tabela .= '</table>'; $conceito = View::bgConceito($indicador_geral); $data['indicador_geral'] = '<div class="' . $conceito['class'] . ' padding10 tcenter">' . number_format($indicador_geral, 1) . ' (' . $conceito['conceito'] . ')</div>'; $data['ranking_geral'] = $tabela; } else { $data['msg'] = '<div class="alert atencao">Nenhum registro encontrado</div>'; } // INDICADORES POR ÁREA // indicador de conteúdo $sqlPesquisa = new SqlPesquisa(); $result = $sqlPesquisa->ranking_pesquisa_indicador_especifico($pk_pesquisa_cat, $pk_turma, $data['ano_letivo'], 1); foreach ($result as $row) { $indicador_conteudo = $row['indicador']; break; } $conceito = View::bgConceito($indicador_conteudo); $data['indicador_conteudo'] = '<div class="' . $conceito['class'] . ' padding10 tcenter">' . number_format($indicador_conteudo, 1) . ' (' . $conceito['conceito'] . ')</div>'; // indicador de assiduidade $sqlPesquisa = new SqlPesquisa(); $result = $sqlPesquisa->ranking_pesquisa_indicador_especifico($pk_pesquisa_cat, $pk_turma, $data['ano_letivo'], 2); foreach ($result as $row) { $indicador_assiduidade = $row['indicador']; break; } $conceito = View::bgConceito($indicador_assiduidade); $data['indicador_assiduidade'] = '<div class="' . $conceito['class'] . ' padding10 tcenter">' . number_format($indicador_assiduidade, 1) . ' (' . $conceito['conceito'] . ')</div>'; // indicador de disciplina $sqlPesquisa = new SqlPesquisa(); $result = $sqlPesquisa->ranking_pesquisa_indicador_especifico($pk_pesquisa_cat, $pk_turma, $data['ano_letivo'], 3); foreach ($result as $row) { $indicador_disciplina = $row['indicador']; break; } $conceito = View::bgConceito($indicador_disciplina); $data['indicador_disciplina'] = '<div class="' . $conceito['class'] . ' padding10 tcenter">' . number_format($indicador_disciplina, 1) . ' (' . $conceito['conceito'] . ')</div>'; // indicador de envolvimento $sqlPesquisa = new SqlPesquisa(); $result = $sqlPesquisa->ranking_pesquisa_indicador_especifico($pk_pesquisa_cat, $pk_turma, $data['ano_letivo'], 4); foreach ($result as $row) { $indicador_envolvimento = $row['indicador']; break; } $conceito = View::bgConceito($indicador_envolvimento); $data['indicador_envolvimento'] = '<div class="' . $conceito['class'] . ' padding10 tcenter">' . number_format($indicador_envolvimento, 1) . ' (' . $conceito['conceito'] . ')</div>'; // RANKING POR CONTEÚDO $sqlPesquisa = new SqlPesquisa(); $result = $sqlPesquisa->ranking_pesquisa_indicador($pk_pesquisa_cat, $pk_turma, $data['ano_letivo'], 1); $tabela = '<table>'; $count = 0; foreach ($result['registros'] as $row) { $count++; $conceito = View::bgConceito($row['indicador']); $tabela .= '<tr>'; $tabela .= '<td class="' . $conceito['class'] . '">' . number_format($row['indicador'], 1) . '</td>'; $tabela .= '<td>' . $count . '</td>'; $tabela .= '<td>' . $row['nome'] . '</td>'; $tabela .= '</tr>'; } $tabela .= '</table>'; $data['ranking_conteudo'] = $tabela; // RANKING POR ASSIDUIDADE $sqlPesquisa = new SqlPesquisa(); $result = $sqlPesquisa->ranking_pesquisa_indicador($pk_pesquisa_cat, $pk_turma, $data['ano_letivo'], 2); $tabela = '<table>'; $count = 0; foreach ($result['registros'] as $row) { $count++; $conceito = View::bgConceito($row['indicador']); $tabela .= '<tr>'; $tabela .= '<td class="' . $conceito['class'] . '">' . number_format($row['indicador'], 1) . '</td>'; $tabela .= '<td>' . $count . '</td>'; $tabela .= '<td>' . $row['nome'] . '</td>'; $tabela .= '</tr>'; } $tabela .= '</table>'; $data['ranking_assiduidade'] = $tabela; // RANKING POR DISCIPLINA $sqlPesquisa = new SqlPesquisa(); $result = $sqlPesquisa->ranking_pesquisa_indicador($pk_pesquisa_cat, $pk_turma, $data['ano_letivo'], 3); $tabela = '<table>'; $count = 0; foreach ($result['registros'] as $row) { $count++; $conceito = View::bgConceito($row['indicador']); $tabela .= '<tr>'; $tabela .= '<td class="' . $conceito['class'] . '">' . number_format($row['indicador'], 1) . '</td>'; $tabela .= '<td>' . $count . '</td>'; $tabela .= '<td>' . $row['nome'] . '</td>'; $tabela .= '</tr>'; } $tabela .= '</table>'; $data['ranking_disciplina'] = $tabela; // RANKING POR ENVOLVIMENTO $sqlPesquisa = new SqlPesquisa(); $result = $sqlPesquisa->ranking_pesquisa_indicador($pk_pesquisa_cat, $pk_turma, $data['ano_letivo'], 4); $tabela = '<table>'; $count = 0; foreach ($result['registros'] as $row) { $count++; $conceito = View::bgConceito($row['indicador']); $tabela .= '<tr>'; $tabela .= '<td class="' . $conceito['class'] . '">' . number_format($row['indicador'], 1) . '</td>'; $tabela .= '<td>' . $count . '</td>'; $tabela .= '<td>' . $row['nome'] . '</td>'; $tabela .= '</tr>'; } $tabela .= '</table>'; $data['ranking_envolvimento'] = $tabela; // Select turmas $sqlPesquisa = new SqlPesquisa(); $result = $sqlPesquisa->ranking_pesquisa_cat_fitro_turma($pk_pesquisa_cat, $pk_serie, $data['ano_letivo']); $turma = explode("&pk_turma=", $_SERVER['QUERY_STRING']); $turma_url = base_url() . $this->uri->segment(1) . '/' . $this->uri->segment(2) . '/' . $this->uri->segment(3) . '/' . $this->uri->segment(4) . '?' . $turma[0]; $select = '<select name="jumpMenu" id="jumpMenu" class="w300 mb20" onchange="MM_jumpMenu(\'parent\',this,0)">'; $label_default = isset($_GET['pk_turma']) ? 'Retirar filtro de turma' : 'Filtrar por turma'; $select .= '<option value="' . $turma_url . '">' . $label_default . '</option>'; foreach ($result['registros'] as $row) { $checked = $this->uri->segment(6) == $row['fk_turma'] ? 'selected' : ''; $select .= '<option value="' . base_url() . $this->uri->segment(1) . '/' . $this->uri->segment(2) . '/ranking_pesquisa_turma/' . $this->uri->segment(4) . '/' . $this->uri->segment(5) . '/' . $row['fk_turma'] . '" ' . $checked . '>' . $row['turma_nome'] . '</option>'; } $select .= '</select>'; $data['filtro_turmas'] = $select; if ($this->input->is_ajax_request()) { echo json_encode(array('content' => $this->load->view($this->uri->segment(3), $data, true))); } else { $this->load->view($this->load->getUrlTema(), $data); } }