<?php
 
session_start();
$com = "A";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.php");
require_once("DFJQUERY.inc");
?>
<html>
<link rel="stylesheet" href="ALM_CSS.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<style type="text/css">
<!--
.Estilo19 {font-size: 16px}
.Estilo23 {font-size: 11px; font-weight: bold; }
-->
</style>

<body>
<div style="position:absolute; top:20px; left:100px"><img src="img/logo2.png"/></div>  

<form name="frm1" method="post" action="" enctype="multipart/form-data">
  <p>&nbsp;</p>
  <div id="width_wrapper" align="center">	
  <table width="475" border="0" align="center" bordercolor="#FFCC00" bordercolordark="#FFCC00">
    <tr>
      <td colspan="4" class="titulo">AGREGAR AGRUPADOR </td>
    </tr>
    <tr>
      <th width="79" style="#FFCC00"><div align="left"><span class="Estilo23">CODIGO</span></div></th>
      <td width="382"><span class="Estilo19">
      <input name="codigo" type="text" id="codigo" tabindex="15"
	  onBlur="may(this)"
	  		<?php

				if(isset($_REQUEST['codigo'])){ //este es el truco
					echo 'value="' . $_REQUEST['codigo'] .  '"';
				}
			?>/>
      </span> </td>
    </tr>
  
      <tr>
        <th width="79" style="#FFCC00"><div align="left"><span class="Estilo23">DESCRIPCION</span></div></th>
        <td width="382"><input name="tap2" id="tap2" type="text" tabindex="2"
		  onBlur="may(this)" size="50"
		<?php

			if(isset($_REQUEST['tap2'])){ 
				echo 'value="' . $_REQUEST['tap2'] .  '"';
			}
		?>></td>
      </tr>
      <tr>
        <th style="#FFCC00"><div align="left"><span class="Estilo23">ALMACEN</span></div></th>
        <td><select name="descripcion" id="descripcion" onChange="javascript: document.getElementById('frm1').submit()" tabindex="9">
          <option value="">-----SELECCIONE-----</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM falmacen WHERE t1 = 'ACTIVO'");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['descripcion']==$reg['nparte1'] ){
		echo '<option value="' . $reg['nparte1'] . '" selected>' . $reg['np_desc1'] . '</option>';
	}else{
		echo '<option value="' . $reg['nparte1'] . '">' . $reg['np_desc1'] . '</option>';
	}
} 
?>
        </select></td>
      </tr>
      <tr>
        <th style="#FFCC00"><div align="left"><span class="Estilo23">STATUS</span></div></th>
        <td><select name="select" tabindex="18">
          <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 colspan="2" class="titulo">
          <div align="center">
            <input name="Submit22" type="Button" class="original" onClick="cargapag('AL10400_AC.php','_self')" value="Guardar">
            <input name="Submit2" type="Button" class="bot_WsW" onClick="envia1('AL10400_PR.php','_self')" value="Regresar">
          </div>       </td>
      </tr>
    </table>
  </div>
</form>
</body>
</html>
<?php
 mysqli_close($con);?>
