<?php
if (isset($_SESSION['usuario'])){
$user=$_SESSION['usuario'];
}
else{
?>
<script>
location.href="index.php?errorusuario=3";
</script>
<?php }

//CONSULTAS PARA EDITAR DESCUENTO
$id=$_GET['idDescuento'];
include("conexion.php");
$cons1="SELECT * FROM descuentos WHERE idDescuento='$id'";
$res1=mysql_query($cons1,$conex) or die ("No se realizó cons1");
$des=mysql_result($res1,0,'descripcion');
$cif=mysql_result($res1,0,'cifra');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>

<link href="ucaestilos.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><form action="editdescuento2.php" method="post" name="form1">
		  <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td><p class="style4">Editar descuento:</p>
                <hr align="left" width="600" size="1" color="#999999" />
                <p>&nbsp;</p>
                <table width="303" border="0" align="center" cellspacing="5">
                  <tr>
                    <td width="102" class="style1"><p class="style4">Descripci&oacute;n:</p></td>
                    <td width="310"><input name="descripcion" type="text" class="cuadrotexto" id="descripcion" value="<?php echo $des; ?>" size="40" maxlength="40" /></td>
                  </tr>
                  <tr>
                    <td class="style4">Porcentaje:</td>
                    <td><input name="cifra" type="text" class="cuadrotexto" id="cifra" onKeyPress="if (event.keyCode &lt; 45 || event.keyCode &gt; 57) event.returnValue = false;" value="<?php echo $cif; ?>" size="3" maxlength="3" />
                        <span class="style9">%
                          <input name="idDescuento" type="hidden" value="<?php echo $id; ?>" />
                      </span></td>
                  </tr>
                </table>
                <p class="style4"></p>
                <table width="158" border="0" align="center" cellspacing="10">
                  <tr>
                    <td width="60"><div align="right">
                        <input name="Reset" type="reset" class="boton2" value="Limpiar" />
                    </div></td>
                    <td width="197"><input name="Submit2" type="submit" class="boton2" value="Guardar" /></td>
                  </tr>
                </table>
              <p></p></td>
            </tr>
          </table>
		  </form></td>
  </tr>
</table>

</body>
</html>
