示例#1
0
use Entities;
include_once '../config.php';
ini_set('display_errors', 1);
ini_set('display_startup_erros', 1);
error_reporting(E_ALL);
$con = mysql_connect("localhost", "root", "offline2610");
mysql_select_db("dbju_guilherme");
$idTabelaAMB99 = 4;
$sql = "select * from AMB99";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
    if ($row["PORTE"] == '') {
        continue;
    }
    $proc = new Entities\Procedimento();
    $proc->setCodigo($row["CODIGO"]);
    $proc->setDescricao($row["DESCRICAO"]);
    $tabela = $em->find("Entities\\Tabela", $idTabelaAMB99);
    $sqlPorte = "select p from Entities\\Porte p JOIN p.planoConvenio pc where pc.id = 90 and p.numero = :numeroPorte";
    $qPorte = $em->createQuery($sqlPorte);
    $qPorte->setParameter("numeroPorte", $row["PORTE"]);
    $portes = $qPorte->getResult();
    $porte = "";
    foreach ($portes as $porte) {
        break;
    }
    echo "rowPorte: " . $row["PORTE"];
    echo " Porte: " . $porte->getNumero() . "<br />";
    $proc->addTabela($tabela);
    $pp = new Entities\ProcedimentoPorte();
示例#2
0
<?php

use Entities\Procedimento;
include_once '../templates/topo.php';
$permissoesPagina = array(CADASTRAPROCEDIMENTO, MENUCADASTROS);
verificaPermissao($permissoesPagina);
$id = '';
if (isset($_REQUEST['id'])) {
    $id = $_REQUEST['id'];
}
$procedimento = $em->find("Entities\\Procedimento", $id);
if (empty($procedimento)) {
    $procedimento = new Procedimento();
}
?>
	<script>
		procedimento = new Procedimento();
		
	</script>
	<div class="tabs center">
			<ul>
				<li><a href="#tabs-1">Dados Procedimento</a></li>
<!--				<li><a href="#tabs-2">Procedimentos</a></li>-->
				
			</ul>
			<div id="tabs-1">
				<div cols='4'>
					<div class='field'>
						<label>Codigo Procedimento</label>
						<input type='text' id='txtCodigo' value='<?php 
echo $procedimento->getCodigo();
示例#3
0
<?php

use Entities;
use Entities\Procedimento;
$procedimento = $_REQUEST['p'];
$isUpdate = true;
$tabela = $_REQUEST['tabela'];
$valor = isset($_REQUEST['valor']) ? $_REQUEST['valor'] : 0;
$p = $em->find('Entities\\Procedimento', $procedimento['id']);
$t = $em->find('Entities\\Tabela', $tabela);
if (empty($p)) {
    $p = new Procedimento();
    $isUpdate = false;
}
$p->setCodigo($procedimento['codigo']);
$p->setDescricao($procedimento['descricao']);
if (!$isUpdate) {
    $p->addTabela($t);
    $t->addProcedimento($p);
}
$em->persist($p);
$em->persist($t);
if (!$isUpdate) {
    $sqlPortes = "select p from Entities\\Porte p JOIN p.planoConvenio pc JOIN pc.convenio c JOIN c.tabelaContratada t where (t.id = :idTabela or c.id=34) and p.numero = '0'";
    $q = $em->createQuery($sqlPortes);
    $q->setParameter("idTabela", $tabela);
    $portes = $q->getResult();
    foreach ($portes as $porte) {
        $pp = new Entities\ProcedimentoPorte();
        $pp->setPorte($porte);
        $pp->setProcedimento($p);