<?
header("Content-Type: application/vnd.ms-excel");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("content-disposition: attachment;filename=lista_total_doc.xls");

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>.:: Reporte ::.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">

<link href="Estilos.css" rel="stylesheet" type="text/css">

<link href="stilos/Estilos.css" rel="stylesheet" type="text/css">
<SCRIPT language=JavaScript src="js/calendario.js"></SCRIPT>
<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->


</head>

<body onLoad="print();">
<table width="740" border="0" cellspacing="0" cellpadding="0">
  <tr valign="top" class="lblForm">
    <td width="240"><div align="left">
    </div></td>
    <td width="216" class="lblTituloReporte"><div align="center"><br>
      <br>

      <br>
      <br>
      <br>
      <br>
    </div></td>
    <td width="284"><div align="right"><img src="../imagenes/logo_perenco.GIF" width="250" height="90" border="0">
    </div></td>
  </tr>
  <tr valign="top" class="lblTituloReporte">
    <td colspan="3"><div align="center">Lista de Documentos por Area de: <?=$area?></div></td>
  </tr>
  <tr valign="top" class="lblForm">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><div align="right"><strong>Reporte del <? echo $fecha1?> al <? echo $fecha2?> </strong></div></td>
  </tr>
  <tr class="lblCampo" valign="top">
    <td height="650" colspan="3"><div align="left">
      <table width="739" border="1" cellpadding="0" cellspacing="0" bordercolor="<?=$bordetabla1?>" style="<?=$stylo['tabla']?>">
        
        <tr bgcolor="#999999" class="lblForm">
          <td width="27" height="25"><div align="center">#</div></td>
          <td width="162"><div align="center"><strong>CODIGO</strong></div></td>
          <td><div align="center"><strong>FECHA</strong></div></td>
          <td><div align="center"><strong>BENEFICIARIO</strong></div></td>
          <td><div align="center">
            <?php 
						if($tipodoc=='CAR' OR $tipodoc=='MEM'){
						echo "Asunto"; 
						}elseif($tipodoc=='PAG'){
						echo "Concepto";
						}elseif($tipodoc=='PRO'){
						echo "Titulo";
						}
						?>
          </div></td>
          <td><div align="center"><strong>USUARIO</strong></div></td>
        </tr>
		<?
					
				    $regxpag=25;
					if(!isset($pagina)){
					$pagina=0;
					$n=1;
					}					
					$regini=$regini;
				if($tipodoc=="0"){						
				$rs=$objPer->getSendDocTotalP($area,extraerfechamysql($fecha1),extraerfechamysql($fecha2),$regini,$regxpag);				
				}else{												
				$rs=$objPer->getControlDocP($area,$tipodoc,extraerfechamysql($fecha1),extraerfechamysql($fecha2),$regini,$regxpag);				
				}		
                while($fila=$objPer->NextRow($rs)){
				
				?>
        <tr   class="lblForm" >
          <td height="25"><div align="center"><?=$n++;?></div></td>
          <td height="25"><div align="center"><? echo $fila['numtradoc']?></div></td>
          <td width="134"><div align="center"><? echo extraerfechanormal($fila['fechatradoc'])?></div></td>
          <td width="166"><div align="center"><? echo $fila['personal']?></div></td>
          <td width="154"><div align="center">
            <?php 
						if($fila['tipodoc']=='CAR' OR $fila['tipodoc']=='MEM'){
						echo strtoupper($fila['asunto']); 
						}elseif($fila['tipodoc']=='PAG'){
						echo strtoupper($fila['concepto']);
						}elseif($fila['tipodoc']=='PRO'){
						echo strtoupper($fila['titulo']);
						}
						?>
          </div></td>
          <td width="82"><div align="center"><? echo $fila['areaorigen']?></div></td>
        </tr>
        <? 
			}
			$objPer->Liberar($rs); 			 
			?>
      </table>
    </div></td>
  </tr>
  <tr class="lblForm" valign="bottom">
    <td colspan="3"><div align="right">Pag <? echo $pagi+1?> de <? echo $totalp?></div></td>
  </tr>
</table>
</body>

</html>

