<?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>
<script language="javascript">
function ocultaMuestra(divVent){
	if(divVent.style.display=='none'){
		divVent.style.display='';

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

	}
}	
	</script>
<body>
<DIV STYLE="position:absolute; top:-20px; left:100px">
<img src="img/sihteolsd.gif"/>
</DIV> 

<form name="frm1" method="post" action="" enctype="multipart/form-data">
  <p>&nbsp;</p>
  <table width="475"  align="center" bordercolor="#FFCC00" bordercolordark="#FFCC00">
    <tr>
      <th colspan="4">AGREGAR SUB-AGRUPADOR </th>
    </tr>
    <tr>
      <td width="77" style="#FFCC00"><span class="Estilo23">CODIGO</span></td>
      <td width="382" colspan="3"><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>
  </table>
  <div id="divVent" style="display:">
    <table width="475"  align="center" bordercolor="#FFCC00" bordercolordark="#FFCC00" >
      <tr>
        <td width="79" style="#FFCC00"><span class="Estilo23">DESCRIPCION</span></td>
        <td width="380"><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>
        <td style="#FFCC00"><span class="Estilo23">AGRUPADOR</span></td>
        <td><select name="almacen" id="almacen" onChange="javascript: document.getElementById('frm1').submit()" tabindex="9">
          <option value="">-----SELECCIONE-----</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM fagrupadores WHERE t1 = 'ACTIVO'");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['almacen']==$reg['n_reg'] ){
		echo '<option value="' . $reg['n_reg'] . '" selected>' . $reg['np_desc1'] . '</option>';
	}else{
		echo '<option value="' . $reg['n_reg'] . '">' . $reg['np_desc1'] . '</option>';
	}
}
?>
        </select></td>
      </tr>
      <tr>
        <td style="#FFCC00"><span class="Estilo23">ALMACEN</span></td>
        <td><label>
          <input name="seccion" type="text" id="seccion" onBlur="may(this)" size="30" READONLY
		<?php

			if(isset($_POST['seccion'])){ 
	@$resultado2=mysqli_query($con ,"select * from fagrupadores where n_reg=$_POST['almacen']");
	while(@$registro2=mysqli_fetch_array(@$resultado2)){
		echo 'value="' . $registro2['descripcion'] . '"';
	}
}
			
		?>>
        </label></td>
      </tr>
      <tr>
        <td style="#FFCC00"><span class="Estilo23">STATUS</span></td>
        <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"><label>
          <div align="center">
            <input name="Submit22" type="Button" class="original" onClick="openpage('AL20000_AC.php','_self')" value="Guardar">
            <input name="Submit2" type="Button" class="bot_WsW" onClick="envia1('AL20000_PR.php','_self')" value="Regresar">
            </div>
        </label></td>
      </tr>
    </table>
  </div>
</form>
</body>
</html>
<?php
 mysqli_close($con);?>
