<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Reporte de Examenes</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="stilos/Estilos.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.Estilo1 {font-size: 10px}
.Estilo15 {font-size: 11px}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body onLoad="javascript:print()">

<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<? 
				    $regxpag=1;
					if(!isset($pagina)){
					$pagina=0;
					}					
					//$regini=$pagina*$regxpag;
					if($tipo==0){						
						$resultado=$objclinico->getPerTodosExaPag($regini,$regxpag);						
					}elseif($tipo==1){						
						$resultado=$objclinico->getPerApePag($des,$regini,$regxpag);
					}else{
						$resultado=$objclinico->getPerCodFichaPag($des,$regini,$regxpag);
					}
				
				while($filas=$objclinico->NextRow($resultado))
                   {
				        $result1=$objclinico->DevolverNExalab($filas['dociden_per']);
						$result2=$objclinico->DevolverNExafisi($filas['dociden_per']);
						$result3=$objclinico->DevolverNFichaMed($filas['dociden_per']);
						$fila1=$objclinico->NextRow($result1);
						$fila2=$objclinico->NextRow($result2);
						$fila3=$objclinico->NextRow($result3);
						$nexalab=$fila1['cod_lab'];
						$nexafisi=$fila2['cod_exafisico'];
						$nfichame=$fila3['cod_ficha_medica'];
				   ?>
  <tr>
    <td width="4">&nbsp;</td>
    <td width="691"><table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="113" colspan="4" rowspan="2"><img src="imagenes/Brp%20logon.JPG" width="63" height="52"></td>
        <td height="22" colspan="3"><div align="center" class="lblParrafo"><u>Servicios Brindados </u></div></td>
        <td width="19" rowspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td height="10" colspan="3">&nbsp;</td>
      </tr>
      <tr>
        <td class="rdoBanners"><div align="right" class="Estilo1">
          <div align="left">CLINICA: </div>
        </div></td>
        <td width="234" class="lblSubTitulo"><div align="left">
          <input name="textfield222" type="text" class="lblForm" size="40" readonly>
        </div></td>
        <td colspan="4" class="rdoBanners"><div align="right" class="Estilo15">
          <div align="left">N&ordm; Ficha de Laboratorio</div>
        </div></td>
        <td width="80" class="lblSubTitulo"><input name="textfield2242" type="text" class="lblForm" value="<? if(empty($nexalab)){echo "No Di&oacute;";}else{echo $nexalab;}?>" size="15" readonly></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="85" class="rdoBanners"><div align="right" class="Estilo1">
          <div align="left">PACIENTE: </div>
        </div></td>
        <td class="lblSubTitulo"><div align="left">
          <input name="textfield222" type="text" class="lblForm" value="<? echo $filas['nom_per']?> <? echo $filas['appat_per']?> <? echo $filas['apmat_per']?>" size="40" readonly>
          <span class="lblParrafo Estilo1">          </span></div></td>
        <td colspan="4" class="rdoBanners"><div align="right" class="Estilo15">
          <div align="left">N&ordm; Ex&aacute;men Medico </div>
        </div></td>
        <td class="lblSubTitulo"><input name="textfield22422" type="text" class="lblForm" value="<? if(empty($nexafisi)){echo "No Di&oacute;";}else{echo $nexafisi;}?>" size="15" readonly></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td class="rdoBanners"><div align="right" class="Estilo1">
          <div align="left">DOCTOR:</div>
        </div></td>
        <td class="lblSubTitulo"><div align="left">
          <input name="textfield223" type="text" class="lblForm" value="<? echo $filas['dr_resp']?>" size="40" readonly>
</div></td>
        <td colspan="4" class="rdoBanners"><div align="right" class="Estilo15">
          <div align="left">N&ordm; Ficha de Laboral </div>
        </div></td>
        <td class="lblSubTitulo"><input name="textfield22423" type="text" class="lblForm" value="<? if(empty($nfichame)){echo "No Di&oacute;";}else{echo $nfichame;}?>" size="15" readonly></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td class="rdoBanners"><div align="right" class="Estilo1">
          <div align="left">EDAD</div>
        </div></td>
        <td colspan="3" class="lblSubTitulo"><div align="left">
          <input name="textfield224" type="text" class="lblForm" value="<? echo $filas['edad']?>" size="5" readonly>
        </div></td>
        <td width="133" class="lblSubTitulo">&nbsp;</td>
        <td colspan="2">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
	    <? $docid = $filas['dociden_per'];
			}
			$objclinico->Liberar($resultado);  
		?>
    </table>    </td>
    <td width="10">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td height="20"><hr></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td height="20"><table width="600" border="1" cellspacing="0" cellpadding="0">
      <tr class="rdoBanners">
        <td width="405" class="rdoBanners"><div align="center">DESCRIPCION</div></td>
        <td width="26"><div align="center">UNID</div></td>
        <td width="23"><div align="center">QTY</div></td>
        <td width="38"><div align="center">SIT</div></td>
        <td width="96"><div align="center">PRECIO</div></td>
        </tr>
		<?php 
		      $result = $objclinico->DevolverServicios();
			  while($filass=$objclinico->NextRow($result)){
		?>
      <tr class="rdoForm">
        <td><?php echo $filass['servicio'];?></td>
        <td><?php echo $filass['unidad'];?></td>
        <td><?php $totavha = $objclinico->DevolverNHepaA($docid); 
				  $totavhb = $objclinico->DevolverNHepaB($docid); 
				  $totaTV = $objclinico->DevolverNTViral($docid); 
				  $totaTETA = $objclinico->DevolverNTETA($docid);
				/*if($filass['cod_serv']==20){
							echo $totavha;}
				elseif($filass['cod_serv']={echo $totavhb;}
				
				
				
				          }*/
							
							
							
							
							
							
							?></td>
        <td>IQUIT</td>
        <td>&nbsp;</td>
        </tr>
		<?php 
			}
			$objclinico->Liberar($result);  
		?>
      <tr class="rdoForm">
        <td class="lblParrafo"><div align="center">TOTAL</div></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
    <td>&nbsp;</td>
  </tr>

</table>
</body>
</html>
