<?php
session_start();
if (isset($_SESSION['usuario'])){
$user=$_SESSION['usuario'];
}
else{
?>
<script>
location.href="index.php?errorusuario=3";
</script>
<?php }

//sacar el tipo de usuario
include("conexion.php");

$cons="Select nombre,tipo,idClinica FROM usuarios Where idUsuario='$user'";
$res=mysql_query($cons,$conex) or die ("No se realizó la consulta en usuarios");
$nombreuser=mysql_result($res,0,'nombre');
$tipo=mysql_result($res,0,'tipo');
$clini=mysql_result($res,0,'idClinica');

?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Clinisys :.</title>
<link href="ucaestilos.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="JavaScript1.2" src="stm31.js"></script>
<style type="text/css">
<!--
body {
	background-color: #CCCCCC;
}
-->
</style></head>

<body>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td><img src="img/top01.jpg" width="800" height="125"></td>
  </tr>
  <tr>
    <td>
	<table width="100%" border="0">
      <tr>
	  <td width="3%"><img src="img/icon_security.jpg" width="22" height="22"></td>
        <td width="28%"><span class="style4">Operador: </span><span class="style5"><?php echo $nombreuser;?></span></td>
        <td width="69%">
		<?php 
		//if ($tipo =='user')
		//{
		$cons2="Select clinica FROM clinicas Where idClinica='$clini'";
		$res2=mysql_query($cons2,$conex) or die ("No se realizó la consulta de la clinica");
		$clinica=mysql_result($res2,0,'clinica');
		echo "<span class='style4'>Cl&iacute;nica: </span><span class='style5'>".$clinica."</span>";
		//}
		?>		</td>
        </tr>
    </table>
	<table width="100%" border="0">
      <tr>
        <td width="87%" height="20" bgcolor="#666666">&nbsp;</td>
        <td width="13%" bgcolor="#666666" class="style8"><div align="center"><a href="cerrar.php"><span class="style6">Cerrar Sesión</span></a></div></td>
      </tr>
    </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12%" valign="top"><br />
		<?php
		include ("puntoventa.php");
		?>
		<br />
		</td>
        </tr>
      <tr>
        <td height="17" valign="middle" bgcolor="#030649"><div align="center"><span class="style8">Universidad Cuauht&eacute;moc Plantel Aguascalientes </span></div></td>
        </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
