

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


$cdgbar=$_POST["cdgbar"];



 if ($result = $mysqli->query("SELECT * FROM web_1001 WHERE cdgbar='$cdgbar' ")) {
   $filas = $result->num_rows;
   $result->close();
   
 }
 
if ($filas > 0) { 

       $sel_resultado = "SELECT * FROM web_1001 WHERE  cdgbar='$cdgbar'  ";
       $result = $mysqli->query($sel_resultado);
       $row = $result->fetch_array();
     
	   $pre001 =  $row["PRE001"];
	   $dscart =  $row["DSCART"];
	   $exiact =  $row["EXIACT"];
						
 }	else {  				
 	   
	   $dscart = "CODIGO DE PRODUCTO NO REGISTRADO, FAVOR VERIFIQUE";
	   $pre001 =  0.00 ;
	   $exiact =  0.00;
	
 }
 
 if ($cdgbar=="") $dscart="INGRESE EL CODIGO DEL ARTICULO";

?>


<html>
	<head>
		<title>Consulta de Articulos</title>
		<link href="../estilos/estilos.css" type="text/css" rel="stylesheet">	
        
        
 		 <script src="..//jquery-maskmoney/src/jquery.maskMoney.js" type="text/javascript"></script>
		<script>
		
		var cursor;
		if (document.all) {
		// Está utilizando EXPLORER
		cursor='hand';
		} else {
		// Está utilizando MOZILLA/NETSCAPE
		cursor='pointer';
		}
		
		
//nombre del primer campo en la secuencia
siguienteCampo = ""
//nombre del formlario
nombreForm = "formulario"

//funcion que gestiona el evento
function TelcaPulsada( e ) {

   if ( window.event != null)				//IE4+
      tecla = window.event.keyCode;
   else if ( e != null ) 				//N4+ o W3C compatibles
      tecla = e.which;
   else
      return;
	
   if (tecla == 13) { 					//se pulso enter
      if ( siguienteCampo == 'fin' ) {			//fin de la secuencia, hace el submit
         alert('Envio del formulario.')			//eliminar este alert para uso normal
         return false					//sustituir por return true para hacer el submit
      } else { 						//da el foco al siguiente campo
         eval('document.' + nombreForm + '.' + siguienteCampo + '.select()')
         return false
      }
   }
}

document.onkeydown = TelcaPulsada;			//asigna el evento pulsacion tecla a la funcion
if (document.captureEvents)				//netscape es especial: requiere activar la captura del evento
	document.captureEvents(Event.KEYDOWN)
	
 
	function cancelar() {
		location.href="index.php?cadena_busqueda=<?php echo $cadena_busqueda?>";
		}
		
	function inicio() {
	//	parent.document.getElementById("cdgbar").select();
   
     }  

		</script>
	</head>
		<body onLoad="inicio()"> 	

			
		<div align="center">
				<blockquote>
				  <form id="formulario" name="formulario" method="post" action="guardar_cierre.php" target="frame_rejilla">
				    <table class="fuente8" width="100%" cellspacing=0 cellpadding=3 border=0	>
				      <tr>
				        <td width="1%">&nbsp;</td>
				        <td colspan="5"  rowspan="2">   <input id="cdgbar"    style='text-align:center;'  value="<?php echo htmlspecialchars( $dscart ) ?>" readonly class="fuente_articulos" name="cdgbar" type="text" ></td>
				        <td width="3%">&nbsp;</td>
			          </tr>
				      <tr>
				        <td>&nbsp;</td>
				        <td>&nbsp;</td>
			          </tr>
				      <tr>
				        <td>&nbsp;</td>
				        <td colspan="5" align="right"  >&nbsp;</td>
				        <td>&nbsp;</td>
			          </tr>
				      <tr>
				        <td>&nbsp;</td>
				        <td colspan="2" align="left"  ><input id="cdgbar3"    style='text-align:right;'  readonly value="<?php echo number_format($pre001,2,".",",")?>" class="fuente_consulta" name="cdgbar3" type="text" ></td>
				        <td width="8%" align="right"  >&nbsp;</td>
				        <td width="3%" align="right"  >&nbsp;</td>
				        <td width="36%" align="right"  ><input id="cdgbar2"  readonly   style='text-align:right;'  value="<?php echo number_format($exiact,2,".",",")?>" class="fuente_consulta" name="cdgbar2" type="text" ></td>
				        <td>&nbsp;</td>
			          </tr>
				      <tr>
				        <td>&nbsp;</td>
				        <td width="13%" align="right" >&nbsp;</td>
				        <td width="35%" align="center" >PRECIO </td>
				        <td align="right" >&nbsp;</td>
				        <td align="right" >&nbsp;</td>
				        <td align="right" >EXISTENCIA</td>
				        <td>&nbsp;</td>
			          </tr>
				      <tr>
				        <td>&nbsp;</td>
				        <td colspan="6" align="center" rowspan="3">&nbsp;</td>
			          </tr>
				      <tr>
				        <td>&nbsp;</td>
			          </tr>
				      <tr>
				        <td>&nbsp;</td>
				        <input size="30"  name="menudo" id="menudo" class="cajaGrande" value=""  type="hidden" readonly=""  >
				        <input size="30"  name="cdgcaj" id="cdgcaj" class="cajaGrande" value="<?php echo $codusu;?>"  type="hidden" readonly=""  >
				        <input size="30"  name="feccie" id="feccie" class="cajaGrande" value="<?php echo $feccie;?>"  type="hidden" readonly=""  >
				        <input id="accion" name="accion" value="alta" type="hidden">
			          </tr>
			        </table>
				    </form>
		  </blockquote>
		</div>
		</body>
</html>