<?
session_start();
if ($_SESSION['estado'] != "ON")
		{
		?>
		<script>
			parent.location.href = 'index.php';
		</script>
		<? 
		exit();
		}
?>
<?
include("../conex.php");
$get_cod_producto = $_POST["txtcod_prod"];
$sql_bpro = "SELECT * FROM productos WHERE codigo = $get_cod_producto";
$res_bpro = mysql_query($sql_bpro,$enlace);
if (mysql_fetch_object ($res_bpro))
	{
	$sql_codigo = mysql_result($res_bpro, 0, "codigo");
	$sql_descripcion = mysql_result($res_bpro, 0, "descripcion");
	$sql_precio = mysql_result($res_bpro, 0, "precio");
	$sql_saldo = mysql_result($res_bpro, 0, "saldo");
	$sql_unidad_medida = mysql_result($res_bpro, 0, "unidad_medida");
	$sql_costo = mysql_result($res_bpro, 0, "costo");
	$sql_u_entrada = mysql_result($res_bpro, 0, "u_entrada");
	$sql_u_salida = mysql_result($res_bpro, 0, "u_salida");
	$sql_cod_familia = mysql_result($res_bpro, 0, "cod_familia");
	$sql_proveedor = mysql_result($res_bpro, 0, "proveedor");
	$sql_observaciones = mysql_result($res_bpro, 0, "observaciones");
	$sql_cod_fabricante = mysql_result($res_bpro, 0, "codigo_fabricante");
	$sql_cod_eq_prov = mysql_result($res_bpro, 0, "codigo_equivalente_proveedor");
	$sql_unidades = mysql_result($res_bpro, 0, "unidades");
	$sql_caja = mysql_result($res_bpro, 0, "caja");
	$sql_ven_prod_param = mysql_result($res_bpro, 0, "vencimiento_producto_param");
	$sql_prod_ser_param = mysql_result($res_bpro, 0, "producto_seriado_param");
	$sql_peso = mysql_result($res_bpro, 0, "peso");
	$sql_volumen = mysql_result($res_bpro, 0, "volumen");
	$sql_impuestos1 = mysql_result($res_bpro, 0, "impuestos1");
	$sql_impuesto2 = mysql_result($res_bpro, 0, "impuesto2");
	
	
	}

else
	{
		$sql_codigo = $get_cod_producto;

	}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Seriado</title>
<style type="text/css">
<!--
body {
	background-color: #CCCCCC;
	margin-left: 0px;
	margin-top: 3px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.Estilo7 {
	font-size: small;
	color: #000099;
}
.Estilo11 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; color: #000099; }
.Estilo13 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9px;
	color: #000099;
	text-decoration: underline;
}
.Estilo14 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9px;
	color: #000099;
}
.titulos2 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 13px;
	color: #003366;
	background-color: #CCCCCC;
	font-style: normal;
	font-weight: bold;
}
.botones {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
	height:26px;
}
-->
</style>

</head>

<table width="90%" border="0" align="center">
	<tr>
		<td><div align="center" class="titulos2">
		Producto Seriado
		</div></td>
	</tr>
</table>
<body vlink="#2293ff" alink="#2293ff" link="#2293ff" onLoad="validacodigo();">
<form name="form1" method="post" action="guarda_seriado.php">
<div align="left" class="titulos2" style="font-size:12px">
<input name="txtcodigo" type="text" id="txtcodigo" value="<?=$sql_codigo?>" readonly="1" size="40" style="visibility:hidden">
  <table width="90%" border="1" align="center">
	 <tr>
      <td>Descripción</td>
      <td>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td><input name="txtdescripcion" type="text" id="txtdescripcion" size="40" value="<?=$sql_descripcion?>"></td>
            <td>&nbsp;</td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td>Marca</td>
      <td height="1px">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td><input name="txtnch" type="text" id="txtnch" size="40" value=""></td>
            <td>&nbsp;</td>
          </tr>
        </table></td>
    </tr>
	       <td>Modelo</td>
           <td height="1px">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td><input name="txtnm" type="text" id="txtnm" size="40" value=""></td>
            <td>&nbsp;</td>
          </tr>
        </table></td>
    </tr>
	    <td>N&ordm; Motor </td>
      <td height="1px">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td><input name="txtes" type="text" id="txtes" size="40" value=""></td>
            <td>&nbsp;</td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td>N&ordm; Chassis </td>
      <td height="1px">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td><input name="txtaf" type="text" id="txtaf" size="40"  value=""></td>
            <td>&nbsp;</td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td>Color</td>
      <td height="1px">&nbsp;</td>
    </tr>
    <tr>
      <td>A&ntilde;o</td>
      <td height="1px">&nbsp;</td>
    </tr>
    <tr>
      <td>Peso Bruto </td>
      <td height="1px">&nbsp;</td>
    </tr>
    <tr>
      <td>Combustible</td>
      <td height="1px">&nbsp;</td>
    </tr>
    <tr>
      <td><p>Descripcion</p>
        </td>
      <td height="1px">&nbsp;</td>
    </tr>
  </table>
  
  <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td>&nbsp;</td>
      <td><div align="center">
        <label>
        <input type="button" name="Submit" value="Guardar" onClick="enviar();">
        </label>
      </div></td>
      <td>&nbsp;</td>
    </tr>
  </table>
</div>
</form>
<script language="javascript">
var nav4 = window.Event ? true : false;
<!-- Ingreso solo letras -->
function valida(evt){
var key = nav4 ? evt.which : evt.keyCode;
	return (key <= 13 || (key >= 48 && key <= 57));
	}
function valida2(evt){
var key = nav4 ? evt.which : evt.keyCode;
	return (key <= 13 || (key >= 48 && key <= 57) || key==46);
	}


function enviar()
	{
	document.form1.submit();
	}
</script>