<?php
 
session_start();
$com = "A";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.php");
require_once("DFJQUERY.inc");
?>
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>

<script language="javascript">
function ocultaMuestra(divVent){
	if(divVent.style.display=='none'){
		divVent.style.display='';

	}else{
		divVent.style.display='none';

	}
}	
	</script>
<script language="javascript">
function openWindow(dataGen,valores){
	var objDate=new Date();
	var getVars,getVarsAux,distPage;
	var idVentana;
	for(getVarsAux in valores){
		getVars +='&'+getVarsAux+'='+valores['getVarsAux'];
	}
	if(typeof dataGen.width=='undefined') dataGen.width='800';
	if(typeof dataGen.height=='undefined') dataGen.height='600';
	distPage='?tmr='+objDate.getHours()+objDate.getMinutes()+objDate.getSeconds()+objDate.getDay()+objDate.getMonth()+objDate.getFullYear();
	idVentana=window.open(dataGen.action+distPage+getVars,dataGen.name,'width='+dataGen.width+',height='+dataGen.height+',top=100,left=50,scrollbars=yes,menubar=yes,status=yes');
	return idVentana;
}
</script>	
<body>

<form name="frm1" method="post" action="" enctype="multipart/form-data">
  <table width="605"  align="center">
    <tr>
      <th colspan="2">AGREGAR ARTICULO </th>
    </tr>
    <tr>
      <td width="93">DESCRIPCION.      </td>
      <td width="496"><input name="tap2" id="tap2" type="text" tabindex="1"
		  onBlur="may(this)" size="40"
		<?php

			if(isset($_REQUEST['tap2'])){ 
				echo 'value="' . $_REQUEST['tap2'] .  '"';
			}
		?>></td>
    </tr>
  </table>
  <div id="divVent" style="display:">
    <table width="769"  align="center"  >
      
      <tr>
        <td>FACTOR DE RENDIMIENTO. </td>
        <td><input name="calle" type="text" id="calle" tabindex="2"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['calle'])){ //este es el truco
					echo 'value="' . $_POST['calle'] .  '"';
				}
			?>/></td>
        <td colspan="2">CAPACIDAD.</td>
        <td colspan="2"><input name="t6" type="text" id="t6" tabindex="3"
	  onBlur="may(this)" size="5"
	  		<?php

				if(isset($_POST['t6'])){ //este es el truco
					echo 'value="' . $_POST['t6'] .  '"';
				}
			?>/>
          <span class="Estilo18">
          <select name="t10" id="t10" onChange="javascript: document.getElementById('frm1').submit()" tabindex="6">
            <option value="">-SEL-</option>
            <?php
 
$sql = mysqli_query($con ,"SELECT * FROM dgmedida");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['t10']==$reg['codigo'] ){
		echo '<option value="' . $reg['codigo'] . '" selected>' . $reg['codigo'] . '</option>';
	}else{
		echo '<option value="' . $reg['codigo'] . '">' . $reg['codigo'] . '</option>';
	}
}
?>
          </select>
        </span></td>
        <td><label>MARCA:
        </label></td>
        <td colspan="3"><span class="Estilo18">
          <select name="marca" id="marca" onChange="javascript: document.getElementById('frm1').submit()" tabindex="6">
            <option value="">---SELECCIONE---</option>
            <?php
 
$sql = mysqli_query($con ,"SELECT * FROM comar WHERE descripcion = 'ACTIVO'");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['marca']==$reg['np_desc1'] ){
		echo '<option value="' . $reg['np_desc1'] . '" selected>' . $reg['np_desc1'] . '</option>';
	}else{
		echo '<option value="' . $reg['np_desc1'] . '">' . $reg['np_desc1'] . '</option>';
	}
}
?>
          </select>
        </span></td>
      </tr>
      <tr>
        <td width="89" height="29">FACTOR DE CORRECCION. </td>
		<td><span class="Estilo18">
		  <input name="colonia" type="text" id="colonia" tabindex="5"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['colonia'])){ //este es el truco
					echo 'value="' . $_POST['colonia'] .  '"';
				}
			?>/>
		</span></td>
        <td colspan="2">UNIDAD DE MEDIDA</td>
        <td colspan="2"><span class="Estilo18">
        <select name="pais" id="pais" onChange="javascript: document.getElementById('frm1').submit()" tabindex="6">
          <option value="">---SELECCIONE---</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM dgmedida");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['pais']==$reg['np_desc1'] ){
		echo '<option value="' . $reg['np_desc1'] . '" selected>' . $reg['np_desc1'] . '</option>';
	}else{
		echo '<option value="' . $reg['np_desc1'] . '">' . $reg['np_desc1'] . '</option>';
	}
}
?>
        </select>
      </span></td>
      <td colspan="2"><div align="center">LOCALIZACION:</div></td>
      <td colspan="2"><div align="center">STOKS.
      </div>
        <label></label>      </td>
      </tr>
    <tr>
      <td height="29">DIAS DE ALMACEN. </td>
      <td><label>
        <input name="postal" type="text" id="postal" tabindex="7"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['postal'])){ //este es el truco
					echo 'value="' . $_POST['postal'] .  '"';
				}
			?>/>
      </label></td>
      <td colspan="2">DESCRIPCION DE COMPRA. </td>
      <td colspan="2"><span class="Estilo18">
        <label></label>
        <input name="delegacion" type="text" id="delegacion" tabindex="8"
	  onBlur="may(this)" size="25"
	  		<?php

				if(isset($_POST['tmun'])){ //este es el truco
					echo 'value="' . $_POST['tmun'] .  '"';
				}
			?>/>
      </span></td>
      <td>SECCION.</td>
      <td><input name="seccion" type="text" id="seccion" tabindex="20"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['seccion'])){ //este es el truco
					echo 'value="' . $_POST['seccion'] .  '"';
				}
			?>/></td>
      <td><div align="center">MAX</div>        <label></label></td>
      <td><input name="max" type="text" id="max" tabindex="23"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['max'])){ //este es el truco
					echo 'value="' . $_POST['max'] .  '"';
				}
			?>/></td>
    </tr>
    <tr>
      <td height="29">IMPUESTO ['IVA'] %. </td>
      <td><label>
        <input name="web" type="text" id="web" tabindex="9"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['web'])){ //este es el truco
					echo 'value="' . $_POST['web'] .  '"';
				}
			?>/>
      </label></td>
      <td colspan="2"><div align="right">AGRUPADOR.</div></td>
      <td colspan="2"><label><span class="Estilo18">
      <input name="t7" type="text" id="t7" style="font-size:10px" size="30" readonly="" value="<?php
 echo $_GET['pas']; ?>"/>
      </span></label></td>
      <td>ANAQUEL.</td>
      <td><input name="anaquel" type="text" id="anaquel" tabindex="21"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['anaquel'])){ //este es el truco
					echo 'value="' . $_POST['anaquel'] .  '"';
				}
			?>/></td>
      <td><div align="center">MIN</div></td>
      <td colspan="2"><input name="min" type="text" id="min" tabindex="24"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['min'])){ //este es el truco
					echo 'value="' . $_POST['min'] .  '"';
				}
			?>/></td>
      </tr>
    <tr>
      <td height="29">TEMPERATURA.</td>
      <td><label>
        <input name="curp" type="text" id="curp" tabindex="11"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['curp'])){ //este es el truco
					echo 'value="' . $_POST['curp'] .  '"';
				}
			?>/>
      </label></td>
      <td colspan="2"><div align="right">ALMACEN.</div></td>
      <td colspan="2"><label>
      <input name="t8" type="text" id="t8" style="font-size:10px" size="30" readonly="" value="<?php

	  $bus=mysqli_fetch_array(mysqli_query($con ,"select descripcion from fagrupadores where np_desc1='".$_GET['pas']."'"));
	   echo $bus['descripcion']; ?>"/>
      </label></td>
      <td width="54">CUBO.</td>
      <td width="65"><label>
        <input name="cubo" type="text" id="cubo" tabindex="22"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['cubo'])){ //este es el truco
					echo 'value="' . $_POST['cubo'] .  '"';
				}
			?>/>
      </label></td>
      <td width="43">&nbsp;</td>
      <td width="68" colspan="2"><label></label></td>
      </tr>
    
    <tr>
      <td height="29" colspan="6"><label></label>        <label>
        <div align="center">VALORES NUTRICIONALES X CADA 100 </div>
      </label></td>
      <td><label>STATUS.</label></td>
      <td colspan="4"><select name="select" tabindex="25">
        <option value="ACTIVO"<?php
if($_REQUEST['select']=="ACTIVO") echo 'selected';?>>ACTIVO</option>
        <option value="INACTIVO"<?php
if($_REQUEST['select']=="INACTIVO") echo 'selected';?>>INACTIVO</option>
      </select></td>
      </tr>
    <tr>
      <td height="29">PROTEINAS.</td>
      <td width="69"><label>
        <input name="proveedor" type="text" id="proveedor" tabindex="13"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['proveedor'])){ //este es el truco
					echo 'value="' . $_POST['proveedor'] .  '"';
				}
			?>/>
      </label></td>
      <td width="60">KCALORIAS.</td>
      <td width="68"><input name="t1" type="text" id="t1" tabindex="16"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['t1'])){ //este es el truco
					echo 'value="' . $_POST['t1'] .  '"';
				}
			?>/></td>
      <td width="50"><label>POTASIO.</label></td>
      <td width="139"><input name="t2" type="text" id="t2" tabindex="19"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['t2'])){ //este es el truco
					echo 'value="' . $_POST['t2'] .  '"';
				}
			?>/></td>
      <td colspan="2">ULTIMO COSTO $. </td>
      <td colspan="3"><input name="t3" type="text" id="t3" tabindex="26"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['t3'])){ //este es el truco
					echo 'value="' . $_POST['t3'] .  '"';
				}
			?>/></td>
      </tr>
    <tr>
      <td height="29">LIPIDOS</td>
      <td><input name="numero" type="text" id="numero" tabindex="14"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['numero'])){ //este es el truco
					echo 'value="' . $_POST['numero'] .  '"';
				}
			?>/></td>
      <td>CALCIO.</td>
      <td><input name="dias" type="text" id="dias" tabindex="17"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['dias'])){ //este es el truco
					echo 'value="' . $_POST['dias'] .  '"';
				}
			?>/></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2">COSTO PROMEDIO. </td>
      <td colspan="4"><label>
        <input name="cos_prom" type="text" id="cos_prom" tabindex="27" disabled="disabled"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['cos_prom'])){ //este es el truco
					echo 'value="' . $_POST['cos_prom'] .  '"';
				}
			?>/>
      </label></td>
      </tr>
    <tr>
      <td height="22">CARBOHIDRATOS.</td>
      <td height="22"><input name="contacto" type="text" id="contacto" tabindex="15"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['contacto'])){ //este es el truco
					echo 'value="' . $_POST['contacto'] .  '"';
				}
			?>/></td>
      <td height="22">SODIO.</td>
      <td height="22"><input name="rfc" type="text" id="rfc" tabindex="18"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['rfc'])){ //este es el truco
					echo 'value="' . $_POST['rfc'] .  '"';
				}
			?>/></td>
      <td height="22" colspan="2"><label></label></td>
      <td height="22" colspan="2">EXISTENCIAS.</td>
      <td height="22" colspan="2"><label>
        <input name="t5" type="text" id="t5" tabindex="28" disabled="disabled"
	  onBlur="may(this)" size="10"
	  		<?php

				if(isset($_POST['t5'])){ //este es el truco
					echo 'value="' . $_POST['t5'] .  '"';
				}
			?>/>
      </label></td>
    </tr>
    
    <tr>
      <td height="46" colspan="10"><label></label>
        <label></label>        <label>
        <div align="center">
          <input name="Submit22" type="Button" onClick="cargapag('CO20001_AC.php','_self')" value="Guardar" tabindex="29">
        </div>
        </label></td>
      </tr>
    </table>
  </div>
</form>
</body>
</html>
<?php
 mysqli_close($con);?>
