<?php
session_start();
include("../clases/BDConexion.php"); 
include("../clases/clsPer.php");  
  $objPer=new clsPer;
  $d=5;
  include("stilos/config.inc.php");
include("Funciones.php");
  include("funcion/funciones.php");  
?>
<!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>
<script type="text/javascript" src="js/ajaxtrans.js"></script>
<script type="text/javascript" src="ajax_listaviaje.js"></script>
<script language="JavaScript"> 
function PrintManifiesto(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=yes"
			var ventana = window.open(sURL,"Manifieto",par)
			ventana.focus();
}
</script>
<script language="JavaScript"> 
function PrintPlanViaje(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=yes"
			var ventana = window.open(sURL,"PlanViaje",par)
			ventana.focus();
}
</script>
<script language="JavaScript"> 
function print_plan(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,"plan",par)
			ventana.focus();
} 
</script>
</head>
<body bgcolor="<?=$c_fondo['fondo']?>">
<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" >Imprimir Manifiesto <span class="lblForm">			  
			</span></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"><div align="center"><span class="lblForm"> </span></div></td>
                  </tr>
                  <tr>
				  <form name="form1" method="post" action="p_imprimir_man.php">
                    <td height="15">
                      <div align="left" class="lblForm">
                        
                          <table width="674" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td colspan="2"><div align="center">Via</div></td>
                              <td><div align="center">Fecha Inicial </div></td>
                              <td><div align="center">Fecha Final</div></td>
                              <td><div align="center"></div></td>
                            </tr>
                            <tr>
                              <td colspan="2"><div align="center">
                                  <select name="via" id="via">
                                    <option value="0">Elija</option>
                                    <option value="A" <? if($via=='A'){?> selected <? }?>>Aerea</option>
                                    <option value="F" <? if($via=='F'){?> selected <? }?>>Fluvial</option>
                                  </select>
                              </div></td>
                              <td width="134"><div align="center">
                                  <table width="134" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td width="67"><div align="left">
                                          <input name="fecha_ini" type="text" id="fecha_ini" value="<?=$fecha_ini?>" 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.fecha_ini');"> <img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0"> </a> </div></td>
                                    </tr>
                                  </table>
                              </div></td>
                              <td width="134"><div align="center">
                                  <table width="134" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td width="67"><div align="left">
                                          <input name="fecha_fin" type="text" value="<?=$fecha_fin?>" 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.fecha_fin');"> <img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0"> </a> </div></td>
                                    </tr>
                                  </table>
                              </div></td>
                              <td width="266">
                                <div align="left">
                                  <input type="submit" name="Submit" value="Buscar" style="<?=$stylo['st2']?>" class="botira">
                                  </div></td>
                            </tr>
                            <tr>
                              <td width="114">&nbsp;</td>
                              <td width="26">&nbsp;</td>
                              <td>&nbsp;</td>
                              <td>&nbsp;</td>
                              <td>&nbsp;</td>
                            </tr>
                          </table>
                                                
                      </div></td>
					  </form>
                  </tr>
                  <tr>
                    <td><div align="center">
                      <table width="640" border="1" cellpadding="0" cellspacing="0" style="<?=$stylo['tabla']?>" bgcolor="<?=$c_fondo['fondo tabla']?>" bordercolor="<?=$bordetabla?>">
                        <tr valign="top" class="lblCampoBlanco" bgcolor="<?=$c_fondo_tr["fondo tr"]?>">
                          <td width="58"><div align="center"># Viaje </div></td>
                          <td width="96"><div align="center">Codigo Viaje</div></td>
                          <td width="129"><div align="center">Fecha Salida</div></td>
                          <td width="128"><div align="center">Fecha Llegada </div></td>
                          <td width="133"><div align="center">Matricula</div></td>
                          <td width="82"><div align="center"> 
						  </div></td>
                        </tr>
                        <? 
  
					  if($fecha_ini!=''){ 
				    				
														
					$resultado=$objPer->getListaViajeManifiesto($via,extraerfechamysql($fecha_ini),extraerfechamysql($fecha_fin));				
				   
                  while($filas=$objPer->NextRow($resultado))
                   {
				   $rs=$objPer->getListaViajeMan($filas['cod_ruta']);
				   $row=$objPer->NextRow($rs);
				   ?>
                        <tr valign="top" class="lblForm" bgcolor="<? if($filas['programado']=='I'){ echo "#FF0000";}?>">
                          <td class="lblForm"><div align="center"><? echo $filas['numvuelo']; ?></div></td>
                          <td class="lblForm"><div align="center"><? echo $filas['cod_ruta']; ?></div></td>
                          <td class="lblForm"><div align="center">
                              <?=extraerfechanormal($filas['fecha_ruta']); ?>
                          </div></td>
                          <td class="lblForm"><div align="center">
                              <?=extraerfechanormal($filas['testimado_ruta']); ?>
                          </div></td>
                          <td class="lblForm"><div align="center"><?php echo $filas['mat_trans']; ?> </div></td>
                          <td class="lblForm">
                            <div align="center"><a href="#" onClick="PrintManifiesto('p_manifiesto_print_dir.php?cod_man=<?=$row['cod_man']?>&cod_ruta=<?=$filas['cod_ruta']?>&via=<?=$filas['via']?>',600,800)"> <img src="../imagenes/imprimir.gif" alt="Imprimir Manifiesto" width="15" height="15" border="0"> </a> 						  						                                
                            </div></td></tr>
                        <tr valign="top" class="lblForm" >
                          <td colspan="6" class="lblForm"><div align="left">
                              <table width="300" border="1" cellpadding="0" cellspacing="0" style="<?=$stylo['tabla']?>" bgcolor="<?=$c_fondo['fondo tabla']?>" bordercolor="<?=$bordetabla?>">
                                <tr class="lblCampoBlanco" bgcolor="<?=$c_fondo_trd["fondo tr"]?>">
                                  <td width="38"><div align="center">#</div></td>
                                  <td width="131"><div align="center">Origen</div></td>
                                  <td width="131"><div align="center">Destino</div></td>
                                </tr>
                                <?
							$n1=0;
						  $rslineas=$objPer->getListaViajeLineas($filas['cod_ruta']);
						  while($rowlineas=$objPer->NextRow($rslineas)){
						  $n1++;
						  ?>
                                <tr>
                                  <td><div align="center">
                                      <?=$n1;?>
                                  </div></td>
                                  <td><div align="center">
                                      <?=$rowlineas['de'];?>
                                  </div></td>
                                  <td><div align="center">
                                      <?=$rowlineas['para'];?>
                                  </div></td>
                                </tr>
                                <? }$objPer->Liberar($rslineas);?>
                              </table>
                          </div></td>
                        </tr>
                        <? 
			}
			$objPer->Liberar($resultado); 
			}  
			?>
                        <tr valign="top" class="lblForm" >
                          <td colspan="6" class="lblForm">&nbsp;</td>
                        </tr>
                        <tr valign="top" class="lblForm" >
                          <td colspan="6" class="lblForm"><div align="center"> </div></td>
                        </tr>
                      </table>
                    </div></td>
                  </tr>
                  <tr>
                    <td><div align="left" id="mensaje"></div></td>
                  </tr>
                  <tr>
                    <td><div align="center"> </div></td>
                  </tr>
                  
				  
				  <tr>
                    <td><div align="center">
                      
                      </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>

