-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoupons1.html
452 lines (381 loc) · 15.1 KB
/
coupons1.html
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
<!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, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>SB Admin - Blank Page</title>
<!-- Custom fonts for this template-->
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<!-- Page level plugin CSS-->
<link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">
<!-- Custom styles for this template-->
<link href="css/sb-admin.css" rel="stylesheet">
<link href="css/addcoupon.css" rel="stylesheet">
</head>
<body id="page-top">
<nav class="navbar navbar-expand navbar-dark bg-dark static-top">
<a class="navbar-brand mr-1" href="index.html">Coupon Campaign</a>
<button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#">
<i class="fas fa-bars"></i>
</button>
<!-- Navbar Search -->
<form class="d-none d-md-inline-block form-inline ml-auto mr-0 mr-md-3 my-2 my-md-0">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search for..." aria-label="Search" aria-describedby="basic-addon2">
<div class="input-group-append">
<button class="btn btn-primary" type="button">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</form>
<!-- Navbar -->
<ul class="navbar-nav ml-auto ml-md-0">
<li class="nav-item dropdown no-arrow mx-1">
<a class="nav-link dropdown-toggle" href="#" id="alertsDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-bell fa-fw"></i>
<span class="badge badge-danger">9+</span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="alertsDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
<li class="nav-item dropdown no-arrow mx-1">
<a class="nav-link dropdown-toggle" href="#" id="messagesDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-envelope fa-fw"></i>
<span class="badge badge-danger">7</span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="messagesDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
<li class="nav-item dropdown no-arrow">
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-user-circle fa-fw"></i>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown">
<a class="dropdown-item" href="#">Settings</a>
<a class="dropdown-item" href="#">Activity Log</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">Logout</a>
</div>
</li>
</ul>
</nav>
<div id="wrapper">
<!-- Sidebar -->
<ul class="sidebar navbar-nav">
<li class="nav-item">
<a class="nav-link" href="index.html">
<i class="fas fa-fw fa-tachometer-alt"></i>
<span>Dashboard</span>
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="pagesDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-fw fa-folder"></i>
<span>Pages</span>
</a>
<div class="dropdown-menu" aria-labelledby="pagesDropdown">
<h6 class="dropdown-header">Login Screens:</h6>
<a class="dropdown-item" href="login.html">Login</a>
<a class="dropdown-item" href="register.html">Register</a>
<a class="dropdown-item" href="forgot-password.html">Forgot Password</a>
<div class="dropdown-divider"></div>
<h6 class="dropdown-header">Other Pages:</h6>
<a class="dropdown-item" href="404.html">404 Page</a>
<a class="dropdown-item active" href="blank.html">Blank Page</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="charts.html">
<i class="fas fa-fw fa-chart-area"></i>
<span>Charts</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="campaigns.html">
<i class="fas fa-fw fa-table"></i>
<span>Campaigns</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="coupons.html">
<i class="fas fa-fw fa-table"></i>
<span>Coupons</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="distributions.html">
<i class="fas fa-fw fa-table"></i>
<span>Distributions</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="customers.html">
<i class="fas fa-fw fa-table"></i>
<span>Customers</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="redeemcustomers.html">
<i class="fas fa-fw fa-table"></i>
<span>Reedem Customers</span></a>
</li>
</ul>
<div id="content-wrapper">
<div class="container-fluid">
<!-- Breadcrumbs-->
<!-- <ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index.html">Dashboard</a>
</li>
<li class="breadcrumb-item active">Blank Page</li>
</ol> -->
<!-- Page Content -->
<h1>Coupons</h1>
<hr>
<p>
<input type="button" class="btn btn-dark" value="Add Coupon">
</p>
<hr>
<!-- <div class="form-popup" id="myForm"> -->
<div class="container">
<div class="jumbotron">
<form action="/action_page.php">
<div>
<b>
<label for="cname" >Campaign Name</label>
</b>
<input type="text" id="cname" name="campaign name" placeholder="name of your campaign">
</div>
<div>
<b>
<label for="ccode">Coupon Code</label>
</b>
<input type="text" id="ccode" name="couponcode" placeholder="assign coupon code">
</div>
<div>
<b><label for="coupontype">Coupon Type</label></b>
<select id="coupontype" name="coupontype">
<option value="percentage">Percentage</option>
<option value="off type">Off type</option>
</select>
</div>
<div><b>
<label for="company">Company</label></b>
<input type="text" id="company" name="company" placeholder="company">
<div>
<b><label for="astatus">Active Status</label></b>
<input type="text" id="astatus" name="astatus" placeholder="yes or no">
</div>
<div><b>
<label for="sdate" >Start Date</label></b>
<input type="text" id="sdate" name="sdate" placeholder="start date">
</div>
<div>
<b>
<label for="edate">End Date</label></b>
<input type="text" id="edate" name="edate" placeholder="end date">
</div>
<div><b>
<label for="redeemstatus">Reedem Status</label></b>
<input type="text" id="redeemstatus" name="redeemstatus" placeholder="status">
</div>
<div><b>
<label for="redeemmount">Redeem Amount</label></b>
<input type="text" id="redeemmount" name="redeemmount" placeholder="amount">
</div>
<input type="submit" value="Submit">
</form>
</div>
</div>
<hr>
<!-- DataTables Example -->
<div class="card mb-3">
<div class="card-header">
<i class="fas fa-table"></i>
All Coupons</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Campaign Name</th>
<th>Coupon Code</th>
<th>Coupon type</th>
<th>Company</th>
<th>Active Status</th>
<th>Start date</th>
<th>Expiry date</th>
<th>Redeem Status</th>
<th>Redeem Amount</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Campaign Name</th>
<th>Coupon Code</th>
<th>Coupon type</th>
<th>Company</th>
<th>Active Status</th>
<th>Start date</th>
<th>Expiry date</th>
<th>Redeem Status</th>
<th>Redeem Amount</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Discounts</td>
<td>SWIGGYIT</td>
<td>%</td>
<td>xyz RESTAURANT</td>
<td>Yes</td>
<td>02-02-2019</td>
<td>04-05-2033</td>
<td>redeemed</td>
<td>100</td>
</tr>
<tr>
<td>Discounts</td>
<td>SWIGGYIT</td>
<td>%</td>
<td>xyz RESTAURANT</td>
<td>Yes</td>
<td>02-02-2019</td>
<td>04-05-2033</td>
<td>redeemed</td>
<td>100</td>
</tr>
<tr>
<td>Discounts</td>
<td>SWIGGYIT</td>
<td>%</td>
<td>xyz RESTAURANT</td>
<td>Yes</td>
<td>02-02-2019</td>
<td>04-05-2033</td>
<td>redeemed</td>
<td>100</td>
</tr>
<tr>
<td>Discounts</td>
<td>SWIGGYIT</td>
<td>%</td>
<td>xyz RESTAURANT</td>
<td>Yes</td>
<td>02-02-2019</td>
<td>04-05-2033</td>
<td>redeemed</td>
<td>100</td>
</tr>
<tr>
<td>Discounts</td>
<td>SWIGGYIT</td>
<td>%</td>
<td>xyz RESTAURANT</td>
<td>Yes</td>
<td>02-02-2019</td>
<td>04-05-2033</td>
<td>redeemed</td>
<td>100</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
</div>
<p class="small text-center text-muted my-5">
<em>More table examples coming soon...</em>
</p>
</div>
<!-- /.container-fluid -->
<!-- Sticky Footer -->
<footer class="sticky-footer">
<div class="container my-auto">
<div class="copyright text-center my-auto">
<span>Copyright © Your Website 2019</span>
</div>
</div>
</footer>
</div>
<!-- /.content-wrapper -->
</div>
<!-- /#wrapper -->
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
<i class="fas fa-angle-up"></i>
</a>
<!-- Logout Modal-->
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
<a class="btn btn-primary" href="login.html">Logout</a>
</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript-->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom scripts for all pages-->
<script src="js/sb-admin.min.js"></script>
<script>
var campaignId,quantity,customerId,startdate,enddate,status,amount;
async function addcoupon(){
campaignId=$("campaignId").val();
quantity=$("quantity").val();
customerId=$("customerId").val();
startdate=$("startdate").val();
enddate=$("enddate").val();
status=$("status").val();
amount=$("amount").val();
data = {
campaignId:campaignId,
quantity:quantity,
customerId:customerId,
startdate:startdate,
enddate:enddate,
status:status,
amount:amount
}
var params = {
type : 'post',
url: "localhost:3000/vouchers",
data: JSON.stringify(data),
contentType: 'application/json;charset=UTF-8',
dataType: 'json'
}
console.log(params.data);
let result;
try {
result = await $.ajax(params);
return result;
}
catch (error) {
if (error) {
console.log(error);
}
}
alert('success');
}
</script>
</body>
</html>