Esempio n. 1
0
 protected function createOrUpdateMoradia($id)
 {
     $obj = new clsModulesMoradiaAluno();
     $obj->ref_cod_aluno = $id;
     $obj->moradia = $this->getRequest()->moradia;
     $obj->material = $this->getRequest()->material;
     $obj->casa_outra = Portabilis_String_Utils::toLatin1($this->getRequest()->casa_outra);
     $obj->moradia_situacao = $this->getRequest()->moradia_situacao;
     $obj->quartos = $this->getRequest()->quartos;
     $obj->sala = $this->getRequest()->sala;
     $obj->copa = $this->getRequest()->copa;
     $obj->banheiro = $this->getRequest()->banheiro;
     $obj->garagem = $this->getRequest()->garagem;
     $obj->empregada_domestica = $this->getRequest()->empregada_domestica == 'on' ? 'S' : 'N';
     $obj->automovel = $this->getRequest()->automovel == 'on' ? 'S' : 'N';
     $obj->motocicleta = $this->getRequest()->motocicleta == 'on' ? 'S' : 'N';
     $obj->computador = $this->getRequest()->computador == 'on' ? 'S' : 'N';
     $obj->geladeira = $this->getRequest()->geladeira == 'on' ? 'S' : 'N';
     $obj->fogao = $this->getRequest()->fogao == 'on' ? 'S' : 'N';
     $obj->maquina_lavar = $this->getRequest()->maquina_lavar == 'on' ? 'S' : 'N';
     $obj->microondas = $this->getRequest()->microondas == 'on' ? 'S' : 'N';
     $obj->video_dvd = $this->getRequest()->video_dvd == 'on' ? 'S' : 'N';
     $obj->televisao = $this->getRequest()->televisao == 'on' ? 'S' : 'N';
     $obj->celular = $this->getRequest()->celular == 'on' ? 'S' : 'N';
     $obj->telefone = $this->getRequest()->telefone == 'on' ? 'S' : 'N';
     $obj->quant_pessoas = $this->getRequest()->quant_pessoas;
     $obj->renda = floatval(preg_replace("/[^0-9\\.]/", "", str_replace(",", ".", $this->getRequest()->renda)));
     $obj->agua_encanada = $this->getRequest()->agua_encanada == 'on' ? 'S' : 'N';
     $obj->poco = $this->getRequest()->poco == 'on' ? 'S' : 'N';
     $obj->energia = $this->getRequest()->energia == 'on' ? 'S' : 'N';
     $obj->esgoto = $this->getRequest()->esgoto == 'on' ? 'S' : 'N';
     $obj->fossa = $this->getRequest()->fossa == 'on' ? 'S' : 'N';
     $obj->lixo = $this->getRequest()->lixo == 'on' ? 'S' : 'N';
     return $obj->existe() ? $obj->edita() : $obj->cadastra();
 }