<?php	
  include("../clases/BDConexion.php");
  include("../clases/clsPer.php");
  include("Funciones.php");
  include("stilos/config.inc.php");
  include("funcion/funciones.php");
  session_start();
  $objPer=new clsPer;
  session_register("control1");
 
  if($borrar==1){
  $control1 = array();  
  }
  
?>
<? //include "sc_lib_ventana.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 language="javascript" src="ajax3.js"></script>
<script language="JavaScript"> 
<!--
function Abrir_Ventanapopup1(sURL,x,y) { 
if (!window.focus) return;
			var par;
			par = "width=" +x + ",height="+y+","
			par = par + "dependent=no,scrollbars=yes,resizable=no"
			par = par + "menubar=no,toolbar=no,status=yes"
			var ventana = window.open(sURL,"Ver",par)
			ventana.focus();
}
function Abrir_Ventanapopup2(sURL,x,y) { 
if (!window.focus) return;
			var par;
			par = "width=" +x + ",height="+y+","
			par = par + "dependent=no,scrollbars=yes,resizable=no"
			par = par + "menubar=no,toolbar=no,status=yes"
			var ventana = window.open(sURL,"Ver",par)
			ventana.focus();
}
//--> 
</script>
<? 
$envia="fondo.php?k=$k&razonsocial=$razonsocial&distrito=$distrito";
$envia1="cvp_personal.php";
$enviao="enviar.php?cod_man=$cod_man&dest_ruta=$dest_ruta&orig_ruta=$orig_ruta";
?>
<script>
function volverB(form)
{
location.reload('<? echo $envia1 ?>');
}
function volver(form)
{
location.reload('<? echo $envia ?>');
}
function volver1(form)
{
location.reload('<? echo $enviao ?>');
}
var vent = null;
function foco() {
   if (vent != null)
       vent.focus();
}
function cerrar() {
   vent = null;
}

</script>
<script language="JavaScript">
function selecciona(form)
{
 if(form.botones1.value)
  {
   form.zonasi.disabled=true;
  }
}

function cierra(form)
{
location.reload('../ventana.php');
}
function activainter(form)
{
   form.pais2.disabled=false;
   form.ciudad2.disabled=false;
   form.nacionalidad2.disabled=false;
   form.btn_ver2.disabled=false;
   form.btn_nuevo2.disabled=false;
   
   form.pais.value="";
   form.pais.disabled=true;
   form.ciudad.value="";
   form.ciudad.disabled=true;
   form.nacionalidad.value="";
   form.nacionalidad.disabled=true;
   form.idciudad1.value="";
   form.btn_ver1.disabled=true;
   form.btn_nuevo1.disabled=true;
}
</script>
<SCRIPT LANGUAGE=javascript>
function fn(form,field)
{
var next=0, found=false
var f=form
if(event.keyCode!=13) return;
for(var i=0;i<f.length;i++) {
if(field.name==f.item(i).name){
next=i+1;
found=true
break;
}
}
while(found){
if( f.item(next).disabled==false && f.item(next).type!='hidden'){
f.item(next).focus();
break;
}
else{
if(next<f.length-1)
next=next+1;
else
break;
}
}
}
</SCRIPT>
<script>
function Enviar1(){		
		var canasta1 = parseInt(document.form1.canasta1.value);
		combustible1=Math.round(document.form1.combustible.value);
		if (form1.fecha.value==""){
			alert("El Campo fecha esta Vacio");
			form1.fecha.focus();
			return;		
		        }
		if (form1.numcontrol.value==""){
			alert("El Campo numero de control esta Vacio");
			form1.numcontrol.focus();
			return;		
		        }    
		if (form1.matricula.value=="0"){
			alert("no eligio el transporte");
			form1.matricula.focus();
			return;		
		        }
		if (form1.piloto.value=="0"){
			alert("no eligio el transporte");
			form1.piloto.focus();
			return;		
		        }
		if (form1.mision.value=="0"){
			alert("no lleno el campo mision");
			form1.mision.focus();
			return;		
		        }
		if(canasta < 1){
		alert("No Agrego el detalle");
			form1.harranq_dch.focus();
			return;
		}
		if(isNaN(parseFloat(combustible1))){alert('El Valor que Introducio en combustible entregado no es numerico'); document.form1.combustible.focus(); document.form1.combustible.select();return;}
        /* var nmedi;
		   nmed='<?php echo $contarItem=count($medicina_aten); ?>';
		   nmed = Math.round(nmed);
		if (nmed < 1){
			alert("No Utilizo ninguna medicina en el caso ");
			form1.btn_agregarMed.focus();
			return;		
		           } */
		if(form1.button.value)
		          {
			 form1.submit();
		          }
				
		  }  
</script>

</head>

<body bgcolor="<?=$c_fondo['fondo']?>" onfocus="foco()" background="../imagenes/fondo.jpg">
<form name="form1" method="post" action="procesos/p_control_heli_grabar.php">
  <table width="971" 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="1250" background="../estilo_tabla/parte_sup_cen.gif" valign="bottom">
        <div align="left" class="lblTitulo" >CONTROL HORAS DE VUELO - BITACORAS DE VIAJES </div></td>
      <td width="25"><img src="../estilo_tabla/parte_sup_der.gif" width="25" height="25" border="0" usemap="#MapMapMap"></td>
    </tr>
    <tr>
      <td  background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
      <td background="../estilo_tabla/parte_med_cen.gif"><div align="left">
          <table width="854" border="0" cellspacing="0" cellpadding="0">
            <tr class="lblCampo">
              <td colspan="7">&nbsp; </td>
            </tr>
            <tr class="lblCampo">
              <td width="84"><div align="right">Codigo Viaje </div></td>
              <td width="3"><div align="left">:</div></td>
              <td width="216"><div align="left">
                  <input name="numcontrol" type="text" class="pnlForm" id="numcontrol" onkeyup=fn(this.form,this) value="<? echo $cod_man?>" size="20">
              </div></td>
              <td width="24"><div align="right"></div></td>
              <td width="4"><div align="left">:</div></td>
              <td width="246"><div align="right">Via</div></td>
              <td width="277"><div align="left">
                <select name="via" id="select5" onChange="enviar1(this.options[this.options.selectedIndex].value)">
                  <option value="0" >Seleccione</option>
                  <option value="A" <? if($via=='A'){?> selected <? }?>>Aerea</option>
                  <option value="F" <? if($via=='F'){?> selected <? }?>>Fluvial</option>
                </select>
                  </div></td>
            </tr>
            <tr class="lblCampo">
              <td><div align="right">Medio Transporte </div></td>
              <td><div align="left"></div></td>
              <td><div align="left">
                <select name="matricula" id="select3" onkeyup=fn(this.form,this)>
                  <option value="0" <? if($mat_trans=="0"){?> selected <? }?>>Ninguno</option>
                  <? 
						echo $objPer->getCboHeliTrans($mat_trans);
						?>
                </select>
              </div></td>
              <td><div align="right"></div></td>
              <td><div align="left"></div></td>
              <td>&nbsp;</td>
              <td><div align="left">
              </div></td>
            </tr>
            <tr class="lblCampo">
              <td><div align="right">Fecha Salida </div></td>
              <td>&nbsp;</td>
              <td><table width="186" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="74"><div align="left">
                      <input name="fecha2" type="text" class="pnlForm" id="fecha3" onKeyUp=fn(this.form,this) value="<? echo $fecha?>" 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');"> <img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0"> </a> </div></td>
                </tr>
              </table></td>
              <td><div align="right"></div></td>
              <td>&nbsp;</td>
              <td><div align="right">Fecha Llegada </div></td>
              <td><div align="left">
                <table width="186" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="74"><div align="left">
                        <input name="fecha" type="text" class="pnlForm" id="fecha2" onKeyUp=fn(this.form,this) value="<? echo $fecha?>" 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');"> <img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0"> </a> </div></td>
                  </tr>
                </table>
              </div></td>
            </tr>
            <tr class="lblCampo">
              <td><div align="right">Combustible entregado </div></td>
              <td>&nbsp;</td>
              <td><input name="combustible" type="text" id="combustible" value="0" size="15">			  
                Glns. 
				<? 
				//echo calcular_horas_formato('11:50','13:16');
				?>
			  </td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td><div align="right">Facturable</div></td>
              <td><select name="select">
                <option value="1">SI</option>
                <option value="2">NO</option>
              </select></td>
            </tr>
          </table>
      </div></td>
      <td background="../estilo_tabla/parte_med_der.gif">&nbsp;</td>
    </tr>
    <tr>
      <td  background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
      <td background="../estilo_tabla/parte_med_cen.gif"> <div align="left">
        </div></td>
      <td background="../estilo_tabla/parte_med_der.gif">&nbsp;</td>
    </tr>
    <tr>
      <td  background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
      <td background="../estilo_tabla/parte_med_cen.gif"><div align="left">
        <table width="658" border="1" cellspacing="0" cellpadding="0">
          
          <tr class="lblCampo">
            <td height="13" colspan="2"><div align="center">Viaje</div></td>
            <td height="13" colspan="4"><div align="center">Tiempo</div></td>
            <td width="5" rowspan="2"><div align="center"></div></td>
            <td width="368"><div align="center"></div>              <div align="center"></div>              <div align="center"></div></td>
            <td>&nbsp;</td>
          </tr>
          <tr class="lblCampo">
            <td height="13"><div align="center">De</div></td>
            <td><div align="center">Para</div></td>
            <td><div align="center">HAR</div></td>
            <td><div align="center">HAI</div></td>
            <td><div align="center">HTI</div></td>
            <td><div align="center">HAP</div></td>
            <td><div align="center">Observacion</div></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td width="68"><div align="center">
              <select name="origen" id="select7">
                <option value="0" <? if($origen=="0"){?> selected <? }?>>Origen</option>
                <? 
						    echo $objPer->getCboLugarH($origen);
						    ?>
              </select>
            </div></td>
            <td width="72"><div align="center">
              <select name="destino" id="select6">
                <option value="0" <? if($destino=="0"){?> selected <? }?>>Destino</option>
                <? 
						    echo $objPer->getCboLugarH($destino);
						?>
              </select>
            </div></td>
            <td width="25"><div align="center">
              <input name="harranq_dch" type="text" id="harranq_dch" value="00:00" size="5" maxlength="5">
</div></td>
            <td width="25"><div align="center">
              <input name="haire_dch" type="text" id="haire_dch" value="00:00" size="5" maxlength="5">
            </div></td>
            <td width="25">
              <div align="center">
                <input name="htierra_dch" type="text" id="htierra_dch" value="00:00" size="5" maxlength="5">
              </div></td>
            <td width="25"><div align="center">
              <input name="hapaga_dch" type="text" id="hapaga_dch" value="00:00" size="5" maxlength="5">
            </div></td>
            <td><div align="center">
            </div></td>
            <td><div align="center">
            </div>              <div align="center">
              <textarea name="obser" cols="45" rows="2" id="textarea"></textarea>
              </div>            <div align="center">
            </div>              <div align="center">
              </div>            <div align="center">
            </div>              <div align="center">
              </div>            <div align="center">
            </div>              <div align="center">
              </div>            <div align="center">
            </div>              <div align="center">
              </div>            <div align="center">
            </div>              <div align="center">
              </div>
              <div align="center"></div>              <div align="center">
              </div>              <div align="center">
              </div></td>
            <td width="25"><div align="center"><a href="#" onClick="enviarDatos()"><img src="../imagenes/btn_siguiente.gif" width="25" height="25" border="0"></a> </div>
                <!-- <input name="boton_Per2" type="button" class="lblForm" id="boton_Per22" onClick="Enviar()" value="&gt;&gt;&gt;"> --></td>
          </tr>
          
          <tr>
            <td colspan="9"><div id="lista"></div></td>
            </tr>
        </table>
      </div></td>
      <td background="../estilo_tabla/parte_med_der.gif">&nbsp;</td>
    </tr>
    <tr>
      <td  background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
      <td background="../estilo_tabla/parte_med_cen.gif">
	  <div align="center" id="canasta">                         
        <? include('p_controlheli_detalle_prueba.php');?></div>
	  </td>
      <td background="../estilo_tabla/parte_med_der.gif">&nbsp;</td>
    </tr>
    <tr>
      <td  background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
      <td background="../estilo_tabla/parte_med_cen.gif"><div align="center">
        <table width="351" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="118" height="22"><div align="center">
              <input name="button" type="button" style="<?=$stylo['st2']?>" class="botira" value=".:Grabar:." onClick="Enviar1()">
            </div></td>
            <td width="112"><div align="center">
              <input name="Submit2" type="button" style="<?=$stylo['st2']?>" class="botira" value=".: Salir :." onClick="volver(this.form);">
            </div></td>
            <td width="121"><div align="center">
              <input type="submit" name="Submit" value="Enviar a Manifiesto">
            </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>
  <map name="MapMapMap">
    <area shape="rect" coords="1,4,21,21" href="fondo.php">
  </map>
</form>
<map name="MapMap">
  <area shape="rect" coords="3,4,23,21" href="fondo.php">
</map>



</body>
</html>

