<?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']="";

	
?>




<body onLoad = "self.focus (); document.frm1.tap2.focus ()">
<div id="width_wrapper" align="center">
<form name="frm1" method="post" action="" enctype="multipart/form-data">
  <p>
    <input name="bot" type="hidden" value=""> 
  </p>
 
  <table width="431" border="0" align="center">
    <tr>
      <td colspan="4" style="#FFFFFF" class="titulo"><span class="Estilo21">	AGREGAR  MERCADO</span> </td>
    </tr>
    <tr>
      <th width="85"  ><span class="Estilo20">CODIGO</span></th>
      <td width="330" colspan="3" style="#A15E8D"><span class="Estilo19">
        <input name="n_reg" type="text" id="n_reg" size="15" value="<?php
 echo $_REQUEST['n_reg'];?>">
      </span></td>
    </tr>
 
      <tr>
        <th width="85"  ><span class="Estilo20">DESCRIPCION</span></th>
        <td width="330" colspan="3" style="#A15E8D"><label>
        <input name="tap2" id="tap2" type="text" tabindex="1" value="<?php
 echo $_REQUEST['tap2'];?>"
		  onBlur="may(this)" size="50"
		 <?php
 
		if(isset($_REQUEST['bot'])){
		echo 'value="'.$reg['tdescrip'].'"';
		}
		?>>
        </label></td>
      </tr>
      
      
      <tr>
        <th height="29"  ><span class="Estilo20">OCUPACION</span></th>
        <td height="29" colspan="3" style="#A15E8D"><select name="select" tabindex="2">
          <option value="NETA"<?php
if($_REQUEST['select']=="NETA") echo 'selected';?>>NETA</option>
          <option value="BRUTA"<?php
if($_REQUEST['select']=="BRUTA") echo 'selected';?>>BRUTA</option>
        </select></td>
      </tr>
      
      <tr>
        <th height="22"  ><span class="Estilo20">COLOR</span></th>
        <td height="22" colspan="3" style="#A15E8D"><select name="color" id="color" type="hideen" onChange="javascript: document.getElementById('frm1').submit()" tabindex="6">
          <option>----SELECCIONE----</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM fcolor");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST[color	]==$reg['clave'] ){
		echo '<option style="background-color:'.$reg["clave"].';" value="' . $reg['clave'] . '" selected>' . $reg['descrip'] . '</option>';
	}else{
		echo '<option style="background-color:'.$reg["clave"].';" value="' . $reg['clave'] . '">' . $reg['descrip'] . '</option>';
	}
}
?>
        </select>        </td>
      </tr>
      <tr>
        <td height="29" colspan="4" class="titulo">
          <div align="center">
      <input name="bot1" type="button" class="original" tabindex="11" onClick="openpage('cat_mercados_AC.php','_self')" value="guardar"/>
      <input name="bot4" type="button" class="bot_WsW" tabindex="12" onClick="openpage('cat_mercados_PR.php','_self')" value="Regresar"/>
          </div></td>
      </tr>
    </table>
</form>
</div>

<?php
 mysqli_close($con);//188-->100?>
</body>
</html>
