From c745fcdd2cb40853931b5ba5eb537cfb28862622 Mon Sep 17 00:00:00 2001 From: Lucas Schmoeller da Silva Date: Wed, 18 Mar 2015 11:01:31 -0300 Subject: [PATCH] Adicionado informações adicionais no cad de alunos --- ieducar/intranet/educar_aluno_det.php | 179 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- ieducar/intranet/include/modules/clsModulesFichaMedicaAluno.inc.php | 735 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ieducar/intranet/include/modules/clsModulesMoradiaAluno.inc.php | 796 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ieducar/intranet/include/modules/clsModulesUniformeAluno.inc.php | 527 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ieducar/misc/database/deltas/portabilis/61_cria_ficha_medica_aluno.sql | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ieducar/misc/database/deltas/portabilis/62_cria_uniforme_escolar.sql | 41 +++++++++++++++++++++++++++++++++++++++++ ieducar/misc/database/deltas/portabilis/63_cria_tabela_moradia_aluno.sql | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ ieducar/modules/Api/Views/AlunoController.php | 182 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- ieducar/modules/Cadastro/Assets/Javascripts/Aluno.js | 423 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------- ieducar/modules/Cadastro/Assets/Javascripts/AlunoShow.js | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- ieducar/modules/Cadastro/Assets/Stylesheets/Aluno.css | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ieducar/modules/Cadastro/Views/AlunoController.php | 593 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ ieducar/modules/Portabilis/Assets/Version.php | 2 +- 13 files changed, 3880 insertions(+), 28 deletions(-) create mode 100644 ieducar/intranet/include/modules/clsModulesFichaMedicaAluno.inc.php create mode 100644 ieducar/intranet/include/modules/clsModulesMoradiaAluno.inc.php create mode 100644 ieducar/intranet/include/modules/clsModulesUniformeAluno.inc.php create mode 100644 ieducar/misc/database/deltas/portabilis/61_cria_ficha_medica_aluno.sql create mode 100644 ieducar/misc/database/deltas/portabilis/62_cria_uniforme_escolar.sql create mode 100644 ieducar/misc/database/deltas/portabilis/63_cria_tabela_moradia_aluno.sql diff --git a/ieducar/intranet/educar_aluno_det.php b/ieducar/intranet/educar_aluno_det.php index e4cad0f..07d3d1d 100644 --- a/ieducar/intranet/educar_aluno_det.php +++ b/ieducar/intranet/educar_aluno_det.php @@ -32,6 +32,9 @@ require_once 'include/clsBase.inc.php'; require_once 'include/clsDetalhe.inc.php'; require_once 'include/clsBanco.inc.php'; require_once 'include/pmieducar/geral.inc.php'; +require_once 'include/modules/clsModulesFichaMedicaAluno.inc.php'; +require_once 'include/modules/clsModulesUniformeAluno.inc.php'; +require_once 'include/modules/clsModulesMoradiaAluno.inc.php'; require_once 'App/Model/ZonaLocalizacao.php'; require_once 'Educacenso/Model/AlunoDataMapper.php'; @@ -41,6 +44,7 @@ require_once 'include/pessoa/clsCadastroFisicaFoto.inc.php'; require_once 'Portabilis/View/Helper/Application.php'; + /** * clsIndexBase class. * @@ -141,7 +145,7 @@ class indice extends clsDetalhe $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']); @@ -386,9 +390,11 @@ class indice extends clsDetalhe if ($caminhoFoto!=null and $caminhoFoto!='') $this->addDetalhe(array('Nome Aluno', $registro['nome_aluno'].'

')); else - $this->addDetalhe(array('Nome Aluno', $registro['nome_aluno'])); + $this->addDetalhe(array('Nome Aluno', $registro['nome_aluno'])); } + + if (idFederal2int($registro['cpf'])) { $this->addDetalhe(array('CPF', $registro['cpf'])); } @@ -669,6 +675,167 @@ class indice extends clsDetalhe ); } + $objFichaMedica = new clsModulesFichaMedicaAluno($this->cod_aluno); + $reg = $objFichaMedica->detalhe(); + + if($reg){ + + $this->addDetalhe(array('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'])); + $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('Em caso de emergência, levar para hospital ou clínica')); + $this->addDetalhe(array('Nome', $reg['hospital_clinica'])); + $this->addDetalhe(array('Endereco', $reg['hospital_clinica_endereco'])); + $this->addDetalhe(array('Telefone', $reg['hospital_clinica_telefone'])); + $this->addDetalhe(array('Em caso de emergência, se não for possível contatar os responsáveis, comunicar')); + $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('Recebeu uniforme escolar', ($reg['recebeu_uniforme'] == 'S' ? 'Sim': 'Não') )); + $this->addDetalhe(array('Camiseta')); + $this->addDetalhe(array('Quantidade', $reg['quantidade_camiseta'])); + $this->addDetalhe(array('Tamanho', $reg['tamanho_camiseta'])); + $this->addDetalhe(array('Blusa/Jaqueta')); + $this->addDetalhe(array('Quantidade', $reg['quantidade_blusa_jaqueta'])); + $this->addDetalhe(array('Tamanho', $reg['tamanho_blusa_jaqueta'])); + $this->addDetalhe(array('Bermuda')); + $this->addDetalhe(array('Quantidade', $reg['quantidade_bermuda'])); + $this->addDetalhe(array('Tamanho', $reg['tamanho_bermuda'])); + $this->addDetalhe(array('Calça')); + $this->addDetalhe(array('Quantidade', $reg['quantidade_calca'])); + $this->addDetalhe(array('Tamanho', $reg['tamanho_calca'])); + $this->addDetalhe(array('Saia')); + $this->addDetalhe(array('Quantidade', $reg['quantidade_saia'])); + $this->addDetalhe(array('Tamanho', $reg['tamanho_saia'])); + $this->addDetalhe(array('Calçado')); + $this->addDetalhe(array('Quantidade', $reg['quantidade_calcado'])); + $this->addDetalhe(array('Tamanho', $reg['tamanho_calcado'])); + $this->addDetalhe(array('Meia')); + $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('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%'; @@ -681,11 +848,15 @@ class indice extends clsDetalhe $scripts = array( '/modules/Portabilis/Assets/Javascripts/Utils.js', - '/modules/Portabilis/Assets/Javascripts/ClientApi.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); } } @@ -699,4 +870,4 @@ $miolo = new indice(); $pagina->addForm($miolo); // Gera o HTML -$pagina->MakeAll(); +$pagina->MakeAll(); \ No newline at end of file diff --git a/ieducar/intranet/include/modules/clsModulesFichaMedicaAluno.inc.php b/ieducar/intranet/include/modules/clsModulesFichaMedicaAluno.inc.php new file mode 100644 index 0000000..f057ba0 --- /dev/null +++ b/ieducar/intranet/include/modules/clsModulesFichaMedicaAluno.inc.php @@ -0,0 +1,735 @@ + + * + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) + * qualquer versão posterior. + * + * Este programa é distribuí­do na expectativa de que seja útil, porém, SEM + * NENHUMA GARANTIA; nem mesmo a garantia implí­cita de COMERCIABILIDADE OU + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral + * do GNU para mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto + * com este programa; se não, escreva para a Free Software Foundation, Inc., no + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. + * + * @author Lucas Schmoeller da Silva + * @category i-Educar + * @license @@license@@ + * @package Module + * @since 07/2013 + * @version $Id$ + */ +require_once 'include/pmieducar/geral.inc.php'; +/** + * clsModulesFichaMedicaAluno class. + * + * @author Lucas Schmoeller da Silva + * @category i-Educar + * @license @@license@@ + * @package Module + * @since 09/2013 + * @version @@package_version@@ + */ +class clsModulesFichaMedicaAluno +{ + var $ref_cod_aluno; + var $altura; + var $peso; + var $grupo_sanguineo; + var $fator_rh; + var $alergia_medicamento; + var $desc_alergia_medicamento; + var $alergia_alimento; + var $desc_alergia_alimento; + var $doenca_congenita; + var $desc_doenca_congenita; + var $fumante; + var $doenca_caxumba; + var $doenca_sarampo; + var $doenca_rubeola; + var $doenca_catapora; + var $doenca_escarlatina; + var $doenca_coqueluche; + var $doenca_outras; + var $epiletico; + var $epiletico_tratamento; + var $hemofilico; + var $hipertenso; + var $asmatico; + var $diabetico; + var $insulina; + var $tratamento_medico; + var $desc_tratamento_medico; + var $medicacao_especifica; + var $desc_medicacao_especifica; + var $acomp_medico_psicologico; + var $desc_acomp_medico_psicologico; + var $restricao_atividade_fisica; + var $desc_restricao_atividade_fisica; + var $fratura_trauma; + var $desc_fratura_trauma; + var $plano_saude; + var $desc_plano_saude; + var $hospital_clinica; + var $hospital_clinica_endereco; + var $hospital_clinica_telefone; + var $responsavel; + var $responsavel_parentesco; + var $responsavel_parentesco_telefone; + var $responsavel_parentesco_celular; + /** + * @var int + * Armazena o total de resultados obtidos na última chamada ao método lista(). + */ + var $_total; + /** + * Nome do schema. + * @var string + */ + var $_schema; + /** + * Nome da tabela. + * @var string + */ + var $_tabela; + /** + * Lista separada por vírgula, com os campos que devem ser selecionados na + * próxima chamado ao método lista(). + * @var string + */ + var $_campos_lista; + /** + * Lista com todos os campos da tabela separados por vírgula, padrão para + * seleção no método lista. + * @var string + */ + var $_todos_campos; + /** + * Valor que define a quantidade de registros a ser retornada pelo método lista(). + * @var int + */ + var $_limite_quantidade; + /** + * Define o valor de offset no retorno dos registros no método lista(). + * @var int + */ + var $_limite_offset; + /** + * Define o campo para ser usado como padrão de ordenação no método lista(). + * @var string + */ + var $_campo_order_by; + /** + * Construtor. + */ + function clsModulesFichaMedicaAluno( $ref_cod_aluno = NULL , $altura = NULL , $peso = NULL , $grupo_sanguineo = NULL , + $fator_rh = NULL , $alergia_medicamento = NULL , $desc_alergia_medicamento = NULL , + $alergia_alimento = NULL , $desc_alergia_alimento = NULL , $doenca_congenita = NULL , + $desc_doenca_congenita = NULL , $fumante = NULL , $doenca_caxumba = NULL , $doenca_sarampo = NULL , + $doenca_rubeola = NULL , $doenca_catapora = NULL , $doenca_escarlatina = NULL , $doenca_coqueluche = NULL , + $doenca_outras = NULL , $epiletico = NULL , $epiletico_tratamento = NULL , $hemofilico = NULL , + $hipertenso = NULL , $asmatico = NULL , $diabetico = NULL , $insulina = NULL , + $tratamento_medico = NULL , $desc_tratamento_medico = NULL , $medicacao_especifica = NULL , + $desc_medicacao_especifica = NULL , $acomp_medico_psicologico = NULL , $desc_acomp_medico_psicologico = NULL , + $restricao_atividade_fisica = NULL , $desc_restricao_atividade_fisica = NULL , $fratura_trauma = NULL , + $desc_fratura_trauma = NULL , $plano_saude = NULL , $desc_plano_saude = NULL , $hospital_clinica = NULL , + $hospital_clinica_endereco = NULL , $hospital_clinica_telefone = NULL , $responsavel = NULL , + $responsavel_parentesco = NULL , $responsavel_parentesco_telefone = NULL , $responsavel_parentesco_celular = NULL) + { + $db = new clsBanco(); + $this->_schema = "modules."; + $this->_tabela = "{$this->_schema}ficha_medica_aluno"; + $this->_campos_lista = $this->_todos_campos = " ref_cod_aluno, altura, peso, grupo_sanguineo, + fator_rh, alergia_medicamento, desc_alergia_medicamento,alergia_alimento, desc_alergia_alimento, + doenca_congenita,desc_doenca_congenita, fumante, doenca_caxumba, doenca_sarampo,doenca_rubeola, + doenca_catapora, doenca_escarlatina, doenca_coqueluche,doenca_outras, epiletico, + epiletico_tratamento, hemofilico,hipertenso, asmatico, diabetico, insulina,tratamento_medico, + desc_tratamento_medico, medicacao_especifica,desc_medicacao_especifica, acomp_medico_psicologico, + desc_acomp_medico_psicologico,restricao_atividade_fisica, desc_restricao_atividade_fisica, + fratura_trauma,desc_fratura_trauma, plano_saude, desc_plano_saude, hospital_clinica, + hospital_clinica_endereco, hospital_clinica_telefone, responsavel,responsavel_parentesco, + responsavel_parentesco_telefone, responsavel_parentesco_celular"; + if (is_numeric($ref_cod_aluno)) { + $this->ref_cod_aluno = $ref_cod_aluno; + } + if (is_string($altura)) { + $this->altura = $altura; + } + if (is_string($peso)) { + $this->peso = $peso; + } + if (is_string($grupo_sanguineo)) { + $this->grupo_sanguineo = $grupo_sanguineo; + } + if (is_string($fator_rh)) { + $this->fator_rh = $fator_rh; + } + if (is_string($alergia_medicamento)) { + $this->alergia_medicamento = $alergia_medicamento; + } + if (is_string($desc_alergia_medicamento)) { + $this->desc_alergia_medicamento = $desc_alergia_medicamento; + } + if (is_string($alergia_alimento)) { + $this->alergia_alimento = $alergia_alimento; + } + if (is_string($desc_alergia_alimento)) { + $this->desc_alergia_alimento = $desc_alergia_alimento; + } + if (is_string($doenca_congenita)) { + $this->doenca_congenita = $doenca_congenita; + } + if (is_string($desc_doenca_congenita)) { + $this->desc_doenca_congenita = $desc_doenca_congenita; + } + if (is_string($fumante)) { + $this->fumante = $fumante; + } + if (is_string($doenca_caxumba)) { + $this->doenca_caxumba = $doenca_caxumba; + } + if (is_string($doenca_sarampo)) { + $this->doenca_sarampo = $doenca_sarampo; + } + if (is_string($doenca_rubeola)) { + $this->doenca_rubeola = $doenca_rubeola; + } + if (is_string($doenca_catapora)) { + $this->doenca_catapora = $doenca_catapora; + } + if (is_string($doenca_escarlatina)) { + $this->doenca_escarlatina = $doenca_escarlatina; + } + if (is_string($doenca_coqueluche)) { + $this->doenca_coqueluche = $doenca_coqueluche; + } + if (is_string($doenca_outras)) { + $this->doenca_outras = $doenca_outras; + } + if (is_string($epiletico)) { + $this->epiletico = $epiletico; + } + if (is_string($epiletico_tratamento)) { + $this->epiletico_tratamento = $epiletico_tratamento; + } + if (is_string($hemofilico)) { + $this->hemofilico = $hemofilico; + } + if (is_string($hipertenso)) { + $this->hipertenso = $hipertenso; + } + if (is_string($asmatico)) { + $this->asmatico = $asmatico; + } + if (is_string($diabetico)) { + $this->diabetico = $diabetico; + } + if (is_string($insulina)) { + $this->insulina = $insulina; + } + if (is_string($tratamento_medico)) { + $this->tratamento_medico = $tratamento_medico; + } + if (is_string($desc_tratamento_medico)) { + $this->desc_tratamento_medico = $desc_tratamento_medico; + } + if (is_string($medicacao_especifica)) { + $this->medicacao_especifica = $medicacao_especifica; + } + if (is_string($desc_medicacao_especifica)) { + $this->desc_medicacao_especifica = $desc_medicacao_especifica; + } + if (is_string($acomp_medico_psicologico)) { + $this->acomp_medico_psicologico = $acomp_medico_psicologico; + } + if (is_string($desc_acomp_medico_psicologico)) { + $this->desc_acomp_medico_psicologico = $desc_acomp_medico_psicologico; + } + if (is_string($restricao_atividade_fisica)) { + $this->restricao_atividade_fisica = $restricao_atividade_fisica; + } + if (is_string($desc_restricao_atividade_fisica)) { + $this->desc_restricao_atividade_fisica = $desc_restricao_atividade_fisica; + } + if (is_string($fratura_trauma)) { + $this->fratura_trauma = $fratura_trauma; + } + if (is_string($desc_fratura_trauma)) { + $this->desc_fratura_trauma = $desc_fratura_trauma; + } + if (is_string($plano_saude)) { + $this->plano_saude = $plano_saude; + } + if (is_string($desc_plano_saude)) { + $this->desc_plano_saude = $desc_plano_saude; + } + if (is_string($hospital_clinica)) { + $this->hospital_clinica = $hospital_clinica; + } + if (is_string($hospital_clinica_endereco)) { + $this->hospital_clinica_endereco = $hospital_clinica_endereco; + } + if (is_string($hospital_clinica_telefone)) { + $this->hospital_clinica_telefone = $hospital_clinica_telefone; + } + if (is_string($responsavel)) { + $this->responsavel = $responsavel; + } + if (is_string($responsavel_parentesco)) { + $this->responsavel_parentesco = $responsavel_parentesco; + } + if (is_string($responsavel_parentesco_telefone)) { + $this->responsavel_parentesco_telefone = $responsavel_parentesco_telefone; + } + if (is_string($responsavel_parentesco_celular)) { + $this->responsavel_parentesco_celular = $responsavel_parentesco_celular; + } + } + /** + * Cria um novo registro. + * @return bool + */ + function cadastra() + { + if (is_numeric($this->ref_cod_aluno)) + { + $db = new clsBanco(); + $campos = ''; + $valores = ''; + $gruda = ''; + $campos .= "{$gruda}ref_cod_aluno"; + $valores .= "{$gruda}{$this->ref_cod_aluno}"; + $gruda = ", "; + $campos .= "{$gruda}altura"; + $valores .= "{$gruda}'{$this->altura}'"; + $gruda = ", "; + + $campos .= "{$gruda}peso"; + $valores .= "{$gruda}'{$this->peso}'"; + $gruda = ", "; + + $campos .= "{$gruda}grupo_sanguineo"; + $valores .= "{$gruda}'{$this->grupo_sanguineo}'"; + $gruda = ", "; + + $campos .= "{$gruda}fator_rh"; + $valores .= "{$gruda}'{$this->fator_rh}'"; + $gruda = ", "; + + $campos .= "{$gruda}alergia_medicamento"; + $valores .= "{$gruda}'{$this->alergia_medicamento}'"; + $gruda = ", "; + + $campos .= "{$gruda}desc_alergia_medicamento"; + $valores .= "{$gruda}'{$this->desc_alergia_medicamento}'"; + $gruda = ", "; + + $campos .= "{$gruda}alergia_alimento"; + $valores .= "{$gruda}'{$this->alergia_alimento}'"; + $gruda = ", "; + + $campos .= "{$gruda}desc_alergia_alimento"; + $valores .= "{$gruda}'{$this->desc_alergia_alimento}'"; + $gruda = ", "; + + $campos .= "{$gruda}doenca_congenita"; + $valores .= "{$gruda}'{$this->doenca_congenita}'"; + $gruda = ", "; + + $campos .= "{$gruda}desc_doenca_congenita"; + $valores .= "{$gruda}'{$this->desc_doenca_congenita}'"; + $gruda = ", "; + + $campos .= "{$gruda}fumante"; + $valores .= "{$gruda}'{$this->fumante}'"; + $gruda = ", "; + + $campos .= "{$gruda}doenca_caxumba"; + $valores .= "{$gruda}'{$this->doenca_caxumba}'"; + $gruda = ", "; + + $campos .= "{$gruda}doenca_sarampo"; + $valores .= "{$gruda}'{$this->doenca_sarampo}'"; + $gruda = ", "; + + $campos .= "{$gruda}doenca_rubeola"; + $valores .= "{$gruda}'{$this->doenca_rubeola}'"; + $gruda = ", "; + + $campos .= "{$gruda}doenca_catapora"; + $valores .= "{$gruda}'{$this->doenca_catapora}'"; + $gruda = ", "; + + $campos .= "{$gruda}doenca_escarlatina"; + $valores .= "{$gruda}'{$this->doenca_escarlatina}'"; + $gruda = ", "; + + $campos .= "{$gruda}doenca_coqueluche"; + $valores .= "{$gruda}'{$this->doenca_coqueluche}'"; + $gruda = ", "; + + $campos .= "{$gruda}doenca_outras"; + $valores .= "{$gruda}'{$this->doenca_outras}'"; + $gruda = ", "; + + $campos .= "{$gruda}epiletico"; + $valores .= "{$gruda}'{$this->epiletico}'"; + $gruda = ", "; + + $campos .= "{$gruda}epiletico_tratamento"; + $valores .= "{$gruda}'{$this->epiletico_tratamento}'"; + $gruda = ", "; + + $campos .= "{$gruda}hemofilico"; + $valores .= "{$gruda}'{$this->hemofilico}'"; + $gruda = ", "; + + $campos .= "{$gruda}hipertenso"; + $valores .= "{$gruda}'{$this->hipertenso}'"; + $gruda = ", "; + + $campos .= "{$gruda}asmatico"; + $valores .= "{$gruda}'{$this->asmatico}'"; + $gruda = ", "; + + $campos .= "{$gruda}diabetico"; + $valores .= "{$gruda}'{$this->diabetico}'"; + $gruda = ", "; + + $campos .= "{$gruda}insulina"; + $valores .= "{$gruda}'{$this->insulina}'"; + $gruda = ", "; + + $campos .= "{$gruda}tratamento_medico"; + $valores .= "{$gruda}'{$this->tratamento_medico}'"; + $gruda = ", "; + + $campos .= "{$gruda}desc_tratamento_medico"; + $valores .= "{$gruda}'{$this->desc_tratamento_medico}'"; + $gruda = ", "; + + $campos .= "{$gruda}medicacao_especifica"; + $valores .= "{$gruda}'{$this->medicacao_especifica}'"; + $gruda = ", "; + + $campos .= "{$gruda}desc_medicacao_especifica"; + $valores .= "{$gruda}'{$this->desc_medicacao_especifica}'"; + $gruda = ", "; + + $campos .= "{$gruda}acomp_medico_psicologico"; + $valores .= "{$gruda}'{$this->acomp_medico_psicologico}'"; + $gruda = ", "; + + $campos .= "{$gruda}desc_acomp_medico_psicologico"; + $valores .= "{$gruda}'{$this->desc_acomp_medico_psicologico}'"; + $gruda = ", "; + + $campos .= "{$gruda}restricao_atividade_fisica"; + $valores .= "{$gruda}'{$this->restricao_atividade_fisica}'"; + $gruda = ", "; + + $campos .= "{$gruda}desc_restricao_atividade_fisica"; + $valores .= "{$gruda}'{$this->desc_restricao_atividade_fisica}'"; + $gruda = ", "; + + $campos .= "{$gruda}fratura_trauma"; + $valores .= "{$gruda}'{$this->fratura_trauma}'"; + $gruda = ", "; + + $campos .= "{$gruda}desc_fratura_trauma"; + $valores .= "{$gruda}'{$this->desc_fratura_trauma}'"; + $gruda = ", "; + + $campos .= "{$gruda}plano_saude"; + $valores .= "{$gruda}'{$this->plano_saude}'"; + $gruda = ", "; + + $campos .= "{$gruda}desc_plano_saude"; + $valores .= "{$gruda}'{$this->desc_plano_saude}'"; + $gruda = ", "; + + $campos .= "{$gruda}hospital_clinica"; + $valores .= "{$gruda}'{$this->hospital_clinica}'"; + $gruda = ", "; + + $campos .= "{$gruda}hospital_clinica_endereco"; + $valores .= "{$gruda}'{$this->hospital_clinica_endereco}'"; + $gruda = ", "; + + $campos .= "{$gruda}hospital_clinica_telefone"; + $valores .= "{$gruda}'{$this->hospital_clinica_telefone}'"; + $gruda = ", "; + + $campos .= "{$gruda}responsavel"; + $valores .= "{$gruda}'{$this->responsavel}'"; + $gruda = ", "; + + $campos .= "{$gruda}responsavel_parentesco"; + $valores .= "{$gruda}'{$this->responsavel_parentesco}'"; + $gruda = ", "; + + $campos .= "{$gruda}responsavel_parentesco_celular"; + $valores .= "{$gruda}'{$this->responsavel_parentesco_celular}'"; + $gruda = ", "; + + $campos .= "{$gruda}responsavel_parentesco_telefone"; + $valores .= "{$gruda}'{$this->responsavel_parentesco_telefone}'"; + $gruda = ", "; + + $db->Consulta("INSERT INTO {$this->_tabela} ( $campos ) VALUES( $valores )"); + return $this->ref_cod_aluno; + } + return FALSE; + } + /** + * Edita os dados de um registro. + * @return bool + */ + function edita() + { + if (is_numeric($this->ref_cod_aluno)) { + $db = new clsBanco(); + $set = ''; + $set .= "altura = '{$this->altura}'"; + + $set .= ",peso = '{$this->peso}'"; + + $set .= ",grupo_sanguineo = '{$this->grupo_sanguineo}'"; + + $set .= ",fator_rh = '{$this->fator_rh}'"; + + $set .= ",alergia_medicamento = '{$this->alergia_medicamento}'"; + + $set .= ",desc_alergia_medicamento = '{$this->desc_alergia_medicamento}'"; + + $set .= ",alergia_alimento = '{$this->alergia_alimento}'"; + + $set .= ",desc_alergia_alimento = '{$this->desc_alergia_alimento}'"; + + $set .= ",doenca_congenita = '{$this->doenca_congenita}'"; + + $set .= ",desc_doenca_congenita = '{$this->desc_doenca_congenita}'"; + + $set .= ",fumante = '{$this->fumante}'"; + + $set .= ",doenca_caxumba = '{$this->doenca_caxumba}'"; + + $set .= ",doenca_sarampo = '{$this->doenca_sarampo}'"; + + $set .= ",doenca_rubeola = '{$this->doenca_rubeola}'"; + + $set .= ",doenca_catapora = '{$this->doenca_catapora}'"; + + $set .= ",doenca_escarlatina = '{$this->doenca_escarlatina}'"; + + $set .= ",doenca_coqueluche = '{$this->doenca_coqueluche}'"; + + $set .= ",doenca_outras = '{$this->doenca_outras}'"; + + $set .= ",epiletico = '{$this->epiletico}'"; + $set .= ",epiletico_tratamento = '{$this->epiletico_tratamento}'"; + + $set .= ",hemofilico = '{$this->hemofilico}'"; + + $set .= ",hipertenso = '{$this->hipertenso}'"; + + $set .= ",asmatico = '{$this->asmatico}'"; + + $set .= ",diabetico = '{$this->diabetico}'"; + + $set .= ",insulina = '{$this->insulina}'"; + + $set .= ",tratamento_medico = '{$this->tratamento_medico}'"; + + $set .= ",desc_tratamento_medico = '{$this->desc_tratamento_medico}'"; + + $set .= ",medicacao_especifica = '{$this->medicacao_especifica}'"; + + $set .= ",desc_medicacao_especifica = '{$this->desc_medicacao_especifica}'"; + + $set .= ",acomp_medico_psicologico = '{$this->acomp_medico_psicologico}'"; + + $set .= ",desc_acomp_medico_psicologico = '{$this->desc_acomp_medico_psicologico}'"; + + $set .= ",restricao_atividade_fisica = '{$this->restricao_atividade_fisica}'"; + + $set .= ",desc_restricao_atividade_fisica = '{$this->desc_restricao_atividade_fisica}'"; + + $set .= ",fratura_trauma = '{$this->fratura_trauma}'"; + + $set .= ",desc_fratura_trauma = '{$this->desc_fratura_trauma}'"; + + $set .= ",plano_saude = '{$this->plano_saude}'"; + + $set .= ",desc_plano_saude = '{$this->desc_plano_saude}'"; + + $set .= ",hospital_clinica = '{$this->hospital_clinica}'"; + + $set .= ",hospital_clinica_endereco = '{$this->hospital_clinica_endereco}'"; + + $set .= ",hospital_clinica_telefone = '{$this->hospital_clinica_telefone}'"; + + $set .= ",responsavel = '{$this->responsavel}'"; + + $set .= ",responsavel_parentesco = '{$this->responsavel_parentesco}'"; + + $set .= ",responsavel_parentesco_telefone = '{$this->responsavel_parentesco_telefone}'"; + + $set .= ",responsavel_parentesco_celular = '{$this->responsavel_parentesco_celular}'"; + + if ($set) { + $db->Consulta("UPDATE {$this->_tabela} SET $set WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); + return TRUE; + } + } + return FALSE; + } + /** + * Retorna uma lista de registros filtrados de acordo com os parâmetros. + * @return array + */ + function lista() + { + $sql = "SELECT {$this->_campos_lista} FROM {$this->_tabela}"; + $filtros = ""; + /* + $whereAnd = " WHERE "; + if (is_string($altura)) { + $filtros .= "{$whereAnd} TO_ASCII(LOWER(altura)) LIKE TO_ASCII(LOWER('%{$altura}%'))"; + $whereAnd = " AND "; + }*/ + $db = new clsBanco(); + $countCampos = count(explode(',', $this->_campos_lista))+2; + $resultado = array(); + $sql .= $filtros . $this->getOrderby() . $this->getLimite(); + $this->_total = $db->CampoUnico("SELECT COUNT(0) FROM {$this->_tabela} {$filtros}"); + $db->Consulta($sql); + if ($countCampos > 1) { + while ($db->ProximoRegistro()) { + $tupla = $db->Tupla(); + $tupla["_total"] = $this->_total; + $resultado[] = $tupla; + } + } + else { + while ($db->ProximoRegistro()) { + $tupla = $db->Tupla(); + $resultado[] = $tupla[$this->_campos_lista]; + } + } + if (count($resultado)) { + return $resultado; + } + return FALSE; + } + /** + * Retorna um array com os dados de um registro. + * @return array + */ + function detalhe() + { + if (is_numeric($this->ref_cod_aluno)) { + $db = new clsBanco(); + $db->Consulta("SELECT {$this->_todos_campos} FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); + $db->ProximoRegistro(); + return $db->Tupla(); + } + return FALSE; + } + /** + * Retorna um array com os dados de um registro. + * @return array + */ + function existe() + { + if (is_numeric($this->ref_cod_aluno)) { + $db = new clsBanco(); + $db->Consulta("SELECT 1 FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); + $db->ProximoRegistro(); + return $db->Tupla(); + } + return FALSE; + } + /** + * Exclui um registro. + * @return bool + */ + function excluir() + { + if (is_numeric($this->ref_cod_aluno)) { + $sql = "DELETE FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"; + $db = new clsBanco(); + $db->Consulta($sql); + return true; + } + return FALSE; + } + /** + * Define quais campos da tabela serão selecionados no método Lista(). + */ + function setCamposLista($str_campos) + { + $this->_campos_lista = $str_campos; + } + /** + * Define que o método Lista() deverpa retornar todos os campos da tabela. + */ + function resetCamposLista() + { + $this->_campos_lista = $this->_todos_campos; + } + /** + * Define limites de retorno para o método Lista(). + */ + function setLimite($intLimiteQtd, $intLimiteOffset = NULL) + { + $this->_limite_quantidade = $intLimiteQtd; + $this->_limite_offset = $intLimiteOffset; + } + /** + * Retorna a string com o trecho da query responsável pelo limite de + * registros retornados/afetados. + * + * @return string + */ + function getLimite() + { + if (is_numeric($this->_limite_quantidade)) { + $retorno = " LIMIT {$this->_limite_quantidade}"; + if (is_numeric($this->_limite_offset)) { + $retorno .= " OFFSET {$this->_limite_offset} "; + } + return $retorno; + } + return ''; + } + /** + * Define o campo para ser utilizado como ordenação no método Lista(). + */ + function setOrderby($strNomeCampo) + { + if (is_string($strNomeCampo) && $strNomeCampo ) { + $this->_campo_order_by = $strNomeCampo; + } + } + /** + * Retorna a string com o trecho da query responsável pela Ordenação dos + * registros. + * + * @return string + */ + function getOrderby() + { + if (is_string($this->_campo_order_by)) { + return " ORDER BY {$this->_campo_order_by} "; + } + return ''; + } +} \ No newline at end of file diff --git a/ieducar/intranet/include/modules/clsModulesMoradiaAluno.inc.php b/ieducar/intranet/include/modules/clsModulesMoradiaAluno.inc.php new file mode 100644 index 0000000..02f3f60 --- /dev/null +++ b/ieducar/intranet/include/modules/clsModulesMoradiaAluno.inc.php @@ -0,0 +1,796 @@ + + * + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) + * qualquer versão posterior. + * + * Este programa é distribuí­do na expectativa de que seja útil, porém, SEM + * NENHUMA GARANTIA; nem mesmo a garantia implí­cita de COMERCIABILIDADE OU + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral + * do GNU para mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto + * com este programa; se não, escreva para a Free Software Foundation, Inc., no + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. + * + * @author Lucas Schmoeller da Silva + * @category i-Educar + * @license @@license@@ + * @package Module + * @since 07/2013 + * @version $Id$ + */ + +require_once 'include/pmieducar/geral.inc.php'; + +/** + * clsModulesMoradiaAluno class. + * + * @author Lucas Schmoeller da Silva + * @category i-Educar + * @license @@license@@ + * @package Module + * @since 07/2013 + * @version @@package_version@@ + */ +class clsModulesMoradiaAluno +{ + var $ref_cod_aluno; + var $moradia; + var $material; + var $casa_outra; + var $moradia_situacao; + var $quartos; + var $sala; + var $copa; + var $banheiro; + var $garagem; + var $empregada_domestica; + var $automovel; + var $motocicleta; + var $computador; + var $geladeira; + var $fogao; + var $maquina_lavar; + var $microondas; + var $video_dvd; + var $televisao; + var $celular; + var $telefone; + var $quant_pessoas; + var $renda; + var $agua_encanada; + var $poco; + var $energia; + var $esgoto; + var $fossa; + var $lixo; + + /** + * Armazena o total de resultados obtidos na última chamada ao método lista(). + * @var int + */ + var $_total; + + /** + * Nome do schema. + * @var string + */ + var $_schema; + + /** + * Nome da tabela. + * @var string + */ + var $_tabela; + + /** + * Lista separada por vírgula, com os campos que devem ser selecionados na + * próxima chamado ao método lista(). + * @var string + */ + var $_campos_lista; + + /** + * Lista com todos os campos da tabela separados por vírgula, padrão para + * seleção no método lista. + * @var string + */ + var $_todos_campos; + + /** + * Valor que define a quantidade de registros a ser retornada pelo método lista(). + * @var int + */ + var $_limite_quantidade; + + /** + * Define o valor de offset no retorno dos registros no método lista(). + * @var int + */ + var $_limite_offset; + + /** + * Define o campo para ser usado como padrão de ordenação no método lista(). + * @var string + */ + var $_campo_order_by; + + /** + * Construtor. + */ + function clsModulesMoradiaAluno($ref_cod_aluno = NULL, + $moradia = NULL, $material = NULL, + $casa_outra = NULL, $moradia_situacao = NULL, + $quartos = NULL, $sala = NULL, + $copa = NULL, $banheiro = NULL, + $garagem = NULL, $empregada_domestica = NULL, + $automovel = NULL, $motocicleta = NULL, + $computador = NULL, $geladeira = NULL, + $fogao = NULL, $maquina_lavar = NULL, $microondas = NULL, $video_dvd = NULL, + $televisao = NULL, $celular = NULL, $telefone = NULL, $quant_pessoas = NULL, $renda = NULL, $agua_encanada = NULL, $poco = NULL, + $energia = NULL, $esgoto = NULL, $fossa = NULL, $lixo = NULL) { + + $db = new clsBanco(); + $this->_schema = "modules."; + $this->_tabela = "{$this->_schema}moradia_aluno"; + + $this->_campos_lista = $this->_todos_campos = "ref_cod_aluno, + moradia, material, casa_outra, moradia_situacao, + quartos, sala, copa, banheiro, garagem, empregada_domestica, + automovel, motocicleta, computador, geladeira, fogao, maquina_lavar, microondas, video_dvd,televisao, celular, telefone, quant_pessoas, renda, agua_encanada, poco, energia, esgoto, fossa, lixo"; + + if (is_numeric($ref_cod_aluno)) { + $this->ref_cod_aluno = $ref_cod_aluno; + } + + if (is_string($moradia)) { + $this->moradia = $moradia; + } + + if (is_string($material)) { + $this->material = $material; + } + + if (is_string($casa_outra)) { + $this->casa_outra = $casa_outra; + } + + if (is_numeric($moradia_situacao)) { + $this->moradia_situacao = $moradia_situacao; + } + + if (is_numeric($quartos)) { + $this->quartos = $quartos; + } + + if (is_numeric($sala)) { + $this->sala = $sala; + } + + if (is_numeric($copa)) { + $this->copa = $copa; + } + + if (is_numeric($banheiro)) { + $this->banheiro = $banheiro; + } + + + if (is_numeric($garagem)) { + $this->garagem = $garagem; + } + + if (is_string($empregada_domestica)) { + $this->empregada_domestica = $empregada_domestica; + } + + if (is_string($motocicleta)) { + $this->motocicleta = $motocicleta; + } + + if (is_string($computador)) { + $this->computador = $computador; + } + + if (is_string($geladeira)) { + $this->geladeira = $geladeira; + } + + if (is_string($fogao)) { + $this->fogao = $fogao; + } + + if (is_string($maquina_lavar)) { + $this->maquina_lavar = $maquina_lavar; + } + + if (is_string($microondas)) { + $this->microondas = $microondas; + } + + if (is_string($video_dvd)) { + $this->video_dvd = $video_dvd; + } + + if (is_string($televisao)) { + $this->televisao = $televisao; + } + + if (is_string($celular)) { + $this->celular = $celular; + } + + if (is_string($telefone)) { + $this->telefone = $telefone; + } + + if (is_string($quant_pessoas)) { + $this->quant_pessoas = $quant_pessoas; + } + + if (is_numeric($renda)) { + $this->renda = $renda; + } + + if (is_numeric($agua_encanada)) { + $this->agua_encanada = $agua_encanada; + } + + if (is_string($poco)) { + $this->poco = $poco; + } + + if (is_string($energia)) { + $this->energia = $energia; + } + + if (is_string($esgoto)) { + $this->esgoto = $esgoto; + } + + if (is_string($fossa)) { + $this->fossa = $fossa; + } + + if (is_string($lixo)) { + $this->lixo = $lixo; + } + + + } + + /** + * Cria um novo registro. + * @return bool + */ + function cadastra() + { + + + if (is_numeric($this->ref_cod_aluno)) + { + + $db = new clsBanco(); + + $campos = ''; + $valores = ''; + $gruda = ''; + + + if (is_numeric($this->ref_cod_aluno)) { + $campos .= "{$gruda}ref_cod_aluno"; + $valores .= "{$gruda}'{$this->ref_cod_aluno}'"; + $gruda = ", "; + } + + if (is_string($this->moradia)) { + $campos .= "{$gruda}moradia"; + $valores .= "{$gruda}'{$this->moradia}'"; + $gruda = ", "; + } + + if (is_string($this->material)) { + $campos .= "{$gruda}material"; + $valores .= "{$gruda}'{$this->material}'"; + $gruda = ", "; + } + + if (is_string($this->casa_outra)) { + $campos .= "{$gruda}casa_outra"; + $valores .= "{$gruda}'{$this->casa_outra}'"; + $gruda = ", "; + } + + if (is_numeric($this->moradia_situacao)) { + $campos .= "{$gruda}moradia_situacao"; + $valores .= "{$gruda}'{$this->moradia_situacao}'"; + $gruda = ", "; + } + + if (is_numeric($this->quartos)) { + $campos .= "{$gruda}quartos"; + $valores .= "{$gruda}'{$this->quartos}'"; + $gruda = ", "; + } + + if (is_numeric($this->sala)) { + $campos .= "{$gruda}sala"; + $valores .= "{$gruda}'{$this->sala}'"; + $gruda = ", "; + } + + if (is_numeric($this->copa)) { + $campos .= "{$gruda}copa"; + $valores .= "{$gruda}'{$this->copa}'"; + $gruda = ", "; + } + + if (is_numeric($this->banheiro)) { + $campos .= "{$gruda}banheiro"; + $valores .= "{$gruda}'{$this->banheiro}'"; + $gruda = ", "; + } + + if (is_numeric($this->garagem)) { + $campos .= "{$gruda}garagem"; + $valores .= "{$gruda}'{$this->garagem}'"; + $gruda = ", "; + } + + + if (is_string($this->empregada_domestica)) { + $campos .= "{$gruda}empregada_domestica"; + $valores .= "{$gruda}'{$this->empregada_domestica}'"; + $gruda = ", "; + } + + if (is_string($this->automovel)) { + $campos .= "{$gruda}automovel"; + $valores .= "{$gruda}'{$this->automovel}'"; + $gruda = ", "; + } + + if (is_string($this->motocicleta)) { + $campos .= "{$gruda}motocicleta"; + $valores .= "{$gruda}'{$this->motocicleta}'"; + $gruda = ", "; + } + + if (is_string($this->geladeira)) { + $campos .= "{$gruda}geladeira"; + $valores .= "{$gruda}'{$this->geladeira}'"; + $gruda = ", "; + } + + if (is_string($this->fogao)) { + $campos .= "{$gruda}fogao"; + $valores .= "{$gruda}'{$this->fogao}'"; + $gruda = ", "; + } + + if (is_string($this->maquina_lavar)) { + $campos .= "{$gruda}maquina_lavar"; + $valores .= "{$gruda}'{$this->maquina_lavar}'"; + $gruda = ", "; + } + + if (is_string($this->microondas)) { + $campos .= "{$gruda}microondas"; + $valores .= "{$gruda}'{$this->microondas}'"; + $gruda = ", "; + } + + if (is_string($this->video_dvd)) { + $campos .= "{$gruda}video_dvd"; + $valores .= "{$gruda}'{$this->video_dvd}'"; + $gruda = ", "; + } + + if (is_string($this->televisao)) { + $campos .= "{$gruda}televisao"; + $valores .= "{$gruda}'{$this->televisao}'"; + $gruda = ", "; + } + + if (is_string($this->celular)) { + $campos .= "{$gruda}celular"; + $valores .= "{$gruda}'{$this->celular}'"; + $gruda = ", "; + } + + if (is_string($this->telefone)) { + $campos .= "{$gruda}telefone"; + $valores .= "{$gruda}'{$this->telefone}'"; + $gruda = ", "; + } + + if (is_numeric($this->quant_pessoas)) { + $campos .= "{$gruda}quant_pessoas"; + $valores .= "{$gruda}'{$this->quant_pessoas}'"; + $gruda = ", "; + } + + if (is_numeric($this->renda)) { + $campos .= "{$gruda}renda"; + $valores .= "{$gruda}'{$this->renda}'"; + $gruda = ", "; + } + + if (is_string($this->agua_encanada)) { + $campos .= "{$gruda}agua_encanada"; + $valores .= "{$gruda}'{$this->agua_encanada}'"; + $gruda = ", "; + } + + if (is_string($this->poco)) { + $campos .= "{$gruda}poco"; + $valores .= "{$gruda}'{$this->poco}'"; + $gruda = ", "; + } + + if (is_string($this->energia)) { + $campos .= "{$gruda}energia"; + $valores .= "{$gruda}'{$this->energia}'"; + $gruda = ", "; + } + + if (is_string($this->esgoto)) { + $campos .= "{$gruda}esgoto"; + $valores .= "{$gruda}'{$this->esgoto}'"; + $gruda = ", "; + } + + if (is_string($this->fossa)) { + $campos .= "{$gruda}fossa"; + $valores .= "{$gruda}'{$this->fossa}'"; + $gruda = ", "; + } + + if (is_string($this->lixo)) { + $campos .= "{$gruda}lixo"; + $valores .= "{$gruda}'{$this->lixo}'"; + $gruda = ", "; + } + + $db->Consulta("INSERT INTO {$this->_tabela} ( $campos ) VALUES( $valores )"); + return $this->ref_cod_aluno; + } + + return FALSE; + } + + /** + * Edita os dados de um registro. + * @return bool + */ + function edita() + { + + if (is_numeric($this->ref_cod_aluno)) { + $db = new clsBanco(); + $set = ''; + + if (is_numeric($this->ref_cod_aluno)) { + $set .= "{$gruda}ref_cod_aluno = '{$this->ref_cod_aluno}'"; + $gruda = ", "; + } + + if (is_string($this->moradia)) { + $set .= "{$gruda}moradia = '{$this->moradia}'"; + $gruda = ", "; + } + + if (is_string($this->material)) { + $set .= "{$gruda}material = '{$this->material}'"; + $gruda = ", "; + } + + if (is_string($this->casa_outra)) { + $set .= "{$gruda}casa_outra = '{$this->casa_outra}'"; + $gruda = ", "; + } + + if (is_numeric($this->moradia_situacao)) { + $set .= "{$gruda}moradia_situacao = '{$this->moradia_situacao}'"; + $gruda = ", "; + } + + if (is_numeric($this->quartos)) { + $set .= "{$gruda}quartos = '{$this->quartos}'"; + $gruda = ", "; + } + + if (is_numeric($this->sala)) { + $set .= "{$gruda}sala = '{$this->sala}'"; + $gruda = ", "; + } + + if (is_numeric($this->copa)) { + $set .= "{$gruda}copa = '{$this->copa}'"; + $gruda = ", "; + } + + if (is_numeric($this->banheiro)) { + $set .= "{$gruda}banheiro = '{$this->banheiro}'"; + $gruda = ", "; + } + + if (is_numeric($this->garagem)) { + $set .= "{$gruda}garagem = '{$this->garagem}'"; + $gruda = ", "; + } + + if (is_string($this->empregada_domestica)) { + $set .= "{$gruda}empregada_domestica = '{$this->empregada_domestica}'"; + $gruda = ", "; + } + + if (is_string($this->automovel)) { + $set .= "{$gruda}automovel = '{$this->automovel}'"; + $gruda = ", "; + } + + if (is_string($this->motocicleta)) { + $set .= "{$gruda}motocicleta = '{$this->motocicleta}'"; + $gruda = ", "; + } + + if (is_string($this->computador)) { + $set .= "{$gruda}computador = '{$this->computador}'"; + $gruda = ", "; + } + + if (is_string($this->geladeira)) { + $set .= "{$gruda}geladeira = '{$this->geladeira}'"; + $gruda = ", "; + } + + + if (is_string($this->fogao)) { + $set .= "{$gruda}fogao = '{$this->fogao}'"; + $gruda = ", "; + } + + if (is_string($this->maquina_lavar)) { + $set .= "{$gruda}maquina_lavar = '{$this->maquina_lavar}'"; + $gruda = ", "; + } + + if (is_string($this->microondas)) { + $set .= "{$gruda}microondas = '{$this->microondas}'"; + $gruda = ", "; + } + + if (is_string($this->video_dvd)) { + $set .= "{$gruda}video_dvd = '{$this->video_dvd}'"; + $gruda = ", "; + } + + if (is_string($this->televisao)) { + $set .= "{$gruda}televisao = '{$this->televisao}'"; + $gruda = ", "; + } + + if (is_string($this->celular)) { + $set .= "{$gruda}celular = '{$this->celular}'"; + $gruda = ", "; + } + + if (is_string($this->telefone)) { + $set .= "{$gruda}telefone = '{$this->telefone}'"; + $gruda = ", "; + } + + if (is_numeric($this->quant_pessoas)) { + $set .= "{$gruda}quant_pessoas = '{$this->quant_pessoas}'"; + $gruda = ", "; + } + + if (is_numeric($this->renda)) { + $set .= "{$gruda}renda = '{$this->renda}'"; + $gruda = ", "; + } + + if (is_string($this->agua_encanada)) { + $set .= "{$gruda}agua_encanada = '{$this->agua_encanada}'"; + $gruda = ", "; + } + + if (is_string($this->poco)) { + $set .= "{$gruda}poco = '{$this->poco}'"; + $gruda = ", "; + } + + if (is_string($this->energia)) { + $set .= "{$gruda}energia = '{$this->energia}'"; + $gruda = ", "; + } + + if (is_string($this->esgoto)) { + $set .= "{$gruda}esgoto = '{$this->esgoto}'"; + $gruda = ", "; + } + + if (is_string($this->fossa)) { + $set .= "{$gruda}fossa = '{$this->fossa}'"; + $gruda = ", "; + } + + if (is_string($this->lixo)) { + $set .= "{$gruda}lixo = '{$this->lixo}'"; + $gruda = ", "; + } + + + if ($set) { + $db->Consulta("UPDATE {$this->_tabela} SET $set WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); + return TRUE; + } + } + + return FALSE; + } + + /** + * Retorna uma lista de registros filtrados de acordo com os parâmetros. + * @return array + */ + function lista() + { + $sql = "SELECT {$this->_campos_lista} FROM {$this->_tabela}"; + $filtros = ""; + $whereAnd = " WHERE "; + + $db = new clsBanco(); + $countCampos = count(explode(',', $this->_campos_lista))+2; + $resultado = array(); + + $sql .= $filtros.$whereNomes.$this->getOrderby() . $this->getLimite(); + + $this->_total = $db->CampoUnico("SELECT COUNT(0) FROM {$this->_tabela} {$filtros}"); + + $db->Consulta($sql); + + if ($countCampos > 1) { + while ($db->ProximoRegistro()) { + $tupla = $db->Tupla(); + $tupla["_total"] = $this->_total; + $resultado[] = $tupla; + } + } + else { + while ($db->ProximoRegistro()) { + $tupla = $db->Tupla(); + $resultado[] = $tupla[$this->_campos_lista]; + } + } + if (count($resultado)) { + return $resultado; + } + + return FALSE; + } + + /** + * Retorna um array com os dados de um registro. + * @return array + */ + function detalhe() + { + if (is_numeric($this->ref_cod_aluno)) { + $db = new clsBanco(); + $db->Consulta("SELECT {$this->_todos_campos} FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); + $db->ProximoRegistro(); + return $db->Tupla(); + } + + return FALSE; + } + + /** + * Retorna um array com os dados de um registro. + * @return array + */ + function existe() + { + if (is_numeric($this->ref_cod_aluno)) { + $db = new clsBanco(); + $db->Consulta("SELECT 1 FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); + $db->ProximoRegistro(); + return $db->Tupla(); + } + + return FALSE; + } + + /** + * Exclui um registro. + * @return bool + */ + function excluir() + { + if (is_numeric($this->ref_cod_aluno)) { + $sql = "DELETE FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"; + $db = new clsBanco(); + $db->Consulta($sql); + return true; + } + + return FALSE; + } + + /** + * Define quais campos da tabela serão selecionados no método Lista(). + */ + function setCamposLista($str_campos) + { + $this->_campos_lista = $str_campos; + } + + /** + * Define que o método Lista() deverpa retornar todos os campos da tabela. + */ + function resetCamposLista() + { + $this->_campos_lista = $this->_todos_campos; + } + + /** + * Define limites de retorno para o método Lista(). + */ + function setLimite($intLimiteQtd, $intLimiteOffset = NULL) + { + $this->_limite_quantidade = $intLimiteQtd; + $this->_limite_offset = $intLimiteOffset; + } + + /** + * Retorna a string com o trecho da query responsável pelo limite de + * registros retornados/afetados. + * + * @return string + */ + function getLimite() + { + if (is_numeric($this->_limite_quantidade)) { + $retorno = " LIMIT {$this->_limite_quantidade}"; + if (is_numeric($this->_limite_offset)) { + $retorno .= " OFFSET {$this->_limite_offset} "; + } + return $retorno; + } + return ''; + } + + /** + * Define o campo para ser utilizado como ordenação no método Lista(). + */ + function setOrderby($strNomeCampo) + { + if (is_string($strNomeCampo) && $strNomeCampo ) { + $this->_campo_order_by = $strNomeCampo; + } + } + + /** + * Retorna a string com o trecho da query responsável pela Ordenação dos + * registros. + * + * @return string + */ + function getOrderby() + { + if (is_string($this->_campo_order_by)) { + return " ORDER BY {$this->_campo_order_by} "; + } + return ''; + } +} \ No newline at end of file diff --git a/ieducar/intranet/include/modules/clsModulesUniformeAluno.inc.php b/ieducar/intranet/include/modules/clsModulesUniformeAluno.inc.php new file mode 100644 index 0000000..e6c26e5 --- /dev/null +++ b/ieducar/intranet/include/modules/clsModulesUniformeAluno.inc.php @@ -0,0 +1,527 @@ + + * + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) + * qualquer versão posterior. + * + * Este programa é distribuí­do na expectativa de que seja útil, porém, SEM + * NENHUMA GARANTIA; nem mesmo a garantia implí­cita de COMERCIABILIDADE OU + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral + * do GNU para mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto + * com este programa; se não, escreva para a Free Software Foundation, Inc., no + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. + * + * @author Lucas Schmoeller da Silva + * @category i-Educar + * @license @@license@@ + * @package Module + * @since 09/2013 + * @version $Id$ + */ + +require_once 'include/pmieducar/geral.inc.php'; + +/** + * clsModulesUniformeAluno class. + * + * @author Lucas Schmoeller da Silva + * @category i-Educar + * @license @@license@@ + * @package Module + * @since 09/2013 + * @version @@package_version@@ + */ +class clsModulesUniformeAluno +{ + var $ref_cod_aluno; + var $recebeu_uniforme; + var $quantidade_camiseta; + var $tamanho_camiseta; + var $quantidade_blusa_jaqueta; + var $tamanho_blusa_jaqueta; + var $quantidade_bermuda; + var $tamanho_bermuda; + var $quantidade_calca; + var $tamanho_calca; + var $quantidade_saia; + var $tamanho_saia; + var $quantidade_calcado; + var $tamanho_calcado; + var $quantidade_meia; + var $tamanho_meia; + + /** + * @var int + * Armazena o total de resultados obtidos na última chamada ao método lista(). + */ + var $_total; + + /** + * Nome do schema. + * @var string + */ + var $_schema; + + /** + * Nome da tabela. + * @var string + */ + var $_tabela; + + /** + * Lista separada por vírgula, com os campos que devem ser selecionados na + * próxima chamado ao método lista(). + * @var string + */ + var $_campos_lista; + + /** + * Lista com todos os campos da tabela separados por vírgula, padrão para + * seleção no método lista. + * @var string + */ + var $_todos_campos; + + /** + * Valor que define a quantidade de registros a ser retornada pelo método lista(). + * @var int + */ + var $_limite_quantidade; + + /** + * Define o valor de offset no retorno dos registros no método lista(). + * @var int + */ + var $_limite_offset; + + /** + * Define o campo para ser usado como padrão de ordenação no método lista(). + * @var string + */ + var $_campo_order_by; + + /** + * Construtor. + */ + function clsModulesUniformeAluno( $ref_cod_aluno = NULL, $recebeu_uniforme = NULL, + $quantidade_camiseta = NULL, $tamanho_camiseta = NULL, $quantidade_blusa_jaqueta = NULL, + $tamanho_blusa_jaqueta = NULL, $quantidade_bermuda = NULL, $tamanho_bermuda = NULL, + $quantidade_calca = NULL, $tamanho_calca = NULL, $quantidade_saia = NULL, $tamanho_saia = NULL, + $quantidade_calcado = NULL, $tamanho_calcado = NULL, $quantidade_meia = NULL, $tamanho_meia = NULL) + { + $db = new clsBanco(); + $this->_schema = "modules."; + $this->_tabela = "{$this->_schema}uniforme_aluno"; + + $this->_campos_lista = $this->_todos_campos = " ref_cod_aluno, recebeu_uniforme, quantidade_camiseta, + tamanho_camiseta, quantidade_blusa_jaqueta, tamanho_blusa_jaqueta, quantidade_bermuda, tamanho_bermuda, + quantidade_calca, tamanho_calca, quantidade_saia, tamanho_saia, quantidade_calcado, tamanho_calcado, + quantidade_meia, tamanho_meia"; + + if (is_numeric($ref_cod_aluno)) { + $this->ref_cod_aluno = $ref_cod_aluno; + } + + if (is_string($recebeu_uniforme)) { + $this->recebeu_uniforme = $recebeu_uniforme; + } + + if (is_numeric($quantidade_camiseta)) { + $this->quantidade_camiseta = $quantidade_camiseta; + } + + if (is_string($tamanho_camiseta)) { + $this->tamanho_camiseta = $tamanho_camiseta; + } + + if (is_numeric($quantidade_blusa_jaqueta)) { + $this->quantidade_blusa_jaqueta = $quantidade_blusa_jaqueta; + } + + if (is_string($tamanho_blusa_jaqueta)) { + $this->tamanho_blusa_jaqueta = $tamanho_blusa_jaqueta; + } + + if (is_numeric($quantidade_bermuda)) { + $this->quantidade_bermuda = $quantidade_bermuda; + } + + if (is_string($tamanho_bermuda)) { + $this->tamanho_bermuda = $tamanho_bermuda; + } + + if (is_numeric($quantidade_calca)) { + $this->quantidade_calca = $quantidade_calca; + } + + if (is_string($tamanho_calca)) { + $this->tamanho_calca = $tamanho_calca; + } + + if (is_numeric($quantidade_saia)) { + $this->quantidade_saia = $quantidade_saia; + } + + if (is_string($tamanho_saia)) { + $this->tamanho_saia = $tamanho_saia; + } + + if (is_numeric($quantidade_calcado)) { + $this->quantidade_calcado = $quantidade_calcado; + } + + if (is_string($tamanho_calcado)) { + $this->tamanho_calcado = $tamanho_calcado; + } + + if (is_numeric($quantidade_meia)) { + $this->quantidade_meia = $quantidade_meia; + } + + if (is_string($tamanho_meia)) { + $this->tamanho_meia = $tamanho_meia; + } + + + } + + /** + * Cria um novo registro. + * @return bool + */ + function cadastra() + { + if (is_numeric($this->ref_cod_aluno)) + { + $db = new clsBanco(); + + $campos = ''; + $valores = ''; + $gruda = ''; + + $campos .= "{$gruda}ref_cod_aluno"; + $valores .= "{$gruda}{$this->ref_cod_aluno}"; + $gruda = ", "; + + $campos .= "{$gruda}recebeu_uniforme"; + $valores .= "{$gruda}'{$this->recebeu_uniforme}'"; + $gruda = ", "; + + if(is_numeric($this->quantidade_camiseta)){ + $campos .= "{$gruda}quantidade_camiseta"; + $valores .= "{$gruda}{$this->quantidade_camiseta}"; + $gruda = ", "; + } + + $campos .= "{$gruda}tamanho_camiseta"; + $valores .= "{$gruda}'{$this->tamanho_camiseta}'"; + $gruda = ", "; + + if(is_numeric($this->quantidade_blusa_jaqueta)){ + $campos .= "{$gruda}quantidade_blusa_jaqueta"; + $valores .= "{$gruda}{$this->quantidade_blusa_jaqueta}"; + $gruda = ", "; + } + + $campos .= "{$gruda}tamanho_blusa_jaqueta"; + $valores .= "{$gruda}'{$this->tamanho_blusa_jaqueta}'"; + $gruda = ", "; + + if(is_numeric($this->quantidade_bermuda)){ + $campos .= "{$gruda}quantidade_bermuda"; + $valores .= "{$gruda}{$this->quantidade_bermuda}"; + $gruda = ", "; + } + + $campos .= "{$gruda}tamanho_bermuda"; + $valores .= "{$gruda}'{$this->tamanho_bermuda}'"; + $gruda = ", "; + + if(is_numeric($this->quantidade_calca)){ + $campos .= "{$gruda}quantidade_calca"; + $valores .= "{$gruda}{$this->quantidade_calca}"; + $gruda = ", "; + } + + $campos .= "{$gruda}tamanho_calca"; + $valores .= "{$gruda}'{$this->tamanho_calca}'"; + $gruda = ", "; + + if(is_numeric($this->quantidade_saia)){ + $campos .= "{$gruda}quantidade_saia"; + $valores .= "{$gruda}{$this->quantidade_saia}"; + $gruda = ", "; + } + + $campos .= "{$gruda}tamanho_saia"; + $valores .= "{$gruda}'{$this->tamanho_saia}'"; + $gruda = ", "; + + if(is_numeric($this->quantidade_calcado)){ + $campos .= "{$gruda}quantidade_calcado"; + $valores .= "{$gruda}{$this->quantidade_calcado}"; + $gruda = ", "; + } + + $campos .= "{$gruda}tamanho_calcado"; + $valores .= "{$gruda}'{$this->tamanho_calcado}'"; + $gruda = ", "; + + if(is_numeric($this->quantidade_meia)){ + $campos .= "{$gruda}quantidade_meia"; + $valores .= "{$gruda}{$this->quantidade_meia}"; + $gruda = ", "; + } + + $campos .= "{$gruda}tamanho_meia"; + $valores .= "{$gruda}'{$this->tamanho_meia}'"; + $gruda = ", "; + + $db->Consulta("INSERT INTO {$this->_tabela} ( $campos ) VALUES( $valores )"); + return $this->ref_cod_aluno; + } + + return FALSE; + } + + /** + * Edita os dados de um registro. + * @return bool + */ + function edita() + { + if (is_numeric($this->ref_cod_aluno)) { + $db = new clsBanco(); + $set = ''; + + $set .= "recebeu_uniforme = '{$this->recebeu_uniforme}'"; + + if (is_numeric($this->quantidade_camiseta)) + $set .= ",quantidade_camiseta = '{$this->quantidade_camiseta}'"; + else{ + $set .= ",quantidade_camiseta = NULL"; + } + + $set .= ",tamanho_camiseta = '{$this->tamanho_camiseta}'"; + + if (is_numeric($this->quantidade_blusa_jaqueta)) + $set .= ",quantidade_blusa_jaqueta = '{$this->quantidade_blusa_jaqueta}'"; + else{ + $set .= ",quantidade_blusa_jaqueta = NULL"; + } + + $set .= ",tamanho_blusa_jaqueta = '{$this->tamanho_blusa_jaqueta}'"; + + if (is_numeric($this->quantidade_bermuda)) + $set .= ",quantidade_bermuda = '{$this->quantidade_bermuda}'"; + else{ + $set .= ",quantidade_bermuda = NULL"; + } + + $set .= ",tamanho_bermuda = '{$this->tamanho_bermuda}'"; + + if (is_numeric($this->quantidade_calca)) + $set .= ",quantidade_calca = '{$this->quantidade_calca}'"; + else{ + $set .= ",quantidade_calca = NULL"; + } + + $set .= ",tamanho_calca = '{$this->tamanho_calca}'"; + + if (is_numeric($this->quantidade_saia)) + $set .= ",quantidade_saia = '{$this->quantidade_saia}'"; + else{ + $set .= ",quantidade_saia = NULL"; + } + + $set .= ",tamanho_saia = '{$this->tamanho_saia}'"; + + if (is_numeric($this->quantidade_calcado)) + $set .= ",quantidade_calcado = '{$this->quantidade_calcado}'"; + else{ + $set .= ",quantidade_calcado = NULL"; + } + + $set .= ",tamanho_calcado = '{$this->tamanho_calcado}'"; + + if (is_numeric($this->quantidade_meia)) + $set .= ",quantidade_meia = '{$this->quantidade_meia}'"; + else{ + $set .= ",quantidade_meia = NULL"; + } + + $set .= ",tamanho_meia = '{$this->tamanho_meia}'"; + + if ($set) { + $db->Consulta("UPDATE {$this->_tabela} SET $set WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); + return TRUE; + } + } + + return FALSE; + } + + /** + * Retorna uma lista de registros filtrados de acordo com os parâmetros. + * @return array + */ + function lista() + { + $sql = "SELECT {$this->_campos_lista} FROM {$this->_tabela}"; + $filtros = ""; + // implementar + + $db = new clsBanco(); + $countCampos = count(explode(',', $this->_campos_lista))+2; + $resultado = array(); + + $sql .= $filtros . $this->getOrderby() . $this->getLimite(); + + $this->_total = $db->CampoUnico("SELECT COUNT(0) FROM {$this->_tabela} {$filtros}"); + + $db->Consulta($sql); + + if ($countCampos > 1) { + while ($db->ProximoRegistro()) { + $tupla = $db->Tupla(); + $tupla["_total"] = $this->_total; + $resultado[] = $tupla; + } + } + else { + while ($db->ProximoRegistro()) { + $tupla = $db->Tupla(); + $resultado[] = $tupla[$this->_campos_lista]; + } + } + if (count($resultado)) { + return $resultado; + } + + return FALSE; + } + + /** + * Retorna um array com os dados de um registro. + * @return array + */ + function detalhe() + { + if (is_numeric($this->ref_cod_aluno)) { + $db = new clsBanco(); + $db->Consulta("SELECT {$this->_todos_campos} FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); + $db->ProximoRegistro(); + return $db->Tupla(); + } + + return FALSE; + } + + /** + * Retorna um array com os dados de um registro. + * @return array + */ + function existe() + { + if (is_numeric($this->ref_cod_aluno)) { + $db = new clsBanco(); + $db->Consulta("SELECT 1 FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); + $db->ProximoRegistro(); + return $db->Tupla(); + } + + return FALSE; + } + + /** + * Exclui um registro. + * @return bool + */ + function excluir() + { + if (is_numeric($this->ref_cod_aluno)) { + $sql = "DELETE FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"; + $db = new clsBanco(); + $db->Consulta($sql); + return true; + } + + return FALSE; + } + + /** + * Define quais campos da tabela serão selecionados no método Lista(). + */ + function setCamposLista($str_campos) + { + $this->_campos_lista = $str_campos; + } + + /** + * Define que o método Lista() deverpa retornar todos os campos da tabela. + */ + function resetCamposLista() + { + $this->_campos_lista = $this->_todos_campos; + } + + /** + * Define limites de retorno para o método Lista(). + */ + function setLimite($intLimiteQtd, $intLimiteOffset = NULL) + { + $this->_limite_quantidade = $intLimiteQtd; + $this->_limite_offset = $intLimiteOffset; + } + + /** + * Retorna a string com o trecho da query responsável pelo limite de + * registros retornados/afetados. + * + * @return string + */ + function getLimite() + { + if (is_numeric($this->_limite_quantidade)) { + $retorno = " LIMIT {$this->_limite_quantidade}"; + if (is_numeric($this->_limite_offset)) { + $retorno .= " OFFSET {$this->_limite_offset} "; + } + return $retorno; + } + return ''; + } + + /** + * Define o campo para ser utilizado como ordenação no método Lista(). + */ + function setOrderby($strNomeCampo) + { + if (is_string($strNomeCampo) && $strNomeCampo ) { + $this->_campo_order_by = $strNomeCampo; + } + } + + /** + * Retorna a string com o trecho da query responsável pela Ordenação dos + * registros. + * + * @return string + */ + function getOrderby() + { + if (is_string($this->_campo_order_by)) { + return " ORDER BY {$this->_campo_order_by} "; + } + return ''; + } +} \ No newline at end of file diff --git a/ieducar/misc/database/deltas/portabilis/61_cria_ficha_medica_aluno.sql b/ieducar/misc/database/deltas/portabilis/61_cria_ficha_medica_aluno.sql new file mode 100644 index 0000000..6993c5a --- /dev/null +++ b/ieducar/misc/database/deltas/portabilis/61_cria_ficha_medica_aluno.sql @@ -0,0 +1,71 @@ +-- // + + -- + -- Cria tabela e seq para ficha médica do aluno + -- + -- @author Lucas Schmoeller da Silva + -- @license @@license@@ + -- @version ? + + CREATE TABLE modules.ficha_medica_aluno + ( + ref_cod_aluno integer NOT NULL, + altura character(4), + peso character(7), + grupo_sanguineo character(2), + fator_rh character(1), + alergia_medicamento character(1), + desc_alergia_medicamento character varying(100), + alergia_alimento character(1), + desc_alergia_alimento character varying(100), + doenca_congenita character(1), + desc_doenca_congenita character varying(100), + fumante character(1), + doenca_caxumba character(1), + doenca_sarampo character(1), + doenca_rubeola character(1), + doenca_catapora character(1), + doenca_escarlatina character(1), + doenca_coqueluche character(1), + doenca_outras character varying(100), + epiletico character(1), + epiletico_tratamento character(1), + hemofilico character(1), + hipertenso character(1), + asmatico character(1), + diabetico character(1), + insulina character(1), + tratamento_medico character(1), + desc_tratamento_medico character varying(100), + medicacao_especifica character(1), + desc_medicacao_especifica character varying(100), + acomp_medico_psicologico character(1), + desc_acomp_medico_psicologico character varying(100), + restricao_atividade_fisica character(1), + desc_restricao_atividade_fisica character varying(100), + fratura_trauma character(1), + desc_fratura_trauma character varying(100), + plano_saude character(1), + desc_plano_saude character varying(50), + hospital_clinica character varying(100), + hospital_clinica_endereco character varying(50), + hospital_clinica_telefone character varying(20), + responsavel character varying(50), + responsavel_parentesco character varying(20), + responsavel_parentesco_telefone character varying(20), + responsavel_parentesco_celular character varying(20), + observacao character varying(255), + CONSTRAINT ficha_medica_cod_aluno_pkey PRIMARY KEY (ref_cod_aluno) + CONSTRAINT ficha_medica_aluno_fkey FOREIGN KEY (ref_cod_aluno) + REFERENCES pmieducar.aluno(cod_aluno) MATCH SIMPLE + ON UPDATE RESTRICT ON DELETE RESTRICT + ) + WITH ( + OIDS=TRUE + ); + + -- //@UNDO + + DROP TABLE modules.ficha_medica_aluno + + -- // \ No newline at end of file diff --git a/ieducar/misc/database/deltas/portabilis/62_cria_uniforme_escolar.sql b/ieducar/misc/database/deltas/portabilis/62_cria_uniforme_escolar.sql new file mode 100644 index 0000000..c9da3c2 --- /dev/null +++ b/ieducar/misc/database/deltas/portabilis/62_cria_uniforme_escolar.sql @@ -0,0 +1,41 @@ + -- // + + -- + -- Cria tabela para uniforme escolar do aluno + -- + -- @author Lucas Schmoeller da Silva + -- @license @@license@@ + -- @version ? + + CREATE TABLE modules.uniforme_aluno + ( + ref_cod_aluno integer NOT NULL, + recebeu_uniforme character(1), + quantidade_camiseta integer, + tamanho_camiseta character(2), + quantidade_blusa_jaqueta integer, + tamanho_blusa_jaqueta character(2), + quantidade_bermuda integer, + tamanho_bermuda character(2), + quantidade_calca integer, + tamanho_calca character(2), + quantidade_saia integer, + tamanho_saia character(2), + quantidade_calcado integer, + tamanho_calcado character(2), + quantidade_meia integer, + tamanho_meia character(2), + CONSTRAINT uniforme_aluno_pkey PRIMARY KEY (ref_cod_aluno), + CONSTRAINT uniforme_aluno_fkey FOREIGN KEY (ref_cod_aluno) + REFERENCES pmieducar.aluno(cod_aluno) MATCH SIMPLE + ON UPDATE RESTRICT ON DELETE RESTRICT + ) + WITH ( + OIDS=TRUE + ); + + -- //@UNDO + + DROP TABLE modules.uniforme_aluno + + -- // \ No newline at end of file diff --git a/ieducar/misc/database/deltas/portabilis/63_cria_tabela_moradia_aluno.sql b/ieducar/misc/database/deltas/portabilis/63_cria_tabela_moradia_aluno.sql new file mode 100644 index 0000000..8d2f467 --- /dev/null +++ b/ieducar/misc/database/deltas/portabilis/63_cria_tabela_moradia_aluno.sql @@ -0,0 +1,55 @@ +-- // + + -- + -- Cria tabela moradia_aluno com dados sobre a moradia de um aluno + -- + -- @author Lucas Schmoeller da Silva + -- @license @@license@@ + -- @version $Id$ + + CREATE TABLE modules.moradia_aluno + ( + ref_cod_aluno integer NOT NULL, + moradia character(1), + material character(1) DEFAULT ('A'), + casa_outra character varying(20), + moradia_situacao integer, + quartos integer, + sala integer, + copa integer, + banheiro integer, + garagem integer, + empregada_domestica character(1), + automovel character(1), + motocicleta character(1), + computador character(1), + geladeira character(1), + fogao character(1), + maquina_lavar character(1), + microondas character(1), + video_dvd character(1), + televisao character(1), + celular character(1), + telefone character(1), + quant_pessoas integer, + renda double precision, + agua_encanada character(1), + poco character(1), + energia character(1), + esgoto character(1), + fossa character(1), + lixo character(1), + CONSTRAINT moradia_aluno_pkei PRIMARY KEY (ref_cod_aluno), + CONSTRAINT moradia_aluno_fkey FOREIGN KEY (ref_cod_aluno) + REFERENCES pmieducar.aluno(cod_aluno) MATCH SIMPLE + ON UPDATE RESTRICT ON DELETE RESTRICT + ) + WITH ( + OIDS=TRUE + ); + + -- //@UNDO + + DROP TABLE modules.moradia_aluno; + + -- // \ No newline at end of file diff --git a/ieducar/modules/Api/Views/AlunoController.php b/ieducar/modules/Api/Views/AlunoController.php index 459a054..c997915 100644 --- a/ieducar/modules/Api/Views/AlunoController.php +++ b/ieducar/modules/Api/Views/AlunoController.php @@ -33,6 +33,9 @@ */ require_once 'include/pmieducar/clsPmieducarAluno.inc.php'; +require_once 'include/modules/clsModulesFichaMedicaAluno.inc.php'; +require_once 'include/modules/clsModulesUniformeAluno.inc.php'; +require_once 'include/modules/clsModulesMoradiaAluno.inc.php'; require_once 'App/Model/MatriculaSituacao.php'; @@ -267,6 +270,130 @@ class AlunoController extends ApiCoreController return $this->saveEntity($dataMapper, $entity); } + protected function createOrUpdateFichaMedica($id) { + + $obj = new clsModulesFichaMedicaAluno(); + + $obj->ref_cod_aluno = $id; + $obj->altura = Portabilis_String_Utils::toLatin1($this->getRequest()->altura); + $obj->peso = Portabilis_String_Utils::toLatin1($this->getRequest()->peso); + $obj->grupo_sanguineo = Portabilis_String_Utils::toLatin1($this->getRequest()->grupo_sanguineo); + $obj->fator_rh = Portabilis_String_Utils::toLatin1($this->getRequest()->fator_rh); + $obj->alergia_medicamento = ($this->getRequest()->alergia_medicamento == 'on' ? 'S' : 'N'); + $obj->desc_alergia_medicamento = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_alergia_medicamento); + $obj->alergia_alimento = ($this->getRequest()->alergia_alimento == 'on' ? 'S' : 'N'); + $obj->desc_alergia_alimento = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_alergia_alimento); + $obj->doenca_congenita = ($this->getRequest()->doenca_congenita == 'on' ? 'S' : 'N'); + $obj->desc_doenca_congenita = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_doenca_congenita); + $obj->fumante = ($this->getRequest()->fumante == 'on' ? 'S' : 'N'); + $obj->doenca_caxumba = ($this->getRequest()->doenca_caxumba == 'on' ? 'S' : 'N'); + $obj->doenca_sarampo = ($this->getRequest()->doenca_sarampo == 'on' ? 'S' : 'N'); + $obj->doenca_rubeola = ($this->getRequest()->doenca_rubeola == 'on' ? 'S' : 'N'); + $obj->doenca_catapora = ($this->getRequest()->doenca_catapora == 'on' ? 'S' : 'N'); + $obj->doenca_escarlatina = ($this->getRequest()->doenca_escarlatina == 'on' ? 'S' : 'N'); + $obj->doenca_coqueluche = ($this->getRequest()->doenca_coqueluche == 'on' ? 'S' : 'N'); + $obj->doenca_outras = Portabilis_String_Utils::toLatin1($this->getRequest()->doenca_outras); + $obj->epiletico = ($this->getRequest()->epiletico == 'on' ? 'S' : 'N'); + $obj->epiletico_tratamento = ($this->getRequest()->epiletico_tratamento == 'on' ? 'S' : 'N'); + $obj->hemofilico = ($this->getRequest()->hemofilico == 'on' ? 'S' : 'N'); + $obj->hipertenso = ($this->getRequest()->hipertenso == 'on' ? 'S' : 'N'); + $obj->asmatico = ($this->getRequest()->asmatico == 'on' ? 'S' : 'N'); + $obj->diabetico = ($this->getRequest()->diabetico == 'on' ? 'S' : 'N'); + $obj->insulina = ($this->getRequest()->insulina == 'on' ? 'S' : 'N'); + $obj->tratamento_medico = ($this->getRequest()->tratamento_medico == 'on' ? 'S' : 'N'); + $obj->desc_tratamento_medico = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_tratamento_medico); + $obj->medicacao_especifica = ($this->getRequest()->medicacao_especifica == 'on' ? 'S' : 'N'); + $obj->desc_medicacao_especifica = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_medicacao_especifica); + $obj->acomp_medico_psicologico = ($this->getRequest()->acomp_medico_psicologico == 'on' ? 'S' : 'N'); + $obj->desc_acomp_medico_psicologico = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_acomp_medico_psicologico); + $obj->acomp_medico_psicologico = ($this->getRequest()->acomp_medico_psicologico == 'on' ? 'S' : 'N'); + $obj->desc_acomp_medico_psicologico = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_acomp_medico_psicologico); + $obj->restricao_atividade_fisica = ($this->getRequest()->restricao_atividade_fisica == 'on' ? 'S' : 'N'); + $obj->desc_restricao_atividade_fisica = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_restricao_atividade_fisica); + $obj->fratura_trauma = ($this->getRequest()->fratura_trauma == 'on' ? 'S' : 'N'); + $obj->desc_fratura_trauma = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_fratura_trauma); + $obj->plano_saude = ($this->getRequest()->plano_saude == 'on' ? 'S' : 'N'); + $obj->desc_plano_saude = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_plano_saude); + $obj->hospital_clinica = Portabilis_String_Utils::toLatin1($this->getRequest()->hospital_clinica); + $obj->hospital_clinica_endereco = Portabilis_String_Utils::toLatin1($this->getRequest()->hospital_clinica_endereco); + $obj->hospital_clinica_telefone = Portabilis_String_Utils::toLatin1($this->getRequest()->hospital_clinica_telefone); + $obj->responsavel = Portabilis_String_Utils::toLatin1($this->getRequest()->responsavel); + $obj->responsavel_parentesco = Portabilis_String_Utils::toLatin1($this->getRequest()->responsavel_parentesco); + $obj->responsavel_parentesco_telefone = Portabilis_String_Utils::toLatin1($this->getRequest()->responsavel_parentesco_telefone); + $obj->responsavel_parentesco_celular = Portabilis_String_Utils::toLatin1($this->getRequest()->responsavel_parentesco_celular); + + return ($obj->existe() ? $obj->edita() : $obj->cadastra()); + } + +protected function createOrUpdateUniforme($id) { + + $obj = new clsModulesUniformeAluno(); + + $obj->ref_cod_aluno = $id; + $obj->recebeu_uniforme = ($this->getRequest()->recebeu_uniforme == 'on' ? 'S' : 'N'); + + $obj->quantidade_camiseta = $this->getRequest()->quantidade_camiseta; + $obj->tamanho_camiseta = Portabilis_String_Utils::toLatin1($this->getRequest()->tamanho_camiseta); + + $obj->quantidade_calca = $this->getRequest()->quantidade_calca; + $obj->tamanho_calca = Portabilis_String_Utils::toLatin1($this->getRequest()->tamanho_calca); + + $obj->quantidade_bermuda = $this->getRequest()->quantidade_bermuda; + $obj->tamanho_bermuda = Portabilis_String_Utils::toLatin1($this->getRequest()->tamanho_bermuda); + + $obj->quantidade_meia = $this->getRequest()->quantidade_meia; + $obj->tamanho_meia = Portabilis_String_Utils::toLatin1($this->getRequest()->tamanho_meia); + + $obj->quantidade_saia = $this->getRequest()->quantidade_saia; + $obj->tamanho_saia = Portabilis_String_Utils::toLatin1($this->getRequest()->tamanho_saia); + + $obj->quantidade_calcado = $this->getRequest()->quantidade_calcado; + $obj->tamanho_calcado = Portabilis_String_Utils::toLatin1($this->getRequest()->tamanho_calcado); + + $obj->quantidade_blusa_jaqueta = $this->getRequest()->quantidade_blusa_jaqueta; + $obj->tamanho_blusa_jaqueta = Portabilis_String_Utils::toLatin1($this->getRequest()->tamanho_blusa_jaqueta); + + return ($obj->existe() ? $obj->edita() : $obj->cadastra()); + } + + protected function createOrUpdateMoradia($id) { + + $obj = new clsModulesMoradiaAluno(); + + $obj->ref_cod_aluno = $id; + + $obj->moradia = $this->getRequest()->moradia; + $obj->material = $this->getRequest()->material; + $obj->casa_outra = Portabilis_String_Utils::toLatin1($this->getRequest()->casa_outra); + $obj->moradia_situacao = $this->getRequest()->moradia_situacao; + $obj->quartos = $this->getRequest()->quartos; + $obj->sala = $this->getRequest()->sala; + $obj->copa = $this->getRequest()->copa; + $obj->banheiro = $this->getRequest()->banheiro; + $obj->garagem = $this->getRequest()->garagem; + $obj->empregada_domestica = ($this->getRequest()->empregada_domestica == 'on' ? 'S' : 'N'); + $obj->automovel = ($this->getRequest()->automovel == 'on' ? 'S' : 'N'); + $obj->motocicleta = ($this->getRequest()->motocicleta == 'on' ? 'S' : 'N'); + $obj->computador = ($this->getRequest()->computador == 'on' ? 'S' : 'N'); + $obj->geladeira = ($this->getRequest()->geladeira == 'on' ? 'S' : 'N'); + $obj->fogao = ($this->getRequest()->fogao == 'on' ? 'S' : 'N'); + $obj->maquina_lavar = ($this->getRequest()->maquina_lavar == 'on' ? 'S' : 'N'); + $obj->microondas = ($this->getRequest()->microondas == 'on' ? 'S' : 'N'); + $obj->video_dvd = ($this->getRequest()->video_dvd == 'on' ? 'S' : 'N'); + $obj->televisao = ($this->getRequest()->televisao == 'on' ? 'S' : 'N'); + $obj->celular = ($this->getRequest()->celular == 'on' ? 'S' : 'N'); + $obj->telefone = ($this->getRequest()->telefone == 'on' ? 'S' : 'N'); + $obj->quant_pessoas = $this->getRequest()->quant_pessoas; + $obj->renda = floatval(preg_replace("/[^0-9\.]/", "", str_replace(",", ".", $this->getRequest()->renda))); + $obj->agua_encanada = ($this->getRequest()->agua_encanada == 'on' ? 'S' : 'N'); + $obj->poco = ($this->getRequest()->poco == 'on' ? 'S' : 'N'); + $obj->energia = ($this->getRequest()->energia == 'on' ? 'S' : 'N'); + $obj->esgoto = ($this->getRequest()->esgoto == 'on' ? 'S' : 'N'); + $obj->fossa = ($this->getRequest()->fossa == 'on' ? 'S' : 'N'); + $obj->lixo = ($this->getRequest()->lixo == 'on' ? 'S' : 'N'); + + return ($obj->existe() ? $obj->edita() : $obj->cadastra()); + } protected function loadAlunoInepId($alunoId) { $dataMapper = $this->getDataMapperFor('educacenso', 'aluno'); @@ -398,15 +525,29 @@ class AlunoController extends ApiCoreController } protected function loadTransferenciaDataEntrada($matriculaId) { + /* + $sql = "select to_char(data_transferencia, 'DD/MM/YYYY') from + pmieducar.transferencia_solicitacao where ref_cod_matricula_entrada = $1 and ativo = 1";*/ $sql = "select to_char(data_cadastro, 'DD/MM/YYYY') from pmieducar.matricula - where cod_matricula=$1 and ativo = 1"; + where cod_matricula=$1 and ativo = 1"; return Portabilis_Utils_Database::selectField($sql, $matriculaId); } + protected function loadNomeTurmaOrigem($matriculaId) { + $sql = "select nm_turma from pmieducar.matricula_turma mt + left join pmieducar.turma t on (t.cod_turma = mt.ref_cod_turma) + where ref_cod_matricula = $1 and mt.ativo = 0 and mt.ref_cod_turma <> COALESCE((select ref_cod_turma from pmieducar.matricula_turma + where ref_cod_matricula = $1 and ativo = 1 limit 1),0) order by mt.data_exclusao desc limit 1"; + + return $this->toUtf8(Portabilis_Utils_Database::selectField($sql, $matriculaId), array('transform' => true)); + } + protected function loadTransferenciaDataSaida($matriculaId) { + /*$sql = "select to_char(data_transferencia, 'DD/MM/YYYY') from + pmieducar.transferencia_solicitacao where ref_cod_matricula_saida = $1 and ativo = 1";*/ $sql = "select to_char(data_exclusao, 'DD/MM/YYYY') from pmieducar.matricula - where cod_matricula=$1 and ativo = 1 and (aprovado=4 or aprovado=6)"; + where cod_matricula=$1 and ativo = 1 and (aprovado=4 or aprovado=6)"; return Portabilis_Utils_Database::selectField($sql, $matriculaId); } @@ -613,6 +754,34 @@ class AlunoController extends ApiCoreController $aluno['destroyed_at'] = Portabilis_Date_Utils::pgSQLToBr($aluno['destroyed_at']); + $objFichaMedica = new clsModulesFichaMedicaAluno($id); + if ($objFichaMedica->existe()){ + $objFichaMedica = $objFichaMedica->detalhe(); + foreach ($objFichaMedica as $chave => $value) { + $objFichaMedica[$chave] = Portabilis_String_Utils::toUtf8($value); + } + $aluno = Portabilis_Array_Utils::merge($objFichaMedica,$aluno); + } + + $objUniforme = new clsModulesUniformeAluno($id); + if ($objUniforme->existe()){ + $objUniforme = $objUniforme->detalhe(); + foreach ($objUniforme as $chave => $value) { + $objUniforme[$chave] = Portabilis_String_Utils::toUtf8($value); + } + $aluno = Portabilis_Array_Utils::merge($objUniforme,$aluno); + } + + $objMoradia = new clsModulesMoradiaAluno($id); + if ($objMoradia->existe()){ + $objMoradia = $objMoradia->detalhe(); + foreach ($objMoradia as $chave => $value) { + $objMoradia[$chave] = Portabilis_String_Utils::toUtf8($value); + } + $aluno = Portabilis_Array_Utils::merge($objMoradia,$aluno); + } + + return $aluno; } } @@ -661,6 +830,7 @@ class AlunoController extends ApiCoreController $matriculas[$index]['escola_nome'] = $this->loadEscolaNome($matricula['escola_id']); $matriculas[$index]['curso_nome'] = $this->loadCursoNome($matricula['curso_id']); $matriculas[$index]['serie_nome'] = $this->loadSerieNome($matricula['serie_id']); + $matriculas[$index]['ultima_enturmacao'] = $this->loadNomeTurmaOrigem($matricula['id']); $matriculas[$index]['data_entrada'] = $this->loadTransferenciaDataEntrada($matricula['id']); $matriculas[$index]['data_saida'] = $this->loadTransferenciaDataSaida($matricula['id']); @@ -691,6 +861,9 @@ class AlunoController extends ApiCoreController $this->createOrUpdateTransporte($id); $this->createUpdateOrDestroyEducacensoAluno($id); $this->updateDeficiencias(); + $this->createOrUpdateFichaMedica($id); + $this->createOrUpdateUniforme($id); + $this->createOrUpdateMoradia($id); $this->messenger->append('Cadastrado realizado com sucesso', 'success', false, 'error'); } @@ -709,6 +882,9 @@ class AlunoController extends ApiCoreController $this->createOrUpdateTransporte($id); $this->createUpdateOrDestroyEducacensoAluno($id); $this->updateDeficiencias(); + $this->createOrUpdateFichaMedica($id); + $this->createOrUpdateUniforme($id); + $this->createOrUpdateMoradia($id); $this->messenger->append('Cadastro alterado com sucesso', 'success', false, 'error'); } @@ -787,4 +963,4 @@ class AlunoController extends ApiCoreController else $this->notImplementedOperationError(); } -} +} \ No newline at end of file diff --git a/ieducar/modules/Cadastro/Assets/Javascripts/Aluno.js b/ieducar/modules/Cadastro/Assets/Javascripts/Aluno.js index 184735a..ece64dc 100644 --- a/ieducar/modules/Cadastro/Assets/Javascripts/Aluno.js +++ b/ieducar/modules/Cadastro/Assets/Javascripts/Aluno.js @@ -12,6 +12,29 @@ var $resourceNotice = $j('').html('') var $pessoaNotice = $resourceNotice.clone() .appendTo($nomeField.parent()); +// adiciona id 'stop' na linha separadora +$j('.tableDetalheLinhaSeparador').closest('tr').attr('id','stop'); +// Adiciona abas na página +$j('td .formdktd').append('
  • Dados pessoais
  • Ficha m\u00e9dica
  • Uniforme escolar
  • Moradia
'); + +// Adiciona estilo de aba selecionada a primeira aba +$j('#tab1').addClass('alunoTab-active').removeClass('alunoTab'); + +// hide nos campos das outras abas (deixando só os campos da primeira aba) +$j('.tablecadastro >tbody > tr').each(function(index, row) { + if (index>14){ + if (row.id!='stop') + row.hide(); + else + return false; + } +}); + +// Adiciona classe para que os campos de descrição possam ser desativados (checkboxs) +$j('#restricao_atividade_fisica, #acomp_medico_psicologico, #medicacao_especifica, #tratamento_medico, #doenca_congenita, #alergia_alimento, #alergia_medicamento, #fratura_trauma, #plano_saude').addClass('temDescricao'); + +$j('#quantidade_camiseta, #tamanho_camiseta, #quantidade_calca, #tamanho_calca, #quantidade_calcado, #tamanho_calcado, #quantidade_bermuda, #tamanho_bermuda, #quantidade_saia, #tamanho_saia, #quantidade_meia, #tamanho_meia, #tamanho_blusa_jaqueta, #quantidade_blusa_jaqueta').addClass('uniforme'); + // ajax resourceOptions.handlePost = function(dataResponse) { @@ -33,6 +56,7 @@ resourceOptions.handlePut = function(dataResponse) { var tipo_resp; + resourceOptions.handleGet = function(dataResponse) { handleMessages(dataResponse.msgs); $resourceNotice.hide(); @@ -61,11 +85,266 @@ resourceOptions.handleGet = function(dataResponse) { $idField.val(dataResponse.id); $j('#aluno_inep_id').val(dataResponse.aluno_inep_id); $j('#aluno_estado_id').val(dataResponse.aluno_estado_id); - tipo_resp = dataResponse.tipo_responsavel; + tipo_resp = dataResponse.tipo_responsavel; $j('#religiao_id').val(dataResponse.religiao_id); $j('#beneficio_id').val(dataResponse.beneficio_id); $j('#tipo_transporte').val(dataResponse.tipo_transporte); $j('#alfabetizado').attr('checked', dataResponse.alfabetizado); + + /*********************************************** + CAMPOS DA FICHA MÉDICA + ************************************************/ + + //campos checkbox + if (dataResponse.alergia_medicamento == 'S'){ + $j('#alergia_medicamento').attr('checked',true); + $j('#alergia_medicamento').val('on'); + } + + if (dataResponse.alergia_alimento == 'S'){ + $j('#alergia_alimento').attr('checked',true); + $j('#alergia_alimento').val('on'); + } + + if (dataResponse.doenca_congenita == 'S'){ + $j('#doenca_congenita').attr('checked',true); + $j('#doenca_congenita').val('on'); + } + + if (dataResponse.fumante == 'S'){ + $j('#fumante').attr('checked',true); + $j('#fumante').val('on'); + } + + if (dataResponse.doenca_caxumba == 'S'){ + $j('#doenca_caxumba').attr('checked',true); + $j('#doenca_caxumba').val('on'); + } + + if (dataResponse.doenca_sarampo == 'S'){ + $j('#doenca_sarampo').attr('checked',true); + $j('#doenca_sarampo').val('on'); + } + + if (dataResponse.doenca_rubeola == 'S'){ + $j('#doenca_rubeola').attr('checked',true); + $j('#doenca_rubeola').val('on'); + } + + if (dataResponse.doenca_catapora == 'S'){ + $j('#doenca_catapora').attr('checked',true); + $j('#doenca_catapora').val('on'); + } + + if (dataResponse.doenca_escarlatina == 'S'){ + $j('#doenca_escarlatina').attr('checked',true); + $j('#doenca_escarlatina').val('on'); + } + + if (dataResponse.doenca_coqueluche == 'S'){ + $j('#doenca_coqueluche').attr('checked',true); + $j('#doenca_coqueluche').val('on'); + } + + if (dataResponse.epiletico == 'S'){ + $j('#epiletico').attr('checked',true); + $j('#epiletico').val('on'); + } + + if (dataResponse.epiletico_tratamento == 'S'){ + $j('#epiletico_tratamento').attr('checked',true); + $j('#epiletico_tratamento').val('on'); + } + + if (dataResponse.hemofilico == 'S'){ + $j('#hemofilico').attr('checked',true); + $j('#hemofilico').val('on'); + } + + if (dataResponse.hipertenso == 'S'){ + $j('#hipertenso').attr('checked',true); + $j('#hipertenso').val('on'); + } + + if (dataResponse.asmatico == 'S'){ + $j('#asmatico').attr('checked',true); + $j('#asmatico').val('on'); + } + + if (dataResponse.diabetico == 'S'){ + $j('#diabetico').attr('checked',true); + $j('#diabetico').val('on'); + } + + if (dataResponse.insulina == 'S'){ + $j('#insulina').attr('checked',true); + $j('#insulina').val('on'); + } + + if (dataResponse.tratamento_medico == 'S'){ + $j('#tratamento_medico').attr('checked',true); + $j('#tratamento_medico').val('on'); + } + + if (dataResponse.medicacao_especifica == 'S'){ + $j('#medicacao_especifica').attr('checked',true); + $j('#medicacao_especifica').val('on'); + } + + if (dataResponse.acomp_medico_psicologico == 'S'){ + $j('#acomp_medico_psicologico').attr('checked',true); + $j('#acomp_medico_psicologico').val('on'); + } + + if (dataResponse.restricao_atividade_fisica == 'S'){ + $j('#restricao_atividade_fisica').attr('checked',true); + $j('#restricao_atividade_fisica').val('on'); + } + + if (dataResponse.fratura_trauma == 'S'){ + $j('#fratura_trauma').attr('checked',true); + $j('#fratura_trauma').val('on'); + } + if (dataResponse.plano_saude == 'S'){ + $j('#plano_saude').attr('checked',true); + $j('#plano_saude').val('on'); + } + // campos texto + $j('#altura').val(dataResponse.altura); + $j('#peso').val(dataResponse.peso); + $j('#grupo_sanguineo').val(dataResponse.grupo_sanguineo); + $j('#fator_rh').val(dataResponse.fator_rh); + $j('#desc_alergia_medicamento').val(dataResponse.desc_alergia_medicamento); + $j('#desc_alergia_alimento').val(dataResponse.desc_alergia_alimento); + $j('#desc_doenca_congenita').val(dataResponse.desc_doenca_congenita); + $j('#doenca_outras').val(dataResponse.doenca_outras); + $j('#desc_tratamento_medico').val(dataResponse.desc_tratamento_medico); + $j('#desc_medicacao_especifica').val(dataResponse.desc_medicacao_especifica); + $j('#desc_acomp_medico_psicologico').val(dataResponse.desc_acomp_medico_psicologico); + $j('#desc_restricao_atividade_fisica').val(dataResponse.desc_restricao_atividade_fisica); + $j('#desc_fratura_trauma').val(dataResponse.desc_fratura_trauma); + $j('#desc_plano_saude').val(dataResponse.desc_plano_saude); + $j('#hospital_clinica').val(dataResponse.hospital_clinica); + $j('#hospital_clinica_endereco').val(dataResponse.hospital_clinica_endereco); + $j('#hospital_clinica_telefone').val(dataResponse.hospital_clinica_telefone); + $j('#responsavel').val(dataResponse.responsavel); + $j('#responsavel_parentesco').val(dataResponse.responsavel_parentesco); + $j('#responsavel_parentesco_telefone').val(dataResponse.responsavel_parentesco_telefone); + $j('#responsavel_parentesco_celular').val(dataResponse.responsavel_parentesco_celular); + + /*********************************************** + CAMPOS DO UNIFORME ESCOLAR + ************************************************/ + + if (dataResponse.recebeu_uniforme == 'S'){ + $j('#recebeu_uniforme').attr('checked',true); + $j('#recebeu_uniforme').val('on'); + } + $j('#tamanho_camiseta').val(dataResponse.tamanho_camiseta); + $j('#tamanho_calcado').val(dataResponse.tamanho_calcado); + $j('#tamanho_saia').val(dataResponse.tamanho_saia); + $j('#tamanho_calca').val(dataResponse.tamanho_calca); + $j('#tamanho_meia').val(dataResponse.tamanho_meia); + $j('#tamanho_bermuda').val(dataResponse.tamanho_bermuda); + $j('#tamanho_blusa_jaqueta').val(dataResponse.tamanho_blusa_jaqueta); + $j('#quantidade_camiseta').val(dataResponse.quantidade_camiseta); + $j('#quantidade_calcado').val(dataResponse.quantidade_calcado); + $j('#quantidade_saia').val(dataResponse.quantidade_saia); + $j('#quantidade_calca').val(dataResponse.quantidade_calca); + $j('#quantidade_calcado').val(dataResponse.quantidade_calcado); + $j('#quantidade_bermuda').val(dataResponse.quantidade_bermuda); + $j('#quantidade_meia').val(dataResponse.quantidade_meia); + $j('#quantidade_blusa_jaqueta').val(dataResponse.quantidade_blusa_jaqueta); + + /*********************************************** + CAMPOS DA MORADIA + ************************************************/ + + if (dataResponse.empregada_domestica == 'S'){ + $j('#empregada_domestica').attr('checked',true); + $j('#empregada_domestica').val('on'); + } + if (dataResponse.automovel == 'S'){ + $j('#automovel').attr('checked',true); + $j('#automovel').val('on'); + } + if (dataResponse.motocicleta == 'S'){ + $j('#motocicleta').attr('checked',true); + $j('#motocicleta').val('on'); + } + if (dataResponse.computador == 'S'){ + $j('#computador').attr('checked',true); + $j('#computador').val('on'); + } + if (dataResponse.geladeira == 'S'){ + $j('#geladeira').attr('checked',true); + $j('#geladeira').val('on'); + } + if (dataResponse.fogao == 'S'){ + $j('#fogao').attr('checked',true); + $j('#fogao').val('on'); + } + if (dataResponse.maquina_lavar == 'S'){ + $j('#maquina_lavar').attr('checked',true); + $j('#maquina_lavar').val('on'); + } + if (dataResponse.microondas == 'S'){ + $j('#microondas').attr('checked',true); + $j('#microondas').val('on'); + } + if (dataResponse.video_dvd == 'S'){ + $j('#video_dvd').attr('checked',true); + $j('#video_dvd').val('on'); + } + if (dataResponse.televisao == 'S'){ + $j('#televisao').attr('checked',true); + $j('#televisao').val('on'); + } + if (dataResponse.telefone == 'S'){ + $j('#telefone').attr('checked',true); + $j('#telefone').val('on'); + } + if (dataResponse.celular == 'S'){ + $j('#celular').attr('checked',true); + $j('#celular').val('on'); + } + if (dataResponse.agua_encanada == 'S'){ + $j('#agua_encanada').attr('checked',true); + $j('#agua_encanada').val('on'); + } + if (dataResponse.poco == 'S'){ + $j('#poco').attr('checked',true); + $j('#poco').val('on'); + } + if (dataResponse.energia == 'S'){ + $j('#energia').attr('checked',true); + $j('#energia').val('on'); + } + if (dataResponse.esgoto == 'S'){ + $j('#esgoto').attr('checked',true); + $j('#esgoto').val('on'); + } + if (dataResponse.fossa == 'S'){ + $j('#fossa').attr('checked',true); + $j('#fossa').val('on'); + } + if (dataResponse.lixo == 'S'){ + $j('#lixo').attr('checked',true); + $j('#lixo').val('on'); + } + + $j('#quartos').val(dataResponse.quartos); + $j('#sala').val(dataResponse.sala); + $j('#copa').val(dataResponse.copa); + $j('#banheiro').val(dataResponse.banheiro); + $j('#garagem').val(dataResponse.garagem); + $j('#casa_outra').val(dataResponse.casa_outra); + $j('#quant_pessoas').val(dataResponse.quant_pessoas); + $j('#renda').val(dataResponse.renda); + $j('#moradia').val(dataResponse.moradia).change(); + $j('#material').val(dataResponse.material).change(); + $j('#moradia_situacao').val(dataResponse.moradia_situacao).change(); + }; var handleGetPersonDetails = function(dataResponse) { @@ -130,21 +409,21 @@ var handleGetPersonDetails = function(dataResponse) { $j('#tipo_responsavel').find('option').remove().end(); if ( $j('#pai').val()=='' && $j('#mae').val()==''){ - $j('#tipo_responsavel').append(''); - $j('#responsavel_nome').show(); + $j('#tipo_responsavel').append(''); + $j('#responsavel_nome').show(); }else if ($j('#pai').val()==''){ - $j('#tipo_responsavel').append(''); - $j('#tipo_responsavel').append(''); + $j('#tipo_responsavel').append(''); + $j('#tipo_responsavel').append(''); } else if ($j('#mae').val()==''){ - $j('#tipo_responsavel').append(''); - $j('#tipo_responsavel').append(''); + $j('#tipo_responsavel').append(''); + $j('#tipo_responsavel').append(''); } else{ - $j('#tipo_responsavel').append(''); - $j('#tipo_responsavel').append(''); - $j('#tipo_responsavel').append(''); + $j('#tipo_responsavel').append(''); + $j('#tipo_responsavel').append(''); + $j('#tipo_responsavel').append(''); } $j('#tipo_responsavel').val(tipo_resp).change(); - + // # TODO show aluno photo //$j('#aluno_foto').val(dataResponse.url_foto); } @@ -247,15 +526,133 @@ function afterChangePessoa(targetWindow, pessoaId) { } checkTipoResponsavel(); - $j('#tipo_responsavel').change(checkTipoResponsavel); + $j('#tipo_responsavel').change(checkTipoResponsavel); + + + var checkMoradia = function(){ + if($j('#moradia').val() == 'C'){ + $j('#material').show(); + $j('#casa_outra').hide(); + }else if($j('#moradia').val() == 'O'){ + $j('#material').hide(); + $j('#casa_outra').show(); + }else{ + $j('#casa_outra').hide(); + $j('#material').hide(); + } + } + checkMoradia(); + $j('#moradia').change(checkMoradia); var msg = 'Bem vindo ao novo cadastro de alunos,
' + + 'Agora você pode navegar entre as abas!
'+ 'Dúvidas? Entre em contato com o suporte.'; $j('

').addClass('back-to-old-version right-top-notice notice') .html(stringUtils.toUtf8(msg)) - .appendTo($j('#id').closest('td')); + .appendTo($j('#tab1').closest('td')); + + + /*********************** + EVENTOS DE CLICK EM ABAS + ************************/ + + // DADOS PESSOAIS + $j('#tab1').click( + function(){ + + $j('.alunoTab-active').toggleClass('alunoTab-active alunoTab'); + $j('#tab1').toggleClass('alunoTab alunoTab-active') + $j('.tablecadastro >tbody > tr').each(function(index, row) { + if (index>14){ + if (row.id!='stop') + row.hide(); + else + return false; + }else{ + row.show(); + } + }); + } + ); + + // FICHA MÉDICA + $j('#tab2').click( + function(){ + $j('.alunoTab-active').toggleClass('alunoTab-active alunoTab'); + $j('#tab2').toggleClass('alunoTab alunoTab-active') + $j('.tablecadastro >tbody > tr').each(function(index, row) { + if (row.id!='stop'){ + if (index>14 && index<61){ + row.show(); + }else if (index>0){ + row.hide(); + } + }else + return false; + }); + // Esse loop desativa/ativa os campos de descrição, conforme os checkbox + $j('.temDescricao').each(function(i, obj) { + $j('#desc_'+obj.id).prop('disabled', !$j('#'+obj.id).prop('checked')); + }); + + }); + // UNIFORME + $j('#tab3').click( + function(){ + $j('.alunoTab-active').toggleClass('alunoTab-active alunoTab'); + $j('#tab3').toggleClass('alunoTab alunoTab-active') + $j('.tablecadastro >tbody > tr').each(function(index, row) { + if (row.id!='stop'){ + if (index>60 && index<83){ + row.show(); + }else if (index>0){ + row.hide(); + } + }else + return false; + }); + $j('.uniforme').prop('disabled',!$j('#recebeu_uniforme').prop('checked')); + }); + + // MORADIA + $j('#tab4').click( + function(){ + $j('.alunoTab-active').toggleClass('alunoTab-active alunoTab'); + $j('#tab4').toggleClass('alunoTab alunoTab-active') + $j('.tablecadastro >tbody > tr').each(function(index, row) { + + if (index<83 && index!=0){ + row.hide(); + }else{ + row.show(); + } + }); + $j('.uniforme').prop('disabled',!$j('#recebeu_uniforme').prop('checked')); + }); + + + /* A seguinte função habilitam/desabilitam o campo de descrição quando for clicado + nos referentes checkboxs */ + + $j('.temDescricao').click(function(){ + if ($j('#'+this.id).prop('checked')) + $j('#desc_'+this.id).removeAttr('disabled'); + else{ + $j('#desc_'+this.id).attr('disabled','disabled'); + $j('#desc_'+this.id).val(''); + } + }); + + $j('#recebeu_uniforme').click(function(){ + if ($j('#recebeu_uniforme').prop('checked')) + $j('.uniforme').removeAttr('disabled'); + else{ + $j('.uniforme').attr('disabled','disabled'); + $j('.uniforme').val(''); + } + }); }); // ready })(jQuery); \ No newline at end of file diff --git a/ieducar/modules/Cadastro/Assets/Javascripts/AlunoShow.js b/ieducar/modules/Cadastro/Assets/Javascripts/AlunoShow.js index d607dc7..f048763 100644 --- a/ieducar/modules/Cadastro/Assets/Javascripts/AlunoShow.js +++ b/ieducar/modules/Cadastro/Assets/Javascripts/AlunoShow.js @@ -11,6 +11,7 @@ function fixupTabelaMatriculas() { $j('').html('Ano').appendTo($tr); $j('').html(stringUtils.toUtf8('Situação')).appendTo($tr); $j('').html('Turma').appendTo($tr); + $j('').html('\u00daltima enturma\u00e7\u00e3o').appendTo($tr); $j('').html(stringUtils.toUtf8('Série')).appendTo($tr); $j('').html('Curso').appendTo($tr); $j('').html('Escola').appendTo($tr); @@ -30,6 +31,7 @@ var handleGetMatriculas = function(dataResponse) { try{ handleMessages(dataResponse.msgs); + var $matriculasTable = $j('#matriculas'); var transferenciaEmAberto = false; @@ -49,6 +51,7 @@ var handleGetMatriculas = function(dataResponse) { $j('').html(matricula.ano).appendTo($tr); $j('').html(matricula.situacao).appendTo($tr); $j('').html(matricula.turma_nome).appendTo($tr); + $j('').html(matricula.ultima_enturmacao).appendTo($tr); $j('').html(matricula.serie_nome).appendTo($tr); $j('').html(matricula.curso_nome).appendTo($tr); $j('').html(matricula.escola_nome).appendTo($tr); @@ -119,10 +122,162 @@ var getMatriculas = function() { getResource(options); } -// when page is ready +$j('.tableDetalheLinhaSeparador').closest('tr').attr('id','stop'); + +// Verifica se possui ficha médica, verificando se existe o primeiro campo +var possui_ficha_medica = $j('#fmedica').length>0; + +var possui_uniforme_escolar = $j('#funiforme').length>0; + +var possui_moradia = $j('#fmoradia').length>0; + +// Adiciona abas na página +$j('td .formdktd').append('

  • Dados pessoais
  • Ficha m\u00e9dica
  • Uniforme escolar
  • Moradia
'); +$j('td .formdktd b').remove(); +$j('#tab1').addClass('alunoTab-active2').removeClass('alunoTab2'); +var linha_inicial_fmedica = 0; + +if(possui_ficha_medica){ + // Atribui um id a linha, para identificar até onde/a partir de onde esconder os campos + $j('#fmedica').closest('tr').attr('id','tfmedica'); + + // Pega o número dessa linha + linha_inicial_fmedica = $j('#tfmedica').index(); + + // hide nos campos das outras abas (deixando só os campos da primeira aba) + $j('.tableDetalhe >tbody > tr').each(function(index, row) { + if (index>=linha_inicial_fmedica){ + if (row.id!='stop') + row.hide(); + else + return false; + } + }); +} + +if(possui_uniforme_escolar){ + // Atribui um id a linha, para identificar até onde/a partir de onde esconder os campos + $j('#funiforme').closest('tr').attr('id','tfuniforme'); + + // Pega o número dessa linha + linha_inicial_funiforme = $j('#tfuniforme').index(); + // hide nos campos das outras abas (deixando só os campos da primeira aba) + $j('.tableDetalhe >tbody > tr').each(function(index, row) { + if (index>=linha_inicial_funiforme){ + if (row.id!='stop') + row.hide(); + else + return false; + } + }); +} + +if(possui_moradia){ + // Atribui um id a linha, para identificar até onde/a partir de onde esconder os campos + $j('#fmoradia').closest('tr').attr('id','tfmoradia'); + + // Pega o número dessa linha + linha_inicial_fmoradia = $j('#tfmoradia').index(); + + // hide nos campos das outras abas (deixando só os campos da primeira aba) + $j('.tableDetalhe >tbody > tr').each(function(index, row) { + if (index>=linha_inicial_fmoradia){ + if (row.id!='stop') + row.hide(); + else + return false; + } + }); +} + + +// when page is ready $j(document).ready(function() { + // on click das abas + + // DADOS PESSOAIS + $j('#tab1').click( + function(){ + + $j('.alunoTab-active2').toggleClass('alunoTab-active2 alunoTab2'); + $j('#tab1').toggleClass('alunoTab2 alunoTab-active2') + $j('.tableDetalhe >tbody > tr').each(function(index, row) { + if (index>=linha_inicial_fmedica){ + if (row.id!='stop') + row.hide(); + else + return false; + }else{ + row.show(); + } + }); + } + ); + + // FICHA MÉDICA + $j('#tab2').click( + function(){ + if (possui_ficha_medica){ + $j('.alunoTab-active2').toggleClass('alunoTab-active2 alunoTab2'); + $j('#tab2').toggleClass('alunoTab2 alunoTab-active2') + $j('.tableDetalhe >tbody > tr').each(function(index, row) { + if (row.id!='stop'){ + if (index>=linha_inicial_fmedica && index0){ + row.hide(); + } + }else + return false; + }); + }else + alert('Dados da ficha m\u00e9dica n\u00e3o foram adicionados ainda. \nVoc\u00ea pode adicion\u00e1-los clicando em editar.'); + + }); + + // FICHA MÉDICA + $j('#tab3').click( + function(){ + if (possui_uniforme_escolar){ + $j('.alunoTab-active2').toggleClass('alunoTab-active2 alunoTab2'); + $j('#tab3').toggleClass('alunoTab2 alunoTab-active2') + $j('.tableDetalhe >tbody > tr').each(function(index, row) { + if (row.id!='stop'){ + if (index>=linha_inicial_funiforme && index0){ + row.hide(); + } + }else + return false; + }); + }else + alert('Dados do uniforme escolar n\u00e3o foram adicionados ainda. \nVoc\u00ea pode adicion\u00e1-los clicando em editar.'); + + }); + // FICHA MÉDICA + $j('#tab4').click( + function(){ + if (possui_moradia){ + $j('.alunoTab-active2').toggleClass('alunoTab-active2 alunoTab2'); + $j('#tab4').toggleClass('alunoTab2 alunoTab-active2') + $j('.tableDetalhe >tbody > tr').each(function(index, row) { + if (row.id!='stop'){ + if (index>=linha_inicial_fmoradia){ + row.show(); + }else if (index>0){ + row.hide(); + } + }else + return false; + }); + }else + alert('Dados da moradia n\u00e3o foram adicionados ainda. \nVoc\u00ea pode adicion\u00e1-los clicando em editar.'); + + }); + getMatriculas(); }); // ready \ No newline at end of file diff --git a/ieducar/modules/Cadastro/Assets/Stylesheets/Aluno.css b/ieducar/modules/Cadastro/Assets/Stylesheets/Aluno.css index 3e55879..682f7f0 100644 --- a/ieducar/modules/Cadastro/Assets/Stylesheets/Aluno.css +++ b/ieducar/modules/Cadastro/Assets/Stylesheets/Aluno.css @@ -15,4 +15,151 @@ #deficiencias_chzn ul { width: 307px; +} + +.pessoa-links { + display: block; + padding: 5px; + margin: 2px; +} + +.pessoa-links a { + /* + obs: no firefox, ao mostrar o elemento (.show, jquery), é setado display como block, + para reparar isto, após chamar .show(), chamar .css('display', 'inline'); + */ + + margin-right: 5px; +} + +#deficiencias_chzn ul { + width: 307px; +} + +#tabControl ul{ + display: inline; + list-style-type: none; +} + +#tabControl ul li{ + padding-left: 2px; + float: left; + +} + +.alunoTab{ + border: 1px solid rgb(73, 92, 103); + border-bottom-color: #FFF; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; + -moz-border-radius-topleft: 5px; + -moz-border-radius-topright: 5px; + -moz-border-radius-bottomleft: 0px; + -moz-border-radius-bottomright: 0px; + -webkit-border-top-left-radius: 5px; + -webkit-border-top-right-radius: 5px; + -webkit-border-bottom-left-radius: 0px; + -webkit-border-bottom-right-radius: 0px; + position:relative; + top: 2px; + width: 100px; + height: 25px; + background-color: white; + text-align: center; + cursor: pointer; +} + +.alunoTab2{ + border: 1px solid rgb(73, 92, 103); + border-bottom-color: #FFF; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; + -moz-border-radius-topleft: 5px; + -moz-border-radius-topright: 5px; + -moz-border-radius-bottomleft: 0px; + -moz-border-radius-bottomright: 0px; + -webkit-border-top-left-radius: 5px; + -webkit-border-top-right-radius: 5px; + -webkit-border-bottom-left-radius: 0px; + -webkit-border-bottom-right-radius: 0px; + position:relative; + top: 2px; + width: 100px; + height: 25px; + background-color: #e4e9ed; + text-align: center; + cursor: pointer; +} + +.alunoTab-active{ + border: 1px solid rgb(73, 92, 103); + border-bottom: 0px; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; + -moz-border-radius-topleft: 5px; + -moz-border-radius-topright: 5px; + -moz-border-radius-bottomleft: 0px; + -moz-border-radius-bottomright: 0px; + -webkit-border-top-left-radius: 5px; + -webkit-border-top-right-radius: 5px; + -webkit-border-bottom-left-radius: 0px; + -webkit-border-bottom-right-radius: 0px; + position:relative; + top: 3px; + width: 100px; + height: 25px; + background-color: #e4e9ed; + text-align: center; + font-weight: bold; +} + +.alunoTab-active2{ + border: 1px solid rgb(73, 92, 103); + border-bottom: 0px; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; + -moz-border-radius-topleft: 5px; + -moz-border-radius-topright: 5px; + -moz-border-radius-bottomleft: 0px; + -moz-border-radius-bottomright: 0px; + -webkit-border-top-left-radius: 5px; + -webkit-border-top-right-radius: 5px; + -webkit-border-bottom-left-radius: 0px; + -webkit-border-bottom-right-radius: 0px; + position:relative; + top: 3px; + width: 100px; + height: 25px; + background-color: white; + text-align: center; + font-weight: bold; +} + +.tabText{ + position: relative; + top: 6px; +} + +#tr_tit_dados_hospital, #tr_tit_dados_responsavel{ + font-weight: bold; + font-size: 12px; +} + +#tit_dados_hospital, #tit_dados_responsavel, #tr_label_calca, +#tr_label_calcado, #tr_label_saia, #tr_label_camiseta, +#tr_label_meia, #tr_label_bermuda, #tr_label_blusa_jaqueta{ + font-weight: bold; + font-size: 10px; +} +.tit_uniforme{ + font-weight: bold; + font-size: 10px; } \ No newline at end of file diff --git a/ieducar/modules/Cadastro/Views/AlunoController.php b/ieducar/modules/Cadastro/Views/AlunoController.php index f877c06..b794d41 100644 --- a/ieducar/modules/Cadastro/Views/AlunoController.php +++ b/ieducar/modules/Cadastro/Views/AlunoController.php @@ -85,7 +85,7 @@ class AlunoController extends Portabilis_Controller_Page_EditController ), 'aluno_inep_id' => array( - 'label' => 'Código inep', + 'label' => 'Código INEP', 'help' => '', ), @@ -97,7 +97,210 @@ class AlunoController extends Portabilis_Controller_Page_EditController 'deficiencias' => array( 'label' => 'Deficiências / habilidades especiais', 'help' => '', - ) + ), + + /* ******************* + ** Dados médicos ** + ******************* */ + + 'altura' => array('label' => 'Altura/Metro'), + + 'peso' => array('label' => 'Peso/Kg'), + + 'grupo_sanguineo' => array('label' => 'Grupo sanguíneo'), + + 'fator_rh' => array('label' => 'Fator RH'), + + 'alergia_medicamento' => array('label' => 'O aluno é alérgico a algum medicamento?'), + + 'desc_alergia_medicamento' => array('label' => 'Quais?'), + + 'alergia_alimento' => array('label' => 'O aluno é alérgico a algum alimento?'), + + 'desc_alergia_alimento' => array('label' => 'Quais?'), + + 'doenca_congenita' => array('label' => 'O aluno possui doença congênita?'), + + 'desc_doenca_congenita' => array('label' => 'Quais?'), + + 'fumante' => array('label' => 'O aluno é fumante?'), + + 'doenca_caxumba' => array('label' => 'O aluno já contraiu caxumba?'), + + 'doenca_sarampo' => array('label' => 'O aluno já contraiu sarampo?'), + + 'doenca_rubeola' => array('label' => 'O aluno já contraiu rubeola?'), + + 'doenca_catapora' => array('label' => 'O aluno já contraiu catapora?'), + + 'doenca_escarlatina' => array('label' => 'O aluno já contraiu escarlatina?'), + + 'doenca_coqueluche' => array('label' => 'O aluno já contraiu coqueluche?'), + + 'doenca_outras' => array('label' => 'Outras doenças que o aluno já contraiu'), + + 'epiletico' => array('label' => 'O aluno é epilético?'), + + 'epiletico_tratamento' => array('label' => 'Está em tratamento?'), + + 'hemofilico' => array('label' => 'O aluno é hemofílico?'), + + 'hipertenso' => array('label' => 'O aluno tem hipertensão?'), + + 'asmatico' => array('label' => 'O aluno é asmático?'), + + 'diabetico' => array('label' => 'O aluno é diabético?'), + + 'insulina' => array('label' => 'Depende de insulina?'), + + 'tratamento_medico' => array('label' => 'O aluno faz algum tratamento médico?'), + + 'desc_tratamento_medico' => array('label' => 'Qual?'), + + 'medicacao_especifica' => array('label' => 'O aluno está ingerindo medicação específica?'), + + 'desc_medicacao_especifica' => array('label' => 'Qual?'), + + 'acomp_medico_psicologico' => array('label' => 'O aluno tem acompanhamento médico ou psicológico?'), + + 'desc_acomp_medico_psicologico' => array('label' => 'Motivo?'), + + 'restricao_atividade_fisica' => array('label' => 'O aluno tem restrição a alguma atividade física?'), + + 'desc_restricao_atividade_fisica' => array('label' => 'Qual?'), + + 'fratura_trauma' => array('label' => 'O aluno sofreu alguma fratura ou trauma?'), + + 'desc_fratura_trauma' => array('label' => 'Qual?'), + + 'plano_saude' => array('label' => 'O aluno possui algum plano de saúde?'), + + 'desc_plano_saude' => array('label' => 'Qual?'), + + 'hospital_clinica' => array('label' => 'Nome'), + + 'hospital_clinica_endereco' => array('label' => 'Endereço'), + + 'hospital_clinica_telefone' => array('label' => 'Telefone'), + + 'responsavel' => array('label' => 'Nome'), + + 'responsavel_parentesco' => array('label' => 'Parentesco'), + + 'responsavel_parentesco_telefone' => array('label' => 'Telefone'), + + 'responsavel_parentesco_celular' => array('label' => 'Celular'), + + /************************* + **** UNIFORME ESCOLAR **** + **************************/ + + 'recebeu_uniforme' => array('label' => 'Recebeu uniforme escolar?'), + + 'label_camiseta' => array('label' => 'Camiseta'), + + 'quantidade_camiseta' => array('label' => 'Quantidade'), + + 'tamanho_camiseta' => array('label' => 'Tamanho'), + + 'label_blusa_jaqueta' => array('label' => 'Blusa/Jaqueta'), + + 'quantidade_blusa_jaqueta' => array('label' => 'Quantidade'), + + 'tamanho_blusa_jaqueta' => array('label' => 'Tamanho'), + + 'label_bermuda' => array('label' => 'Bermuda'), + + 'quantidade_bermuda' => array('label' => 'Quantidade'), + + 'tamanho_bermuda' => array('label' => 'Tamanho'), + + 'label_calca' => array('label' => 'Calça'), + + 'quantidade_calca' => array('label' => 'Quantidade'), + + 'tamanho_calca' => array('label' => 'Tamanho'), + + 'label_saia' => array('label' => 'Saia'), + + 'quantidade_saia' => array('label' => 'Quantidade'), + + 'tamanho_saia' => array('label' => 'Tamanho'), + + 'label_calcado' => array('label' => 'Calçado'), + + 'quantidade_calcado' => array('label' => 'Quantidade'), + + 'tamanho_calcado' => array('label' => 'Tamanho'), + + 'label_meia' => array('label' => 'Meia'), + + 'quantidade_meia' => array('label' => 'Quantidade'), + + 'tamanho_meia' => array('label' => 'Tamanho'), + + /************ + MORADIA + ************/ + + 'moradia' => array('label' => 'Moradia'), + + 'material' => array('label' => 'Material'), + + 'casa_outra' => array('label' => 'Outro'), + + 'moradia_situacao' => array('label' => 'Situação'), + + 'quartos' => array('label' => 'Número de quartos'), + + 'sala' => array('label' => 'Número de salas'), + + 'copa' => array('label' => 'Número de copas'), + + 'banheiro' => array('label' => 'Número de banheiros'), + + 'garagem' => array('label' => 'Número de garagens'), + + 'empregada_domestica' => array('label' => 'Possui empregada doméstica?'), + + 'automovel' => array('label' => 'Possui automóvel?'), + + 'motocicleta' => array('label' => 'Possui motocicleta?'), + + 'computador' => array('label' => 'Possui computador?'), + + 'geladeira' => array('label' => 'Possui geladeira?'), + + 'fogao' => array('label' => 'Possui fogão?'), + + 'maquina_lavar' => array('label' => 'Possui máquina de lavar?'), + + 'microondas' => array('label' => 'Possui microondas?'), + + 'video_dvd' => array('label' => 'Possui vídeo/DVD?'), + + 'televisao' => array('label' => 'Possui televisão?'), + + 'celular' => array('label' => 'Possui celular?'), + + 'telefone' => array('label' => 'Possui telefone?'), + + 'quant_pessoas' => array('label' => 'Quantidades de pessoas residentes no lar'), + + 'renda' => array('label' => 'Renda familiar em R$'), + + 'agua_encanada' => array('label' => 'Possui água encanada?'), + + 'poco' => array('label' => 'Possui poço?'), + + 'energia' => array('label' => 'Possui energia?'), + + 'esgoto' => array('label' => 'Possui esgoto?'), + + 'fossa' => array('label' => 'Possui fossa?'), + + 'lixo' => array('label' => 'Possui lixo?'), + ); @@ -125,7 +328,6 @@ class AlunoController extends Portabilis_Controller_Page_EditController '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); @@ -139,7 +341,7 @@ class AlunoController extends Portabilis_Controller_Page_EditController $this->inputsHelper()->simpleSearchPessoa('nome', $options); // data nascimento - $options = array('label' => 'Data nascimento', 'disabled' => true, 'required' => false, 'size' => 25, 'placeholder' => ''); + $options = array('label' => 'Data de nascimento', 'disabled' => true, 'required' => false, 'size' => 25, 'placeholder' => ''); $this->inputsHelper()->date('data_nascimento', $options); // rg @@ -162,7 +364,14 @@ class AlunoController extends Portabilis_Controller_Page_EditController $label = Portabilis_String_Utils::toLatin1($this->_getLabel('responsavel')); + /*$tiposResponsavel = array(null => $label, + 'pai' => 'Pai', + 'mae' => 'Mãe', + 'outra_pessoa' => 'Outra pessoa');*/ + $tiposResponsavel = array(null => 'Informe uma Pessoa primeiro'); + $options = array('label' => $this->_getLabel('responsavel'), + 'resources' => $tiposResponsavel, 'required' => true, 'inline' => true); @@ -193,10 +402,10 @@ class AlunoController extends Portabilis_Controller_Page_EditController // religião - $this->inputsHelper()->religiao(array('required' => false)); + $this->inputsHelper()->religiao(array('required' => false, 'label' => Portabilis_String_Utils::toLatin1('Religião'))); // beneficio - $this->inputsHelper()->beneficio(array('required' => false)); + $this->inputsHelper()->beneficio(array('required' => false, 'label' => Portabilis_String_Utils::toLatin1('Benefício'))); // Deficiências / habilidades especiais @@ -212,6 +421,378 @@ class AlunoController extends Portabilis_Controller_Page_EditController $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()); } } diff --git a/ieducar/modules/Portabilis/Assets/Version.php b/ieducar/modules/Portabilis/Assets/Version.php index 1546e58..449d9ef 100644 --- a/ieducar/modules/Portabilis/Assets/Version.php +++ b/ieducar/modules/Portabilis/Assets/Version.php @@ -4,7 +4,7 @@ usado pelo metodos loadJavascript e loadStylesheet do helper Portabilis_View_Helper_Application */ class Portabilis_Assets_Version { - const VERSION = '4'; + const VERSION = '5'; } ?> -- libgit2 0.21.2