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

function pon_prefijo(cdgbar,dscart,codfactura,numlinea) {

	//parent.document.formulario_lineas.cdgbar.value=cdgbar;
	//parent.document.formulario_lineas.dscart.value=dscart;
	//parent.oponer.modificar_articulo()
	

	
	parent.modificar_articulo(cdgbar,codfactura,numlinea);
	
	// window.open("../inventario/modificar_articulo_xml.php?cdgbar="+cdgbar+"&codfactura="+codfactura+"&numlinea="+numlinea,"miwin","width=1100,height=650,scrollbars=yes");
    
}


function limpiar() {

	parent.document.formulario_lineas.cdgbar.value="";
	parent.document.formulario_lineas.dscart.value="";
}

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

<?php
	$dscart =$_GET["dscart"];
	$cdgbar=strtoupper($_GET["cdgbar"]);
	$codfactura =$_GET["codfactura"];
	$numlinea =$_GET["numlinea"];



	
$consulta1 ="SELECT * FROM web_1001 WHERE  CDGBAR='$cdgbar' or  CDGBAR2='$cdgbar' or  CDGBAR3='$cdgbar'";
$resultado1 = $mysqli->query($consulta1);
$fila = $resultado1->fetch_array();
$nrs = $resultado1->num_rows;


	if ( $nrs > 0) {
		?>
        <script language="javascript">
pon_prefijo("<?php echo $fila["CDGBAR"]?>",'<?php echo $fila["DSCART"] ?>','<?php echo $codfactura ?>','<?php echo $numlinea ?>');


		</script>
		<?php 
		
		
		
		
	} else { ?>
	<script>
			if (confirm(" Articulo nuevo desea agregarlo ? "))

			parent.nuevo_articulo("<?php echo $cdgbar ?>",'<?php echo $dscart ?>','<?php echo $codfactura ?>','<?php echo $numlinea ?>');
			limpiar() ;
			
	//	window.open("../inventario/nuevo_articulo_xml.php?cdgbar="+cdgbar+"&dscart="+dscart,"miwin","width=1100,height=650,scrollbars=yes");
	//parent.limpiararticulo();
	
			//window.open("../inventario/nuevo_articulo_xml.php?cdgbar="+cdgbar+"&dscart="+dscart,"miwin","width=1100,height=650,scrollbars=yes");

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