<?php
 
session_start();
$com = "M";
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>
<?php


if (isset($_REQUEST['bot']) &&$_REQUEST['bot']==""){
	echo '<h2>!!! SELECCIONE UN REGISTRO !!!</h2>';
	echo '<meta content="1; url=cat_cuartos_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	if(!isset($_REQUEST['tap2'])){
		include('cat_cuartos_CL.php');
		$varible_clase = new clase();
		$res=$varible_clase->lista_busqueda($_REQUEST["bot"]);
		$reg=mysqli_fetch_array($res);
		if(!isset($_REQUEST['id_pro']))$_REQUEST['id_pro']="";
		if(!isset($reg['id_pro']))$reg['id_pro']="";
		$_REQUEST['id_pro']=$reg['id_pro'];
		$_REQUEST['tap2']=$reg['descripcion'];
		$_REQUEST['clavetp']=$reg['clavetp'];
		$_REQUEST['totalcuartos']=$reg['totalcuartos'];
		$_REQUEST['color']=$reg['color'];
		}
?>
<style type="text/css">
<!--
.Estilo4 {
	font-family: Arial, Helvetica, sans-serif;
	color: #FFFFFF;
	font-weight: bold;
}
.Estilo5 {font-size: 12px}
.Estilo18 {color: #FFFFFF}
.Estilo19 {font-size: 16px}
.Estilo20 {color: #FFFFFF; font-weight: bold; }

#width_wrapper{
width:480px;
margin:0 auto;
margin-top:20px;
margin-bottom:40px;
border:0px solid #000;
background-color:#fff;
background-image:url(img/white_grid.png);
padding:15px;
position:absolute; top:40px; left:350px;
}
#width_wrapper td.titulo{
background-image:url(img/fondotitulos.jpg);
color:#FFF;
font-weight:bold;
text-align:center;
font-size:18px;
font-family:helvetica;
}
#width_wrapper td{
background-color:#28345d;
color:#FFF;
text-align:left;
padding:5px 5px 5px 5px;
}
-->
</style>

<body onLoad = "self.focus (); document.frm1.clavetp.focus ()">
<div id="width_wrapper" align="center">
<form name="frm1" method="post" action="" enctype="multipart/form-data">
<input name="bot" type="hidden" value=" <?php
 echo $_REQUEST['bot'];?> "> 
  <table width="475" align="center">
    <tr>
      <td colspan="2" class="titulo">MODIFICAR  CUARTO </td>
    </tr>
    <tr>
      <th width="113">CODIGO</th>
      <td width="346"><span class="Estilo19">
        <input name="clavetp" type="text" id="clavetp" tabindex="1" size="15" value="<?php
 echo $_REQUEST['clavetp'];?>">
      </span></td>
    </tr>
      <tr>
        <th width="113">DESCRIPCION</th>
        <td width="346"><label>
        <input name="tap2" id="tap2" type="text" tabindex="2" value="<?php
 echo $_REQUEST['tap2'];?>"
		  onBlur="may(this)" size="50"
		 <?php
 
		if(isset($_REQUEST['bot'])){
		echo 'value="'.$reg['descripcion'].'"';
		}
		?>>
        </label></td>
      </tr>
      <tr>
        <th height="29">TOTAL DE CUARTOS</th>
        <td height="29"><input name="totalcuartos" type="text" id="totalcuartos"  tabindex="3" value="<?php
 echo $_REQUEST['totalcuartos'];?>" size="10"></td>
      </tr>
      
      <tr>
        <th height="29">COLOR</th>
        <td height="29"><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($_REQUEST['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>
        <td height="29" colspan="2" class="titulo">
          <div align="center">
        <input type="button" name="bot1" value="Modificar" tabindex="5" onClick="openpage('cat_cuartos_MC.php','_self')" class="original"/>
        <input type="button" name="bot4" value="Regresar" tabindex="6" onClick="openpage('cat_cuartos_PR.php','_self')" class="bot_WsW"/>
          </div></td>
      </tr>
    </table>
  </div>
</form>
</div>
 <?php
 
}
?>
<?php
 mysqli_close($con);?>
</body>
</html>