<?
ini_set('error_reporting',1);
session_start();
if ($_SESSION['estado'] != "ON")
		{
		?>
		<script>
			parent.location.href = 'index.php';
		</script>
		<? 
		exit();
		}
?>
<title>Busqueda Chassis</title>
<style type="text/css">
<!--
.Estilo15 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; }
-->
</style>
<?
$id_empresa=$_SESSION['empresa'];
$donde = $_GET["d"];
$cod_prod = $_GET["cod"];
include "../conex.php";
$sql_bprod = "SELECT * FROM productos WHERE codigo = $cod_prod";
$res_bprod = mysql_query($sql_bprod,$enlace);
while (mysql_fetch_object ($res_bprod))
		{
		$txtproducto =mysql_result($res_bprod, $row, "descripcion");
		$cser =mysql_result($res_bprod, $row, "producto_seriado_param");
		
		$row=$row+1;
		}
?>
<table width="100%"align="center" border="0">
  <tr>
    <td width="25%"><div align="center"><img src="Images/logo.gif" width="120" height="120"></div></td>
	<td width="50%"><div align="center"><strong><font size="6">Nuevo Seriado</font></strong></div></td>
    <td width="25%">&nbsp;</td>
  </tr>
</table>
<form id="form2" name="form2" method="post" action="nuevo_seriado.php" target="formulario">
<input type="text" name="txtcprod" id="txtcprod" style="border-width:0;width:100%; visibility:hidden" value="<?=$cod_prod;?>" border="0" readonly="1" />
	<div align="center">
<table width="95%" border="0">
    <tr>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="30%" align="left">Producto</td>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="60%" align="left">
            <input type="text" name="txtprod" id="txtprdo" value="<?=$txtproducto;?>" style="border-width:0;width:100%" border="0" readonly="1" />		
		</td>
	</tr>
	   <tr>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="30%" align="left">Marca</td>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="60%" align="left">
            <input type="text" name="txtmarca" id="txtmarca" style="border-width:0;width:100%" border="0" />		
		</td>
	</tr>
    <tr>
    	<td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="30%" align="left">Modelo</td>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="60%" align="left">
            <input type="text" name="txtmodelo" id="txtmodelo" style="border-width:0;width:100%" border="0"  />		
		</td>
      </tr>
	<tr>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="30%" align="left">Motor</td>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="60%" align="left">
            <input type="text" name="txtmotor" id="txtmotor" style="border-width:0;width:100%" border="0" /> 		
		</td>
	</tr>
	<tr>
    	<td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="30%" align="left">Chassis</td>
    	<td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="60%" align="left">
            <input type="text" name="txtchassis" id="txtchassis" style="border-width:0;width:100%" border="0" /> 		
		</td>
	</tr>
	<tr>
		<td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="30%" align="left">Color</td>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="60%" align="left">
            <input type="text" name="txtcolor" id="txtcolor" style="border-width:0;width:100%" border="0" />		
		</td>
	</tr>
	<tr>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="30%" align="left">A&ntilde;o</td>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="60%" align="left">
            <input type="text" name="txtano" id="txtano" style="border-width:0;width:100%" border="0" onKeyPress="return validanum(event)">		
		</td>
	</tr>
	<tr>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="30%" align="left">Peso Bruto Vehicular </td>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="60%" align="left">
            <input type="text" name="txtpeso" id="txtpeso" style="border-width:0;width:100%" border="0">		
		</td>
	</tr>
	<tr>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="30%" align="left">Combustible</td>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="60%" align="left">
            <input type="text" name="txtcombustible" id="txtcombustible" style="border-width:0;width:100%" border="0">		
		</td>
    </tr>
	<tr>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="30%" align="left">Descripci&oacute;n</td>
        <td class="Estilo15" style="border:double; border-width:3px; border-color:#0F0F0F" width="60%" align="left">
            <input type="text" name="txtdescripcion" id="txtdescripcion" style="border-width:0;width:100%" border="0" >		
		</td>
    </tr>
</table>
<table width="95%" border="0">
	<tr>
		<td><div align="center">
			<input type="button" name="Submit" value="Enviar" onclick="envi();">
		</div></td>
	</tr>
</table>
</div>
      
</form>
<div align="center">
	<iframe name="formulario" src="blanco.htm" width=1px height=1px AllowTransparency="true" frameborder="0"></iframe>
</div>
<script languaje="javascript">
<!--
var nav4 = window.Event ? true : false;
	<!-- Ingreso solo letras y espacio -->
function validanum(evt)
	{
	var key = nav4 ? evt.which : evt.keyCode;
	return (key < 13 || (key >= 48 && key <= 57));
	}

function envi()
	{
	if (<?=$cser?>!=1)
		{
		alert ("El producto ingresado no es seriado");
		}
	else
		{
		if (document.form2.txtchassis.value=='')
			{
			alert("Debe ingresar todos los datos del seriado");
			}
		else
			{
			window.opener.document.getElementById("seriado[<? echo "$donde";?>]").value = document.form2.txtchassis.value;
			document.form2.submit();
			}
		}
	}
</script>
