<?php $id_pac=$_GET['id_pac']; 
require_once('../../../Connections/odonto_connection.php');

function consulta_tabla1()
{
	$id_pac=$_GET['id_pac'];
	include('../../../Connections/odonto_connection.php');
	$query="SELECT * FROM tabla1 WHERE tabla1.id_pac like $id_pac";
	$fila=mysql_query($query) or die(mysql_error());
	$consulta_fila=mysql_fetch_assoc($fila);
	mysql_free_result($fila);
	mysql_close($odonto_connection);
	return $consulta_fila;
}

$id_pac=$_GET['id_pac']; 

$query_rs_todos = "SELECT * FROM `tabla1` WHERE `id_pac` like '$id_pac'";
$rs_ingreso = mysqli_query($odonto_connection,$query_rs_todos) or die(mysql_error());
$row_rs_ingreso2 = mysqli_fetch_assoc($rs_ingreso);

$doctor=$row_rs_ingreso2['usuario'];

$query_rs_todos = "SELECT * FROM `ingreso` WHERE `doc` like '$doctor'";
$rs_ingreso = mysqli_query($odonto_connection,$query_rs_todos) or die(mysql_error());
$row_rs_ingreso = mysqli_fetch_assoc($rs_ingreso);

$id_doc=$row_rs_ingreso['id_user'];
$clinica=$row_rs_ingreso['clinica'];

			$query_rs_todos = "SELECT * FROM `datos_clinica` WHERE `clinica` like '$clinica'";
			$rs_datos = mysqli_query($odonto_connection,$query_rs_todos) or die(mysql_error());
			$row_rs_datos = mysqli_fetch_assoc($rs_datos);
			
			if($row_rs_datos['nom_sucursal'] != NULL){$sucursal='tiene sucursal';}
			else {$sucursal='no tiene sucursal';}



?>
	
<?php 

$query_rs_todos = "SELECT * FROM `tabla1` WHERE `id_pac` like '$id_pac'";
$rs_ingreso = mysqli_query($odonto_connection,$query_rs_todos) or die(mysql_error());
$row_rs_ingreso2 = mysqli_fetch_assoc($rs_ingreso);
$doctor=$row_rs_ingreso2['usuario'];
$clinica=$row_rs_ingreso2['clinica'];
require('../../../tabulator_tabla2.php');

function consulta($id_pac,$pieza)
{
include('../../../Connections/odonto_connection.php');
global $tabla2;
$query="SELECT * FROM $tabla2 WHERE $tabla2.id_pac like $id_pac AND $tabla2.pieza like $pieza AND $tabla2.a1 is not null AND $tabla2.a2 is not null AND $tabla2.a3 is not null AND $tabla2.a4 is not null AND $tabla2.a5 is not null AND $tabla2.circu is not null AND $tabla2.prote is not null AND $tabla2.prote_2 is not null AND $tabla2.extra is not null AND $tabla2.tc is not null AND $tabla2.cnp is not null LIMIT 1";
$fila=mysqli_query($odonto_connection,$query) or die(mysql_error());
$consulta_fila=mysqli_fetch_assoc($fila);
return $consulta_fila;
mysqli_free_result($fila);
mysqli_close($odonto_connection);
}

?>	
<div class="odonto1_grande1" >
		<!-- comienzan las piezas -->
			<?php include('../poo_php.php');?>
</div>

<style type="text/css">

div.odonto1_grande1 {
	margin:0;
	padding:0;
	font: 100%/1.0 TrebuchetMS,Arial,sans-serif;
	text-align: left;
    border: 2px solid black;
    -ms-transform: scale(0.60,0.60); /* IE 9 */
    -webkit-transform: scale(0.60,0.60); /* Safari */
    transform: scale(0.60,0.60); /* Standard syntax */
	position:absolute;
	left:200px;
	top:-30px;
	background-color:white;
	width:670px;
	height:330px;
}
</style>
