<?php
  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;
  if($cod_emp!="0"){
  $resultadog=$objPer->getCia1($cod_emp);										  
  $filag=$objPer->NextRow2($resultadog);
  }
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><MMString:LoadString id="insertbar/formsHidden" /></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. -->
<script language="JavaScript"> 
<!--
function print_1(sURL,x,y) {
if (!window.focus) return;
			var par;
			par = "width=" +x + ",height="+y+","
			par = par + "dependent=no,scrollbars=yes,resizable=yes,"
			par = par + "menubar=no,toolbar=no,status=no"
			var ventana = window.open(sURL,"Ver",par)
			ventana.focus();
}
//--> 
</script>
<script language="JavaScript"> 
<!--
function print_12(sURL,x,y) {
if (!window.focus) return;
			var par;
			par = "width=" +x + ",height="+y+","
			par = par + "dependent=no,scrollbars=yes,resizable=yes,"
			par = par + "menubar=no,toolbar=no,status=no"
			var ventana = window.open(sURL,"Ver1",par)
			ventana.focus();
}
//--> 
</script>

</head>

<body bgcolor="<?=$c_fondo['fondo']?>"><!-- background="../imagenes/fondo.jpg" -->
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr valign="top" >
    <td height="25" colspan="4">
    <div align="left" ></div></td>
  </tr>
  <tr class="lblCampo" >
    <td colspan="4"><div align="center">
        <table width="730" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="25"><img src="../estilo_tabla/parte_sup_izq.gif" width="25" height="25"></td>
            <td width="680" background="../estilo_tabla/parte_sup_cen.gif" valign="bottom">
			<div align="left" class="lblTitulo" >Recorrido del Transporte x Cia. </div>			</td>
            <td width="25"><img src="../estilo_tabla/parte_sup_der.gif" width="25" height="25" border="0" usemap="#Map"></td>
          </tr>
          <tr>
            <td width="25" background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
            <td width="680" height="86" background="../estilo_tabla/parte_med_cen.gif"><div align="center">
              <table width="679" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="15" colspan="5"><div align="center"><span class="lblForm">
                    </span>
                      <div align="left" class="lblForm">                      </div>
                      <span class="lblForm"></span>                      <span class="lblForm">
                      </span><span class="lblForm">                      </span></div></td>
                </tr>
                <tr>
				<form action="cvp_record_trans_cia.php" method="post" name="form1" >
                  <td height="15" colspan="5">				    
				  <div align="left">
				    <table width="668" border="0" cellspacing="0" cellpadding="0">
                      <tr class="lblCampo">
                        <td width="67">
						<div align="left">Empresa :
                          <span class="lblForm"></span>                      </div></td>
                        <td width="206"><div align="left"><span class="lblForm">
                          <select name="cod_emp" class="lblForm1" id="select2" onkeyup=fn(this.form,this)>
                            <option value="0">Varios</option>
                            <? 
							echo $objPer->getCboEmp1($cod_emp);
							?>
                          </select>
                        </span></div></td>
                        <td width="64"><div align="right"><span class="lblCampo">Fechas
                        </span></div></td>
                        <td width="214"><div align="right">
                          <table width="204" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="97"><div align="left">
                                <table width="87" border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td width="67"><div align="left">
                                        <input name="fecha1" type="text" id="fecha13" value="<? echo $fecha1?>" size="12" maxlength="10" title="FORMATO dd/mm/AA">
                                    </div></td>
                                    <td width="10">&nbsp;</td>
                                    <td width="109"><div align="left"> <a onMouseOver="window.status='Calendario';return true;" onMouseOut="window.status='';return true;"  href="javascript:show_calendar('form1.fecha1');"> <img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0"> </a> </div></td>
                                  </tr>
                                </table>
                              </div></td>
                              <td width="107"><div align="left">
                                <table width="87" border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td width="67"><div align="left">
                                        <input name="fecha2" type="text" id="fecha22" value="<? echo $fecha2?>" size="12" maxlength="10" title="FORMATO dd/mm/AA">
                                    </div></td>
                                    <td width="10">&nbsp;</td>
                                    <td width="109"><div align="left"> <a onMouseOver="window.status='Calendario';return true;" onMouseOut="window.status='';return true;"  href="javascript:show_calendar('form1.fecha2');"> <img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0"> </a> </div></td>
                                  </tr>
                                </table>
                              </div></td>
                            </tr>
                          </table>
                        </div></td>
                        <td width="117"><div align="left"><span class="lblForm">
                          <input type="submit" name="Submit" value="Buscar" style="<?=$stylo['st2']?>" class="botira">
                        </span></div></td>
                      </tr>
                    </table>
				  </div>
				  </td>
				</form>
                </tr>
                <tr>
				<form name="form2" method="post" action="cvp_record_trans_cia_g.php">
                  <td colspan="5"><div align="center">
                    
                      <table width="573" border="0" cellpadding="0" cellspacing="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla?>">
                        <tr valign="top" class="lblCampoBlanco" bgcolor="<?=$c_fondo_tr["fondo tr"]?>">
                          <td width="119"><div align="left">Razon Social </div></td>
                          <td width="10"><div align="left"></div></td>
                          <td width="316"><div align="left"><? echo $filag['razon_emp']?></div></td>
                          <td width="119">
                            <div align="center"></div></td>
                          <td width="76"><div align="center"> </div></td>
                        </tr>
                        <tr valign="top" class="lblCampoBlanco" bgcolor="<?=$c_fondo_tr["fondo tr"]?>">
                          <td><div align="left">R.U.C.</div></td>
                          <td><div align="left"></div></td>
                          <td><div align="left"><? echo $filag['ruc_emp']?></div></td>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
                        <tr valign="top" class="lblCampoBlanco" bgcolor="<?=$c_fondo_tr["fondo tr"]?>">
                          <td><div align="left">Direccion</div></td>
                          <td><div align="left"></div></td>
                          <td><div align="left"><? echo $filag['dir_emp']?></div></td>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
                        <tr valign="top" class="lblCampoBlanco" bgcolor="<?=$c_fondo_tr["fondo tr"]?>">
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
                        <?				    
						$resultado=$objPer->getRecorridoTransxCia($cod_emp,extraerfechamysql($fecha1),extraerfechamysql($fecha2));										  
                  while($fila=$objPer->NextRow($resultado))
                   {
				   
				   ?>
                        <tr valign="top" class="lblCampo" >
                          <td colspan="5" class="lblCampo">
                            <div align="left">
                              <table width="573" border="0" cellspacing="0" cellpadding="0">
							  <? //if($fila['cod_man']!=NULL){?>
                                <tr>
                                  <td width="83"><div align="left">Matricula</div></td>
                                  <td width="5"><div align="left">:</div></td>
                                  <td width="139"><div align="left"><? echo $fila['mat_trans']?> </div></td>
                                  <td width="99"><div align="left">Transporte : </div></td>
                                  <td width="311"><div align="left"><? echo $fila['model_trans'];?></div></td>
                                </tr>
								<? //}?>
                                <tr>
                                  <td colspan="5"><div align="left">
                                      <table width="571" border="1" cellpadding="0" cellspacing="0" bordercolor="<?=$bordetabla?>" bgcolor="<?=$c_fondo['fondo tabla']?>" style="<?=$stylo['tabla']?>">
                                        
										<tr class="lblCampoBlanco" bgcolor="<?=$c_fondo_tr["fondo tr"]?>">
                                          <td width="94"><div align="center">N&ordm; Manifiesto </div></td>
                                          <td width="149"><div align="center">Fecha</div></td>
                                          <td width="128"><div align="center">Origen</div></td>
                                          <td width="107"><div align="center">Destino</div></td>
                                          <td width="81">&nbsp;</td>
                                        </tr>
										<? //}?>
                                        <?				    
						$resultados=$objPer->getRecorridoTransxCia1($fila['mat_trans'],extraerfechamysql($fecha1),extraerfechamysql($fecha2));			
										  
                  while($filas=$objPer->NextRow1($resultados))
                   {
				   ?>
                                        <tr class="lblForm">
                                          <td><div align="center"><? echo $filas['cod_man']?></div></td>
                                          <td><div align="center"><? echo extraerfechanormal($filas['fecha_man'])?></div></td>
                                          <td><div align="center"><? echo $filas['origen']?></div></td>
                                          <td><div align="center"><? echo $filas['destino']?></div></td>
                                          <td><div align="center"> <a href="javascript:print_1('cvp_mani_print.php?cod_man=<? echo $filas['cod_man']?>&via=<? echo $filas['via']?>&mat_trans=<? echo $filas['mat_trans']?>&tipo_trans=<? echo $filas['tipo_trans']?>&fecha_man=<? echo $filas['fecha_man']?>&fecha_ruta=<? echo $filas['fecha_ruta']?>&testimado_ruta=<? echo $filas['testimado_ruta']?>&horasal_ruta=<? echo $filas['horasal_ruta']?>&horallega_ruta=<? echo $filas['horallega_ruta']?>&obser=<? echo $filas['obser']?>',800,600)"> <img src="../imagenes/imprimir.gif" alt="Imprimir Manifiesto" width="15" height="15" border="0"> </a>
                                                  <? if($filas['archivo_man']!=""){?>
                                                  <a href="procesos/bajando_pdf.php?arch=<? echo $filas['archivo_man']?>"> <img src="../imagenes/pdf.gif" width="15" height="15" border="0"> </a>
                                                  <? 
								  }else{
								  ?>
                                                  <img src="../imagenes/gris.gif" width="15" height="15" border="0">
                                                  <?
								  }
								  ?>
                                          </div></td>
                                        </tr>
                                        <?
				}
			$objPer->Liberar1($resultados); 
				?>
                                      </table>
                                  </div></td>
                                </tr>
                              </table>
                          </div></td>
                        </tr>
                        <? 
			}
			$objPer->Liberar($resultado); 
			
			 
			?>
                        <tr valign="top" class="lblForm" >
                          <td colspan="5" class="lblForm">&nbsp;</td>
                        </tr>
                        <tr valign="top" class="lblForm" >
                          <td colspan="5" class="lblForm"><div align="center">
                              <table width="450" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td width="104"><div align="right">
                                      <input type="button" name="Submit22" value=".:Imprimir:." style="<?=$stylo['st2']?>" class="botira" onClick="javascript:print_12('cvp_record_trans_cia_g.php?fecha1=<? echo $fecha1?>&fecha2=<? echo $fecha2?>&cod_emp=<? echo $cod_emp?>',800,600)">
                                  </div></td>
                                  <td width="93">
                                    <input name="fecha1" type="hidden" id="fecha1" value="<? echo $fecha1?>">
                                    <input name="fecha2" type="hidden" id="fecha23" value="<? echo $fecha2?>">
                                    <input name="cod_emp" type="hidden" id="cod_emp" value="<? echo  $cod_emp?>">
</td>
                                  <td width="104"><div align="left">
                                      <input type="button" name="Submit2" value=".:Regresar:." style="<?=$stylo['st2']?>" class="botira" onClick="volver(this.form);">
                                  </div></td>
                                </tr>
                              </table>
                          </div></td>
                        </tr>
                      </table>
                    
                  </div>
			 </td>
			 </form>
                </tr>				
                <tr>
                  <td colspan="5"><div align="left"><span class="lblForm"></span></div></td>
                </tr>
			  
                 
                 
              </table>
            </div></td>
            <td background="../estilo_tabla/parte_med_der.gif">&nbsp;</td>
          </tr>
          <tr>
            <td><img src="../estilo_tabla/parte_inf_izq.gif" width="25" height="25"></td>
            <td background="../estilo_tabla/parte_inf_cen.gif">&nbsp;</td>
            <td><img src="../estilo_tabla/parte_inf_der.gif" width="25" height="25"></td>
          </tr>
        </table>
    </div></td>
  </tr>
  <tr valign="top" class="lblCampo" >
    <td colspan="4">
      <div align="center"> </div></td>
  </tr>
</table>

<map name="Map">
  <area shape="rect" coords="2,5,22,21" href="fondo.php">
</map>
</body>

</html>

