<?php
  include("stilos/config.inc.php");
  include("../clases/BDConexion.php"); 
  include("../clases/clsPer.php");
  include("Funciones.php");
  session_start();
  $objPer=new clsPer;
  $resultado=$objPer->getTransDatos($mat_trans);
  $filas=$objPer->NextRow($resultado);
  $mat_trans=$filas['mat_trans'];
  $tipo_trans=$filas['tipo_trans'];
  $cappass_trans=$filas['cappass_trans']; 
  $capcarg_trans=$filas['capcarg_trans'];
  $model_trans=$filas['model_trans'];
  $tripnum_trans=$filas['tripnum_trans'];
  $tcant_trans=$filas['tcant_trans'];
  $passt_trans=$filas['passt_trans'];
  $cargat_trans=$filas['cargat_trans'];
  $cod_emp=$filas['cod_emp'];
  $tarifa=$filas['tarifa'];
?>
<? //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"> 
<!--
//sURL,x,y
function Abrir_Ventanapopup1(sURL,x,y) { 
/*var especificaciones="top=0, left=0, toolbar=no,location=no, status=yes,menubar=no,scrollbars=no, resizable=no, width=1,height=1" 
var titulo="Titulo"
window.open(el_url,titulo,especificaciones);*/ 

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="cvp_cons_trans.php?des=$des&mat_trans=$mat_trans";
$envia1="cvp_emp.php";
?>
<script>
function volverB(form)
{
location.reload('<? echo $envia1 ?>');
}
function volver(form)
{
location.reload('<? echo $envia ?>');
}
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 enviar_url(form,url)
{

		if(form1.mat_trans.value==""){
		alert("Debe Ingresar la matricula de transporte");
		form1.mat_trans.focus();
		return;		
	    }
		if(form1.tipo_trans.value=="0"){
		alert("Debe Ingresar el tipo de transporte");
		form1.tipo_trans.focus();
		return;		
	    }
		
		if(form1.tcant_trans.value==""){
		alert("Debe Ingresar la capasidad de pasajeros");
		form1.cappass_trans.focus();
		return;		
	    }
		if(form1.capcarg_trans.value==""){
		alert("Debe Ingresar la capacidad de carga");
		form1.capcarg_trans.focus();
		return;		
	    }
		if(form1.model_trans.value==""){
		alert("Debe Ingresar el modelo de transporte");
		form1.model_trans.focus();
		return;		
	    }		
		/*if(form1.capcarg_trans.value > form1.cargat_trans.value){
				alert("la capacidad de carga disponible debe ser igual o menor que el total de Carga");
				form1.capcarg_trans.focus();
				return;
		}
		if(form1.tcant_trans.value > form1.passt_trans.value){
				alert("la cantidad de pasajeros disponible debe ser igual o menor que el total de pasajeros");
				form1.tcant_trans.focus();
				return;
		}*/
		if(form1.button.value)
		{				
				form1.submit();
		}
}
</script>
<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->
<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->
<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->
</head>

<body bgcolor="<?=$c_fondo['fondo']?>" onfocus="foco()" 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">
        <form name="form1" method="post" action="procesos/cvp_trans_editar.php">
          <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" >Registro de Unidades de Transporte</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  background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
              <td  height="86" background="../estilo_tabla/parte_med_cen.gif"><div align="center">
                  <table width="679" border="0" cellspacing="0" cellpadding="0">
                    <tr class="lblCampo">
                      <td colspan="6">&nbsp; </td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Empresa</div></td>
                      <td><div align="left">:</div></td>
                      <td><div align="left">
                        <select name="cod_emp" class="lblForm1" id="select2" onkeyup=fn(this.form,this)>
                          <option value="0">Varios</option>
                          <? 
							echo $objPer->getCboEmp1($cod_emp);
							?>
                        </select>
                      </div></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td width="170"><div align="left">Matricula de Unidad </div></td>
                      <td width="6"><div align="left">:</div></td>
                      <td width="200"><div align="left">
                          <input name="mat_trans" type="text" id="apellidos2" onkeyup=fn(this.form,this) value="<? echo $mat_trans?>" size="20">
                      </div></td>
                      <td width="96">Tipo de Unidad </td>
                      <td width="8"><div align="left">:</div></td>
                      <td width="199">					  
					  <select name="tipo_trans" id="select3" onkeyup=fn(this.form,this)>
                        <option value="0" <? if($tipo_trans=="0"){?> selected <? }?>>Seleccionar Pais</option>
                        <option value="AVIONETA" <? if($tipo_trans=="AVIONETA"){?> selected <? }?>>AVIONETA</option>
                        <option value="RAPIDO" <? if($tipo_trans=="RAPIDO"){?> selected <? }?>>RAPIDO</option>
                        <option value="BARCAZA" <? if($tipo_trans=="BARCAZA"){?> selected <? }?>>BARCAZA</option>
						<option value="HELICOPTERO" <? if($tipo_trans=="HELICOPTERO"){?> selected <? }?>>HELICOPTERO</option>
						<option value="HIDROAVION" <? if($tipo_trans=="HIDROAVION"){?> selected <? }?>>HIDROAVION</option>                        
                      </select>					  </td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Cap. Disponible de Pass. Tripu. </div></td>
                      <td><div align="left">:</div></td>
                      <td>
                        <div align="left">
                          <input name="tcant_trans" type="text" id="tcant_trans" onkeyup=fn(this.form,this) value="<? echo $tcant_trans?>" size="5">
                      </div></td>
                      <td>Disponible Carga </td>
                      <td><div align="left">:</div></td>
                      <td><input name="capcarg_trans" type="text" id="capcarg_trans" onkeyup=fn(this.form,this) value="<? echo $capcarg_trans?>" size="8">
                      Kgs.</td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Cap. Total Pass Tripulante </div></td>
                      <td><div align="left">:</div></td>
                      <td><div align="left">
                        <input name="passt_trans" type="text" id="passt_trans2" onkeyup=fn(this.form,this) value="<? echo $passt_trans?>" size="5">
                      </div></td>
                      <td><div align="left">Total Carga </div></td>
                      <td><div align="left">:</div></td>
                      <td><div align="left">
                        <input name="cargat_trans" type="text" id="cargat_trans" onkeyup=fn(this.form,this) value="<? echo $cargat_trans?>" size="8">
                        Kgs.
                      </div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Modelo</div></td>
                      <td><div align="left">:</div></td>
                      <td><div align="left">
                        <input name="model_trans" type="text" id="appat_per4" onkeyup=fn(this.form,this) value="<? echo $model_trans?>" size="35">
                        </div></td>
                      <td><!-- Numero de Tripulacion --> </td>
                      <td><div align="left"></div></td>
                      <td>
                        <div align="left">
                          <input name="tripnum_trans" type="hidden" id="appat_per32" onkeyup=fn(this.form,this) value="<? echo $tripnum_trans?>" size="5">
                        </div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Tarifa por Contrato </div></td>
                      <td>&nbsp;</td>
                      <td><div align="left">
                        <input name="tarifa" type="text" id="tarifa" value="<?=$tarifa?>" size="15">
                      </div></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="normal">
                      <td colspan="6">
                        <hr align="left" size="1" color="#000000">
                      </td>
                    </tr>
                    <tr class="normal">
                      <td colspan="6">
					    <div align="center">
					      <table width="660" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                              <td width="220"><div align="right">
                                <input name="button" type="button" style="<?=$stylo['st2']?>" class="botira" value=".:Actializar:." onClick="enviar_url(form1,'procesos/cvp_trans_editar.php')">
                              </div></td>
                              <td width="220"><div align="center">
                              </div></td>
                              <td width="220"><div align="left">
                                <input name="Submit2" type="button" style="<?=$stylo['st2']?>" class="botira" value=".: Regresar :." onClick="volver(this.form);">
                              </div></td>
                            </tr>
                          </table>
			          </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="20"></td>
              <td background="../estilo_tabla/parte_inf_cen.gif">&nbsp;</td>
              <td><img src="../estilo_tabla/parte_inf_der.gif" width="25" height="20"></td>
            </tr>
          </table>
        </form>
    </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="3,4,23,21" href="fondo.php">
</map>
</body>
</html>

