-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaddCoupon.php
117 lines (105 loc) · 5.28 KB
/
addCoupon.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- 引入样式,mdui -->
<link rel="stylesheet" href="https://unpkg.com/mdui@1.0.2/dist/css/mdui.min.css"/>
<script src="https://unpkg.com/mdui@1.0.2/dist/js/mdui.min.js"></script>
<!-- 这个页面css-->
<title>Store Admin| Coupon</title>
</head>
<body>
<?php include("include/sidebar.php");?>
<div class="content" style="mdui-drawer-body-left">
<!-- 主内容 -->
<h1 style="text-transform:capitalize;">Coupon Management/Add Coupon
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-blue-accent" onclick="<?php echo "location.href='".$_SERVER["HTTP_REFERER"]."'"?>">Return</button>
</h1>
<h2 style="font-style: italic;">Please enter Coupon information</h2>
<form action="addedCoupon.php" method="post" id="submit">
<div class="mdui-col-xs-3" style="font-weight: 400;">Coupon Name:</div>
<div class="mdui-col-xs-9">
<!-- required必填字段 -->
<div class="mdui-textfield">
<input class="mdui-textfield-input" type="text" placeholder="Food" id="couname" form="submit" name="couname"/>
</div>
</div>
<div class="mdui-col-xs-3">Coupon Category:</div>
<div class="mdui-col-xs-9">
<select class="mdui-select" name="cousele" form="submit">
<option value="0" selected>Discount</option>
<option value="1">Voucher</option>
<option value="2">Cash</option>
</select>
</div>
<div class="mdui-col-xs-3">Valid Time:</div>
<div class="mdui-col-xs-9">
<p><input type="datetime-local" id="time1" name="start" form="submit"> to <input type="datetime-local" id="time2" name="end" form="submit"></p>
</div>
<div class="mdui-col-xs-3">Coupon Value:</div>
<div class="mdui-col-xs-9">
<!-- required必填字段 -->
<div class="mdui-textfield">
<input type="text" placeholder="0" id="value" name="value" form="submit">
</div>
</div>
<div class="mdui-col-xs-3">Coupon Description:</div>
<div class="mdui-col-xs-9">
<div class="mdui-textfield">
<textarea class="textfield3" name="coudisc" placeholder="Description" cols="30" rows="3" id="coudesc" form="submit"></textarea>
</div>
</div>
<div class="purchasenumber" >
<div class="mdui-col-xs-3">Quantity</div>
<div class="number" >
<i class = "minus iconfont icon-jianhao" class="mdui-col-xs-3" style="margin: 10px 10px 10px 0px;"></i>
<input type="text" name="cousele" form="submit">
<i class = "plus iconfont icon-jiahao1"></i>
</div>
</div>
</form>
</div>
<div>
<button class="mdui-btn mdui-color-blue-accent mdui-ripple" form="submit" style="margin: 10px 10px 10px 10px;" id="myButton" onclick="saveText()" form="submit">Save</button>
<button class="mdui-btn mdui-ripple" id="cancelButton" onclick="cancel()">Cancle</button>
</div>
</div>
</div>
</body>
<!-- 这个页面的JS -->
<style>
.content{
margin-left: 25px
}
</style>
<script>
var text1 = "";
var text2 = "";
var text3 = "";
var text4 = "";
var text5 = "";
var numberInput = 1;
function saveText() {
// 将文本框的值保存到变量中
text1 = document.getElementById("couname").value;
text2 = document.getElementById("time1").value;
text3 = document.getElementById("time2").value;
text4 = document.getElementById("value").value;
text5 = document.getElementById("coudesc").value;
numberInput = document.querySelector('.number input').value;
// 提示用户保存成功
}
function cancel() {
// 将文本框的值重置为初始值
text1 = document.getElementById("couname").value = "";
text2 = document.getElementById("time1").value = "";
text3 = document.getElementById("time2").value = "";
text4 = document.getElementById("value").value = "";
text5 = document.getElementById("coudesc").value = "";
numberInput = document.querySelector('.number input').value = 1;
// 提示用户已还原到初始状态
}
</script>
</html>