Esempio n. 1
0
}
include_once '../bd/PessoaDAO.php';
include_once '../bd/FamiliaDAO.php';
include_once '../bd/CidadeDAO.php';
include_once '../bd/EstadoDAO.php';
include_once '../controle/cFuncoes.php';
include_once '../bd/PessoaHasProgramaDAO.php';
include_once '../bd/ProgramaDAO.php';
include_once '../bd/TelefoneDAO.php';
$id_pessoa = $_GET['id_pessoa'];
$fD = new FamiliaDAO();
$cD = new CidadeDAO();
$eD = new EstadoDAO();
$pD = new PessoaDAO();
$pHpD = new PessoaHasProgramaDAO();
$telD = new TelefoneDAO();
$pessoa = mysql_fetch_assoc($pD->buscaPessoaById($id_pessoa));
$familia = mysql_fetch_assoc($fD->buscaFamiliaById($pessoa['id_familia']));
if ($pessoa['cidade_natal'] != "") {
    $cidadeNatal = mysql_fetch_assoc($cD->buscaCidadebyCod($pessoa['cidade_natal']));
}
$cidade = mysql_fetch_assoc($cD->buscaCidadebyCod($familia['cod_cidade']));
$estado = mysql_fetch_assoc($eD->buscaEstadobyCod($cidade['cod_estado']));
$telefone_residencial = mysql_fetch_assoc($telD->buscaTelefoneByIdFamilia($pessoa['id_familia']));
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <?php 
require "vLayoutHead.php";
Esempio n. 2
0
                        <br/>        
                        <td>                   
                            <div class="dados_familia">                                                                
                                <h3>&nbsp;</h3>         
                                <p>&nbsp;</p>         
                                <?php 
if (isset($_GET["family"])) {
    echo "<p>Qual é o grau de parentesco desta pessoa em relação a(ao) " . strtoupper($_GET['titular']) . ":<br>" . "<select name='grauParentesco'>" . "<option>AGREGADO(A)</option>" . "<option>AMASIADO(A)</option>" . "<option>AVÔ(Ó)</option>" . "<option>COMPANHEIRO(A)</option>" . "<option>CÔNJUGE(MARIDO OU ESPOSA)</option>" . "<option>CUNHADO(A)</option>" . "<option>ENTEADO(A)</option>" . "<option>EX-COMPANHEIRO(A)</option>" . "<option>EX-MARIDO/EX-ESPOSA</option>" . "<option>FILHO(A)</option>" . "<option>GENRO/NORA</option>" . "<option>IRMÃ(O)</option>" . "<option>NETO(A)</option>" . "<option>PADRASTO/MADRASTA</option>" . "<option>PAI/MÃE</option>" . "<option>PRIMO(A)</option>" . "<option>SOBRINHO(A)</option>" . "<option>SOGRO(A)</option>" . "<option>TIO(A)</option>" . "</select>";
    include_once '../bd/FamiliaDAO.php';
    include_once '../bd/CidadeDAO.php';
    include_once '../bd/EstadoDAO.php';
    include_once '../bd/TelefoneDAO.php';
    $fD = new FamiliaDAO();
    $cD = new CidadeDAO();
    $eD = new EstadoDAO();
    $tD = new TelefoneDAO();
    $result = mysql_fetch_assoc($fD->buscaFamiliaById($_GET["family"]));
    $resCidade = mysql_fetch_assoc($cD->buscaCidadebyCod($result['cod_cidade']));
    $resEstado = mysql_fetch_assoc($eD->buscaEstadobyCod($resCidade['cod_estado']));
    $resTelefone = mysql_fetch_assoc($tD->buscaTelefoneByIdFamilia($_GET['family']));
    ?>
                                    <p>&nbsp;</p>
                                    <p>&nbsp;</p>
                                    <p>ID da família<br/>
                                        <input type="text" name="id_familia" value="<?php 
    echo $_GET["family"];
    ?>
" size="14" disabled/><br/>
                                    </p><br/>
                                    <p>CEP:(*)<br/>
                                        <input type="text" id="cep" name="cep" value="<?php 
 public function listarTiposJSON()
 {
     $telefoneDAO = new TelefoneDAO();
     $tipos = $telefoneDAO->listarTipos();
     echo json_encode($tipos);
 }
Esempio n. 4
0
if (!isset($_POST['idFamilia'])) {
    //se nao existe familia
    //cadastra o bairro
    $bairroDAO = new BairroDAO();
    $bairroDAO->cadastraBairro($_POST['bairro']);
    //cadastra a familia
    $familia = new Familia($_POST['cep'], $_POST['logradouro'], $_POST['numero'], $_POST['bairro'], $_POST['cidade']);
    $familiaDAO = new FamiliaDAO();
    $res = $familiaDAO->cadastraFamilia_2($familia);
    if ($res === FALSE) {
        echo "Erro ao cadastrar familia";
        exit;
    } else {
        if (isset($_POST['telefone_residencial'])) {
            $tel = $_POST['telefone_residencial'];
            $TelefoneDAO = new TelefoneDAO();
            $TelefoneDAO->cadastraTelefone($tel, $familia->getIdFamilia(), '');
        }
    }
} else {
    //echo $_POST['idFamilia'];
    $familia = new Familia("", "", "", "", "");
    $familia->setIdFamilia($_POST['idFamilia']);
}
//se existe grauParentesco não estou cadastrando um TITULAR!
if (isset($_POST['grauParentesco'])) {
    $grauParentesco = $_POST['grauParentesco'];
} else {
    $grauParentesco = "TITULAR";
}
//cadastra a pessoa
Esempio n. 5
0
        if (!in_array($programa, $programas_novos)) {
            //se o programa antigo não está na lista de programas novo rem
            $pessoaHasProgramaDAO->remove($id_pessoa, $programa);
            echo "O programa novo {$programa} não está na lista de programas antigos vamos inseri-lo";
            echo "o programa antigo não está na lista de programas novo rem<br>";
        }
    }
} else {
    $pessoaHasProgramaDAO->removeTodosProgramas($id_pessoa);
    //remove todos os programas
    echo "DEletando tudo";
}
$bairroDAO->cadastraBairro($bairro);
$familia = new Familia($cep, $logradouro, $numero, $bairro, $cidade);
$familia->setIdFamilia($id_familia);
$TelefoneDAO = new TelefoneDAO();
$telefone_antigo = $TelefoneDAO->buscaTelefoneByIdFamilia($id_familia);
if (mysql_numrows($telefone_antigo) > 0) {
    //se tinha telefone cadastrado
    $tel_antigo = mysql_fetch_assoc($telefone_antigo);
    if ($telefone_residencial == '') {
        //e agora não tem mais
        echo "agora não tem mais";
        $TelefoneDAO->removeTelefoneByNumero($tel_antigo['telefone']);
        //remove
    } else {
        //se ainda tem, atualiza
        echo "ainda tem";
        $Telefone_novo = new Telefone($id_familia, $telefone_residencial, '');
        $TelefoneDAO->alteraDadosTelefone($Telefone_novo, $tel_antigo['telefone']);
    }
Esempio n. 6
0
 private function selectOne()
 {
     $pessoaAux = $this->fetch();
     if (sizeof($pessoaAux) > 0) {
         $pessoaAux = $pessoaAux[0];
         $pessoa = $this->selectTipo($pessoaAux);
         $veiculoDAO = new VeiculoDAO();
         $veiculos = $veiculoDAO->listarProprieatario($pessoaAux->id);
         $pessoa->veiculos = $veiculos;
         $telefoneDAO = new TelefoneDAO();
         $telefones = $telefoneDAO->listaPorPessoa($pessoaAux->id);
         $pessoa->telefones = $telefones;
         $enderecoDAO = new EnderecoDAO();
         $pessoa->enderecos = $enderecoDAO->listaPorPessoa($pessoaAux->id);
         return $pessoa;
     }
     throw new FormException("Usuário não encontrado");
 }
 public function novoTel()
 {
     $telefoneControl = new TelefoneDAO();
     $tiposTelefone = $telefoneControl->listarTipos();
     $telefone = new Telefone();
     $n = $_GET['valor'];
     include 'telefone_unit.form.php';
 }