Commit c745fcdd2cb40853931b5ba5eb537cfb28862622
1 parent
dadb586f
Exists in
master
Adicionado informações adicionais no cad de alunos
Adicionado aba ficha médica; Adicionado aba uniforme escolar; Adicionado aba moradia; portabilis/ieducar#89
Showing
13 changed files
with
3880 additions
and
28 deletions
Show diff stats
ieducar/intranet/educar_aluno_det.php
@@ -32,6 +32,9 @@ require_once 'include/clsBase.inc.php'; | @@ -32,6 +32,9 @@ require_once 'include/clsBase.inc.php'; | ||
32 | require_once 'include/clsDetalhe.inc.php'; | 32 | require_once 'include/clsDetalhe.inc.php'; |
33 | require_once 'include/clsBanco.inc.php'; | 33 | require_once 'include/clsBanco.inc.php'; |
34 | require_once 'include/pmieducar/geral.inc.php'; | 34 | require_once 'include/pmieducar/geral.inc.php'; |
35 | +require_once 'include/modules/clsModulesFichaMedicaAluno.inc.php'; | ||
36 | +require_once 'include/modules/clsModulesUniformeAluno.inc.php'; | ||
37 | +require_once 'include/modules/clsModulesMoradiaAluno.inc.php'; | ||
35 | 38 | ||
36 | require_once 'App/Model/ZonaLocalizacao.php'; | 39 | require_once 'App/Model/ZonaLocalizacao.php'; |
37 | require_once 'Educacenso/Model/AlunoDataMapper.php'; | 40 | require_once 'Educacenso/Model/AlunoDataMapper.php'; |
@@ -41,6 +44,7 @@ require_once 'include/pessoa/clsCadastroFisicaFoto.inc.php'; | @@ -41,6 +44,7 @@ require_once 'include/pessoa/clsCadastroFisicaFoto.inc.php'; | ||
41 | 44 | ||
42 | require_once 'Portabilis/View/Helper/Application.php'; | 45 | require_once 'Portabilis/View/Helper/Application.php'; |
43 | 46 | ||
47 | + | ||
44 | /** | 48 | /** |
45 | * clsIndexBase class. | 49 | * clsIndexBase class. |
46 | * | 50 | * |
@@ -141,7 +145,7 @@ class indice extends clsDetalhe | @@ -141,7 +145,7 @@ class indice extends clsDetalhe | ||
141 | $detalheFoto = $objFoto->detalhe(); | 145 | $detalheFoto = $objFoto->detalhe(); |
142 | if ($detalheFoto) | 146 | if ($detalheFoto) |
143 | $caminhoFoto = $detalheFoto['caminho']; | 147 | $caminhoFoto = $detalheFoto['caminho']; |
144 | - | 148 | + |
145 | $registro['nome_aluno'] = strtoupper($det_pessoa_fj['nome']); | 149 | $registro['nome_aluno'] = strtoupper($det_pessoa_fj['nome']); |
146 | $registro['cpf'] = int2IdFederal($det_fisica['cpf']); | 150 | $registro['cpf'] = int2IdFederal($det_fisica['cpf']); |
147 | $registro['data_nasc'] = dataToBrasil($det_fisica['data_nasc']); | 151 | $registro['data_nasc'] = dataToBrasil($det_fisica['data_nasc']); |
@@ -386,9 +390,11 @@ class indice extends clsDetalhe | @@ -386,9 +390,11 @@ class indice extends clsDetalhe | ||
386 | if ($caminhoFoto!=null and $caminhoFoto!='') | 390 | if ($caminhoFoto!=null and $caminhoFoto!='') |
387 | $this->addDetalhe(array('Nome Aluno', $registro['nome_aluno'].'<p><img height="117" src="'.$caminhoFoto.'"/></p>')); | 391 | $this->addDetalhe(array('Nome Aluno', $registro['nome_aluno'].'<p><img height="117" src="'.$caminhoFoto.'"/></p>')); |
388 | else | 392 | else |
389 | - $this->addDetalhe(array('Nome Aluno', $registro['nome_aluno'])); | 393 | + $this->addDetalhe(array('Nome Aluno', $registro['nome_aluno'])); |
390 | } | 394 | } |
391 | 395 | ||
396 | + | ||
397 | + | ||
392 | if (idFederal2int($registro['cpf'])) { | 398 | if (idFederal2int($registro['cpf'])) { |
393 | $this->addDetalhe(array('CPF', $registro['cpf'])); | 399 | $this->addDetalhe(array('CPF', $registro['cpf'])); |
394 | } | 400 | } |
@@ -669,6 +675,167 @@ class indice extends clsDetalhe | @@ -669,6 +675,167 @@ class indice extends clsDetalhe | ||
669 | ); | 675 | ); |
670 | } | 676 | } |
671 | 677 | ||
678 | + $objFichaMedica = new clsModulesFichaMedicaAluno($this->cod_aluno); | ||
679 | + $reg = $objFichaMedica->detalhe(); | ||
680 | + | ||
681 | + if($reg){ | ||
682 | + | ||
683 | + $this->addDetalhe(array('<span id="fmedica"></span>Altura/metro', $reg['altura'])); | ||
684 | + if (trim($reg['peso'])!='') $this->addDetalhe(array('Peso/kg', $reg['peso'])); | ||
685 | + if (trim($reg['grupo_sanguineo'])!='') $this->addDetalhe(array('Grupo sanguíneo', $reg['grupo_sanguineo'])); | ||
686 | + if (trim($reg['fator_rh'])!='') $this->addDetalhe(array('Fator RH', $reg['fator_rh'])); | ||
687 | + $this->addDetalhe(array('Possui alergia a algum medicamento', ($reg['alergia_medicamento'] == 'S' ? 'Sim': 'Não') )); | ||
688 | + if (trim($reg['desc_alergia_medicamento'])!='') $this->addDetalhe(array('Quais', $reg['desc_alergia_medicamento'])); | ||
689 | + $this->addDetalhe(array('Possui alergia a algum alimento', ($reg['alergia_alimento'] == 'S' ? 'Sim': 'Não') )); | ||
690 | + if (trim($reg['desc_alergia_alimento'])!='') $this->addDetalhe(array('Quais', $reg['desc_alergia_alimento'])); | ||
691 | + $this->addDetalhe(array('Possui alguma doenca congênita', ($reg['doenca_congenita'] == 'S' ? 'Sim': 'Não') )); | ||
692 | + if (trim($reg['desc_doenca_congenita'])!='') $this->addDetalhe(array('Quais', $reg['desc_doenca_congenita'])); | ||
693 | + $this->addDetalhe(array('É fumante', ($reg['fumante'] == 'S' ? 'Sim': 'Não') )); | ||
694 | + $this->addDetalhe(array('Já contraiu caxumba', ($reg['doenca_caxumba'] == 'S' ? 'Sim': 'Não') )); | ||
695 | + $this->addDetalhe(array('Já contraiu sarampo', ($reg['doenca_sarampo'] == 'S' ? 'Sim': 'Não') )); | ||
696 | + $this->addDetalhe(array('Já contraiu rubeola', ($reg['doenca_rubeola'] == 'S' ? 'Sim': 'Não') )); | ||
697 | + $this->addDetalhe(array('Já contraiu catapora', ($reg['doenca_catapora'] == 'S' ? 'Sim': 'Não') )); | ||
698 | + $this->addDetalhe(array('Já contraiu escarlatina', ($reg['doenca_escarlatina'] == 'S' ? 'Sim': 'Não') )); | ||
699 | + $this->addDetalhe(array('Já contraiu coqueluche', ($reg['doenca_coqueluche'] == 'S' ? 'Sim': 'Não') )); | ||
700 | + if (trim($reg['doenca_outras'])!='') $this->addDetalhe(array('Outras doenças que o aluno já contraiu', $reg['doenca_outras'])); | ||
701 | + $this->addDetalhe(array('Epilético', ($reg['epiletico'] == 'S' ? 'Sim': 'Não') )); | ||
702 | + $this->addDetalhe(array('Está em tratamento', ($reg['epiletico_tratamento'] == 'S' ? 'Sim': 'Não') )); | ||
703 | + $this->addDetalhe(array('Hemofílico', ($reg['hemofilico'] == 'S' ? 'Sim': 'Não') )); | ||
704 | + $this->addDetalhe(array('Hipertenso', ($reg['hipertenso'] == 'S' ? 'Sim': 'Não') )); | ||
705 | + $this->addDetalhe(array('Asmático', ($reg['asmatico'] == 'S' ? 'Sim': 'Não') )); | ||
706 | + $this->addDetalhe(array('Diabético', ($reg['diabetico'] == 'S' ? 'Sim': 'Não') )); | ||
707 | + $this->addDetalhe(array('Depende de insulina', ($reg['insulina'] == 'S' ? 'Sim': 'Não') )); | ||
708 | + $this->addDetalhe(array('Faz tratamento médico', ($reg['tratamento_medico'] == 'S' ? 'Sim': 'Não') )); | ||
709 | + if (trim($reg['desc_tratamento_medico'])!='') $this->addDetalhe(array('Qual', $reg['desc_tratamento_medico'])); | ||
710 | + $this->addDetalhe(array('Ingere medicação específica', ($reg['medicacao_especifica'] == 'S' ? 'Sim': 'Não') )); | ||
711 | + if (trim($reg['desc_medicacao_especifica'])!='') $this->addDetalhe(array('Qual', $reg['desc_medicacao_especifica'])); | ||
712 | + $this->addDetalhe(array('Acompanhamento médico ou psicológico', ($reg['acomp_medico_psicologico'] == 'S' ? 'Sim': 'Não') )); | ||
713 | + if (trim($reg['desc_acomp_medico_psicologico'])!='') $this->addDetalhe(array('Motivo', $reg['desc_acomp_medico_psicologico'])); | ||
714 | + $this->addDetalhe(array('Restrição para atividades físicas', ($reg['restricao_atividade_fisica'] == 'S' ? 'Sim': 'Não') )); | ||
715 | + if (trim($reg['desc_restricao_atividade_fisica'])!='') $this->addDetalhe(array('Qual', $reg['desc_restricao_atividade_fisica'])); | ||
716 | + $this->addDetalhe(array('Teve alguma fratura ou trauma', ($reg['fratura_trauma'] == 'S' ? 'Sim': 'Não') )); | ||
717 | + if (trim($reg['desc_fratura_trauma'])!='') $this->addDetalhe(array('Qual', $reg['desc_fratura_trauma'])); | ||
718 | + $this->addDetalhe(array('Tem plano de saúde', ($reg['plano_saude'] == 'S' ? 'Sim': 'Não') )); | ||
719 | + if (trim($reg['desc_plano_saude'])!='') $this->addDetalhe(array('Qual', $reg['desc_plano_saude'])); | ||
720 | + $this->addDetalhe(array('<span id="tit_dados_hospital">Em caso de emergência, levar para hospital ou clínica</span>')); | ||
721 | + $this->addDetalhe(array('Nome', $reg['hospital_clinica'])); | ||
722 | + $this->addDetalhe(array('Endereco', $reg['hospital_clinica_endereco'])); | ||
723 | + $this->addDetalhe(array('Telefone', $reg['hospital_clinica_telefone'])); | ||
724 | + $this->addDetalhe(array('<span id="tit_dados_responsavel">Em caso de emergência, se não for possível contatar os responsáveis, comunicar</span>')); | ||
725 | + $this->addDetalhe(array('Nome', $reg['responsavel'])); | ||
726 | + $this->addDetalhe(array('Parentesco', $reg['responsavel_parentesco'])); | ||
727 | + $this->addDetalhe(array('Telefone', $reg['responsavel_parentesco_telefone'])); | ||
728 | + $this->addDetalhe(array('Celular', $reg['responsavel_parentesco_celular'])); | ||
729 | + | ||
730 | + } | ||
731 | + | ||
732 | + $objUniforme = new clsModulesUniformeAluno($this->cod_aluno); | ||
733 | + $reg = $objUniforme->detalhe(); | ||
734 | + | ||
735 | + if($reg){ | ||
736 | + $this->addDetalhe(array('<span id="funiforme"></span>Recebeu uniforme escolar', ($reg['recebeu_uniforme'] == 'S' ? 'Sim': 'Não') )); | ||
737 | + $this->addDetalhe(array('<span class="tit_uniforme">Camiseta</span>')); | ||
738 | + $this->addDetalhe(array('Quantidade', $reg['quantidade_camiseta'])); | ||
739 | + $this->addDetalhe(array('Tamanho', $reg['tamanho_camiseta'])); | ||
740 | + $this->addDetalhe(array('<span class="tit_uniforme">Blusa/Jaqueta</span>')); | ||
741 | + $this->addDetalhe(array('Quantidade', $reg['quantidade_blusa_jaqueta'])); | ||
742 | + $this->addDetalhe(array('Tamanho', $reg['tamanho_blusa_jaqueta'])); | ||
743 | + $this->addDetalhe(array('<span class="tit_uniforme">Bermuda</span>')); | ||
744 | + $this->addDetalhe(array('Quantidade', $reg['quantidade_bermuda'])); | ||
745 | + $this->addDetalhe(array('Tamanho', $reg['tamanho_bermuda'])); | ||
746 | + $this->addDetalhe(array('<span class="tit_uniforme">Calça</span>')); | ||
747 | + $this->addDetalhe(array('Quantidade', $reg['quantidade_calca'])); | ||
748 | + $this->addDetalhe(array('Tamanho', $reg['tamanho_calca'])); | ||
749 | + $this->addDetalhe(array('<span class="tit_uniforme">Saia</span>')); | ||
750 | + $this->addDetalhe(array('Quantidade', $reg['quantidade_saia'])); | ||
751 | + $this->addDetalhe(array('Tamanho', $reg['tamanho_saia'])); | ||
752 | + $this->addDetalhe(array('<span class="tit_uniforme">Calçado</span>')); | ||
753 | + $this->addDetalhe(array('Quantidade', $reg['quantidade_calcado'])); | ||
754 | + $this->addDetalhe(array('Tamanho', $reg['tamanho_calcado'])); | ||
755 | + $this->addDetalhe(array('<span class="tit_uniforme">Meia</span>')); | ||
756 | + $this->addDetalhe(array('Quantidade', $reg['quantidade_meia'])); | ||
757 | + $this->addDetalhe(array('Tamanho', $reg['tamanho_meia'])); | ||
758 | + } | ||
759 | + | ||
760 | + $objMoradia = new clsModulesMoradiaAluno($this->cod_aluno); | ||
761 | + $reg = $objMoradia->detalhe(); | ||
762 | + | ||
763 | + if($reg){ | ||
764 | + | ||
765 | + $moradia = ''; | ||
766 | + switch ($reg['moradia']) { | ||
767 | + case 'A': | ||
768 | + $moradia = 'Apartamento'; | ||
769 | + break; | ||
770 | + case 'C': | ||
771 | + $moradia = 'Casa'; | ||
772 | + switch ($reg['material']) { | ||
773 | + case 'A': | ||
774 | + $moradia.= ' de alvenaria'; | ||
775 | + break; | ||
776 | + case 'M': | ||
777 | + $moradia.= ' de madeira'; | ||
778 | + break; | ||
779 | + case 'I': | ||
780 | + $moradia.= ' mista'; | ||
781 | + break; | ||
782 | + } | ||
783 | + break; | ||
784 | + case 'O': | ||
785 | + $moradia = 'Outra: '.$reg['casa_outra']; | ||
786 | + break; | ||
787 | + default: | ||
788 | + $moradia = 'Não informado'; | ||
789 | + } | ||
790 | + | ||
791 | + $this->addDetalhe(array('<span id="fmoradia"></span>Moradia', $moradia )); | ||
792 | + $situacao; | ||
793 | + switch ($reg['moradia_situacao']) { | ||
794 | + case 1: | ||
795 | + $situacao = 'Alugado'; | ||
796 | + break; | ||
797 | + case 2: | ||
798 | + $situacao = 'Próprio'; | ||
799 | + break; | ||
800 | + case 3: | ||
801 | + $situacao = 'Cedido'; | ||
802 | + break; | ||
803 | + case 4: | ||
804 | + $situacao = 'Financiado'; | ||
805 | + break; | ||
806 | + case 5: | ||
807 | + $situacao = 'Outra'; | ||
808 | + break; | ||
809 | + } | ||
810 | + $this->addDetalhe(array('Situação', $situacao)); | ||
811 | + $this->addDetalhe(array('Quantidade de quartos', $reg['quartos'])); | ||
812 | + $this->addDetalhe(array('Quantidade de salas', $reg['sala'])); | ||
813 | + $this->addDetalhe(array('Quantidade de copas', $reg['copa'])); | ||
814 | + $this->addDetalhe(array('Quantidade de banheiros', $reg['banheiro'])); | ||
815 | + $this->addDetalhe(array('Quantidade de garagens', $reg['garagem'])); | ||
816 | + $this->addDetalhe(array('Possui empregada doméstica', $reg['empregada_domestica'])); | ||
817 | + $this->addDetalhe(array('Possui automóvel', $reg['automovel'])); | ||
818 | + $this->addDetalhe(array('Possui motocicleta', $reg['motocicleta'])); | ||
819 | + $this->addDetalhe(array('Possui computador', $reg['computador'])); | ||
820 | + $this->addDetalhe(array('Possui geladeira', $reg['geladeira'])); | ||
821 | + $this->addDetalhe(array('Possui fogão', $reg['fogao'])); | ||
822 | + $this->addDetalhe(array('Possui máquina de lavar', $reg['maquina_lavar'])); | ||
823 | + $this->addDetalhe(array('Possui microondas', $reg['microondas'])); | ||
824 | + $this->addDetalhe(array('Possui vídeo/dvd', $reg['video_dvd'])); | ||
825 | + $this->addDetalhe(array('Possui televisão', $reg['televisao'])); | ||
826 | + $this->addDetalhe(array('Possui celular', $reg['celular'])); | ||
827 | + $this->addDetalhe(array('Possui telefone', $reg['telefone'])); | ||
828 | + $this->addDetalhe(array('Quantidade de pessoas', $reg['quant_pessoas'])); | ||
829 | + $this->addDetalhe(array('Renda familiar', 'R$ '.$reg['renda'])); | ||
830 | + $this->addDetalhe(array('Possui água encanada', $reg['agua_encanada'])); | ||
831 | + $this->addDetalhe(array('Possui poço', $reg['poco'])); | ||
832 | + $this->addDetalhe(array('Possui energia elétrica', $reg['energia'])); | ||
833 | + $this->addDetalhe(array('Possui tratamento de esgoto', $reg['esgoto'])); | ||
834 | + $this->addDetalhe(array('Possui fossa', $reg['fossa'])); | ||
835 | + $this->addDetalhe(array('Possui coleta de lixo', $reg['lixo'])); | ||
836 | + | ||
837 | + } | ||
838 | + | ||
672 | $this->url_cancelar = 'educar_aluno_lst.php'; | 839 | $this->url_cancelar = 'educar_aluno_lst.php'; |
673 | $this->largura = '100%'; | 840 | $this->largura = '100%'; |
674 | 841 | ||
@@ -681,11 +848,15 @@ class indice extends clsDetalhe | @@ -681,11 +848,15 @@ class indice extends clsDetalhe | ||
681 | 848 | ||
682 | $scripts = array( | 849 | $scripts = array( |
683 | '/modules/Portabilis/Assets/Javascripts/Utils.js', | 850 | '/modules/Portabilis/Assets/Javascripts/Utils.js', |
684 | - '/modules/Portabilis/Assets/Javascripts/ClientApi.js', | 851 | + '/modules/Portabilis/Assets/Javascripts/ClientApi.js', |
685 | '/modules/Cadastro/Assets/Javascripts/AlunoShow.js' | 852 | '/modules/Cadastro/Assets/Javascripts/AlunoShow.js' |
686 | ); | 853 | ); |
687 | 854 | ||
688 | Portabilis_View_Helper_Application::loadJavascript($this, $scripts); | 855 | Portabilis_View_Helper_Application::loadJavascript($this, $scripts); |
856 | + | ||
857 | + $styles = array ('/modules/Cadastro/Assets/Stylesheets/Aluno.css'); | ||
858 | + | ||
859 | + Portabilis_View_Helper_Application::loadStylesheet($this, $styles); | ||
689 | } | 860 | } |
690 | } | 861 | } |
691 | 862 | ||
@@ -699,4 +870,4 @@ $miolo = new indice(); | @@ -699,4 +870,4 @@ $miolo = new indice(); | ||
699 | $pagina->addForm($miolo); | 870 | $pagina->addForm($miolo); |
700 | 871 | ||
701 | // Gera o HTML | 872 | // Gera o HTML |
702 | -$pagina->MakeAll(); | 873 | -$pagina->MakeAll(); |
874 | +$pagina->MakeAll(); | ||
703 | \ No newline at end of file | 875 | \ No newline at end of file |
ieducar/intranet/include/modules/clsModulesFichaMedicaAluno.inc.php
0 → 100644
@@ -0,0 +1,735 @@ | @@ -0,0 +1,735 @@ | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * i-Educar - Sistema de gestão escolar | ||
4 | + * | ||
5 | + * Copyright (C) 2006 Prefeitura Municipal de Itajaí | ||
6 | + * <ctima@itajai.sc.gov.br> | ||
7 | + * | ||
8 | + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo | ||
9 | + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free | ||
10 | + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) | ||
11 | + * qualquer versão posterior. | ||
12 | + * | ||
13 | + * Este programa é distribuído na expectativa de que seja útil, porém, SEM | ||
14 | + * NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU | ||
15 | + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral | ||
16 | + * do GNU para mais detalhes. | ||
17 | + * | ||
18 | + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto | ||
19 | + * com este programa; se não, escreva para a Free Software Foundation, Inc., no | ||
20 | + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
21 | + * | ||
22 | + * @author Lucas Schmoeller da Silva <lucas@portabilis.com.br> | ||
23 | + * @category i-Educar | ||
24 | + * @license @@license@@ | ||
25 | + * @package Module | ||
26 | + * @since 07/2013 | ||
27 | + * @version $Id$ | ||
28 | + */ | ||
29 | +require_once 'include/pmieducar/geral.inc.php'; | ||
30 | +/** | ||
31 | + * clsModulesFichaMedicaAluno class. | ||
32 | + * | ||
33 | + * @author Lucas Schmoeller da Silva <lucas@portabilis.com.br> | ||
34 | + * @category i-Educar | ||
35 | + * @license @@license@@ | ||
36 | + * @package Module | ||
37 | + * @since 09/2013 | ||
38 | + * @version @@package_version@@ | ||
39 | + */ | ||
40 | +class clsModulesFichaMedicaAluno | ||
41 | +{ | ||
42 | + var $ref_cod_aluno; | ||
43 | + var $altura; | ||
44 | + var $peso; | ||
45 | + var $grupo_sanguineo; | ||
46 | + var $fator_rh; | ||
47 | + var $alergia_medicamento; | ||
48 | + var $desc_alergia_medicamento; | ||
49 | + var $alergia_alimento; | ||
50 | + var $desc_alergia_alimento; | ||
51 | + var $doenca_congenita; | ||
52 | + var $desc_doenca_congenita; | ||
53 | + var $fumante; | ||
54 | + var $doenca_caxumba; | ||
55 | + var $doenca_sarampo; | ||
56 | + var $doenca_rubeola; | ||
57 | + var $doenca_catapora; | ||
58 | + var $doenca_escarlatina; | ||
59 | + var $doenca_coqueluche; | ||
60 | + var $doenca_outras; | ||
61 | + var $epiletico; | ||
62 | + var $epiletico_tratamento; | ||
63 | + var $hemofilico; | ||
64 | + var $hipertenso; | ||
65 | + var $asmatico; | ||
66 | + var $diabetico; | ||
67 | + var $insulina; | ||
68 | + var $tratamento_medico; | ||
69 | + var $desc_tratamento_medico; | ||
70 | + var $medicacao_especifica; | ||
71 | + var $desc_medicacao_especifica; | ||
72 | + var $acomp_medico_psicologico; | ||
73 | + var $desc_acomp_medico_psicologico; | ||
74 | + var $restricao_atividade_fisica; | ||
75 | + var $desc_restricao_atividade_fisica; | ||
76 | + var $fratura_trauma; | ||
77 | + var $desc_fratura_trauma; | ||
78 | + var $plano_saude; | ||
79 | + var $desc_plano_saude; | ||
80 | + var $hospital_clinica; | ||
81 | + var $hospital_clinica_endereco; | ||
82 | + var $hospital_clinica_telefone; | ||
83 | + var $responsavel; | ||
84 | + var $responsavel_parentesco; | ||
85 | + var $responsavel_parentesco_telefone; | ||
86 | + var $responsavel_parentesco_celular; | ||
87 | + /** | ||
88 | + * @var int | ||
89 | + * Armazena o total de resultados obtidos na última chamada ao método lista(). | ||
90 | + */ | ||
91 | + var $_total; | ||
92 | + /** | ||
93 | + * Nome do schema. | ||
94 | + * @var string | ||
95 | + */ | ||
96 | + var $_schema; | ||
97 | + /** | ||
98 | + * Nome da tabela. | ||
99 | + * @var string | ||
100 | + */ | ||
101 | + var $_tabela; | ||
102 | + /** | ||
103 | + * Lista separada por vírgula, com os campos que devem ser selecionados na | ||
104 | + * próxima chamado ao método lista(). | ||
105 | + * @var string | ||
106 | + */ | ||
107 | + var $_campos_lista; | ||
108 | + /** | ||
109 | + * Lista com todos os campos da tabela separados por vírgula, padrão para | ||
110 | + * seleção no método lista. | ||
111 | + * @var string | ||
112 | + */ | ||
113 | + var $_todos_campos; | ||
114 | + /** | ||
115 | + * Valor que define a quantidade de registros a ser retornada pelo método lista(). | ||
116 | + * @var int | ||
117 | + */ | ||
118 | + var $_limite_quantidade; | ||
119 | + /** | ||
120 | + * Define o valor de offset no retorno dos registros no método lista(). | ||
121 | + * @var int | ||
122 | + */ | ||
123 | + var $_limite_offset; | ||
124 | + /** | ||
125 | + * Define o campo para ser usado como padrão de ordenação no método lista(). | ||
126 | + * @var string | ||
127 | + */ | ||
128 | + var $_campo_order_by; | ||
129 | + /** | ||
130 | + * Construtor. | ||
131 | + */ | ||
132 | + function clsModulesFichaMedicaAluno( $ref_cod_aluno = NULL , $altura = NULL , $peso = NULL , $grupo_sanguineo = NULL , | ||
133 | + $fator_rh = NULL , $alergia_medicamento = NULL , $desc_alergia_medicamento = NULL , | ||
134 | + $alergia_alimento = NULL , $desc_alergia_alimento = NULL , $doenca_congenita = NULL , | ||
135 | + $desc_doenca_congenita = NULL , $fumante = NULL , $doenca_caxumba = NULL , $doenca_sarampo = NULL , | ||
136 | + $doenca_rubeola = NULL , $doenca_catapora = NULL , $doenca_escarlatina = NULL , $doenca_coqueluche = NULL , | ||
137 | + $doenca_outras = NULL , $epiletico = NULL , $epiletico_tratamento = NULL , $hemofilico = NULL , | ||
138 | + $hipertenso = NULL , $asmatico = NULL , $diabetico = NULL , $insulina = NULL , | ||
139 | + $tratamento_medico = NULL , $desc_tratamento_medico = NULL , $medicacao_especifica = NULL , | ||
140 | + $desc_medicacao_especifica = NULL , $acomp_medico_psicologico = NULL , $desc_acomp_medico_psicologico = NULL , | ||
141 | + $restricao_atividade_fisica = NULL , $desc_restricao_atividade_fisica = NULL , $fratura_trauma = NULL , | ||
142 | + $desc_fratura_trauma = NULL , $plano_saude = NULL , $desc_plano_saude = NULL , $hospital_clinica = NULL , | ||
143 | + $hospital_clinica_endereco = NULL , $hospital_clinica_telefone = NULL , $responsavel = NULL , | ||
144 | + $responsavel_parentesco = NULL , $responsavel_parentesco_telefone = NULL , $responsavel_parentesco_celular = NULL) | ||
145 | + { | ||
146 | + $db = new clsBanco(); | ||
147 | + $this->_schema = "modules."; | ||
148 | + $this->_tabela = "{$this->_schema}ficha_medica_aluno"; | ||
149 | + $this->_campos_lista = $this->_todos_campos = " ref_cod_aluno, altura, peso, grupo_sanguineo, | ||
150 | + fator_rh, alergia_medicamento, desc_alergia_medicamento,alergia_alimento, desc_alergia_alimento, | ||
151 | + doenca_congenita,desc_doenca_congenita, fumante, doenca_caxumba, doenca_sarampo,doenca_rubeola, | ||
152 | + doenca_catapora, doenca_escarlatina, doenca_coqueluche,doenca_outras, epiletico, | ||
153 | + epiletico_tratamento, hemofilico,hipertenso, asmatico, diabetico, insulina,tratamento_medico, | ||
154 | + desc_tratamento_medico, medicacao_especifica,desc_medicacao_especifica, acomp_medico_psicologico, | ||
155 | + desc_acomp_medico_psicologico,restricao_atividade_fisica, desc_restricao_atividade_fisica, | ||
156 | + fratura_trauma,desc_fratura_trauma, plano_saude, desc_plano_saude, hospital_clinica, | ||
157 | + hospital_clinica_endereco, hospital_clinica_telefone, responsavel,responsavel_parentesco, | ||
158 | + responsavel_parentesco_telefone, responsavel_parentesco_celular"; | ||
159 | + if (is_numeric($ref_cod_aluno)) { | ||
160 | + $this->ref_cod_aluno = $ref_cod_aluno; | ||
161 | + } | ||
162 | + if (is_string($altura)) { | ||
163 | + $this->altura = $altura; | ||
164 | + } | ||
165 | + if (is_string($peso)) { | ||
166 | + $this->peso = $peso; | ||
167 | + } | ||
168 | + if (is_string($grupo_sanguineo)) { | ||
169 | + $this->grupo_sanguineo = $grupo_sanguineo; | ||
170 | + } | ||
171 | + if (is_string($fator_rh)) { | ||
172 | + $this->fator_rh = $fator_rh; | ||
173 | + } | ||
174 | + if (is_string($alergia_medicamento)) { | ||
175 | + $this->alergia_medicamento = $alergia_medicamento; | ||
176 | + } | ||
177 | + if (is_string($desc_alergia_medicamento)) { | ||
178 | + $this->desc_alergia_medicamento = $desc_alergia_medicamento; | ||
179 | + } | ||
180 | + if (is_string($alergia_alimento)) { | ||
181 | + $this->alergia_alimento = $alergia_alimento; | ||
182 | + } | ||
183 | + if (is_string($desc_alergia_alimento)) { | ||
184 | + $this->desc_alergia_alimento = $desc_alergia_alimento; | ||
185 | + } | ||
186 | + if (is_string($doenca_congenita)) { | ||
187 | + $this->doenca_congenita = $doenca_congenita; | ||
188 | + } | ||
189 | + if (is_string($desc_doenca_congenita)) { | ||
190 | + $this->desc_doenca_congenita = $desc_doenca_congenita; | ||
191 | + } | ||
192 | + if (is_string($fumante)) { | ||
193 | + $this->fumante = $fumante; | ||
194 | + } | ||
195 | + if (is_string($doenca_caxumba)) { | ||
196 | + $this->doenca_caxumba = $doenca_caxumba; | ||
197 | + } | ||
198 | + if (is_string($doenca_sarampo)) { | ||
199 | + $this->doenca_sarampo = $doenca_sarampo; | ||
200 | + } | ||
201 | + if (is_string($doenca_rubeola)) { | ||
202 | + $this->doenca_rubeola = $doenca_rubeola; | ||
203 | + } | ||
204 | + if (is_string($doenca_catapora)) { | ||
205 | + $this->doenca_catapora = $doenca_catapora; | ||
206 | + } | ||
207 | + if (is_string($doenca_escarlatina)) { | ||
208 | + $this->doenca_escarlatina = $doenca_escarlatina; | ||
209 | + } | ||
210 | + if (is_string($doenca_coqueluche)) { | ||
211 | + $this->doenca_coqueluche = $doenca_coqueluche; | ||
212 | + } | ||
213 | + if (is_string($doenca_outras)) { | ||
214 | + $this->doenca_outras = $doenca_outras; | ||
215 | + } | ||
216 | + if (is_string($epiletico)) { | ||
217 | + $this->epiletico = $epiletico; | ||
218 | + } | ||
219 | + if (is_string($epiletico_tratamento)) { | ||
220 | + $this->epiletico_tratamento = $epiletico_tratamento; | ||
221 | + } | ||
222 | + if (is_string($hemofilico)) { | ||
223 | + $this->hemofilico = $hemofilico; | ||
224 | + } | ||
225 | + if (is_string($hipertenso)) { | ||
226 | + $this->hipertenso = $hipertenso; | ||
227 | + } | ||
228 | + if (is_string($asmatico)) { | ||
229 | + $this->asmatico = $asmatico; | ||
230 | + } | ||
231 | + if (is_string($diabetico)) { | ||
232 | + $this->diabetico = $diabetico; | ||
233 | + } | ||
234 | + if (is_string($insulina)) { | ||
235 | + $this->insulina = $insulina; | ||
236 | + } | ||
237 | + if (is_string($tratamento_medico)) { | ||
238 | + $this->tratamento_medico = $tratamento_medico; | ||
239 | + } | ||
240 | + if (is_string($desc_tratamento_medico)) { | ||
241 | + $this->desc_tratamento_medico = $desc_tratamento_medico; | ||
242 | + } | ||
243 | + if (is_string($medicacao_especifica)) { | ||
244 | + $this->medicacao_especifica = $medicacao_especifica; | ||
245 | + } | ||
246 | + if (is_string($desc_medicacao_especifica)) { | ||
247 | + $this->desc_medicacao_especifica = $desc_medicacao_especifica; | ||
248 | + } | ||
249 | + if (is_string($acomp_medico_psicologico)) { | ||
250 | + $this->acomp_medico_psicologico = $acomp_medico_psicologico; | ||
251 | + } | ||
252 | + if (is_string($desc_acomp_medico_psicologico)) { | ||
253 | + $this->desc_acomp_medico_psicologico = $desc_acomp_medico_psicologico; | ||
254 | + } | ||
255 | + if (is_string($restricao_atividade_fisica)) { | ||
256 | + $this->restricao_atividade_fisica = $restricao_atividade_fisica; | ||
257 | + } | ||
258 | + if (is_string($desc_restricao_atividade_fisica)) { | ||
259 | + $this->desc_restricao_atividade_fisica = $desc_restricao_atividade_fisica; | ||
260 | + } | ||
261 | + if (is_string($fratura_trauma)) { | ||
262 | + $this->fratura_trauma = $fratura_trauma; | ||
263 | + } | ||
264 | + if (is_string($desc_fratura_trauma)) { | ||
265 | + $this->desc_fratura_trauma = $desc_fratura_trauma; | ||
266 | + } | ||
267 | + if (is_string($plano_saude)) { | ||
268 | + $this->plano_saude = $plano_saude; | ||
269 | + } | ||
270 | + if (is_string($desc_plano_saude)) { | ||
271 | + $this->desc_plano_saude = $desc_plano_saude; | ||
272 | + } | ||
273 | + if (is_string($hospital_clinica)) { | ||
274 | + $this->hospital_clinica = $hospital_clinica; | ||
275 | + } | ||
276 | + if (is_string($hospital_clinica_endereco)) { | ||
277 | + $this->hospital_clinica_endereco = $hospital_clinica_endereco; | ||
278 | + } | ||
279 | + if (is_string($hospital_clinica_telefone)) { | ||
280 | + $this->hospital_clinica_telefone = $hospital_clinica_telefone; | ||
281 | + } | ||
282 | + if (is_string($responsavel)) { | ||
283 | + $this->responsavel = $responsavel; | ||
284 | + } | ||
285 | + if (is_string($responsavel_parentesco)) { | ||
286 | + $this->responsavel_parentesco = $responsavel_parentesco; | ||
287 | + } | ||
288 | + if (is_string($responsavel_parentesco_telefone)) { | ||
289 | + $this->responsavel_parentesco_telefone = $responsavel_parentesco_telefone; | ||
290 | + } | ||
291 | + if (is_string($responsavel_parentesco_celular)) { | ||
292 | + $this->responsavel_parentesco_celular = $responsavel_parentesco_celular; | ||
293 | + } | ||
294 | + } | ||
295 | + /** | ||
296 | + * Cria um novo registro. | ||
297 | + * @return bool | ||
298 | + */ | ||
299 | + function cadastra() | ||
300 | + { | ||
301 | + if (is_numeric($this->ref_cod_aluno)) | ||
302 | + { | ||
303 | + $db = new clsBanco(); | ||
304 | + $campos = ''; | ||
305 | + $valores = ''; | ||
306 | + $gruda = ''; | ||
307 | + $campos .= "{$gruda}ref_cod_aluno"; | ||
308 | + $valores .= "{$gruda}{$this->ref_cod_aluno}"; | ||
309 | + $gruda = ", "; | ||
310 | + $campos .= "{$gruda}altura"; | ||
311 | + $valores .= "{$gruda}'{$this->altura}'"; | ||
312 | + $gruda = ", "; | ||
313 | + | ||
314 | + $campos .= "{$gruda}peso"; | ||
315 | + $valores .= "{$gruda}'{$this->peso}'"; | ||
316 | + $gruda = ", "; | ||
317 | + | ||
318 | + $campos .= "{$gruda}grupo_sanguineo"; | ||
319 | + $valores .= "{$gruda}'{$this->grupo_sanguineo}'"; | ||
320 | + $gruda = ", "; | ||
321 | + | ||
322 | + $campos .= "{$gruda}fator_rh"; | ||
323 | + $valores .= "{$gruda}'{$this->fator_rh}'"; | ||
324 | + $gruda = ", "; | ||
325 | + | ||
326 | + $campos .= "{$gruda}alergia_medicamento"; | ||
327 | + $valores .= "{$gruda}'{$this->alergia_medicamento}'"; | ||
328 | + $gruda = ", "; | ||
329 | + | ||
330 | + $campos .= "{$gruda}desc_alergia_medicamento"; | ||
331 | + $valores .= "{$gruda}'{$this->desc_alergia_medicamento}'"; | ||
332 | + $gruda = ", "; | ||
333 | + | ||
334 | + $campos .= "{$gruda}alergia_alimento"; | ||
335 | + $valores .= "{$gruda}'{$this->alergia_alimento}'"; | ||
336 | + $gruda = ", "; | ||
337 | + | ||
338 | + $campos .= "{$gruda}desc_alergia_alimento"; | ||
339 | + $valores .= "{$gruda}'{$this->desc_alergia_alimento}'"; | ||
340 | + $gruda = ", "; | ||
341 | + | ||
342 | + $campos .= "{$gruda}doenca_congenita"; | ||
343 | + $valores .= "{$gruda}'{$this->doenca_congenita}'"; | ||
344 | + $gruda = ", "; | ||
345 | + | ||
346 | + $campos .= "{$gruda}desc_doenca_congenita"; | ||
347 | + $valores .= "{$gruda}'{$this->desc_doenca_congenita}'"; | ||
348 | + $gruda = ", "; | ||
349 | + | ||
350 | + $campos .= "{$gruda}fumante"; | ||
351 | + $valores .= "{$gruda}'{$this->fumante}'"; | ||
352 | + $gruda = ", "; | ||
353 | + | ||
354 | + $campos .= "{$gruda}doenca_caxumba"; | ||
355 | + $valores .= "{$gruda}'{$this->doenca_caxumba}'"; | ||
356 | + $gruda = ", "; | ||
357 | + | ||
358 | + $campos .= "{$gruda}doenca_sarampo"; | ||
359 | + $valores .= "{$gruda}'{$this->doenca_sarampo}'"; | ||
360 | + $gruda = ", "; | ||
361 | + | ||
362 | + $campos .= "{$gruda}doenca_rubeola"; | ||
363 | + $valores .= "{$gruda}'{$this->doenca_rubeola}'"; | ||
364 | + $gruda = ", "; | ||
365 | + | ||
366 | + $campos .= "{$gruda}doenca_catapora"; | ||
367 | + $valores .= "{$gruda}'{$this->doenca_catapora}'"; | ||
368 | + $gruda = ", "; | ||
369 | + | ||
370 | + $campos .= "{$gruda}doenca_escarlatina"; | ||
371 | + $valores .= "{$gruda}'{$this->doenca_escarlatina}'"; | ||
372 | + $gruda = ", "; | ||
373 | + | ||
374 | + $campos .= "{$gruda}doenca_coqueluche"; | ||
375 | + $valores .= "{$gruda}'{$this->doenca_coqueluche}'"; | ||
376 | + $gruda = ", "; | ||
377 | + | ||
378 | + $campos .= "{$gruda}doenca_outras"; | ||
379 | + $valores .= "{$gruda}'{$this->doenca_outras}'"; | ||
380 | + $gruda = ", "; | ||
381 | + | ||
382 | + $campos .= "{$gruda}epiletico"; | ||
383 | + $valores .= "{$gruda}'{$this->epiletico}'"; | ||
384 | + $gruda = ", "; | ||
385 | + | ||
386 | + $campos .= "{$gruda}epiletico_tratamento"; | ||
387 | + $valores .= "{$gruda}'{$this->epiletico_tratamento}'"; | ||
388 | + $gruda = ", "; | ||
389 | + | ||
390 | + $campos .= "{$gruda}hemofilico"; | ||
391 | + $valores .= "{$gruda}'{$this->hemofilico}'"; | ||
392 | + $gruda = ", "; | ||
393 | + | ||
394 | + $campos .= "{$gruda}hipertenso"; | ||
395 | + $valores .= "{$gruda}'{$this->hipertenso}'"; | ||
396 | + $gruda = ", "; | ||
397 | + | ||
398 | + $campos .= "{$gruda}asmatico"; | ||
399 | + $valores .= "{$gruda}'{$this->asmatico}'"; | ||
400 | + $gruda = ", "; | ||
401 | + | ||
402 | + $campos .= "{$gruda}diabetico"; | ||
403 | + $valores .= "{$gruda}'{$this->diabetico}'"; | ||
404 | + $gruda = ", "; | ||
405 | + | ||
406 | + $campos .= "{$gruda}insulina"; | ||
407 | + $valores .= "{$gruda}'{$this->insulina}'"; | ||
408 | + $gruda = ", "; | ||
409 | + | ||
410 | + $campos .= "{$gruda}tratamento_medico"; | ||
411 | + $valores .= "{$gruda}'{$this->tratamento_medico}'"; | ||
412 | + $gruda = ", "; | ||
413 | + | ||
414 | + $campos .= "{$gruda}desc_tratamento_medico"; | ||
415 | + $valores .= "{$gruda}'{$this->desc_tratamento_medico}'"; | ||
416 | + $gruda = ", "; | ||
417 | + | ||
418 | + $campos .= "{$gruda}medicacao_especifica"; | ||
419 | + $valores .= "{$gruda}'{$this->medicacao_especifica}'"; | ||
420 | + $gruda = ", "; | ||
421 | + | ||
422 | + $campos .= "{$gruda}desc_medicacao_especifica"; | ||
423 | + $valores .= "{$gruda}'{$this->desc_medicacao_especifica}'"; | ||
424 | + $gruda = ", "; | ||
425 | + | ||
426 | + $campos .= "{$gruda}acomp_medico_psicologico"; | ||
427 | + $valores .= "{$gruda}'{$this->acomp_medico_psicologico}'"; | ||
428 | + $gruda = ", "; | ||
429 | + | ||
430 | + $campos .= "{$gruda}desc_acomp_medico_psicologico"; | ||
431 | + $valores .= "{$gruda}'{$this->desc_acomp_medico_psicologico}'"; | ||
432 | + $gruda = ", "; | ||
433 | + | ||
434 | + $campos .= "{$gruda}restricao_atividade_fisica"; | ||
435 | + $valores .= "{$gruda}'{$this->restricao_atividade_fisica}'"; | ||
436 | + $gruda = ", "; | ||
437 | + | ||
438 | + $campos .= "{$gruda}desc_restricao_atividade_fisica"; | ||
439 | + $valores .= "{$gruda}'{$this->desc_restricao_atividade_fisica}'"; | ||
440 | + $gruda = ", "; | ||
441 | + | ||
442 | + $campos .= "{$gruda}fratura_trauma"; | ||
443 | + $valores .= "{$gruda}'{$this->fratura_trauma}'"; | ||
444 | + $gruda = ", "; | ||
445 | + | ||
446 | + $campos .= "{$gruda}desc_fratura_trauma"; | ||
447 | + $valores .= "{$gruda}'{$this->desc_fratura_trauma}'"; | ||
448 | + $gruda = ", "; | ||
449 | + | ||
450 | + $campos .= "{$gruda}plano_saude"; | ||
451 | + $valores .= "{$gruda}'{$this->plano_saude}'"; | ||
452 | + $gruda = ", "; | ||
453 | + | ||
454 | + $campos .= "{$gruda}desc_plano_saude"; | ||
455 | + $valores .= "{$gruda}'{$this->desc_plano_saude}'"; | ||
456 | + $gruda = ", "; | ||
457 | + | ||
458 | + $campos .= "{$gruda}hospital_clinica"; | ||
459 | + $valores .= "{$gruda}'{$this->hospital_clinica}'"; | ||
460 | + $gruda = ", "; | ||
461 | + | ||
462 | + $campos .= "{$gruda}hospital_clinica_endereco"; | ||
463 | + $valores .= "{$gruda}'{$this->hospital_clinica_endereco}'"; | ||
464 | + $gruda = ", "; | ||
465 | + | ||
466 | + $campos .= "{$gruda}hospital_clinica_telefone"; | ||
467 | + $valores .= "{$gruda}'{$this->hospital_clinica_telefone}'"; | ||
468 | + $gruda = ", "; | ||
469 | + | ||
470 | + $campos .= "{$gruda}responsavel"; | ||
471 | + $valores .= "{$gruda}'{$this->responsavel}'"; | ||
472 | + $gruda = ", "; | ||
473 | + | ||
474 | + $campos .= "{$gruda}responsavel_parentesco"; | ||
475 | + $valores .= "{$gruda}'{$this->responsavel_parentesco}'"; | ||
476 | + $gruda = ", "; | ||
477 | + | ||
478 | + $campos .= "{$gruda}responsavel_parentesco_celular"; | ||
479 | + $valores .= "{$gruda}'{$this->responsavel_parentesco_celular}'"; | ||
480 | + $gruda = ", "; | ||
481 | + | ||
482 | + $campos .= "{$gruda}responsavel_parentesco_telefone"; | ||
483 | + $valores .= "{$gruda}'{$this->responsavel_parentesco_telefone}'"; | ||
484 | + $gruda = ", "; | ||
485 | + | ||
486 | + $db->Consulta("INSERT INTO {$this->_tabela} ( $campos ) VALUES( $valores )"); | ||
487 | + return $this->ref_cod_aluno; | ||
488 | + } | ||
489 | + return FALSE; | ||
490 | + } | ||
491 | + /** | ||
492 | + * Edita os dados de um registro. | ||
493 | + * @return bool | ||
494 | + */ | ||
495 | + function edita() | ||
496 | + { | ||
497 | + if (is_numeric($this->ref_cod_aluno)) { | ||
498 | + $db = new clsBanco(); | ||
499 | + $set = ''; | ||
500 | + $set .= "altura = '{$this->altura}'"; | ||
501 | + | ||
502 | + $set .= ",peso = '{$this->peso}'"; | ||
503 | + | ||
504 | + $set .= ",grupo_sanguineo = '{$this->grupo_sanguineo}'"; | ||
505 | + | ||
506 | + $set .= ",fator_rh = '{$this->fator_rh}'"; | ||
507 | + | ||
508 | + $set .= ",alergia_medicamento = '{$this->alergia_medicamento}'"; | ||
509 | + | ||
510 | + $set .= ",desc_alergia_medicamento = '{$this->desc_alergia_medicamento}'"; | ||
511 | + | ||
512 | + $set .= ",alergia_alimento = '{$this->alergia_alimento}'"; | ||
513 | + | ||
514 | + $set .= ",desc_alergia_alimento = '{$this->desc_alergia_alimento}'"; | ||
515 | + | ||
516 | + $set .= ",doenca_congenita = '{$this->doenca_congenita}'"; | ||
517 | + | ||
518 | + $set .= ",desc_doenca_congenita = '{$this->desc_doenca_congenita}'"; | ||
519 | + | ||
520 | + $set .= ",fumante = '{$this->fumante}'"; | ||
521 | + | ||
522 | + $set .= ",doenca_caxumba = '{$this->doenca_caxumba}'"; | ||
523 | + | ||
524 | + $set .= ",doenca_sarampo = '{$this->doenca_sarampo}'"; | ||
525 | + | ||
526 | + $set .= ",doenca_rubeola = '{$this->doenca_rubeola}'"; | ||
527 | + | ||
528 | + $set .= ",doenca_catapora = '{$this->doenca_catapora}'"; | ||
529 | + | ||
530 | + $set .= ",doenca_escarlatina = '{$this->doenca_escarlatina}'"; | ||
531 | + | ||
532 | + $set .= ",doenca_coqueluche = '{$this->doenca_coqueluche}'"; | ||
533 | + | ||
534 | + $set .= ",doenca_outras = '{$this->doenca_outras}'"; | ||
535 | + | ||
536 | + $set .= ",epiletico = '{$this->epiletico}'"; | ||
537 | + $set .= ",epiletico_tratamento = '{$this->epiletico_tratamento}'"; | ||
538 | + | ||
539 | + $set .= ",hemofilico = '{$this->hemofilico}'"; | ||
540 | + | ||
541 | + $set .= ",hipertenso = '{$this->hipertenso}'"; | ||
542 | + | ||
543 | + $set .= ",asmatico = '{$this->asmatico}'"; | ||
544 | + | ||
545 | + $set .= ",diabetico = '{$this->diabetico}'"; | ||
546 | + | ||
547 | + $set .= ",insulina = '{$this->insulina}'"; | ||
548 | + | ||
549 | + $set .= ",tratamento_medico = '{$this->tratamento_medico}'"; | ||
550 | + | ||
551 | + $set .= ",desc_tratamento_medico = '{$this->desc_tratamento_medico}'"; | ||
552 | + | ||
553 | + $set .= ",medicacao_especifica = '{$this->medicacao_especifica}'"; | ||
554 | + | ||
555 | + $set .= ",desc_medicacao_especifica = '{$this->desc_medicacao_especifica}'"; | ||
556 | + | ||
557 | + $set .= ",acomp_medico_psicologico = '{$this->acomp_medico_psicologico}'"; | ||
558 | + | ||
559 | + $set .= ",desc_acomp_medico_psicologico = '{$this->desc_acomp_medico_psicologico}'"; | ||
560 | + | ||
561 | + $set .= ",restricao_atividade_fisica = '{$this->restricao_atividade_fisica}'"; | ||
562 | + | ||
563 | + $set .= ",desc_restricao_atividade_fisica = '{$this->desc_restricao_atividade_fisica}'"; | ||
564 | + | ||
565 | + $set .= ",fratura_trauma = '{$this->fratura_trauma}'"; | ||
566 | + | ||
567 | + $set .= ",desc_fratura_trauma = '{$this->desc_fratura_trauma}'"; | ||
568 | + | ||
569 | + $set .= ",plano_saude = '{$this->plano_saude}'"; | ||
570 | + | ||
571 | + $set .= ",desc_plano_saude = '{$this->desc_plano_saude}'"; | ||
572 | + | ||
573 | + $set .= ",hospital_clinica = '{$this->hospital_clinica}'"; | ||
574 | + | ||
575 | + $set .= ",hospital_clinica_endereco = '{$this->hospital_clinica_endereco}'"; | ||
576 | + | ||
577 | + $set .= ",hospital_clinica_telefone = '{$this->hospital_clinica_telefone}'"; | ||
578 | + | ||
579 | + $set .= ",responsavel = '{$this->responsavel}'"; | ||
580 | + | ||
581 | + $set .= ",responsavel_parentesco = '{$this->responsavel_parentesco}'"; | ||
582 | + | ||
583 | + $set .= ",responsavel_parentesco_telefone = '{$this->responsavel_parentesco_telefone}'"; | ||
584 | + | ||
585 | + $set .= ",responsavel_parentesco_celular = '{$this->responsavel_parentesco_celular}'"; | ||
586 | + | ||
587 | + if ($set) { | ||
588 | + $db->Consulta("UPDATE {$this->_tabela} SET $set WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); | ||
589 | + return TRUE; | ||
590 | + } | ||
591 | + } | ||
592 | + return FALSE; | ||
593 | + } | ||
594 | + /** | ||
595 | + * Retorna uma lista de registros filtrados de acordo com os parâmetros. | ||
596 | + * @return array | ||
597 | + */ | ||
598 | + function lista() | ||
599 | + { | ||
600 | + $sql = "SELECT {$this->_campos_lista} FROM {$this->_tabela}"; | ||
601 | + $filtros = ""; | ||
602 | + /* | ||
603 | + $whereAnd = " WHERE "; | ||
604 | + if (is_string($altura)) { | ||
605 | + $filtros .= "{$whereAnd} TO_ASCII(LOWER(altura)) LIKE TO_ASCII(LOWER('%{$altura}%'))"; | ||
606 | + $whereAnd = " AND "; | ||
607 | + }*/ | ||
608 | + $db = new clsBanco(); | ||
609 | + $countCampos = count(explode(',', $this->_campos_lista))+2; | ||
610 | + $resultado = array(); | ||
611 | + $sql .= $filtros . $this->getOrderby() . $this->getLimite(); | ||
612 | + $this->_total = $db->CampoUnico("SELECT COUNT(0) FROM {$this->_tabela} {$filtros}"); | ||
613 | + $db->Consulta($sql); | ||
614 | + if ($countCampos > 1) { | ||
615 | + while ($db->ProximoRegistro()) { | ||
616 | + $tupla = $db->Tupla(); | ||
617 | + $tupla["_total"] = $this->_total; | ||
618 | + $resultado[] = $tupla; | ||
619 | + } | ||
620 | + } | ||
621 | + else { | ||
622 | + while ($db->ProximoRegistro()) { | ||
623 | + $tupla = $db->Tupla(); | ||
624 | + $resultado[] = $tupla[$this->_campos_lista]; | ||
625 | + } | ||
626 | + } | ||
627 | + if (count($resultado)) { | ||
628 | + return $resultado; | ||
629 | + } | ||
630 | + return FALSE; | ||
631 | + } | ||
632 | + /** | ||
633 | + * Retorna um array com os dados de um registro. | ||
634 | + * @return array | ||
635 | + */ | ||
636 | + function detalhe() | ||
637 | + { | ||
638 | + if (is_numeric($this->ref_cod_aluno)) { | ||
639 | + $db = new clsBanco(); | ||
640 | + $db->Consulta("SELECT {$this->_todos_campos} FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); | ||
641 | + $db->ProximoRegistro(); | ||
642 | + return $db->Tupla(); | ||
643 | + } | ||
644 | + return FALSE; | ||
645 | + } | ||
646 | + /** | ||
647 | + * Retorna um array com os dados de um registro. | ||
648 | + * @return array | ||
649 | + */ | ||
650 | + function existe() | ||
651 | + { | ||
652 | + if (is_numeric($this->ref_cod_aluno)) { | ||
653 | + $db = new clsBanco(); | ||
654 | + $db->Consulta("SELECT 1 FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); | ||
655 | + $db->ProximoRegistro(); | ||
656 | + return $db->Tupla(); | ||
657 | + } | ||
658 | + return FALSE; | ||
659 | + } | ||
660 | + /** | ||
661 | + * Exclui um registro. | ||
662 | + * @return bool | ||
663 | + */ | ||
664 | + function excluir() | ||
665 | + { | ||
666 | + if (is_numeric($this->ref_cod_aluno)) { | ||
667 | + $sql = "DELETE FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"; | ||
668 | + $db = new clsBanco(); | ||
669 | + $db->Consulta($sql); | ||
670 | + return true; | ||
671 | + } | ||
672 | + return FALSE; | ||
673 | + } | ||
674 | + /** | ||
675 | + * Define quais campos da tabela serão selecionados no método Lista(). | ||
676 | + */ | ||
677 | + function setCamposLista($str_campos) | ||
678 | + { | ||
679 | + $this->_campos_lista = $str_campos; | ||
680 | + } | ||
681 | + /** | ||
682 | + * Define que o método Lista() deverpa retornar todos os campos da tabela. | ||
683 | + */ | ||
684 | + function resetCamposLista() | ||
685 | + { | ||
686 | + $this->_campos_lista = $this->_todos_campos; | ||
687 | + } | ||
688 | + /** | ||
689 | + * Define limites de retorno para o método Lista(). | ||
690 | + */ | ||
691 | + function setLimite($intLimiteQtd, $intLimiteOffset = NULL) | ||
692 | + { | ||
693 | + $this->_limite_quantidade = $intLimiteQtd; | ||
694 | + $this->_limite_offset = $intLimiteOffset; | ||
695 | + } | ||
696 | + /** | ||
697 | + * Retorna a string com o trecho da query responsável pelo limite de | ||
698 | + * registros retornados/afetados. | ||
699 | + * | ||
700 | + * @return string | ||
701 | + */ | ||
702 | + function getLimite() | ||
703 | + { | ||
704 | + if (is_numeric($this->_limite_quantidade)) { | ||
705 | + $retorno = " LIMIT {$this->_limite_quantidade}"; | ||
706 | + if (is_numeric($this->_limite_offset)) { | ||
707 | + $retorno .= " OFFSET {$this->_limite_offset} "; | ||
708 | + } | ||
709 | + return $retorno; | ||
710 | + } | ||
711 | + return ''; | ||
712 | + } | ||
713 | + /** | ||
714 | + * Define o campo para ser utilizado como ordenação no método Lista(). | ||
715 | + */ | ||
716 | + function setOrderby($strNomeCampo) | ||
717 | + { | ||
718 | + if (is_string($strNomeCampo) && $strNomeCampo ) { | ||
719 | + $this->_campo_order_by = $strNomeCampo; | ||
720 | + } | ||
721 | + } | ||
722 | + /** | ||
723 | + * Retorna a string com o trecho da query responsável pela Ordenação dos | ||
724 | + * registros. | ||
725 | + * | ||
726 | + * @return string | ||
727 | + */ | ||
728 | + function getOrderby() | ||
729 | + { | ||
730 | + if (is_string($this->_campo_order_by)) { | ||
731 | + return " ORDER BY {$this->_campo_order_by} "; | ||
732 | + } | ||
733 | + return ''; | ||
734 | + } | ||
735 | +} | ||
0 | \ No newline at end of file | 736 | \ No newline at end of file |
ieducar/intranet/include/modules/clsModulesMoradiaAluno.inc.php
0 → 100644
@@ -0,0 +1,796 @@ | @@ -0,0 +1,796 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +/** | ||
4 | + * i-Educar - Sistema de gestão escolar | ||
5 | + * | ||
6 | + * Copyright (C) 2006 Prefeitura Municipal de Itajaí | ||
7 | + * <ctima@itajai.sc.gov.br> | ||
8 | + * | ||
9 | + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo | ||
10 | + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free | ||
11 | + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) | ||
12 | + * qualquer versão posterior. | ||
13 | + * | ||
14 | + * Este programa é distribuído na expectativa de que seja útil, porém, SEM | ||
15 | + * NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU | ||
16 | + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral | ||
17 | + * do GNU para mais detalhes. | ||
18 | + * | ||
19 | + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto | ||
20 | + * com este programa; se não, escreva para a Free Software Foundation, Inc., no | ||
21 | + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
22 | + * | ||
23 | + * @author Lucas Schmoeller da Silva <lucas@portabilis.com.br> | ||
24 | + * @category i-Educar | ||
25 | + * @license @@license@@ | ||
26 | + * @package Module | ||
27 | + * @since 07/2013 | ||
28 | + * @version $Id$ | ||
29 | + */ | ||
30 | + | ||
31 | +require_once 'include/pmieducar/geral.inc.php'; | ||
32 | + | ||
33 | +/** | ||
34 | + * clsModulesMoradiaAluno class. | ||
35 | + * | ||
36 | + * @author Lucas Schmoeller da Silva <lucas@portabilis.com.br> | ||
37 | + * @category i-Educar | ||
38 | + * @license @@license@@ | ||
39 | + * @package Module | ||
40 | + * @since 07/2013 | ||
41 | + * @version @@package_version@@ | ||
42 | + */ | ||
43 | +class clsModulesMoradiaAluno | ||
44 | +{ | ||
45 | + var $ref_cod_aluno; | ||
46 | + var $moradia; | ||
47 | + var $material; | ||
48 | + var $casa_outra; | ||
49 | + var $moradia_situacao; | ||
50 | + var $quartos; | ||
51 | + var $sala; | ||
52 | + var $copa; | ||
53 | + var $banheiro; | ||
54 | + var $garagem; | ||
55 | + var $empregada_domestica; | ||
56 | + var $automovel; | ||
57 | + var $motocicleta; | ||
58 | + var $computador; | ||
59 | + var $geladeira; | ||
60 | + var $fogao; | ||
61 | + var $maquina_lavar; | ||
62 | + var $microondas; | ||
63 | + var $video_dvd; | ||
64 | + var $televisao; | ||
65 | + var $celular; | ||
66 | + var $telefone; | ||
67 | + var $quant_pessoas; | ||
68 | + var $renda; | ||
69 | + var $agua_encanada; | ||
70 | + var $poco; | ||
71 | + var $energia; | ||
72 | + var $esgoto; | ||
73 | + var $fossa; | ||
74 | + var $lixo; | ||
75 | + | ||
76 | + /** | ||
77 | + * Armazena o total de resultados obtidos na última chamada ao método lista(). | ||
78 | + * @var int | ||
79 | + */ | ||
80 | + var $_total; | ||
81 | + | ||
82 | + /** | ||
83 | + * Nome do schema. | ||
84 | + * @var string | ||
85 | + */ | ||
86 | + var $_schema; | ||
87 | + | ||
88 | + /** | ||
89 | + * Nome da tabela. | ||
90 | + * @var string | ||
91 | + */ | ||
92 | + var $_tabela; | ||
93 | + | ||
94 | + /** | ||
95 | + * Lista separada por vírgula, com os campos que devem ser selecionados na | ||
96 | + * próxima chamado ao método lista(). | ||
97 | + * @var string | ||
98 | + */ | ||
99 | + var $_campos_lista; | ||
100 | + | ||
101 | + /** | ||
102 | + * Lista com todos os campos da tabela separados por vírgula, padrão para | ||
103 | + * seleção no método lista. | ||
104 | + * @var string | ||
105 | + */ | ||
106 | + var $_todos_campos; | ||
107 | + | ||
108 | + /** | ||
109 | + * Valor que define a quantidade de registros a ser retornada pelo método lista(). | ||
110 | + * @var int | ||
111 | + */ | ||
112 | + var $_limite_quantidade; | ||
113 | + | ||
114 | + /** | ||
115 | + * Define o valor de offset no retorno dos registros no método lista(). | ||
116 | + * @var int | ||
117 | + */ | ||
118 | + var $_limite_offset; | ||
119 | + | ||
120 | + /** | ||
121 | + * Define o campo para ser usado como padrão de ordenação no método lista(). | ||
122 | + * @var string | ||
123 | + */ | ||
124 | + var $_campo_order_by; | ||
125 | + | ||
126 | + /** | ||
127 | + * Construtor. | ||
128 | + */ | ||
129 | + function clsModulesMoradiaAluno($ref_cod_aluno = NULL, | ||
130 | + $moradia = NULL, $material = NULL, | ||
131 | + $casa_outra = NULL, $moradia_situacao = NULL, | ||
132 | + $quartos = NULL, $sala = NULL, | ||
133 | + $copa = NULL, $banheiro = NULL, | ||
134 | + $garagem = NULL, $empregada_domestica = NULL, | ||
135 | + $automovel = NULL, $motocicleta = NULL, | ||
136 | + $computador = NULL, $geladeira = NULL, | ||
137 | + $fogao = NULL, $maquina_lavar = NULL, $microondas = NULL, $video_dvd = NULL, | ||
138 | + $televisao = NULL, $celular = NULL, $telefone = NULL, $quant_pessoas = NULL, $renda = NULL, $agua_encanada = NULL, $poco = NULL, | ||
139 | + $energia = NULL, $esgoto = NULL, $fossa = NULL, $lixo = NULL) { | ||
140 | + | ||
141 | + $db = new clsBanco(); | ||
142 | + $this->_schema = "modules."; | ||
143 | + $this->_tabela = "{$this->_schema}moradia_aluno"; | ||
144 | + | ||
145 | + $this->_campos_lista = $this->_todos_campos = "ref_cod_aluno, | ||
146 | + moradia, material, casa_outra, moradia_situacao, | ||
147 | + quartos, sala, copa, banheiro, garagem, empregada_domestica, | ||
148 | + automovel, motocicleta, computador, geladeira, fogao, maquina_lavar, microondas, video_dvd,televisao, celular, telefone, quant_pessoas, renda, agua_encanada, poco, energia, esgoto, fossa, lixo"; | ||
149 | + | ||
150 | + if (is_numeric($ref_cod_aluno)) { | ||
151 | + $this->ref_cod_aluno = $ref_cod_aluno; | ||
152 | + } | ||
153 | + | ||
154 | + if (is_string($moradia)) { | ||
155 | + $this->moradia = $moradia; | ||
156 | + } | ||
157 | + | ||
158 | + if (is_string($material)) { | ||
159 | + $this->material = $material; | ||
160 | + } | ||
161 | + | ||
162 | + if (is_string($casa_outra)) { | ||
163 | + $this->casa_outra = $casa_outra; | ||
164 | + } | ||
165 | + | ||
166 | + if (is_numeric($moradia_situacao)) { | ||
167 | + $this->moradia_situacao = $moradia_situacao; | ||
168 | + } | ||
169 | + | ||
170 | + if (is_numeric($quartos)) { | ||
171 | + $this->quartos = $quartos; | ||
172 | + } | ||
173 | + | ||
174 | + if (is_numeric($sala)) { | ||
175 | + $this->sala = $sala; | ||
176 | + } | ||
177 | + | ||
178 | + if (is_numeric($copa)) { | ||
179 | + $this->copa = $copa; | ||
180 | + } | ||
181 | + | ||
182 | + if (is_numeric($banheiro)) { | ||
183 | + $this->banheiro = $banheiro; | ||
184 | + } | ||
185 | + | ||
186 | + | ||
187 | + if (is_numeric($garagem)) { | ||
188 | + $this->garagem = $garagem; | ||
189 | + } | ||
190 | + | ||
191 | + if (is_string($empregada_domestica)) { | ||
192 | + $this->empregada_domestica = $empregada_domestica; | ||
193 | + } | ||
194 | + | ||
195 | + if (is_string($motocicleta)) { | ||
196 | + $this->motocicleta = $motocicleta; | ||
197 | + } | ||
198 | + | ||
199 | + if (is_string($computador)) { | ||
200 | + $this->computador = $computador; | ||
201 | + } | ||
202 | + | ||
203 | + if (is_string($geladeira)) { | ||
204 | + $this->geladeira = $geladeira; | ||
205 | + } | ||
206 | + | ||
207 | + if (is_string($fogao)) { | ||
208 | + $this->fogao = $fogao; | ||
209 | + } | ||
210 | + | ||
211 | + if (is_string($maquina_lavar)) { | ||
212 | + $this->maquina_lavar = $maquina_lavar; | ||
213 | + } | ||
214 | + | ||
215 | + if (is_string($microondas)) { | ||
216 | + $this->microondas = $microondas; | ||
217 | + } | ||
218 | + | ||
219 | + if (is_string($video_dvd)) { | ||
220 | + $this->video_dvd = $video_dvd; | ||
221 | + } | ||
222 | + | ||
223 | + if (is_string($televisao)) { | ||
224 | + $this->televisao = $televisao; | ||
225 | + } | ||
226 | + | ||
227 | + if (is_string($celular)) { | ||
228 | + $this->celular = $celular; | ||
229 | + } | ||
230 | + | ||
231 | + if (is_string($telefone)) { | ||
232 | + $this->telefone = $telefone; | ||
233 | + } | ||
234 | + | ||
235 | + if (is_string($quant_pessoas)) { | ||
236 | + $this->quant_pessoas = $quant_pessoas; | ||
237 | + } | ||
238 | + | ||
239 | + if (is_numeric($renda)) { | ||
240 | + $this->renda = $renda; | ||
241 | + } | ||
242 | + | ||
243 | + if (is_numeric($agua_encanada)) { | ||
244 | + $this->agua_encanada = $agua_encanada; | ||
245 | + } | ||
246 | + | ||
247 | + if (is_string($poco)) { | ||
248 | + $this->poco = $poco; | ||
249 | + } | ||
250 | + | ||
251 | + if (is_string($energia)) { | ||
252 | + $this->energia = $energia; | ||
253 | + } | ||
254 | + | ||
255 | + if (is_string($esgoto)) { | ||
256 | + $this->esgoto = $esgoto; | ||
257 | + } | ||
258 | + | ||
259 | + if (is_string($fossa)) { | ||
260 | + $this->fossa = $fossa; | ||
261 | + } | ||
262 | + | ||
263 | + if (is_string($lixo)) { | ||
264 | + $this->lixo = $lixo; | ||
265 | + } | ||
266 | + | ||
267 | + | ||
268 | + } | ||
269 | + | ||
270 | + /** | ||
271 | + * Cria um novo registro. | ||
272 | + * @return bool | ||
273 | + */ | ||
274 | + function cadastra() | ||
275 | + { | ||
276 | + | ||
277 | + | ||
278 | + if (is_numeric($this->ref_cod_aluno)) | ||
279 | + { | ||
280 | + | ||
281 | + $db = new clsBanco(); | ||
282 | + | ||
283 | + $campos = ''; | ||
284 | + $valores = ''; | ||
285 | + $gruda = ''; | ||
286 | + | ||
287 | + | ||
288 | + if (is_numeric($this->ref_cod_aluno)) { | ||
289 | + $campos .= "{$gruda}ref_cod_aluno"; | ||
290 | + $valores .= "{$gruda}'{$this->ref_cod_aluno}'"; | ||
291 | + $gruda = ", "; | ||
292 | + } | ||
293 | + | ||
294 | + if (is_string($this->moradia)) { | ||
295 | + $campos .= "{$gruda}moradia"; | ||
296 | + $valores .= "{$gruda}'{$this->moradia}'"; | ||
297 | + $gruda = ", "; | ||
298 | + } | ||
299 | + | ||
300 | + if (is_string($this->material)) { | ||
301 | + $campos .= "{$gruda}material"; | ||
302 | + $valores .= "{$gruda}'{$this->material}'"; | ||
303 | + $gruda = ", "; | ||
304 | + } | ||
305 | + | ||
306 | + if (is_string($this->casa_outra)) { | ||
307 | + $campos .= "{$gruda}casa_outra"; | ||
308 | + $valores .= "{$gruda}'{$this->casa_outra}'"; | ||
309 | + $gruda = ", "; | ||
310 | + } | ||
311 | + | ||
312 | + if (is_numeric($this->moradia_situacao)) { | ||
313 | + $campos .= "{$gruda}moradia_situacao"; | ||
314 | + $valores .= "{$gruda}'{$this->moradia_situacao}'"; | ||
315 | + $gruda = ", "; | ||
316 | + } | ||
317 | + | ||
318 | + if (is_numeric($this->quartos)) { | ||
319 | + $campos .= "{$gruda}quartos"; | ||
320 | + $valores .= "{$gruda}'{$this->quartos}'"; | ||
321 | + $gruda = ", "; | ||
322 | + } | ||
323 | + | ||
324 | + if (is_numeric($this->sala)) { | ||
325 | + $campos .= "{$gruda}sala"; | ||
326 | + $valores .= "{$gruda}'{$this->sala}'"; | ||
327 | + $gruda = ", "; | ||
328 | + } | ||
329 | + | ||
330 | + if (is_numeric($this->copa)) { | ||
331 | + $campos .= "{$gruda}copa"; | ||
332 | + $valores .= "{$gruda}'{$this->copa}'"; | ||
333 | + $gruda = ", "; | ||
334 | + } | ||
335 | + | ||
336 | + if (is_numeric($this->banheiro)) { | ||
337 | + $campos .= "{$gruda}banheiro"; | ||
338 | + $valores .= "{$gruda}'{$this->banheiro}'"; | ||
339 | + $gruda = ", "; | ||
340 | + } | ||
341 | + | ||
342 | + if (is_numeric($this->garagem)) { | ||
343 | + $campos .= "{$gruda}garagem"; | ||
344 | + $valores .= "{$gruda}'{$this->garagem}'"; | ||
345 | + $gruda = ", "; | ||
346 | + } | ||
347 | + | ||
348 | + | ||
349 | + if (is_string($this->empregada_domestica)) { | ||
350 | + $campos .= "{$gruda}empregada_domestica"; | ||
351 | + $valores .= "{$gruda}'{$this->empregada_domestica}'"; | ||
352 | + $gruda = ", "; | ||
353 | + } | ||
354 | + | ||
355 | + if (is_string($this->automovel)) { | ||
356 | + $campos .= "{$gruda}automovel"; | ||
357 | + $valores .= "{$gruda}'{$this->automovel}'"; | ||
358 | + $gruda = ", "; | ||
359 | + } | ||
360 | + | ||
361 | + if (is_string($this->motocicleta)) { | ||
362 | + $campos .= "{$gruda}motocicleta"; | ||
363 | + $valores .= "{$gruda}'{$this->motocicleta}'"; | ||
364 | + $gruda = ", "; | ||
365 | + } | ||
366 | + | ||
367 | + if (is_string($this->geladeira)) { | ||
368 | + $campos .= "{$gruda}geladeira"; | ||
369 | + $valores .= "{$gruda}'{$this->geladeira}'"; | ||
370 | + $gruda = ", "; | ||
371 | + } | ||
372 | + | ||
373 | + if (is_string($this->fogao)) { | ||
374 | + $campos .= "{$gruda}fogao"; | ||
375 | + $valores .= "{$gruda}'{$this->fogao}'"; | ||
376 | + $gruda = ", "; | ||
377 | + } | ||
378 | + | ||
379 | + if (is_string($this->maquina_lavar)) { | ||
380 | + $campos .= "{$gruda}maquina_lavar"; | ||
381 | + $valores .= "{$gruda}'{$this->maquina_lavar}'"; | ||
382 | + $gruda = ", "; | ||
383 | + } | ||
384 | + | ||
385 | + if (is_string($this->microondas)) { | ||
386 | + $campos .= "{$gruda}microondas"; | ||
387 | + $valores .= "{$gruda}'{$this->microondas}'"; | ||
388 | + $gruda = ", "; | ||
389 | + } | ||
390 | + | ||
391 | + if (is_string($this->video_dvd)) { | ||
392 | + $campos .= "{$gruda}video_dvd"; | ||
393 | + $valores .= "{$gruda}'{$this->video_dvd}'"; | ||
394 | + $gruda = ", "; | ||
395 | + } | ||
396 | + | ||
397 | + if (is_string($this->televisao)) { | ||
398 | + $campos .= "{$gruda}televisao"; | ||
399 | + $valores .= "{$gruda}'{$this->televisao}'"; | ||
400 | + $gruda = ", "; | ||
401 | + } | ||
402 | + | ||
403 | + if (is_string($this->celular)) { | ||
404 | + $campos .= "{$gruda}celular"; | ||
405 | + $valores .= "{$gruda}'{$this->celular}'"; | ||
406 | + $gruda = ", "; | ||
407 | + } | ||
408 | + | ||
409 | + if (is_string($this->telefone)) { | ||
410 | + $campos .= "{$gruda}telefone"; | ||
411 | + $valores .= "{$gruda}'{$this->telefone}'"; | ||
412 | + $gruda = ", "; | ||
413 | + } | ||
414 | + | ||
415 | + if (is_numeric($this->quant_pessoas)) { | ||
416 | + $campos .= "{$gruda}quant_pessoas"; | ||
417 | + $valores .= "{$gruda}'{$this->quant_pessoas}'"; | ||
418 | + $gruda = ", "; | ||
419 | + } | ||
420 | + | ||
421 | + if (is_numeric($this->renda)) { | ||
422 | + $campos .= "{$gruda}renda"; | ||
423 | + $valores .= "{$gruda}'{$this->renda}'"; | ||
424 | + $gruda = ", "; | ||
425 | + } | ||
426 | + | ||
427 | + if (is_string($this->agua_encanada)) { | ||
428 | + $campos .= "{$gruda}agua_encanada"; | ||
429 | + $valores .= "{$gruda}'{$this->agua_encanada}'"; | ||
430 | + $gruda = ", "; | ||
431 | + } | ||
432 | + | ||
433 | + if (is_string($this->poco)) { | ||
434 | + $campos .= "{$gruda}poco"; | ||
435 | + $valores .= "{$gruda}'{$this->poco}'"; | ||
436 | + $gruda = ", "; | ||
437 | + } | ||
438 | + | ||
439 | + if (is_string($this->energia)) { | ||
440 | + $campos .= "{$gruda}energia"; | ||
441 | + $valores .= "{$gruda}'{$this->energia}'"; | ||
442 | + $gruda = ", "; | ||
443 | + } | ||
444 | + | ||
445 | + if (is_string($this->esgoto)) { | ||
446 | + $campos .= "{$gruda}esgoto"; | ||
447 | + $valores .= "{$gruda}'{$this->esgoto}'"; | ||
448 | + $gruda = ", "; | ||
449 | + } | ||
450 | + | ||
451 | + if (is_string($this->fossa)) { | ||
452 | + $campos .= "{$gruda}fossa"; | ||
453 | + $valores .= "{$gruda}'{$this->fossa}'"; | ||
454 | + $gruda = ", "; | ||
455 | + } | ||
456 | + | ||
457 | + if (is_string($this->lixo)) { | ||
458 | + $campos .= "{$gruda}lixo"; | ||
459 | + $valores .= "{$gruda}'{$this->lixo}'"; | ||
460 | + $gruda = ", "; | ||
461 | + } | ||
462 | + | ||
463 | + $db->Consulta("INSERT INTO {$this->_tabela} ( $campos ) VALUES( $valores )"); | ||
464 | + return $this->ref_cod_aluno; | ||
465 | + } | ||
466 | + | ||
467 | + return FALSE; | ||
468 | + } | ||
469 | + | ||
470 | + /** | ||
471 | + * Edita os dados de um registro. | ||
472 | + * @return bool | ||
473 | + */ | ||
474 | + function edita() | ||
475 | + { | ||
476 | + | ||
477 | + if (is_numeric($this->ref_cod_aluno)) { | ||
478 | + $db = new clsBanco(); | ||
479 | + $set = ''; | ||
480 | + | ||
481 | + if (is_numeric($this->ref_cod_aluno)) { | ||
482 | + $set .= "{$gruda}ref_cod_aluno = '{$this->ref_cod_aluno}'"; | ||
483 | + $gruda = ", "; | ||
484 | + } | ||
485 | + | ||
486 | + if (is_string($this->moradia)) { | ||
487 | + $set .= "{$gruda}moradia = '{$this->moradia}'"; | ||
488 | + $gruda = ", "; | ||
489 | + } | ||
490 | + | ||
491 | + if (is_string($this->material)) { | ||
492 | + $set .= "{$gruda}material = '{$this->material}'"; | ||
493 | + $gruda = ", "; | ||
494 | + } | ||
495 | + | ||
496 | + if (is_string($this->casa_outra)) { | ||
497 | + $set .= "{$gruda}casa_outra = '{$this->casa_outra}'"; | ||
498 | + $gruda = ", "; | ||
499 | + } | ||
500 | + | ||
501 | + if (is_numeric($this->moradia_situacao)) { | ||
502 | + $set .= "{$gruda}moradia_situacao = '{$this->moradia_situacao}'"; | ||
503 | + $gruda = ", "; | ||
504 | + } | ||
505 | + | ||
506 | + if (is_numeric($this->quartos)) { | ||
507 | + $set .= "{$gruda}quartos = '{$this->quartos}'"; | ||
508 | + $gruda = ", "; | ||
509 | + } | ||
510 | + | ||
511 | + if (is_numeric($this->sala)) { | ||
512 | + $set .= "{$gruda}sala = '{$this->sala}'"; | ||
513 | + $gruda = ", "; | ||
514 | + } | ||
515 | + | ||
516 | + if (is_numeric($this->copa)) { | ||
517 | + $set .= "{$gruda}copa = '{$this->copa}'"; | ||
518 | + $gruda = ", "; | ||
519 | + } | ||
520 | + | ||
521 | + if (is_numeric($this->banheiro)) { | ||
522 | + $set .= "{$gruda}banheiro = '{$this->banheiro}'"; | ||
523 | + $gruda = ", "; | ||
524 | + } | ||
525 | + | ||
526 | + if (is_numeric($this->garagem)) { | ||
527 | + $set .= "{$gruda}garagem = '{$this->garagem}'"; | ||
528 | + $gruda = ", "; | ||
529 | + } | ||
530 | + | ||
531 | + if (is_string($this->empregada_domestica)) { | ||
532 | + $set .= "{$gruda}empregada_domestica = '{$this->empregada_domestica}'"; | ||
533 | + $gruda = ", "; | ||
534 | + } | ||
535 | + | ||
536 | + if (is_string($this->automovel)) { | ||
537 | + $set .= "{$gruda}automovel = '{$this->automovel}'"; | ||
538 | + $gruda = ", "; | ||
539 | + } | ||
540 | + | ||
541 | + if (is_string($this->motocicleta)) { | ||
542 | + $set .= "{$gruda}motocicleta = '{$this->motocicleta}'"; | ||
543 | + $gruda = ", "; | ||
544 | + } | ||
545 | + | ||
546 | + if (is_string($this->computador)) { | ||
547 | + $set .= "{$gruda}computador = '{$this->computador}'"; | ||
548 | + $gruda = ", "; | ||
549 | + } | ||
550 | + | ||
551 | + if (is_string($this->geladeira)) { | ||
552 | + $set .= "{$gruda}geladeira = '{$this->geladeira}'"; | ||
553 | + $gruda = ", "; | ||
554 | + } | ||
555 | + | ||
556 | + | ||
557 | + if (is_string($this->fogao)) { | ||
558 | + $set .= "{$gruda}fogao = '{$this->fogao}'"; | ||
559 | + $gruda = ", "; | ||
560 | + } | ||
561 | + | ||
562 | + if (is_string($this->maquina_lavar)) { | ||
563 | + $set .= "{$gruda}maquina_lavar = '{$this->maquina_lavar}'"; | ||
564 | + $gruda = ", "; | ||
565 | + } | ||
566 | + | ||
567 | + if (is_string($this->microondas)) { | ||
568 | + $set .= "{$gruda}microondas = '{$this->microondas}'"; | ||
569 | + $gruda = ", "; | ||
570 | + } | ||
571 | + | ||
572 | + if (is_string($this->video_dvd)) { | ||
573 | + $set .= "{$gruda}video_dvd = '{$this->video_dvd}'"; | ||
574 | + $gruda = ", "; | ||
575 | + } | ||
576 | + | ||
577 | + if (is_string($this->televisao)) { | ||
578 | + $set .= "{$gruda}televisao = '{$this->televisao}'"; | ||
579 | + $gruda = ", "; | ||
580 | + } | ||
581 | + | ||
582 | + if (is_string($this->celular)) { | ||
583 | + $set .= "{$gruda}celular = '{$this->celular}'"; | ||
584 | + $gruda = ", "; | ||
585 | + } | ||
586 | + | ||
587 | + if (is_string($this->telefone)) { | ||
588 | + $set .= "{$gruda}telefone = '{$this->telefone}'"; | ||
589 | + $gruda = ", "; | ||
590 | + } | ||
591 | + | ||
592 | + if (is_numeric($this->quant_pessoas)) { | ||
593 | + $set .= "{$gruda}quant_pessoas = '{$this->quant_pessoas}'"; | ||
594 | + $gruda = ", "; | ||
595 | + } | ||
596 | + | ||
597 | + if (is_numeric($this->renda)) { | ||
598 | + $set .= "{$gruda}renda = '{$this->renda}'"; | ||
599 | + $gruda = ", "; | ||
600 | + } | ||
601 | + | ||
602 | + if (is_string($this->agua_encanada)) { | ||
603 | + $set .= "{$gruda}agua_encanada = '{$this->agua_encanada}'"; | ||
604 | + $gruda = ", "; | ||
605 | + } | ||
606 | + | ||
607 | + if (is_string($this->poco)) { | ||
608 | + $set .= "{$gruda}poco = '{$this->poco}'"; | ||
609 | + $gruda = ", "; | ||
610 | + } | ||
611 | + | ||
612 | + if (is_string($this->energia)) { | ||
613 | + $set .= "{$gruda}energia = '{$this->energia}'"; | ||
614 | + $gruda = ", "; | ||
615 | + } | ||
616 | + | ||
617 | + if (is_string($this->esgoto)) { | ||
618 | + $set .= "{$gruda}esgoto = '{$this->esgoto}'"; | ||
619 | + $gruda = ", "; | ||
620 | + } | ||
621 | + | ||
622 | + if (is_string($this->fossa)) { | ||
623 | + $set .= "{$gruda}fossa = '{$this->fossa}'"; | ||
624 | + $gruda = ", "; | ||
625 | + } | ||
626 | + | ||
627 | + if (is_string($this->lixo)) { | ||
628 | + $set .= "{$gruda}lixo = '{$this->lixo}'"; | ||
629 | + $gruda = ", "; | ||
630 | + } | ||
631 | + | ||
632 | + | ||
633 | + if ($set) { | ||
634 | + $db->Consulta("UPDATE {$this->_tabela} SET $set WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); | ||
635 | + return TRUE; | ||
636 | + } | ||
637 | + } | ||
638 | + | ||
639 | + return FALSE; | ||
640 | + } | ||
641 | + | ||
642 | + /** | ||
643 | + * Retorna uma lista de registros filtrados de acordo com os parâmetros. | ||
644 | + * @return array | ||
645 | + */ | ||
646 | + function lista() | ||
647 | + { | ||
648 | + $sql = "SELECT {$this->_campos_lista} FROM {$this->_tabela}"; | ||
649 | + $filtros = ""; | ||
650 | + $whereAnd = " WHERE "; | ||
651 | + | ||
652 | + $db = new clsBanco(); | ||
653 | + $countCampos = count(explode(',', $this->_campos_lista))+2; | ||
654 | + $resultado = array(); | ||
655 | + | ||
656 | + $sql .= $filtros.$whereNomes.$this->getOrderby() . $this->getLimite(); | ||
657 | + | ||
658 | + $this->_total = $db->CampoUnico("SELECT COUNT(0) FROM {$this->_tabela} {$filtros}"); | ||
659 | + | ||
660 | + $db->Consulta($sql); | ||
661 | + | ||
662 | + if ($countCampos > 1) { | ||
663 | + while ($db->ProximoRegistro()) { | ||
664 | + $tupla = $db->Tupla(); | ||
665 | + $tupla["_total"] = $this->_total; | ||
666 | + $resultado[] = $tupla; | ||
667 | + } | ||
668 | + } | ||
669 | + else { | ||
670 | + while ($db->ProximoRegistro()) { | ||
671 | + $tupla = $db->Tupla(); | ||
672 | + $resultado[] = $tupla[$this->_campos_lista]; | ||
673 | + } | ||
674 | + } | ||
675 | + if (count($resultado)) { | ||
676 | + return $resultado; | ||
677 | + } | ||
678 | + | ||
679 | + return FALSE; | ||
680 | + } | ||
681 | + | ||
682 | + /** | ||
683 | + * Retorna um array com os dados de um registro. | ||
684 | + * @return array | ||
685 | + */ | ||
686 | + function detalhe() | ||
687 | + { | ||
688 | + if (is_numeric($this->ref_cod_aluno)) { | ||
689 | + $db = new clsBanco(); | ||
690 | + $db->Consulta("SELECT {$this->_todos_campos} FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); | ||
691 | + $db->ProximoRegistro(); | ||
692 | + return $db->Tupla(); | ||
693 | + } | ||
694 | + | ||
695 | + return FALSE; | ||
696 | + } | ||
697 | + | ||
698 | + /** | ||
699 | + * Retorna um array com os dados de um registro. | ||
700 | + * @return array | ||
701 | + */ | ||
702 | + function existe() | ||
703 | + { | ||
704 | + if (is_numeric($this->ref_cod_aluno)) { | ||
705 | + $db = new clsBanco(); | ||
706 | + $db->Consulta("SELECT 1 FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); | ||
707 | + $db->ProximoRegistro(); | ||
708 | + return $db->Tupla(); | ||
709 | + } | ||
710 | + | ||
711 | + return FALSE; | ||
712 | + } | ||
713 | + | ||
714 | + /** | ||
715 | + * Exclui um registro. | ||
716 | + * @return bool | ||
717 | + */ | ||
718 | + function excluir() | ||
719 | + { | ||
720 | + if (is_numeric($this->ref_cod_aluno)) { | ||
721 | + $sql = "DELETE FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"; | ||
722 | + $db = new clsBanco(); | ||
723 | + $db->Consulta($sql); | ||
724 | + return true; | ||
725 | + } | ||
726 | + | ||
727 | + return FALSE; | ||
728 | + } | ||
729 | + | ||
730 | + /** | ||
731 | + * Define quais campos da tabela serão selecionados no método Lista(). | ||
732 | + */ | ||
733 | + function setCamposLista($str_campos) | ||
734 | + { | ||
735 | + $this->_campos_lista = $str_campos; | ||
736 | + } | ||
737 | + | ||
738 | + /** | ||
739 | + * Define que o método Lista() deverpa retornar todos os campos da tabela. | ||
740 | + */ | ||
741 | + function resetCamposLista() | ||
742 | + { | ||
743 | + $this->_campos_lista = $this->_todos_campos; | ||
744 | + } | ||
745 | + | ||
746 | + /** | ||
747 | + * Define limites de retorno para o método Lista(). | ||
748 | + */ | ||
749 | + function setLimite($intLimiteQtd, $intLimiteOffset = NULL) | ||
750 | + { | ||
751 | + $this->_limite_quantidade = $intLimiteQtd; | ||
752 | + $this->_limite_offset = $intLimiteOffset; | ||
753 | + } | ||
754 | + | ||
755 | + /** | ||
756 | + * Retorna a string com o trecho da query responsável pelo limite de | ||
757 | + * registros retornados/afetados. | ||
758 | + * | ||
759 | + * @return string | ||
760 | + */ | ||
761 | + function getLimite() | ||
762 | + { | ||
763 | + if (is_numeric($this->_limite_quantidade)) { | ||
764 | + $retorno = " LIMIT {$this->_limite_quantidade}"; | ||
765 | + if (is_numeric($this->_limite_offset)) { | ||
766 | + $retorno .= " OFFSET {$this->_limite_offset} "; | ||
767 | + } | ||
768 | + return $retorno; | ||
769 | + } | ||
770 | + return ''; | ||
771 | + } | ||
772 | + | ||
773 | + /** | ||
774 | + * Define o campo para ser utilizado como ordenação no método Lista(). | ||
775 | + */ | ||
776 | + function setOrderby($strNomeCampo) | ||
777 | + { | ||
778 | + if (is_string($strNomeCampo) && $strNomeCampo ) { | ||
779 | + $this->_campo_order_by = $strNomeCampo; | ||
780 | + } | ||
781 | + } | ||
782 | + | ||
783 | + /** | ||
784 | + * Retorna a string com o trecho da query responsável pela Ordenação dos | ||
785 | + * registros. | ||
786 | + * | ||
787 | + * @return string | ||
788 | + */ | ||
789 | + function getOrderby() | ||
790 | + { | ||
791 | + if (is_string($this->_campo_order_by)) { | ||
792 | + return " ORDER BY {$this->_campo_order_by} "; | ||
793 | + } | ||
794 | + return ''; | ||
795 | + } | ||
796 | +} | ||
0 | \ No newline at end of file | 797 | \ No newline at end of file |
ieducar/intranet/include/modules/clsModulesUniformeAluno.inc.php
0 → 100644
@@ -0,0 +1,527 @@ | @@ -0,0 +1,527 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +/** | ||
4 | + * i-Educar - Sistema de gestão escolar | ||
5 | + * | ||
6 | + * Copyright (C) 2006 Prefeitura Municipal de Itajaí | ||
7 | + * <ctima@itajai.sc.gov.br> | ||
8 | + * | ||
9 | + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo | ||
10 | + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free | ||
11 | + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) | ||
12 | + * qualquer versão posterior. | ||
13 | + * | ||
14 | + * Este programa é distribuído na expectativa de que seja útil, porém, SEM | ||
15 | + * NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU | ||
16 | + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral | ||
17 | + * do GNU para mais detalhes. | ||
18 | + * | ||
19 | + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto | ||
20 | + * com este programa; se não, escreva para a Free Software Foundation, Inc., no | ||
21 | + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
22 | + * | ||
23 | + * @author Lucas Schmoeller da Silva <lucas@portabilis.com.br> | ||
24 | + * @category i-Educar | ||
25 | + * @license @@license@@ | ||
26 | + * @package Module | ||
27 | + * @since 09/2013 | ||
28 | + * @version $Id$ | ||
29 | + */ | ||
30 | + | ||
31 | +require_once 'include/pmieducar/geral.inc.php'; | ||
32 | + | ||
33 | +/** | ||
34 | + * clsModulesUniformeAluno class. | ||
35 | + * | ||
36 | + * @author Lucas Schmoeller da Silva <lucas@portabilis.com.br> | ||
37 | + * @category i-Educar | ||
38 | + * @license @@license@@ | ||
39 | + * @package Module | ||
40 | + * @since 09/2013 | ||
41 | + * @version @@package_version@@ | ||
42 | + */ | ||
43 | +class clsModulesUniformeAluno | ||
44 | +{ | ||
45 | + var $ref_cod_aluno; | ||
46 | + var $recebeu_uniforme; | ||
47 | + var $quantidade_camiseta; | ||
48 | + var $tamanho_camiseta; | ||
49 | + var $quantidade_blusa_jaqueta; | ||
50 | + var $tamanho_blusa_jaqueta; | ||
51 | + var $quantidade_bermuda; | ||
52 | + var $tamanho_bermuda; | ||
53 | + var $quantidade_calca; | ||
54 | + var $tamanho_calca; | ||
55 | + var $quantidade_saia; | ||
56 | + var $tamanho_saia; | ||
57 | + var $quantidade_calcado; | ||
58 | + var $tamanho_calcado; | ||
59 | + var $quantidade_meia; | ||
60 | + var $tamanho_meia; | ||
61 | + | ||
62 | + /** | ||
63 | + * @var int | ||
64 | + * Armazena o total de resultados obtidos na última chamada ao método lista(). | ||
65 | + */ | ||
66 | + var $_total; | ||
67 | + | ||
68 | + /** | ||
69 | + * Nome do schema. | ||
70 | + * @var string | ||
71 | + */ | ||
72 | + var $_schema; | ||
73 | + | ||
74 | + /** | ||
75 | + * Nome da tabela. | ||
76 | + * @var string | ||
77 | + */ | ||
78 | + var $_tabela; | ||
79 | + | ||
80 | + /** | ||
81 | + * Lista separada por vírgula, com os campos que devem ser selecionados na | ||
82 | + * próxima chamado ao método lista(). | ||
83 | + * @var string | ||
84 | + */ | ||
85 | + var $_campos_lista; | ||
86 | + | ||
87 | + /** | ||
88 | + * Lista com todos os campos da tabela separados por vírgula, padrão para | ||
89 | + * seleção no método lista. | ||
90 | + * @var string | ||
91 | + */ | ||
92 | + var $_todos_campos; | ||
93 | + | ||
94 | + /** | ||
95 | + * Valor que define a quantidade de registros a ser retornada pelo método lista(). | ||
96 | + * @var int | ||
97 | + */ | ||
98 | + var $_limite_quantidade; | ||
99 | + | ||
100 | + /** | ||
101 | + * Define o valor de offset no retorno dos registros no método lista(). | ||
102 | + * @var int | ||
103 | + */ | ||
104 | + var $_limite_offset; | ||
105 | + | ||
106 | + /** | ||
107 | + * Define o campo para ser usado como padrão de ordenação no método lista(). | ||
108 | + * @var string | ||
109 | + */ | ||
110 | + var $_campo_order_by; | ||
111 | + | ||
112 | + /** | ||
113 | + * Construtor. | ||
114 | + */ | ||
115 | + function clsModulesUniformeAluno( $ref_cod_aluno = NULL, $recebeu_uniforme = NULL, | ||
116 | + $quantidade_camiseta = NULL, $tamanho_camiseta = NULL, $quantidade_blusa_jaqueta = NULL, | ||
117 | + $tamanho_blusa_jaqueta = NULL, $quantidade_bermuda = NULL, $tamanho_bermuda = NULL, | ||
118 | + $quantidade_calca = NULL, $tamanho_calca = NULL, $quantidade_saia = NULL, $tamanho_saia = NULL, | ||
119 | + $quantidade_calcado = NULL, $tamanho_calcado = NULL, $quantidade_meia = NULL, $tamanho_meia = NULL) | ||
120 | + { | ||
121 | + $db = new clsBanco(); | ||
122 | + $this->_schema = "modules."; | ||
123 | + $this->_tabela = "{$this->_schema}uniforme_aluno"; | ||
124 | + | ||
125 | + $this->_campos_lista = $this->_todos_campos = " ref_cod_aluno, recebeu_uniforme, quantidade_camiseta, | ||
126 | + tamanho_camiseta, quantidade_blusa_jaqueta, tamanho_blusa_jaqueta, quantidade_bermuda, tamanho_bermuda, | ||
127 | + quantidade_calca, tamanho_calca, quantidade_saia, tamanho_saia, quantidade_calcado, tamanho_calcado, | ||
128 | + quantidade_meia, tamanho_meia"; | ||
129 | + | ||
130 | + if (is_numeric($ref_cod_aluno)) { | ||
131 | + $this->ref_cod_aluno = $ref_cod_aluno; | ||
132 | + } | ||
133 | + | ||
134 | + if (is_string($recebeu_uniforme)) { | ||
135 | + $this->recebeu_uniforme = $recebeu_uniforme; | ||
136 | + } | ||
137 | + | ||
138 | + if (is_numeric($quantidade_camiseta)) { | ||
139 | + $this->quantidade_camiseta = $quantidade_camiseta; | ||
140 | + } | ||
141 | + | ||
142 | + if (is_string($tamanho_camiseta)) { | ||
143 | + $this->tamanho_camiseta = $tamanho_camiseta; | ||
144 | + } | ||
145 | + | ||
146 | + if (is_numeric($quantidade_blusa_jaqueta)) { | ||
147 | + $this->quantidade_blusa_jaqueta = $quantidade_blusa_jaqueta; | ||
148 | + } | ||
149 | + | ||
150 | + if (is_string($tamanho_blusa_jaqueta)) { | ||
151 | + $this->tamanho_blusa_jaqueta = $tamanho_blusa_jaqueta; | ||
152 | + } | ||
153 | + | ||
154 | + if (is_numeric($quantidade_bermuda)) { | ||
155 | + $this->quantidade_bermuda = $quantidade_bermuda; | ||
156 | + } | ||
157 | + | ||
158 | + if (is_string($tamanho_bermuda)) { | ||
159 | + $this->tamanho_bermuda = $tamanho_bermuda; | ||
160 | + } | ||
161 | + | ||
162 | + if (is_numeric($quantidade_calca)) { | ||
163 | + $this->quantidade_calca = $quantidade_calca; | ||
164 | + } | ||
165 | + | ||
166 | + if (is_string($tamanho_calca)) { | ||
167 | + $this->tamanho_calca = $tamanho_calca; | ||
168 | + } | ||
169 | + | ||
170 | + if (is_numeric($quantidade_saia)) { | ||
171 | + $this->quantidade_saia = $quantidade_saia; | ||
172 | + } | ||
173 | + | ||
174 | + if (is_string($tamanho_saia)) { | ||
175 | + $this->tamanho_saia = $tamanho_saia; | ||
176 | + } | ||
177 | + | ||
178 | + if (is_numeric($quantidade_calcado)) { | ||
179 | + $this->quantidade_calcado = $quantidade_calcado; | ||
180 | + } | ||
181 | + | ||
182 | + if (is_string($tamanho_calcado)) { | ||
183 | + $this->tamanho_calcado = $tamanho_calcado; | ||
184 | + } | ||
185 | + | ||
186 | + if (is_numeric($quantidade_meia)) { | ||
187 | + $this->quantidade_meia = $quantidade_meia; | ||
188 | + } | ||
189 | + | ||
190 | + if (is_string($tamanho_meia)) { | ||
191 | + $this->tamanho_meia = $tamanho_meia; | ||
192 | + } | ||
193 | + | ||
194 | + | ||
195 | + } | ||
196 | + | ||
197 | + /** | ||
198 | + * Cria um novo registro. | ||
199 | + * @return bool | ||
200 | + */ | ||
201 | + function cadastra() | ||
202 | + { | ||
203 | + if (is_numeric($this->ref_cod_aluno)) | ||
204 | + { | ||
205 | + $db = new clsBanco(); | ||
206 | + | ||
207 | + $campos = ''; | ||
208 | + $valores = ''; | ||
209 | + $gruda = ''; | ||
210 | + | ||
211 | + $campos .= "{$gruda}ref_cod_aluno"; | ||
212 | + $valores .= "{$gruda}{$this->ref_cod_aluno}"; | ||
213 | + $gruda = ", "; | ||
214 | + | ||
215 | + $campos .= "{$gruda}recebeu_uniforme"; | ||
216 | + $valores .= "{$gruda}'{$this->recebeu_uniforme}'"; | ||
217 | + $gruda = ", "; | ||
218 | + | ||
219 | + if(is_numeric($this->quantidade_camiseta)){ | ||
220 | + $campos .= "{$gruda}quantidade_camiseta"; | ||
221 | + $valores .= "{$gruda}{$this->quantidade_camiseta}"; | ||
222 | + $gruda = ", "; | ||
223 | + } | ||
224 | + | ||
225 | + $campos .= "{$gruda}tamanho_camiseta"; | ||
226 | + $valores .= "{$gruda}'{$this->tamanho_camiseta}'"; | ||
227 | + $gruda = ", "; | ||
228 | + | ||
229 | + if(is_numeric($this->quantidade_blusa_jaqueta)){ | ||
230 | + $campos .= "{$gruda}quantidade_blusa_jaqueta"; | ||
231 | + $valores .= "{$gruda}{$this->quantidade_blusa_jaqueta}"; | ||
232 | + $gruda = ", "; | ||
233 | + } | ||
234 | + | ||
235 | + $campos .= "{$gruda}tamanho_blusa_jaqueta"; | ||
236 | + $valores .= "{$gruda}'{$this->tamanho_blusa_jaqueta}'"; | ||
237 | + $gruda = ", "; | ||
238 | + | ||
239 | + if(is_numeric($this->quantidade_bermuda)){ | ||
240 | + $campos .= "{$gruda}quantidade_bermuda"; | ||
241 | + $valores .= "{$gruda}{$this->quantidade_bermuda}"; | ||
242 | + $gruda = ", "; | ||
243 | + } | ||
244 | + | ||
245 | + $campos .= "{$gruda}tamanho_bermuda"; | ||
246 | + $valores .= "{$gruda}'{$this->tamanho_bermuda}'"; | ||
247 | + $gruda = ", "; | ||
248 | + | ||
249 | + if(is_numeric($this->quantidade_calca)){ | ||
250 | + $campos .= "{$gruda}quantidade_calca"; | ||
251 | + $valores .= "{$gruda}{$this->quantidade_calca}"; | ||
252 | + $gruda = ", "; | ||
253 | + } | ||
254 | + | ||
255 | + $campos .= "{$gruda}tamanho_calca"; | ||
256 | + $valores .= "{$gruda}'{$this->tamanho_calca}'"; | ||
257 | + $gruda = ", "; | ||
258 | + | ||
259 | + if(is_numeric($this->quantidade_saia)){ | ||
260 | + $campos .= "{$gruda}quantidade_saia"; | ||
261 | + $valores .= "{$gruda}{$this->quantidade_saia}"; | ||
262 | + $gruda = ", "; | ||
263 | + } | ||
264 | + | ||
265 | + $campos .= "{$gruda}tamanho_saia"; | ||
266 | + $valores .= "{$gruda}'{$this->tamanho_saia}'"; | ||
267 | + $gruda = ", "; | ||
268 | + | ||
269 | + if(is_numeric($this->quantidade_calcado)){ | ||
270 | + $campos .= "{$gruda}quantidade_calcado"; | ||
271 | + $valores .= "{$gruda}{$this->quantidade_calcado}"; | ||
272 | + $gruda = ", "; | ||
273 | + } | ||
274 | + | ||
275 | + $campos .= "{$gruda}tamanho_calcado"; | ||
276 | + $valores .= "{$gruda}'{$this->tamanho_calcado}'"; | ||
277 | + $gruda = ", "; | ||
278 | + | ||
279 | + if(is_numeric($this->quantidade_meia)){ | ||
280 | + $campos .= "{$gruda}quantidade_meia"; | ||
281 | + $valores .= "{$gruda}{$this->quantidade_meia}"; | ||
282 | + $gruda = ", "; | ||
283 | + } | ||
284 | + | ||
285 | + $campos .= "{$gruda}tamanho_meia"; | ||
286 | + $valores .= "{$gruda}'{$this->tamanho_meia}'"; | ||
287 | + $gruda = ", "; | ||
288 | + | ||
289 | + $db->Consulta("INSERT INTO {$this->_tabela} ( $campos ) VALUES( $valores )"); | ||
290 | + return $this->ref_cod_aluno; | ||
291 | + } | ||
292 | + | ||
293 | + return FALSE; | ||
294 | + } | ||
295 | + | ||
296 | + /** | ||
297 | + * Edita os dados de um registro. | ||
298 | + * @return bool | ||
299 | + */ | ||
300 | + function edita() | ||
301 | + { | ||
302 | + if (is_numeric($this->ref_cod_aluno)) { | ||
303 | + $db = new clsBanco(); | ||
304 | + $set = ''; | ||
305 | + | ||
306 | + $set .= "recebeu_uniforme = '{$this->recebeu_uniforme}'"; | ||
307 | + | ||
308 | + if (is_numeric($this->quantidade_camiseta)) | ||
309 | + $set .= ",quantidade_camiseta = '{$this->quantidade_camiseta}'"; | ||
310 | + else{ | ||
311 | + $set .= ",quantidade_camiseta = NULL"; | ||
312 | + } | ||
313 | + | ||
314 | + $set .= ",tamanho_camiseta = '{$this->tamanho_camiseta}'"; | ||
315 | + | ||
316 | + if (is_numeric($this->quantidade_blusa_jaqueta)) | ||
317 | + $set .= ",quantidade_blusa_jaqueta = '{$this->quantidade_blusa_jaqueta}'"; | ||
318 | + else{ | ||
319 | + $set .= ",quantidade_blusa_jaqueta = NULL"; | ||
320 | + } | ||
321 | + | ||
322 | + $set .= ",tamanho_blusa_jaqueta = '{$this->tamanho_blusa_jaqueta}'"; | ||
323 | + | ||
324 | + if (is_numeric($this->quantidade_bermuda)) | ||
325 | + $set .= ",quantidade_bermuda = '{$this->quantidade_bermuda}'"; | ||
326 | + else{ | ||
327 | + $set .= ",quantidade_bermuda = NULL"; | ||
328 | + } | ||
329 | + | ||
330 | + $set .= ",tamanho_bermuda = '{$this->tamanho_bermuda}'"; | ||
331 | + | ||
332 | + if (is_numeric($this->quantidade_calca)) | ||
333 | + $set .= ",quantidade_calca = '{$this->quantidade_calca}'"; | ||
334 | + else{ | ||
335 | + $set .= ",quantidade_calca = NULL"; | ||
336 | + } | ||
337 | + | ||
338 | + $set .= ",tamanho_calca = '{$this->tamanho_calca}'"; | ||
339 | + | ||
340 | + if (is_numeric($this->quantidade_saia)) | ||
341 | + $set .= ",quantidade_saia = '{$this->quantidade_saia}'"; | ||
342 | + else{ | ||
343 | + $set .= ",quantidade_saia = NULL"; | ||
344 | + } | ||
345 | + | ||
346 | + $set .= ",tamanho_saia = '{$this->tamanho_saia}'"; | ||
347 | + | ||
348 | + if (is_numeric($this->quantidade_calcado)) | ||
349 | + $set .= ",quantidade_calcado = '{$this->quantidade_calcado}'"; | ||
350 | + else{ | ||
351 | + $set .= ",quantidade_calcado = NULL"; | ||
352 | + } | ||
353 | + | ||
354 | + $set .= ",tamanho_calcado = '{$this->tamanho_calcado}'"; | ||
355 | + | ||
356 | + if (is_numeric($this->quantidade_meia)) | ||
357 | + $set .= ",quantidade_meia = '{$this->quantidade_meia}'"; | ||
358 | + else{ | ||
359 | + $set .= ",quantidade_meia = NULL"; | ||
360 | + } | ||
361 | + | ||
362 | + $set .= ",tamanho_meia = '{$this->tamanho_meia}'"; | ||
363 | + | ||
364 | + if ($set) { | ||
365 | + $db->Consulta("UPDATE {$this->_tabela} SET $set WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); | ||
366 | + return TRUE; | ||
367 | + } | ||
368 | + } | ||
369 | + | ||
370 | + return FALSE; | ||
371 | + } | ||
372 | + | ||
373 | + /** | ||
374 | + * Retorna uma lista de registros filtrados de acordo com os parâmetros. | ||
375 | + * @return array | ||
376 | + */ | ||
377 | + function lista() | ||
378 | + { | ||
379 | + $sql = "SELECT {$this->_campos_lista} FROM {$this->_tabela}"; | ||
380 | + $filtros = ""; | ||
381 | + // implementar | ||
382 | + | ||
383 | + $db = new clsBanco(); | ||
384 | + $countCampos = count(explode(',', $this->_campos_lista))+2; | ||
385 | + $resultado = array(); | ||
386 | + | ||
387 | + $sql .= $filtros . $this->getOrderby() . $this->getLimite(); | ||
388 | + | ||
389 | + $this->_total = $db->CampoUnico("SELECT COUNT(0) FROM {$this->_tabela} {$filtros}"); | ||
390 | + | ||
391 | + $db->Consulta($sql); | ||
392 | + | ||
393 | + if ($countCampos > 1) { | ||
394 | + while ($db->ProximoRegistro()) { | ||
395 | + $tupla = $db->Tupla(); | ||
396 | + $tupla["_total"] = $this->_total; | ||
397 | + $resultado[] = $tupla; | ||
398 | + } | ||
399 | + } | ||
400 | + else { | ||
401 | + while ($db->ProximoRegistro()) { | ||
402 | + $tupla = $db->Tupla(); | ||
403 | + $resultado[] = $tupla[$this->_campos_lista]; | ||
404 | + } | ||
405 | + } | ||
406 | + if (count($resultado)) { | ||
407 | + return $resultado; | ||
408 | + } | ||
409 | + | ||
410 | + return FALSE; | ||
411 | + } | ||
412 | + | ||
413 | + /** | ||
414 | + * Retorna um array com os dados de um registro. | ||
415 | + * @return array | ||
416 | + */ | ||
417 | + function detalhe() | ||
418 | + { | ||
419 | + if (is_numeric($this->ref_cod_aluno)) { | ||
420 | + $db = new clsBanco(); | ||
421 | + $db->Consulta("SELECT {$this->_todos_campos} FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); | ||
422 | + $db->ProximoRegistro(); | ||
423 | + return $db->Tupla(); | ||
424 | + } | ||
425 | + | ||
426 | + return FALSE; | ||
427 | + } | ||
428 | + | ||
429 | + /** | ||
430 | + * Retorna um array com os dados de um registro. | ||
431 | + * @return array | ||
432 | + */ | ||
433 | + function existe() | ||
434 | + { | ||
435 | + if (is_numeric($this->ref_cod_aluno)) { | ||
436 | + $db = new clsBanco(); | ||
437 | + $db->Consulta("SELECT 1 FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"); | ||
438 | + $db->ProximoRegistro(); | ||
439 | + return $db->Tupla(); | ||
440 | + } | ||
441 | + | ||
442 | + return FALSE; | ||
443 | + } | ||
444 | + | ||
445 | + /** | ||
446 | + * Exclui um registro. | ||
447 | + * @return bool | ||
448 | + */ | ||
449 | + function excluir() | ||
450 | + { | ||
451 | + if (is_numeric($this->ref_cod_aluno)) { | ||
452 | + $sql = "DELETE FROM {$this->_tabela} WHERE ref_cod_aluno = '{$this->ref_cod_aluno}'"; | ||
453 | + $db = new clsBanco(); | ||
454 | + $db->Consulta($sql); | ||
455 | + return true; | ||
456 | + } | ||
457 | + | ||
458 | + return FALSE; | ||
459 | + } | ||
460 | + | ||
461 | + /** | ||
462 | + * Define quais campos da tabela serão selecionados no método Lista(). | ||
463 | + */ | ||
464 | + function setCamposLista($str_campos) | ||
465 | + { | ||
466 | + $this->_campos_lista = $str_campos; | ||
467 | + } | ||
468 | + | ||
469 | + /** | ||
470 | + * Define que o método Lista() deverpa retornar todos os campos da tabela. | ||
471 | + */ | ||
472 | + function resetCamposLista() | ||
473 | + { | ||
474 | + $this->_campos_lista = $this->_todos_campos; | ||
475 | + } | ||
476 | + | ||
477 | + /** | ||
478 | + * Define limites de retorno para o método Lista(). | ||
479 | + */ | ||
480 | + function setLimite($intLimiteQtd, $intLimiteOffset = NULL) | ||
481 | + { | ||
482 | + $this->_limite_quantidade = $intLimiteQtd; | ||
483 | + $this->_limite_offset = $intLimiteOffset; | ||
484 | + } | ||
485 | + | ||
486 | + /** | ||
487 | + * Retorna a string com o trecho da query responsável pelo limite de | ||
488 | + * registros retornados/afetados. | ||
489 | + * | ||
490 | + * @return string | ||
491 | + */ | ||
492 | + function getLimite() | ||
493 | + { | ||
494 | + if (is_numeric($this->_limite_quantidade)) { | ||
495 | + $retorno = " LIMIT {$this->_limite_quantidade}"; | ||
496 | + if (is_numeric($this->_limite_offset)) { | ||
497 | + $retorno .= " OFFSET {$this->_limite_offset} "; | ||
498 | + } | ||
499 | + return $retorno; | ||
500 | + } | ||
501 | + return ''; | ||
502 | + } | ||
503 | + | ||
504 | + /** | ||
505 | + * Define o campo para ser utilizado como ordenação no método Lista(). | ||
506 | + */ | ||
507 | + function setOrderby($strNomeCampo) | ||
508 | + { | ||
509 | + if (is_string($strNomeCampo) && $strNomeCampo ) { | ||
510 | + $this->_campo_order_by = $strNomeCampo; | ||
511 | + } | ||
512 | + } | ||
513 | + | ||
514 | + /** | ||
515 | + * Retorna a string com o trecho da query responsável pela Ordenação dos | ||
516 | + * registros. | ||
517 | + * | ||
518 | + * @return string | ||
519 | + */ | ||
520 | + function getOrderby() | ||
521 | + { | ||
522 | + if (is_string($this->_campo_order_by)) { | ||
523 | + return " ORDER BY {$this->_campo_order_by} "; | ||
524 | + } | ||
525 | + return ''; | ||
526 | + } | ||
527 | +} | ||
0 | \ No newline at end of file | 528 | \ No newline at end of file |
ieducar/misc/database/deltas/portabilis/61_cria_ficha_medica_aluno.sql
0 → 100644
@@ -0,0 +1,71 @@ | @@ -0,0 +1,71 @@ | ||
1 | +-- // | ||
2 | + | ||
3 | + -- | ||
4 | + -- Cria tabela e seq para ficha médica do aluno | ||
5 | + -- | ||
6 | + -- @author Lucas Schmoeller da Silva <lucas@portabilis.com.br> | ||
7 | + -- @license @@license@@ | ||
8 | + -- @version ? | ||
9 | + | ||
10 | + CREATE TABLE modules.ficha_medica_aluno | ||
11 | + ( | ||
12 | + ref_cod_aluno integer NOT NULL, | ||
13 | + altura character(4), | ||
14 | + peso character(7), | ||
15 | + grupo_sanguineo character(2), | ||
16 | + fator_rh character(1), | ||
17 | + alergia_medicamento character(1), | ||
18 | + desc_alergia_medicamento character varying(100), | ||
19 | + alergia_alimento character(1), | ||
20 | + desc_alergia_alimento character varying(100), | ||
21 | + doenca_congenita character(1), | ||
22 | + desc_doenca_congenita character varying(100), | ||
23 | + fumante character(1), | ||
24 | + doenca_caxumba character(1), | ||
25 | + doenca_sarampo character(1), | ||
26 | + doenca_rubeola character(1), | ||
27 | + doenca_catapora character(1), | ||
28 | + doenca_escarlatina character(1), | ||
29 | + doenca_coqueluche character(1), | ||
30 | + doenca_outras character varying(100), | ||
31 | + epiletico character(1), | ||
32 | + epiletico_tratamento character(1), | ||
33 | + hemofilico character(1), | ||
34 | + hipertenso character(1), | ||
35 | + asmatico character(1), | ||
36 | + diabetico character(1), | ||
37 | + insulina character(1), | ||
38 | + tratamento_medico character(1), | ||
39 | + desc_tratamento_medico character varying(100), | ||
40 | + medicacao_especifica character(1), | ||
41 | + desc_medicacao_especifica character varying(100), | ||
42 | + acomp_medico_psicologico character(1), | ||
43 | + desc_acomp_medico_psicologico character varying(100), | ||
44 | + restricao_atividade_fisica character(1), | ||
45 | + desc_restricao_atividade_fisica character varying(100), | ||
46 | + fratura_trauma character(1), | ||
47 | + desc_fratura_trauma character varying(100), | ||
48 | + plano_saude character(1), | ||
49 | + desc_plano_saude character varying(50), | ||
50 | + hospital_clinica character varying(100), | ||
51 | + hospital_clinica_endereco character varying(50), | ||
52 | + hospital_clinica_telefone character varying(20), | ||
53 | + responsavel character varying(50), | ||
54 | + responsavel_parentesco character varying(20), | ||
55 | + responsavel_parentesco_telefone character varying(20), | ||
56 | + responsavel_parentesco_celular character varying(20), | ||
57 | + observacao character varying(255), | ||
58 | + CONSTRAINT ficha_medica_cod_aluno_pkey PRIMARY KEY (ref_cod_aluno) | ||
59 | + CONSTRAINT ficha_medica_aluno_fkey FOREIGN KEY (ref_cod_aluno) | ||
60 | + REFERENCES pmieducar.aluno(cod_aluno) MATCH SIMPLE | ||
61 | + ON UPDATE RESTRICT ON DELETE RESTRICT | ||
62 | + ) | ||
63 | + WITH ( | ||
64 | + OIDS=TRUE | ||
65 | + ); | ||
66 | + | ||
67 | + -- //@UNDO | ||
68 | + | ||
69 | + DROP TABLE modules.ficha_medica_aluno | ||
70 | + | ||
71 | + -- // | ||
0 | \ No newline at end of file | 72 | \ No newline at end of file |
ieducar/misc/database/deltas/portabilis/62_cria_uniforme_escolar.sql
0 → 100644
@@ -0,0 +1,41 @@ | @@ -0,0 +1,41 @@ | ||
1 | + -- // | ||
2 | + | ||
3 | + -- | ||
4 | + -- Cria tabela para uniforme escolar do aluno | ||
5 | + -- | ||
6 | + -- @author Lucas Schmoeller da Silva <lucas@portabilis.com.br> | ||
7 | + -- @license @@license@@ | ||
8 | + -- @version ? | ||
9 | + | ||
10 | + CREATE TABLE modules.uniforme_aluno | ||
11 | + ( | ||
12 | + ref_cod_aluno integer NOT NULL, | ||
13 | + recebeu_uniforme character(1), | ||
14 | + quantidade_camiseta integer, | ||
15 | + tamanho_camiseta character(2), | ||
16 | + quantidade_blusa_jaqueta integer, | ||
17 | + tamanho_blusa_jaqueta character(2), | ||
18 | + quantidade_bermuda integer, | ||
19 | + tamanho_bermuda character(2), | ||
20 | + quantidade_calca integer, | ||
21 | + tamanho_calca character(2), | ||
22 | + quantidade_saia integer, | ||
23 | + tamanho_saia character(2), | ||
24 | + quantidade_calcado integer, | ||
25 | + tamanho_calcado character(2), | ||
26 | + quantidade_meia integer, | ||
27 | + tamanho_meia character(2), | ||
28 | + CONSTRAINT uniforme_aluno_pkey PRIMARY KEY (ref_cod_aluno), | ||
29 | + CONSTRAINT uniforme_aluno_fkey FOREIGN KEY (ref_cod_aluno) | ||
30 | + REFERENCES pmieducar.aluno(cod_aluno) MATCH SIMPLE | ||
31 | + ON UPDATE RESTRICT ON DELETE RESTRICT | ||
32 | + ) | ||
33 | + WITH ( | ||
34 | + OIDS=TRUE | ||
35 | + ); | ||
36 | + | ||
37 | + -- //@UNDO | ||
38 | + | ||
39 | + DROP TABLE modules.uniforme_aluno | ||
40 | + | ||
41 | + -- // | ||
0 | \ No newline at end of file | 42 | \ No newline at end of file |
ieducar/misc/database/deltas/portabilis/63_cria_tabela_moradia_aluno.sql
0 → 100644
@@ -0,0 +1,55 @@ | @@ -0,0 +1,55 @@ | ||
1 | +-- // | ||
2 | + | ||
3 | + -- | ||
4 | + -- Cria tabela moradia_aluno com dados sobre a moradia de um aluno | ||
5 | + -- | ||
6 | + -- @author Lucas Schmoeller da Silva <lucas@portabilis.com.br> | ||
7 | + -- @license @@license@@ | ||
8 | + -- @version $Id$ | ||
9 | + | ||
10 | + CREATE TABLE modules.moradia_aluno | ||
11 | + ( | ||
12 | + ref_cod_aluno integer NOT NULL, | ||
13 | + moradia character(1), | ||
14 | + material character(1) DEFAULT ('A'), | ||
15 | + casa_outra character varying(20), | ||
16 | + moradia_situacao integer, | ||
17 | + quartos integer, | ||
18 | + sala integer, | ||
19 | + copa integer, | ||
20 | + banheiro integer, | ||
21 | + garagem integer, | ||
22 | + empregada_domestica character(1), | ||
23 | + automovel character(1), | ||
24 | + motocicleta character(1), | ||
25 | + computador character(1), | ||
26 | + geladeira character(1), | ||
27 | + fogao character(1), | ||
28 | + maquina_lavar character(1), | ||
29 | + microondas character(1), | ||
30 | + video_dvd character(1), | ||
31 | + televisao character(1), | ||
32 | + celular character(1), | ||
33 | + telefone character(1), | ||
34 | + quant_pessoas integer, | ||
35 | + renda double precision, | ||
36 | + agua_encanada character(1), | ||
37 | + poco character(1), | ||
38 | + energia character(1), | ||
39 | + esgoto character(1), | ||
40 | + fossa character(1), | ||
41 | + lixo character(1), | ||
42 | + CONSTRAINT moradia_aluno_pkei PRIMARY KEY (ref_cod_aluno), | ||
43 | + CONSTRAINT moradia_aluno_fkey FOREIGN KEY (ref_cod_aluno) | ||
44 | + REFERENCES pmieducar.aluno(cod_aluno) MATCH SIMPLE | ||
45 | + ON UPDATE RESTRICT ON DELETE RESTRICT | ||
46 | + ) | ||
47 | + WITH ( | ||
48 | + OIDS=TRUE | ||
49 | + ); | ||
50 | + | ||
51 | + -- //@UNDO | ||
52 | + | ||
53 | + DROP TABLE modules.moradia_aluno; | ||
54 | + | ||
55 | + -- // | ||
0 | \ No newline at end of file | 56 | \ No newline at end of file |
ieducar/modules/Api/Views/AlunoController.php
@@ -33,6 +33,9 @@ | @@ -33,6 +33,9 @@ | ||
33 | */ | 33 | */ |
34 | 34 | ||
35 | require_once 'include/pmieducar/clsPmieducarAluno.inc.php'; | 35 | require_once 'include/pmieducar/clsPmieducarAluno.inc.php'; |
36 | +require_once 'include/modules/clsModulesFichaMedicaAluno.inc.php'; | ||
37 | +require_once 'include/modules/clsModulesUniformeAluno.inc.php'; | ||
38 | +require_once 'include/modules/clsModulesMoradiaAluno.inc.php'; | ||
36 | 39 | ||
37 | require_once 'App/Model/MatriculaSituacao.php'; | 40 | require_once 'App/Model/MatriculaSituacao.php'; |
38 | 41 | ||
@@ -267,6 +270,130 @@ class AlunoController extends ApiCoreController | @@ -267,6 +270,130 @@ class AlunoController extends ApiCoreController | ||
267 | return $this->saveEntity($dataMapper, $entity); | 270 | return $this->saveEntity($dataMapper, $entity); |
268 | } | 271 | } |
269 | 272 | ||
273 | + protected function createOrUpdateFichaMedica($id) { | ||
274 | + | ||
275 | + $obj = new clsModulesFichaMedicaAluno(); | ||
276 | + | ||
277 | + $obj->ref_cod_aluno = $id; | ||
278 | + $obj->altura = Portabilis_String_Utils::toLatin1($this->getRequest()->altura); | ||
279 | + $obj->peso = Portabilis_String_Utils::toLatin1($this->getRequest()->peso); | ||
280 | + $obj->grupo_sanguineo = Portabilis_String_Utils::toLatin1($this->getRequest()->grupo_sanguineo); | ||
281 | + $obj->fator_rh = Portabilis_String_Utils::toLatin1($this->getRequest()->fator_rh); | ||
282 | + $obj->alergia_medicamento = ($this->getRequest()->alergia_medicamento == 'on' ? 'S' : 'N'); | ||
283 | + $obj->desc_alergia_medicamento = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_alergia_medicamento); | ||
284 | + $obj->alergia_alimento = ($this->getRequest()->alergia_alimento == 'on' ? 'S' : 'N'); | ||
285 | + $obj->desc_alergia_alimento = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_alergia_alimento); | ||
286 | + $obj->doenca_congenita = ($this->getRequest()->doenca_congenita == 'on' ? 'S' : 'N'); | ||
287 | + $obj->desc_doenca_congenita = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_doenca_congenita); | ||
288 | + $obj->fumante = ($this->getRequest()->fumante == 'on' ? 'S' : 'N'); | ||
289 | + $obj->doenca_caxumba = ($this->getRequest()->doenca_caxumba == 'on' ? 'S' : 'N'); | ||
290 | + $obj->doenca_sarampo = ($this->getRequest()->doenca_sarampo == 'on' ? 'S' : 'N'); | ||
291 | + $obj->doenca_rubeola = ($this->getRequest()->doenca_rubeola == 'on' ? 'S' : 'N'); | ||
292 | + $obj->doenca_catapora = ($this->getRequest()->doenca_catapora == 'on' ? 'S' : 'N'); | ||
293 | + $obj->doenca_escarlatina = ($this->getRequest()->doenca_escarlatina == 'on' ? 'S' : 'N'); | ||
294 | + $obj->doenca_coqueluche = ($this->getRequest()->doenca_coqueluche == 'on' ? 'S' : 'N'); | ||
295 | + $obj->doenca_outras = Portabilis_String_Utils::toLatin1($this->getRequest()->doenca_outras); | ||
296 | + $obj->epiletico = ($this->getRequest()->epiletico == 'on' ? 'S' : 'N'); | ||
297 | + $obj->epiletico_tratamento = ($this->getRequest()->epiletico_tratamento == 'on' ? 'S' : 'N'); | ||
298 | + $obj->hemofilico = ($this->getRequest()->hemofilico == 'on' ? 'S' : 'N'); | ||
299 | + $obj->hipertenso = ($this->getRequest()->hipertenso == 'on' ? 'S' : 'N'); | ||
300 | + $obj->asmatico = ($this->getRequest()->asmatico == 'on' ? 'S' : 'N'); | ||
301 | + $obj->diabetico = ($this->getRequest()->diabetico == 'on' ? 'S' : 'N'); | ||
302 | + $obj->insulina = ($this->getRequest()->insulina == 'on' ? 'S' : 'N'); | ||
303 | + $obj->tratamento_medico = ($this->getRequest()->tratamento_medico == 'on' ? 'S' : 'N'); | ||
304 | + $obj->desc_tratamento_medico = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_tratamento_medico); | ||
305 | + $obj->medicacao_especifica = ($this->getRequest()->medicacao_especifica == 'on' ? 'S' : 'N'); | ||
306 | + $obj->desc_medicacao_especifica = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_medicacao_especifica); | ||
307 | + $obj->acomp_medico_psicologico = ($this->getRequest()->acomp_medico_psicologico == 'on' ? 'S' : 'N'); | ||
308 | + $obj->desc_acomp_medico_psicologico = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_acomp_medico_psicologico); | ||
309 | + $obj->acomp_medico_psicologico = ($this->getRequest()->acomp_medico_psicologico == 'on' ? 'S' : 'N'); | ||
310 | + $obj->desc_acomp_medico_psicologico = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_acomp_medico_psicologico); | ||
311 | + $obj->restricao_atividade_fisica = ($this->getRequest()->restricao_atividade_fisica == 'on' ? 'S' : 'N'); | ||
312 | + $obj->desc_restricao_atividade_fisica = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_restricao_atividade_fisica); | ||
313 | + $obj->fratura_trauma = ($this->getRequest()->fratura_trauma == 'on' ? 'S' : 'N'); | ||
314 | + $obj->desc_fratura_trauma = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_fratura_trauma); | ||
315 | + $obj->plano_saude = ($this->getRequest()->plano_saude == 'on' ? 'S' : 'N'); | ||
316 | + $obj->desc_plano_saude = Portabilis_String_Utils::toLatin1($this->getRequest()->desc_plano_saude); | ||
317 | + $obj->hospital_clinica = Portabilis_String_Utils::toLatin1($this->getRequest()->hospital_clinica); | ||
318 | + $obj->hospital_clinica_endereco = Portabilis_String_Utils::toLatin1($this->getRequest()->hospital_clinica_endereco); | ||
319 | + $obj->hospital_clinica_telefone = Portabilis_String_Utils::toLatin1($this->getRequest()->hospital_clinica_telefone); | ||
320 | + $obj->responsavel = Portabilis_String_Utils::toLatin1($this->getRequest()->responsavel); | ||
321 | + $obj->responsavel_parentesco = Portabilis_String_Utils::toLatin1($this->getRequest()->responsavel_parentesco); | ||
322 | + $obj->responsavel_parentesco_telefone = Portabilis_String_Utils::toLatin1($this->getRequest()->responsavel_parentesco_telefone); | ||
323 | + $obj->responsavel_parentesco_celular = Portabilis_String_Utils::toLatin1($this->getRequest()->responsavel_parentesco_celular); | ||
324 | + | ||
325 | + return ($obj->existe() ? $obj->edita() : $obj->cadastra()); | ||
326 | + } | ||
327 | + | ||
328 | +protected function createOrUpdateUniforme($id) { | ||
329 | + | ||
330 | + $obj = new clsModulesUniformeAluno(); | ||
331 | + | ||
332 | + $obj->ref_cod_aluno = $id; | ||
333 | + $obj->recebeu_uniforme = ($this->getRequest()->recebeu_uniforme == 'on' ? 'S' : 'N'); | ||
334 | + | ||
335 | + $obj->quantidade_camiseta = $this->getRequest()->quantidade_camiseta; | ||
336 | + $obj->tamanho_camiseta = Portabilis_String_Utils::toLatin1($this->getRequest()->tamanho_camiseta); | ||
337 | + | ||
338 | + $obj->quantidade_calca = $this->getRequest()->quantidade_calca; | ||
339 | + $obj->tamanho_calca = Portabilis_String_Utils::toLatin1($this->getRequest()->tamanho_calca); | ||
340 | + | ||
341 | + $obj->quantidade_bermuda = $this->getRequest()->quantidade_bermuda; | ||
342 | + $obj->tamanho_bermuda = Portabilis_String_Utils::toLatin1($this->getRequest()->tamanho_bermuda); | ||
343 | + | ||
344 | + $obj->quantidade_meia = $this->getRequest()->quantidade_meia; | ||
345 | + $obj->tamanho_meia = Portabilis_String_Utils::toLatin1($this->getRequest()->tamanho_meia); | ||
346 | + | ||
347 | + $obj->quantidade_saia = $this->getRequest()->quantidade_saia; | ||
348 | + $obj->tamanho_saia = Portabilis_String_Utils::toLatin1($this->getRequest()->tamanho_saia); | ||
349 | + | ||
350 | + $obj->quantidade_calcado = $this->getRequest()->quantidade_calcado; | ||
351 | + $obj->tamanho_calcado = Portabilis_String_Utils::toLatin1($this->getRequest()->tamanho_calcado); | ||
352 | + | ||
353 | + $obj->quantidade_blusa_jaqueta = $this->getRequest()->quantidade_blusa_jaqueta; | ||
354 | + $obj->tamanho_blusa_jaqueta = Portabilis_String_Utils::toLatin1($this->getRequest()->tamanho_blusa_jaqueta); | ||
355 | + | ||
356 | + return ($obj->existe() ? $obj->edita() : $obj->cadastra()); | ||
357 | + } | ||
358 | + | ||
359 | + protected function createOrUpdateMoradia($id) { | ||
360 | + | ||
361 | + $obj = new clsModulesMoradiaAluno(); | ||
362 | + | ||
363 | + $obj->ref_cod_aluno = $id; | ||
364 | + | ||
365 | + $obj->moradia = $this->getRequest()->moradia; | ||
366 | + $obj->material = $this->getRequest()->material; | ||
367 | + $obj->casa_outra = Portabilis_String_Utils::toLatin1($this->getRequest()->casa_outra); | ||
368 | + $obj->moradia_situacao = $this->getRequest()->moradia_situacao; | ||
369 | + $obj->quartos = $this->getRequest()->quartos; | ||
370 | + $obj->sala = $this->getRequest()->sala; | ||
371 | + $obj->copa = $this->getRequest()->copa; | ||
372 | + $obj->banheiro = $this->getRequest()->banheiro; | ||
373 | + $obj->garagem = $this->getRequest()->garagem; | ||
374 | + $obj->empregada_domestica = ($this->getRequest()->empregada_domestica == 'on' ? 'S' : 'N'); | ||
375 | + $obj->automovel = ($this->getRequest()->automovel == 'on' ? 'S' : 'N'); | ||
376 | + $obj->motocicleta = ($this->getRequest()->motocicleta == 'on' ? 'S' : 'N'); | ||
377 | + $obj->computador = ($this->getRequest()->computador == 'on' ? 'S' : 'N'); | ||
378 | + $obj->geladeira = ($this->getRequest()->geladeira == 'on' ? 'S' : 'N'); | ||
379 | + $obj->fogao = ($this->getRequest()->fogao == 'on' ? 'S' : 'N'); | ||
380 | + $obj->maquina_lavar = ($this->getRequest()->maquina_lavar == 'on' ? 'S' : 'N'); | ||
381 | + $obj->microondas = ($this->getRequest()->microondas == 'on' ? 'S' : 'N'); | ||
382 | + $obj->video_dvd = ($this->getRequest()->video_dvd == 'on' ? 'S' : 'N'); | ||
383 | + $obj->televisao = ($this->getRequest()->televisao == 'on' ? 'S' : 'N'); | ||
384 | + $obj->celular = ($this->getRequest()->celular == 'on' ? 'S' : 'N'); | ||
385 | + $obj->telefone = ($this->getRequest()->telefone == 'on' ? 'S' : 'N'); | ||
386 | + $obj->quant_pessoas = $this->getRequest()->quant_pessoas; | ||
387 | + $obj->renda = floatval(preg_replace("/[^0-9\.]/", "", str_replace(",", ".", $this->getRequest()->renda))); | ||
388 | + $obj->agua_encanada = ($this->getRequest()->agua_encanada == 'on' ? 'S' : 'N'); | ||
389 | + $obj->poco = ($this->getRequest()->poco == 'on' ? 'S' : 'N'); | ||
390 | + $obj->energia = ($this->getRequest()->energia == 'on' ? 'S' : 'N'); | ||
391 | + $obj->esgoto = ($this->getRequest()->esgoto == 'on' ? 'S' : 'N'); | ||
392 | + $obj->fossa = ($this->getRequest()->fossa == 'on' ? 'S' : 'N'); | ||
393 | + $obj->lixo = ($this->getRequest()->lixo == 'on' ? 'S' : 'N'); | ||
394 | + | ||
395 | + return ($obj->existe() ? $obj->edita() : $obj->cadastra()); | ||
396 | + } | ||
270 | 397 | ||
271 | protected function loadAlunoInepId($alunoId) { | 398 | protected function loadAlunoInepId($alunoId) { |
272 | $dataMapper = $this->getDataMapperFor('educacenso', 'aluno'); | 399 | $dataMapper = $this->getDataMapperFor('educacenso', 'aluno'); |
@@ -398,15 +525,29 @@ class AlunoController extends ApiCoreController | @@ -398,15 +525,29 @@ class AlunoController extends ApiCoreController | ||
398 | } | 525 | } |
399 | 526 | ||
400 | protected function loadTransferenciaDataEntrada($matriculaId) { | 527 | protected function loadTransferenciaDataEntrada($matriculaId) { |
528 | + /* | ||
529 | + $sql = "select to_char(data_transferencia, 'DD/MM/YYYY') from | ||
530 | + pmieducar.transferencia_solicitacao where ref_cod_matricula_entrada = $1 and ativo = 1";*/ | ||
401 | $sql = "select to_char(data_cadastro, 'DD/MM/YYYY') from pmieducar.matricula | 531 | $sql = "select to_char(data_cadastro, 'DD/MM/YYYY') from pmieducar.matricula |
402 | - where cod_matricula=$1 and ativo = 1"; | 532 | + where cod_matricula=$1 and ativo = 1"; |
403 | 533 | ||
404 | return Portabilis_Utils_Database::selectField($sql, $matriculaId); | 534 | return Portabilis_Utils_Database::selectField($sql, $matriculaId); |
405 | } | 535 | } |
406 | 536 | ||
537 | + protected function loadNomeTurmaOrigem($matriculaId) { | ||
538 | + $sql = "select nm_turma from pmieducar.matricula_turma mt | ||
539 | + left join pmieducar.turma t on (t.cod_turma = mt.ref_cod_turma) | ||
540 | + where ref_cod_matricula = $1 and mt.ativo = 0 and mt.ref_cod_turma <> COALESCE((select ref_cod_turma from pmieducar.matricula_turma | ||
541 | + where ref_cod_matricula = $1 and ativo = 1 limit 1),0) order by mt.data_exclusao desc limit 1"; | ||
542 | + | ||
543 | + return $this->toUtf8(Portabilis_Utils_Database::selectField($sql, $matriculaId), array('transform' => true)); | ||
544 | + } | ||
545 | + | ||
407 | protected function loadTransferenciaDataSaida($matriculaId) { | 546 | protected function loadTransferenciaDataSaida($matriculaId) { |
547 | + /*$sql = "select to_char(data_transferencia, 'DD/MM/YYYY') from | ||
548 | + pmieducar.transferencia_solicitacao where ref_cod_matricula_saida = $1 and ativo = 1";*/ | ||
408 | $sql = "select to_char(data_exclusao, 'DD/MM/YYYY') from pmieducar.matricula | 549 | $sql = "select to_char(data_exclusao, 'DD/MM/YYYY') from pmieducar.matricula |
409 | - where cod_matricula=$1 and ativo = 1 and (aprovado=4 or aprovado=6)"; | 550 | + where cod_matricula=$1 and ativo = 1 and (aprovado=4 or aprovado=6)"; |
410 | 551 | ||
411 | return Portabilis_Utils_Database::selectField($sql, $matriculaId); | 552 | return Portabilis_Utils_Database::selectField($sql, $matriculaId); |
412 | } | 553 | } |
@@ -613,6 +754,34 @@ class AlunoController extends ApiCoreController | @@ -613,6 +754,34 @@ class AlunoController extends ApiCoreController | ||
613 | 754 | ||
614 | $aluno['destroyed_at'] = Portabilis_Date_Utils::pgSQLToBr($aluno['destroyed_at']); | 755 | $aluno['destroyed_at'] = Portabilis_Date_Utils::pgSQLToBr($aluno['destroyed_at']); |
615 | 756 | ||
757 | + $objFichaMedica = new clsModulesFichaMedicaAluno($id); | ||
758 | + if ($objFichaMedica->existe()){ | ||
759 | + $objFichaMedica = $objFichaMedica->detalhe(); | ||
760 | + foreach ($objFichaMedica as $chave => $value) { | ||
761 | + $objFichaMedica[$chave] = Portabilis_String_Utils::toUtf8($value); | ||
762 | + } | ||
763 | + $aluno = Portabilis_Array_Utils::merge($objFichaMedica,$aluno); | ||
764 | + } | ||
765 | + | ||
766 | + $objUniforme = new clsModulesUniformeAluno($id); | ||
767 | + if ($objUniforme->existe()){ | ||
768 | + $objUniforme = $objUniforme->detalhe(); | ||
769 | + foreach ($objUniforme as $chave => $value) { | ||
770 | + $objUniforme[$chave] = Portabilis_String_Utils::toUtf8($value); | ||
771 | + } | ||
772 | + $aluno = Portabilis_Array_Utils::merge($objUniforme,$aluno); | ||
773 | + } | ||
774 | + | ||
775 | + $objMoradia = new clsModulesMoradiaAluno($id); | ||
776 | + if ($objMoradia->existe()){ | ||
777 | + $objMoradia = $objMoradia->detalhe(); | ||
778 | + foreach ($objMoradia as $chave => $value) { | ||
779 | + $objMoradia[$chave] = Portabilis_String_Utils::toUtf8($value); | ||
780 | + } | ||
781 | + $aluno = Portabilis_Array_Utils::merge($objMoradia,$aluno); | ||
782 | + } | ||
783 | + | ||
784 | + | ||
616 | return $aluno; | 785 | return $aluno; |
617 | } | 786 | } |
618 | } | 787 | } |
@@ -661,6 +830,7 @@ class AlunoController extends ApiCoreController | @@ -661,6 +830,7 @@ class AlunoController extends ApiCoreController | ||
661 | $matriculas[$index]['escola_nome'] = $this->loadEscolaNome($matricula['escola_id']); | 830 | $matriculas[$index]['escola_nome'] = $this->loadEscolaNome($matricula['escola_id']); |
662 | $matriculas[$index]['curso_nome'] = $this->loadCursoNome($matricula['curso_id']); | 831 | $matriculas[$index]['curso_nome'] = $this->loadCursoNome($matricula['curso_id']); |
663 | $matriculas[$index]['serie_nome'] = $this->loadSerieNome($matricula['serie_id']); | 832 | $matriculas[$index]['serie_nome'] = $this->loadSerieNome($matricula['serie_id']); |
833 | + $matriculas[$index]['ultima_enturmacao'] = $this->loadNomeTurmaOrigem($matricula['id']); | ||
664 | 834 | ||
665 | $matriculas[$index]['data_entrada'] = $this->loadTransferenciaDataEntrada($matricula['id']); | 835 | $matriculas[$index]['data_entrada'] = $this->loadTransferenciaDataEntrada($matricula['id']); |
666 | $matriculas[$index]['data_saida'] = $this->loadTransferenciaDataSaida($matricula['id']); | 836 | $matriculas[$index]['data_saida'] = $this->loadTransferenciaDataSaida($matricula['id']); |
@@ -691,6 +861,9 @@ class AlunoController extends ApiCoreController | @@ -691,6 +861,9 @@ class AlunoController extends ApiCoreController | ||
691 | $this->createOrUpdateTransporte($id); | 861 | $this->createOrUpdateTransporte($id); |
692 | $this->createUpdateOrDestroyEducacensoAluno($id); | 862 | $this->createUpdateOrDestroyEducacensoAluno($id); |
693 | $this->updateDeficiencias(); | 863 | $this->updateDeficiencias(); |
864 | + $this->createOrUpdateFichaMedica($id); | ||
865 | + $this->createOrUpdateUniforme($id); | ||
866 | + $this->createOrUpdateMoradia($id); | ||
694 | 867 | ||
695 | $this->messenger->append('Cadastrado realizado com sucesso', 'success', false, 'error'); | 868 | $this->messenger->append('Cadastrado realizado com sucesso', 'success', false, 'error'); |
696 | } | 869 | } |
@@ -709,6 +882,9 @@ class AlunoController extends ApiCoreController | @@ -709,6 +882,9 @@ class AlunoController extends ApiCoreController | ||
709 | $this->createOrUpdateTransporte($id); | 882 | $this->createOrUpdateTransporte($id); |
710 | $this->createUpdateOrDestroyEducacensoAluno($id); | 883 | $this->createUpdateOrDestroyEducacensoAluno($id); |
711 | $this->updateDeficiencias(); | 884 | $this->updateDeficiencias(); |
885 | + $this->createOrUpdateFichaMedica($id); | ||
886 | + $this->createOrUpdateUniforme($id); | ||
887 | + $this->createOrUpdateMoradia($id); | ||
712 | 888 | ||
713 | $this->messenger->append('Cadastro alterado com sucesso', 'success', false, 'error'); | 889 | $this->messenger->append('Cadastro alterado com sucesso', 'success', false, 'error'); |
714 | } | 890 | } |
@@ -787,4 +963,4 @@ class AlunoController extends ApiCoreController | @@ -787,4 +963,4 @@ class AlunoController extends ApiCoreController | ||
787 | else | 963 | else |
788 | $this->notImplementedOperationError(); | 964 | $this->notImplementedOperationError(); |
789 | } | 965 | } |
790 | -} | 966 | -} |
967 | +} | ||
791 | \ No newline at end of file | 968 | \ No newline at end of file |
ieducar/modules/Cadastro/Assets/Javascripts/Aluno.js
@@ -12,6 +12,29 @@ var $resourceNotice = $j('<span>').html('') | @@ -12,6 +12,29 @@ var $resourceNotice = $j('<span>').html('') | ||
12 | var $pessoaNotice = $resourceNotice.clone() | 12 | var $pessoaNotice = $resourceNotice.clone() |
13 | .appendTo($nomeField.parent()); | 13 | .appendTo($nomeField.parent()); |
14 | 14 | ||
15 | +// adiciona id 'stop' na linha separadora | ||
16 | +$j('.tableDetalheLinhaSeparador').closest('tr').attr('id','stop'); | ||
17 | +// Adiciona abas na página | ||
18 | +$j('td .formdktd').append('<div id="tabControl"><ul><li><div id="tab1" class="alunoTab"> <span class="tabText">Dados pessoais</span></div></li><li><div id="tab2" class="alunoTab"> <span class="tabText">Ficha m\u00e9dica</span></div></li><li><div id="tab3" class="alunoTab"> <span class="tabText">Uniforme escolar</span></div></li><li><div id="tab4" class="alunoTab"> <span class="tabText">Moradia</span></div></li></ul></div>'); | ||
19 | + | ||
20 | +// Adiciona estilo de aba selecionada a primeira aba | ||
21 | +$j('#tab1').addClass('alunoTab-active').removeClass('alunoTab'); | ||
22 | + | ||
23 | +// hide nos campos das outras abas (deixando só os campos da primeira aba) | ||
24 | +$j('.tablecadastro >tbody > tr').each(function(index, row) { | ||
25 | + if (index>14){ | ||
26 | + if (row.id!='stop') | ||
27 | + row.hide(); | ||
28 | + else | ||
29 | + return false; | ||
30 | + } | ||
31 | +}); | ||
32 | + | ||
33 | +// Adiciona classe para que os campos de descrição possam ser desativados (checkboxs) | ||
34 | +$j('#restricao_atividade_fisica, #acomp_medico_psicologico, #medicacao_especifica, #tratamento_medico, #doenca_congenita, #alergia_alimento, #alergia_medicamento, #fratura_trauma, #plano_saude').addClass('temDescricao'); | ||
35 | + | ||
36 | +$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'); | ||
37 | + | ||
15 | // ajax | 38 | // ajax |
16 | 39 | ||
17 | resourceOptions.handlePost = function(dataResponse) { | 40 | resourceOptions.handlePost = function(dataResponse) { |
@@ -33,6 +56,7 @@ resourceOptions.handlePut = function(dataResponse) { | @@ -33,6 +56,7 @@ resourceOptions.handlePut = function(dataResponse) { | ||
33 | 56 | ||
34 | var tipo_resp; | 57 | var tipo_resp; |
35 | 58 | ||
59 | + | ||
36 | resourceOptions.handleGet = function(dataResponse) { | 60 | resourceOptions.handleGet = function(dataResponse) { |
37 | handleMessages(dataResponse.msgs); | 61 | handleMessages(dataResponse.msgs); |
38 | $resourceNotice.hide(); | 62 | $resourceNotice.hide(); |
@@ -61,11 +85,266 @@ resourceOptions.handleGet = function(dataResponse) { | @@ -61,11 +85,266 @@ resourceOptions.handleGet = function(dataResponse) { | ||
61 | $idField.val(dataResponse.id); | 85 | $idField.val(dataResponse.id); |
62 | $j('#aluno_inep_id').val(dataResponse.aluno_inep_id); | 86 | $j('#aluno_inep_id').val(dataResponse.aluno_inep_id); |
63 | $j('#aluno_estado_id').val(dataResponse.aluno_estado_id); | 87 | $j('#aluno_estado_id').val(dataResponse.aluno_estado_id); |
64 | - tipo_resp = dataResponse.tipo_responsavel; | 88 | + tipo_resp = dataResponse.tipo_responsavel; |
65 | $j('#religiao_id').val(dataResponse.religiao_id); | 89 | $j('#religiao_id').val(dataResponse.religiao_id); |
66 | $j('#beneficio_id').val(dataResponse.beneficio_id); | 90 | $j('#beneficio_id').val(dataResponse.beneficio_id); |
67 | $j('#tipo_transporte').val(dataResponse.tipo_transporte); | 91 | $j('#tipo_transporte').val(dataResponse.tipo_transporte); |
68 | $j('#alfabetizado').attr('checked', dataResponse.alfabetizado); | 92 | $j('#alfabetizado').attr('checked', dataResponse.alfabetizado); |
93 | + | ||
94 | + /*********************************************** | ||
95 | + CAMPOS DA FICHA MÉDICA | ||
96 | + ************************************************/ | ||
97 | + | ||
98 | + //campos checkbox | ||
99 | + if (dataResponse.alergia_medicamento == 'S'){ | ||
100 | + $j('#alergia_medicamento').attr('checked',true); | ||
101 | + $j('#alergia_medicamento').val('on'); | ||
102 | + } | ||
103 | + | ||
104 | + if (dataResponse.alergia_alimento == 'S'){ | ||
105 | + $j('#alergia_alimento').attr('checked',true); | ||
106 | + $j('#alergia_alimento').val('on'); | ||
107 | + } | ||
108 | + | ||
109 | + if (dataResponse.doenca_congenita == 'S'){ | ||
110 | + $j('#doenca_congenita').attr('checked',true); | ||
111 | + $j('#doenca_congenita').val('on'); | ||
112 | + } | ||
113 | + | ||
114 | + if (dataResponse.fumante == 'S'){ | ||
115 | + $j('#fumante').attr('checked',true); | ||
116 | + $j('#fumante').val('on'); | ||
117 | + } | ||
118 | + | ||
119 | + if (dataResponse.doenca_caxumba == 'S'){ | ||
120 | + $j('#doenca_caxumba').attr('checked',true); | ||
121 | + $j('#doenca_caxumba').val('on'); | ||
122 | + } | ||
123 | + | ||
124 | + if (dataResponse.doenca_sarampo == 'S'){ | ||
125 | + $j('#doenca_sarampo').attr('checked',true); | ||
126 | + $j('#doenca_sarampo').val('on'); | ||
127 | + } | ||
128 | + | ||
129 | + if (dataResponse.doenca_rubeola == 'S'){ | ||
130 | + $j('#doenca_rubeola').attr('checked',true); | ||
131 | + $j('#doenca_rubeola').val('on'); | ||
132 | + } | ||
133 | + | ||
134 | + if (dataResponse.doenca_catapora == 'S'){ | ||
135 | + $j('#doenca_catapora').attr('checked',true); | ||
136 | + $j('#doenca_catapora').val('on'); | ||
137 | + } | ||
138 | + | ||
139 | + if (dataResponse.doenca_escarlatina == 'S'){ | ||
140 | + $j('#doenca_escarlatina').attr('checked',true); | ||
141 | + $j('#doenca_escarlatina').val('on'); | ||
142 | + } | ||
143 | + | ||
144 | + if (dataResponse.doenca_coqueluche == 'S'){ | ||
145 | + $j('#doenca_coqueluche').attr('checked',true); | ||
146 | + $j('#doenca_coqueluche').val('on'); | ||
147 | + } | ||
148 | + | ||
149 | + if (dataResponse.epiletico == 'S'){ | ||
150 | + $j('#epiletico').attr('checked',true); | ||
151 | + $j('#epiletico').val('on'); | ||
152 | + } | ||
153 | + | ||
154 | + if (dataResponse.epiletico_tratamento == 'S'){ | ||
155 | + $j('#epiletico_tratamento').attr('checked',true); | ||
156 | + $j('#epiletico_tratamento').val('on'); | ||
157 | + } | ||
158 | + | ||
159 | + if (dataResponse.hemofilico == 'S'){ | ||
160 | + $j('#hemofilico').attr('checked',true); | ||
161 | + $j('#hemofilico').val('on'); | ||
162 | + } | ||
163 | + | ||
164 | + if (dataResponse.hipertenso == 'S'){ | ||
165 | + $j('#hipertenso').attr('checked',true); | ||
166 | + $j('#hipertenso').val('on'); | ||
167 | + } | ||
168 | + | ||
169 | + if (dataResponse.asmatico == 'S'){ | ||
170 | + $j('#asmatico').attr('checked',true); | ||
171 | + $j('#asmatico').val('on'); | ||
172 | + } | ||
173 | + | ||
174 | + if (dataResponse.diabetico == 'S'){ | ||
175 | + $j('#diabetico').attr('checked',true); | ||
176 | + $j('#diabetico').val('on'); | ||
177 | + } | ||
178 | + | ||
179 | + if (dataResponse.insulina == 'S'){ | ||
180 | + $j('#insulina').attr('checked',true); | ||
181 | + $j('#insulina').val('on'); | ||
182 | + } | ||
183 | + | ||
184 | + if (dataResponse.tratamento_medico == 'S'){ | ||
185 | + $j('#tratamento_medico').attr('checked',true); | ||
186 | + $j('#tratamento_medico').val('on'); | ||
187 | + } | ||
188 | + | ||
189 | + if (dataResponse.medicacao_especifica == 'S'){ | ||
190 | + $j('#medicacao_especifica').attr('checked',true); | ||
191 | + $j('#medicacao_especifica').val('on'); | ||
192 | + } | ||
193 | + | ||
194 | + if (dataResponse.acomp_medico_psicologico == 'S'){ | ||
195 | + $j('#acomp_medico_psicologico').attr('checked',true); | ||
196 | + $j('#acomp_medico_psicologico').val('on'); | ||
197 | + } | ||
198 | + | ||
199 | + if (dataResponse.restricao_atividade_fisica == 'S'){ | ||
200 | + $j('#restricao_atividade_fisica').attr('checked',true); | ||
201 | + $j('#restricao_atividade_fisica').val('on'); | ||
202 | + } | ||
203 | + | ||
204 | + if (dataResponse.fratura_trauma == 'S'){ | ||
205 | + $j('#fratura_trauma').attr('checked',true); | ||
206 | + $j('#fratura_trauma').val('on'); | ||
207 | + } | ||
208 | + if (dataResponse.plano_saude == 'S'){ | ||
209 | + $j('#plano_saude').attr('checked',true); | ||
210 | + $j('#plano_saude').val('on'); | ||
211 | + } | ||
212 | + // campos texto | ||
213 | + $j('#altura').val(dataResponse.altura); | ||
214 | + $j('#peso').val(dataResponse.peso); | ||
215 | + $j('#grupo_sanguineo').val(dataResponse.grupo_sanguineo); | ||
216 | + $j('#fator_rh').val(dataResponse.fator_rh); | ||
217 | + $j('#desc_alergia_medicamento').val(dataResponse.desc_alergia_medicamento); | ||
218 | + $j('#desc_alergia_alimento').val(dataResponse.desc_alergia_alimento); | ||
219 | + $j('#desc_doenca_congenita').val(dataResponse.desc_doenca_congenita); | ||
220 | + $j('#doenca_outras').val(dataResponse.doenca_outras); | ||
221 | + $j('#desc_tratamento_medico').val(dataResponse.desc_tratamento_medico); | ||
222 | + $j('#desc_medicacao_especifica').val(dataResponse.desc_medicacao_especifica); | ||
223 | + $j('#desc_acomp_medico_psicologico').val(dataResponse.desc_acomp_medico_psicologico); | ||
224 | + $j('#desc_restricao_atividade_fisica').val(dataResponse.desc_restricao_atividade_fisica); | ||
225 | + $j('#desc_fratura_trauma').val(dataResponse.desc_fratura_trauma); | ||
226 | + $j('#desc_plano_saude').val(dataResponse.desc_plano_saude); | ||
227 | + $j('#hospital_clinica').val(dataResponse.hospital_clinica); | ||
228 | + $j('#hospital_clinica_endereco').val(dataResponse.hospital_clinica_endereco); | ||
229 | + $j('#hospital_clinica_telefone').val(dataResponse.hospital_clinica_telefone); | ||
230 | + $j('#responsavel').val(dataResponse.responsavel); | ||
231 | + $j('#responsavel_parentesco').val(dataResponse.responsavel_parentesco); | ||
232 | + $j('#responsavel_parentesco_telefone').val(dataResponse.responsavel_parentesco_telefone); | ||
233 | + $j('#responsavel_parentesco_celular').val(dataResponse.responsavel_parentesco_celular); | ||
234 | + | ||
235 | + /*********************************************** | ||
236 | + CAMPOS DO UNIFORME ESCOLAR | ||
237 | + ************************************************/ | ||
238 | + | ||
239 | + if (dataResponse.recebeu_uniforme == 'S'){ | ||
240 | + $j('#recebeu_uniforme').attr('checked',true); | ||
241 | + $j('#recebeu_uniforme').val('on'); | ||
242 | + } | ||
243 | + $j('#tamanho_camiseta').val(dataResponse.tamanho_camiseta); | ||
244 | + $j('#tamanho_calcado').val(dataResponse.tamanho_calcado); | ||
245 | + $j('#tamanho_saia').val(dataResponse.tamanho_saia); | ||
246 | + $j('#tamanho_calca').val(dataResponse.tamanho_calca); | ||
247 | + $j('#tamanho_meia').val(dataResponse.tamanho_meia); | ||
248 | + $j('#tamanho_bermuda').val(dataResponse.tamanho_bermuda); | ||
249 | + $j('#tamanho_blusa_jaqueta').val(dataResponse.tamanho_blusa_jaqueta); | ||
250 | + $j('#quantidade_camiseta').val(dataResponse.quantidade_camiseta); | ||
251 | + $j('#quantidade_calcado').val(dataResponse.quantidade_calcado); | ||
252 | + $j('#quantidade_saia').val(dataResponse.quantidade_saia); | ||
253 | + $j('#quantidade_calca').val(dataResponse.quantidade_calca); | ||
254 | + $j('#quantidade_calcado').val(dataResponse.quantidade_calcado); | ||
255 | + $j('#quantidade_bermuda').val(dataResponse.quantidade_bermuda); | ||
256 | + $j('#quantidade_meia').val(dataResponse.quantidade_meia); | ||
257 | + $j('#quantidade_blusa_jaqueta').val(dataResponse.quantidade_blusa_jaqueta); | ||
258 | + | ||
259 | + /*********************************************** | ||
260 | + CAMPOS DA MORADIA | ||
261 | + ************************************************/ | ||
262 | + | ||
263 | + if (dataResponse.empregada_domestica == 'S'){ | ||
264 | + $j('#empregada_domestica').attr('checked',true); | ||
265 | + $j('#empregada_domestica').val('on'); | ||
266 | + } | ||
267 | + if (dataResponse.automovel == 'S'){ | ||
268 | + $j('#automovel').attr('checked',true); | ||
269 | + $j('#automovel').val('on'); | ||
270 | + } | ||
271 | + if (dataResponse.motocicleta == 'S'){ | ||
272 | + $j('#motocicleta').attr('checked',true); | ||
273 | + $j('#motocicleta').val('on'); | ||
274 | + } | ||
275 | + if (dataResponse.computador == 'S'){ | ||
276 | + $j('#computador').attr('checked',true); | ||
277 | + $j('#computador').val('on'); | ||
278 | + } | ||
279 | + if (dataResponse.geladeira == 'S'){ | ||
280 | + $j('#geladeira').attr('checked',true); | ||
281 | + $j('#geladeira').val('on'); | ||
282 | + } | ||
283 | + if (dataResponse.fogao == 'S'){ | ||
284 | + $j('#fogao').attr('checked',true); | ||
285 | + $j('#fogao').val('on'); | ||
286 | + } | ||
287 | + if (dataResponse.maquina_lavar == 'S'){ | ||
288 | + $j('#maquina_lavar').attr('checked',true); | ||
289 | + $j('#maquina_lavar').val('on'); | ||
290 | + } | ||
291 | + if (dataResponse.microondas == 'S'){ | ||
292 | + $j('#microondas').attr('checked',true); | ||
293 | + $j('#microondas').val('on'); | ||
294 | + } | ||
295 | + if (dataResponse.video_dvd == 'S'){ | ||
296 | + $j('#video_dvd').attr('checked',true); | ||
297 | + $j('#video_dvd').val('on'); | ||
298 | + } | ||
299 | + if (dataResponse.televisao == 'S'){ | ||
300 | + $j('#televisao').attr('checked',true); | ||
301 | + $j('#televisao').val('on'); | ||
302 | + } | ||
303 | + if (dataResponse.telefone == 'S'){ | ||
304 | + $j('#telefone').attr('checked',true); | ||
305 | + $j('#telefone').val('on'); | ||
306 | + } | ||
307 | + if (dataResponse.celular == 'S'){ | ||
308 | + $j('#celular').attr('checked',true); | ||
309 | + $j('#celular').val('on'); | ||
310 | + } | ||
311 | + if (dataResponse.agua_encanada == 'S'){ | ||
312 | + $j('#agua_encanada').attr('checked',true); | ||
313 | + $j('#agua_encanada').val('on'); | ||
314 | + } | ||
315 | + if (dataResponse.poco == 'S'){ | ||
316 | + $j('#poco').attr('checked',true); | ||
317 | + $j('#poco').val('on'); | ||
318 | + } | ||
319 | + if (dataResponse.energia == 'S'){ | ||
320 | + $j('#energia').attr('checked',true); | ||
321 | + $j('#energia').val('on'); | ||
322 | + } | ||
323 | + if (dataResponse.esgoto == 'S'){ | ||
324 | + $j('#esgoto').attr('checked',true); | ||
325 | + $j('#esgoto').val('on'); | ||
326 | + } | ||
327 | + if (dataResponse.fossa == 'S'){ | ||
328 | + $j('#fossa').attr('checked',true); | ||
329 | + $j('#fossa').val('on'); | ||
330 | + } | ||
331 | + if (dataResponse.lixo == 'S'){ | ||
332 | + $j('#lixo').attr('checked',true); | ||
333 | + $j('#lixo').val('on'); | ||
334 | + } | ||
335 | + | ||
336 | + $j('#quartos').val(dataResponse.quartos); | ||
337 | + $j('#sala').val(dataResponse.sala); | ||
338 | + $j('#copa').val(dataResponse.copa); | ||
339 | + $j('#banheiro').val(dataResponse.banheiro); | ||
340 | + $j('#garagem').val(dataResponse.garagem); | ||
341 | + $j('#casa_outra').val(dataResponse.casa_outra); | ||
342 | + $j('#quant_pessoas').val(dataResponse.quant_pessoas); | ||
343 | + $j('#renda').val(dataResponse.renda); | ||
344 | + $j('#moradia').val(dataResponse.moradia).change(); | ||
345 | + $j('#material').val(dataResponse.material).change(); | ||
346 | + $j('#moradia_situacao').val(dataResponse.moradia_situacao).change(); | ||
347 | + | ||
69 | }; | 348 | }; |
70 | 349 | ||
71 | var handleGetPersonDetails = function(dataResponse) { | 350 | var handleGetPersonDetails = function(dataResponse) { |
@@ -130,21 +409,21 @@ var handleGetPersonDetails = function(dataResponse) { | @@ -130,21 +409,21 @@ var handleGetPersonDetails = function(dataResponse) { | ||
130 | 409 | ||
131 | $j('#tipo_responsavel').find('option').remove().end(); | 410 | $j('#tipo_responsavel').find('option').remove().end(); |
132 | if ( $j('#pai').val()=='' && $j('#mae').val()==''){ | 411 | if ( $j('#pai').val()=='' && $j('#mae').val()==''){ |
133 | - $j('#tipo_responsavel').append('<option value="outra_pessoa" selected >Outra pessoa</option>'); | ||
134 | - $j('#responsavel_nome').show(); | 412 | + $j('#tipo_responsavel').append('<option value="outra_pessoa" selected >Outra pessoa</option>'); |
413 | + $j('#responsavel_nome').show(); | ||
135 | }else if ($j('#pai').val()==''){ | 414 | }else if ($j('#pai').val()==''){ |
136 | - $j('#tipo_responsavel').append('<option value="mae" selected >Mãe</option>'); | ||
137 | - $j('#tipo_responsavel').append('<option value="outra_pessoa" >Outra pessoa</option>'); | 415 | + $j('#tipo_responsavel').append('<option value="mae" selected >Mãe</option>'); |
416 | + $j('#tipo_responsavel').append('<option value="outra_pessoa" >Outra pessoa</option>'); | ||
138 | } else if ($j('#mae').val()==''){ | 417 | } else if ($j('#mae').val()==''){ |
139 | - $j('#tipo_responsavel').append('<option value="pai" selected >Pai</option>'); | ||
140 | - $j('#tipo_responsavel').append('<option value="outra_pessoa" >Outra pessoa</option>'); | 418 | + $j('#tipo_responsavel').append('<option value="pai" selected >Pai</option>'); |
419 | + $j('#tipo_responsavel').append('<option value="outra_pessoa" >Outra pessoa</option>'); | ||
141 | } else{ | 420 | } else{ |
142 | - $j('#tipo_responsavel').append('<option value="mae" selected >Mãe</option>'); | ||
143 | - $j('#tipo_responsavel').append('<option value="pai" selected >Pai</option>'); | ||
144 | - $j('#tipo_responsavel').append('<option value="outra_pessoa" >Outra pessoa</option>'); | 421 | + $j('#tipo_responsavel').append('<option value="mae" selected >Mãe</option>'); |
422 | + $j('#tipo_responsavel').append('<option value="pai" selected >Pai</option>'); | ||
423 | + $j('#tipo_responsavel').append('<option value="outra_pessoa" >Outra pessoa</option>'); | ||
145 | } | 424 | } |
146 | $j('#tipo_responsavel').val(tipo_resp).change(); | 425 | $j('#tipo_responsavel').val(tipo_resp).change(); |
147 | - | 426 | + |
148 | // # TODO show aluno photo | 427 | // # TODO show aluno photo |
149 | //$j('#aluno_foto').val(dataResponse.url_foto); | 428 | //$j('#aluno_foto').val(dataResponse.url_foto); |
150 | } | 429 | } |
@@ -247,15 +526,133 @@ function afterChangePessoa(targetWindow, pessoaId) { | @@ -247,15 +526,133 @@ function afterChangePessoa(targetWindow, pessoaId) { | ||
247 | } | 526 | } |
248 | 527 | ||
249 | checkTipoResponsavel(); | 528 | checkTipoResponsavel(); |
250 | - $j('#tipo_responsavel').change(checkTipoResponsavel); | 529 | + $j('#tipo_responsavel').change(checkTipoResponsavel); |
530 | + | ||
531 | + | ||
532 | + var checkMoradia = function(){ | ||
533 | + if($j('#moradia').val() == 'C'){ | ||
534 | + $j('#material').show(); | ||
535 | + $j('#casa_outra').hide(); | ||
536 | + }else if($j('#moradia').val() == 'O'){ | ||
537 | + $j('#material').hide(); | ||
538 | + $j('#casa_outra').show(); | ||
539 | + }else{ | ||
540 | + $j('#casa_outra').hide(); | ||
541 | + $j('#material').hide(); | ||
542 | + } | ||
543 | + } | ||
544 | + checkMoradia(); | ||
545 | + $j('#moradia').change(checkMoradia); | ||
251 | 546 | ||
252 | 547 | ||
253 | var msg = 'Bem vindo ao novo cadastro de alunos,<br />' + | 548 | var msg = 'Bem vindo ao novo cadastro de alunos,<br />' + |
549 | + 'Agora você pode navegar entre as abas! <br />'+ | ||
254 | '<b>Dúvidas?</b> Entre em contato com o suporte.'; | 550 | '<b>Dúvidas?</b> Entre em contato com o suporte.'; |
255 | 551 | ||
256 | $j('<p>').addClass('back-to-old-version right-top-notice notice') | 552 | $j('<p>').addClass('back-to-old-version right-top-notice notice') |
257 | .html(stringUtils.toUtf8(msg)) | 553 | .html(stringUtils.toUtf8(msg)) |
258 | - .appendTo($j('#id').closest('td')); | 554 | + .appendTo($j('#tab1').closest('td')); |
555 | + | ||
556 | + | ||
557 | + /*********************** | ||
558 | + EVENTOS DE CLICK EM ABAS | ||
559 | + ************************/ | ||
560 | + | ||
561 | + // DADOS PESSOAIS | ||
562 | + $j('#tab1').click( | ||
563 | + function(){ | ||
564 | + | ||
565 | + $j('.alunoTab-active').toggleClass('alunoTab-active alunoTab'); | ||
566 | + $j('#tab1').toggleClass('alunoTab alunoTab-active') | ||
567 | + $j('.tablecadastro >tbody > tr').each(function(index, row) { | ||
568 | + if (index>14){ | ||
569 | + if (row.id!='stop') | ||
570 | + row.hide(); | ||
571 | + else | ||
572 | + return false; | ||
573 | + }else{ | ||
574 | + row.show(); | ||
575 | + } | ||
576 | + }); | ||
577 | + } | ||
578 | + ); | ||
579 | + | ||
580 | + // FICHA MÉDICA | ||
581 | + $j('#tab2').click( | ||
582 | + function(){ | ||
583 | + $j('.alunoTab-active').toggleClass('alunoTab-active alunoTab'); | ||
584 | + $j('#tab2').toggleClass('alunoTab alunoTab-active') | ||
585 | + $j('.tablecadastro >tbody > tr').each(function(index, row) { | ||
586 | + if (row.id!='stop'){ | ||
587 | + if (index>14 && index<61){ | ||
588 | + row.show(); | ||
589 | + }else if (index>0){ | ||
590 | + row.hide(); | ||
591 | + } | ||
592 | + }else | ||
593 | + return false; | ||
594 | + }); | ||
595 | + // Esse loop desativa/ativa os campos de descrição, conforme os checkbox | ||
596 | + $j('.temDescricao').each(function(i, obj) { | ||
597 | + $j('#desc_'+obj.id).prop('disabled', !$j('#'+obj.id).prop('checked')); | ||
598 | + }); | ||
599 | + | ||
600 | + }); | ||
601 | + // UNIFORME | ||
602 | + $j('#tab3').click( | ||
603 | + function(){ | ||
604 | + $j('.alunoTab-active').toggleClass('alunoTab-active alunoTab'); | ||
605 | + $j('#tab3').toggleClass('alunoTab alunoTab-active') | ||
606 | + $j('.tablecadastro >tbody > tr').each(function(index, row) { | ||
607 | + if (row.id!='stop'){ | ||
608 | + if (index>60 && index<83){ | ||
609 | + row.show(); | ||
610 | + }else if (index>0){ | ||
611 | + row.hide(); | ||
612 | + } | ||
613 | + }else | ||
614 | + return false; | ||
615 | + }); | ||
616 | + $j('.uniforme').prop('disabled',!$j('#recebeu_uniforme').prop('checked')); | ||
617 | + }); | ||
618 | + | ||
619 | + // MORADIA | ||
620 | + $j('#tab4').click( | ||
621 | + function(){ | ||
622 | + $j('.alunoTab-active').toggleClass('alunoTab-active alunoTab'); | ||
623 | + $j('#tab4').toggleClass('alunoTab alunoTab-active') | ||
624 | + $j('.tablecadastro >tbody > tr').each(function(index, row) { | ||
625 | + | ||
626 | + if (index<83 && index!=0){ | ||
627 | + row.hide(); | ||
628 | + }else{ | ||
629 | + row.show(); | ||
630 | + } | ||
631 | + }); | ||
632 | + $j('.uniforme').prop('disabled',!$j('#recebeu_uniforme').prop('checked')); | ||
633 | + }); | ||
634 | + | ||
635 | + | ||
636 | + /* A seguinte função habilitam/desabilitam o campo de descrição quando for clicado | ||
637 | + nos referentes checkboxs */ | ||
638 | + | ||
639 | + $j('.temDescricao').click(function(){ | ||
640 | + if ($j('#'+this.id).prop('checked')) | ||
641 | + $j('#desc_'+this.id).removeAttr('disabled'); | ||
642 | + else{ | ||
643 | + $j('#desc_'+this.id).attr('disabled','disabled'); | ||
644 | + $j('#desc_'+this.id).val(''); | ||
645 | + } | ||
646 | + }); | ||
647 | + | ||
648 | + $j('#recebeu_uniforme').click(function(){ | ||
649 | + if ($j('#recebeu_uniforme').prop('checked')) | ||
650 | + $j('.uniforme').removeAttr('disabled'); | ||
651 | + else{ | ||
652 | + $j('.uniforme').attr('disabled','disabled'); | ||
653 | + $j('.uniforme').val(''); | ||
654 | + } | ||
655 | + }); | ||
259 | 656 | ||
260 | }); // ready | 657 | }); // ready |
261 | })(jQuery); | 658 | })(jQuery); |
262 | \ No newline at end of file | 659 | \ No newline at end of file |
ieducar/modules/Cadastro/Assets/Javascripts/AlunoShow.js
@@ -11,6 +11,7 @@ function fixupTabelaMatriculas() { | @@ -11,6 +11,7 @@ function fixupTabelaMatriculas() { | ||
11 | $j('<th>').html('Ano').appendTo($tr); | 11 | $j('<th>').html('Ano').appendTo($tr); |
12 | $j('<th>').html(stringUtils.toUtf8('Situação')).appendTo($tr); | 12 | $j('<th>').html(stringUtils.toUtf8('Situação')).appendTo($tr); |
13 | $j('<th>').html('Turma').appendTo($tr); | 13 | $j('<th>').html('Turma').appendTo($tr); |
14 | + $j('<th>').html('\u00daltima enturma\u00e7\u00e3o').appendTo($tr); | ||
14 | $j('<th>').html(stringUtils.toUtf8('Série')).appendTo($tr); | 15 | $j('<th>').html(stringUtils.toUtf8('Série')).appendTo($tr); |
15 | $j('<th>').html('Curso').appendTo($tr); | 16 | $j('<th>').html('Curso').appendTo($tr); |
16 | $j('<th>').html('Escola').appendTo($tr); | 17 | $j('<th>').html('Escola').appendTo($tr); |
@@ -30,6 +31,7 @@ var handleGetMatriculas = function(dataResponse) { | @@ -30,6 +31,7 @@ var handleGetMatriculas = function(dataResponse) { | ||
30 | try{ | 31 | try{ |
31 | handleMessages(dataResponse.msgs); | 32 | handleMessages(dataResponse.msgs); |
32 | 33 | ||
34 | + | ||
33 | var $matriculasTable = $j('#matriculas'); | 35 | var $matriculasTable = $j('#matriculas'); |
34 | var transferenciaEmAberto = false; | 36 | var transferenciaEmAberto = false; |
35 | 37 | ||
@@ -49,6 +51,7 @@ var handleGetMatriculas = function(dataResponse) { | @@ -49,6 +51,7 @@ var handleGetMatriculas = function(dataResponse) { | ||
49 | $j('<td>').html(matricula.ano).appendTo($tr); | 51 | $j('<td>').html(matricula.ano).appendTo($tr); |
50 | $j('<td>').html(matricula.situacao).appendTo($tr); | 52 | $j('<td>').html(matricula.situacao).appendTo($tr); |
51 | $j('<td>').html(matricula.turma_nome).appendTo($tr); | 53 | $j('<td>').html(matricula.turma_nome).appendTo($tr); |
54 | + $j('<td>').html(matricula.ultima_enturmacao).appendTo($tr); | ||
52 | $j('<td>').html(matricula.serie_nome).appendTo($tr); | 55 | $j('<td>').html(matricula.serie_nome).appendTo($tr); |
53 | $j('<td>').html(matricula.curso_nome).appendTo($tr); | 56 | $j('<td>').html(matricula.curso_nome).appendTo($tr); |
54 | $j('<td>').html(matricula.escola_nome).appendTo($tr); | 57 | $j('<td>').html(matricula.escola_nome).appendTo($tr); |
@@ -119,10 +122,162 @@ var getMatriculas = function() { | @@ -119,10 +122,162 @@ var getMatriculas = function() { | ||
119 | getResource(options); | 122 | getResource(options); |
120 | } | 123 | } |
121 | 124 | ||
122 | -// when page is ready | 125 | +$j('.tableDetalheLinhaSeparador').closest('tr').attr('id','stop'); |
126 | + | ||
127 | +// Verifica se possui ficha médica, verificando se existe o primeiro campo | ||
128 | +var possui_ficha_medica = $j('#fmedica').length>0; | ||
129 | + | ||
130 | +var possui_uniforme_escolar = $j('#funiforme').length>0; | ||
131 | + | ||
132 | +var possui_moradia = $j('#fmoradia').length>0; | ||
133 | + | ||
134 | +// Adiciona abas na página | ||
135 | +$j('td .formdktd').append('<div id="tabControl"><ul><li><div id="tab1" class="alunoTab2"> <span class="tabText">Dados pessoais</span></div></li><li><div id="tab2" class="alunoTab2"> <span class="tabText">Ficha m\u00e9dica</span></div></li><li><div id="tab3" class="alunoTab2"> <span class="tabText">Uniforme escolar</span></div></li><li><div id="tab4" class="alunoTab2"> <span class="tabText">Moradia</span></div></li></ul></div>'); | ||
136 | +$j('td .formdktd b').remove(); | ||
137 | +$j('#tab1').addClass('alunoTab-active2').removeClass('alunoTab2'); | ||
138 | +var linha_inicial_fmedica = 0; | ||
139 | + | ||
140 | +if(possui_ficha_medica){ | ||
141 | + // Atribui um id a linha, para identificar até onde/a partir de onde esconder os campos | ||
142 | + $j('#fmedica').closest('tr').attr('id','tfmedica'); | ||
143 | + | ||
144 | + // Pega o número dessa linha | ||
145 | + linha_inicial_fmedica = $j('#tfmedica').index(); | ||
146 | + | ||
147 | + // hide nos campos das outras abas (deixando só os campos da primeira aba) | ||
148 | + $j('.tableDetalhe >tbody > tr').each(function(index, row) { | ||
149 | + if (index>=linha_inicial_fmedica){ | ||
150 | + if (row.id!='stop') | ||
151 | + row.hide(); | ||
152 | + else | ||
153 | + return false; | ||
154 | + } | ||
155 | + }); | ||
156 | +} | ||
157 | + | ||
158 | +if(possui_uniforme_escolar){ | ||
159 | + // Atribui um id a linha, para identificar até onde/a partir de onde esconder os campos | ||
160 | + $j('#funiforme').closest('tr').attr('id','tfuniforme'); | ||
161 | + | ||
162 | + // Pega o número dessa linha | ||
163 | + linha_inicial_funiforme = $j('#tfuniforme').index(); | ||
123 | 164 | ||
165 | + // hide nos campos das outras abas (deixando só os campos da primeira aba) | ||
166 | + $j('.tableDetalhe >tbody > tr').each(function(index, row) { | ||
167 | + if (index>=linha_inicial_funiforme){ | ||
168 | + if (row.id!='stop') | ||
169 | + row.hide(); | ||
170 | + else | ||
171 | + return false; | ||
172 | + } | ||
173 | + }); | ||
174 | +} | ||
175 | + | ||
176 | +if(possui_moradia){ | ||
177 | + // Atribui um id a linha, para identificar até onde/a partir de onde esconder os campos | ||
178 | + $j('#fmoradia').closest('tr').attr('id','tfmoradia'); | ||
179 | + | ||
180 | + // Pega o número dessa linha | ||
181 | + linha_inicial_fmoradia = $j('#tfmoradia').index(); | ||
182 | + | ||
183 | + // hide nos campos das outras abas (deixando só os campos da primeira aba) | ||
184 | + $j('.tableDetalhe >tbody > tr').each(function(index, row) { | ||
185 | + if (index>=linha_inicial_fmoradia){ | ||
186 | + if (row.id!='stop') | ||
187 | + row.hide(); | ||
188 | + else | ||
189 | + return false; | ||
190 | + } | ||
191 | + }); | ||
192 | +} | ||
193 | + | ||
194 | + | ||
195 | +// when page is ready | ||
124 | $j(document).ready(function() { | 196 | $j(document).ready(function() { |
125 | 197 | ||
198 | + // on click das abas | ||
199 | + | ||
200 | + // DADOS PESSOAIS | ||
201 | + $j('#tab1').click( | ||
202 | + function(){ | ||
203 | + | ||
204 | + $j('.alunoTab-active2').toggleClass('alunoTab-active2 alunoTab2'); | ||
205 | + $j('#tab1').toggleClass('alunoTab2 alunoTab-active2') | ||
206 | + $j('.tableDetalhe >tbody > tr').each(function(index, row) { | ||
207 | + if (index>=linha_inicial_fmedica){ | ||
208 | + if (row.id!='stop') | ||
209 | + row.hide(); | ||
210 | + else | ||
211 | + return false; | ||
212 | + }else{ | ||
213 | + row.show(); | ||
214 | + } | ||
215 | + }); | ||
216 | + } | ||
217 | + ); | ||
218 | + | ||
219 | + // FICHA MÉDICA | ||
220 | + $j('#tab2').click( | ||
221 | + function(){ | ||
222 | + if (possui_ficha_medica){ | ||
223 | + $j('.alunoTab-active2').toggleClass('alunoTab-active2 alunoTab2'); | ||
224 | + $j('#tab2').toggleClass('alunoTab2 alunoTab-active2') | ||
225 | + $j('.tableDetalhe >tbody > tr').each(function(index, row) { | ||
226 | + if (row.id!='stop'){ | ||
227 | + if (index>=linha_inicial_fmedica && index<linha_inicial_funiforme){ | ||
228 | + row.show(); | ||
229 | + }else if (index>0){ | ||
230 | + row.hide(); | ||
231 | + } | ||
232 | + }else | ||
233 | + return false; | ||
234 | + }); | ||
235 | + }else | ||
236 | + alert('Dados da ficha m\u00e9dica n\u00e3o foram adicionados ainda. \nVoc\u00ea pode adicion\u00e1-los clicando em editar.'); | ||
237 | + | ||
238 | + }); | ||
239 | + | ||
240 | + // FICHA MÉDICA | ||
241 | + $j('#tab3').click( | ||
242 | + function(){ | ||
243 | + if (possui_uniforme_escolar){ | ||
244 | + $j('.alunoTab-active2').toggleClass('alunoTab-active2 alunoTab2'); | ||
245 | + $j('#tab3').toggleClass('alunoTab2 alunoTab-active2') | ||
246 | + $j('.tableDetalhe >tbody > tr').each(function(index, row) { | ||
247 | + if (row.id!='stop'){ | ||
248 | + if (index>=linha_inicial_funiforme && index<linha_inicial_fmoradia){ | ||
249 | + row.show(); | ||
250 | + }else if (index>0){ | ||
251 | + row.hide(); | ||
252 | + } | ||
253 | + }else | ||
254 | + return false; | ||
255 | + }); | ||
256 | + }else | ||
257 | + alert('Dados do uniforme escolar n\u00e3o foram adicionados ainda. \nVoc\u00ea pode adicion\u00e1-los clicando em editar.'); | ||
258 | + | ||
259 | + }); | ||
260 | + // FICHA MÉDICA | ||
261 | + $j('#tab4').click( | ||
262 | + function(){ | ||
263 | + if (possui_moradia){ | ||
264 | + $j('.alunoTab-active2').toggleClass('alunoTab-active2 alunoTab2'); | ||
265 | + $j('#tab4').toggleClass('alunoTab2 alunoTab-active2') | ||
266 | + $j('.tableDetalhe >tbody > tr').each(function(index, row) { | ||
267 | + if (row.id!='stop'){ | ||
268 | + if (index>=linha_inicial_fmoradia){ | ||
269 | + row.show(); | ||
270 | + }else if (index>0){ | ||
271 | + row.hide(); | ||
272 | + } | ||
273 | + }else | ||
274 | + return false; | ||
275 | + }); | ||
276 | + }else | ||
277 | + alert('Dados da moradia n\u00e3o foram adicionados ainda. \nVoc\u00ea pode adicion\u00e1-los clicando em editar.'); | ||
278 | + | ||
279 | + }); | ||
280 | + | ||
126 | getMatriculas(); | 281 | getMatriculas(); |
127 | 282 | ||
128 | }); // ready | 283 | }); // ready |
129 | \ No newline at end of file | 284 | \ No newline at end of file |
ieducar/modules/Cadastro/Assets/Stylesheets/Aluno.css
@@ -15,4 +15,151 @@ | @@ -15,4 +15,151 @@ | ||
15 | 15 | ||
16 | #deficiencias_chzn ul { | 16 | #deficiencias_chzn ul { |
17 | width: 307px; | 17 | width: 307px; |
18 | +} | ||
19 | + | ||
20 | +.pessoa-links { | ||
21 | + display: block; | ||
22 | + padding: 5px; | ||
23 | + margin: 2px; | ||
24 | +} | ||
25 | + | ||
26 | +.pessoa-links a { | ||
27 | + /* | ||
28 | + obs: no firefox, ao mostrar o elemento (.show, jquery), é setado display como block, | ||
29 | + para reparar isto, após chamar .show(), chamar .css('display', 'inline'); | ||
30 | + */ | ||
31 | + | ||
32 | + margin-right: 5px; | ||
33 | +} | ||
34 | + | ||
35 | +#deficiencias_chzn ul { | ||
36 | + width: 307px; | ||
37 | +} | ||
38 | + | ||
39 | +#tabControl ul{ | ||
40 | + display: inline; | ||
41 | + list-style-type: none; | ||
42 | +} | ||
43 | + | ||
44 | +#tabControl ul li{ | ||
45 | + padding-left: 2px; | ||
46 | + float: left; | ||
47 | + | ||
48 | +} | ||
49 | + | ||
50 | +.alunoTab{ | ||
51 | + border: 1px solid rgb(73, 92, 103); | ||
52 | + border-bottom-color: #FFF; | ||
53 | + border-top-left-radius: 5px; | ||
54 | + border-top-right-radius: 5px; | ||
55 | + border-bottom-left-radius: 0px; | ||
56 | + border-bottom-right-radius: 0px; | ||
57 | + -moz-border-radius-topleft: 5px; | ||
58 | + -moz-border-radius-topright: 5px; | ||
59 | + -moz-border-radius-bottomleft: 0px; | ||
60 | + -moz-border-radius-bottomright: 0px; | ||
61 | + -webkit-border-top-left-radius: 5px; | ||
62 | + -webkit-border-top-right-radius: 5px; | ||
63 | + -webkit-border-bottom-left-radius: 0px; | ||
64 | + -webkit-border-bottom-right-radius: 0px; | ||
65 | + position:relative; | ||
66 | + top: 2px; | ||
67 | + width: 100px; | ||
68 | + height: 25px; | ||
69 | + background-color: white; | ||
70 | + text-align: center; | ||
71 | + cursor: pointer; | ||
72 | +} | ||
73 | + | ||
74 | +.alunoTab2{ | ||
75 | + border: 1px solid rgb(73, 92, 103); | ||
76 | + border-bottom-color: #FFF; | ||
77 | + border-top-left-radius: 5px; | ||
78 | + border-top-right-radius: 5px; | ||
79 | + border-bottom-left-radius: 0px; | ||
80 | + border-bottom-right-radius: 0px; | ||
81 | + -moz-border-radius-topleft: 5px; | ||
82 | + -moz-border-radius-topright: 5px; | ||
83 | + -moz-border-radius-bottomleft: 0px; | ||
84 | + -moz-border-radius-bottomright: 0px; | ||
85 | + -webkit-border-top-left-radius: 5px; | ||
86 | + -webkit-border-top-right-radius: 5px; | ||
87 | + -webkit-border-bottom-left-radius: 0px; | ||
88 | + -webkit-border-bottom-right-radius: 0px; | ||
89 | + position:relative; | ||
90 | + top: 2px; | ||
91 | + width: 100px; | ||
92 | + height: 25px; | ||
93 | + background-color: #e4e9ed; | ||
94 | + text-align: center; | ||
95 | + cursor: pointer; | ||
96 | +} | ||
97 | + | ||
98 | +.alunoTab-active{ | ||
99 | + border: 1px solid rgb(73, 92, 103); | ||
100 | + border-bottom: 0px; | ||
101 | + border-top-left-radius: 5px; | ||
102 | + border-top-right-radius: 5px; | ||
103 | + border-bottom-left-radius: 0px; | ||
104 | + border-bottom-right-radius: 0px; | ||
105 | + -moz-border-radius-topleft: 5px; | ||
106 | + -moz-border-radius-topright: 5px; | ||
107 | + -moz-border-radius-bottomleft: 0px; | ||
108 | + -moz-border-radius-bottomright: 0px; | ||
109 | + -webkit-border-top-left-radius: 5px; | ||
110 | + -webkit-border-top-right-radius: 5px; | ||
111 | + -webkit-border-bottom-left-radius: 0px; | ||
112 | + -webkit-border-bottom-right-radius: 0px; | ||
113 | + position:relative; | ||
114 | + top: 3px; | ||
115 | + width: 100px; | ||
116 | + height: 25px; | ||
117 | + background-color: #e4e9ed; | ||
118 | + text-align: center; | ||
119 | + font-weight: bold; | ||
120 | +} | ||
121 | + | ||
122 | +.alunoTab-active2{ | ||
123 | + border: 1px solid rgb(73, 92, 103); | ||
124 | + border-bottom: 0px; | ||
125 | + border-top-left-radius: 5px; | ||
126 | + border-top-right-radius: 5px; | ||
127 | + border-bottom-left-radius: 0px; | ||
128 | + border-bottom-right-radius: 0px; | ||
129 | + -moz-border-radius-topleft: 5px; | ||
130 | + -moz-border-radius-topright: 5px; | ||
131 | + -moz-border-radius-bottomleft: 0px; | ||
132 | + -moz-border-radius-bottomright: 0px; | ||
133 | + -webkit-border-top-left-radius: 5px; | ||
134 | + -webkit-border-top-right-radius: 5px; | ||
135 | + -webkit-border-bottom-left-radius: 0px; | ||
136 | + -webkit-border-bottom-right-radius: 0px; | ||
137 | + position:relative; | ||
138 | + top: 3px; | ||
139 | + width: 100px; | ||
140 | + height: 25px; | ||
141 | + background-color: white; | ||
142 | + text-align: center; | ||
143 | + font-weight: bold; | ||
144 | +} | ||
145 | + | ||
146 | +.tabText{ | ||
147 | + position: relative; | ||
148 | + top: 6px; | ||
149 | +} | ||
150 | + | ||
151 | +#tr_tit_dados_hospital, #tr_tit_dados_responsavel{ | ||
152 | + font-weight: bold; | ||
153 | + font-size: 12px; | ||
154 | +} | ||
155 | + | ||
156 | +#tit_dados_hospital, #tit_dados_responsavel, #tr_label_calca, | ||
157 | +#tr_label_calcado, #tr_label_saia, #tr_label_camiseta, | ||
158 | +#tr_label_meia, #tr_label_bermuda, #tr_label_blusa_jaqueta{ | ||
159 | + font-weight: bold; | ||
160 | + font-size: 10px; | ||
161 | +} | ||
162 | +.tit_uniforme{ | ||
163 | + font-weight: bold; | ||
164 | + font-size: 10px; | ||
18 | } | 165 | } |
19 | \ No newline at end of file | 166 | \ No newline at end of file |
ieducar/modules/Cadastro/Views/AlunoController.php
@@ -85,7 +85,7 @@ class AlunoController extends Portabilis_Controller_Page_EditController | @@ -85,7 +85,7 @@ class AlunoController extends Portabilis_Controller_Page_EditController | ||
85 | ), | 85 | ), |
86 | 86 | ||
87 | 'aluno_inep_id' => array( | 87 | 'aluno_inep_id' => array( |
88 | - 'label' => 'Código inep', | 88 | + 'label' => 'Código INEP', |
89 | 'help' => '', | 89 | 'help' => '', |
90 | ), | 90 | ), |
91 | 91 | ||
@@ -97,7 +97,210 @@ class AlunoController extends Portabilis_Controller_Page_EditController | @@ -97,7 +97,210 @@ class AlunoController extends Portabilis_Controller_Page_EditController | ||
97 | 'deficiencias' => array( | 97 | 'deficiencias' => array( |
98 | 'label' => 'Deficiências / habilidades especiais', | 98 | 'label' => 'Deficiências / habilidades especiais', |
99 | 'help' => '', | 99 | 'help' => '', |
100 | - ) | 100 | + ), |
101 | + | ||
102 | + /* ******************* | ||
103 | + ** Dados médicos ** | ||
104 | + ******************* */ | ||
105 | + | ||
106 | + 'altura' => array('label' => 'Altura/Metro'), | ||
107 | + | ||
108 | + 'peso' => array('label' => 'Peso/Kg'), | ||
109 | + | ||
110 | + 'grupo_sanguineo' => array('label' => 'Grupo sanguíneo'), | ||
111 | + | ||
112 | + 'fator_rh' => array('label' => 'Fator RH'), | ||
113 | + | ||
114 | + 'alergia_medicamento' => array('label' => 'O aluno é alérgico a algum medicamento?'), | ||
115 | + | ||
116 | + 'desc_alergia_medicamento' => array('label' => 'Quais?'), | ||
117 | + | ||
118 | + 'alergia_alimento' => array('label' => 'O aluno é alérgico a algum alimento?'), | ||
119 | + | ||
120 | + 'desc_alergia_alimento' => array('label' => 'Quais?'), | ||
121 | + | ||
122 | + 'doenca_congenita' => array('label' => 'O aluno possui doença congênita?'), | ||
123 | + | ||
124 | + 'desc_doenca_congenita' => array('label' => 'Quais?'), | ||
125 | + | ||
126 | + 'fumante' => array('label' => 'O aluno é fumante?'), | ||
127 | + | ||
128 | + 'doenca_caxumba' => array('label' => 'O aluno já contraiu caxumba?'), | ||
129 | + | ||
130 | + 'doenca_sarampo' => array('label' => 'O aluno já contraiu sarampo?'), | ||
131 | + | ||
132 | + 'doenca_rubeola' => array('label' => 'O aluno já contraiu rubeola?'), | ||
133 | + | ||
134 | + 'doenca_catapora' => array('label' => 'O aluno já contraiu catapora?'), | ||
135 | + | ||
136 | + 'doenca_escarlatina' => array('label' => 'O aluno já contraiu escarlatina?'), | ||
137 | + | ||
138 | + 'doenca_coqueluche' => array('label' => 'O aluno já contraiu coqueluche?'), | ||
139 | + | ||
140 | + 'doenca_outras' => array('label' => 'Outras doenças que o aluno já contraiu'), | ||
141 | + | ||
142 | + 'epiletico' => array('label' => 'O aluno é epilético?'), | ||
143 | + | ||
144 | + 'epiletico_tratamento' => array('label' => 'Está em tratamento?'), | ||
145 | + | ||
146 | + 'hemofilico' => array('label' => 'O aluno é hemofílico?'), | ||
147 | + | ||
148 | + 'hipertenso' => array('label' => 'O aluno tem hipertensão?'), | ||
149 | + | ||
150 | + 'asmatico' => array('label' => 'O aluno é asmático?'), | ||
151 | + | ||
152 | + 'diabetico' => array('label' => 'O aluno é diabético?'), | ||
153 | + | ||
154 | + 'insulina' => array('label' => 'Depende de insulina?'), | ||
155 | + | ||
156 | + 'tratamento_medico' => array('label' => 'O aluno faz algum tratamento médico?'), | ||
157 | + | ||
158 | + 'desc_tratamento_medico' => array('label' => 'Qual?'), | ||
159 | + | ||
160 | + 'medicacao_especifica' => array('label' => 'O aluno está ingerindo medicação específica?'), | ||
161 | + | ||
162 | + 'desc_medicacao_especifica' => array('label' => 'Qual?'), | ||
163 | + | ||
164 | + 'acomp_medico_psicologico' => array('label' => 'O aluno tem acompanhamento médico ou psicológico?'), | ||
165 | + | ||
166 | + 'desc_acomp_medico_psicologico' => array('label' => 'Motivo?'), | ||
167 | + | ||
168 | + 'restricao_atividade_fisica' => array('label' => 'O aluno tem restrição a alguma atividade física?'), | ||
169 | + | ||
170 | + 'desc_restricao_atividade_fisica' => array('label' => 'Qual?'), | ||
171 | + | ||
172 | + 'fratura_trauma' => array('label' => 'O aluno sofreu alguma fratura ou trauma?'), | ||
173 | + | ||
174 | + 'desc_fratura_trauma' => array('label' => 'Qual?'), | ||
175 | + | ||
176 | + 'plano_saude' => array('label' => 'O aluno possui algum plano de saúde?'), | ||
177 | + | ||
178 | + 'desc_plano_saude' => array('label' => 'Qual?'), | ||
179 | + | ||
180 | + 'hospital_clinica' => array('label' => 'Nome'), | ||
181 | + | ||
182 | + 'hospital_clinica_endereco' => array('label' => 'Endereço'), | ||
183 | + | ||
184 | + 'hospital_clinica_telefone' => array('label' => 'Telefone'), | ||
185 | + | ||
186 | + 'responsavel' => array('label' => 'Nome'), | ||
187 | + | ||
188 | + 'responsavel_parentesco' => array('label' => 'Parentesco'), | ||
189 | + | ||
190 | + 'responsavel_parentesco_telefone' => array('label' => 'Telefone'), | ||
191 | + | ||
192 | + 'responsavel_parentesco_celular' => array('label' => 'Celular'), | ||
193 | + | ||
194 | + /************************* | ||
195 | + **** UNIFORME ESCOLAR **** | ||
196 | + **************************/ | ||
197 | + | ||
198 | + 'recebeu_uniforme' => array('label' => 'Recebeu uniforme escolar?'), | ||
199 | + | ||
200 | + 'label_camiseta' => array('label' => 'Camiseta'), | ||
201 | + | ||
202 | + 'quantidade_camiseta' => array('label' => 'Quantidade'), | ||
203 | + | ||
204 | + 'tamanho_camiseta' => array('label' => 'Tamanho'), | ||
205 | + | ||
206 | + 'label_blusa_jaqueta' => array('label' => 'Blusa/Jaqueta'), | ||
207 | + | ||
208 | + 'quantidade_blusa_jaqueta' => array('label' => 'Quantidade'), | ||
209 | + | ||
210 | + 'tamanho_blusa_jaqueta' => array('label' => 'Tamanho'), | ||
211 | + | ||
212 | + 'label_bermuda' => array('label' => 'Bermuda'), | ||
213 | + | ||
214 | + 'quantidade_bermuda' => array('label' => 'Quantidade'), | ||
215 | + | ||
216 | + 'tamanho_bermuda' => array('label' => 'Tamanho'), | ||
217 | + | ||
218 | + 'label_calca' => array('label' => 'Calça'), | ||
219 | + | ||
220 | + 'quantidade_calca' => array('label' => 'Quantidade'), | ||
221 | + | ||
222 | + 'tamanho_calca' => array('label' => 'Tamanho'), | ||
223 | + | ||
224 | + 'label_saia' => array('label' => 'Saia'), | ||
225 | + | ||
226 | + 'quantidade_saia' => array('label' => 'Quantidade'), | ||
227 | + | ||
228 | + 'tamanho_saia' => array('label' => 'Tamanho'), | ||
229 | + | ||
230 | + 'label_calcado' => array('label' => 'Calçado'), | ||
231 | + | ||
232 | + 'quantidade_calcado' => array('label' => 'Quantidade'), | ||
233 | + | ||
234 | + 'tamanho_calcado' => array('label' => 'Tamanho'), | ||
235 | + | ||
236 | + 'label_meia' => array('label' => 'Meia'), | ||
237 | + | ||
238 | + 'quantidade_meia' => array('label' => 'Quantidade'), | ||
239 | + | ||
240 | + 'tamanho_meia' => array('label' => 'Tamanho'), | ||
241 | + | ||
242 | + /************ | ||
243 | + MORADIA | ||
244 | + ************/ | ||
245 | + | ||
246 | + 'moradia' => array('label' => 'Moradia'), | ||
247 | + | ||
248 | + 'material' => array('label' => 'Material'), | ||
249 | + | ||
250 | + 'casa_outra' => array('label' => 'Outro'), | ||
251 | + | ||
252 | + 'moradia_situacao' => array('label' => 'Situação'), | ||
253 | + | ||
254 | + 'quartos' => array('label' => 'Número de quartos'), | ||
255 | + | ||
256 | + 'sala' => array('label' => 'Número de salas'), | ||
257 | + | ||
258 | + 'copa' => array('label' => 'Número de copas'), | ||
259 | + | ||
260 | + 'banheiro' => array('label' => 'Número de banheiros'), | ||
261 | + | ||
262 | + 'garagem' => array('label' => 'Número de garagens'), | ||
263 | + | ||
264 | + 'empregada_domestica' => array('label' => 'Possui empregada doméstica?'), | ||
265 | + | ||
266 | + 'automovel' => array('label' => 'Possui automóvel?'), | ||
267 | + | ||
268 | + 'motocicleta' => array('label' => 'Possui motocicleta?'), | ||
269 | + | ||
270 | + 'computador' => array('label' => 'Possui computador?'), | ||
271 | + | ||
272 | + 'geladeira' => array('label' => 'Possui geladeira?'), | ||
273 | + | ||
274 | + 'fogao' => array('label' => 'Possui fogão?'), | ||
275 | + | ||
276 | + 'maquina_lavar' => array('label' => 'Possui máquina de lavar?'), | ||
277 | + | ||
278 | + 'microondas' => array('label' => 'Possui microondas?'), | ||
279 | + | ||
280 | + 'video_dvd' => array('label' => 'Possui vídeo/DVD?'), | ||
281 | + | ||
282 | + 'televisao' => array('label' => 'Possui televisão?'), | ||
283 | + | ||
284 | + 'celular' => array('label' => 'Possui celular?'), | ||
285 | + | ||
286 | + 'telefone' => array('label' => 'Possui telefone?'), | ||
287 | + | ||
288 | + 'quant_pessoas' => array('label' => 'Quantidades de pessoas residentes no lar'), | ||
289 | + | ||
290 | + 'renda' => array('label' => 'Renda familiar em R$'), | ||
291 | + | ||
292 | + 'agua_encanada' => array('label' => 'Possui água encanada?'), | ||
293 | + | ||
294 | + 'poco' => array('label' => 'Possui poço?'), | ||
295 | + | ||
296 | + 'energia' => array('label' => 'Possui energia?'), | ||
297 | + | ||
298 | + 'esgoto' => array('label' => 'Possui esgoto?'), | ||
299 | + | ||
300 | + 'fossa' => array('label' => 'Possui fossa?'), | ||
301 | + | ||
302 | + 'lixo' => array('label' => 'Possui lixo?'), | ||
303 | + | ||
101 | ); | 304 | ); |
102 | 305 | ||
103 | 306 | ||
@@ -125,7 +328,6 @@ class AlunoController extends Portabilis_Controller_Page_EditController | @@ -125,7 +328,6 @@ class AlunoController extends Portabilis_Controller_Page_EditController | ||
125 | 'required' => false, 'size' => 25); | 328 | 'required' => false, 'size' => 25); |
126 | $this->inputsHelper()->integer('id', $options); | 329 | $this->inputsHelper()->integer('id', $options); |
127 | 330 | ||
128 | - | ||
129 | // código aluno inep | 331 | // código aluno inep |
130 | $options = array('label' => $this->_getLabel('aluno_inep_id'), 'required' => false, 'size' => 25, 'max_length' => 14); | 332 | $options = array('label' => $this->_getLabel('aluno_inep_id'), 'required' => false, 'size' => 25, 'max_length' => 14); |
131 | $this->inputsHelper()->integer('aluno_inep_id', $options); | 333 | $this->inputsHelper()->integer('aluno_inep_id', $options); |
@@ -139,7 +341,7 @@ class AlunoController extends Portabilis_Controller_Page_EditController | @@ -139,7 +341,7 @@ class AlunoController extends Portabilis_Controller_Page_EditController | ||
139 | $this->inputsHelper()->simpleSearchPessoa('nome', $options); | 341 | $this->inputsHelper()->simpleSearchPessoa('nome', $options); |
140 | 342 | ||
141 | // data nascimento | 343 | // data nascimento |
142 | - $options = array('label' => 'Data nascimento', 'disabled' => true, 'required' => false, 'size' => 25, 'placeholder' => ''); | 344 | + $options = array('label' => 'Data de nascimento', 'disabled' => true, 'required' => false, 'size' => 25, 'placeholder' => ''); |
143 | $this->inputsHelper()->date('data_nascimento', $options); | 345 | $this->inputsHelper()->date('data_nascimento', $options); |
144 | 346 | ||
145 | // rg | 347 | // rg |
@@ -162,7 +364,14 @@ class AlunoController extends Portabilis_Controller_Page_EditController | @@ -162,7 +364,14 @@ class AlunoController extends Portabilis_Controller_Page_EditController | ||
162 | 364 | ||
163 | $label = Portabilis_String_Utils::toLatin1($this->_getLabel('responsavel')); | 365 | $label = Portabilis_String_Utils::toLatin1($this->_getLabel('responsavel')); |
164 | 366 | ||
367 | + /*$tiposResponsavel = array(null => $label, | ||
368 | + 'pai' => 'Pai', | ||
369 | + 'mae' => 'Mãe', | ||
370 | + 'outra_pessoa' => 'Outra pessoa');*/ | ||
371 | + $tiposResponsavel = array(null => 'Informe uma Pessoa primeiro'); | ||
372 | + | ||
165 | $options = array('label' => $this->_getLabel('responsavel'), | 373 | $options = array('label' => $this->_getLabel('responsavel'), |
374 | + 'resources' => $tiposResponsavel, | ||
166 | 'required' => true, | 375 | 'required' => true, |
167 | 'inline' => true); | 376 | 'inline' => true); |
168 | 377 | ||
@@ -193,10 +402,10 @@ class AlunoController extends Portabilis_Controller_Page_EditController | @@ -193,10 +402,10 @@ class AlunoController extends Portabilis_Controller_Page_EditController | ||
193 | 402 | ||
194 | 403 | ||
195 | // religião | 404 | // religião |
196 | - $this->inputsHelper()->religiao(array('required' => false)); | 405 | + $this->inputsHelper()->religiao(array('required' => false, 'label' => Portabilis_String_Utils::toLatin1('Religião'))); |
197 | 406 | ||
198 | // beneficio | 407 | // beneficio |
199 | - $this->inputsHelper()->beneficio(array('required' => false)); | 408 | + $this->inputsHelper()->beneficio(array('required' => false, 'label' => Portabilis_String_Utils::toLatin1('Benefício'))); |
200 | 409 | ||
201 | 410 | ||
202 | // Deficiências / habilidades especiais | 411 | // Deficiências / habilidades especiais |
@@ -212,6 +421,378 @@ class AlunoController extends Portabilis_Controller_Page_EditController | @@ -212,6 +421,378 @@ class AlunoController extends Portabilis_Controller_Page_EditController | ||
212 | $this->inputsHelper()->checkbox('alfabetizado', $options); | 421 | $this->inputsHelper()->checkbox('alfabetizado', $options); |
213 | 422 | ||
214 | 423 | ||
424 | + /* ************************************* | ||
425 | + ** Dados para a Aba 'Ficha médica' ** | ||
426 | + ************************************* */ | ||
427 | + | ||
428 | + // altura | ||
429 | + $options = array('label' => $this->_getLabel('altura'), 'size' => 5, 'max_length' => 4, 'required' => false, 'placeholder' => '' ); | ||
430 | + $this->inputsHelper()->numeric('altura',$options); | ||
431 | + | ||
432 | + // peso | ||
433 | + $options = array('label' => $this->_getLabel('peso'), 'size' => 5, 'max_length' => 6, 'required' => false, 'placeholder' => '' ); | ||
434 | + $this->inputsHelper()->numeric('peso',$options); | ||
435 | + | ||
436 | + // grupo_sanguineo | ||
437 | + $options = array('label' => $this->_getLabel('grupo_sanguineo'), 'size' => 5, 'max_length' => 2, 'required' => false, 'placeholder' => '' ); | ||
438 | + $this->inputsHelper()->text('grupo_sanguineo',$options); | ||
439 | + | ||
440 | + // fator_rh | ||
441 | + $options = array('label' => $this->_getLabel('fator_rh'), 'size' => 5, 'max_length' => 1, 'required' => false, 'placeholder' => '' ); | ||
442 | + $this->inputsHelper()->text('fator_rh',$options); | ||
443 | + | ||
444 | + // alergia_medicamento | ||
445 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('alergia_medicamento') ), 'required' => false, 'placeholder' => ''); | ||
446 | + $this->inputsHelper()->checkbox('alergia_medicamento',$options); | ||
447 | + | ||
448 | + // desc_alergia_medicamento | ||
449 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_alergia_medicamento') ), 'size' => 50, 'max_length' => 100,'required' => false, 'placeholder' => ''); | ||
450 | + $this->inputsHelper()->text('desc_alergia_medicamento',$options); | ||
451 | + | ||
452 | + // alergia_alimento | ||
453 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('alergia_alimento') ), 'required' => false, 'placeholder' => ''); | ||
454 | + $this->inputsHelper()->checkbox('alergia_alimento',$options); | ||
455 | + | ||
456 | + // desc_alergia_alimento | ||
457 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_alergia_alimento') ), 'size' => 50, 'max_length' => 100,'required' => false, 'placeholder' => ''); | ||
458 | + $this->inputsHelper()->text('desc_alergia_alimento',$options); | ||
459 | + | ||
460 | + // doenca_congenita | ||
461 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_congenita') ), 'required' => false, 'placeholder' => ''); | ||
462 | + $this->inputsHelper()->checkbox('doenca_congenita',$options); | ||
463 | + | ||
464 | + // desc_doenca_congenita | ||
465 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_doenca_congenita') ), 'size' => 50, 'max_length' => 100,'required' => false, 'placeholder' => ''); | ||
466 | + $this->inputsHelper()->text('desc_doenca_congenita',$options); | ||
467 | + | ||
468 | + // fumante | ||
469 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('fumante') ), 'required' => false, 'placeholder' => ''); | ||
470 | + $this->inputsHelper()->checkbox('fumante',$options); | ||
471 | + | ||
472 | + // doenca_caxumba | ||
473 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_caxumba') ), 'required' => false, 'placeholder' => ''); | ||
474 | + $this->inputsHelper()->checkbox('doenca_caxumba',$options); | ||
475 | + | ||
476 | + // doenca_sarampo | ||
477 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_sarampo') ), 'required' => false, 'placeholder' => ''); | ||
478 | + $this->inputsHelper()->checkbox('doenca_sarampo',$options); | ||
479 | + | ||
480 | + // doenca_rubeola | ||
481 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_rubeola') ), 'required' => false, 'placeholder' => ''); | ||
482 | + $this->inputsHelper()->checkbox('doenca_rubeola',$options); | ||
483 | + | ||
484 | + // doenca_catapora | ||
485 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_catapora') ), 'required' => false, 'placeholder' => ''); | ||
486 | + $this->inputsHelper()->checkbox('doenca_catapora',$options); | ||
487 | + | ||
488 | + // doenca_escarlatina | ||
489 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_escarlatina') ), 'required' => false, 'placeholder' => ''); | ||
490 | + $this->inputsHelper()->checkbox('doenca_escarlatina',$options); | ||
491 | + | ||
492 | + // doenca_coqueluche | ||
493 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_coqueluche') ), 'required' => false, 'placeholder' => ''); | ||
494 | + $this->inputsHelper()->checkbox('doenca_coqueluche',$options); | ||
495 | + | ||
496 | + // doenca_outras | ||
497 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('doenca_outras') ), 'size' => 50, 'max_length' => 100,'required' => false, 'placeholder' => ''); | ||
498 | + $this->inputsHelper()->text('doenca_outras',$options); | ||
499 | + | ||
500 | + // epiletico | ||
501 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('epiletico') ), 'required' => false, 'placeholder' => ''); | ||
502 | + $this->inputsHelper()->checkbox('epiletico',$options); | ||
503 | + | ||
504 | + // epiletico_tratamento | ||
505 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('epiletico_tratamento') ), 'required' => false, 'placeholder' => ''); | ||
506 | + $this->inputsHelper()->checkbox('epiletico_tratamento',$options); | ||
507 | + | ||
508 | + // hemofilico | ||
509 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('hemofilico') ), 'required' => false, 'placeholder' => ''); | ||
510 | + $this->inputsHelper()->checkbox('hemofilico',$options); | ||
511 | + | ||
512 | + // hipertenso | ||
513 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('hipertenso') ), 'required' => false, 'placeholder' => ''); | ||
514 | + $this->inputsHelper()->checkbox('hipertenso',$options); | ||
515 | + | ||
516 | + // asmatico | ||
517 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('asmatico') ), 'required' => false, 'placeholder' => ''); | ||
518 | + $this->inputsHelper()->checkbox('asmatico',$options); | ||
519 | + | ||
520 | + // diabetico | ||
521 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('diabetico') ), 'required' => false, 'placeholder' => ''); | ||
522 | + $this->inputsHelper()->checkbox('diabetico',$options); | ||
523 | + | ||
524 | + // insulina | ||
525 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('insulina') ), 'required' => false, 'placeholder' => ''); | ||
526 | + $this->inputsHelper()->checkbox('insulina',$options); | ||
527 | + | ||
528 | + // tratamento_medico | ||
529 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tratamento_medico') ), 'required' => false, 'placeholder' => ''); | ||
530 | + $this->inputsHelper()->checkbox('tratamento_medico',$options); | ||
531 | + | ||
532 | + // desc_tratamento_medico | ||
533 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_tratamento_medico') ), 'size' => 50, 'max_length' => 100,'required' => false, 'placeholder' => ''); | ||
534 | + $this->inputsHelper()->text('desc_tratamento_medico',$options); | ||
535 | + | ||
536 | + // medicacao_especifica | ||
537 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('medicacao_especifica') ), 'required' => false, 'placeholder' => ''); | ||
538 | + $this->inputsHelper()->checkbox('medicacao_especifica',$options); | ||
539 | + | ||
540 | + // desc_medicacao_especifica | ||
541 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_medicacao_especifica') ), 'size' => 50, 'max_length' => 100,'required' => false, 'placeholder' => ''); | ||
542 | + $this->inputsHelper()->text('desc_medicacao_especifica',$options); | ||
543 | + | ||
544 | + // acomp_medico_psicologico | ||
545 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('acomp_medico_psicologico') ), 'required' => false, 'placeholder' => ''); | ||
546 | + $this->inputsHelper()->checkbox('acomp_medico_psicologico',$options); | ||
547 | + | ||
548 | + // desc_acomp_medico_psicologico | ||
549 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_acomp_medico_psicologico') ), 'size' => 50, 'max_length' => 100,'required' => false, 'placeholder' => ''); | ||
550 | + $this->inputsHelper()->text('desc_acomp_medico_psicologico',$options); | ||
551 | + | ||
552 | + // restricao_atividade_fisica | ||
553 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('restricao_atividade_fisica') ), 'required' => false, 'placeholder' => ''); | ||
554 | + $this->inputsHelper()->checkbox('restricao_atividade_fisica',$options); | ||
555 | + | ||
556 | + // desc_restricao_atividade_fisica | ||
557 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_restricao_atividade_fisica') ), 'size' => 50, 'max_length' => 100,'required' => false, 'placeholder' => ''); | ||
558 | + $this->inputsHelper()->text('desc_restricao_atividade_fisica',$options); | ||
559 | + | ||
560 | + // fratura_trauma | ||
561 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('fratura_trauma') ), 'required' => false, 'placeholder' => ''); | ||
562 | + $this->inputsHelper()->checkbox('fratura_trauma',$options); | ||
563 | + | ||
564 | + // desc_fratura_trauma | ||
565 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_fratura_trauma') ), 'size' => 50, 'max_length' => 100,'required' => false, 'placeholder' => ''); | ||
566 | + $this->inputsHelper()->text('desc_fratura_trauma',$options); | ||
567 | + | ||
568 | + // plano_saude | ||
569 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('plano_saude') ), 'required' => false, 'placeholder' => ''); | ||
570 | + $this->inputsHelper()->checkbox('plano_saude',$options); | ||
571 | + | ||
572 | + // desc_plano_saude | ||
573 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('desc_plano_saude') ), 'size' => 50, 'max_length' => 100,'required' => false, 'placeholder' => ''); | ||
574 | + $this->inputsHelper()->text('desc_plano_saude',$options); | ||
575 | + | ||
576 | + $this->campoRotulo('tit_dados_hospital',Portabilis_String_Utils::toLatin1('Em caso de emergência, levar para hospital ou clínica')); | ||
577 | + | ||
578 | + // hospital_clinica | ||
579 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('hospital_clinica') ), 'size' => 50, 'max_length' => 100,'required' => false, 'placeholder' => ''); | ||
580 | + $this->inputsHelper()->text('hospital_clinica',$options); | ||
581 | + | ||
582 | + // hospital_clinica_endereco | ||
583 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('hospital_clinica_endereco') ), 'size' => 50, 'max_length' => 50,'required' => false, 'placeholder' => ''); | ||
584 | + $this->inputsHelper()->text('hospital_clinica_endereco',$options); | ||
585 | + | ||
586 | + // hospital_clinica_telefone | ||
587 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('hospital_clinica_telefone') ), 'size' => 20, 'max_length' => 20,'required' => false, 'placeholder' => ''); | ||
588 | + $this->inputsHelper()->text('hospital_clinica_telefone',$options); | ||
589 | + | ||
590 | + $this->campoRotulo('tit_dados_responsavel',Portabilis_String_Utils::toLatin1('Em caso de emergência, caso não seja encontrado pais ou responsáveis, avisar')); | ||
591 | + | ||
592 | + // responsavel | ||
593 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('responsavel') ), 'size' => 50, 'max_length' => 50,'required' => false, 'placeholder' => ''); | ||
594 | + $this->inputsHelper()->text('responsavel',$options); | ||
595 | + | ||
596 | + // responsavel_parentesco | ||
597 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('responsavel_parentesco') ), 'size' => 20, 'max_length' => 20,'required' => false, 'placeholder' => ''); | ||
598 | + $this->inputsHelper()->text('responsavel_parentesco',$options); | ||
599 | + | ||
600 | + // responsavel_parentesco_telefone | ||
601 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('responsavel_parentesco_telefone') ), 'size' => 20, 'max_length' => 20,'required' => false, 'placeholder' => ''); | ||
602 | + $this->inputsHelper()->text('responsavel_parentesco_telefone',$options); | ||
603 | + | ||
604 | + // responsavel_parentesco_celular | ||
605 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('responsavel_parentesco_celular') ), 'size' => 20, 'max_length' => 20,'required' => false, 'placeholder' => ''); | ||
606 | + $this->inputsHelper()->text('responsavel_parentesco_celular',$options); | ||
607 | + | ||
608 | + // recebeu_uniforme | ||
609 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('recebeu_uniforme') ), 'required' => false, 'placeholder' => ''); | ||
610 | + $this->inputsHelper()->checkbox('recebeu_uniforme',$options); | ||
611 | + | ||
612 | + $this->campoRotulo('label_camiseta',Portabilis_String_Utils::toLatin1($this->_getLabel('label_camiseta'))); | ||
613 | + | ||
614 | + // quantidade_camiseta | ||
615 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quantidade_camiseta') ), 'size' => 2, 'max_length' => 3,'required' => false, 'placeholder' => ''); | ||
616 | + $this->inputsHelper()->integer('quantidade_camiseta',$options); | ||
617 | + | ||
618 | + // tamanho_camiseta | ||
619 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tamanho_camiseta') ), 'size' => 2, 'max_length' => 2,'required' => false, 'placeholder' => ''); | ||
620 | + $this->inputsHelper()->text('tamanho_camiseta',$options); | ||
621 | + | ||
622 | + $this->campoRotulo('label_bermuda',Portabilis_String_Utils::toLatin1($this->_getLabel('label_bermuda'))); | ||
623 | + | ||
624 | + // quantidade_bermuda | ||
625 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quantidade_bermuda') ), 'size' => 2, 'max_length' => 3,'required' => false, 'placeholder' => ''); | ||
626 | + $this->inputsHelper()->integer('quantidade_bermuda',$options); | ||
627 | + | ||
628 | + // tamanho_bermuda | ||
629 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tamanho_bermuda') ), 'size' => 2, 'max_length' => 2,'required' => false, 'placeholder' => ''); | ||
630 | + $this->inputsHelper()->text('tamanho_bermuda',$options); | ||
631 | + | ||
632 | + $this->campoRotulo('label_calca',Portabilis_String_Utils::toLatin1($this->_getLabel('label_calca'))); | ||
633 | + | ||
634 | + // quantidade_calca | ||
635 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quantidade_calca') ), 'size' => 2, 'max_length' => 3,'required' => false, 'placeholder' => ''); | ||
636 | + $this->inputsHelper()->integer('quantidade_calca',$options); | ||
637 | + | ||
638 | + // tamanho_calca | ||
639 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tamanho_calca') ), 'size' => 2, 'max_length' => 2,'required' => false, 'placeholder' => ''); | ||
640 | + $this->inputsHelper()->text('tamanho_calca',$options); | ||
641 | + | ||
642 | + $this->campoRotulo('label_saia',Portabilis_String_Utils::toLatin1($this->_getLabel('label_saia'))); | ||
643 | + | ||
644 | + // quantidade_saia | ||
645 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quantidade_saia') ), 'size' => 2, 'max_length' => 3,'required' => false, 'placeholder' => ''); | ||
646 | + $this->inputsHelper()->integer('quantidade_saia',$options); | ||
647 | + | ||
648 | + // tamanho_saia | ||
649 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tamanho_saia') ), 'size' => 2, 'max_length' => 2,'required' => false, 'placeholder' => ''); | ||
650 | + $this->inputsHelper()->text('tamanho_saia',$options); | ||
651 | + | ||
652 | + $this->campoRotulo('label_calcado',Portabilis_String_Utils::toLatin1($this->_getLabel('label_calcado'))); | ||
653 | + | ||
654 | + // quantidade_calcado | ||
655 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quantidade_calcado') ), 'size' => 2, 'max_length' => 3,'required' => false, 'placeholder' => ''); | ||
656 | + $this->inputsHelper()->integer('quantidade_calcado',$options); | ||
657 | + | ||
658 | + // tamanho_calcado | ||
659 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tamanho_calcado') ), 'size' => 2, 'max_length' => 2,'required' => false, 'placeholder' => ''); | ||
660 | + $this->inputsHelper()->text('tamanho_calcado',$options); | ||
661 | + | ||
662 | + $this->campoRotulo('label_meia',Portabilis_String_Utils::toLatin1($this->_getLabel('label_meia'))); | ||
663 | + | ||
664 | + // quantidade_meia | ||
665 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quantidade_meia') ), 'size' =>2, 'max_length' => 3,'required' => false, 'placeholder' => ''); | ||
666 | + $this->inputsHelper()->integer('quantidade_meia',$options); | ||
667 | + | ||
668 | + // tamanho_meia | ||
669 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tamanho_meia') ), 'size' => 2, 'max_length' => 2,'required' => false, 'placeholder' => ''); | ||
670 | + $this->inputsHelper()->text('tamanho_meia',$options); | ||
671 | + | ||
672 | + $this->campoRotulo('label_blusa_jaqueta',Portabilis_String_Utils::toLatin1($this->_getLabel('label_blusa_jaqueta'))); | ||
673 | + | ||
674 | + // quantidade_blusa_jaqueta | ||
675 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quantidade_blusa_jaqueta') ), 'size' =>2, 'max_length' => 3,'required' => false, 'placeholder' => ''); | ||
676 | + $this->inputsHelper()->integer('quantidade_blusa_jaqueta',$options); | ||
677 | + | ||
678 | + // tamanho_blusa_jaqueta | ||
679 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('tamanho_blusa_jaqueta') ), 'size' => 2, 'max_length' => 2,'required' => false, 'placeholder' => ''); | ||
680 | + $this->inputsHelper()->text('tamanho_blusa_jaqueta',$options); | ||
681 | + | ||
682 | + $moradias = array(null => 'Selecione', | ||
683 | + 'A' => 'Apartamento', | ||
684 | + 'C' => 'Casa', | ||
685 | + 'O' => 'Outro'); | ||
686 | + | ||
687 | + $options = array('label' => $this->_getLabel('moradia'), | ||
688 | + 'resources' => $moradias, | ||
689 | + 'required' => false, | ||
690 | + 'inline' => true); | ||
691 | + | ||
692 | + $this->inputsHelper()->select('moradia', $options); | ||
693 | + | ||
694 | + $materiais_moradia = array( 'A' => 'Alvenaria', | ||
695 | + 'M' => 'Madeira', | ||
696 | + 'I' => 'Mista'); | ||
697 | + | ||
698 | + $options = array('label' => null, | ||
699 | + 'resources' => $materiais_moradia, | ||
700 | + 'required' => false, | ||
701 | + 'inline' => true); | ||
702 | + | ||
703 | + $this->inputsHelper()->select('material', $options); | ||
704 | + | ||
705 | + $options = array('label' => null, 'size' => 20, 'max_length' => 20,'required' => false, 'placeholder' => 'Descreva'); | ||
706 | + $this->inputsHelper()->text('casa_outra',$options); | ||
707 | + | ||
708 | + $situacoes = array( null => 'Selecione', | ||
709 | + '1' => 'Alugado', | ||
710 | + '2' => Portabilis_String_Utils::toLatin1('Próprio'), | ||
711 | + '3' => 'Cedido', | ||
712 | + '4' => 'Financiado', | ||
713 | + '5' => 'Outros'); | ||
714 | + | ||
715 | + $options = array('label' => $this->_getLabel('moradia_situacao'), | ||
716 | + 'resources' => $situacoes, | ||
717 | + 'required' => false); | ||
718 | + | ||
719 | + $this->inputsHelper()->select('moradia_situacao', $options); | ||
720 | + | ||
721 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quartos') ), 'size' =>2, 'max_length' => 2,'required' => false, 'placeholder' => ''); | ||
722 | + $this->inputsHelper()->integer('quartos',$options); | ||
723 | + | ||
724 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('sala') ), 'size' =>2, 'max_length' => 2,'required' => false, 'placeholder' => ''); | ||
725 | + $this->inputsHelper()->integer('sala',$options); | ||
726 | + | ||
727 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('copa') ), 'size' =>2, 'max_length' => 2,'required' => false, 'placeholder' => ''); | ||
728 | + $this->inputsHelper()->integer('copa',$options); | ||
729 | + | ||
730 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('banheiro') ), 'size' =>2, 'max_length' => 2,'required' => false, 'placeholder' => ''); | ||
731 | + $this->inputsHelper()->integer('banheiro',$options); | ||
732 | + | ||
733 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('garagem') ), 'size' =>2, 'max_length' => 2,'required' => false, 'placeholder' => ''); | ||
734 | + $this->inputsHelper()->integer('garagem',$options); | ||
735 | + | ||
736 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('empregada_domestica') ), 'required' => false, 'placeholder' => ''); | ||
737 | + $this->inputsHelper()->checkbox('empregada_domestica',$options); | ||
738 | + | ||
739 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('automovel') ), 'required' => false, 'placeholder' => ''); | ||
740 | + $this->inputsHelper()->checkbox('automovel',$options); | ||
741 | + | ||
742 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('motocicleta') ), 'required' => false, 'placeholder' => ''); | ||
743 | + $this->inputsHelper()->checkbox('motocicleta',$options); | ||
744 | + | ||
745 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('computador') ), 'required' => false, 'placeholder' => ''); | ||
746 | + $this->inputsHelper()->checkbox('computador',$options); | ||
747 | + | ||
748 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('geladeira') ), 'required' => false, 'placeholder' => ''); | ||
749 | + $this->inputsHelper()->checkbox('geladeira',$options); | ||
750 | + | ||
751 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('fogao') ), 'required' => false, 'placeholder' => ''); | ||
752 | + $this->inputsHelper()->checkbox('fogao',$options); | ||
753 | + | ||
754 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('maquina_lavar') ), 'required' => false, 'placeholder' => ''); | ||
755 | + $this->inputsHelper()->checkbox('maquina_lavar',$options); | ||
756 | + | ||
757 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('microondas') ), 'required' => false, 'placeholder' => ''); | ||
758 | + $this->inputsHelper()->checkbox('microondas',$options); | ||
759 | + | ||
760 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('video_dvd') ), 'required' => false, 'placeholder' => ''); | ||
761 | + $this->inputsHelper()->checkbox('video_dvd',$options); | ||
762 | + | ||
763 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('televisao') ), 'required' => false, 'placeholder' => ''); | ||
764 | + $this->inputsHelper()->checkbox('televisao',$options); | ||
765 | + | ||
766 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('telefone') ), 'required' => false, 'placeholder' => ''); | ||
767 | + $this->inputsHelper()->checkbox('telefone',$options); | ||
768 | + | ||
769 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('celular') ), 'required' => false, 'placeholder' => ''); | ||
770 | + $this->inputsHelper()->checkbox('celular',$options); | ||
771 | + | ||
772 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('quant_pessoas') ), 'size' =>5, 'max_length' => 2,'required' => false, 'placeholder' => ''); | ||
773 | + $this->inputsHelper()->integer('quant_pessoas',$options); | ||
774 | + | ||
775 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('renda') ), 'size' =>5, 'max_length' => 10,'required' => false, 'placeholder' => ''); | ||
776 | + $this->inputsHelper()->numeric('renda',$options); | ||
777 | + | ||
778 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('agua_encanada') ), 'required' => false, 'placeholder' => ''); | ||
779 | + $this->inputsHelper()->checkbox('agua_encanada',$options); | ||
780 | + | ||
781 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('poco') ), 'required' => false, 'placeholder' => ''); | ||
782 | + $this->inputsHelper()->checkbox('poco',$options); | ||
783 | + | ||
784 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('energia') ), 'required' => false, 'placeholder' => ''); | ||
785 | + $this->inputsHelper()->checkbox('energia',$options); | ||
786 | + | ||
787 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('esgoto') ), 'required' => false, 'placeholder' => ''); | ||
788 | + $this->inputsHelper()->checkbox('esgoto',$options); | ||
789 | + | ||
790 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('fossa') ), 'required' => false, 'placeholder' => ''); | ||
791 | + $this->inputsHelper()->checkbox('fossa',$options); | ||
792 | + | ||
793 | + $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('lixo') ), 'required' => false, 'placeholder' => ''); | ||
794 | + $this->inputsHelper()->checkbox('lixo',$options); | ||
795 | + | ||
215 | $this->loadResourceAssets($this->getDispatcher()); | 796 | $this->loadResourceAssets($this->getDispatcher()); |
216 | } | 797 | } |
217 | } | 798 | } |
ieducar/modules/Portabilis/Assets/Version.php
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | usado pelo metodos loadJavascript e loadStylesheet do helper Portabilis_View_Helper_Application */ | 4 | usado pelo metodos loadJavascript e loadStylesheet do helper Portabilis_View_Helper_Application */ |
5 | 5 | ||
6 | class Portabilis_Assets_Version { | 6 | class Portabilis_Assets_Version { |
7 | - const VERSION = '4'; | 7 | + const VERSION = '5'; |
8 | } | 8 | } |
9 | 9 | ||
10 | ?> | 10 | ?> |