add.html
3.8 KB
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
83
84
85
86
87
88
89
90
91
92
93
<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="#A" data-toggle="tab">生成</a></li>
</ul>
<form class="form-horizontal margin-top-20" action="{:url('DiscountCoupon/add')}" method="post">
<div class="tabbable" style="float: left;">
<div class="tab-content">
<div class="tab-pane active" id="A">
<fieldset>
<div class="control-group">
<label class="control-label">优惠券名称</label>
<div class="controls">
<input class="form-control" type="text" name="discount_coupon_name" value="">
</div>
</div>
<div class="control-group">
<label class="control-label">满</label>
<div class="controls">
<input class="form-control" type="number" name="overflow" value="">
</div>
</div>
<div class="control-group">
<label class="control-label">减</label>
<div class="controls">
<input class="form-control" type="number" name="reduce" value="">
</div>
</div>
<div class="control-group">
<label class="control-label">截止日期</label>
<div class="controls">
<input type="text" name="deadline" class="form-control js-bootstrap-datetime" autocomplete="off">
</div>
</div>
</fieldset>
</div>
</div>
</div>
<div class="user_list" style="float: left; margin-left: 100px; width: 350px; height:500px; overflow: scroll; overflow-x:hidden">
<table class="table table-hover table-bordered table-list" id="TABLE">
<tr>
<th><input type="checkbox" id="All" onclick="checkAll()"></th>
<th><input class="form-control" style="width: 200px; display: unset" type="text" placeholder="关键词" id="Search" onchange="ajax()"> 搜索</th>
</tr>
<volist name="user" id="vo">
<tr>
<td><input type="checkbox" name="user_id[]" value="{$vo.id}"></td>
<td>{$vo.user_nickname}</td>
</tr>
</volist>
</table>
</div>
<div style="clear: both"> </div>
<div class="form-actions" style="clear: both">
<button class="btn btn-primary js-ajax-submit"type="submit">生成</button>
<a class="btn btn-default" href="javascript:history.back(-1);">返回</a>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script>
function ajax() {
$.ajax({
url:"{:url('DiscountCoupon/getUserList')}",
data:{
keywords:$("#Search").val()
},
type:"POST",
dataType:"JSON",
success:function (data) {
//alert(data.data);
$("#TABLE").html(data.data);
}
})
}
function checkAll() {
var input = $("#TABLE input[type='checkbox']");
var go = true;
if(input[0].checked === false) {
go = false;
}
for (var i = 1; i <= input.length; i++) {
input[i].checked = go;
}
}
</script>
</body>
</html>