protected function fixupValidation($inputOptions) { // fixup para remover caracteres não numericos // inclusive pontos '.', não removidos pela super classe $js = " \$j('#" . $inputOptions['id'] . "').keyup(function(){\n var oldValue = this.value;\n\n this.value = this.value.replace(/[^0-9\\.]/g, '');\n this.value = this.value.replace('.', '');\n\n if (oldValue != this.value)\n messageUtils.error('Informe apenas números.', this);\n\n });"; Portabilis_View_Helper_Application::embedJavascript($this->viewInstance, $js, $afterReady = false); }
protected function _preRender() { Portabilis_View_Helper_Application::loadStylesheet($this, 'intranet/styles/localizacaoSistema.css'); $localizacao = new LocalizacaoSistema(); $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "Início", "educar_index.php" => "i-Educar - Escola", "" => "Detalhe da regra de avaliaçõo")); $this->enviaLocalizacao($localizacao->montar()); }
protected function _preRender() { parent::_preRender(); Portabilis_View_Helper_Application::loadStylesheet($this, 'intranet/styles/localizacaoSistema.css'); $localizacao = new LocalizacaoSistema(); $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "Início", "educar_index.php" => "i-Educar - Escola", "" => "Listagem de áreas de conhecimento")); $this->enviaLocalizacao($localizacao->montar()); }
protected function _preRender() { parent::_preRender(); Portabilis_View_Helper_Application::loadStylesheet($this, 'intranet/styles/localizacaoSistema.css'); $localizacao = new LocalizacaoSistema(); $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "Início", "educar_biblioteca_index.php" => "i-Educar - Biblioteca", "" => "Relatório de obras")); $this->enviaLocalizacao($localizacao->montar()); }
protected function fixupOptions($inputOptions) { $id = $inputOptions['id']; $sizeFixup = "\$input.attr('size', " . $inputOptions['size'] . ");"; $disableFixup = $inputOptions['disabled'] ? "\$input.attr('disabled', 'disabled');" : ''; $script = "\n var \$input = \$j('#" . $id . "');\n {$sizeFixup}\n {$disableFixup}\n "; Portabilis_View_Helper_Application::embedJavascript($this->viewInstance, $script, $afterReady = true); }
protected function _preRender() { parent::_preRender(); Portabilis_View_Helper_Application::loadStylesheet($this, 'intranet/styles/localizacaoSistema.css'); $localizacao = new LocalizacaoSistema(); $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "Início", "educar_index.php" => "i-Educar - Escola", "" => "Emissão de atestado de frequência")); $this->enviaLocalizacao($localizacao->montar()); }
protected function _preRender() { parent::_preRender(); Portabilis_View_Helper_Application::loadStylesheet($this, 'intranet/styles/localizacaoSistema.css'); $nomeMenu = $this->getRequest()->id == null ? "Cadastrar" : "Editar"; $localizacao = new LocalizacaoSistema(); $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "Início", "educar_index.php" => "i-Educar - Escola", "" => "{$nomeMenu} área de conhecimento")); $this->enviaLocalizacao($localizacao->montar()); }
public function Gerar() { Portabilis_View_Helper_Application::loadStylesheet($this, '/modules/HistoricoEscolar/Static/styles/processamento.css'); $this->inputsHelper()->dynamic(array('ano', 'instituicao', 'escola')); $this->inputsHelper()->dynamic(array('curso', 'serie', 'turma', 'matricula'), array('required' => false)); $resourceOptionsTable = "<table id='resource-options' class='styled horizontal-expand hide-on-search disable-on-apply-changes'>\r\n\r\n <tr>\r\n <td><label for='dias-letivos'>Quantidade dias letivos *</label></td>\r\n <td colspan='2'><input type='text' id='dias-letivos' name='quantidade-dias-letivos' class='obrigatorio disable-on-search clear-on-change-curso validates-value-is-numeric'></input></td>\r\n </tr>\r\n\r\n <tr>\r\n <td><label for='grade-curso'>Grade curso *</label></td>\r\n <td>{$this->getSelectGradeCurso()}</td>\r\n </tr>\r\n\r\n <tr>\r\n <td><label for='percentual-frequencia'>% Frequência *</label></td>\r\n <td>\r\n <select id='percentual-frequencia' class='obrigatorio disable-on-search'>\r\n <option value=''>Selecione</option>\r\n <option value='buscar-boletim'>Usar do boletim</option>\r\n <option value='informar-manualmente'>Informar manualmente</option>\r\n </select>\r\n </td>\r\n <td><input id='percentual-frequencia-manual' name='percentual-frequencia-manual' style='display:none;'></input></td>\r\n </tr>\r\n\r\n <tr>\r\n <td><label for='situacao'>Situação *</label></td>\r\n <td colspan='2'>\r\n <select id='situacao' class='obrigatorio disable-on-search'>\r\n <option value=''>Selecione</option>\r\n <option value='buscar-matricula'>Usar do boletim</option>\r\n <option value='em-andamento'>Em andamento</option>\r\n <option value='aprovado'>Aprovado</option>\r\n <option value='reprovado'>Reprovado</option>\r\n <option value='transferido'>Transferido</option>\r\n </select>\r\n </td>\r\n </tr>\r\n\r\n <tr>\r\n <td><label for='disciplinas'>Disciplinas *</label></td>\r\n <td>\r\n <select id='disciplinas' name='disciplinas' class='obrigatorio disable-on-search'>\r\n <option value=''>Selecione</option>\r\n <option value='buscar-boletim'>Usar do boletim</option>\r\n <option value='informar-manualmente'>Informar manualmente</option>\r\n </select>\r\n </td>\r\n <td>\r\n <table id='disciplinas-manual' style='display:none;'>\r\n <tr>\r\n <th>Nome</th>\r\n <th>Nota</th>\r\n <th>Falta</th>\r\n <th>Ação</th>\r\n </tr>\r\n <tr class='disciplina'>\r\n <td><input class='nome obrigatorio disable-on-search change-state-with-parent' style='display:none;'></input></td>\r\n <td><input class='nota' ></input></td>\r\n <td>\r\n <input class='falta validates-value-is-numeric'></input>\r\n </td>\r\n <td>\r\n <a class='remove-disciplina-line' href='#'>Remover</a>\r\n </td>\r\n </tr>\r\n <tr class='actions'>\r\n <td colspan='4'>\r\n <input type='button' class='action' id='new-disciplina-line' name='new-line' value='Adicionar nova'></input>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n\r\n <tr>\r\n <td><label for='notas'>Notas *</label></td>\r\n <td>\r\n <select id='notas' class='obrigatorio disable-on-search disable-and-hide-wen-disciplinas-manual'>\r\n <option value=''>Selecione</option>\r\n <option value='buscar-boletim'>Lançadas no boletim</option>\r\n <option value='AP'>AP</option>\r\n <option value='informar-manualmente'>Informar manualmente</option>\r\n </select>\r\n </td>\r\n <td><input id='notas-manual' name='notas-manual' style='display:none;'></input></td>\r\n </tr>\r\n\r\n <tr>\r\n <td><label for='faltas'>Faltas *</label></td>\r\n <td>\r\n <select id='faltas' class='obrigatorio disable-on-search disable-and-hide-wen-disciplinas-manual'>\r\n <option value=''>Selecione</option>\r\n <option value='buscar-boletim'>Lançadas no boletim</option>\r\n <option value='informar-manualmente'>Informar manualmente</option>\r\n </select>\r\n </td>\r\n <td><input id='faltas-manual' name='faltas-manual' style='display:none;'></input></td>\r\n </tr>\r\n\r\n <tr>\r\n <td><label for='registro'>Registro (arquivo)</label></td>\r\n <td colspan='2'><input type='text' id='registro' name='registro'></input></td>\r\n </tr>\r\n\r\n <tr>\r\n <td><label for='livro'>Livro</label></td>\r\n <td colspan='2'><input type='text' id='livro' name='livro'></input></td>\r\n </tr>\r\n\r\n <tr>\r\n <td><label for='dias-letivos'>Folha</label></td>\r\n <td colspan='2'><input type='text' id='folha' name='folha'></input></td>\r\n </tr>\r\n\r\n <tr>\r\n <td><label for='observacao'>Observação</label></td>\r\n <td colspan='2'><textarea id='observacao' name='observacao' cols='60' rows='5'></textarea></td>\r\n </tr>\r\n\r\n <tr>\r\n <td><label for='extra-curricular'>Extra curricular</label></td>\r\n <td colspan='2'><input type='checkbox' id='extra-curricular' name='extra-curricular'></input></td>\r\n </tr>\r\n\r\n </table>"; $this->appendOutput($resourceOptionsTable); Portabilis_View_Helper_Application::loadJQueryUiLib($this); Portabilis_View_Helper_Application::loadJavascript($this, array('/modules/Portabilis/Assets/Javascripts/Utils.js', '/modules/Portabilis/Assets/Javascripts/Frontend/Inputs/SimpleSearch.js', '/modules/HistoricoEscolar/Static/scripts/processamento.js')); }
public function checkbox($attrName, $options = array()) { $defaultOptions = array('options' => array(), 'objectName' => ''); $options = $this->mergeOptions($options, $defaultOptions); $spacer = !empty($options['objectName']) && !empty($attrName) ? '_' : ''; $defaultInputOptions = array('id' => $options['objectName'] . $spacer . $attrName, 'label' => ucwords($attrName), 'value' => '', 'label_hint' => '', 'inline' => false, 'script' => 'fixupCheckboxValue(this)', 'disabled' => false); $inputOptions = $this->mergeOptions($options['options'], $defaultInputOptions); // fixup para enviar um valor, junto ao param do checkbox. $js = "var fixupCheckboxValue = function(input) {\n var \$this = \$j(input);\n \$this.val(\$this.is(':checked') ? 'on' : '');\n }"; Portabilis_View_Helper_Application::embedJavascript($this->viewInstance, $js, $afterReady = false); call_user_func_array(array($this->viewInstance, 'campoCheck'), $inputOptions); }
protected function js($objectName, $attrName, $options) { // setup multiple search /* all search options (including the option chosenOptions, that is passed for chosen plugin), can be overwritten adding "var = multipleSearch<ObjectName>Options = { 'options' : 'val', option2 : '_' };" in the script file for the resource controller. */ $resourceOptions = "multipleSearch" . Portabilis_String_Utils::camelize($objectName) . "Options"; $js = "{$resourceOptions} = typeof {$resourceOptions} == 'undefined' ? {} : {$resourceOptions};\n multipleSearchHelper.setup('{$objectName}', '{$attrName}', '" . $options['searchPath'] . "', {$resourceOptions});"; // this script will be executed after the script for the current controller (if it was loaded in the view); Portabilis_View_Helper_Application::embedJavascript($this->viewInstance, $js, $afterReady = true); }
public function bibliotecaPesquisaCliente($options = array()) { $defaultOptions = array('id' => null, 'options' => array(), 'hiddenInputOptions' => array()); $options = $this->mergeOptions($options, $defaultOptions); $inputHint = "<img border='0' onclick='pesquisaCliente();' id='lupa_pesquisa_cliente' name='lupa_pesquisa_cliente' src='imagens/lupa.png' />"; // input $defaultInputOptions = array('id' => 'nome_cliente', 'label' => 'Cliente', 'value' => '', 'size' => '30', 'max_length' => '255', 'required' => true, 'expressao' => false, 'inline' => false, 'label_hint' => '', 'input_hint' => $inputHint, 'callback' => '', 'event' => 'onKeyUp', 'disabled' => true); $inputOptions = $this->mergeOptions($options['options'], $defaultInputOptions); call_user_func_array(array($this->viewInstance, 'campoTexto'), $inputOptions); // hidden input $defaultHiddenInputOptions = array('id' => 'ref_cod_cliente', 'value' => $this->getResourceId($options['id'])); $hiddenInputOptions = $this->mergeOptions($options['hiddenInputOptions'], $defaultHiddenInputOptions); call_user_func_array(array($this->viewInstance, 'campoOculto'), $hiddenInputOptions); // js Portabilis_View_Helper_Application::embedJavascript($this->viewInstance, ' var resetCliente = function(){ $("#ref_cod_cliente").val(""); $("#nome_cliente").val(""); } $("#ref_cod_biblioteca").change(resetCliente);', true); Portabilis_View_Helper_Application::embedJavascript($this->viewInstance, "\n function pesquisaCliente() {\n var additionalFields = getElementFor('biblioteca');\n var exceptFields = getElementFor('nome_cliente');\n\n if (validatesPresenseOfValueInRequiredFields(additionalFields, exceptFields)) {\n \t var bibliotecaId = getElementFor('biblioteca').val();\n var attrIdName = getElementFor('cliente').attr('id');\n\n\t pesquisa_valores_popless('educar_pesquisa_cliente_lst.php?campo1='+attrIdName+'&campo2=nome_cliente&ref_cod_biblioteca='+bibliotecaId);\n }\n }\n "); }
function RenderHTML() { $this->_preRender(); $this->bannerLateral = 'imagens/nvp_vert_intranet.jpg'; $this->titulo_barra = 'Intranet'; $this->Processar(); $retorno = ''; if ($this->banner) { $retorno .= "<table width='100%' style=\"height:100%\" border='0' cellpadding='0' cellspacing='0'><tr>"; $retorno .= "<td class=\"barraLateral\" width=\"21\" valign=\"top\"><a href='#'><img src=\"{$this->bannerLateral}\" align=\"right\" border=\"0\" alt=\"{$this->titulo_barra}\" title=\"{$this->titulo_barra}\"></a></td><td valign='top'>"; } $this->Gerar(); $script = explode("/", $_SERVER["PHP_SELF"]); $script = $script[count($script) - 1]; $this->nome_excluirImg = empty($this->nome_excluirImg) ? "Excluir Imagem" : $this->nome_excluirImg; $this->nome_url_cancelar = empty($this->nome_url_cancelar) ? "Cancelar" : $this->nome_url_cancelar; $this->nome_url_sucesso = empty($this->nome_url_sucesso) ? "Salvar" : $this->nome_url_sucesso; $width = empty($this->largura) ? "width='100%'" : "width='{$this->largura}'"; $retorno .= "\n<!-- cadastro begin -->\n"; $retorno .= "<form name='{$this->__nome}' id='{$this->__nome}' onsubmit='return {$this->onSubmit}' action='{$this->action}' method='post' target='{$this->target}' {$this->form_enctype}>\n"; $retorno .= "<input name='tipoacao' id='tipoacao' type='hidden' value='{$this->tipoacao}'>\n"; $retorno .= "<input name='__sequencia_fluxo' id='__sequencia_fluxo' type='hidden' value='{$this->__sequencia_fluxo}'>"; if ($this->campos) { reset($this->campos); while (list($nome, $componente) = each($this->campos)) { if ($componente[0] == 'oculto' || $componente[0] == 'rotulo') { $retorno .= "<input name='{$nome}' id='{$nome}' type='hidden' value='" . urlencode($componente[3]) . "'>\n"; } } } $retorno .= "<center>\n<table class='tablecadastro' {$width} border='0' cellpadding='2' cellspacing='0'>\n"; $titulo = $this->titulo ? $this->titulo : "<b>{$this->tipoacao} {$this->titulo_aplication}</b>"; /** * Adiciona os botoes de help para a pagina atual */ $url = parse_url($_SERVER['REQUEST_URI']); $url = ereg_replace('^/', '', $url['path']); if (strpos($url, '_det.php') !== FALSE) { $tipo = 'det'; } elseif (strpos($url, '_lst.php') !== FALSE) { $tipo = 'lst'; } elseif (strpos($url, '_pdf.php') !== FALSE) { $tipo = 'pdf'; } else { $tipo = 'cad'; } $barra = $titulo; // @todo Remover código, funcionalidade não existente. if (class_exists('clsPmiajudaPagina')) { $ajudaPagina = new clsPmiajudaPagina(); $lista = $ajudaPagina->lista(null, null, $url); if ($lista) { $barra = "\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n <tr>\n <script type=\"text/javascript\">document.help_page_index = 0;</script>\n <td width=\"20\"><a href=\"javascript:showExpansivelIframe(700,500,'ajuda_mostra.php?cod_topico={$lista[0]["ref_cod_topico"]}&tipo={$tipo}');\"><img src=\"imagens/banco_imagens/interrogacao.gif\" border=\"0\" alt=\"Botão de Ajuda\" title=\"Clique aqui para obter ajuda sobre esta página\"></a></td>\n <td>{$titulo}</td>\n <td align=\"right\"><a href=\"javascript:showExpansivelIframe(700,500,'ajuda_mostra.php?cod_topico={$lista[0]["ref_cod_topico"]}&tipo={$tipo}');\"><img src=\"imagens/banco_imagens/interrogacao.gif\" border=\"0\" alt=\"Botão de Ajuda\" title=\"Clique aqui para obter ajuda sobre esta página\"></a></td>\n </tr>\n </table>"; } } $retorno .= "<tr><td class='formdktd' colspan='2' height='24'>{$barra}</td></tr>"; $flashMessage = $this->flashMessage(); if (!empty($flashMessage)) { $retorno .= "<tr><td class='formmdtd' colspan='2' height='24'><div id='flash-container'>{$flashMessage}</div></td></tr>"; } if (empty($this->campos)) { $retorno .= "<tr><td class='linhaSim' colspan='2'><span class='form'>Não existe informação disponível</span></td></tr>"; } else { // Verifica se houve erros no controller $retorno .= $this->_getControllerErrors(); $retorno .= $this->MakeCampos(); } $retorno .= "<tr><td class='tableDetalheLinhaSeparador' colspan='2'></td></tr>\n <tr class='linhaBotoes'><td colspan='2' align='center'>\n <script type=\"text/javascript\">\n var goodIE = (document.all) ? 1:0;\n var netscape6 = (document.getElementById && !document.all) ? 1:0;\n var aux = '';\n var aberto = false;"; $retorno .= $this->MakeFormat(); $retorno .= "\n function setColor(color)\n { \n"; reset($this->campos); while (list($nome, $componente) = each($this->campos)) { $validador = $componente[4]; if (!empty($validador)) { if ($validador == 'cor') { $retorno .= "\n if (color) {\n document.{$this->__nome}.{$nome}.value = color;\n }\n document.getElementById('" . $nome . "1').style.background = '#' + document.{$this->__nome}.{$nome}.value; "; } } } $retorno .= "}\n"; $retorno .= "function acao(){ "; unset($this->campos['desabilitado_tab']); unset($this->campos['cabecalho_tab']); reset($this->campos); while (list($nome, $componente) = each($this->campos)) { $nomeCampo = $componente[0]; $validador = $componente[2]; if (empty($validador) && $nomeCampo == 'cpf' && ereg("^(tab_add_[0-9])", $nome) !== 1) { $retorno .= "if( document.getElementById('{$nome}').value != \"\")\n {\n if (! (/[0-9]{3}\\.[0-9]{3}\\.[0-9]{3}-[0-9]{2}/.test(document.getElementById('{$nome}').value) ) )\n {\n\n alert('Preencha o campo {$nome} Corretamente');\n return false;\n }else\n {\n if(! DvCpfOk( document.getElementById('{$nome}')) ) return false;\n }\n }"; } /** * Campo tabela */ if (ereg("^(tab_add_[0-9])", $nome) === 1) { $nome_campos = $componente['cabecalho']; $componente = array_shift($componente); unset($componente['oculto']); reset($componente); $ct_campo = 0; $retorno .= "for(var id_campo=0;id_campo<{$nome}.getId();id_campo++)\n{\n"; while (list($name, $componente_campo) = each($componente)) { $nomeCampo = $componente_campo[1]; $validador = $componente_campo[2]; if (!empty($validador)) { if ($componente_campo[0] == 'idFederal') { $campo = "document.getElementById(\"{$nomeCampo}[\"+id_campo+\"]\")"; $validador = explode('+', $validador); $retorno .= " if ("; $retorno .= "!({$validador[0]}.test( {$campo}.value ))) { \n"; $retorno .= "if( !({$validador[1]}.test( {$campo}.value ))) { "; $retorno .= " alert( 'Preencha o campo \\'{$nome_campos[$ct_campo]}\\' corretamente!' ); \n return false; }"; $retorno .= "else { if(! DvCnpjOk( {$campo}) ) return false; } }"; $retorno .= "else{ if(! DvCpfOk( {$campo}) ) return false; }"; } elseif ($componente_campo[0] != 'oculto') { $campo = "document.getElementById(\"{$nomeCampo}[\"+id_campo+\"]\")"; $fim_for = ""; if ($validador[0] == '*') { $validador = substr($validador, 1); $campo = "campos"; $retorno .= " var campos = document.getElementById('{$nomeCampo}['+id_campo+']');\n\n if(campos.value!='' &&\n "; } else { $retorno .= " \n if ("; } $retorno .= "!({$validador}.test( {$campo}.value )))\n"; $retorno .= "{\n"; $retorno .= " mudaClassName( 'formdestaque', 'obrigatorio' );\n"; $retorno .= " {$campo}.className = \"formdestaque\";\n"; $retorno .= " alert( 'Preencha o campo \\'" . extendChars($nome_campos[$ct_campo], true) . "\\' corretamente!' ); \n"; $retorno .= " {$campo}.focus(); \n"; $retorno .= " return false;\n"; $retorno .= "}\n{$fim_for}"; } if (!empty($nomeCampo)) { if ($nomeCampo == 'cpf') { $retorno .= " else { if(! DvCpfOk( document.getElementById('{$nomeCampo}['+id_campo+']')) ) return false; }"; } } if (!empty($nomeCampo)) { if ($nomeCampo == 'cnpj' || $nomeCampo == 'cnpj_pesq') { $retorno .= " else { if(document.getElementById('{$nomeCampo}['+id_campo+']').value != ''){ if(! DvCnpjOk( document.getElementById('{$nomeCampo}['+id_campo+']')) ) return false; }}"; } } } if (empty($validador) && $nomeCampo == 'cpf') { $retorno .= "if( document.getElementById('{$nomeCampo}['+id_campo+']').value != \"\") {\n if (! (/[0-9]{3}\\.[0-9]{3}\\.[0-9]{3}-[0-9]{2}/.test(document.getElementById('{$nomeCampo}['+id_campo+']').value))) {\n alert('Preencha o campo \\'{$nome_campos[$ct_campo]}\\' Corretamente');\n document.getElementById('{$nomeCampo}['+id_campo+']').focus();\n return false;\n }\n else {\n if (! DvCpfOk(document.getElementById('{$nomeCampo}['+id_campo+']'))) {\n document.getElementById('{$nomeCampo}['+id_campo+']').focus();\n return false;\n }\n }\n }"; } $ct_campo++; } $retorno .= "\n}\n"; continue; } if (!empty($validador)) { if ($validador == 'lat') { $retorno .= "if(!(/^-2[5-9]/.test( document.{$this->__nome}." . $nome . "_graus.value ))) { \n"; $retorno .= " alert( 'Preencha o campo \\'{$componente['1']}\\' corretamente!' ); \n"; $retorno .= " document.{$this->__nome}." . $nome . "_graus.focus(); \n"; $retorno .= " return false; } "; $retorno .= "if(!(/^([0-5])?[0-9]\$/.test( document.{$this->__nome}." . $nome . "_min.value ))) { \n"; $retorno .= " alert( 'Preencha o campo \\'{$componente['1']}\\' corretamente!' ); \n"; $retorno .= " document.{$this->__nome}." . $nome . "_min.focus(); \n"; $retorno .= " return false; } "; $retorno .= "if(!(/^([0-5])?[0-9]\$/.test( document.{$this->__nome}." . $nome . "_seg.value ))) { \n"; $retorno .= " alert( 'Preencha o campo \\'{$componente['1']}\\' corretamente!' ); \n"; $retorno .= " document.{$this->__nome}." . $nome . "_seg.focus(); \n"; $retorno .= " return false; } "; } elseif ($validador == 'lon') { $retorno .= "if(!(/^(-4[7-9])|(-5[0-4])/.test( document.{$this->__nome}." . $nome . "_graus.value ))) { \n"; $retorno .= " alert( 'Preencha o campo \\'{$componente['1']}\\' corretamente!' ); \n"; $retorno .= " document.{$this->__nome}." . $nome . "_graus.focus(); \n"; $retorno .= " return false; } "; $retorno .= "if(!(/^([0-5])?[0-9]\$/.test( document.{$this->__nome}." . $nome . "_min.value ))) { \n"; $retorno .= " alert( 'Preencha o campo \\'{$componente['1']}\\' corretamente!' ); \n"; $retorno .= " document.{$this->__nome}." . $nome . "_min.focus(); \n"; $retorno .= " return false; } "; $retorno .= "if(!(/^([0-5])?[0-9]\$/.test( document.{$this->__nome}." . $nome . "_seg.value ))) { \n"; $retorno .= " alert( 'Preencha o campo \\'{$componente['1']}\\' corretamente!' ); \n"; $retorno .= " document.{$this->__nome}." . $nome . "_seg.focus(); \n"; $retorno .= " return false; } "; } else { if ($nomeCampo == 'idFederal') { $validador = explode('+', $validador); $retorno .= " if ("; $retorno .= "!({$validador[0]}.test( document.getElementById('{$nome}').value ))) { \n"; $retorno .= "if( !({$validador[1]}.test( document.getElementById('{$nome}').value ))) { "; $retorno .= " alert( 'Preencha o campo \\'{$componente['1']}\\' corretamente!' ); \n return false; }"; $retorno .= "else { if(! DvCnpjOk( document.getElementById('{$nome}')) ) return false; } }"; $retorno .= "else{ if(! DvCpfOk( document.getElementById('{$nome}')) ) return false; }"; } elseif ($nomeCampo == 'listaativarpeso') { $retorno .= "if(!({$validador}.test( document.{$this->__nome}.{$nome}_val.value ))) { \n"; $retorno .= " alert( 'Preencha o campo \\'{$componente['1']}\\' corretamente!' ); \n"; $retorno .= " document.{$this->__nome}.{$nome}_val.focus(); \n"; $retorno .= " return false; } "; } else { //substituito referencia a elementos por padrão W3C document.getElementById() //quando se referenciava um nome de elemento como um array ex: cadastro[aluno] //nao funcionava na referencia por nome //16-08-2006 $retorno .= ' if ('; if ($validador[0] == '*') { $validador = substr($validador, 1); $retorno .= "document.getElementById(\"{$nome}\").value!='' && "; } $retorno .= "!({$validador}.test( document.getElementById(\"{$nome}\").value )))\n"; $retorno .= "{\n"; $retorno .= " mudaClassName( 'formdestaque', 'obrigatorio' );\n"; $retorno .= " document.getElementById(\"{$nome}\").className = \"formdestaque\";\n"; $retorno .= " alert( 'Preencha o campo \\'" . extendChars($componente[1], true) . "\\' corretamente!' ); \n"; if ($this->__nm_tab) { $retorno .= "\n var item = document.getElementById('{$nome}');\n var prox = 1;\n do{\n item = item.parentNode;\n if(item == null)\n {\n prox = 0;\n }\n else\n {\n if(/content[0-9]+/.exec(item.id) != null)\n {\n prox = 2;\n }\n }\n }while(prox == 1);\n if(prox == 2)\n {\n num_content = +/[0-9]+/.exec(item.id);\n num_aba = 2 * num_content - 2;\n LTb0('0', num_aba);\n }\n "; } $retorno .= " document.getElementById(\"{$nome}\").focus(); \n"; $retorno .= " return false;\n"; $retorno .= "}\n"; if (!empty($nomeCampo)) { if ($nomeCampo == 'cpf') { $retorno .= " else { if(! DvCpfOk( document.getElementById('{$nome}')) ) return false; }"; } } if (!empty($nomeCampo)) { if ($nomeCampo == 'cnpj' || $nomeCampo == 'cnpj_pesq') { $retorno .= " else { if(document.{$this->__nome}.{$nome}.value != ''){ if(! DvCnpjOk( document.{$this->__nome}.{$nome}) ) return false; }}"; } } } } } } // Fim while if ($this->acao_executa_submit) { $retorno .= "\n if (document.getElementById('btn_enviar')) {\n document.getElementById('btn_enviar').disabled = true;\n document.getElementById('btn_enviar').value = 'Aguarde...';\n document.getElementById('btn_enviar').className = 'botaolistagemdisabled';\n }\n "; $retorno .= "\ndocument.{$this->__nome}.submit(); "; } else { $retorno .= " \n return true; \n"; } $retorno .= "\n}\n"; $retorno .= "</script>\n"; if ($this->acao_enviar && $this->botao_enviar) { $retorno .= " <input type='button' id='btn_enviar' class='botaolistagem' onclick='{$this->acao_enviar};' value='{$this->nome_url_sucesso}'> "; } if ($this->fexcluir) { $retorno .= " <input type='button' class='botaolistagem' onclick='javascript:excluir();' value=' Excluir '> "; } if ($this->bot_alt) { $retorno .= " <input type='button' class='botaolistagem' onclick='javascript: go( \"{$this->url_alt}\" );' value=' {$this->nome_url_alt} '> "; } if ($this->excluir_Img) { $retorno .= " <input type='button' class='botaolistagem' onclick='javascript:ExcluirImg();' value=' {$this->nome_excluirImg} '> "; } if ($this->acao) { $retorno .= " <input type='button' class='botaolistagem' onclick='javascript: {$this->acao}' value=' {$this->nome_acao} '> "; } if ($this->url_cancelar || $this->script_cancelar) { $retorno .= " <input type='button' class='botaolistagem' onclick='javascript: {$this->script_cancelar} go( \"{$this->url_cancelar}\" );' value=' {$this->nome_url_cancelar} '> "; } if ($this->array_botao_url) { for ($i = 0; $i < count($this->array_botao); $i++) { if ($this->array_botao_id[$i]) { $retorno .= " <input type='button' class='botaolistagem' onclick='javascript:go( \"" . $this->array_botao_url[$i] . "\" );' value='" . $this->array_botao[$i] . "' id=\"{$this->array_botao_id[$i]}\"> "; } else { $retorno .= " <input type='button' class='botaolistagem' onclick='javascript:go( \"" . $this->array_botao_url[$i] . "\" );' value='" . $this->array_botao[$i] . "' id=\"arr_bot_{$this->array_botao[$i]}\"> "; } } } elseif ($this->array_botao_url_script) { for ($i = 0; $i < count($this->array_botao); $i++) { if ($this->array_botao_id[$i]) { $id = $this->array_botao_id[$i]; $retorno .= " <input type='button' class='botaolistagem' onclick=\"" . $this->array_botao_url_script[$i] . "\" value=\"" . $this->array_botao[$i] . "\" id=\"{$id}\"> \n"; } else { $id = $this->array_botao[$i]; $retorno .= " <input type='button' class='botaolistagem' onclick=\"" . $this->array_botao_url_script[$i] . "\" value=\"" . $this->array_botao[$i] . "\" id=\"arr_bot_{$id}\"> \n"; } } } $retorno .= "</td>\n</tr>\n"; $retorno .= "</table>\n</center>\n<!-- cadastro end -->\n"; $retorno .= "</form>\n"; if ($this->bannerClose) { $retorno .= "</td></tr></table>"; } if ($this->executa_script) { $retorno .= "<script type=\"text/javascript\">{$this->executa_script}</script>"; } Portabilis_View_Helper_Application::embedJavascriptToFixupFieldsWidth($this); return $retorno; }
protected function js($objectName, $attrName, $options) { // load simple search js $jsFile = '/modules/Portabilis/Assets/Javascripts/Frontend/Inputs/SimpleSearch.js'; Portabilis_View_Helper_Application::loadJavascript($this->viewInstance, $jsFile); // setup simple search /* all search options (including the option autocompleteOptions, that is passed for jquery autocomplete plugin), can be overwritten adding "var = simpleSearch<ObjectName>Options = { option : '...', optionName : '...' };" in the script file for the resource controller. */ $resourceOptions = "simpleSearch" . Portabilis_String_Utils::camelize($objectName) . "Options"; $js = "{$resourceOptions} = typeof {$resourceOptions} == 'undefined' ? {} : {$resourceOptions};\n simpleSearchHelper.setup('{$objectName}', '{$attrName}', '" . $options['searchPath'] . "', {$resourceOptions});"; // this script will be executed after the script for the current controller (if it was loaded in the view); Portabilis_View_Helper_Application::embedJavascript($this->viewInstance, $js, $afterReady = true); }
protected function placeholderJs($options) { $optionsVarName = "multipleSearch" . Portabilis_String_Utils::camelize($options['objectName']) . "Options"; $js = "if (typeof {$optionsVarName} == 'undefined') { {$optionsVarName} = {} };\n {$optionsVarName}.placeholder = safeUtf8Decode('Selecione os assuntos');"; Portabilis_View_Helper_Application::embedJavascript($this->viewInstance, $js, $afterReady = true); }
function Gerar() { if ($_POST) { foreach ($_POST as $campo => $val) { $this->{$campo} = !$this->{$campo} ? $val : $this->{$campo}; } } // primary keys $this->campoOculto("ref_cod_aluno", $this->ref_cod_aluno); $this->campoOculto("sequencial", $this->sequencial); $obj_aluno = new clsPmieducarAluno(); $lst_aluno = $obj_aluno->lista($this->ref_cod_aluno, null, null, null, null, null, null, null, null, null, 1); if (is_array($lst_aluno)) { $det_aluno = array_shift($lst_aluno); $this->nm_aluno = $det_aluno["nome_aluno"]; $this->campoRotulo("nm_aluno", "Aluno", $this->nm_aluno); } //$obj_permissoes = new clsPermissoes(); //$this->ref_cod_instituicao = $obj_permissoes->getInstituicao( $this->pessoa_logada ); //$this->campoOculto( 'ref_cod_instituicao', $this->ref_cod_instituicao ); $obj_nivel = new clsPmieducarUsuario($this->pessoa_logada); $nivel_usuario = $obj_nivel->detalhe(); if ($nivel_usuario['ref_cod_tipo_usuario'] == 1) { $obj_instituicao = new clsPmieducarInstituicao(); $lista = $obj_instituicao->lista(null, null, null, null, null, null, null, null, null, null, null, null, null, 1); $opcoes["1"] = "Selecione"; if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes["{$registro['cod_instituicao']}"] = "{$registro['nm_instituicao']}"; } } $this->campoLista("ref_cod_instituicao", "Instituição", $opcoes, ""); } else { $obj_instituicao = new clsPmieducarInstituicao($nivel_usuario['ref_cod_instituicao']); $inst = $obj_instituicao->detalhe(); $this->campoOculto("ref_cod_instituicao", $inst['cod_instituicao']); $this->campoTexto("instituicao", "Instiuição", $inst['nm_instituicao'], 30, 255, false, false, false, "", "", "", "", true); } // text $this->campoTexto("escola", "Escola", $this->escola, 30, 255, true); $this->campoTexto("escola_cidade", "Cidade da Escola", $this->escola_cidade, 30, 255, true); $det_uf[] = array(); if ($this->escola_uf) { //busca pais do estado $obj_uf = new clsUf($this->escola_uf); $det_uf = $obj_uf->detalhe(); } $lista_pais_origem = array('45' => "País da escola"); $obj_pais = new clsPais(); $obj_pais_lista = $obj_pais->lista(null, null, null, "", "", "nome asc"); if ($obj_pais_lista) { foreach ($obj_pais_lista as $key => $pais) { $lista_pais_origem[$pais["idpais"]] = $pais["nome"]; } } $this->campoLista("idpais", "País da Escola", $lista_pais_origem, $det_uf['int_idpais']); $obj_uf = new clsUf(); $lista_uf = $obj_uf->lista(false, false, $det_uf['int_idpais'], false, false, "sigla_uf"); $lista_estado = array("SC" => "Selecione um país"); if ($lista_uf) { foreach ($lista_uf as $uf) { $lista_estado[$uf['sigla_uf']] = $uf['sigla_uf']; } } $this->campoLista("escola_uf", "Estado da Escola", $lista_estado, $this->escola_uf); $this->campoTexto("nm_curso", "Curso", $this->nm_curso, 30, 255, false); $opcoesGradeCurso = getOpcoesGradeCurso(); $this->campoLista("historico_grade_curso_id", "Grade curso", $opcoesGradeCurso, $this->historico_grade_curso_id); $this->campoTexto("nm_serie", "Série", $this->nm_serie, 30, 255, true); $this->campoNumero("ano", "Ano", $this->ano, 4, 4, true); $this->campoMonetario("carga_horaria", "Carga Horária", $this->carga_horaria, 8, 8, true); $this->campoCheck("cb_faltas_globalizadas", "Faltas Globalizadas", is_numeric($this->faltas_globalizadas) ? 'on' : ''); $this->campoNumero("faltas_globalizadas", "Faltas Globalizadas", $this->faltas_globalizadas, 4, 4, false); $this->campoNumero("dias_letivos", "Dias Letivos", $this->dias_letivos, 3, 3, true); $this->campoMonetario("frequencia", "Frequência", $this->frequencia, 8, 6, true); $this->campoCheck("extra_curricular", "Extra-Curricular", $this->extra_curricular); $this->campoCheck("aceleracao", "Aceleração", $this->aceleracao); $this->campoMemo("observacao", "Observação", $this->observacao, 60, 5, false); $opcoes = array("" => "Selecione", 1 => "Aprovado", 2 => "Reprovado", 3 => "Em Andamento", 4 => "Transferido"); $this->campoLista("aprovado", "Situação", $opcoes, $this->aprovado); $this->campoTexto("registro", "Registro (arquivo)", $this->registro, 30, 50, false); $this->campoTexto("livro", "Livro", $this->livro, 30, 50, false); $this->campoTexto("folha", "Folha", $this->folha, 30, 50, false); //---------------------INCLUI DISCIPLINAS---------------------// $this->campoQuebra(); //if ( $_POST["historico_disciplinas"] ) //$this->historico_disciplinas = unserialize( urldecode( $_POST["historico_disciplinas"] ) ); //$qtd_disciplinas = ( count( $this->historico_disciplinas ) == 0 ) ? 1 : ( count( $this->historico_disciplinas ) + 1); if (is_numeric($this->ref_cod_aluno) && is_numeric($this->sequencial) && !$_POST) { $obj = new clsPmieducarHistoricoDisciplinas(); $obj->setOrderby("nm_disciplina ASC"); $registros = $obj->lista(null, $this->ref_cod_aluno, $this->sequencial); $qtd_disciplinas = 0; if ($registros) { foreach ($registros as $campo) { $this->historico_disciplinas[$qtd_disciplinas][] = $campo["nm_disciplina"]; $this->historico_disciplinas[$qtd_disciplinas][] = $campo["nota"]; $this->historico_disciplinas[$qtd_disciplinas][] = $campo["faltas"]; $this->historico_disciplinas[$qtd_disciplinas][] = $campo["sequencial"]; $qtd_disciplinas++; } } } $this->campoTabelaInicio("notas", "Notas", array("Disciplina", "Nota", "Faltas"), $this->historico_disciplinas); //$this->campoTexto( "nm_disciplina", "Disciplina", $this->nm_disciplina, 30, 255, false, false, false, '', '', 'autoCompleteComponentesCurricular(this)', 'onfocus' ); $this->campoTexto("nm_disciplina", "Disciplina", $this->nm_disciplina, 30, 255, false, false, false, '', '', '', 'onfocus'); $this->campoTexto("nota", "Nota", $this->nota, 10, 255, false); $this->campoNumero("faltas", "Faltas", $this->faltas, 3, 3, false); //$this->campoOculto("sequencial",""); $this->campoTabelaFim(); //$this->campoOculto("ultimo_sequencial","$qtd_disciplinas"); $this->campoQuebra(); //---------------------FIM INCLUI DISCIPLINAS---------------------// // carrega estilo para feedback messages, para exibir msg validação frequencia. $style = "/modules/Portabilis/Assets/Stylesheets/Frontend.css"; Portabilis_View_Helper_Application::loadStylesheet($this, $style); Portabilis_View_Helper_Application::loadJQueryLib($this); Portabilis_View_Helper_Application::loadJQueryUiLib($this); Portabilis_View_Helper_Application::loadJavascript($this, array('/modules/Portabilis/Assets/Javascripts/Utils.js', '/modules/Portabilis/Assets/Javascripts/Frontend/Inputs/SimpleSearch.js', '/modules/Portabilis/Assets/Javascripts/Validator.js')); }
public static function loadAjaxChosenLib($viewInstance) { // AjaxChosen requires this fixup, see https://github.com/meltingice/ajax-chosen $fixupCss = ".chzn-container .chzn-results .group-result { display: list-item; }"; Portabilis_View_Helper_Application::embedStylesheet($viewInstance, $fixupCss); self::loadJavascript($viewInstance, '/modules/Portabilis/Assets/Plugins/AjaxChosen/ajax-chosen.min.js', false); }
protected function loadAssets() { $jsFile = '/modules/Portabilis/Assets/Javascripts/Frontend/Inputs/Resource/SimpleSearchLogradouro.js'; Portabilis_View_Helper_Application::loadJavascript($this->viewInstance, $jsFile); }
function Gerar() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; session_write_close(); // Verificação de permissão para cadastro. $this->obj_permissao = new clsPermissoes(); $this->nivel_usuario = $this->obj_permissao->nivel_acesso($this->pessoa_logada); $this->titulo = 'Aluno - Detalhe'; $this->cod_aluno = $_GET['cod_aluno']; $tmp_obj = new clsPmieducarAluno($this->cod_aluno); $registro = $tmp_obj->detalhe(); if (!$registro) { header('Location: educar_aluno_lst.php'); die; } else { foreach ($registro as $key => $value) { $this->{$key} = $value; } } if ($this->ref_idpes) { $obj_pessoa_fj = new clsPessoaFj($this->ref_idpes); $det_pessoa_fj = $obj_pessoa_fj->detalhe(); $obj_fisica = new clsFisica($this->ref_idpes); $det_fisica = $obj_fisica->detalhe(); $obj_fisica_raca = new clsCadastroFisicaRaca(); $lst_fisica_raca = $obj_fisica_raca->lista($this->ref_idpes); if ($lst_fisica_raca) { $det_fisica_raca = array_shift($lst_fisica_raca); $obj_raca = new clsCadastroRaca($det_fisica_raca['ref_cod_raca']); $det_raca = $obj_raca->detalhe(); } $objFoto = new clsCadastroFisicaFoto($this->ref_idpes); $detalheFoto = $objFoto->detalhe(); if ($detalheFoto) { $caminhoFoto = $detalheFoto['caminho']; } $registro['nome_aluno'] = strtoupper($det_pessoa_fj['nome']); $registro['cpf'] = int2IdFederal($det_fisica['cpf']); $registro['data_nasc'] = dataToBrasil($det_fisica['data_nasc']); $registro['sexo'] = $det_fisica['sexo'] == 'F' ? 'Feminino' : 'Masculino'; $obj_estado_civil = new clsEstadoCivil(); $obj_estado_civil_lista = $obj_estado_civil->lista(); $lista_estado_civil = array(); if ($obj_estado_civil_lista) { foreach ($obj_estado_civil_lista as $estado_civil) { $lista_estado_civil[$estado_civil['ideciv']] = $estado_civil['descricao']; } } $registro['ideciv'] = $lista_estado_civil[$det_fisica['ideciv']->ideciv]; $registro['email'] = $det_pessoa_fj['email']; $registro['url'] = $det_pessoa_fj['url']; $registro['nacionalidade'] = $det_fisica['nacionalidade']; $registro['naturalidade'] = $det_fisica['idmun_nascimento']->detalhe(); $registro['naturalidade'] = $registro['naturalidade']['nome']; $registro['pais_origem'] = $det_fisica['idpais_estrangeiro']->detalhe(); $registro['pais_origem'] = $registro['pais_origem']['nome']; $registro['ref_idpes_responsavel'] = $det_fisica['idpes_responsavel']; $this->idpes_pai = $det_fisica['idpes_pai']; $this->idpes_mae = $det_fisica['idpes_mae']; $this->sus = $det_fisica['sus']; $this->nm_pai = $registro['nm_pai']; $this->nm_mae = $registro['nm_mae']; if ($this->idpes_pai) { $obj_pessoa_pai = new clsPessoaFj($this->idpes_pai); $det_pessoa_pai = $obj_pessoa_pai->detalhe(); if ($det_pessoa_pai) { $registro['nm_pai'] = $det_pessoa_pai['nome']; // CPF $obj_cpf = new clsFisica($this->idpes_pai); $det_cpf = $obj_cpf->detalhe(); if ($det_cpf['cpf']) { $this->cpf_pai = int2CPF($det_cpf['cpf']); } } } if ($this->idpes_mae) { $obj_pessoa_mae = new clsPessoaFj($this->idpes_mae); $det_pessoa_mae = $obj_pessoa_mae->detalhe(); if ($det_pessoa_mae) { $registro['nm_mae'] = $det_pessoa_mae['nome']; // CPF $obj_cpf = new clsFisica($this->idpes_mae); $det_cpf = $obj_cpf->detalhe(); if ($det_cpf['cpf']) { $this->cpf_mae = int2CPF($det_cpf['cpf']); } } } $registro['ddd_fone_1'] = $det_pessoa_fj['ddd_1']; $registro['fone_1'] = $det_pessoa_fj['fone_1']; $registro['ddd_fone_2'] = $det_pessoa_fj['ddd_2']; $registro['fone_2'] = $det_pessoa_fj['fone_2']; $registro['ddd_fax'] = $det_pessoa_fj['ddd_fax']; $registro['fone_fax'] = $det_pessoa_fj['fone_fax']; $registro['ddd_mov'] = $det_pessoa_fj['ddd_mov']; $registro['fone_mov'] = $det_pessoa_fj['fone_mov']; $obj_deficiencia_pessoa = new clsCadastroFisicaDeficiencia(); $obj_deficiencia_pessoa_lista = $obj_deficiencia_pessoa->lista($this->ref_idpes); if ($obj_deficiencia_pessoa_lista) { $deficiencia_pessoa = array(); foreach ($obj_deficiencia_pessoa_lista as $deficiencia) { $obj_def = new clsCadastroDeficiencia($deficiencia['ref_cod_deficiencia']); $det_def = $obj_def->detalhe(); $deficiencia_pessoa[$deficiencia['ref_cod_deficiencia']] = $det_def['nm_deficiencia']; } } $ObjDocumento = new clsDocumento($this->ref_idpes); $detalheDocumento = $ObjDocumento->detalhe(); $registro['rg'] = $detalheDocumento['rg']; if ($detalheDocumento['data_exp_rg']) { $registro['data_exp_rg'] = date('d/m/Y', strtotime(substr($detalheDocumento['data_exp_rg'], 0, 19))); } $registro['sigla_uf_exp_rg'] = $detalheDocumento['sigla_uf_exp_rg']; $registro['tipo_cert_civil'] = $detalheDocumento['tipo_cert_civil']; $registro['num_termo'] = $detalheDocumento['num_termo']; $registro['num_livro'] = $detalheDocumento['num_livro']; $registro['num_folha'] = $detalheDocumento['num_folha']; if ($detalheDocumento['data_emissao_cert_civil']) { $registro['data_emissao_cert_civil'] = date('d/m/Y', strtotime(substr($detalheDocumento['data_emissao_cert_civil'], 0, 19))); } $registro['sigla_uf_cert_civil'] = $detalheDocumento['sigla_uf_cert_civil']; $registro['cartorio_cert_civil'] = $detalheDocumento['cartorio_cert_civil']; $registro['num_cart_trabalho'] = $detalheDocumento['num_cart_trabalho']; $registro['serie_cart_trabalho'] = $detalheDocumento['serie_cart_trabalho']; if ($detalheDocumento['data_emissao_cart_trabalho']) { $registro['data_emissao_cart_trabalho'] = date('d/m/Y', strtotime(substr($detalheDocumento['data_emissao_cart_trabalho'], 0, 19))); } $registro['sigla_uf_cart_trabalho'] = $detalheDocumento['sigla_uf_cart_trabalho']; $registro['num_tit_eleitor'] = $detalheDocumento['num_titulo_eleitor']; $registro['zona_tit_eleitor'] = $detalheDocumento['zona_titulo_eleitor']; $registro['secao_tit_eleitor'] = $detalheDocumento['secao_titulo_eleitor']; $registro['idorg_exp_rg'] = $detalheDocumento['ref_idorg_rg']; $obj_endereco = new clsPessoaEndereco($this->ref_idpes); if ($obj_endereco_det = $obj_endereco->detalhe()) { $registro['id_cep'] = $obj_endereco_det['cep']->cep; $registro['id_bairro'] = $obj_endereco_det['idbai']->idbai; $registro['id_logradouro'] = $obj_endereco_det['idlog']->idlog; $registro['numero'] = $obj_endereco_det['numero']; $registro['letra'] = $obj_endereco_det['letra']; $registro['complemento'] = $obj_endereco_det['complemento']; $registro['andar'] = $obj_endereco_det['andar']; $registro['apartamento'] = $obj_endereco_det['apartamento']; $registro['bloco'] = $obj_endereco_det['bloco']; $registro['nm_logradouro'] = $obj_endereco_det['logradouro']; $registro['cep_'] = int2CEP($registro['id_cep']); $obj_bairro = new clsBairro($registro['id_bairro']); $obj_bairro_det = $obj_bairro->detalhe(); if ($obj_bairro_det) { $registro['nm_bairro'] = $obj_bairro_det['nome']; } $obj_log = new clsLogradouro($registro['id_logradouro']); $obj_log_det = $obj_log->detalhe(); if ($obj_log_det) { $registro['nm_logradouro'] = $obj_log_det['nome']; $registro['idtlog'] = $obj_log_det['idtlog']->detalhe(); $registro['idtlog'] = $registro['idtlog']['descricao']; $obj_mun = new clsMunicipio($obj_log_det['idmun']); $det_mun = $obj_mun->detalhe(); if ($det_mun) { $registro['cidade'] = ucfirst(strtolower($det_mun['nome'])); } } $obj_bairro = new clsBairro($registro["id_bairro"]); $obj_bairro_det = $obj_bairro->detalhe(); if ($obj_bairro_det) { $registro['nm_bairro'] = $obj_bairro_det['nome']; } } else { $obj_endereco = new clsEnderecoExterno($this->ref_idpes); if ($obj_endereco_det = $obj_endereco->detalhe()) { $registro['id_cep'] = $obj_endereco_det['cep']; $registro['cidade'] = $obj_endereco_det['cidade']; $registro['nm_bairro'] = $obj_endereco_det['bairro']; $registro['nm_logradouro'] = $obj_endereco_det['logradouro']; $registro['numero'] = $obj_endereco_det['numero']; $registro['letra'] = $obj_endereco_det['letra']; $registro['complemento'] = $obj_endereco_det['complemento']; $registro['andar'] = $obj_endereco_det['andar']; $registro['apartamento'] = $obj_endereco_det['apartamento']; $registro['bloco'] = $obj_endereco_det['bloco']; $registro['idtlog'] = $obj_endereco_det['idtlog']->detalhe(); $registro['idtlog'] = $registro['idtlog']['descricao']; $det_uf = $obj_endereco_det['sigla_uf']->detalhe(); $registro['ref_sigla_uf'] = $det_uf['nome']; $registro['cep_'] = int2CEP($registro['id_cep']); } } } // Adiciona a informação de zona de localização junto ao bairro do // endereço. $zona = App_Model_ZonaLocalizacao::getInstance(); $registro['nm_bairro'] = sprintf('%s (Zona %s)', $registro['nm_bairro'], $zona->getValue($obj_endereco_det['zona_localizacao'])); if ($registro['cod_aluno']) { $this->addDetalhe(array('Código Aluno', $registro['cod_aluno'])); } // código inep $alunoMapper = new Educacenso_Model_AlunoDataMapper(); $alunoInep = NULL; try { $alunoInep = $alunoMapper->find(array('aluno' => $this->cod_aluno)); $this->addDetalhe(array('Código inep', $alunoInep->alunoInep)); } catch (Exception $e) { } // código estado $this->addDetalhe(array('Código estado', $registro['aluno_estado_id'])); if ($registro['caminho_foto']) { $this->addDetalhe(array('Foto', sprintf('<img src="arquivos/educar/aluno/small/%s" border="0">', $registro['caminho_foto']))); } if ($registro['nome_aluno']) { if ($caminhoFoto != null and $caminhoFoto != '') { $this->addDetalhe(array('Nome Aluno', $registro['nome_aluno'] . '<p><img height="117" src="' . $caminhoFoto . '"/></p>')); } else { $this->addDetalhe(array('Nome Aluno', $registro['nome_aluno'])); } } if (idFederal2int($registro['cpf'])) { $this->addDetalhe(array('CPF', $registro['cpf'])); } if ($registro['data_nasc']) { $this->addDetalhe(array('Data de Nascimento', $registro['data_nasc'])); } /** * Analfabeto. */ $this->addDetalhe(array('Analfabeto', $registro['analfabeto'] == 0 ? 'Não' : 'Sim')); if ($registro['sexo']) { $this->addDetalhe(array('Sexo', $registro['sexo'])); } if ($registro['ideciv']) { $this->addDetalhe(array('Estado Civil', $registro['ideciv'])); } if ($registro['id_cep']) { $this->addDetalhe(array('CEP', $registro['cep_'])); } if ($registro['ref_sigla_uf']) { $this->addDetalhe(array('UF', $registro['ref_sigla_uf'])); } if ($registro['cidade']) { $this->addDetalhe(array('Cidade', $registro['cidade'])); } if ($registro['nm_bairro']) { $this->addDetalhe(array('Bairro', $registro['nm_bairro'])); } if ($registro['nm_logradouro']) { $logradouro = ''; if ($registro['idtlog']) { $logradouro .= $registro['idtlog'] . ' '; } $logradouro .= $registro['nm_logradouro']; $this->addDetalhe(array('Logradouro', $logradouro)); } if ($registro['numero']) { $this->addDetalhe(array('Número', $registro['numero'])); } if ($registro['letra']) { $this->addDetalhe(array('Letra', $registro['letra'])); } if ($registro['complemento']) { $this->addDetalhe(array('Complemento', $registro['complemento'])); } if ($registro['bloco']) { $this->addDetalhe(array('Bloco', $registro['bloco'])); } if ($registro['andar']) { $this->addDetalhe(array('Andar', $registro['andar'])); } if ($registro['apartamento']) { $this->addDetalhe(array('Apartamento', $registro['apartamento'])); } if ($registro['naturalidade']) { $this->addDetalhe(array('Naturalidade', $registro['naturalidade'])); } if ($registro['nacionalidade']) { $lista_nacionalidade = array('NULL' => 'Selecione', 1 => 'Brasileiro', 2 => 'Naturalizado Brasileiro', 3 => 'Estrangeiro'); $registro['nacionalidade'] = $lista_nacionalidade[$registro['nacionalidade']]; $this->addDetalhe(array('Nacionalidade', $registro['nacionalidade'])); } if ($registro['pais_origem']) { $this->addDetalhe(array('País de Origem', $registro['pais_origem'])); } $responsavel = $tmp_obj->getResponsavelAluno(); if ($responsavel) { $this->addDetalhe(array('Responsável Aluno', $responsavel['nome_responsavel'])); } if ($registro['ref_idpes_responsavel']) { $obj_pessoa_resp = new clsPessoaFj($registro['ref_idpes_responsavel']); $det_pessoa_resp = $obj_pessoa_resp->detalhe(); if ($det_pessoa_resp) { $registro['ref_idpes_responsavel'] = $det_pessoa_resp['nome']; } $this->addDetalhe(array('Responsável', $registro['ref_idpes_responsavel'])); } if ($registro['nm_pai']) { $this->addDetalhe(array('Pai', $registro['nm_pai'])); } if ($registro["nm_mae"]) { $this->addDetalhe(array('Mãe', $registro['nm_mae'])); } if ($registro['fone_1']) { if ($registro['ddd_fone_1']) { $registro['ddd_fone_1'] = sprintf('(%s) ', $registro['ddd_fone_1']); } $this->addDetalhe(array('Telefone 1', $registro['ddd_fone_1'] . $registro['fone_1'])); } if ($registro['fone_2']) { if ($registro['ddd_fone_2']) { $registro['ddd_fone_2'] = sprintf('(%s) ', $registro['ddd_fone_2']); } $this->addDetalhe(array('Telefone 2', $registro['ddd_fone_2'] . $registro['fone_2'])); } if ($registro['fone_mov']) { if ($registro['ddd_mov']) { $registro['ddd_mov'] = sprintf('(%s) ', $registro['ddd_mov']); } $this->addDetalhe(array('Celular', $registro['ddd_mov'] . $registro['fone_mov'])); } if ($registro['fone_fax']) { if ($registro['ddd_fax']) { $registro['ddd_fax'] = sprintf('(%s) ', $registro['ddd_fax']); } $this->addDetalhe(array('Fax', $registro['ddd_fax'] . $registro['fone_fax'])); } if ($registro['email']) { $this->addDetalhe(array('E-mail', $registro['email'])); } if ($registro['url']) { $this->addDetalhe(array('Página Pessoal', $registro['url'])); } if ($registro['ref_cod_aluno_beneficio']) { $obj_beneficio = new clsPmieducarAlunoBeneficio($registro['ref_cod_aluno_beneficio']); $obj_beneficio_det = $obj_beneficio->detalhe(); $this->addDetalhe(array('Benefício', $obj_beneficio_det['nm_beneficio'])); } if ($registro['ref_cod_religiao']) { $obj_religiao = new clsPmieducarReligiao($registro['ref_cod_religiao']); $obj_religiao_det = $obj_religiao->detalhe(); $this->addDetalhe(array('Religião', $obj_religiao_det['nm_religiao'])); } if ($det_raca['nm_raca']) { $this->addDetalhe(array('Raça', $det_raca['nm_raca'])); } if ($deficiencia_pessoa) { $tabela = '<table border="0" width="300" cellpadding="3"><tr bgcolor="#A1B3BD" align="center"><td>Deficiências</td></tr>'; $cor = '#D1DADF'; foreach ($deficiencia_pessoa as $indice => $valor) { $cor = $cor == '#D1DADF' ? '#E4E9ED' : '#D1DADF'; $tabela .= sprintf('<tr bgcolor="%s" align="center"><td>%s</td></tr>', $cor, $valor); } $tabela .= '</table>'; $this->addDetalhe(array('Deficiências', $tabela)); } if ($registro['rg']) { $this->addDetalhe(array('RG', $registro['rg'])); } if ($registro['data_exp_rg']) { $this->addDetalhe(array('Data de Expedição RG', $registro['data_exp_rg'])); } if ($registro['idorg_exp_rg']) { $this->addDetalhe(array('Órgão Expedição RG', $registro['idorg_exp_rg'])); } if ($registro['sigla_uf_exp_rg']) { $this->addDetalhe(array('Estado Expedidor', $registro['sigla_uf_exp_rg'])); } /** * @todo CoreExt_Enum? */ if ($registro['tipo_cert_civil']) { $lista_tipo_cert_civil = array(); $lista_tipo_cert_civil["0"] = 'Selecione'; $lista_tipo_cert_civil[91] = 'Nascimento'; $lista_tipo_cert_civil[92] = 'Casamento'; $this->addDetalhe(array('Tipo Certificado Civil', $registro['tipo_cert_civil'])); } if ($registro['num_termo']) { $this->addDetalhe(array('Termo', $registro['num_termo'])); } if ($registro['num_livro']) { $this->addDetalhe(array('Livro', $registro['num_livro'])); } if ($registro['num_folha']) { $this->addDetalhe(array('Folha', $registro['num_folha'])); } if ($registro['data_emissao_cert_civil']) { $this->addDetalhe(array('Emissão Certidão Civil', $registro['data_emissao_cert_civil'])); } if ($registro['sigla_uf_cert_civil']) { $this->addDetalhe(array('Sigla Certidão Civil', $registro['sigla_uf_cert_civil'])); } if ($registro['cartorio_cert_civil']) { $this->addDetalhe(array('Cartório', $registro['cartorio_cert_civil'])); } if ($registro['num_tit_eleitor']) { $this->addDetalhe(array('Título de Eleitor', $registro['num_tit_eleitor'])); } if ($registro['zona_tit_eleitor']) { $this->addDetalhe(array('Zona', $registro['zona_tit_eleitor'])); } if ($registro['secao_tit_eleitor']) { $this->addDetalhe(array('Seção', $registro['secao_tit_eleitor'])); } // Transporte escolar. $transporteMapper = new Transporte_Model_AlunoDataMapper(); $transporteAluno = NULL; try { $transporteAluno = $transporteMapper->find(array('aluno' => $this->cod_aluno)); } catch (Exception $e) { } $this->addDetalhe(array('Transporte escolar', isset($transporteAluno) && $transporteAluno->responsavel != 'Não utiliza' ? 'Sim' : 'Não')); if ($transporteAluno && $transporteAluno->responsavel != 'Não utiliza') { $this->addDetalhe(array('Responsável transporte', $transporteAluno->responsavel)); } if ($this->obj_permissao->permissao_cadastra(578, $this->pessoa_logada, 7)) { $this->url_novo = '/module/Cadastro/aluno'; $this->url_editar = '/module/Cadastro/aluno?id=' . $registro['cod_aluno']; $this->array_botao = array('Nova matrícula', 'Atualizar Histórico'); $this->array_botao_url_script = array(sprintf('go("educar_matricula_cad.php?ref_cod_aluno=%d");', $registro['cod_aluno']), sprintf('go("educar_historico_escolar_lst.php?ref_cod_aluno=%d");', $registro['cod_aluno'])); } $objFichaMedica = new clsModulesFichaMedicaAluno($this->cod_aluno); $reg = $objFichaMedica->detalhe(); if ($reg) { $this->addDetalhe(array('<span id="fmedica"></span>Altura/metro', $reg['altura'])); if (trim($reg['peso']) != '') { $this->addDetalhe(array('Peso/kg', $reg['peso'])); } if (trim($reg['grupo_sanguineo']) != '') { $this->addDetalhe(array('Grupo sanguíneo', $reg['grupo_sanguineo'])); } if (trim($reg['fator_rh']) != '') { $this->addDetalhe(array('Fator RH', $reg['fator_rh'])); } if (trim($this->sus) != '') { $this->addDetalhe(array('Número do cartão do SUS', $this->sus)); } $this->addDetalhe(array('Possui alergia a algum medicamento', $reg['alergia_medicamento'] == 'S' ? 'Sim' : 'Não')); if (trim($reg['desc_alergia_medicamento']) != '') { $this->addDetalhe(array('Quais', $reg['desc_alergia_medicamento'])); } $this->addDetalhe(array('Possui alergia a algum alimento', $reg['alergia_alimento'] == 'S' ? 'Sim' : 'Não')); if (trim($reg['desc_alergia_alimento']) != '') { $this->addDetalhe(array('Quais', $reg['desc_alergia_alimento'])); } $this->addDetalhe(array('Possui alguma doenca congênita', $reg['doenca_congenita'] == 'S' ? 'Sim' : 'Não')); if (trim($reg['desc_doenca_congenita']) != '') { $this->addDetalhe(array('Quais', $reg['desc_doenca_congenita'])); } $this->addDetalhe(array('É fumante', $reg['fumante'] == 'S' ? 'Sim' : 'Não')); $this->addDetalhe(array('Já contraiu caxumba', $reg['doenca_caxumba'] == 'S' ? 'Sim' : 'Não')); $this->addDetalhe(array('Já contraiu sarampo', $reg['doenca_sarampo'] == 'S' ? 'Sim' : 'Não')); $this->addDetalhe(array('Já contraiu rubeola', $reg['doenca_rubeola'] == 'S' ? 'Sim' : 'Não')); $this->addDetalhe(array('Já contraiu catapora', $reg['doenca_catapora'] == 'S' ? 'Sim' : 'Não')); $this->addDetalhe(array('Já contraiu escarlatina', $reg['doenca_escarlatina'] == 'S' ? 'Sim' : 'Não')); $this->addDetalhe(array('Já contraiu coqueluche', $reg['doenca_coqueluche'] == 'S' ? 'Sim' : 'Não')); if (trim($reg['doenca_outras']) != '') { $this->addDetalhe(array('Outras doenças que o aluno já contraiu', $reg['doenca_outras'])); } $this->addDetalhe(array('Epilético', $reg['epiletico'] == 'S' ? 'Sim' : 'Não')); $this->addDetalhe(array('Está em tratamento', $reg['epiletico_tratamento'] == 'S' ? 'Sim' : 'Não')); $this->addDetalhe(array('Hemofílico', $reg['hemofilico'] == 'S' ? 'Sim' : 'Não')); $this->addDetalhe(array('Hipertenso', $reg['hipertenso'] == 'S' ? 'Sim' : 'Não')); $this->addDetalhe(array('Asmático', $reg['asmatico'] == 'S' ? 'Sim' : 'Não')); $this->addDetalhe(array('Diabético', $reg['diabetico'] == 'S' ? 'Sim' : 'Não')); $this->addDetalhe(array('Depende de insulina', $reg['insulina'] == 'S' ? 'Sim' : 'Não')); $this->addDetalhe(array('Faz tratamento médico', $reg['tratamento_medico'] == 'S' ? 'Sim' : 'Não')); if (trim($reg['desc_tratamento_medico']) != '') { $this->addDetalhe(array('Qual', $reg['desc_tratamento_medico'])); } $this->addDetalhe(array('Ingere medicação específica', $reg['medicacao_especifica'] == 'S' ? 'Sim' : 'Não')); if (trim($reg['desc_medicacao_especifica']) != '') { $this->addDetalhe(array('Qual', $reg['desc_medicacao_especifica'])); } $this->addDetalhe(array('Acompanhamento médico ou psicológico', $reg['acomp_medico_psicologico'] == 'S' ? 'Sim' : 'Não')); if (trim($reg['desc_acomp_medico_psicologico']) != '') { $this->addDetalhe(array('Motivo', $reg['desc_acomp_medico_psicologico'])); } $this->addDetalhe(array('Restrição para atividades físicas', $reg['restricao_atividade_fisica'] == 'S' ? 'Sim' : 'Não')); if (trim($reg['desc_restricao_atividade_fisica']) != '') { $this->addDetalhe(array('Qual', $reg['desc_restricao_atividade_fisica'])); } $this->addDetalhe(array('Teve alguma fratura ou trauma', $reg['fratura_trauma'] == 'S' ? 'Sim' : 'Não')); if (trim($reg['desc_fratura_trauma']) != '') { $this->addDetalhe(array('Qual', $reg['desc_fratura_trauma'])); } $this->addDetalhe(array('Tem plano de saúde', $reg['plano_saude'] == 'S' ? 'Sim' : 'Não')); if (trim($reg['desc_plano_saude']) != '') { $this->addDetalhe(array('Qual', $reg['desc_plano_saude'])); } $this->addDetalhe(array('<span id="tr_tit_dados_hospital">Em caso de emergência, levar para hospital ou clínica</span>')); $this->addDetalhe(array('Nome', $reg['hospital_clinica'])); $this->addDetalhe(array('Endereço', $reg['hospital_clinica_endereco'])); $this->addDetalhe(array('Telefone', $reg['hospital_clinica_telefone'])); $this->addDetalhe(array('<span id="tr_tit_dados_responsavel">Em caso de emergência, se não for possível contatar os responsáveis, comunicar</span>')); $this->addDetalhe(array('Nome', $reg['responsavel'])); $this->addDetalhe(array('Parentesco', $reg['responsavel_parentesco'])); $this->addDetalhe(array('Telefone', $reg['responsavel_parentesco_telefone'])); $this->addDetalhe(array('Celular', $reg['responsavel_parentesco_celular'])); } $objUniforme = new clsModulesUniformeAluno($this->cod_aluno); $reg = $objUniforme->detalhe(); if ($reg) { $this->addDetalhe(array('<span id="funiforme"></span>Recebeu uniforme escolar', $reg['recebeu_uniforme'] == 'S' ? 'Sim' : 'Não')); $this->addDetalhe(array('<span class="tit_uniforme">Camiseta</span>')); $this->addDetalhe(array('Quantidade', $reg['quantidade_camiseta'])); $this->addDetalhe(array('Tamanho', $reg['tamanho_camiseta'])); $this->addDetalhe(array('<span class="tit_uniforme">Blusa/Jaqueta</span>')); $this->addDetalhe(array('Quantidade', $reg['quantidade_blusa_jaqueta'])); $this->addDetalhe(array('Tamanho', $reg['tamanho_blusa_jaqueta'])); $this->addDetalhe(array('<span class="tit_uniforme">Bermuda</span>')); $this->addDetalhe(array('Quantidade', $reg['quantidade_bermuda'])); $this->addDetalhe(array('Tamanho', $reg['tamanho_bermuda'])); $this->addDetalhe(array('<span class="tit_uniforme">Calça</span>')); $this->addDetalhe(array('Quantidade', $reg['quantidade_calca'])); $this->addDetalhe(array('Tamanho', $reg['tamanho_calca'])); $this->addDetalhe(array('<span class="tit_uniforme">Saia</span>')); $this->addDetalhe(array('Quantidade', $reg['quantidade_saia'])); $this->addDetalhe(array('Tamanho', $reg['tamanho_saia'])); $this->addDetalhe(array('<span class="tit_uniforme">Calçado</span>')); $this->addDetalhe(array('Quantidade', $reg['quantidade_calcado'])); $this->addDetalhe(array('Tamanho', $reg['tamanho_calcado'])); $this->addDetalhe(array('<span class="tit_uniforme">Meia</span>')); $this->addDetalhe(array('Quantidade', $reg['quantidade_meia'])); $this->addDetalhe(array('Tamanho', $reg['tamanho_meia'])); } $objMoradia = new clsModulesMoradiaAluno($this->cod_aluno); $reg = $objMoradia->detalhe(); if ($reg) { $moradia = ''; switch ($reg['moradia']) { case 'A': $moradia = 'Apartamento'; break; case 'C': $moradia = 'Casa'; switch ($reg['material']) { case 'A': $moradia .= ' de alvenaria'; break; case 'M': $moradia .= ' de madeira'; break; case 'I': $moradia .= ' mista'; break; } break; case 'O': $moradia = 'Outra: ' . $reg['casa_outra']; break; default: $moradia = 'Não informado'; } $this->addDetalhe(array('<span id="fmoradia"></span>Moradia', $moradia)); $situacao; switch ($reg['moradia_situacao']) { case 1: $situacao = 'Alugado'; break; case 2: $situacao = 'Próprio'; break; case 3: $situacao = 'Cedido'; break; case 4: $situacao = 'Financiado'; break; case 5: $situacao = 'Outra'; break; } $this->addDetalhe(array('Situação', $situacao)); $this->addDetalhe(array('Quantidade de quartos', $reg['quartos'])); $this->addDetalhe(array('Quantidade de salas', $reg['sala'])); $this->addDetalhe(array('Quantidade de copas', $reg['copa'])); $this->addDetalhe(array('Quantidade de banheiros', $reg['banheiro'])); $this->addDetalhe(array('Quantidade de garagens', $reg['garagem'])); $this->addDetalhe(array('Possui empregada doméstica', $reg['empregada_domestica'])); $this->addDetalhe(array('Possui automóvel', $reg['automovel'])); $this->addDetalhe(array('Possui motocicleta', $reg['motocicleta'])); $this->addDetalhe(array('Possui computador', $reg['computador'])); $this->addDetalhe(array('Possui geladeira', $reg['geladeira'])); $this->addDetalhe(array('Possui fogão', $reg['fogao'])); $this->addDetalhe(array('Possui máquina de lavar', $reg['maquina_lavar'])); $this->addDetalhe(array('Possui microondas', $reg['microondas'])); $this->addDetalhe(array('Possui vídeo/dvd', $reg['video_dvd'])); $this->addDetalhe(array('Possui televisão', $reg['televisao'])); $this->addDetalhe(array('Possui celular', $reg['celular'])); $this->addDetalhe(array('Possui telefone', $reg['telefone'])); $this->addDetalhe(array('Quantidade de pessoas', $reg['quant_pessoas'])); $this->addDetalhe(array('Renda familiar', 'R$ ' . $reg['renda'])); $this->addDetalhe(array('Possui água encanada', $reg['agua_encanada'])); $this->addDetalhe(array('Possui poço', $reg['poco'])); $this->addDetalhe(array('Possui energia elétrica', $reg['energia'])); $this->addDetalhe(array('Possui tratamento de esgoto', $reg['esgoto'])); $this->addDetalhe(array('Possui fossa', $reg['fossa'])); $this->addDetalhe(array('Possui coleta de lixo', $reg['lixo'])); } $this->url_cancelar = 'educar_aluno_lst.php'; $this->largura = '100%'; $localizacao = new LocalizacaoSistema(); $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "Início", "educar_index.php" => "i-Educar - Escola", "" => "Detalhe do aluno")); $this->enviaLocalizacao($localizacao->montar()); $this->addDetalhe("<input type='hidden' id='escola_id' name='aluno_id' value='{$registro['ref_cod_escola']}' />"); $this->addDetalhe("<input type='hidden' id='aluno_id' name='aluno_id' value='{$registro['cod_aluno']}' />"); // js Portabilis_View_Helper_Application::loadJQueryLib($this); $scripts = array('/modules/Portabilis/Assets/Javascripts/Utils.js', '/modules/Portabilis/Assets/Javascripts/ClientApi.js', '/modules/Cadastro/Assets/Javascripts/AlunoShow.js'); Portabilis_View_Helper_Application::loadJavascript($this, $scripts); $styles = array('/modules/Cadastro/Assets/Stylesheets/Aluno.css'); Portabilis_View_Helper_Application::loadStylesheet($this, $styles); }
function Gerar() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; session_write_close(); $this->titulo = 'Turma - Detalhe'; $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet'); $this->cod_turma = $_GET['cod_turma']; $tmp_obj = new clsPmieducarTurma(); $lst_obj = $tmp_obj->lista($this->cod_turma, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, array('true', 'false')); $registro = array_shift($lst_obj); foreach ($registro as $key => $value) { $this->{$key} = $value; } if (!$registro) { header('Location: educar_turma_lst.php'); die; } if (class_exists('clsPmieducarTurmaTipo')) { $obj_ref_cod_turma_tipo = new clsPmieducarTurmaTipo($registro['ref_cod_turma_tipo']); $det_ref_cod_turma_tipo = $obj_ref_cod_turma_tipo->detalhe(); $registro['ref_cod_turma_tipo'] = $det_ref_cod_turma_tipo['nm_tipo']; } else { $registro['ref_cod_turma_tipo'] = 'Erro na geração'; } if (class_exists('clsPmieducarInfraPredioComodo')) { $obj_ref_cod_infra_predio_comodo = new clsPmieducarInfraPredioComodo($registro['ref_cod_infra_predio_comodo']); $det_ref_cod_infra_predio_comodo = $obj_ref_cod_infra_predio_comodo->detalhe(); $registro['ref_cod_infra_predio_comodo'] = $det_ref_cod_infra_predio_comodo['nm_comodo']; } else { $registro['ref_cod_infra_predio_comodo'] = 'Erro na geração'; } if (class_exists('clsPmieducarInstituicao')) { $obj_cod_instituicao = new clsPmieducarInstituicao($registro['ref_cod_instituicao']); $obj_cod_instituicao_det = $obj_cod_instituicao->detalhe(); $registro['ref_cod_instituicao'] = $obj_cod_instituicao_det['nm_instituicao']; } else { $registro['ref_cod_instituicao'] = 'Erro na geração'; } if (class_exists('clsPmieducarEscola')) { $this->ref_ref_cod_escola = $registro['ref_ref_cod_escola']; $obj_ref_cod_escola = new clsPmieducarEscola($registro['ref_ref_cod_escola']); $det_ref_cod_escola = $obj_ref_cod_escola->detalhe(); $registro['ref_ref_cod_escola'] = $det_ref_cod_escola['nome']; } else { $registro['ref_cod_escola'] = 'Erro na geração'; } if (class_exists('clsPmieducarCurso')) { $obj_ref_cod_curso = new clsPmieducarCurso($registro['ref_cod_curso']); $det_ref_cod_curso = $obj_ref_cod_curso->detalhe(); $registro['ref_cod_curso'] = $det_ref_cod_curso['nm_curso']; $padrao_ano_escolar = $det_ref_cod_curso['padrao_ano_escolar']; } else { $registro['ref_cod_curso'] = 'Erro na geração'; } if (class_exists('clsPmieducarSerie')) { $this->ref_ref_cod_serie = $registro['ref_ref_cod_serie']; $obj_ser = new clsPmieducarSerie($registro['ref_ref_cod_serie']); $det_ser = $obj_ser->detalhe(); $registro['ref_ref_cod_serie'] = $det_ser['nm_serie']; } else { $registro['ref_ref_cod_serie'] = 'Erro na geração'; } $obj_permissoes = new clsPermissoes(); $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); if ($nivel_usuario == 1) { if ($registro['ref_cod_instituicao']) { $this->addDetalhe(array('Instituição', $registro['ref_cod_instituicao'])); } } if ($nivel_usuario == 1 || $nivel_usuario == 2) { if ($registro['ref_ref_cod_escola']) { $this->addDetalhe(array('Escola', $registro['ref_ref_cod_escola'])); } } if ($registro['ref_cod_curso']) { $this->addDetalhe(array('Curso', $registro['ref_cod_curso'])); } if ($registro['ref_ref_cod_serie']) { $this->addDetalhe(array('Série', $registro['ref_ref_cod_serie'])); } if ($registro['ref_cod_regente']) { $obj_pessoa = new clsPessoa_($registro['ref_cod_regente']); $det = $obj_pessoa->detalhe(); $this->addDetalhe(array('Professor/Regente', $det['nome'])); } if ($registro['ref_cod_infra_predio_comodo']) { $this->addDetalhe(array('Sala', $registro['ref_cod_infra_predio_comodo'])); } if ($registro['ref_cod_turma_tipo']) { $this->addDetalhe(array('Tipo de Turma', $registro['ref_cod_turma_tipo'])); } if ($registro['nm_turma']) { $this->addDetalhe(array('Turma', $registro['nm_turma'])); } if ($registro['sgl_turma']) { $this->addDetalhe(array('Sigla', $registro['sgl_turma'])); } if ($registro['max_aluno']) { $this->addDetalhe(array('Máximo de Alunos', $registro['max_aluno'])); } $this->addDetalhe(array('Situação', dbBool($registro['visivel']) ? 'Ativo' : 'Desativo')); if ($registro['multiseriada'] == 1) { if ($registro['multiseriada'] == 1) { $registro['multiseriada'] = 'sim'; } else { $registro['multiseriada'] = 'não'; } $this->addDetalhe(array('Multi-Seriada', $registro['multiseriada'])); $obj_serie_mult = new clsPmieducarSerie($registro['ref_ref_cod_serie_mult']); $det_serie_mult = $obj_serie_mult->detalhe(); $this->addDetalhe(array('Série Multi-Seriada', $det_serie_mult['nm_serie'])); } if ($padrao_ano_escolar == 1) { if ($registro['hora_inicial']) { $registro['hora_inicial'] = date('H:i', strtotime($registro['hora_inicial'])); $this->addDetalhe(array('Hora Inicial', $registro['hora_inicial'])); } if ($registro['hora_final']) { $registro['hora_final'] = date('H:i', strtotime($registro['hora_final'])); $this->addDetalhe(array('Hora Final', $registro['hora_final'])); } if ($registro['hora_inicio_intervalo']) { $registro['hora_inicio_intervalo'] = date('H:i', strtotime($registro['hora_inicio_intervalo'])); $this->addDetalhe(array('Hora Início Intervalo', $registro['hora_inicio_intervalo'])); } if ($registro['hora_fim_intervalo']) { $registro['hora_fim_intervalo'] = date('H:i', strtotime($registro['hora_fim_intervalo'])); $this->addDetalhe(array('Hora Fim Intervalo', $registro['hora_fim_intervalo'])); } } elseif ($padrao_ano_escolar == 0) { $obj = new clsPmieducarTurmaModulo(); $obj->setOrderby('data_inicio ASC'); $lst = $obj->lista($this->cod_turma); if ($lst) { $tabela = ' <table> <tr align="center"> <td bgcolor="#A1B3BD"><b>Nome</b></td> <td bgcolor="#A1B3BD"><b>Data Início</b></td> <td bgcolor="#A1B3BD"><b>Data Fim</b></td> </tr>'; $cont = 0; foreach ($lst as $valor) { if ($cont % 2 == 0) { $color = ' bgcolor="#E4E9ED" '; } else { $color = ' bgcolor="#FFFFFF" '; } $obj_modulo = new clsPmieducarModulo($valor['ref_cod_modulo']); $det_modulo = $obj_modulo->detalhe(); $nm_modulo = $det_modulo['nm_tipo']; $valor['data_inicio'] = dataFromPgToBr($valor['data_inicio']); $valor['data_fim'] = dataFromPgToBr($valor['data_fim']); $tabela .= sprintf(' <tr> <td %s align=left>%s</td> <td %s align=left>%s</td> <td %s align=left>%s</td> </tr>', $color, $nm_modulo, $color, $valor['data_inicio'], $color, $valor['data_fim']); $cont++; } $tabela .= '</table>'; } if ($tabela) { $this->addDetalhe(array('Módulo', $tabela)); } $dias_da_semana = array('' => 'Selecione', 1 => 'Domingo', 2 => 'Segunda', 3 => 'Terça', 4 => 'Quarta', 5 => 'Quinta', 6 => 'Sexta', 7 => 'Sábado'); $obj = new clsPmieducarTurmaDiaSemana(); $lst = $obj->lista(NULL, $this->cod_turma); if ($lst) { $tabela1 = ' <table> <tr align="center"> <td bgcolor="#A1B3BD"><b>Nome</b></td> <td bgcolor="#A1B3BD"><b>Hora Inicial</b></td> <td bgcolor="#A1B3BD"><b>Hora Final</b></td> </tr>'; $cont = 0; foreach ($lst as $valor) { if ($cont % 2 == 0) { $color = ' bgcolor="#E4E9ED" '; } else { $color = ' bgcolor="#FFFFFF" '; } $valor['hora_inicial'] = date('H:i', strtotime($valor['hora_inicial'])); $valor['hora_final'] = date('H:i', strtotime($valor['hora_final'])); $tabela1 .= sprintf("\n <tr>\n <td %s align=left>%s</td>\n <td %s align=left>%s</td>\n <td %s align=left>%s</td>\n </tr>", $color, $dias_da_semana[$valor['dia_semana']], $color, $valor['hora_inicial'], $color, $valor['hora_final']); $cont++; } $tabela1 .= '</table>'; } if ($tabela1) { $this->addDetalhe(array('Dia da Semana', $tabela1)); } } // Recupera os componentes curriculares da turma $componentes = array(); try { $componentes = App_Model_IedFinder::getComponentesTurma($this->ref_ref_cod_serie, $this->ref_ref_cod_escola, $this->cod_turma); } catch (Exception $e) { } $tabela3 = ' <table> <tr align="center"> <td bgcolor="#A1B3BD"><b>Nome</b></td> <td bgcolor="#A1B3BD"><b>Carga horária</b></td> </tr>'; $cont = 0; foreach ($componentes as $componente) { $color = $cont++ % 2 == 0 ? ' bgcolor="#E4E9ED" ' : ' bgcolor="#FFFFFF" '; $tabela3 .= sprintf(' <tr> <td %s align="left">%s</td> <td %s align="center">%.0f h</td> </tr>', $color, $componente, $color, $componente->cargaHoraria); } $tabela3 .= '</table>'; $this->addDetalhe(array('Componentes curriculares', $tabela3)); if ($obj_permissoes->permissao_cadastra(586, $this->pessoa_logada, 7)) { $this->url_novo = 'educar_turma_cad.php'; $this->url_editar = 'educar_turma_cad.php?cod_turma=' . $registro['cod_turma']; } $this->url_cancelar = 'educar_turma_lst.php'; $this->largura = '100%'; $localizacao = new LocalizacaoSistema(); $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "Início", "educar_index.php" => "i-Educar - Escola", "" => "Detalhe da turma")); $this->enviaLocalizacao($localizacao->montar()); $this->array_botao[] = 'Reclassificar alunos alfabeticamente'; $this->array_botao_url_script[] = "if(confirm(\"Deseja realmente reclassificar os alunos alfabeticamente?\\nAo utilizar esta opção para esta turma, a ordenação dos alunos no diário e em relatórios que é controlada por ordem de chegada após a data de fechamento da turma (campo Data de fechamento), passará a ter o controle novamente alfabético, desconsiderando a data de fechamento.\"))reclassifica_matriculas({$registro['cod_turma']})"; Portabilis_View_Helper_Application::loadJQueryLib($this); $scripts = array('/modules/Portabilis/Assets/Javascripts/Utils.js', '/modules/Portabilis/Assets/Javascripts/ClientApi.js', '/modules/Cadastro/Assets/Javascripts/TurmaDet.js'); Portabilis_View_Helper_Application::loadJavascript($this, $scripts); }
function Gerar() { // js Portabilis_View_Helper_Application::loadJQueryLib($this); $scripts = array('/modules/Portabilis/Assets/Javascripts/Utils.js', '/modules/Portabilis/Assets/Javascripts/ClientApi.js', '/modules/Cadastro/Assets/Javascripts/Escola.js'); Portabilis_View_Helper_Application::loadJavascript($this, $scripts); $obj_permissoes = new clsPermissoes(); // echo "<pre>";print_r($_POST);die; if (!$this->sem_cnpj && !$this->com_cnpj) { $parametros = new clsParametrosPesquisas(); $parametros->setSubmit(1); $parametros->setPessoa('J'); $parametros->setPessoaCampo('sem_cnpj'); $parametros->setPessoaNovo("S"); $parametros->setPessoaCPF("N"); $parametros->setPessoaTela('window'); $this->campoOculto("sem_cnpj", ""); $parametros->setCodSistema(13); $parametros->adicionaCampoTexto("cnpj", "cnpj"); $this->campoCnpjPesq("cnpj", "CNPJ", $this->cnpj, "pesquisa_pessoa_lst.php", $parametros->serializaCampos(), true); // $this->acao_enviar = "obj = document.getElementById(\"cnpj\");if(obj.value != \"\" ) {document.getElementById(\"formcadastro\").submit(); } else { acao(); }"; $this->acao_enviar = false; $this->url_cancelar = false; $this->array_botao = array("Continuar", "Cancelar"); $this->array_botao_url_script = array("obj = document.getElementById('cnpj');if(obj.value != '' ) { acao(); } else { acao(); }", "go('educar_escola_lst.php');"); } else { $this->inputsHelper()->integer('escola_inep_id', array('label' => 'Código inep', 'required' => false, 'max_length' => 14)); if ($_POST) { foreach ($_POST as $campo => $val) { if ($campo != 'tipoacao' && $campo != 'sem_cnpj') { $this->{$campo} = $this->{$campo} ? $this->{$campo} : $val; } } } if ($this->sem_cnpj) { $this->campoOculto("sem_cnpj", $this->sem_cnpj); // cadastro novo sem CNPJ $this->p_ddd_telefone_1 = $this->p_ddd_telefone_1 == null ? "" : $this->p_ddd_telefone_1; $this->p_ddd_telefone_fax = $this->p_ddd_telefone_fax == null ? "" : $this->p_ddd_telefone_fax; if ($this->ref_idpes) { $objTemp = new clsPessoaJuridica($this->ref_idpes); $detalhe = $objTemp->detalhe(); } // $this->campoOculto( "passo", 4 ); // $this->campoOculto( "sem_cnpj", 0 ); $this->campoOculto("cod_escola", $this->cod_escola); // text $this->campoTexto("fantasia", "Escola", $this->fantasia, 30, 255, true); $this->campoTexto("sigla", "Sigla", $this->sigla, 30, 255, true); // foreign keys $nivel = $obj_permissoes->nivel_acesso($this->pessoa_logada); if ($nivel == 1) { $cabecalhos[] = "Instituicao"; $objInstituicao = new clsPmieducarInstituicao(); $opcoes = array("" => "Selecione"); $objInstituicao->setOrderby("nm_instituicao ASC"); $lista = $objInstituicao->lista(); if (is_array($lista)) { foreach ($lista as $linha) { $opcoes[$linha["cod_instituicao"]] = $linha["nm_instituicao"]; } } $this->campoLista("ref_cod_instituicao", "Instituição", $opcoes, $this->ref_cod_instituicao); } else { $this->ref_cod_instituicao = $obj_permissoes->getInstituicao($this->pessoa_logada); if ($this->ref_cod_instituicao) { $this->campoOculto("ref_cod_instituicao", $this->ref_cod_instituicao); } else { die("Usu�rio n�o � do nivel poli-institucional e n�o possui uma institui��o"); } } $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarEscolaRedeEnsino")) { /*$todas_redes_ensino = "rede_ensino = new Array();\n"; $objTemp = new clsPmieducarEscolaRedeEnsino(); $lista = $objTemp->lista(); if ( is_array( $lista ) && count( $lista ) ) { foreach ( $lista as $registro ) { $todas_redes_ensino .= "rede_ensino[rede_ensino.length] = new Array( {$registro["cod_escola_rede_ensino"]}, '{$registro['nm_rede']}', {$registro["ref_cod_instituicao"]} );\n"; } } echo "<script>{$todas_redes_ensino}</script>";*/ // EDITAR $script = "javascript:showExpansivelIframe(520, 120, 'educar_escola_rede_ensino_cad_pop.php');"; if ($this->ref_cod_instituicao) { $objTemp = new clsPmieducarEscolaRedeEnsino(); $lista = $objTemp->lista(null, null, null, null, null, null, null, null, 1, $this->ref_cod_instituicao); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes["{$registro['cod_escola_rede_ensino']}"] = "{$registro['nm_rede']}"; } } $script = "<img id='img_rede_ensino' style='display: \\'\\'' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } else { $script = "<img id='img_rede_ensino' style='display: none;' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } } else { echo "<!--\nErro\nClasse clsPmieducarEscolaRedeEnsino nao encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); } $this->campoLista("ref_cod_escola_rede_ensino", "Rede Ensino", $opcoes, $this->ref_cod_escola_rede_ensino, "", false, "", $script); $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarEscolaLocalizacao")) { /*$todas_escolas_localizacao = "escola_localizacao = new Array();\n"; $objTemp = new clsPmieducarEscolaLocalizacao(); $lista = $objTemp->lista(); if ( is_array( $lista ) && count( $lista ) ) { foreach ( $lista as $registro ) { $todas_escolas_localizacao .= "escola_localizacao[escola_localizacao.length] = new Array( {$registro["cod_escola_localizacao"]}, '{$registro['nm_localizacao']}', {$registro["ref_cod_instituicao"]} );\n"; } } echo "<script>{$todas_escolas_localizacao}</script>";*/ // EDITAR $script = "javascript:showExpansivelIframe(520, 120, 'educar_escola_localizacao_cad_pop.php');"; if ($this->ref_cod_instituicao) { $objTemp = new clsPmieducarEscolaLocalizacao(); $lista = $objTemp->lista(null, null, null, null, null, null, null, null, 1, $this->ref_cod_instituicao); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes["{$registro['cod_escola_localizacao']}"] = "{$registro['nm_localizacao']}"; } } $script = "<img id='img_localizacao' style='display: \\'\\'' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } else { $script = "<img id='img_localizacao' style='display: none;' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } } else { echo "<!--\nErro\nClasse clsPmieducarEscolaLocalizacao nao encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); } $this->campoLista("ref_cod_escola_localizacao", "Escola Localização", $opcoes, $this->ref_cod_escola_localizacao, "", false, "", $script); if (is_numeric($this->cep)) { $this->cep = int2CEP($this->cep); } // $this->campoCep( "cep","CEP", $this->cep,true,"-",false,false ); $this->campoCep("cep", "CEP", $this->cep, true, "-", false, false); $this->campoTexto("cidade", "Cidade", $this->cidade, "50", "255", true); $this->campoTexto("bairro", "Bairro", $this->bairro, "50", "20", true); $this->campoTexto("logradouro", "Logradouro", $this->logradouro, "50", "255", true); $this->campoTexto("complemento", "Complemento", $this->complemento, "22", "20", false); $this->campoNumero("numero", "Número", $this->numero, "6", "6", true); $this->campoTexto("p_ddd_telefone_1", "DDD Telefone 1", $this->p_ddd_telefone_1, "2", "2", false); $this->campoTexto("p_telefone_1", "Telefone 1", $this->p_telefone_1, "10", "15", false); $this->campoTexto("p_ddd_telefone_fax", "DDD Fax", $this->p_ddd_telefone_fax, "2", "2", false); $this->campoTexto("p_telefone_fax", "Fax", $this->p_telefone_fax, "10", "15", false); $this->campoTexto("p_email", "E-mail", $this->p_email, "50", "255", false); } if ($this->com_cnpj) { $this->campoOculto("com_cnpj", $this->com_cnpj); // die("com CNPJ"); // echo "<br>cep: ".$this->cep; // echo "<br>cep_: ".$this->cep_; if (!$this->cod_escola) { $this->cnpj = urldecode($_POST['cnpj']); $this->cnpj = idFederal2int($this->cnpj); // echo int2IdFederal($this->cnpj); $this->cnpj = int2IdFederal($this->cnpj); } // echo "sakdmk: ".$this->cnpj;die; // cadastro novo com CNPJ //echo "hehehe".idFederal2int($this->cnpj);echo "kiki".int2IdFederal($this->cnpj);die; $objJuridica = new clsPessoaJuridica(false, idFederal2int($this->cnpj)); $det = $objJuridica->detalhe(); $this->ref_idpes = $det["idpes"]; // if( $this->ref_idpes ) // { // $this->p_ddd_telefone_1 = ( $this->p_ddd_telefone_1 == null ) ? "": is_numeric( $this->p_ddd_telefone_1 ); // $this->p_ddd_telefone_2 = ( $this->p_ddd_telefone_2 == null ) ? "": is_numeric( $this->p_ddd_telefone_2 ); // $this->p_ddd_telefone_3 = ( $this->p_ddd_telefone_3 == null ) ? "": is_numeric( $this->p_ddd_telefone_3 ); // $obj_pessoa = new clsPessoa_( $this->ref_idpes ); // $det_pessoa = $obj_pessoa->detalhe(); //$this->fantasia = $det_pessoa["nome"]; // $this->nm_escola = $det["nome"]; if (!$this->fantasia) { $this->fantasia = $det["fantasia"]; } if ($this->passou) { $this->cnpj = is_numeric($this->cnpj) ? $this->cnpj : idFederal2int($this->cnpj); $this->cnpj = int2IdFederal($this->cnpj); } // $this->campoRotulo("cnpj_", "CNPJ", $this->cnpj); $this->campoOculto("cnpj", idFederal2int($this->cnpj)); $this->campoOculto("ref_idpes", $this->ref_idpes); // $this->campoOculto( "passo", 3 ); $this->campoOculto("cod_escola", $this->cod_escola); // text $this->campoTexto("fantasia", "Escola", $this->fantasia, 30, 255, true); $this->campoTexto("sigla", "Sigla", $this->sigla, 30, 20, true); // foreign keys $nivel = $obj_permissoes->nivel_acesso($this->pessoa_logada); if ($nivel == 1) { $cabecalhos[] = "Instituicao"; $objInstituicao = new clsPmieducarInstituicao(); $opcoes = array("" => "Selecione"); $objInstituicao->setOrderby("nm_instituicao ASC"); $lista = $objInstituicao->lista(); if (is_array($lista)) { foreach ($lista as $linha) { $opcoes[$linha["cod_instituicao"]] = $linha["nm_instituicao"]; } } $this->campoLista("ref_cod_instituicao", "Instituicao", $opcoes, $this->ref_cod_instituicao); } else { $this->ref_cod_instituicao = $obj_permissoes->getInstituicao($this->pessoa_logada); if ($this->ref_cod_instituicao) { $this->campoOculto("ref_cod_instituicao", $this->ref_cod_instituicao); } else { die("Usu�rio n�o � do nivel poli-institucional e n�o possui uma institui��o"); } } $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarEscolaRedeEnsino")) { /*$todas_redes_ensino = "rede_ensino = new Array();\n"; $objTemp = new clsPmieducarEscolaRedeEnsino(); $lista = $objTemp->lista( null,null,null,null,null,null,null,null,1 ); if ( is_array( $lista ) && count( $lista ) ) { foreach ( $lista as $registro ) { $todas_redes_ensino .= "rede_ensino[rede_ensino.length] = new Array( {$registro["cod_escola_rede_ensino"]}, '{$registro['nm_rede']}', {$registro["ref_cod_instituicao"]} );\n"; } } echo "<script>{$todas_redes_ensino}</script>";*/ // EDITAR $script = "javascript:showExpansivelIframe(520, 120, 'educar_escola_rede_ensino_cad_pop.php');"; if ($this->ref_cod_instituicao) { $objTemp = new clsPmieducarEscolaRedeEnsino(); $lista = $objTemp->lista(null, null, null, null, null, null, null, null, 1, $this->ref_cod_instituicao); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes["{$registro['cod_escola_rede_ensino']}"] = "{$registro['nm_rede']}"; } } $script = "<img id='img_rede_ensino' style='display:\\'\\'' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } else { $script = "<img id='img_rede_ensino' style='display: none;' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } } else { echo "<!--\nErro\nClasse clsPmieducarEscolaRedeEnsino nao encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); } $this->campoLista("ref_cod_escola_rede_ensino", "Rede Ensino", $opcoes, $this->ref_cod_escola_rede_ensino, "", false, "", $script); $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarEscolaLocalizacao")) { /*$todas_escolas_localizacao = "escola_localizacao = new Array();\n"; $objTemp = new clsPmieducarEscolaLocalizacao(); $lista = $objTemp->lista( null,null,null,null,null,null,null,null,1 ); if ( is_array( $lista ) && count( $lista ) ) { foreach ( $lista as $registro ) { $todas_escolas_localizacao .= "escola_localizacao[escola_localizacao.length] = new Array( {$registro["cod_escola_localizacao"]}, '{$registro['nm_localizacao']}', {$registro["ref_cod_instituicao"]} );\n"; } } echo "<script>{$todas_escolas_localizacao}</script>";*/ // EDITAR $script = "javascript:showExpansivelIframe(520, 120, 'educar_escola_localizacao_cad_pop.php');"; if ($this->ref_cod_instituicao) { $objTemp = new clsPmieducarEscolaLocalizacao(); $lista = $objTemp->lista(null, null, null, null, null, null, null, null, 1, $this->ref_cod_instituicao); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes["{$registro['cod_escola_localizacao']}"] = "{$registro['nm_localizacao']}"; } } $script = "<img id='img_localizacao' style='display:\\'\\'' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } else { $script = "<img id='img_localizacao' style='display: none;' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } } else { echo "<!--\nErro\nClasse clsPmieducarEscolaLocalizacao nao encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); } $this->campoLista("ref_cod_escola_localizacao", "Escola Localização", $opcoes, $this->ref_cod_escola_localizacao, "", false, "", $script); // Detalhes do Endereco $objUf = new clsUf(); $listauf = $objUf->lista(); $listaEstado = array("" => "Selecione"); if ($listauf) { foreach ($listauf as $uf) { $listaEstado[$uf['sigla_uf']] = $uf['sigla_uf']; } } $objTipoLog = new clsTipoLogradouro(); $listaTipoLog = $objTipoLog->lista(); $listaTLog = array("" => "Selecione"); if ($listaTipoLog) { foreach ($listaTipoLog as $tipoLog) { $listaTLog[urldecode($tipoLog['idtlog'])] = $tipoLog['descricao']; } } $this->campoOculto("isEnderecoExterno", $this->isEnderecoExterno); // echo "$this->cep ,$this->sigla_uf "; $this->campoOculto("cep_", $this->cep_); $this->campoOculto("sigla_uf_", $this->sigla_uf_); $this->campoOculto("cidade_", $this->cidade_); $this->campoOculto("bairro_", $this->bairro_); $this->campoOculto("idbai", $this->idbai); $this->campoOculto("logradouro_", $this->logradouro_); $this->campoOculto("idlog", $this->idlog); $this->campoOculto("idtlog_", $this->idtlog_); $disabled = $this->isEnderecoExterno ? false : true; if ($this->idlog && $this->idbai && $this->cep && $this->ref_idpes) { $this->campoOculto("cep_", $this->cep); $this->cep_ = int2CEP($this->cep); //$this->campoLista( "ref_cod_escola_localizacao", "Escola Localizacão", $opcoes, $this->ref_cod_escola_localizacao ); // $this->campoCep("cep_","CEP", int2CEP($this->cep),true,"-"," <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f('pesquisa_cep3.php', 'enderecos')\" style=\"cursor: hand;\">",true); // $this->campoCep( "cep_", "CEP", int2CEP( $this->cep ), true, "-", " <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f( 'pesquisa_cep_lst.php', 'enderecos' )\" style=\"cursor: hand;\">", false ); //$this->campoCep( "cep", "CEP", int2CEP( $this->cep ), true, "-", " <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_popless('pesquisa_cep_lst.php', 'enderecos')\" style=\"cursor: hand;\">", true ); $this->campoCep("cep", "CEP", $this->cep_, true, "-", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'educar_pesquisa_cep_log_bairro.php?campo1=bairro&campo2=idbai&campo3=cep_&campo4=logradouro&campo5=idlog&campo6=sigla_uf_&campo7=cidade&campo8=idtlog_&campo9=isEnderecoExterno&campo10=cep&campo11=sigla_uf&campo12=idtlog&campo13=cidade_\\'></iframe>');\">", $disabled); $this->campoLista("sigla_uf", "Estado", $listaEstado, $this->sigla_uf, false, false, false, false, true, true); $this->campoTexto("cidade", "Cidade", $this->cidade, "50", "255", true, false, false, "", "", "", "onKeyUp", true); $this->campoTexto("bairro", "Bairro", $this->bairro, "50", "255", true, false, false, "", "", "", "onKeyUp", true); $this->campoLista("idtlog", "Tipo Logradouro", $listaTLog, $this->idtlog, false, false, false, false, true, true); $this->campoTexto("logradouro", "Logradouro", $this->logradouro, "50", "255", true, false, false, "", "", "", "onKeyUp", true); $this->campoTexto("complemento", "Complemento", $this->complemento, "22", "20", false, false); $this->campoNumero("numero", "Número", $this->numero, "6", "6", false); $this->campoNumero("andar", "Andar", $this->andar, "2", "2", false); } elseif ($this->ref_idpes && $this->cep) { $this->cep = is_numeric($this->cep) ? int2CEP($this->cep) : $this->cep; // $this->campoCep("cep_","CEP", int2CEP($this->cep),true,"-"," <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f('pesquisa_cep3.php', 'enderecos')\" style=\"cursor: hand;\">",false); // $this->campoCep( "cep_", "CEP", int2CEP( $this->cep ), true, "-", " <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f( 'pesquisa_cep_lst.php', 'enderecos' )\" style=\"cursor: hand;\">", false ); //$this->campoCep( "cep", "CEP", int2CEP( $this->cep ), true, "-", " <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_popless('pesquisa_cep_lst.php', 'enderecos')\" style=\"cursor: hand;\">", false ); $this->campoCep("cep", "CEP", $this->cep, true, "-", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'educar_pesquisa_cep_log_bairro.php?campo1=bairro&campo2=idbai&campo3=cep_&campo4=logradouro&campo5=idlog&campo6=sigla_uf_&campo7=cidade&campo8=idtlog_&campo9=isEnderecoExterno&campo10=cep&campo11=sigla_uf&campo12=idtlog&campo13=cidade_\\'></iframe>');\">"); $this->campoLista("sigla_uf", "Estado", $listaEstado, $this->sigla_uf, "", false, "", "", false, true); $this->campoTexto("cidade", "Cidade", $this->cidade, "50", "255", true, false, false, "", "", "", "onKeyUp", false); $this->campoTexto("bairro", "Bairro", $this->bairro, "50", "255", true, false, false, "", "", "", "onKeyUp", false); $this->campoLista("idtlog", "Tipo Logradouro", $listaTLog, $this->idtlog, "", false, "", "", false, true); $this->campoTexto("logradouro", "Logradouro", $this->logradouro, "50", "255", true, false, false, "", "", "", "onKeyUp", false); $this->campoTexto("complemento", "Complemento", $this->complemento, "22", "20", false, false, false, "", "", "", "onKeyUp", false); $this->campoNumero("numero", "Número", $this->numero, 6, 6, false, "", ""); $this->campoNumero("andar", "Andar", $this->andar, "2", "2", false); } else { if (!$this->isEnderecoExterno) { $obj_bairro = new clsBairro($this->idbai); $this->cep_ = int2CEP($this->cep_); $obj_bairro_det = $obj_bairro->detalhe(); if ($obj_bairro_det) { $this->bairro = $obj_bairro_det["nome"]; } $obj_log = new clsLogradouro($this->idlog); $obj_log_det = $obj_log->detalhe(); if ($obj_log_det) { $this->logradouro = $obj_log_det["nome"]; $this->idtlog = $obj_log_det["idtlog"]->idtlog; $obj_mun = new clsMunicipio($obj_log_det["idmun"]); $det_mun = $obj_mun->detalhe(); if ($det_mun) { $this->cidade = strtoupper(ucfirst(strtolower($det_mun["nome"]))); } $this->sigla_uf = $this->sigla_uf_ = $det_mun['sigla_uf']->sigla_uf; } } else { $this->cep_ = $this->cep; } /*$obj_bairro = new clsBairro($obj_endereco_det["ref_idbai"]); $obj_bairro_det = $obj_bairro->detalhe(); if($obj_bairro_det){ $this->bairro = $obj_bairro_det["nome"]; }*/ // $this->campoCep("cep_","CEP", int2CEP($this->cep),true,"-"," <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f('pesquisa_cep3.php', 'enderecos')\" style=\"cursor: hand;\">",true); // $this->campoCep( "cep_", "CEP", int2CEP( $this->cep ), true, "-", " <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f( 'pesquisa_cep_lst.php', 'enderecos' )\" style=\"cursor: hand;\">", false ); // $this->campoCep( "cep_", "CEP", int2CEP( $this->cep ), true, "-", " <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_popless('pesquisa_cep_lst.php', 'enderecos')\" style=\"cursor: hand;\">", false ); $this->campoCep("cep", "CEP", $this->cep_, true, "-", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'educar_pesquisa_cep_log_bairro.php?campo1=bairro&campo2=idbai&campo3=cep_&campo4=logradouro&campo5=idlog&campo6=sigla_uf_&campo7=cidade&campo8=idtlog_&campo9=isEnderecoExterno&campo10=cep&campo11=sigla_uf&campo12=idtlog&campo13=cidade_\\'></iframe>');\">", $disabled); // $this->campoCep("cep_", "CEP", $this->cep_, true, "-", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\'miolo\' id=\'miolo\' frameborder=\'0\' height=\'100%\' width=\'500\' marginheight=\'0\' marginwidth=\'0\' src=\'educar_pesquisa_cep_log_bairro.php?campo1=nm_bairro&campo2=id_bairro&campo3=id_cep&campo4=nm_logradouro&campo5=id_logradouro&campo6=ref_sigla_uf&campo7=cidade&campo8=ref_idtlog_&campo9=isEnderecoExterno&campo10=cep_&campo11=ref_sigla_uf_&campo12=ref_idtlog&campo13=id_cidade\'></iframe>');\">", $disabled); $this->campoLista("sigla_uf", "Estado", $listaEstado, $this->sigla_uf, false, false, false, false, $disabled, true); $this->campoTexto("cidade", "Cidade", $this->cidade, "50", "255", true, false, false, "", "", "", "", $disabled, true); $this->campoTexto("bairro", "Bairro", $this->bairro, "50", "20", true, false, false, "", "", "", "", $disabled, true); $this->campoLista("idtlog", "Tipo Logradouro", $listaTLog, $this->idtlog, false, false, false, false, $disabled, true); $this->campoTexto("logradouro", "Logradouro", $this->logradouro, "50", "255", true, false, false, "", "", "", "", $disabled, true); $this->campoTexto("complemento", "Complemento", $this->complemento, "22", "20", false, false, false); $this->campoNumero("numero", "Número", $this->numero, "6", "6", false); $this->campoNumero("andar", "Andar", $this->andar, "2", "2", false); } $this->campoNumero("p_ddd_telefone_1", "DDD Telefone 1", $this->p_ddd_telefone_1, 2, 2, false); $this->campoNumero("p_telefone_1", "Telefone 1", $this->p_telefone_1, 10, 15, false); $this->campoNumero("p_ddd_telefone_2", "DDD Telefone 2", $this->p_ddd_telefone_2, 2, 2, false); $this->campoNumero("p_telefone_2", "Telefone", $this->p_telefone_2, 10, 15, false); $this->campoNumero("p_ddd_telefone_fax", "DDD Fax", $this->p_ddd_telefone_fax, 2, 2, false); $this->campoNumero("p_telefone_fax", "Fax", $this->p_telefone_fax, 10, 15, false); $this->campoTexto("p_http", "Site", $this->p_http, "50", "255", false); $this->campoTexto("p_email", "E-mail", $this->p_email, "50", "255", false); // } // else // { // $this->mensagem = "nop"; // } $this->passou = true; $this->campoOculto("passou", $this->passou); } // else if ( $this->passo == 3 ) // { // // // // } $this->campoCheck("bloquear_lancamento_diario_anos_letivos_encerrados", "Bloquear lançamento no diário para anos letivos encerrados", $this->bloquear_lancamento_diario_anos_letivos_encerrados); if ($_POST["escola_curso"]) { $this->escola_curso = unserialize(urldecode($_POST["escola_curso"])); } if (is_numeric($this->cod_escola) && !$_POST) { $obj = new clsPmieducarEscolaCurso($this->cod_escola); $registros = $obj->lista($this->cod_escola); if ($registros) { foreach ($registros as $campo) { $this->escola_curso[$campo["ref_cod_curso"]] = $campo["ref_cod_curso"]; } } } if ($_POST["ref_cod_curso"]) { $this->escola_curso[$_POST["ref_cod_curso"]] = $_POST["ref_cod_curso"]; unset($this->ref_cod_curso); } $this->campoQuebra(); $this->campoOculto("excluir_curso", ""); unset($aux); if ($this->escola_curso) { // echo "<pre>";print_r($this->escola_curso); foreach ($this->escola_curso as $curso) { if ($this->excluir_curso == $curso) { unset($this->escola_curso[$curso]); // = null; $this->excluir_curso = null; } else { $obj_curso = new clsPmieducarCurso($curso); $obj_curso_det = $obj_curso->detalhe(); $nm_curso = $obj_curso_det["nm_curso"]; $this->campoTextoInv("ref_cod_curso_{$curso}", "", $nm_curso, 30, 255, false, false, false, "", "<a href='#' onclick=\"getElementById('excluir_curso').value = '{$curso}'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bola_xis.gif' title='Excluir' border=0></a>"); $aux[$curso] = $curso; } } unset($this->escola_curso); $this->escola_curso = $aux; } $this->campoOculto("escola_curso", serialize($this->escola_curso)); $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarCurso")) { /*$todos_cursos = "curso = new Array();\n"; $objTemp = new clsPmieducarCurso(); $objTemp->setOrderby("nm_curso"); $lista = $objTemp->lista( null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1 ); if ( is_array( $lista ) && count( $lista ) ) { foreach ( $lista as $registro ) { $todos_cursos .= "curso[curso.length] = new Array({$registro["cod_curso"]},'{$registro["nm_curso"]}', {$registro["ref_cod_instituicao"]});\n"; } } echo "<script>{$todos_cursos}</script>";*/ // EDITAR if ($this->cod_escola || $this->ref_cod_instituicao) { $objTemp = new clsPmieducarCurso(); $objTemp->setOrderby("nm_curso"); $lista = $objTemp->lista(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1, null, $this->ref_cod_instituicao); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes["{$registro['cod_curso']}"] = "{$registro['nm_curso']}"; } } } } else { echo "<!--\nErro\nClasse clsPmieducarCurso não encontrada\n-->"; $opcoes = array("" => "Erro na geração"); } if ($aux) { $this->campoLista("ref_cod_curso", "Curso", $opcoes, $this->ref_cod_curso, "", false, "", "<a href='#' onclick=\"getElementById('incluir_curso').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_adiciona.gif' title='Incluir' border=0></a>", false, false); } else { $this->campoLista("ref_cod_curso", "Curso", $opcoes, $this->ref_cod_curso, "", false, "", "<a href='#' onclick=\"getElementById('incluir_curso').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_adiciona.gif' title='Incluir' border=0></a>"); } $this->campoOculto("incluir_curso", ""); $this->campoQuebra(); } }
public function bibliotecaPesquisaObra($options = array()) { $defaultOptions = array('id' => null, 'options' => array(), 'hiddenInputOptions' => array()); $options = $this->mergeOptions($options, $defaultOptions); $inputHint = "<img border='0' onclick='pesquisaObra();' id='lupa_pesquisa_obra' name='lupa_pesquisa_obra' src='imagens/lupa.png' />"; // se não recuperar obra, deixa titulo em branco $obra = $this->getObra($options['id']); $tituloObra = $obra ? $obra['titulo'] : ''; $defaultInputOptions = array('id' => 'titulo_obra', 'label' => 'Obra', 'value' => $tituloObra, 'size' => '30', 'max_length' => '255', 'required' => true, 'expressao' => false, 'inline' => false, 'label_hint' => '', 'input_hint' => $inputHint, 'callback' => '', 'event' => 'onKeyUp', 'disabled' => true); $inputOptions = $this->mergeOptions($options['options'], $defaultInputOptions); call_user_func_array(array($this->viewInstance, 'campoTexto'), $inputOptions); // hidden input $defaultHiddenInputOptions = array('id' => 'ref_cod_acervo', 'value' => $this->getAcervoId($options['id'])); $hiddenInputOptions = $this->mergeOptions($options['hiddenInputOptions'], $defaultHiddenInputOptions); call_user_func_array(array($this->viewInstance, 'campoOculto'), $hiddenInputOptions); // Ao selecionar obra, na pesquisa de obra é setado o value deste elemento $this->viewInstance->campoOculto("cod_biblioteca", ""); Portabilis_View_Helper_Application::embedJavascript($this->viewInstance, ' var resetObra = function(){ $("#ref_cod_acervo").val(""); $("#titulo_obra").val(""); } $("#ref_cod_biblioteca").change(resetObra);', true); Portabilis_View_Helper_Application::embedJavascript($this->viewInstance, ' function pesquisaObra() { var additionalFields = getElementFor("biblioteca"); var exceptFields = getElementFor("titulo_obra"); if (validatesPresenseOfValueInRequiredFields(additionalFields, exceptFields)) { var bibliotecaId = getElementFor("biblioteca").val(); pesquisa_valores_popless("educar_pesquisa_obra_lst.php?campo1=ref_cod_acervo&campo2=titulo_obra&campo3="+bibliotecaId) } }'); }
protected function loadAssets() { $rootPath = $_SERVER['DOCUMENT_ROOT']; $style = "/modules/DynamicInput/Assets/Stylesheets/{$this->helperName()}.css"; $script = "/modules/DynamicInput/Assets/Javascripts/{$this->helperName()}.js"; if (file_exists($rootPath . $style)) { Portabilis_View_Helper_Application::loadStylesheet($this->viewInstance, $style); } if (file_exists($rootPath . $script)) { Portabilis_View_Helper_Application::loadJavascript($this->viewInstance, $script); } }
protected function reCaptchaFixup() { $this->campoRotulo('replace_by_recaptcha_widget_wrapper', 'Confirmação visual', '<div id="replace_by_recaptcha_widget"></div>'); $js = "function replaceRecaptchaWidget() {\n var emptyElement = document.getElementById('replace_by_recaptcha_widget');\n var originElement = document.getElementById('recaptcha_widget_div');\n emptyElement.parentNode.replaceChild(originElement, emptyElement);\n }\n\n window.onload = replaceRecaptchaWidget;"; Portabilis_View_Helper_Application::embedJavascript($this, $js); }
function afterChangePessoa($id) { Portabilis_View_Helper_Application::embedJavascript($this, "\n\n if(window.opener && window.opener.afterChangePessoa) {\n var parentType = \$j('#parent_type').val();\n\n if (parentType)\n window.opener.afterChangePessoa(self, parentType, {$id}, \$j('#nm_pessoa').val());\n else\n window.opener.afterChangePessoa(self, {$id});\n }\n else\n document.location = 'atendidos_lst.php';\n\n ", $afterReady = true); }
function Gerar() { if ($_POST) { foreach ($_POST as $campo => $val) { $this->{$campo} = !$this->{$campo} ? $val : $this->{$campo}; } } $this->campoRotulo("cod_rota", "Código da rota", $this->cod_rota); $this->campoRotulo("descricao", "Rota", $this->descricao); $this->campoQuebra(); if (is_numeric($this->cod_rota) && !$_POST) { $obj = new clsModulesItinerarioTransporteEscolar(); $obj->setOrderby(" seq ASC"); $registros = $obj->lista(null, $this->cod_rota); $qtd_pontos = 0; if ($registros) { foreach ($registros as $campo) { $this->pontos[$qtd_pontos][] = $campo["ref_cod_ponto_transporte_escolar"] . ' - ' . $campo["descricao"]; $this->pontos[$qtd_pontos][] = $campo["hora"]; $this->pontos[$qtd_pontos][] = $campo["tipo"]; $this->pontos[$qtd_pontos][] = $campo["ref_cod_veiculo"] . ' - ' . $campo["nome_onibus"]; $qtd_pontos++; } } } $this->campoTabelaInicio("pontos", "Itinerário", array("Ponto (Requer pré-cadastro)<br/> <spam style=\" font-weight: normal; font-size: 10px;\">Digite o código ou nome do ponto e selecione o desejado</spam>", "Hora", "Tipo", "Veículo (Requer pré-cadastro)<br/> <spam style=\" font-weight: normal; font-size: 10px;\">Digite o código, nome ou placa do veículo e selecione o desejado</spam>"), $this->pontos); $this->campoTexto("ref_cod_ponto_transporte_escolar", "Ponto (Requer pré-cadastro)", $this->ref_cod_ponto_transporte_escolar, 50, 255, false, true, false, '', '', '', 'onfocus'); $this->campoHora("hora", "Hora", $this->hora); $this->campoLista("tipo", "Tipo", array('' => "Selecione", 'I' => 'Ida', 'V' => 'Volta'), $this->tipo); $this->campoTexto("ref_cod_veiculo", "Veículo", $this->ref_cod_veiculo, 50, 255, false, false, false, '', '', '', 'onfocus'); $this->campoTabelaFim(); $this->campoQuebra(); $style = "/modules/Portabilis/Assets/Stylesheets/Frontend.css"; Portabilis_View_Helper_Application::loadStylesheet($this, $style); Portabilis_View_Helper_Application::loadJQueryLib($this); Portabilis_View_Helper_Application::loadJQueryUiLib($this); Portabilis_View_Helper_Application::loadJavascript($this, array('/modules/Portabilis/Assets/Javascripts/Utils.js', '/modules/Portabilis/Assets/Javascripts/Frontend/Inputs/SimpleSearch.js', '/modules/Portabilis/Assets/Javascripts/Validator.js')); $this->addBotao('Excluir todos', "transporte_itinerario_del.php?cod_rota={$this->cod_rota}"); }
protected function loadAssets() { Portabilis_View_Helper_Application::loadJQueryLib($this); Portabilis_View_Helper_Application::loadJQueryFormLib($this); $styles = array('/modules/Portabilis/Assets/Stylesheets/Frontend.css', '/modules/Portabilis/Assets/Stylesheets/Frontend/Resource.css', 'styles/localizacaoSistema.css'); Portabilis_View_Helper_Application::loadStylesheet($this, $styles); $scripts = array('/modules/Portabilis/Assets/Javascripts/ClientApi.js', '/modules/Portabilis/Assets/Javascripts/Validator.js', '/modules/Portabilis/Assets/Javascripts/Utils.js'); if (!$this->backwardCompatibility) { $scripts[] = '/modules/Portabilis/Assets/Javascripts/Frontend/Resource.js'; } Portabilis_View_Helper_Application::loadJavascript($this, $scripts); }
function RenderHTML() { $this->_preRender(); $this->Gerar(); $retorno = ''; if ($this->banner) { $retorno .= "<table width='100%' style=\"height:100%\" border='0' cellpadding='0' cellspacing='0'><tr>"; $retorno .= "<td class=\"barraLateral\" width=\"21\" valign=\"top\"><a href='#'><img src=\"{$this->bannerLateral}\" align=\"right\" border=\"0\" alt=\"{$this->titulo_barra}\" title=\"{$this->titulo_barra}\"></a></td><td valign='top'>"; } $retorno .= "\n <script type=\"text/javascript\">function go(url) { document.location = url; }\n var goodIE = (document.all) ? 1:0;\n var netscape6 = (document.getElementById && !document.all) ? 1:0;\n var aux = '';\n var aberto = false;"; $retorno .= $this->MakeFormat(); $retorno .= '</script>'; if ($this->campos) { $width = empty($this->largura) ? '' : "width='{$this->largura}'"; /** * Adiciona o help da página. */ $url = parse_url($_SERVER['REQUEST_URI']); $url = ereg_replace('^/', '', $url['path']); if (strpos($url, '_det.php') !== FALSE) { $tipo = 'det'; } elseif (strpos($url, '_lst.php') !== FALSE) { $tipo = 'lst'; } elseif (strpos($url, '_pdf.php') !== FALSE) { $tipo = 'pdf'; } else { $tipo = 'cad'; } $server = $_SERVER['SERVER_NAME']; $endereco = $_SERVER['REQUEST_URI']; $enderecoPagina = $_SERVER['PHP_SELF']; //$barra = '<b>Localizacao: http://'.$server.$endereco.'</b><br>'; //$barra = '<tr><td><b>Localizacao:'. $enderecoPagina .'</b><br></tr></td>'; $barra = '<b>Filtros de busca</b>'; if (class_exists('clsPmiajudaPagina')) { $ajudaPagina = new clsPmiajudaPagina(); $lista = $ajudaPagina->lista(null, null, $url); if ($lista) { $barra = "\n <table border=\"0\" cellpading=\"0\" cellspacing=\"0\" width=\"100%\">\n <tr>\n <script type=\"text/javascript\">document.help_page_index = 0;</script>\n <td width=\"20\"><a href=\"javascript:showExpansivelIframe(700,500,'ajuda_mostra.php?cod_topico={$lista[0]["ref_cod_topico"]}&tipo={$tipo}');\"><img src=\"imagens/banco_imagens/interrogacao.gif\" border=\"0\" alt=\"Bot�o de Ajuda\" title=\"Clique aqui para obter ajuda sobre esta p�gina\"></a></td>\n <td><b>Filtros de busca</b></td>\n <td align=\"right\"><a href=\"javascript:showExpansivelIframe(700,500,'ajuda_mostra.php?cod_topico={$lista[0]["ref_cod_topico"]}&tipo={$tipo}');\"><img src=\"imagens/banco_imagens/interrogacao.gif\" border=\"0\" alt=\"Bot�o de Ajuda\" title=\"Clique aqui para obter ajuda sobre esta p�gina\"></a></td>\n </tr>\n </table>"; } } if ($this->busca_janela) { $janela .= "<form name='{$this->__nome}' id='{$this->__nome}' method='{$this->method}'>"; $janela .= "<input name='busca' type='hidden' value='S'>"; $janela .= "<table class='tablelistagem' border='0' cellpadding='2' cellspacing='1'>"; if ($this->campos) { reset($this->campos); while (list($nome, $componente) = each($this->campos)) { if ($componente[0] == "oculto" || $componente[0] == "rotulo") { $janela .= "<input name='{$nome}' id='{$nome}' type='hidden' value='" . urlencode($componente[3]) . "'>"; } } } $janela .= "<tr><td class='formdktd' colspan='2' height='24'>{$barra}</td></tr>"; if (empty($this->campos)) { $janela .= "<tr><td class='formlttd' colspan='2'><span class='form'>Não existem campos definidos para o formulário</span></td></tr>"; } else { $janela .= $this->MakeCampos(); } $janela .= "<tr><td class='formdktd' colspan='2'></td></tr>"; $janela .= "<tr><td colspan='2' align='center'>"; $retorno .= "<script type=\"text/javascript\" language='javascript'>"; if ($this->funcAcao) { $retorno .= $this->funcAcao; } else { $retorno .= "function acao{$this->funcAcaoNome}() { document.{$this->__nome}.submit(); } "; } $retorno .= "</script>"; $janela .= "<input type='button' class='botaolistagem' value='Busca' onclick='javascript:acao{$this->funcAcaoNome}();'>"; $janela .= "</td></tr>"; $janela .= "</table>"; $janela .= "</form>"; $janela = str_replace("\"", "'", $janela); $janela = str_replace("'", "\\'", $janela); $janela = str_replace("\n", "", $janela); $retorno .= "<br><table class=\"tablelistagem\" width=\"90%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" align=\"center\" >"; $retorno .= "<td align=\"center\" class='formdktd' colspan='2' height='24' valign='middle'><input type=\"button\" class=\"botaolistagem\" onclick=\"javascript:showExpansivel(0,0, '{$janela}');\" value=\"Pesquisar\"> "; $retorno .= "</td></tr>"; $retorno .= "</table>"; } else { $retorno .= "<!-- begin formulario -->\n <form name='{$this->__nome}' id='{$this->__nome}' method='{$this->method}' action=\"\">\n <input name='busca' type='hidden' value='S'>"; if ($this->campos) { reset($this->campos); while (list($nome, $componente) = each($this->campos)) { if ($componente[0] == 'oculto' || $componente[0] == 'rotulo') { $retorno .= "<input name='{$nome}' id='{$nome}' type='hidden' value='" . urlencode($componente[3]) . "'>"; } } } $retorno .= "\n <table class='tablelistagem' {$width} border='0' cellpadding='2' cellspacing='1'>"; $retorno .= "\n <tr>\n <td class='fundoLocalizacao' colspan='2' height='24'>{$this->locale}</td>\n </tr>"; $retorno .= "\n <tr>\n <td class='formdktd' colspan='2' height='24'>{$barra}</td>\n </tr>"; if (empty($this->campos)) { $retorno .= "\n <tr>\n <td class='formlttd' colspan='2'><span class='form'>Não existem campos definidos para o formulário</span></td>\n </tr>"; } else { $retorno .= $this->MakeCampos(); } $retorno .= "\n <tr>\n <td class='formdktd' colspan='2'></td>\n </tr>"; $retorno .= "\n <tr>\n <td colspan='2' align='center'>\n <script type=\"text/javascript\" language='javascript'>"; if ($this->funcAcao) { $retorno .= $this->funcAcao; } else { $retorno .= "function acao{$this->funcAcaoNome}() { document.{$this->__nome}.submit(); } "; } $retorno .= "</script>"; if ($this->exibirBotaoSubmit) { if ($this->botao_submit) { $retorno .= " <input type='submit' class='botaolistagem' value='busca' id='botao_busca'> "; } else { $retorno .= " <input type='button' class='botaolistagem' onclick='javascript:acao{$this->funcAcaoNome}();' value='busca' id='botao_busca'> "; } } $retorno .= "\n </td>\n </tr>\n </table>\n <!-- cadastro end -->\n </form>"; } } $retorno .= "<br>"; $ncols = 1; $width = empty($this->largura) ? '' : "width='{$this->largura}'"; if (!$this->__titulo) { // Recebe a variavel titulo por motivos de compatibilidade com scripts antigos $this->__titulo = $this->titulo; } $this->method = 'POST'; $retorno .= "\n <form name=\"form_resultado\" id=\"form_resultado\" method=\"POST\" action=\"\">\n <!-- listagem begin -->\n <table class='tablelistagem' {$width} border='0' cellpadding='4' cellspacing='1'>\n <tr>\n <td colspan='{$ncols}'>{$this->__titulo}</td>\n </tr>"; $ncols = count($this->cabecalho); // Cabeçalho if (!empty($this->cabecalho)) { reset($this->cabecalho); $ncols = count($this->cabecalho); if (!empty($this->colunas)) { reset($this->colunas); } $retorno .= "<input type='hidden' id='ordenacao' name='ordenacao' value='{$_POST['ordenacao']}'>"; $retorno .= "<input type='hidden' id='fonte' name='fonte' value='{$_POST['fonte']}'>"; $retorno .= "\n <tr>"; while (list($i, $texto) = each($this->cabecalho)) { if (!empty($this->colunas)) { list($i, $fmt) = each($this->colunas); } else { $fmt = alTopLeft; } if ($texto) { $inicio = $fim = ''; if ($this->campos_ordenacao[$i] != '') { $_POST['fonte'] = empty($_POST['fonte']) ? "imagens/nvp_setinha_down.gif" : $_POST['fonte']; $inicio = "<img name='seta' src='{$_POST['fonte']}' border='0' /> <a href='#' onclick='definirOrdenacao(\"{$this->campos_ordenacao[$i]}\");document.getElementById(\"form_resultado\").submit();'>"; $fim = "</a>"; } $retorno .= "\n <td class='formdktd' {$fmt} style=\"font-weight:bold;\" valign='middle'>{$inicio}{$texto}{$fim}</td>"; } } $retorno .= "\n </tr>"; } // Lista if (empty($this->linhas)) { $retorno .= "\n <tr>\n <td class='formlttd' colspan='{$ncols}' align='center'>Não há informação para ser apresentada</td>\n </tr>"; } else { reset($this->linhas); while (list($i, $linha) = each($this->linhas)) { $classe = $i % 2 ? 'formmdtd' : 'formlttd'; $retorno .= "\n <tr>"; if (is_array($linha)) { reset($linha); if (!empty($this->colunas)) { reset($this->colunas); } while (list($i, $celula) = each($linha)) { if (!empty($this->colunas)) { list($i, $fmt) = each($this->colunas); } else { $fmt = alTopLeft; } if (strpos($celula, "<img src='imagens/noticia.jpg' border=0>") !== FALSE) { $celula = str_replace("<img src='imagens/noticia.jpg' border=0>", "<img src='imagens/noticia.jpg' border=0 alt=''>", $celula); } $retorno .= "\n <td class='{$classe}' {$fmt}>{$celula}</td>"; } } else { $retorno .= "\n <td class='formdktd' {$fmt} colspan='{$ncols}'>{$linha}</td>"; } $retorno .= "\n </tr>"; } } $retorno .= "\n <tr>\n <td class='formdktd' colspan=\"{$ncols}\"> </td>\n </tr>"; if (!empty($this->paginador2)) { $retorno .= "\n <tr>\n <td align=\"center\" colspan=\"{$ncols}\">{$this->paginador2}</td>\n </tr>"; } if (!empty($this->paginador)) { $ua = 0; $qdt_paginador = 1; $i = 0; $retorno .= "\n <tr>\n <td colspan='{$ncols}' align='center'>"; foreach ($this->paginador as $pagina) { if ($pagina[2]) { switch ($pagina[0]) { case "<<": $retorno .= "<a href='{$pagina[1]}' class='nvp_paginador'>{$pagina[0]}</a> "; break; case "-10": $retorno .= "<a href='{$pagina[1]}' class='nvp_paginador'>{$pagina[0]}</a> "; break; case ">>": $retorno .= " <a href='{$pagina[1]}' class='nvp_paginador'>{$pagina[0]}</a>"; break; case "p10": $retorno .= " <a href='{$pagina[1]}' class='nvp_paginador'>+10</a>"; break; default: $retorno .= "<a href='{$pagina[1]}' class='nvp_paginador'>{$pagina[0]}</a> "; } } else { $retorno .= "<span class='linkBory' style='text-decoration: underline; color: black;'> {$pagina[0]} </span> "; } if ($ua++ > 15) { $ua = 0; $retorno .= "<br>"; } } $retorno .= "\n </td>\n </tr>"; } if ($this->tituloFormResultado) { $retorno .= "\n <tr>\n <td class='formdktd' colspan=\"{$ncols}\" height='24'><span class='form'><b>{$this->tituloFormResultado}</b></span></td>\n </tr>"; } if (!empty($this->camposResultado)) { reset($this->camposResultado); $campo_anterior = ''; $md = TRUE; while (list($nome, $componente) = each($this->camposResultado)) { if ($componente[0] != 'oculto') { $tipo = $componente[0]; $campo = $componente[1] . ':'; if ($campo == $campo_anterior) { $campo = ''; } else { $campo_anterior = $campo; $md = !$md; } $classe = $md ? 'formmdtd' : 'formlttd'; $retorno .= "\n <tr>\n <td class='{$classe}' valign='top'><span class='form'>{$campo}</span></td>\n <td class='{$classe}' valign='top'>\n <span class='form'>\n "; switch ($tipo) { case "rotulo": $retorno .= $componente[2]; break; case "texto": $retorno .= "\n <input class='form' type='text' name='{$nome}' value='{$componente['2']}' size='{$componente['3']}' maxlength='{$componente['4']}'>\n"; break; case "memo": $retorno .= "\n <textarea class='form' name='{$nome}' cols='{$componente['3']}' rows='{$componente['4']}' wrap='virtual' >{$componente['2']}</textarea>\n"; break; case "lista": $retorno .= "\n <select class='form' name='{$nome}'>\n"; reset($componente[2]); while (list($chave, $texto) = each($componente[2])) { $retorno .= "<option value='" . urlencode($chave) . "'"; if ($chave == $componente[3]) { $retorno .= ' selected'; } $retorno .= ">{$texto}</option>\n"; } $retorno .= "</select>\n"; break; } $retorno .= "\n </span>\n </td>\n </tr>"; } } } $botao = ''; if ($this->acao_voltar) { $botao = " <input type='button' class='botaolistagem' onclick='javascript: {$this->acao_voltar}' value=' Voltar '>"; } if ($this->acao_imprimir) { $botao = " <input type='button' id='imprimir' class='botaolistagem' onclick='javascript: {$this->acao_imprimir}' value='{$this->valor_imprimir}'>"; } if ($this->acao && $this->show_botao_novo) { $retorno .= "\n <tr>\n <td colspan=\"{$ncols}\" align=\"center\"><input type='button' class='botaolistagem' onclick='javascript: {$this->acao}' value=' {$this->nome_acao} '>{$botao}</td>\n </tr>"; } elseif ($this->acao_imprimir) { $retorno .= "\n <tr>\n <td colspan=\"{$ncols}\" align=\"center\">{$botao}</td>\n </tr>"; } $retorno .= "\n <tr>\n <td colspan=\"{$ncols}\" align=\"center\">"; if (count($this->array_botao_script)) { for ($i = 0; $i < count($this->array_botao); $i++) { $retorno .= " <input type='button' class='botaolistagem' onclick='" . $this->array_botao_script[$i] . "' value='" . $this->array_botao[$i] . "'> \n"; } } else { for ($i = 0; $i < count($this->array_botao); $i++) { $retorno .= " <input type='button' class='botaolistagem' onclick='javascript:go( \"" . $this->array_botao_url[$i] . "\" );' value='" . $this->array_botao[$i] . "'> \n"; } } $retorno .= "</td>\n </tr>"; if (!is_null($this->rodape)) { $retorno .= "<tr><td colspan=\"{$ncols}\" align=\"center\" id=\"td_rodape\">\n"; $retorno .= $this->rodape; $retorno .= "\n </td>\n </tr>"; } $retorno .= "\n </table>\n </form>\n <!-- listagem end -->"; if ($this->bannerClose) { $retorno .= "\n <!-- Fechando o Banner (clsListagem) -->\n </td>\n </tr>\n </table>\n "; } Portabilis_View_Helper_Application::embedJavascriptToFixupFieldsWidth($this); return $retorno; }
protected function loadAssets() { $styles = array('styles/reset.css', 'styles/portabilis.css', 'styles/min-portabilis.css', '/modules/Error/Assets/Stylesheets/Error.css'); Portabilis_View_Helper_Application::loadStylesheet($this, $styles); }
public function escola($options = array()) { $isProfessor = Portabilis_Business_Professor::isProfessor($this->getInstituicaoId($options['instituicaoId']), $this->getCurrentUserId()); if ($this->hasNivelAcesso('POLI_INSTITUCIONAL') || $this->hasNivelAcesso('INSTITUCIONAL') || $isProfessor) { $this->selectInput($options); } elseif ($this->hasNivelAcesso('SOMENTE_ESCOLA') || $this->hasNivelAcesso('SOMENTE_BIBLIOTECA')) { $this->stringInput($options); } Portabilis_View_Helper_Application::loadJavascript($this->viewInstance, '/modules/DynamicInput/Assets/Javascripts/Escola.js'); }
protected function loadCoreAssets() { parent::loadCoreAssets(); $dependencies = array('/modules/DynamicInput/Assets/Javascripts/DynamicInput.js'); Portabilis_View_Helper_Application::loadJavascript($this->viewInstance, $dependencies); }