<?
session_start();
if ($_SESSION['estado'] != "ON")
		{
		?>
		<script>
			parent.location.href = 'index.php';
		</script>
		<? 
		exit();
		}
?>
<?
include("../conex.php");
$bchassis = $_GET["d"];
$bcodigoprod = $_GET["cod"];
$jsbp_sql = mysql_query("SELECT * FROM seriado WHERE num_salida=0 AND chassis = '$bchassis' AND cod_producto = $bcodigoprod;", $enlace);
$jsbp_cont=0;
$flag=0;
while ( mysql_fetch_object ($jsbp_sql) )
	{
	$jsbp_sql_marca = "";
	$jsbp_sql_modelo = "";
	$jsbp_sql_motor = "";
	$jsbp_sql_chassis = "";
	$jsbp_sql_color = "";
	$jsbp_sql_ano = "";
	$jsbp_sql_peso_bruto = "";
	$jsbp_sql_combustible = "";
	$jsbp_sql_descripcion = "";
	$jsbp_sql_marca = mysql_result($jsbp_sql, $jsbp_cont, "marca");
	$jsbp_sql_modelo = mysql_result($jsbp_sql, $jsbp_cont, "modelo");
	$jsbp_sql_motor = mysql_result($jsbp_sql, $jsbp_cont, "motor");
	$jsbp_sql_chassis = mysql_result($jsbp_sql, $jsbp_cont, "chassis");
	$jsbp_sql_color = mysql_result($jsbp_sql, $jsbp_cont, "color");
	$jsbp_sql_ano = mysql_result($jsbp_sql, $jsbp_cont, "ano");
	$jsbp_sql_peso_bruto = mysql_result($jsbp_sql, $jsbp_cont, "peso_bruto");
	$jsbp_sql_combustible = mysql_result($jsbp_sql, $jsbp_cont, "combustible");
	$jsbp_sql_descripcion = mysql_result($jsbp_sql, $jsbp_cont, "descripcion");
	
	if (($jsbp_sql_marca == '') || ($jsbp_sql_modelo == '') || ($jsbp_sql_motor == '') || ($jsbp_sql_chassis == '') || ($jsbp_sql_color == '') || ($jsbp_sql_ano == '') || ($jsbp_sql_peso_bruto == '') || ($jsbp_sql_combustible == '') || ($jsbp_sql_descripcion == ''))
		{
		?>
		<script language="javascript">
		window.opener.document.form1.txtcompser.value='2';
		</script>
		<?
		}
	else
		{
		?>
		<script language="javascript">
		window.opener.document.form1.txtcompser.value='1';
		</script>
		<?
		}
	$jsbp_cont=$jsbp_cont+1;

	}
	

if ($jsbp_cont==0)	{
	?>
	<script language="javascript">
	window.opener.document.form1.txtcompser.value='0';
	</script>
	<?
	}
?>
<script language="javascript">
	window.top.open('','_parent','');window.top.close();
</script>