<?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>


  

<body onLoad = "self.focus (); document.frm1.clavetp.focus ()">
<div id="width_wrapper" align="center">
<form name="frm1" method="post" action="" enctype="multipart/form-data">
  <table width="475" align="center">
    <tr>   <td colspan="2" class="titulo">AGREGAR  CUARTO </td> </tr>
    <tr>
      <th width="114">CODIGO</th>
      <td width="345"><input name="clavetp" type="text" id="clavetp" tabindex="1"
	  onBlur="may(this)" size="20"
	  		<?php

				if(isset($_POST['clavetp'])){ //este es el truco
					echo 'value="' . $_POST['clavetp'] .  '"';
				}
			?>/></td>
    </tr>
      <tr>
        <th width="113">DESCRIPCION</th>
        <td width="346"><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>TOTAL DE CUARTOS</th>
        <td><input name="totalcuartos" type="text" id="totalcuartos" tabindex="3"
	  onBlur="may(this)" size="20"
	  		<?php

				if(isset($_POST['totalcuartos'])){ //este es el truco
					echo 'value="' . $_POST['totalcuartos'] .  '"';
				}
			?>/></td>
      </tr>
      <tr>
        <th>COLOR</th>
        <td><select name="color" id="color" onChange="javascript: document.getElementById('frm1').submit()" tabindex="4">
          <option value="">----------SELECCIONE----------</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM fcolor");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['color']==$reg['clave'] ){
		echo '<option value="' . $reg['clave'] . '" selected>' . $reg['descrip'] . '</option>';
	}else{
		echo '<option value="' . $reg['clave'] . '">' . $reg['descrip'] . '</option>';
	}
}
?>
        </select></td>
      </tr>
      <tr>
        <th>MAESTRA</th>
        <td><input name="MTA" type="checkbox" id="MTA" tabindex="24" value="MTA"<?php
if($_REQUEST['MTA']) echo 'checked';?>></td>
      </tr>
      <tr>
        <td colspan="2" class="titulo"><label>
          <div align="center">
        <input name="Submit22" type="Button" onClick="openpage('cat_cuartos_AC.php','_self')" tabindex="5" value="Guardar" class="original">
        <input type="Button" name="Submit2" value="Regresar" tabindex="6" onClick="envia1('cat_cuartos_PR.php','_self')" class="bot_WsW">
            </div>
        </label></td>
      </tr>
    </table>
</form>
</div>
</body>
</html>
<?php
 mysqli_close($con);?>