                                                                                                                                                                                                                        
<html>
<head>
<link href="../estilos/estilos.css" type="text/css" rel="stylesheet">
</head>
<script language="javascript">

function pon_prefijo(cdgbar) {
	parent.document.formulario.Acdgbar.value=cdgbar;


	
}


</script>


<body>
<?php include ("../conexion.php"); 

	$cdgbar=$_GET["cdgbar"];
	
	 if ($cdgbar =="") {
	
	 } else {
		 
	$consulta = "SELECT * FROM web_1001 WHERE cdgbar='$cdgbar' ";
					$resultado = $mysqli->query($consulta);
					$row = $resultado->fetch_assoc();
						$filas = $resultado->num_rows;
	
	if ($filas>0) {	
	?>
	
			<script>

	alert("Atencion codigo de barras ya existe, favor verifique")
    
			parent.document.getElementById("Acdgbar").select();
	 		parent.document.getElementById("Acdgbar").focus();
			parent.document.formulario.Acdgbar.value="";
	
	</script>
				<?php 
		} else {
	
 ?>
 
 <script languaje="javascript">
		pon_prefijo("<?php echo mysql_result($rs_tabla,0,cdgbar) ?>");

		</script>


	<?php 
 }}
	
		
 
?>
</div>
</body>
</html>
