public function acompanhamento_turma_detalhe() { $data = $this->getParametroVisao(); $data['abaAtiva'] = 7; $data['abaPage'] = $data['alias'] = $data['page'] = __FUNCTION__; $data['page'] = 'home'; $data['tema'] != '' ? $this->load->setTheme($data['tema']) : ''; $data['msg'] = $this->getMsg(); $data['total'] = 0; $data['pk_livro'] = (int) filter_input(INPUT_GET, 'pk_livro', FILTER_VALIDATE_INT); $data['pk_turma'] = (int) filter_input(INPUT_GET, 'pk_turma', FILTER_VALIDATE_INT); $data['pk_serie'] = (int) filter_input(INPUT_GET, 'pk_serie', FILTER_VALIDATE_INT); $data['pk_unidade'] = (int) filter_input(INPUT_GET, 'pk_unidade', FILTER_VALIDATE_INT); $data['ano_letivo'] = isset($_GET['ano']) ? (int) filter_input(INPUT_GET, 'ano_letivo', FILTER_VALIDATE_INT) : $data['ano_letivo']; $data['get_shadowbox'] = View::shadowbox($data['shadowbox']); $config['base_url'] = base_url() . $this->uri->segment(1) . '/' . $this->uri->segment(2) . '/' . $this->uri->segment(3) . '?' . $data['get_shadowbox']; $sqlAulas = new SqlAulas(); $data['livro'] = $sqlAulas->get_livros_geral($data['ano_letivo'], $data['pk_serie']); $livro = explode("&pk_livro=", $_SERVER['QUERY_STRING']); $data['livro_url'] = $config['base_url'] . substr($livro[0], 12); if (isset($_GET['pk_livro'])) { $sqlAulas = new SqlAulas(); $result = $sqlAulas->get_percentual($data['pk_livro'], date('Y-m-d')); $percentual = !empty($result[0]['percentual']) ? $result[0]['percentual'] : 0; if ($data['idTipoUsuario'] == 1 || $data['idTipoUsuario'] == 2 || $data['idTipoUsuario'] == 3 || $data['idTipoUsuario'] == 15) { $sqlGrade = new SqlGrade(); $data['turma'] = $sqlGrade->filtro_turmas($data['pk_unidade'], $data['pk_serie'], $data['ano_letivo']); $turma = explode("&pk_turma=", $_SERVER['QUERY_STRING']); $data['turma_url'] = $config['base_url'] . substr($turma[0], 12); } $status = explode("&status=", $_SERVER['QUERY_STRING']); $data['status_url'] = $config['base_url'] . substr($status[0], 12); if (isset($_GET['pk_turma'])) { $sqlLivro = new SqlLivro(); $result = $sqlLivro->get_materias_apostilas_turma($data['pk_livro']); $data['total'] = count($result); if ($data['total'] > 0) { $count = 0; $html = '<table class="tabela_relatorio mt20"><tr> <td class="titulo_relatorio tcenter" nowrap="nowrap"><strong>Disciplina</strong></td> <td class="titulo_relatorio tcenter"><strong>Professor(a)</strong></td> <td class="titulo_relatorio tcenter"><strong>Aulas dadas</strong></td> <td class="titulo_relatorio tcenter"><strong>Última aula</strong></td> <td class="titulo_relatorio tcenter"><strong>Conteúdos programáticos em andamento na última aula</strong></td> <td class="titulo_relatorio tcenter w100"><strong>Planejamento executado</strong></td>'; $cor = ''; foreach ($result as $row) { $sqlLivro = new SqlLivro(); $result = $sqlLivro->get_apostila_acompanhamento($row['fk_materia_vin'], $_GET['pk_turma'], $_GET['pk_livro']); $conteudo = !empty($result) != '' ? $result[0]['capitulo_sequencial'] . ': ' . $result[0]['capitulo_nome'] . '<br/>Tópico ' . $result[0]['topico'] . ': ' . $result[0]['conteudo_nome'] . ' - pag(s): ' . $result[0]['paginas_trabalhadas'] : ''; $percentual = !empty($result) != '' ? number_format($result[0]['percentual_professor'], 1) . '%' : ''; $aula = !empty($result) != '' ? $result[0]['aula'] : ''; $data_aula = !empty($result) != '' ? View::converteDataBr($result[0]['data_aula']) : ''; if ($data['idTipoUsuario'] == 1 || $data['idTipoUsuario'] == 2 || $data['idTipoUsuario'] == 3 || $data['idTipoUsuario'] == 15) { $nome = !empty($result) != '' ? '<a rel="shadowbox" class="link" href="' . base_url() . 'aula/conteudos/edicao_conteudos' . '?shadowbox=1' . '&pk_materia_vin=' . $result[0]['fk_materia_vin'] . '&pk_usuario_professor=' . $result[0]['fk_usuario_professor'] . '&pk_turma=' . $data['pk_turma'] . '&pk_livro=' . $data['pk_livro'] . '">' . $result[0]['nome'] . '</a>' : ''; } else { $nome = !empty($result) != '' ? $result[0]['nome'] : ''; } if (!empty($result)) { $percent_media_geral = Matematica::divisao($result[0]['percentual_professor'], $percentual); if ($percent_media_geral < 0.8) { $cor = 'vermelho'; } else { if ($percent_media_geral > 1.2) { $cor = 'azul'; } else { $cor = 'verde'; } } } $statusCor = ''; $status = ''; if (!empty($result)) { if ($result[0]['status'] == 1) { $status = "Em andamento"; $statusCor = "status1"; } else { if ($result[0]['status'] == 2) { $status = "Concluído"; $statusCor = "status2"; } else { if ($result[0]['status'] == 3) { $status = "Revisado"; $statusCor = "status3"; } else { $status = ""; $statusCor = ""; } } } } if (isset($_GET['status'])) { if ($_GET['status'] == 1 && isset($percent_media_geral) && $percent_media_geral < 0.8 && $conteudo != '') { $html .= '<tr><td class="status">' . $row['materia_nome'] . '</td>'; $html .= '<td class="status">' . $nome . '</td>'; $html .= '<td class="tcenter status">' . $aula . '</td>'; $html .= '<td class="tcenter status">' . $data_aula . '</td>'; $html .= '<td class="status">' . $conteudo . '</td>'; $html .= '<td class="status ' . $cor . '">' . $percentual . '</td>'; } else { if ($_GET['status'] == 2 && isset($percent_media_geral) && $percent_media_geral >= 0.8 && $percent_media_geral <= 1.2 && $conteudo != '') { $html .= '<tr><td class="status">' . $row['materia_nome'] . '</td>'; $html .= '<td class="status">' . $nome . '</td>'; $html .= '<td class="tcenter status">' . $aula . '</td>'; $html .= '<td class="tcenter status">' . $data_aula . '</td>'; $html .= '<td class="status">' . $conteudo . '</td>'; $html .= '<td class="status ' . $cor . '">' . $percentual . '</td>'; } else { if ($_GET['status'] == 3 && isset($percent_media_geral) && $percent_media_geral > 1.2 && $conteudo != '') { $html .= '<tr><td class="status">' . $row['materia_nome'] . '</td>'; $html .= '<td class="status">' . $nome . '</td>'; $html .= '<td class="tcenter status">' . $aula . '</td>'; $html .= '<td class="tcenter status">' . $data_aula . '</td>'; $html .= '<td class="status">' . $conteudo . '</td>'; $html .= '<td class="status ' . $cor . '">' . $percentual . '</td>'; } } } } else { $html .= '<tr><td class="status">' . $row['materia_nome'] . '</td>'; $html .= '<td class="status">' . $nome . '</td>'; $html .= '<td class="tcenter status">' . $aula . '</td>'; $html .= '<td class="tcenter status">' . $data_aula . '</td>'; $html .= '<td class="status">' . $conteudo . '</td>'; $html .= '<td class="status tcenter ' . $cor . '">' . $percentual . '</td>'; } } $html .= '</tr></table>'; $data['html'] = $html; } else { $data['msg'] = '<div class="alert atencao">Não há registros com o parâmetro selecionado.</div>'; } } } if ($this->input->is_ajax_request()) { $this->load->view($this->uri->segment(3), $data); } else { $this->load->view($this->load->getUrlTema(), $data); } }
/** * Método que exibe os conteúdos do professor distribuídos no mes * @param int $pk_usuario_professor * @param int $pk_materia_vin * @param int $pk_turma * @param int $pk_livro */ public function calendario_conteudos_professor($pk_usuario_professor, $pk_materia_vin, $pk_turma, $pk_livro) { $data = $this->getParametroVisao(); $data['abaAtiva'] = 7; $data['abaPage'] = $data['alias'] = $data['page'] = __FUNCTION__; $data['page'] = 'home'; $data['msg'] = $this->getMsg(); $data['get_shadowbox'] = View::shadowbox($data['shadowbox']); $config['base_url'] = base_url() . $this->uri->segment(1) . '/' . $this->uri->segment(2) . '/' . $this->uri->segment(3) . '?' . $data['get_shadowbox']; $data['css'] = array(0 => 'css/calendario.css'); $dataAula = isset($_GET['dia']) && $_GET['dia'] != '' ? $_GET['ano'] . '-' . $_GET['mes'] . '-' . $_GET['dia'] : date('Y-m-d'); $mes = isset($_GET['mes']) && $_GET['mes'] != '' ? $_GET['mes'] : date('m'); if ($_SERVER['REQUEST_METHOD'] == "POST") { try { //$this->input->post(); $this->session->set_flashdata('msg', '<div class="alert ok">Tópico editado com sucesso!</div>'); if (isset($_SESSION['pk_turma_cadastro_aula']) && !isset($_GET['shadowbox'])) { redirect(base_url() . 'aula/conteudos/cadastrar_conteudo_dados'); } else { redirect($data['urlAtual']); } return false; } catch (Exception $e) { $msg = '<p class="alert erro">' . $e->getMessage() . '</p>'; } } $sqlProfessor = new SqlUsuario(); $result = $sqlProfessor->get_nome_professor($pk_usuario_professor); $data['professor'] = $result[0]['nome']; // pega os dias do mês onde já foram incluídos registros $sqlAulas = new SqlAulas(); $result = $sqlAulas->listar_aula_calendario($pk_turma, $mes); // Envia o resultado da consulta para o calendário para que sejam marcados os dias com registro $data['calendario'] = Calendario_aulas::MostreCalendario($mes, $result, $data['ano_letivo']); // $result = $sqlAulas->listar_aula($pk_turma, 0, 0, $dataAula); // $data['registros'] = $result['registros']; // $tabela = ''; // if ($result['total'] > 0) { // $tabela .= '<table id="aulas">'; // // foreach ($result['registros'] as $row) { // $tabela .= '<tr>'; // $tabela .= '<td class="aulas_conteudos w300"><div class="ordem">' . $row['ordem'] . '</div>'; // $tabela .= '<div class="dados_cabecalho">'; // if (($row['falta'] == 6) || ($row['falta'] == 7)) { // Se a aula foi vaga ou foi substituída por alguma ação da coordenação // $tabela .= '<p><strong>Disciplina:</strong> ' . $row['materia_nome'] . '</p>'; // $tabela .= '<p><strong>Professor(a):</strong> ' . $row['professor_nome'] . '</p>'; // } else { // Se houve a aula // $tabela .= '<p><strong>Disciplina:</strong> ' . $row['materia_nome'] . '</p>'; // $tabela .= '<p><strong>Professor(a):</strong> ' . $row['professor_nome'] . '</p>'; // } // $tabela .= '<p><strong>Horário:</strong> ' . substr($row['hora_inicio'], 0, 5) . ' às ' . substr($row['hora_fim'], 0, 5) . '</p>'; // $tabela .= '</div></td>'; // fim de dados_cabecalho // $tabela .= '<td class="aulas_conteudos">'; // // if (is_int($row['fk_livro']) && ($row['fk_livro'] > 0) && (is_int($row['aula']) && ($row['aula'] > 0))) { // // $result = $sqlAulas->get_conteudos_apostilas($row['fk_usuario_professor'], $pk_turma, $dataAula, $row['aula']); // $conteudo = ''; // foreach ($result as $item){ // if ($item['status'] == 1) { // $status_nome = ' (em andamento)'; // } // else if ($item['status'] == 2) { // $status_nome = ' (concluído)'; // } // else if ($item['status'] == 3) { // $status_nome = ' (revisado)'; // } // else { // $status_nome = ''; // } // $conteudo .= '<br /><strong>' . $item['capitulo_sequencial'] . '</strong>: ' . $item['capitulo_nome'] . '<br />'; // $conteudo .= '<strong>Assunto</strong>: ' . $item['conteudo_nome'] . ' - Páginas:' . $item['paginas_trabalhadas'] . $status_nome . '<br />'; // if ($item['exercicios_casa'] != ''){ // $conteudo .= '<strong>Exercícios propostos para casa</strong>: '.$item['exercicios_casa'] . '<br />'; // } // if ($item['exercicios_sala'] != ''){ // $conteudo .= '<strong>Exercícios em sala</strong>: '.$item['exercicios_sala'] . '<br />'; // } // } // $tabela .= $conteudo; // } else { // if ($row['capitulo'] != '') { // $tabela .= '<p><strong>Capítulo:</strong> ' . $row['capitulo'] . '</p>'; // } // if ($row['conteudos_livro_desc'] != '') { // $tabela .= '<p><strong>Conteúdo:</strong> ' . $row['conteudos_livro_desc'] . '</p>'; // } else { // $tabela .= '<p><strong>Conteúdo:</strong> ' . $row['conteudo'] . '</p>'; // } // if ($row['paginas'] != '') { // $tabela .= '<p><strong>Páginas:</strong> ' . $row['paginas'] . '</p>'; // } // if ($row['exercicios_sala'] != '') { // $tabela .= '<p><strong>Exercícios:</strong> ' . $row['exercicios_sala'] . '</p>'; // } // if ($row['exercicios_casa'] != '') { // $tabela .= '<p><strong>Exercícios propostos para casa:</strong> ' . $row['exercicios_casa'] . '</p>'; // } // if ($row['obs'] != '') { // $tabela .= '<p><strong>Observação:</strong> ' . $row['obs'] . '</p>'; // } // } // $tabela .= '</td>'; // } // $tabela .= '</table>'; // $resposta = $tabela; // } // else { // if ($data['mobile']) { // $resposta = '<div class="alert alert-info">Os conteúdos das aulas do dia selecionado não foram ainda incluídos no sistema.</div>'; // } // else { // $resposta = '<br class="clearfloat" /><div class="alert informacao">Os conteúdos das aulas do dia selecionado não foram ainda incluídos no sistema.</a>'; // } // } // // $data['aulas_conteudo'] = $resposta; // // $arrUnidades = array(1, 2, 3); // $arrSeries = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13); // // $sqlGrade = new SqlGrade(); // $result = $sqlGrade->lista_turmas($arrUnidades, $arrSeries, $data['ano_letivo']); // $turma_url = base_url() . $this->uri->segment(1) . '/' . $this->uri->segment(2) . '/' . $this->uri->segment(3); // // if (!isset($_GET['data_final'])) { //// $select = ''; //// $select .= '<select name="pk_turma" class="w280" onchange="document.'.$data['alias'].'.submit()">'; //// $label_default = isset($_GET['pk_turma']) ? 'Retirar filtro de turma' : ''; //// $select .= '<option value="'.$turma_url.'">'.$label_default.'</option>'; //// foreach ($result as $row) //// { //// $checked = $this->uri->segment(4) == $row['pk_turma'] ? 'selected' : ''; //// $select .= '<option value="'.$row['pk_turma'].'" '.$checked.'>'.$row['turma_nome'].'</option>'; //// } //// $select .= '</select>'; //// $data['filtro_turmas'] = $select; // // $select = ''; // $select .= '<select name="pk_turma" class="w280" onchange="document.' . $data['alias'] . '.submit()">'; // $label_default = isset($_GET['pk_turma']) ? 'Retirar filtro de turma' : ''; // $select .= '<option value="' . $turma_url . '">' . $label_default . '</option>'; // foreach ($result as $row) { // $checked = $this->uri->segment(4) == $row['pk_turma'] ? 'selected' : ''; // $select .= '<option value="' . $row['pk_turma'] . '" ' . $checked . '>' . $row['turma_nome'] . '</option>'; // } // $select .= '</select>'; // $data['filtro_turmas'] = $select; // } $this->load->view($this->load->getUrlTema(), $data); }