Ejemplo n.º 1
0
<?php

use Entities\EnderecoConvenio;
use Entities\ContatoConvenio;
$contatoConvenio = $_REQUEST["contatoConvenio"];
$c = $em->find("Entities\\ContatoConvenio", $contatoConvenio['id']);
if (empty($c)) {
    $c = new ContatoConvenio();
}
$c->setNome($contatoConvenio['nome']);
$c->setCelular($contatoConvenio['celular']);
$c->setEmail($contatoConvenio['email']);
$c->setNextel($contatoConvenio['nextel']);
$c->setRamal($contatoConvenio['ramal']);
$c->setTelefone($contatoConvenio['telefone']);
$a = $c->getEnderecoConvenio();
if (empty($a)) {
    $c->setEnderecoConvenio($em->find("Entities\\EnderecoConvenio", $contatoConvenio['enderecoConvenio']['id']));
}
$a = $c->getConvenio();
if (empty($a)) {
    $c->setConvenio($em->find("Entities\\Convenio", $contatoConvenio['convenio']['id']));
}
$em->persist($c);
try {
    $em->flush();
    $erro = 0;
} catch (Exception $e) {
    $em->getConnection()->rollback();
    $erro = 1;
}
Ejemplo n.º 2
0
<?php

use Entities\ContatoConvenio;
include_once '../templates/topo.php';
$id = '';
if (isset($_REQUEST['id'])) {
    $id = $_REQUEST['id'];
}
$contatoConvenio = $em->find("Entities\\ContatoConvenio", $id);
if (empty($contatoConvenio)) {
    $contatoConvenio = new ContatoConvenio();
}
?>
	<script>
		contatoConvenio = new ContatoConvenio();
	</script>
	<div class="tabs center">
			<ul>
				<li><a href="#tabs-contato-1">Contato</a></li>
			</ul>
			<div id="tabs-contato-1">
				<div cols='2'>
					<div class='field' >
						<label>Nome</label>
						<input type="hidden" value="<?php 
echo $id;
?>
" id='hidIdContatoConvenio' />
						<input type='text' id='txtNome' value='<?php 
echo $contatoConvenio->getNome();
?>