<?php
 
session_start();
$com = "E";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.php");
include("DF30000.inc");

if(!isset($_POST['bot'])){
	echo '<h2>!!! SELECCIONA UN REGISTRO... ACTUALIZANDO !!!</h2>';
	echo '<meta content="1; url=DG71300_PR.php"  HTTP-EQUIV="REFRESH">';
	exit();
}
if(!isset($_POST['tip_cli'])){
	include('DG71300_CL.php');
	$data['idTipNiv']=$_POST['bot'];
	$tipNiv = new TipNiv($data);
	$dt_tipniv=mysqli_fetch_array($tipNiv->busReg());
	$_REQUEST['tip_cli']=$dt_tipniv['id_tipcli'];
	$_REQUEST['num_niv']=$dt_tipniv['num_niv'];	
	$_REQUEST['por_com']=number_format($dt_tipniv['por_com'],2,'.',',');		
}

?>
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>


<body>
<?php
 
$ayuda = 'DP16000_AG.php';
include("DYAYUDA.php");
?>

<form name="frm1" id="frm1" method="post" action="">
<input type="hidden" name="bot" id="bot" value="<?php
echo $_POST['bot'];?>">
<table   align="center">
  <tr>
    <th colspan="4"><span class="Estilo2">ELIMINAR NIVEL </span></th>
  </tr>
  <tr>
    <td style="#FFFFFF">Tipo de Cliente: </td>
    <td style="#6699CC"><label>
      <select name="tip_cli" id="tip_cli" disabled="disabled">
        <?php

		require_once("DG71200_CL.php");
		$tipoCliente=new TipCli($data);
		$sq_tipcli=$tipoCliente->listaCompleta();
		if(!isset($_REQUEST['tip_cli'])){
			if(mysqli_num_rows($sq_tipcli)>0){
				$dt_tipcli=mysqli_fetch_array($sq_tipcli);
				mysqli_data_seek($sq_tipcli,0);
			}	
			$selTipCli=$dt_tipcli['id_tipcli'];
		}else{
			$selTipCli=$_REQUEST['tip_cli'];
		}
		while($dt_tipcli=mysqli_fetch_array($sq_tipcli)){
			if($selTipCli==$dt_tipcli['id_tipcli']) 
				echo "<option value=\"$dt_tipcli['id_tipcli']\" selected>$dt_tipcli['des_tipcli']</option>";
			else 
				echo "<option value=\"$dt_tipcli['id_tipcli']\">$dt_tipcli['des_tipcli']</option>";			
		}
		?>
      </select>
    </label></td>
    <td>Nivel:</td>
    <td style="#6699CC"><input name="num_niv" type="text" id="num_niv" size="5" tabindex="1" value="<?php
echo $_REQUEST['num_niv'];?>" readonly></td>
  </tr>
  <tr>
    <td style="#FFFFFF"><div align="left">%Comision:</div></td>
    <td colspan="3" style="#6699CC"><input name="por_com" type="text" id="por_com" size="20" tabindex="2" value="<?php
echo $_REQUEST['por_com'];?>" readonly></td>
  </tr>
  <tr>
    <td colspan="4"><div align="center" class="inputcodigo">
      <input type="button" name="Submit" value="Eliminar" onClick="openpage('DG71300_EC.php','_self')" tabindex="3"/>
      &nbsp;&nbsp;&nbsp;
      <input type="button" name="Submit2" value="Regresar" onClick="openpage('DG71300_PR.php','_self')" tabindex="4"/>
    </div></td>
  </tr>
</table>
</form>
</body>
</html>
