<?php 	
	include('../conexion.php');
		
		session_start();
		 
		if($_SESSION['tipo_usu']=='a' or $_SESSION['tipo_usu']=='u'  or $_SESSION['tipo_usu']=='c'){
		}else{
			header('location:acceso_denegado.php');
		}
		
		
$cdgart=$_GET["cdgart"];
$cadena_busqueda=$_GET["cadena_busqueda"];

$consulta = "SELECT * FROM web_1001 WHERE cdgart='$cdgart'";
$resultado = $mysqli->query($consulta);
$row = $resultado->fetch_array();

		$cdgbod= $row["cdgbod"]; 
		$artpro= $row["artpro"] ;
		$tipcanbas= $row["tipcanbas"] ;
		$estante= $row["estante"] ;
		  $uniemp= $row["uniemp"] ;
			  $regmedfarm= $row["regmedfarm"] ;
		$numlot= $row["numlot"] ;
		$feclote= $row["feclot"] ;
		if ($feclote <> ""){
		$feclote= implode("-", array_reverse(explode("-", $feclote))); 
		}
?>
<html>
	<head>
   
				<title>Principal</title>
		<link href="../estilos/estilos.css" type="text/css" rel="stylesheet">
		<script type="text/javascript" src="../funciones/validar.js"></script>
	
      
		<script language="javascript">
		
			function validarproveedor(){
			var codigo=document.getElementById("cdgpro").value;
			miPopup = window.open("comprobarproveedor.php?cdgpro="+codigo,"frame_datos1","width=700,height=80,scrollbars=yes");

		document.getElementById("Familia").focus();
		document.getElementById("Familia").select();
		}	
	
				
		function aceptar() {
			location.href="index.php?cadena_busqueda=<?php echo $cadena_busqueda?>";
		}	
			
			
						
		function cancelar() {
		location.href="index.php?cadena_busqueda=<?php echo $cadena_busqueda?>";
		}
		
		var cursor;
		if (document.all) {
		// Está utilizando EXPLORER
		cursor='hand';
		} else {
		// Está utilizando MOZILLA/NETSCAPE
		cursor='pointer';
		}
		
		function limpiar() {
			document.getElementById("formulario").reset();
		}
		
			function limpiar_codigo() {

			document.getElementById("Acdgbar").focus();
			document.getElementById("Acdgbar").select();
		}
		
		
	
		</script>
	</head>
		<body onLoad=" validarproveedor(); enfoque_inicial(); nobackbutton(); ">
		<div id="">
			<div id="zonaContenido">
				<div align="center">
				  <p>&nbsp;</p>
				  <div id="tituloForm" class="header">Visualizar Articulo</div>
				  <p>&nbsp;</p>
				  <div id="frmBusqueda" class="contenidoCliente">
				  
				  <form id="formulario" name="formulario" method="post" action="guardar_articulo.php">
				    <table class="fuente8" width="101%" cellspacing=0 cellpadding=3 border=0>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td colspan="4">&nbsp;</td>
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Código </td>
                        <td colspan="4"><?php echo $cdgart?></td>
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
                        <td width="1%">&nbsp;</td>
                        <td width="1%">&nbsp;</td>
                        <td width="16%">Cód Barras </td>
                        <td><input name="Acdgbar" type="text" class="cajaGrande" id="Acdgbar" size="70" maxlength="15"  readonly=""                  value="<?php echo $row["CDGBAR"]?>"  width="29%" rowspan="7" align="left" valign="top"  onChange="validararticulo()" onFocus= "siguienteCampo ='Adscart';"></td>
                       
					    <td><input name="Acdgbar2" type="text" class="cajaGrande" id="Acdgbar2" size="70" maxlength="15"  readonly=""                  value="<?php echo $row["CDGBAR2"]?>"  width="29%" rowspan="7" align="left" valign="top"  onChange="validararticulo()" onFocus= "siguienteCampo ='Adscart';"></td>
					    <?php
					        $estart= $row["ESTART"];
                            $query_estart = "SELECT * FROM  estatus ORDER BY nomest ASC";
                            $result = $mysqli->query($query_estart);
					  ?>
					   
					    <td><input name="Acdgbar3" type="text" class="cajaGrande" id="Acdgbar3" size="70" maxlength="15"  readonly=""                  value="<?php echo $row["CDGBAR3"]?>"  width="29%" rowspan="7" align="left" valign="top"  onChange="validararticulo()" onFocus= "siguienteCampo ='Adscart';"></td>
                        <td><select id="comboestatus" name="comboestatus" class="comboGrande" disabled="disabled"  onFocus="siguienteCampo ='combotipousuario';">
                       
					      <?php
						while ($fila = $result->fetch_assoc()) { 
									if ($estart ==  $fila["codest"]) { ?>
                              <option value="<?php echo  $fila["codest"]?>" selected="selected"><?php echo  $fila["nomest"]?></option>
                              <?php } else { ?>
                              <option value="<?php echo  $fila["codest"]?>"><?php echo  $fila["nomest"]?></option>
                              <?php } ;
								} ?>
                          
                          </select></td>
                        <input name="barras2" type="hidden"  id="barras2" value="<?php echo $row["CDGBAR"]?>"> 
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Descripcion</td>
                       
                        <td colspan="4"><input id="Adscart" autocomplete="off" class="cajaGrande" disabled="disabled" name="Adscart" maxlength="365"  type="text" value="<?php echo htmlspecialchars($row["DSCART"])?>"    onFocus="siguienteCampo ='Acosart';"></td>
                        <td>&nbsp;</td>
                      </tr>
           
					  		  
					   <?php
					        $artexe= $row["COB_IV"];
                            $query_artexe = "SELECT * FROM tipocliente ORDER BY cdgtipcli ASC";
                            $result = $mysqli->query($query_artexe);
					  ?>
					  
					  
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Exento </td>
                        <td width="24%"><select id="cob_iv" name="cob_iv" class="cajaGrande" disabled="disabled"  onFocus="siguienteCampo ='comboestatus';" onChange="calcular_precio001()">
                            <?php
					 while ($fila = $result->fetch_assoc()) { 
					          if ($artexe ==  $fila["cdgtipcli"]) { ?>
                              <option value="<?php echo  $fila["cdgtipcli"]?>" selected="selected"><?php echo  $fila["dsctipcli"]?></option>
                              <?php } else { ?>
                              <option value="<?php echo  $fila["cdgtipcli"]?>"><?php echo  $fila["dsctipcli"]?></option>
                              <?php } ;
								} ?>
                            </select>                          </td>
                        <td width="12%">&nbsp;</td>
          
                        <td width="21%">% Imp </td>
                        <td width="20%"><input id="ivporc" name="ivporc" type="text" class="cajaGrande" readonly  autocomplete="off"  style='text-align:right;' align="right" maxlength="14" value="<?php echo  $row["ivporc"]?>"  onChange="calcular_precio001()" onFocus=" siguienteCampo ='Acosart';" ></td>
                        <td width="3%">&nbsp;</td>
                      </tr>
					  			  		   <?php
					        $tipo= $row["CDGTIPPRO"];
                            $query_tipo = "SELECT * FROM hac_tipo_producto ORDER BY cdgtippro ASC";
                            $result = $mysqli->query($query_tipo);
					  ?>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Tipo</td>
                        <td><select id="cdgtippro" name="cdgtippro" class="cajaGrande"  disabled="disabled" onFocus="siguienteCampo ='comboestatus';" onChange="calcular_precio001()">
                            <?php
					 while ($fila = $result->fetch_assoc()) { 
					          if ($tipo ==  $fila["cdgtippro"]) { ?>
                            <option value="<?php echo  $fila["cdgtippro"]?>" selected="selected"><?php echo  $fila["dsctippro"]?></option>
                            <?php } else { ?>
                            <option value="<?php echo  $fila["cdgtippro"]?>"><?php echo  $fila["dsctippro"]?></option>
                            <?php } ;
								} ?>
                        </select></td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Costo </td>
                        <td><input id="Acosart" name="Acosart" autocomplete="off" type="text" class="cajaGrande" readonly maxlength="14"  style='text-align:right;'  value="<?php  echo number_format( $row["cosart"],2,".",",")?>"   onkeypress="mascara(this,moneda) "  onBlur="calcular_precio001();" onFocus=" siguienteCampo ='Adesart';" ></td>
                        <td>&nbsp;</td>
                        <td><div align="left">Descuento Aplicado </div></td>
                        <td><input id="Adesart" name="Adesart" type="text" class="cajaGrande"  style='text-align:right;' readonly align="right" maxlength="14" value="<?php echo  $row["DESART"]?>"  onChange="calcular_precio001()" onFocus=" siguienteCampo ='fleart';" ></td>
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Impuesto</td>
                        <td><input id="impart" name="impart"  autocomplete="off" type="text" class="cajaGrande"   style='text-align:right;' readonly maxlength="14" align="right" value="<?php echo number_format( $row["impart"],2,".",",")?>"  onChange="calcular_precio001() ;  ponDecimales(2)" onFocus="ponDecimales(2);" ></td>
                        <td>&nbsp;</td>
                        <td>Flete</td>
                        <td><input id="fleart" name="fleart" type="text" class="cajaGrande"  style='text-align:right;' readonly align="right" maxlength="14" value="<?php echo  $row["fleart"]?>"  onChange="calcular_precio001()" onFocus=" siguienteCampo ='utiart1';" ></td>
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Utilidad  </td>
                        <td><input id="utiart1" name="utiart1"  autocomplete="off" type="text" class="cajaGrande"  readonly="" style='text-align:right;' maxlength="14" value="<?php echo number_format( $row["utiart1"],2,".",",")?>"  onChange="calcular_precio001() " onFocus=" siguienteCampo ='desmax'" ></td>
                        <td>&nbsp;</td>
                        <td>Precio</td>
                        <td><input id="pre001" name="pre001" autocomplete="off" type="text"   class="cajaGrande" maxlength="14" style='text-align:right;' value="<?php echo number_format( $row["PRE001"],2,".",",")?>"  readonly="" ></td>
                        <td>&nbsp;</td>
                      </tr>
                      
                      
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                                      <?php
						$query_medida = "SELECT * FROM hac_unidad_medida ORDER BY dscunimed ASC";
                        $result2 = $mysqli->query($query_medida);			  
										  
					    $unimed= $row["UNIMED"];
                          
				?>
		
					    <td>U.Medida</td>
                        <td><select id="unimed" name="unimed" class="cajaGrande"   disabled="disabled" onFocus="siguienteCampo ='comboestatus';" onChange="calcular_precio001()">
                            <?php 

				        	 while ($fila2 = $result2->fetch_assoc()) { 
					          if ( $unimed ==  $fila2["simunimed"]) { ?>
                            <option value="<?php echo  $fila2["simunimed"]?>" selected="selected"><?php echo  $fila2["dscunimed"]?></option>
                            <?php } else { ?>
                            <option value="<?php echo  $fila2["simunimed"]?>"><?php echo  $fila2["dscunimed"]?></option>
                            <?php } ;
								} ?>
                        </select></td>
                        <td>&nbsp;</td>
                        <td><div align="left">Existencia</div></td>
                        <td><input id="Aexiact" name="Aexiact" readonly  autocomplete="off"   type="text" class="cajaGrande" style='text-align:right;' maxlength="14"  align="right" value="<?php echo number_format($row["EXIACT"],2,".",",")?>" onFocus="siguienteCampo ='Acosart';"></td>
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
								
										   <?php
					        $cdgtipart= $row["CDGTIPART"];
                                $query_tipo_codigo = "SELECT * FROM hac_tipo_articulo ORDER BY dsctipart DESC";
                                $result2 = $mysqli->query($query_tipo_codigo);
					  ?>
					  
                        <td>Tipo Articulo</td>
                        <td><select id="cdgtipart" name="cdgtipart" class="cajaGrande"  disabled="disabled" onFocus="siguienteCampo ='comboestatus';" onChange="calcular_precio001()">
                            <?php
					 while ($fila2 = $result2->fetch_assoc()) { 
					          if ($cdgtipart ==  $fila2["cdgtipart"]) { ?>
                            <option value="<?php echo  $fila2["cdgtipart"]?>" selected="selected"><?php echo  $fila2["dsctipart"]?></option>
                            <?php } else { ?>
                            <option value="<?php echo  $fila2["cdgtipart"]?>"><?php echo  $fila2["dsctipart"]?></option>
                            <?php } ;
								} ?>
                        </select></td>
                        <td>&nbsp;</td>
                        <td><div align="left">Descuento en Factura </div></td>
                        <td><input id="Adesfac" name="Adesfac" type="text" class="cajaGrande" readonly  style='text-align:right;' align="right" maxlength="14" value="<?php echo  $row["DESFAC"]?>"   onFocus=" siguienteCampo ='cdgpro';" ></td>
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Cabys</td>
                        										        <?php
								
	$cdghac=$row["cdghac"];
	$consulta = "SELECT * FROM codigoshacienda WHERE codigoHacienda='$cdghac'";;
	$resultado2=$mysqli->query($consulta);
	$row2 = $resultado2->fetch_assoc();


					  ?>
                        
                        <td> <input id="cdgcab" name="cdgcab" type="text"  readonly="" class="cajaMedia" maxlength="25" style='text-align:center;'  value="<?php echo $cdghac; ?>" autocomplete="off"  onFocus=" siguienteCampo ='Acosart';"  onChange="validarcabys()"     >
                        <img src="../img/Search_Male_User_Icon_32.png" alt="Buscar" width="25" height="27" title="Buscar proveedor"  onClick="abreVentanaCabys()" onMouseOver="style.cursor=cursor"></td>
                        <td colspan="3"><input id="dscprohac"  name="dscprohac" type="text" readonly=""  class="cajaGrande" maxlength="6" onFocus="siguienteCampo ='Familia';" value="<?php echo $row2["producto_servicio"]?>"></td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Proveedor </td>
                        <td><input id="cdgpro" name="cdgpro" type="text"   readonly=""  class="cajaMedia" maxlength="6" style='text-align:center;'  value="<?php echo $row["cdgpro"]?>" autocomplete="off"  onFocus=" siguienteCampo ='Acosart';"  onChange="validarproveedor()"     >
                            <img src="../img/Search_Male_User_Icon_32.png" alt="Buscar" width="25" height="27" title="Buscar proveedor"  onClick="abreVentana()" onMouseOver="style.cursor=cursor"></td>
                        <td colspan="3"><input id="dscpro" name="dscpro"  readonly="" type="text"   class="cajaGrande" maxlength="6" onFocus="siguienteCampo ='Familia';" ></td>
                        <td>&nbsp;</td>
                      </tr>
					  			        <?php
								
	$cdgfam=$row["CDGFAM"];
	$query = "SELECT cdgfam, dscfam FROM familias  ORDER BY dscfam";
	$resultado=$mysqli->query($query);
	
	$cdglin=$row["CDGLIN"];
	$query2 = "SELECT cdglin, dsclin FROM lineas WHERE cdgfam = $cdgfam AND cdglin = $cdglin ";
	$resultado2=$mysqli->query($query2);
	$row3 = $resultado2->fetch_assoc()

					  ?>
                                        <tr>
											<?php
	
	$actividades_comerciales="SELECT * FROM hac_actividades_comerciales ORDER BY cdgactpri ASC";
	$resultado6 = $mysqli->query($actividades_comerciales) 
	
	
	?>

                                          <td>&nbsp;</td>
                                          <td>&nbsp;</td>
                                          <td>Activ Comercial</td>
                                          <td colspan="2"><select id="cdgact" name="cdgact" class="comboGrande"  disabled="disabled"   >
	 <?php

					 while ($fila5 = $resultado6->fetch_assoc()) { 
					          if ($row["cdgact"] ==  $fila5["cdgact"]) { ?>
                          <option value="<?php echo  $fila5["cdgact"]?>" selected="cdgbod"><?php echo  $fila5["dscact"]?></option>
                          <?php } else { ?>
                          <option value="<?php echo  $fila5["cdgact"]?>"><?php echo  $fila5["dscact"]?></option>
                          <?php } ;
								} ?>
								

        </select></td>
                                          <td>Unid. Empaque</td>
                                          <td><input id="uniemp" name="uniemp" autocomplete="off" type="text" class="cajaGrande" maxlength="14" style='text-align:right;' value="<?php echo number_format( $row["uniemp"],2,".",",")?>"  onFocus=" siguienteCampo ='stockmax';" ></td>
                                          <td>&nbsp;</td>
                                        </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Familia</td>
                        <td colspan="2"><select name="Familia" id="Familia" disabled="disabled" class="comboGrande" >
                          <?php
							while($row2 = $resultado->fetch_assoc()) {
									if ($cdgfam ==  $row2["cdgfam"]) { ?>
                          <option value="<?php echo   $row2['cdgfam']?>" selected="selected"><?php echo  $row2['dscfam']?></option>
                          <?php } else { ?>
                          <option value="<?php echo  $row2['cdgfam']?>"><?php echo  $row2['dscfam']?></option>
                          <?php } ;
								} ?>
                        </select></td>
								   <?php
					     
                                $query_bodega = "SELECT * FROM bodegas ORDER BY dscbod ASC";
                                $result5 = $mysqli->query($query_bodega);
					  ?>
                        <td>Bodega</td>
                        <td><select id="cdgbod" name="cdgbod" class="cajaGrande"  disabled="disabled">
                          <?php
					 while ($fila5 = $result5->fetch_assoc()) { 
					          if ($cdgbod ==  $fila5["cdgbod"]) { ?>
                          <option value="<?php echo  $fila5["cdgbod"]?>" selected="cdgbod"><?php echo  $fila5["dscbod"]?></option>
                          <?php } else { ?>
                          <option value="<?php echo  $fila5["cdgbod"]?>"><?php echo  $fila5["dscbod"]?></option>
                          <?php } ;
								} ?>
                        </select></td>
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
                        <td height="23">&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Linea</td>
                        <td colspan="2"><select name="Linea" id="Linea" disabled="disabled" class="comboGrande">
                          <option value="<?php echo   $row3['cdglin']?>" selected="selected"><?php echo  $row3['dsclin']?></option>
                        </select></td>
                        <td>&nbsp;</td>
                      <td> <?php

						if($tipcanbas==1){?>
                        <input type="checkbox"  disabled="disabled" name="tipcanbas" checked value="1" id="tipcanbas" >
                          Canasta Básica
                          <?php  }else{  ?>
                          <input type="checkbox"  disabled="disabled"  name="tipcanbas"  value="1"  id="tipcanbas" >
                        Canasta Básica                          <?php  }  ?>
                        <td colspan="2"></td>
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
					  
		
					  
                        <td height="23">&nbsp;</td>
                        <td>&nbsp;</td>
           <td>Estante</td>
                        <td colspan="2"><input id="estante" name="estante"  autocomplete="off" type="text" class="cajaGrande" style='text-align:right;' maxlength="14"  align="right" value="<?php echo $estante ?>" onFocus="siguienteCampo ='Acosart';"></td>
                        <td>&nbsp;</td>
                        <td> <?php

						if($artpro==1){?>
                        <input type="checkbox" name="artpro" disabled="disabled" checked value="1" id="artpro" >
                          Promocional
                          <?php  }else{  ?>
                    <input type="checkbox" name="artpro" disabled="disabled"  value="1"  id="artpro" >
                          Promocional
                          <?php  }  ?></td>
                        <td colspan="2"></td>
                        <td width="1%">&nbsp;</td>
                      </tr>
					  <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Dcto Maximo</td>
                        <td><input id="desmax" name="desmax" autocomplete="off" type="text" class="cajaGrande" readonly maxlength="14" style='text-align:right;' value="<?php echo number_format( $row["desmax"],2,".",",")?>"  onFocus=" siguienteCampo ='desmin';" ></td>
                        <td><input id="pre002" name="pre002" autocomplete="off" type="hidden" class="cajaGrande"  maxlength="14" style='text-align:right;' value="<?php echo number_format( $row["PRE002"],2,".",",")?>"  readonly="" >
                        <input id="utiart2" name="utiart2" autocomplete="off" type="hidden" class="cajaGrande" readonly style='text-align:right;' maxlength="14" value="<?php echo number_format( $row["utiart2"],2,".",",")?>"  onChange="calcular_precio001()" onFocus=" siguienteCampo ='desmax';" >
                        <input id="utisug" name="utisug" autocomplete="off" type="hidden" class="cajaGrande"  readonly="" maxlength="14" style='text-align:right;' value="<?php echo number_format( $row["utisug"],2,".",",")?>"  onFocus=" siguienteCampo ='Aexiact';" ></td>
                        <td>Dcto Minimo </td>
                        <td><input id="desmin" name="desmin" autocomplete="off" type="text" class="cajaGrande"  readonly="" maxlength="14" style='text-align:right;' value="<?php echo number_format( $row["desmin"],2,".",",")?>"  onFocus=" siguienteCampo ='cdgpro';" ></td>
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Stock Maximo</td>
                        <td> <input id="stockmax" name="stockmax" autocomplete="off" type="text" class="cajaGrande" maxlength="14" style='text-align:right;' value="<?php echo number_format( $row["stockmax"],2,".",",")?>"  onFocus=" siguienteCampo ='stockmin';"  readonly></td>
                        <td>&nbsp;</td>
                        <td>Stock Minimo</td>
                        <td><input id="stockmin" name="stockmin" autocomplete="off" type="text" class="cajaGrande" maxlength="14" style='text-align:right;' value="<?php echo number_format( $row["stockmin"],2,".",",")?>"  onFocus=" siguienteCampo ='Aexiact';" readonly ></td>
                        <td>&nbsp;</td>
                      </tr>
										  <tr>
										    <td>&nbsp;</td>
										    <td>&nbsp;</td>
										    <td>Registro Sanitario </td>
										    <td><input id="regmedfarm" autocomplete="off" name="regmedfarm" readonly="" type="text" class="cajaMedia" maxlength="14" style='text-align:center;' value="<?php echo $regmedfarm ?>" onFocus=" siguienteCampo ='feclote';" ></td>
										    <td>&nbsp;</td>
										    <td>Formula Farmaceutica </td>
										    <td><select id="formafarm" name="formafarm" class="cajaGrande"   disabled="disabled"  onFocus="siguienteCampo ='comboestatus';" onChange="calcular_precio001()">
                                                <?php 
      	  
						
					
						$query_forfar = "SELECT * FROM hac_formulas_farmaceuticas  ORDER BY dscforfar ASC";
                        $result8 = $mysqli->query($query_forfar);			  
				
						$formafarm= $row["formafarm"];
   	
				        	 while ($fila8 = $result8->fetch_assoc()) { 
					          if ( $formafarm ==  $fila8["cdgforfar"]) { ?>
                                                <option value="<?php echo  $fila8["cdgforfar"]?>" selected="selected"><?php echo  $fila8["dscforfar"]?></option>
                                                <?php } else { ?>
                                                <option value="<?php echo  $fila8["cdgforfar"]?>"><?php echo  $fila8["dscforfar"]?></option>
                                                <?php } ;
								} ?>
                                            </select></td>
					  </tr>
										  <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Número de Lote </td>
                        <td> <input id="numlote" autocomplete="off" name="numlote" type="text" class="cajaMedia" maxlength="14" style='text-align:center;' value="<?php echo $numlot ?>" onFocus=" siguienteCampo ='feclote';" > </td>
                        <td>&nbsp;</td>
                        <td>Vencimiento de Lote </td>
                        <td><input id="feclote" name="feclote" type="text" class="cajaMedia"  autocomplete="off" style='text-align:center;'  value="<?php echo $feclote ?>" placeholder="Fecha" onChange="comprobar_fechas()"  onFocus=" siguienteCampo ='Acosart';" ></td>
                      </tr>  
                    </table>
				    <div id="botonBusqueda">
					  <div align="center"><img src="../img/Undo_48x48-32.png" width="48" height="48" onClick="cancelar()" border="0"  class="aCentro" onMouseOver="style.cursor=cursor" title=" Cancelar">
					    <input id="accion" name="accion" value="modificar" type="hidden">
					    <input id="id" name="id" value="" type="hidden">
					    <input id="cdgart" name="cdgart" value="<?php echo $cdgart ?>" type="hidden">
				      </div>
			        </div>
					 <input id="id" name="Zid" value="" type="hidden">
			        <div id="botonBusqueda">
					<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>
			  </form>
		  </div>
		  
		    <div    style="display:none; position:absolute; top:10%;  left:50%;  height:15%;  width:30%; background-color:white"   id="VentanaEmergente">
           
		  <p>
            <form id="formulario_emergente" name="formulario_emergente"  >
				
			     <table class="fuente8" width="98%" cellspacing=0 cellpadding=3 border=0>
					   <tr>
       <td colspan="27" align="center" >Codigo de Barras ya fue Registrado !!     Favor Verifique</td>
			       </tr>
					   <tr>
				
					   
					     <td  width="20%" align="center" >&nbsp;</td>
	<td  width="63%" align="center"  ><input  type="botton" value="OK" id="boton"   border="0" onClick= "ocultarVentana()"  style='text-align:center;' onMouseOver="style.cursor=cursor"  /></td>
					     <td  width="17%" align="center" >&nbsp;</td>
			       </tr>
					   <tr>
					     <td colspan="12" align="center" ><input type="image" value="Botón" id="boton2"   src="../img/Symbol-Error_128x128-32.png"  width="128" height="128" border="0" onClick= "ocultarVentana(),limpiar_codigo()"  onMouseOver="style.cursor=cursor"  /> </td>
                         
                        
			       </tr>

                        
		<input id="codfactura" name="codfactura" value=""  onkeypress="chequearEnter(event)" type="hidden">	
							
					</table>
		
						  </form>

</div>

   		<iframe id="frame_datos1" name="frame_datos1" width="0" height="0" frameborder="0">
					<ilayer width="0" height="0" id="frame_datos1" name="frame_datos1"></ilayer>
					</iframe>  
		  
		  
		  </div>
		</div>
	</body>
</html>

