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

function pon_prefijo(cdgbar,dscart,exiact) {
	
	parent.opener.document.form_articulos.cdgbar.value=cdgbar;
	parent.opener.document.form_articulos.dscart.value=dscart;
	parent.opener.buscar_articulos();
	parent.window.close();




}

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


$dscart = strtoupper($_POST["dscart"]);

	
		if ($result = $mysqli->query("SELECT * FROM web_1001  WHERE dscart like '%$dscart%'  and tipart != 2   " )) {
   $nrs = $result->num_rows;
   $result->close();
}


?>
<div id=""  >
<form id="form1" name="form1">


<?php



 if ($nrs>0) { ?>
<div  class="totalResultado"> 
	<table class="fuente8" width="98%" cellspacing=0 cellpadding=0 border=0>
		 <tr class="cabeceraTabla" >
			<td width="21%">CODIGO</td>
			<td width="41%"><div align="center" class="cabeceraTabla">
			  <p>ARTICULO</p>
		   </div></td>
		      <td width="12%"><div align="center" class="cabeceraTabla">
			  <p>EXISTENCIA</p>
		   </div></td>
			<td width="16%">PRECIO</td>
			<td width="10%"><span class="totalResultado"><span class="totalResultado">
		    <div align="center">
			</span></td>
		  </tr>
       
		<?php
		
	
$consulta = "SELECT * FROM web_1001  WHERE dscart like '%$dscart%'  and tipart != 2   ";
if ($resultado = $mysqli->query($consulta)) 
$contador=0;
		
		 while ($fila = $resultado->fetch_assoc()) {

        $cdgbar = $fila["CDGBAR"];
        $dscart = $fila["DSCART"];
        $precio = $fila["PRE002"];
		$exiact = $fila["EXIACT"];
		$cob_iv = $fila["COB_IV"];
		$tipart = $fila["tipart"];
				

		if ($contador % 2) { $fondolinea="itemParTabla"; } else { $fondolinea="itemImparTabla"; }?>
						<tr class="<?php echo $fondolinea?>">
					<td>
        <div align="center"><?php echo $cdgbar;?></div></td>
					<td>
        <div align="left"><?php echo $dscart;?></div></td>
		<td>
        <div align="center"><?php echo $exiact;?></div></td>
		<td><div align="right" ><?php echo number_format($precio,2,".",",")?></div></td>
					<?php  $cantidad="";?>
                    
					<td align="center"><div align="center"><a href="javascript:pon_prefijo('<?php echo $cdgbar?>','<?php echo htmlspecialchars( $dscart ) ?>','<?php echo $exiact?>')"><img src="../img/Redo_32x32-32.png" border="0" title="Seleccionar"></a></div></td>					
				</tr>
			<?php 
		$contador++;	
			}
		?>
  </table>
		<?php } else { ?>
					<table class="fuente8" width="87%" cellspacing=0 cellpadding=3 border=0>
						<tr>
							<td width="100%" class="mensaje"><?php echo "No existe articulo que cumpla con los criterios de b&uacute;squeda";?></td>
					    </tr>
					</table>					
					<?php }  
					
					
				
					
					?>	
<iframe id="frame_datos2" name="frame_datos2" width="0%" height="0" frameborder="0">
	<ilayer width="0" height="0" id="frame_datos2" name="frame_datos2"></ilayer>
</iframe>
<input type="hidden" id="accion" name="accion">
</form>
</div>
</body>
</html>
