public function Gerar()
 {
     $this->url_cancelar = '/intranet/transporte_pessoa_lst.php';
     // Código do vinculo
     $options = array('label' => $this->_getLabel('id'), 'disabled' => true, 'required' => false, 'size' => 25);
     $this->inputsHelper()->integer('id', $options);
     // Pessoa
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('pessoa')), 'required' => true);
     $this->inputsHelper()->simpleSearchPessoa('nome', $options);
     // Montar o inputsHelper->select \/
     // Cria lista de rotas
     $obj_rota = new clsModulesRotaTransporteEscolar();
     $obj_rota->setOrderBy(' descricao asc ');
     $lista_rota = $obj_rota->lista();
     $rota_resources = array("" => "Selecione uma rota");
     foreach ($lista_rota as $reg) {
         $rota_resources["{$reg['cod_rota_transporte_escolar']}"] = "{$reg['descricao']}";
     }
     // Rota
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('rota')), 'required' => true, 'resources' => $rota_resources);
     $this->inputsHelper()->select('rota', $options);
     // Ponto de Embarque
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('ponto')), 'required' => false, 'resources' => array("" => "Selecione uma rota acima"));
     $this->inputsHelper()->select('ponto', $options);
     // Destino
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('destino')), 'required' => false);
     $this->inputsHelper()->simpleSearchPessoaj('destino', $options);
     // observacoes
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('observacao')), 'required' => false, 'size' => 50, 'max_length' => 255);
     $this->inputsHelper()->textArea('observacao', $options);
     $this->loadResourceAssets($this->getDispatcher());
 }
Beispiel #2
0
 public function Gerar()
 {
     $this->url_cancelar = '/intranet/transporte_motorista_lst.php';
     // Código do Motorista
     $options = array('label' => $this->_getLabel('id'), 'disabled' => true, 'required' => false, 'size' => 25);
     $this->inputsHelper()->integer('id', $options);
     // nome
     $options = array('label' => $this->_getLabel('pessoa'), 'size' => 50);
     $this->inputsHelper()->simpleSearchPessoa('nome', $options);
     //número da CNH
     $options = array('label' => $this->_getLabel('cnh'), 'max_length' => 15, 'size' => 15, 'placeholder' => Portabilis_String_Utils::toLatin1('Número da CNH'), 'required' => true);
     $this->inputsHelper()->integer('cnh', $options);
     //Categoria da CNH
     $options = array('label' => $this->_getLabel('tipo_cnh'), 'max_length' => 2, 'size' => 1, 'placeholder' => '', 'required' => true);
     $this->inputsHelper()->text('tipo_cnh', $options);
     // Vencimento
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('dt_habilitacao')), 'required' => false, 'size' => 10, 'placeholder' => '');
     $this->inputsHelper()->date('dt_habilitacao', $options);
     // Habilitação
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('vencimento_cnh')), 'required' => false, 'size' => 10, 'placeholder' => '');
     $this->inputsHelper()->date('vencimento_cnh', $options);
     // Codigo da empresa
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('ref_cod_empresa_transporte_escolar')), 'required' => true);
     $this->inputsHelper()->simpleSearchEmpresa('ref_cod_empresa_transporte_escolarf', $options);
     // observações
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('observacao')), 'required' => false, 'size' => 50, 'max_length' => 255);
     $this->inputsHelper()->textArea('observacao', $options);
     $this->loadResourceAssets($this->getDispatcher());
 }
 public function Gerar()
 {
     $this->url_cancelar = '/intranet/transporte_rota_lst.php';
     // ano
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('ano')), 'required' => true, 'size' => 5, 'max_length' => 4);
     $this->inputsHelper()->integer('ano', $options);
     // Código da rota
     $options = array('label' => $this->_getLabel('id'), 'disabled' => true, 'required' => false, 'size' => 25);
     $this->inputsHelper()->integer('id', $options);
     // descricao
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc')), 'required' => true, 'size' => 50, 'max_length' => 50);
     $this->inputsHelper()->text('desc', $options);
     // Destino
     $options = array('label' => $this->_getLabel('ref_idpes_destino'), 'required' => true, 'size' => 50);
     $this->inputsHelper()->simpleSearchPessoaj('ref_idpes_destino', $options);
     // Empresa rota
     $options = array('label' => $this->_getLabel('ref_cod_empresa_transporte_escolar'), 'required' => true, 'size' => 50);
     $this->inputsHelper()->simpleSearchEmpresa('ref_cod_empresa_transporte_escolar', $options);
     // Tipo
     $tipos = array(null => 'Selecione um tipo', 'U' => 'Urbana', 'R' => 'Rural');
     $options = array('label' => $this->_getLabel('tipo_rota'), 'resources' => $tipos, 'required' => true);
     $this->inputsHelper()->select('tipo_rota', $options);
     // km pavimentados
     $options = array('label' => $this->_getLabel('km_pav'), 'required' => false, 'size' => 9, 'max_length' => 10, 'placeholder' => '');
     $this->inputsHelper()->numeric('km_pav', $options);
     // km não pavimentados
     $options = array('label' => $this->_getLabel('km_npav'), 'required' => false, 'size' => 9, 'max_length' => 10, 'placeholder' => '');
     $this->inputsHelper()->numeric('km_npav', $options);
     // Tercerizado
     $options = array('label' => $this->_getLabel('tercerizado'));
     $this->inputsHelper()->checkbox('tercerizado', $options);
     $this->loadResourceAssets($this->getDispatcher());
 }
 protected function createOrUpdatePonto($id = null)
 {
     $ponto = new clsModulesPontoTransporteEscolar();
     $ponto->cod_ponto_transporte_escolar = $id;
     // após cadastro não muda mais id pessoa
     $ponto->descricao = Portabilis_String_Utils::toLatin1($this->getRequest()->desc);
     return is_null($id) ? $ponto->cadastra() : $ponto->edita();
 }
 protected function resourceValue($id)
 {
     if ($id) {
         $sql = "select (descricao || ',Placa: ' || placa) from modules.veiculo where cod_veiculo = \$1";
         $options = array('params' => $id, 'return_only' => 'first-field');
         $nome = Portabilis_Utils_Database::fetchPreparedQuery($sql, $options);
         return Portabilis_String_Utils::toLatin1($nome, array('transform' => true, 'escape' => false));
     }
 }
 protected function resourceValue($id)
 {
     if ($id) {
         $sql = "select descricao from modules.ponto_transporte_escolar where cod_ponto_transporte_escolar = \$1";
         $options = array('params' => $id, 'return_only' => 'first-field');
         $nome = Portabilis_Utils_Database::fetchPreparedQuery($sql, $options);
         return Portabilis_String_Utils::toLatin1($nome, array('transform' => true, 'escape' => false));
     }
 }
 protected function resourceValue($id)
 {
     if ($id) {
         $sql = "select nome from cadastro.pessoa where idpes = \$1";
         $options = array('params' => $id, 'return_only' => 'first-field');
         $nome = Portabilis_Utils_Database::fetchPreparedQuery($sql, $options);
         return Portabilis_String_Utils::toLatin1($nome, array('transform' => true, 'escape' => false));
     }
 }
 protected function createOrUpdateEmpresa($id = null)
 {
     $empresa = new clsModulesEmpresaTransporteEscolar();
     $empresa->cod_empresa_transporte_escolar = $id;
     $empresa->ref_resp_idpes = $this->getRequest()->pessoa_id;
     $empresa->ref_idpes = $this->getRequest()->pessoaj_id;
     $empresa->observacao = Portabilis_String_Utils::toLatin1($this->getRequest()->observacao);
     return is_null($id) ? $empresa->cadastra() : $empresa->edita();
 }
Beispiel #9
0
 public function select($attrName, $options = array())
 {
     $defaultOptions = array('options' => array(), 'objectName' => '', 'resources' => array());
     $options = $this->mergeOptions($options, $defaultOptions);
     $spacer = !empty($options['objectName']) && !empty($attrName) ? '_' : '';
     $defaultInputOptions = array('id' => $options['objectName'] . $spacer . $attrName, 'label' => ucwords($attrName), 'resources' => $options['resources'], 'value' => '', 'callback' => '', 'inline' => false, 'label_hint' => '', 'input_hint' => '', 'disabled' => false, 'required' => true, 'multiple' => false);
     $inputOptions = $this->mergeOptions($options['options'], $defaultInputOptions);
     $inputOptions['label'] = Portabilis_String_Utils::toLatin1($inputOptions['label'], array('escape' => false));
     call_user_func_array(array($this->viewInstance, 'campoLista'), $inputOptions);
 }
Beispiel #10
0
 protected function inputOptions($options)
 {
     $resources = $options['resources'];
     if (empty($options['resources'])) {
         $resources = new clsPmieducarReligiao();
         $resources = $resources->lista(null, null, null, null, null, null, null, null, 1);
         $resources = Portabilis_Array_Utils::setAsIdValue($resources, 'cod_religiao', 'nm_religiao');
     }
     return $this->insertOption(null, Portabilis_String_Utils::toLatin1("Religião"), $resources);
 }
Beispiel #11
0
 protected function inputOptions($options)
 {
     $resources = $options['resources'];
     if (empty($resources)) {
         $resources = new clsPmieducarAlunoBeneficio();
         $resources = $resources->lista(null, null, null, null, null, null, null, null, null, 1);
         $resources = Portabilis_Array_Utils::setAsIdValue($resources, 'cod_aluno_beneficio', 'nm_beneficio');
     }
     return $this->insertOption(null, Portabilis_String_Utils::toLatin1("Benefício"), $resources);
 }
 protected function resourceValue($id)
 {
     if ($id) {
         $sql = "select nome, sigla_uf from public.municipio where idmun = \$1";
         $options = array('params' => $id, 'return_only' => 'first-row');
         $municipio = Portabilis_Utils_Database::fetchPreparedQuery($sql, $options);
         $nome = $municipio['nome'];
         $siglaUf = $municipio['sigla_uf'];
         return Portabilis_String_Utils::toLatin1($nome, array('transform' => true, 'escape' => false)) . " ({$siglaUf})";
     }
 }
 protected function resourceValue($id)
 {
     if ($id) {
         $sql = "select nome, descricao as tipo_logradouro from\n                    public.logradouro l left join urbano.tipo_logradouro tl on (l.idtlog = tl.idtlog) \n                    where idlog = \$1";
         $options = array('params' => $id, 'return_only' => 'first-row');
         $resource = Portabilis_Utils_Database::fetchPreparedQuery($sql, $options);
         $tipo = Portabilis_String_Utils::toUtf8($resource['tipo_logradouro']);
         $nome = Portabilis_String_Utils::toUtf8($resource['nome']);
         return Portabilis_String_Utils::toLatin1($tipo . ' ' . $nome, array('transform' => true, 'escape' => false));
     }
 }
Beispiel #14
0
 public function Gerar()
 {
     $this->url_cancelar = '/intranet/transporte_ponto_lst.php';
     // Código do ponto
     $options = array('label' => $this->_getLabel('id'), 'disabled' => true, 'required' => false, 'size' => 25);
     $this->inputsHelper()->integer('id', $options);
     // descricao
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc')), 'required' => true, 'size' => 50, 'max_length' => 70);
     $this->inputsHelper()->text('desc', $options);
     $this->loadResourceAssets($this->getDispatcher());
 }
 protected function resourceValue($id)
 {
     if ($id) {
         $sql = "select nome, zona_localizacao from public.bairro where idbai = \$1";
         $options = array('params' => $id, 'return_only' => 'first-row');
         $municipio = Portabilis_Utils_Database::fetchPreparedQuery($sql, $options);
         $nome = $municipio['nome'];
         $zona = $municipio['zona_localizacao'] == 1 ? 'Urbana' : 'Rural';
         return Portabilis_String_Utils::toLatin1($nome, array('transform' => true, 'escape' => false)) . " / Zona {$zona}";
     }
 }
 protected function createOrUpdatePessoaTransporte($id = null)
 {
     $pt = new clsModulesPessoaTransporte();
     $pt->cod_pessoa_transporte = $id;
     // após cadastro não muda mais id pessoa
     $pt->ref_idpes = $this->getRequest()->pessoa_id;
     $pt->ref_idpes_destino = $this->getRequest()->pessoaj_id;
     $pt->ref_cod_ponto_transporte_escolar = $this->getRequest()->ponto;
     $pt->ref_cod_rota_transporte_escolar = $this->getRequest()->rota;
     $pt->observacao = Portabilis_String_Utils::toLatin1($this->getRequest()->observacao);
     return is_null($id) ? $pt->cadastra() : $pt->edita();
 }
Beispiel #17
0
 public function text($attrName, $options = array())
 {
     $defaultOptions = array('options' => array(), 'objectName' => '');
     $options = $this->mergeOptions($options, $defaultOptions);
     $spacer = !empty($options['objectName']) && !empty($attrName) ? '_' : '';
     $label = !empty($attrName) ? $attrName : $options['objectName'];
     $label = str_replace('_id', '', $label);
     $defaultInputOptions = array('id' => $options['objectName'] . $spacer . $attrName, 'label' => ucwords($label), 'value' => null, 'size' => 50, 'max_length' => 50, 'required' => true, 'script' => false, 'inline' => false, 'label_hint' => '', 'input_hint' => '', 'callback' => false, 'event' => 'onKeyUp', 'disabled' => false);
     $inputOptions = $this->mergeOptions($options['options'], $defaultInputOptions);
     $inputOptions['label'] = Portabilis_String_Utils::toLatin1($inputOptions['label'], array('escape' => false));
     call_user_func_array(array($this->viewInstance, 'campoTexto'), $inputOptions);
     $this->fixupPlaceholder($inputOptions);
 }
 protected function getMatriculas()
 {
     if ($this->canGetMatriculas()) {
         $matriculas = new clsPmieducarMatricula();
         $matriculas->setOrderby("sequencial_fechamento , translate(nome,'" . Portabilis_String_Utils::toLatin1(åáàãâäéèêëíìîïóòõôöúùüûçÿýñÅÁÀÃÂÄÉÈÊËÍÌÎÏÓÒÕÔÖÚÙÛÜÇÝÑ) . "', '" . Portabilis_String_Utils::toLatin1(aaaaaaeeeeiiiiooooouuuucyynAAAAAAEEEEIIIIOOOOOUUUUCYN) . "') ");
         $matriculas = $matriculas->lista(NULL, NULL, $this->getRequest()->escola_id, $this->getRequest()->serie_id, NULL, NULL, $this->getRequest()->aluno_id, NULL, NULL, NULL, NULL, NULL, $ativo = 1, $this->getRequest()->ano, NULL, $this->getRequest()->instituicao_id, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, $this->getRequest()->curso_id, NULL, $this->getRequest()->matricula_id, NULL, NULL, NULL, NULL, $this->getRequest()->turma_id);
         $options = array();
         foreach ($matriculas as $matricula) {
             $options['__' . $matricula['cod_matricula']] = $this->toUtf8($matricula['nome']);
         }
         return array('options' => $options);
     }
 }
 protected function createOrUpdateMotorista($id = null)
 {
     $motorista = new clsModulesMotorista();
     $motorista->cod_motorista = $id;
     // após cadastro não muda mais id pessoa
     $motorista->ref_idpes = $this->getRequest()->pessoa_id;
     $motorista->cnh = $this->getRequest()->cnh;
     $motorista->tipo_cnh = Portabilis_String_Utils::toLatin1($this->getRequest()->tipo_cnh);
     $motorista->dt_habilitacao = Portabilis_Date_Utils::brToPgSQL($this->getRequest()->dt_habilitacao);
     $motorista->vencimento_cnh = Portabilis_Date_Utils::brToPgSQL($this->getRequest()->vencimento_cnh);
     $motorista->ref_cod_empresa_transporte_escolar = $this->getRequest()->empresa_id;
     $motorista->observacao = Portabilis_String_Utils::toLatin1($this->getRequest()->observacao);
     return is_null($id) ? $motorista->cadastra() : $motorista->edita();
 }
 protected function createOrUpdateRota($id = null)
 {
     $rota = new clsModulesRotaTransporteEscolar();
     $rota->cod_rota_transporte_escolar = $id;
     // após cadastro não muda mais id pessoa
     $rota->descricao = Portabilis_String_Utils::toLatin1($this->getRequest()->desc);
     $rota->ref_idpes_destino = $this->getRequest()->pessoaj_id;
     $rota->ano = $this->getRequest()->ano;
     $rota->tipo_rota = $this->getRequest()->tipo_rota;
     $rota->km_pav = $this->getRequest()->km_pav;
     $rota->km_npav = $this->getRequest()->km_npav;
     $rota->ref_cod_empresa_transporte_escolar = $this->getRequest()->empresa_id;
     $rota->tercerizado = $this->getRequest()->tercerizado == 'on' ? 'S' : 'N';
     return is_null($id) ? $rota->cadastra() : $rota->edita();
 }
 function templateName()
 {
     $flagTipoBoletimTurma = App_Model_IedFinder::getTurma($codTurma = $this->args['turma']);
     $flagTipoBoletimTurma = $flagTipoBoletimTurma['tipo_boletim'];
     if (empty($flagTipoBoletimTurma)) {
         throw new Exception(Portabilis_String_Utils::toLatin1("Não foi definido o tipo de boletim no cadastro de turmas."));
     }
     $tiposBoletim = Portabilis_Model_Report_TipoBoletim;
     $templates = array($tiposBoletim::BIMESTRAL => 'portabilis_boletim', $tiposBoletim::TRIMESTRAL => 'portabilis_boletim_trimestral', $tiposBoletim::TRIMESTRAL_CONCEITUAL => 'portabilis_boletim_primeiro_ano_trimestral', $tiposBoletim::SEMESTRAL => 'portabilis_boletim_semestral', $tiposBoletim::SEMESTRAL_CONCEITUAL => 'portabilis_boletim_conceitual_semestral', $tiposBoletim::SEMESTRAL_EDUCACAO_INFANTIL => 'portabilis_boletim_educ_infantil_semestral', $tiposBoletim::PARECER_DESCRITIVO_COMPONENTE => 'portabilis_boletim_parecer', $tiposBoletim::PARECER_DESCRITIVO_GERAL => 'portabilis_boletim_parecer_geral');
     $template = is_null($flagTipoBoletimTurma) ? '' : $templates[$flagTipoBoletimTurma];
     if (empty($template)) {
         throw new Exception(Portabilis_String_Utils::toLatin1("Não foi possivel recuperar nome do template para o boletim."));
     }
     return $template;
 }
Beispiel #22
0
 public function Gerar()
 {
     $this->url_cancelar = '/intranet/transporte_empresa_lst.php';
     // Código da empresa
     $options = array('label' => $this->_getLabel('id'), 'disabled' => true, 'required' => false, 'size' => 25);
     $this->inputsHelper()->integer('id', $options);
     $options = array('label' => $this->_getLabel('pessoaj'), 'required' => true);
     //    $this->inputsHelper()->integer('pessoaj', $options);
     $this->inputsHelper()->simpleSearchPessoaj('pessoaj', $options);
     // nome
     $options = array('label' => $this->_getLabel('pessoa'), 'size' => 68);
     $this->inputsHelper()->simpleSearchPessoa('nome', $options);
     // observações
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('observacao')), 'required' => false, 'size' => 50, 'max_length' => 253);
     $this->inputsHelper()->textArea('observacao', $options);
     $this->loadResourceAssets($this->getDispatcher());
 }
 public function Gerar()
 {
     $id = isset($_GET['id']) ? $_GET['id'] : 0;
     if ($id == 0 || !$this->verificaIdRota($id)) {
         header('Location: /intranet/transporte_rota_lst.php');
     }
     $this->url_cancelar = '/intranet/transporte_rota_det.php?cod_rota=' . $id . '';
     // Código da rota
     $options = array('label' => $this->_getLabel('id'), 'disabled' => true, 'required' => false, 'size' => 25);
     $this->inputsHelper()->integer('id', $options);
     // descricao
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('descricao')), 'disabled' => true, 'size' => 50, 'max_length' => 50);
     $this->inputsHelper()->text('descricao', $options);
     $resourceOptionsTable = "\n    <table id='disciplinas-manual'>\n      <tr>\n        <th>Ponto</th>\n        <th>Hora</th>\n        <th>Tipo</th> \n        <th>Veiculo</th>\n        \n        <th>A&ccedil;&atilde;o</th>\n      </tr>\n      <tr class='ponto'>\n        <td><input class='nome obrigatorio disable-on-search change-state-with-parent'></input></td>\n        <td><input class='nota' ></input></td>\n        <td>\n          <select id='disciplinas' name='disciplinas' class='obrigatorio disable-on-search'>\n            <option value=''>Selecione</option>\n            <option value='I'>Ida</option>\n            <option value='V'>Volta</option>\n          </select>\n        </td>              \n        <td>\n          <input class='nome obrigatorio disable-on-search change-state-with-parent'></input>\n        </td>\n  \n        <td>\n          <a class='remove-disciplina-line' href='#'>Remover</a>\n        </td>\n      </tr>\n<tr class='disciplina'>\n        <td><input class='nome obrigatorio disable-on-search change-state-with-parent'></input></td>\n        <td><input class='nota' ></input></td>\n        <td>\n          <select id='disciplinas' name='disciplinas' class='obrigatorio disable-on-search'>\n            <option value=''>Selecione</option>\n            <option value='I'>Ida</option>\n            <option value='V'>Volta</option>\n          </select>\n        </td>              \n        <td>\n          <input class='nome obrigatorio disable-on-search change-state-with-parent'></input>\n        </td>\n  \n        <td>\n          <a class='remove-disciplina-line' href='#'>Remover</a>\n        </td>\n      </tr>      \n      <tr class='actions'>\n        <td colspan='4'>\n          <input type='button' class='action' id='new-disciplina-line' name='new-line' value='Adicionar ponto'></input>\n        </td>\n      </tr>\n    </table>";
     $this->appendOutput($resourceOptionsTable);
     //$this->loadResourceAssets($this->getDispatcher());
 }
 protected function createOrUpdateVeiculo($id = null)
 {
     $veiculo = new clsModulesVeiculo();
     $veiculo->cod_veiculo = $id;
     // após cadastro não muda mais id pessoa
     $veiculo->descricao = Portabilis_String_Utils::toLatin1($this->getRequest()->descricao);
     $veiculo->placa = Portabilis_String_Utils::toLatin1($this->getRequest()->placa);
     $veiculo->renavam = $this->getRequest()->renavam;
     $veiculo->chassi = $this->getRequest()->chassi;
     $veiculo->marca = Portabilis_String_Utils::toLatin1($this->getRequest()->marca);
     $veiculo->passageiros = $this->getRequest()->passageiros;
     $veiculo->ano_fabricacao = $this->getRequest()->ano_fabricacao;
     $veiculo->ano_modelo = $this->getRequest()->ano_modelo;
     $veiculo->malha = $this->getRequest()->malha;
     $veiculo->ref_cod_tipo_veiculo = $this->getRequest()->tipo;
     $veiculo->exclusivo_transporte_escolar = $this->getRequest()->exclusivo_transporte_escolar == 'on' ? 'S' : 'N';
     $veiculo->adaptado_necessidades_especiais = $this->getRequest()->adaptado_necessidades_especiais == 'on' ? 'S' : 'N';
     $veiculo->ativo = $this->getRequest()->ativo == 'on' ? 'S' : 'N';
     $veiculo->descricao_inativo = Portabilis_String_Utils::toLatin1($this->getRequest()->descricao_inativo);
     $veiculo->ref_cod_empresa_transporte_escolar = $this->getRequest()->empresa_id;
     $veiculo->ref_cod_motorista = $this->getRequest()->motorista_id;
     $veiculo->observacao = Portabilis_String_Utils::toLatin1($this->getRequest()->observacao);
     return is_null($id) ? $veiculo->cadastra() : $veiculo->edita();
 }
 protected function getNomeSerie($serieId)
 {
     $sql = "select nm_serie from pmieducar.serie where cod_serie = \$1";
     return Portabilis_String_Utils::toLatin1(Portabilis_Utils_Database::selectField($sql, $serieId));
 }
Beispiel #26
0
 function VerificaPermicaoNumerico($processo_ap)
 {
     if (is_numeric($processo_ap)) {
         $sempermissao = TRUE;
         if ($processo_ap == 0) {
             $this->prog_alert .= "Processo AP == 0!";
         }
         if ($processo_ap != 0) {
             $this->db()->Consulta("SELECT 1 FROM menu_funcionario WHERE ref_cod_menu_submenu = 0 AND ref_ref_cod_pessoa_fj = {$this->currentUserId()}");
             if ($this->db()->ProximoRegistro()) {
                 list($aui) = $this->db()->Tupla();
                 $sempermissao = FALSE;
             }
             // @todo A primeira consulta OK, verifica de forma simples de tem
             //       permissão de acesso ao processo. Já a segunda, não existe
             //       sentido para nivel = 2 já que processoAp pode ser de níveis
             //       maiores que 2.
             $this->db()->Consulta("SELECT 1 FROM menu_funcionario WHERE (ref_cod_menu_submenu = {$processo_ap} AND ref_ref_cod_pessoa_fj = {$this->currentUserId()}) OR (SELECT true FROM menu_submenu WHERE cod_menu_submenu = {$processo_ap} AND nivel = 2)");
             if ($this->db()->ProximoRegistro()) {
                 list($aui) = $this->db()->Tupla();
                 $sempermissao = FALSE;
             }
             if ($sempermissao) {
                 $ip = empty($_SERVER['REMOTE_ADDR']) ? "NULL" : $_SERVER['REMOTE_ADDR'];
                 $ip_de_rede = empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? "NULL" : $_SERVER['HTTP_X_FORWARDED_FOR'];
                 $pagina = $_SERVER["PHP_SELF"];
                 $posts = "";
                 $gets = "";
                 $sessions = "";
                 foreach ($_POST as $key => $val) {
                     $posts .= " - {$key}: {$val}\n";
                 }
                 foreach ($_GET as $key => $val) {
                     $gets .= " - {$key}: {$val}\n";
                 }
                 foreach ($_SESSION as $key => $val) {
                     $sessions .= " - {$key}: {$val}\n";
                 }
                 $variaveis = "POST\n{$posts}GET\n{$gets}SESSION\n{$sessions}";
                 $variaveis = Portabilis_String_Utils::toLatin1($variaveis, array('escape' => true));
                 if ($this->currentUserId()) {
                     $this->db()->Consulta("INSERT INTO intranet_segur_permissao_negada (ref_ref_cod_pessoa_fj, ip_externo, ip_interno, data_hora, pagina, variaveis) VALUES('{$this->currentUserId()}', '{$ip}', '{$ip_de_rede}', NOW(), '{$pagina}', '{$variaveis}')");
                 } else {
                     $this->db()->Consulta("INSERT INTO intranet_segur_permissao_negada (ref_ref_cod_pessoa_fj, ip_externo, ip_interno, data_hora, pagina, variaveis) VALUES(NULL, '{$ip}', '{$ip_de_rede}', NOW(), '{$pagina}', '{$variaveis}')");
                 }
                 return FALSE;
             }
         }
         return TRUE;
     }
 }
Beispiel #27
0
 public function Gerar()
 {
     $this->url_cancelar = '/intranet/educar_aluno_lst.php';
     // código aluno
     $options = array('label' => $this->_getLabel('id'), 'disabled' => true, 'required' => false, 'size' => 25);
     $this->inputsHelper()->integer('id', $options);
     // código aluno inep
     $options = array('label' => $this->_getLabel('aluno_inep_id'), 'required' => false, 'size' => 25, 'max_length' => 14);
     $this->inputsHelper()->integer('aluno_inep_id', $options);
     // código aluno rede estadual
     $options = array('label' => $this->_getLabel('aluno_estado_id'), 'required' => false, 'size' => 25, 'max_length' => 25);
     $this->inputsHelper()->text('aluno_estado_id', $options);
     // nome
     $options = array('label' => $this->_getLabel('pessoa'), 'size' => 68);
     $this->inputsHelper()->simpleSearchPessoa('nome', $options);
     // data nascimento
     $options = array('label' => 'Data de nascimento', 'disabled' => true, 'required' => false, 'size' => 25, 'placeholder' => '');
     $this->inputsHelper()->date('data_nascimento', $options);
     // rg
     $options = array('label' => $this->_getLabel('rg'), 'disabled' => true, 'required' => false, 'size' => 25);
     $this->inputsHelper()->integer('rg', $options);
     // pai
     $options = array('label' => $this->_getLabel('pai'), 'disabled' => true, 'required' => false, 'size' => 68);
     $this->inputsHelper()->text('pai', $options);
     // mãe
     $options = array('label' => $this->_getLabel('mae'), 'disabled' => true, 'required' => false, 'size' => 68);
     $this->inputsHelper()->text('mae', $options);
     // responsável
     // tipo
     $label = Portabilis_String_Utils::toLatin1($this->_getLabel('responsavel'));
     /*$tiposResponsavel = array(null           => $label,
       'pai'          => 'Pai',
       'mae'          => 'M&atilde;e',
       'outra_pessoa' => 'Outra pessoa');*/
     $tiposResponsavel = array(null => 'Informe uma Pessoa primeiro');
     $options = array('label' => $this->_getLabel('responsavel'), 'resources' => $tiposResponsavel, 'required' => true, 'inline' => true);
     $this->inputsHelper()->select('tipo_responsavel', $options);
     // nome
     $helperOptions = array('objectName' => 'responsavel');
     $options = array('label' => '', 'size' => 50, 'required' => true);
     $this->inputsHelper()->simpleSearchPessoa('nome', $options, $helperOptions);
     // transporte publico
     $label = Portabilis_String_Utils::toLatin1($this->_getLabel('transporte'));
     $tiposTransporte = array(null => $label, 'nenhum' => 'N&atilde;o utiliza', 'municipal' => 'Municipal', 'estadual' => 'Estadual');
     $options = array('label' => $this->_getLabel('transporte'), 'resources' => $tiposTransporte, 'required' => true);
     $this->inputsHelper()->select('tipo_transporte', $options);
     // religião
     $this->inputsHelper()->religiao(array('required' => false, 'label' => Portabilis_String_Utils::toLatin1('Religião')));
     // beneficio
     $this->inputsHelper()->beneficio(array('required' => false, 'label' => Portabilis_String_Utils::toLatin1('Benefício')));
     // Deficiências / habilidades especiais
     $helperOptions = array('objectName' => 'deficiencias');
     $options = array('label' => $this->_getLabel('deficiencias'), 'size' => 50, 'required' => false, 'options' => array('value' => null));
     $this->inputsHelper()->multipleSearchDeficiencias('', $options, $helperOptions);
     // alfabetizado
     $options = array('label' => $this->_getLabel('alfabetizado'), 'value' => 'checked');
     $this->inputsHelper()->checkbox('alfabetizado', $options);
     /* *************************************
      ** Dados para a Aba 'Ficha médica' **
      ************************************* */
     // altura
     $options = array('label' => $this->_getLabel('altura'), 'size' => 5, 'max_length' => 4, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->numeric('altura', $options);
     // peso
     $options = array('label' => $this->_getLabel('peso'), 'size' => 5, 'max_length' => 6, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->numeric('peso', $options);
     // grupo_sanguineo
     $options = array('label' => $this->_getLabel('grupo_sanguineo'), 'size' => 5, 'max_length' => 2, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('grupo_sanguineo', $options);
     // fator_rh
     $options = array('label' => $this->_getLabel('fator_rh'), 'size' => 5, 'max_length' => 1, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('fator_rh', $options);
     // alergia_medicamento
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('alergia_medicamento')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('alergia_medicamento', $options);
     // desc_alergia_medicamento
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_alergia_medicamento')), 'size' => 50, 'max_length' => 100, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('desc_alergia_medicamento', $options);
     // alergia_alimento
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('alergia_alimento')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('alergia_alimento', $options);
     // desc_alergia_alimento
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_alergia_alimento')), 'size' => 50, 'max_length' => 100, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('desc_alergia_alimento', $options);
     // doenca_congenita
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_congenita')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('doenca_congenita', $options);
     // desc_doenca_congenita
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_doenca_congenita')), 'size' => 50, 'max_length' => 100, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('desc_doenca_congenita', $options);
     // fumante
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('fumante')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('fumante', $options);
     // doenca_caxumba
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_caxumba')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('doenca_caxumba', $options);
     // doenca_sarampo
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_sarampo')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('doenca_sarampo', $options);
     // doenca_rubeola
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_rubeola')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('doenca_rubeola', $options);
     // doenca_catapora
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_catapora')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('doenca_catapora', $options);
     // doenca_escarlatina
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_escarlatina')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('doenca_escarlatina', $options);
     // doenca_coqueluche
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_coqueluche')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('doenca_coqueluche', $options);
     // doenca_outras
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_outras')), 'size' => 50, 'max_length' => 100, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('doenca_outras', $options);
     // epiletico
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('epiletico')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('epiletico', $options);
     // epiletico_tratamento
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('epiletico_tratamento')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('epiletico_tratamento', $options);
     // hemofilico
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('hemofilico')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('hemofilico', $options);
     // hipertenso
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('hipertenso')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('hipertenso', $options);
     // asmatico
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('asmatico')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('asmatico', $options);
     // diabetico
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('diabetico')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('diabetico', $options);
     // insulina
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('insulina')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('insulina', $options);
     // tratamento_medico
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tratamento_medico')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('tratamento_medico', $options);
     // desc_tratamento_medico
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_tratamento_medico')), 'size' => 50, 'max_length' => 100, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('desc_tratamento_medico', $options);
     // medicacao_especifica
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('medicacao_especifica')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('medicacao_especifica', $options);
     // desc_medicacao_especifica
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_medicacao_especifica')), 'size' => 50, 'max_length' => 100, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('desc_medicacao_especifica', $options);
     // acomp_medico_psicologico
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('acomp_medico_psicologico')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('acomp_medico_psicologico', $options);
     // desc_acomp_medico_psicologico
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_acomp_medico_psicologico')), 'size' => 50, 'max_length' => 100, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('desc_acomp_medico_psicologico', $options);
     // restricao_atividade_fisica
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('restricao_atividade_fisica')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('restricao_atividade_fisica', $options);
     // desc_restricao_atividade_fisica
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_restricao_atividade_fisica')), 'size' => 50, 'max_length' => 100, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('desc_restricao_atividade_fisica', $options);
     // fratura_trauma
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('fratura_trauma')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('fratura_trauma', $options);
     // desc_fratura_trauma
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_fratura_trauma')), 'size' => 50, 'max_length' => 100, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('desc_fratura_trauma', $options);
     // plano_saude
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('plano_saude')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('plano_saude', $options);
     // desc_plano_saude
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_plano_saude')), 'size' => 50, 'max_length' => 100, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('desc_plano_saude', $options);
     $this->campoRotulo('tit_dados_hospital', Portabilis_String_Utils::toLatin1('Em caso de emergência, levar para hospital ou clínica'));
     // hospital_clinica
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('hospital_clinica')), 'size' => 50, 'max_length' => 100, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('hospital_clinica', $options);
     // hospital_clinica_endereco
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('hospital_clinica_endereco')), 'size' => 50, 'max_length' => 50, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('hospital_clinica_endereco', $options);
     // hospital_clinica_telefone
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('hospital_clinica_telefone')), 'size' => 20, 'max_length' => 20, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('hospital_clinica_telefone', $options);
     $this->campoRotulo('tit_dados_responsavel', Portabilis_String_Utils::toLatin1('Em caso de emergência, caso não seja encontrado pais ou responsáveis, avisar'));
     // responsavel
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('responsavel')), 'size' => 50, 'max_length' => 50, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('responsavel', $options);
     // responsavel_parentesco
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('responsavel_parentesco')), 'size' => 20, 'max_length' => 20, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('responsavel_parentesco', $options);
     // responsavel_parentesco_telefone
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('responsavel_parentesco_telefone')), 'size' => 20, 'max_length' => 20, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('responsavel_parentesco_telefone', $options);
     // responsavel_parentesco_celular
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('responsavel_parentesco_celular')), 'size' => 20, 'max_length' => 20, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('responsavel_parentesco_celular', $options);
     // recebeu_uniforme
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('recebeu_uniforme')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('recebeu_uniforme', $options);
     $this->campoRotulo('label_camiseta', Portabilis_String_Utils::toLatin1($this->_getLabel('label_camiseta')));
     // quantidade_camiseta
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quantidade_camiseta')), 'size' => 2, 'max_length' => 3, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->integer('quantidade_camiseta', $options);
     // tamanho_camiseta
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tamanho_camiseta')), 'size' => 2, 'max_length' => 2, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('tamanho_camiseta', $options);
     $this->campoRotulo('label_bermuda', Portabilis_String_Utils::toLatin1($this->_getLabel('label_bermuda')));
     // quantidade_bermuda
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quantidade_bermuda')), 'size' => 2, 'max_length' => 3, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->integer('quantidade_bermuda', $options);
     // tamanho_bermuda
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tamanho_bermuda')), 'size' => 2, 'max_length' => 2, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('tamanho_bermuda', $options);
     $this->campoRotulo('label_calca', Portabilis_String_Utils::toLatin1($this->_getLabel('label_calca')));
     // quantidade_calca
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quantidade_calca')), 'size' => 2, 'max_length' => 3, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->integer('quantidade_calca', $options);
     // tamanho_calca
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tamanho_calca')), 'size' => 2, 'max_length' => 2, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('tamanho_calca', $options);
     $this->campoRotulo('label_saia', Portabilis_String_Utils::toLatin1($this->_getLabel('label_saia')));
     // quantidade_saia
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quantidade_saia')), 'size' => 2, 'max_length' => 3, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->integer('quantidade_saia', $options);
     // tamanho_saia
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tamanho_saia')), 'size' => 2, 'max_length' => 2, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('tamanho_saia', $options);
     $this->campoRotulo('label_calcado', Portabilis_String_Utils::toLatin1($this->_getLabel('label_calcado')));
     // quantidade_calcado
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quantidade_calcado')), 'size' => 2, 'max_length' => 3, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->integer('quantidade_calcado', $options);
     // tamanho_calcado
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tamanho_calcado')), 'size' => 2, 'max_length' => 2, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('tamanho_calcado', $options);
     $this->campoRotulo('label_meia', Portabilis_String_Utils::toLatin1($this->_getLabel('label_meia')));
     // quantidade_meia
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quantidade_meia')), 'size' => 2, 'max_length' => 3, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->integer('quantidade_meia', $options);
     // tamanho_meia
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tamanho_meia')), 'size' => 2, 'max_length' => 2, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('tamanho_meia', $options);
     $this->campoRotulo('label_blusa_jaqueta', Portabilis_String_Utils::toLatin1($this->_getLabel('label_blusa_jaqueta')));
     // quantidade_blusa_jaqueta
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quantidade_blusa_jaqueta')), 'size' => 2, 'max_length' => 3, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->integer('quantidade_blusa_jaqueta', $options);
     // tamanho_blusa_jaqueta
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tamanho_blusa_jaqueta')), 'size' => 2, 'max_length' => 2, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->text('tamanho_blusa_jaqueta', $options);
     $moradias = array(null => 'Selecione', 'A' => 'Apartamento', 'C' => 'Casa', 'O' => 'Outro');
     $options = array('label' => $this->_getLabel('moradia'), 'resources' => $moradias, 'required' => false, 'inline' => true);
     $this->inputsHelper()->select('moradia', $options);
     $materiais_moradia = array('A' => 'Alvenaria', 'M' => 'Madeira', 'I' => 'Mista');
     $options = array('label' => null, 'resources' => $materiais_moradia, 'required' => false, 'inline' => true);
     $this->inputsHelper()->select('material', $options);
     $options = array('label' => null, 'size' => 20, 'max_length' => 20, 'required' => false, 'placeholder' => 'Descreva');
     $this->inputsHelper()->text('casa_outra', $options);
     $situacoes = array(null => 'Selecione', '1' => 'Alugado', '2' => Portabilis_String_Utils::toLatin1('Próprio'), '3' => 'Cedido', '4' => 'Financiado', '5' => 'Outros');
     $options = array('label' => $this->_getLabel('moradia_situacao'), 'resources' => $situacoes, 'required' => false);
     $this->inputsHelper()->select('moradia_situacao', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quartos')), 'size' => 2, 'max_length' => 2, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->integer('quartos', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('sala')), 'size' => 2, 'max_length' => 2, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->integer('sala', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('copa')), 'size' => 2, 'max_length' => 2, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->integer('copa', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('banheiro')), 'size' => 2, 'max_length' => 2, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->integer('banheiro', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('garagem')), 'size' => 2, 'max_length' => 2, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->integer('garagem', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('empregada_domestica')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('empregada_domestica', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('automovel')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('automovel', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('motocicleta')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('motocicleta', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('computador')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('computador', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('geladeira')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('geladeira', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('fogao')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('fogao', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('maquina_lavar')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('maquina_lavar', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('microondas')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('microondas', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('video_dvd')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('video_dvd', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('televisao')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('televisao', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('telefone')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('telefone', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('celular')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('celular', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quant_pessoas')), 'size' => 5, 'max_length' => 2, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->integer('quant_pessoas', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('renda')), 'size' => 5, 'max_length' => 10, 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->numeric('renda', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('agua_encanada')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('agua_encanada', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('poco')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('poco', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('energia')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('energia', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('esgoto')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('esgoto', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('fossa')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('fossa', $options);
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('lixo')), 'required' => false, 'placeholder' => '');
     $this->inputsHelper()->checkbox('lixo', $options);
     $this->loadResourceAssets($this->getDispatcher());
 }
Beispiel #28
0
 function Gerar()
 {
     if ($_POST) {
         foreach ($_POST as $campo => $val) {
             $this->{$campo} = $this->{$campo} ? $this->{$campo} : $val;
         }
     }
     $this->campoOculto('cod_turma', $this->cod_turma);
     // foreign keys
     $obrigatorio = FALSE;
     $instituicao_obrigatorio = TRUE;
     $escola_curso_obrigatorio = TRUE;
     $curso_obrigatorio = TRUE;
     $get_escola = TRUE;
     $get_escola_curso_serie = FALSE;
     $sem_padrao = TRUE;
     $get_curso = TRUE;
     $bloqueia = false;
     $anoVisivel = false;
     if (isset($this->ano) || !is_numeric($this->cod_turma)) {
         $anoVisivel = true;
     }
     if (!isset($this->cod_turma)) {
         $bloqueia = false;
     } else {
         if (is_numeric($this->cod_turma)) {
             $obj_matriculas_turma = new clsPmieducarMatriculaTurma();
             $obj_matriculas_turma->setOrderby('nome_aluno');
             $lst_matriculas_turma = $obj_matriculas_turma->lista(NULL, $this->cod_turma, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, array(1, 2, 3), NULL, NULL, NULL, NULL, TRUE, NULL, 1, TRUE);
             if (is_array($lst_matriculas_turma) && count($lst_matriculas_turma) > 0) {
                 $bloqueia = true;
             }
         }
     }
     $desabilitado = $bloqueia;
     include 'include/pmieducar/educar_campo_lista.php';
     if ($this->ref_cod_escola) {
         $this->ref_ref_cod_escola = $this->ref_cod_escola;
     }
     $opcoes_serie = array('' => 'Selecione');
     // Editar
     if ($this->ref_cod_curso) {
         $obj_serie = new clsPmieducarSerie();
         $obj_serie->setOrderby('nm_serie ASC');
         $lst_serie = $obj_serie->lista(NULL, NULL, NULL, $this->ref_cod_curso, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
         if (is_array($lst_serie) && count($lst_serie)) {
             foreach ($lst_serie as $serie) {
                 $opcoes_serie[$serie['cod_serie']] = $serie['nm_serie'];
             }
         }
     }
     if ($bloqueia) {
         $this->campoOculto('serie_param', $this->serie_param = $this->ref_ref_cod_serie);
         $this->campoOculto('escola_param', $this->escola_param = $this->ref_cod_escola);
     }
     $this->campoLista('ref_ref_cod_serie', 'Série', $opcoes_serie, $this->ref_ref_cod_serie, '', FALSE, '', NULL, $bloqueia);
     // o campo ano somente é exibido para turmas novas  ou cadastradas após inclusão deste campo.
     if ($anoVisivel) {
         $this->inputsHelper()->dynamic('anoLetivo', array('disabled' => $bloqueia));
         if ($bloqueia) {
             $this->inputsHelper()->hidden('ano_hidden', array('value' => $this->ano));
         }
     }
     // Infra prédio cômodo
     $opcoes = array('' => 'Selecione');
     // Editar
     if ($this->ref_ref_cod_escola) {
         $obj_infra_predio = new clsPmieducarInfraPredio();
         $obj_infra_predio->setOrderby('nm_predio ASC');
         $lst_infra_predio = $obj_infra_predio->lista(NULL, NULL, NULL, $this->ref_ref_cod_escola, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
         if (is_array($lst_infra_predio) && count($lst_infra_predio)) {
             foreach ($lst_infra_predio as $predio) {
                 $obj_infra_predio_comodo = new clsPmieducarInfraPredioComodo();
                 $lst_infra_predio_comodo = $obj_infra_predio_comodo->lista(NULL, NULL, NULL, NULL, $predio['cod_infra_predio'], NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
                 if (is_array($lst_infra_predio_comodo) && count($lst_infra_predio_comodo)) {
                     foreach ($lst_infra_predio_comodo as $comodo) {
                         $opcoes[$comodo['cod_infra_predio_comodo']] = $comodo['nm_comodo'];
                     }
                 }
             }
         }
     }
     $this->campoLista('ref_cod_infra_predio_comodo', 'Sala', $opcoes, $this->ref_cod_infra_predio_comodo, NULL, NULL, NULL, NULL, NULL, FALSE);
     $array_servidor = array('' => 'Selecione um servidor');
     if ($this->ref_cod_regente) {
         $obj_pessoa = new clsPessoa_($this->ref_cod_regente);
         $det = $obj_pessoa->detalhe();
         $array_servidor[$this->ref_cod_regente] = $det['nome'];
     }
     $this->campoListaPesq('ref_cod_regente', 'Professor/Regente', $array_servidor, $this->ref_cod_regente, '', '', FALSE, '', '', NULL, NULL, '', TRUE, FALSE, FALSE);
     // Turma tipo
     $opcoes = array('' => 'Selecione');
     // Editar
     if ($this->ref_cod_instituicao) {
         $objTemp = new clsPmieducarTurmaTipo();
         $objTemp->setOrderby('nm_tipo ASC');
         $lista = $objTemp->lista(NULL, 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_turma_tipo']] = $registro['nm_tipo'];
             }
         }
     }
     $this->campoLista('ref_cod_turma_tipo', 'Tipo de Turma', $opcoes, $this->ref_cod_turma_tipo, '', FALSE, '', NULL);
     $this->campoTexto('nm_turma', 'Turma', $this->nm_turma, 30, 255, TRUE);
     $this->campoTexto('sgl_turma', 'Sigla', $this->sgl_turma, 15, 15, FALSE);
     $this->campoNumero('max_aluno', 'Máximo de Alunos', $this->max_aluno, 3, 3, TRUE);
     $this->inputsHelper()->date('data_fechamento', array('required' => false, 'label' => 'Data de fechamento', 'value' => Portabilis_Date_Utils::pgSQLToBr($this->data_fechamento)));
     $ativo = isset($this->cod_turma) ? dbBool($this->visivel) : true;
     $this->campoCheck('visivel', 'Ativo', $ativo);
     $this->campoCheck('multiseriada', 'Multi-Seriada', $this->multiseriada, '', FALSE, FALSE);
     $this->campoLista('ref_ref_cod_serie_mult', 'Série', array('' => 'Selecione'), '', '', FALSE, '', '', '', FALSE);
     $this->campoOculto('ref_ref_cod_serie_mult_', $this->ref_ref_cod_serie_mult);
     $this->campoQuebra2();
     // hora
     $this->campoHora('hora_inicial', 'Hora Inicial', $this->hora_inicial, FALSE);
     $this->campoHora('hora_final', 'Hora Final', $this->hora_final, FALSE);
     $this->campoHora('hora_inicio_intervalo', Portabilis_String_Utils::toLatin1('Hora Início Intervalo'), $this->hora_inicio_intervalo, FALSE);
     $this->campoHora('hora_fim_intervalo', 'Hora Fim Intervalo', $this->hora_fim_intervalo, FALSE);
     $this->inputsHelper()->turmaTurno();
     // modelos boletim
     require_once 'Portabilis/Model/Report/TipoBoletim.php';
     require_once 'Portabilis/Array/Utils.php';
     $tiposBoletim = Portabilis_Model_Report_TipoBoletim::getInstance()->getEnums();
     $tiposBoletim = Portabilis_Array_Utils::insertIn(null, "Selecione um modelo", $tiposBoletim);
     $this->campoLista('tipo_boletim', Portabilis_String_Utils::toLatin1('Modelo relatório boletim'), $tiposBoletim, $this->tipo_boletim);
     $this->campoQuebra2();
     if ($this->ref_ref_cod_serie) {
         require_once 'ComponenteCurricular/Model/ComponenteDataMapper.php';
         require_once 'ComponenteCurricular/Model/AnoEscolarDataMapper.php';
         require_once 'ComponenteCurricular/Model/TurmaDataMapper.php';
         $disciplinas = '';
         $conteudo = '';
         // Instancia o mapper de componente curricular
         $mapper = new ComponenteCurricular_Model_ComponenteDataMapper();
         // Instancia o mapper de ano escolar
         $anoEscolar = new ComponenteCurricular_Model_AnoEscolarDataMapper();
         $lista = $anoEscolar->findComponentePorSerie($this->ref_ref_cod_serie);
         // Instancia o mapper de turma
         $componenteTurmaMapper = new ComponenteCurricular_Model_TurmaDataMapper();
         $componentesTurma = array();
         if (isset($this->cod_turma) && is_numeric($this->cod_turma)) {
             $componentesTurma = $componenteTurmaMapper->findAll(array(), array('turma' => $this->cod_turma));
         }
         $componentes = array();
         foreach ($componentesTurma as $componenteTurma) {
             $componentes[$componenteTurma->get('componenteCurricular')] = $componenteTurma;
         }
         unset($componentesTurma);
         $this->escola_serie_disciplina = array();
         if (is_array($lista) && count($lista)) {
             $conteudo .= '<div style="margin-bottom: 10px;">';
             $conteudo .= '  <span style="display: block; float: left; width: 250px;">Nome</span>';
             $conteudo .= '  <span style="display: block; float: left; width: 100px;">' . Portabilis_String_Utils::toLatin1('Carga horária') . '</span>';
             $conteudo .= '  <span style="display: block; float: left">' . Portabilis_String_Utils::toLatin1('Usar padrão do componente?') . '</span>';
             $conteudo .= '</div>';
             $conteudo .= '<br style="clear: left" />';
             foreach ($lista as $registro) {
                 $checked = '';
                 $usarComponente = FALSE;
                 if (isset($componentes[$registro->id])) {
                     $checked = 'checked="checked"';
                 }
                 if (is_null($componentes[$registro->id]->cargaHoraria) || 0 == $componentes[$registro->id]->cargaHoraria) {
                     $usarComponente = TRUE;
                 } else {
                     $cargaHoraria = $componentes[$registro->id]->cargaHoraria;
                 }
                 $cargaComponente = $registro->cargaHoraria;
                 $conteudo .= '<div style="margin-bottom: 10px; float: left">';
                 $conteudo .= "  <label style='display: block; float: left; width: 250px'><input type=\"checkbox\" {$checked} name=\"disciplinas[{$registro->id}]\" id=\"disciplinas[]\" value=\"{$registro->id}\">{$registro}</label>";
                 $conteudo .= "  <label style='display: block; float: left; width: 100px;'><input type='text' name='carga_horaria[{$registro->id}]' value='{$cargaHoraria}' size='5' maxlength='7'></label>";
                 $conteudo .= "  <label style='display: block; float: left'><input type='checkbox' name='usar_componente[{$registro->id}]' value='1' " . ($usarComponente == TRUE ? $checked : '') . ">({$cargaComponente} h)</label>";
                 $conteudo .= '</div>';
                 $conteudo .= '<br style="clear: left" />';
                 $cargaHoraria = '';
             }
             $disciplinas = '<table cellspacing="0" cellpadding="0" border="0">';
             $disciplinas .= sprintf('<tr align="left"><td>%s</td></tr>', $conteudo);
             $disciplinas .= '</table>';
         } else {
             $disciplinas = Portabilis_String_Utils::toLatin1('A série/ano escolar não possui componentes curriculares cadastrados.');
         }
     }
     $componentes = $help = array();
     try {
         $componentes = App_Model_IedFinder::getEscolaSerieDisciplina($this->ref_ref_cod_serie, $this->ref_cod_escola);
     } catch (Exception $e) {
     }
     foreach ($componentes as $componente) {
         $help[] = sprintf('%s (%.0f h)', $componente->nome, $componente->cargaHoraria);
     }
     if (count($componentes)) {
         $help = '<ul><li>' . implode('</li><li>', $help) . '</li></ul>';
     } else {
         $help = '';
     }
     $label = 'Componentes curriculares:<br />' . '<strong>Observa&ccedil;&atilde;o:</strong> caso n&atilde;o defina os componentes<br />' . 'curriculares para a turma, esta usar&aacute; a defini&ccedil;&atilde;o<br />' . 'da s&eacute;rie/ano escolar da escola:' . '<span id="_escola_serie_componentes">%s</span>';
     $label = sprintf($label, $help);
     $this->campoRotulo('disciplinas_', $label, "<div id='disciplinas'>{$disciplinas}</div>");
     $this->campoQuebra2();
     if ($_POST['turma_modulo']) {
         $this->turma_modulo = unserialize(urldecode($_POST['turma_modulo']));
     }
     $qtd_modulo = count($this->turma_modulo) == 0 ? 1 : count($this->turma_modulo) + 1;
     if (is_numeric($this->cod_turma) && !$_POST) {
         $obj = new clsPmieducarTurmaModulo();
         $registros = $obj->lista($this->cod_turma);
         if ($registros) {
             foreach ($registros as $campo) {
                 $this->turma_modulo[$campo[$qtd_modulo]]['sequencial_'] = $campo['sequencial'];
                 $this->turma_modulo[$campo[$qtd_modulo]]['ref_cod_modulo_'] = $campo['ref_cod_modulo'];
                 $this->turma_modulo[$campo[$qtd_modulo]]['data_inicio_'] = dataFromPgToBr($campo['data_inicio']);
                 $this->turma_modulo[$campo[$qtd_modulo]]['data_fim_'] = dataFromPgToBr($campo['data_fim']);
                 $qtd_modulo++;
             }
         }
     }
     if ($_POST["ref_cod_modulo"] && $_POST["data_inicio"] && $_POST["data_fim"]) {
         $this->turma_modulo[$qtd_modulo]["sequencial_"] = $qtd_modulo;
         $this->turma_modulo[$qtd_modulo]["ref_cod_modulo_"] = $_POST["ref_cod_modulo"];
         $this->turma_modulo[$qtd_modulo]["data_inicio_"] = $_POST["data_inicio"];
         $this->turma_modulo[$qtd_modulo]["data_fim_"] = $_POST["data_fim"];
         $qtd_modulo++;
         unset($this->ref_cod_modulo);
         unset($this->data_inicio);
         unset($this->data_fim);
     }
     $this->campoOculto("excluir_modulo", "");
     $qtd_modulo = 1;
     unset($aux);
     if ($this->turma_modulo) {
         foreach ($this->turma_modulo as $campo) {
             if ($this->excluir_modulo == $campo['sequencial_']) {
                 $this->turma_modulo[$campo['sequencial']] = NULL;
                 $this->excluir_modulo = NULL;
             } else {
                 $obj_modulo = new clsPmieducarModulo($campo['ref_cod_modulo_']);
                 $det_modulo = $obj_modulo->detalhe();
                 $nm_tipo_modulo = $det_modulo['nm_tipo'];
                 $this->campoTextoInv('ref_cod_modulo_' . $campo['sequencial_'], '', $nm_tipo_modulo, 30, 255, FALSE, FALSE, TRUE, '', '', '', '', 'ref_cod_modulo');
                 $this->campoTextoInv('data_inicio_' . $campo['sequencial_'], '', $campo['data_inicio_'], 10, 10, FALSE, FALSE, TRUE, '', '', '', '', '');
                 $this->campoTextoInv('data_fim_' . $campo['sequencial_'], '', $campo['data_fim_'], 10, 10, FALSE, FALSE, FALSE, '', "<a href='#' onclick=\"document.getElementById('excluir_modulo').value = '{$campo["sequencial_"]}'; document.getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bola_xis.gif' title='Excluir' border=0></a>", '', '', '');
                 $aux[$qtd_modulo]['sequencial_'] = $qtd_modulo;
                 $aux[$qtd_modulo]['ref_cod_modulo_'] = $campo['ref_cod_modulo_'];
                 $aux[$qtd_modulo]['data_inicio_'] = $campo['data_inicio_'];
                 $aux[$qtd_modulo]['data_fim_'] = $campo['data_fim_'];
                 $qtd_modulo++;
             }
         }
         unset($this->turma_modulo);
         $this->turma_modulo = $aux;
     }
     $this->campoOculto('turma_modulo', serialize($this->turma_modulo));
     // Módulo
     // foreign keys
     $opcoes = array('' => 'Selecione');
     // Editar
     if ($this->ref_cod_instituicao) {
         $objTemp = new clsPmieducarModulo();
         $objTemp->setOrderby('nm_tipo ASC');
         $lista = $objTemp->lista(NULL, NULL, NULL, 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_modulo']] = $registro['nm_tipo'];
             }
         }
     }
     $this->campoLista('ref_cod_modulo', Portabilis_String_utils::toLatin1('Módulo'), $opcoes, $this->ref_cod_modulo, NULL, NULL, NULL, NULL, NULL, FALSE);
     $this->campoData('data_inicio', Portabilis_String_utils::toLatin1('Data Início'), $this->data_inicio, FALSE);
     $this->campoData('data_fim', 'Data Fim', $this->data_fim, FALSE);
     $this->campoOculto('incluir_modulo', '');
     $this->campoRotulo('bt_incluir_modulo', Portabilis_String_utils::toLatin1('Módulo'), "<a href='#' onclick=\"document.getElementById('incluir_modulo').value = 'S'; document.getElementById('tipoacao').value = ''; acao();\"><img src='imagens/nvp_bot_adiciona.gif' alt='adicionar' title='Incluir' border=0></a>");
     $this->campoQuebra2();
     if ($_POST['turma_dia_semana']) {
         $this->turma_dia_semana = unserialize(urldecode($_POST['turma_dia_semana']));
     }
     if (is_numeric($this->cod_turma) && !$_POST) {
         $obj = new clsPmieducarTurmaDiaSemana();
         $registros = $obj->lista(NULL, $this->cod_turma);
         if ($registros) {
             foreach ($registros as $campo) {
                 $aux['dia_semana_'] = $campo['dia_semana'];
                 $aux['hora_inicial_'] = $campo['hora_inicial'];
                 $aux['hora_final_'] = $campo['hora_final'];
                 $this->turma_dia_semana[] = $aux;
             }
         }
     }
     unset($aux);
     if ($_POST['dia_semana'] && $_POST['ds_hora_inicial'] && $_POST['ds_hora_final']) {
         $aux['dia_semana_'] = $_POST['dia_semana'];
         $aux['hora_inicial_'] = $_POST['ds_hora_inicial'];
         $aux['hora_final_'] = $_POST['ds_hora_final'];
         $this->turma_dia_semana[] = $aux;
         unset($this->dia_semana);
         unset($this->ds_hora_inicial);
         unset($this->ds_hora_final);
     }
     $this->campoOculto('excluir_dia_semana', '');
     unset($aux);
     if ($this->turma_dia_semana) {
         foreach ($this->turma_dia_semana as $key => $dias_semana) {
             if ($this->excluir_dia_semana == $dias_semana['dia_semana_']) {
                 unset($this->turma_dia_semana[$key]);
                 unset($this->excluir_dia_semana);
             } else {
                 $nm_dia_semana = $this->dias_da_semana[$dias_semana['dia_semana_']];
                 $this->campoTextoInv('dia_semana_' . $dias_semana['dia_semana_'], '', $nm_dia_semana, 8, 8, FALSE, FALSE, TRUE, '', '', '', '', 'dia_semana');
                 $this->campoTextoInv('hora_inicial_' . $dias_semana['dia_semana_'], '', $dias_semana['hora_inicial_'], 5, 5, FALSE, FALSE, TRUE, '', '', '', '', 'ds_hora_inicial_');
                 $this->campoTextoInv('hora_final_' . $dias_semana['dia_semana_'], '', $dias_semana['hora_final_'], 5, 5, FALSE, FALSE, FALSE, '', "<a href='#' onclick=\"document.getElementById('excluir_dia_semana').value = '{$dias_semana["dia_semana_"]}'; document.getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bola_xis.gif' title='Excluir' border=0></a>", '', '', 'ds_hora_final_');
                 $aux['dia_semana_'] = $dias_semana['dia_semana_'];
                 $aux['hora_inicial_'] = $dias_semana['hora_inicial_'];
                 $aux['hora_final_'] = $dias_semana['hora_final_'];
             }
         }
     }
     $this->campoOculto('turma_dia_semana', serialize($this->turma_dia_semana));
     if (class_exists('clsPmieducarTurmaDiaSemana')) {
         $opcoes = $this->dias_da_semana;
     } else {
         echo '<!--\\nErro\\nClasse clsPmieducarTurmaDiaSemana não encontrada\\n-->';
         $opcoes = array('' => Portabilis_String_utils::toLatin1('Erro na geração'));
     }
     $this->campoLista('dia_semana', 'Dia Semana', $opcoes, $this->dia_semana, NULL, false, '', '', false, false);
     $this->campoHora('ds_hora_inicial', 'Hora Inicial', $this->ds_hora_inicial, FALSE);
     $this->campoHora('ds_hora_final', 'Hora Final', $this->ds_hora_final, FALSE);
     $this->campoOculto('incluir_dia_semana', '');
     $this->campoRotulo('bt_incluir_dia_semana', 'Dia Semana', "<a href='#' onclick=\"document.getElementById('incluir_dia_semana').value = 'S'; document.getElementById('tipoacao').value = ''; acao();\"><img src='imagens/nvp_bot_adiciona.gif' alt='adicionar' title='Incluir' border=0></a>");
     $this->campoOculto('padrao_ano_escolar', $this->padrao_ano_escolar);
     $this->acao_enviar = 'valida()';
 }
Beispiel #29
0
 protected function textInput($objectName, $attrName, $options)
 {
     $textHelperOptions = array('objectName' => $objectName);
     $options['options']['placeholder'] = Portabilis_String_Utils::toLatin1($this->inputPlaceholder(), array('escape' => false));
     $this->inputsHelper()->text($attrName, $options['options'], $textHelperOptions);
 }
 protected function createOrUpdateAluno($id = null)
 {
     $tiposResponsavel = array('pai' => 'p', 'mae' => 'm', 'outra_pessoa' => 'r');
     $aluno = new clsPmieducarAluno();
     $aluno->cod_aluno = $id;
     $aluno->aluno_estado_id = Portabilis_String_Utils::toLatin1($this->getRequest()->aluno_estado_id);
     // após cadastro não muda mais id pessoa
     if (is_null($id)) {
         $aluno->ref_idpes = $this->getRequest()->pessoa_id;
     }
     $aluno->ref_cod_aluno_beneficio = $this->getRequest()->beneficio_id;
     $aluno->ref_cod_religiao = $this->getRequest()->religiao_id;
     $aluno->analfabeto = $this->getRequest()->alfabetizado ? 0 : 1;
     $aluno->tipo_responsavel = $tiposResponsavel[$this->getRequest()->tipo_responsavel];
     $aluno->ref_usuario_exc = $this->getSession()->id_pessoa;
     return is_null($id) ? $aluno->cadastra() : $aluno->edita();
 }