Exemplo n.º 1
0
<?php

use Entities\Tabela;
include_once '../templates/topo.php';
$id = '';
if (isset($_REQUEST['id'])) {
    $id = $_REQUEST['id'];
}
$tabela = $em->find("Entities\\Tabela", $id);
if (empty($cliente)) {
    $tabela = new Tabela();
}
?>
	<script>
//		tabela = new tabela();
		
	</script>
	<div class="tabs center">
			<ul>
				<li><a href="#tabs-1">Dados Tabela</a></li>
				
			</ul>
			<div id="tabs-1">
				<div cols='1'>
					<div class='field'>
						<label>Nome Tabela</label>
						<input type='text' id='txtNome' value='<?php 
echo $tabela->getNome();
?>
'  size='30' style='text-align: left;' />
					</div>
Exemplo n.º 2
0
<?php

use Entities\Tabela;
$id = isset($_REQUEST["id"]) ? get_request($id) : '';
$nome = get_request("nome");
$tabela = $em->find("Entities\\Tabela", $id);
if (empty($tabela)) {
    $tabela = new Tabela();
}
$tabela->setNome($nome);
$em->persist($tabela);
$erro = 0;
$descricaoErro = "";
try {
    $em->flush();
} catch (Exception $e) {
    //	$em->getConnection()->rollback();
    $erro = 1;
    $descricaoErro = $e->getMessage();
    //	print_r($e);
}
echo "<erro>{$erro}</erro><descricaoErro>{$descricaoErro}</descricaoErro>";