<?php
  /*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=requisicion.xlsx");*/
  
  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;  
  
  $resultadoc=$objPer->getGuias($num_guia);
  $filac=$objPer->NextRow($resultadoc);
  if($filac['motivo']=='1'){
  $a1="x";
  }elseif($filac['motivo']=='2'){
  $b1="x";
  }elseif($filac['motivo']=='3'){
  $c1="x";
  }elseif($filac['motivo']=='4'){
  $d1="x";
  }elseif($filac['motivo']=='5'){
  $e1="x";
  }elseif($filac['motivo']=='6'){
  $f1="x";
  }elseif($filac['motivo']=='7'){
  $g1="x";
  }elseif($filac['motivo']=='8'){
  $h1="x";
  }elseif($filac['motivo']=='9'){
  $i1="x";
  }elseif($filac['motivo']=='10'){
  $j1="x";
  }elseif($filac['motivo']=='11'){
  $k1="x";
  }elseif($filac['motivo']=='12'){
  $l1="x";
  }elseif($filac['motivo']=='13'){
  $m1="x";
  }elseif($filac['motivo']=='14'){
  $n1="x";
  }


?>
<!-- xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40" -->
<html >
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<head>
<title></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="javascript:print();">
<!-- div id="Classeur1_16681" align=center x:publishsource="Excel"  -->
<table width="723" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="195"><div align="center"></div></td>
  </tr>
  <tr class="lblCampo">
    <td class="lblCampo"><div align="center" class="lblCampo">
      <table width="721" border="0" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">       
        <tr class="lblCampo" valign="top">
          <td colspan="3" class="lblCampo"><div align="left">
            <table width="718" border="0" cellspacing="0" cellpadding="0">
              <tr class="lblCampo">
                <td width="359" >
				<div align="left" class="lblCampo">
                  <table width="355" border="0" cellspacing="0" cellpadding="0">
                    <tr class="lblCampo">
                      <td><div align="right"><?=extraerfechanormal($filac['fecha'])?></div></td>
                    </tr>
                    <tr class="lblCampo" valign="bottom">
                      <td height="25"><div align="right"><?=$filac['destinatario']?></div></td>
                    </tr>
                    <tr class="lblCampo" valign="bottom">
                      <td height="25"><div align="right"><?=$filac['ruc']?></div></td>
                    </tr>
                  </table>
                </div></td>
                <td width="359" class="lblCampo" valign="top"><div align="left">
                  <table width="355" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td height="30"><div align="right"><?=$filac['partida']?></div></td>
                    </tr>
                    <tr class="lblCampo" valign="bottom">
                      <td height="25"><div align="right"><?=$filac['llegada']?></div></td>
                    </tr>
                  </table>
                </div></td>
              </tr>
              <tr>
                <td><div align="left">
                  <table width="350" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="176"><div align="left"><?=$a?></div></td>
                      <td width="174"><div align="left"><?=$b?></div></td>
                    </tr>
                    <tr>
                      <td><div align="left"><?=$c?></div></td>
                      <td><div align="left"><?=$d?></div></td>
                    </tr>
                    <tr>
                      <td><div align="left"><?=$e?></div></td>
                      <td><div align="left"><?=$f?></div></td>
                    </tr>
                    <tr>
                      <td><div align="left"><?=$g?></div></td>
                      <td><div align="left"><?=$h?></div></td>
                    </tr>
                    <tr>
                      <td><div align="left"><?=$i?></div></td>
                      <td><div align="left"><?=$j?></div></td>
                    </tr>
                    <tr>
                      <td><div align="left"><?=$k?></div></td>
                      <td><div align="left"><?=$l?></div></td>
                    </tr>
                    <tr>
                      <td><div align="left"><?=$m?></div></td>
                      <td><div align="left"><?=$n?></div></td>
                    </tr>
                  </table>
                </div></td>
                <td><div align="left">
                  <table width="350" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="176">&nbsp;</td>
                      <td width="174">&nbsp;</td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo" valign="bottom">
                      <td height="40"><div align="left"><?=$filac['ruct']?></div></td>
                      <td><div align="left"><?=$filac['denominacion']?></div></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left"><?=$filac['marcaplaca']?></div></td>
                      <td><div align="left"><?=$filac['licencia']?></div></td>
                    </tr>
                  </table>
                </div></td>
              </tr>
            </table>
              </div></td>
        </tr>
        <tr class="lblCampo" valign="top">
          <td height="30" colspan="3">&nbsp;</td>
        </tr>
        
        <tr>
          <td colspan="3"><div align="left">
              <table width="718" border="0" cellspacing="0" cellpadding="0">
                <tr valign="top">
                  <td height="500"><div align="left">
                      <table width="720" border="0" cellpadding="0" cellspacing="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
                        <tr valign="top" >
                          <td width="71" height="40"><div align="center"></div>
                            <div align="center"></div></td>
                          <td width="423"><div align="center"></div>
                          <div align="left"></div>                          </td>
                          <td width="60"><div align="center"></div>
                              <div align="center"> </div></td>
                          <td>
                            <div align="center"></div></td>
                          <td width="78"><div align="center"></div>
                              <div align="center"></div></td>
                        </tr>
                        <? 
					  		   
				    /*if($tipo=="fecha_rd"){
						$resultado=$objPer->getArtPedDetF01($tipo,extraerfechamysql($campo1),extraerfechamysql($campo2));
						$resultadot=$objPer->getArtPedDetFecT($tipo,extraerfechamysql($campo1),extraerfechamysql($campo2));
					}else{*/
						$resultado=$objPer->getGuiasdetalle($num_guia);
						//$resultadot=$objPer->getArtPedDetT($tipo,$campo1);
					//}
					
					$n=0;
                  while($filas=$objPer->NextRow($resultado))
                   {
				   $n++;
				   ?>
                        <tr valign="top" >
                          <td height="25" >
                            <div align="center"> <? echo $n; ?> </div></td>
                          <td class="lblCampo12"><div align="left"></div>                            
                          <div align="left">
                                <?php 
						echo $filas['des'];						
						?> </div></td>
                          <td class="lblCampo12">
                            <div align="center">
                              <?php 
						echo $filas['cantidad'];	
						$cant=$cant+$filas['cantidad'];					
						?>
                          </div></td>
                          <td width="88">
                            <div align="center">
                              <?php 
						echo $filas['um'];						
						?>
                          </div></td>
                          <td><div align="left">
                            <?php 						
						echo number_format($filas['peso'],2,'.',' ');
						$pes=$pes+$filas['peso'];						
						?>
                          </div></td>
                        </tr>
                        <? 
			}
			$objPer->Liberar($resultado); 
			 
			?>
                      </table>
                  </div></td>
                </tr>
                <tr class="lblCampo">
                  <td>                      <div align="left">
                    <table width="720" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="71">&nbsp;</td>
                        <td width="423">&nbsp;</td>
                        <td width="60"><div align="center"><?=$cant?></div></td>
                        <td width="88">&nbsp;</td>
                        <td width="78"><div align="left"><? echo number_format($pes,2,'.',' ')." KG";?></div></td>
                      </tr>
                    </table>
                  </div></td>
                </tr>
              </table>
          </div></td>
        </tr>
        <tr class="lblCampo">
          <td height="25" colspan="3"><div align="left"></div></td>
        </tr>
        <tr class="lblCampo" valign="top">
          <td height="50" colspan="3"><div align="left">
            <?=$filac['obser']?>
          </div></td>
        </tr>
        <tr class="lblCampo" valign="top">
          <td height="25" colspan="3">&nbsp;</td>
        </tr>
        <tr class="lblCampo" valign="top">
          <td colspan="3"><div align="left">
            <?=$filac['despacho']?>
          </div></td>
        </tr>
        
      </table>
    </div></td>
  </tr>
</table>
</body>

</html>

