<?
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_docs.xls");
  /*include("stilos/config.inc.php");
  include("../clases/BDConexion.php");
  include("../clases/clsPer.php");
  include("funcion/funciones.php");
  include("Funciones.php");
  session_start();
  $objPer=new clsPer;*/
?>
<!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">&nbsp;</td>
    <td width="216">&nbsp;</td>
    <td width="284"><div align="right"></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 height="25" colspan="<? if($tipodoc=='PAG'){ echo $cel=8;}else{ echo $cel=5;}?>"><div align="left">Lista de Documentos por Area de:
            <?=$area?>
          </div></td>
          </tr>
        <tr bgcolor="#999999" class="lblForm">
          <td height="25" colspan="<? if($tipodoc=='PAG'){ echo $cel=8;}else{ echo $cel=5;}?>"><strong>Reporte del <? echo $fecha1?> al <? echo $fecha2?></strong></td>
          </tr>
        <tr bgcolor="#999999" class="lblForm">
          <td width="26" height="25"><div align="center">#</div></td>
          <td width="136"><div align="center"><strong>CODIGO</strong></div></td>
          <td><div align="center"><strong>FECHA</strong></div></td>
          <? if($tipodoc=='PAG'){?><td><div align="center"><strong>BENEFICIARIO</strong></div></td><? }?>
          <td width="201"><div align="center">
            <?php 
						if($tipodoc=='CAR' OR $tipodoc=='MEM'){
						echo "Asunto"; 
						}elseif($tipodoc=='PAG'){
						echo "Concepto";
						}elseif($tipodoc=='PRO'){
						echo "Titulo";
						}
						?>
          </div></td>
          <? if($tipodoc=='PAG'){?><td width="52"><div align="center"><strong>Monto</strong></div></td>
          <td width="57"><div align="center"><strong>Moneda</strong></div></td><? }?>
          <td><div align="center"><strong>USUARIO</strong></div></td>
        </tr>
		<?
					
				    
					$n=1;
										
					
				if($tipodoc=="0"){						
				$rs=$objPer->getSendDocTotalPrint($area,extraerfechamysql($fecha1),extraerfechamysql($fecha2));				
				}else{												
				$rs=$objPer->getSendDocSelPrint($area,$tipodoc,$campo,$des,extraerfechamysql($fecha1),extraerfechamysql($fecha2));				
				}		
                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="73"><div align="center"><? echo extraerfechanormal($fila['fechatradoc'])?></div></td>
          <? if($tipodoc=='PAG'){?><td width="96"><div align="center"><? echo $fila['personal']?></div></td><? }?>
          <td><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>
          <? if($tipodoc=='PAG'){?><td><div align="center"><? echo $fila['monto']?></div></td>
          <td><div align="center"><? echo $fila['tipomon']?></div></td><? }?>
          <td width="80"><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"></div></td>
  </tr>
</table>
</body>

</html>

