-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeslim.php
82 lines (77 loc) · 2.99 KB
/
geslim.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
include "../sec.php";
foreach($_POST as $k => $v)
$$k=$v;
if($cambiar>0)
{
for($i=0;$i<count($lim1);$i++)
{
mysql_query("update comision set limite1='$lim1[$i]',limite2='$lim2[$i]',descuento1='$desc1[$i]',descuento2='$desc2[$i]',descuento3='$desc3[$i]' where idnivel='$id[$i]' and tipo='VENTALIBRE'");
}
//$idsms=posturl(array("a"=>"nivel","lim1"=>$lim1,"lim2"=>$lim2,"desc1"=>$desc1,"id"=>$id,"canal"=>"VENTALIBRE"),$XXurl_erp4);
}
$qry1="select * from comision where tipo='VENTALIBRE'";
//echo $qry1;
$res1 = MYSQL_QUERY($qry1) or die("2--".mysql_error());
while($r1=mysql_fetch_row($res1)) {
$tbl.="<tr><td>$r1[0]</td><td>$r1[1]</td><td>$r1[2]</td><td>$r1[3]%</td><td>$r1[4]%</td><td>$r1[5]%</td><td><input type='checkbox' class='chksel'/></td></tr>";
$tbl.="<tr class='htr'><td><input name='id[]' type='hidden' value='$r1[0]'/> $r1[0]</td><td><input name='lim1[]' type='text' value='$r1[1]'/></td><td><input name='lim2[]' type='text' value='$r1[2]'/></td><td><input name='desc1[]' type='text' value='$r1[3]'/></td><td><input name='desc2[]' type='text' value='$r1[4]'/></td><td><input name='desc3[]' type='text' value='$r1[5]'/></td><td><input type='checkbox' class='chknosel' checked='checked'/></td></tr>";
}
?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/dataTables.bootstrap.css" rel="stylesheet">
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.dataTables.js"></script>
<script src="../js/dataTables.bootstrap.js"></script>
<link href="../font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="../css/sb-admin.css" rel="stylesheet">
<title>Gestion de Comisiones</title>
<style type="text/css">
.htr {
display: none;
}
input[type=text]{
width: 70px;
}
</style>
<script src="../js/jquery-1.10.2.js"></script>
<script type="text/javascript">
$(function(){
$("tbody .chksel, tbody .chknosel").click(function(e){
e.preventDefault()
var jo_tr1 = $(this.parentNode.parentNode), jo_tr2;
if($(this).hasClass("chksel"))
jo_tr2 = jo_tr1.next();
else
jo_tr2 = jo_tr1.prev();
jo_tr1.addClass("htr");
jo_tr2.removeClass("htr");
})
})
</script>
</head>
<body>
<div class="container">
<h2>Gestion de Niveles(COMISIONES)</h2>
<form method='POST' action='geslim.php'>
<div class="panel panel-success">
<div class="panel-heading">Gestion de Comisiones</div>
<div class="panel-body">
<table class="table">
<thead>
<th>Nivel</th><th>Limite Inf.</th><th>Limite Sup.</th><th>Com. Regulares</th><th>Com. Saludables</th><th>Com. Especial</th><th>Editar</th>
</thead>
<?php echo $tbl; ?>
</table>
</div></div>
<input type="hidden" value="1" name="cambiar">
<input type="submit" value="Actualizar">
</form>
</div>
</body>
</html>