-
Notifications
You must be signed in to change notification settings - Fork 0
/
renew.html
194 lines (151 loc) · 6.37 KB
/
renew.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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@500&display=swap" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://unpkg.com/gijgo@1.9.13/js/gijgo.min.js" type="text/javascript"></script>
<link href="https://unpkg.com/gijgo@1.9.13/css/gijgo.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"
integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"
integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV"
crossorigin="anonymous"></script>
<style>
nav {
padding: 20px;
display: flex;
justify-content: space-between;
box-shadow: 3px 10px 17px -15px rgba(0, 0, 0, 0.48);
}
a,
a:hover {
color: black;
text-decoration: none;
}
.search {
margin: 50px 0px;
display: flex;
justify-content: center;
}
.search select {
margin: 0px 15px;
}
.table {
text-align: center;
}
</style>
</head>
<body>
<nav>
<a href="Home"><span style="font-size: 2em;line-height: 3;font-weight: bold;">Dashboard</span></a>
<img src="static/AASTL.png" style="width: 100px; height: 100px;">
<a href="#"><img src="static/setting2.png" style="width: 80px;height: 80px;"></a>
</nav>
<div class="search">
<form class="form-inline">
<input class="form-control mr-sm-2" type="ID" placeholder="ID" name="inputID" id="inputID">
<button class="btn btn-primary my-2 my-sm-0" type="button" onclick="checkID()">Check</button>
</form>
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead class="thead-dark">
<tr>
<th scope="col">ID</th>
<th scope="col">Name</th>
<th scope="col">Membership Type</th>
<th scope="col">Gender</th>
<th scope="col">Period</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
</div>
<div style="display: flex; justify-content: center;">
<form class="form">
<div class="form-group row">
<div class="form-group col-6">
<select class="form-control" id="inputDuration">
<option selected value="0">Renew Type...</option>
<option value="1">Semesterly</option>
<option value="2">Monthly</option>
<option value="3">Daily</option>
</select>
</div>
<div class="form-group col-6">
<select class="form-control" id="inputPeriod">
<option selected value="0">Period...</option>
<option value="1">8:30 am</option>
<option value="2">10:30 am</option>
<option value="3">12:30 pm</option>
<option value="4">3:30 pm</option>
<option value="5">5:30 pm</option>
</select>
</div>
</div>
<div class="form-roup row">
<div class="form-group col-12">
<label>Start date</label>
<input class="StartDate" id="inputStartDate" name="inputStartDate" data-date-format="mm/dd/yyyy"
placeholder="mm/dd/yyyy">
</div>
</div>
<div class="form-group row" style="display: flex;justify-content: center;margin-top: 20px;">
<button class="btn btn-success col-6" type="button" onclick="renewMembership()">Renew</button>
</div>
</form>
</div>
<script type="text/javascript">
$('.StartDate').datepicker({
format: 'mm/dd/yyyy',
startDate: '-3d',
disableDaysOfWeek: [5]
});
var dict = [
{
ID: "17108644",
Name: "Tarek",
Membership_type: "Monthly",
Gender: "Male",
Period: "8:30 am",
Status: "Active"
}
];
function checkID() {
var ID = document.getElementById('inputID').value;
for (let i = 0; i < dict.length; i++) {
var record = dict[i];
var table = document.getElementById('tbody');
if (table.childNodes.length != 0)
table.removeChild(table.childNodes[0]);
if (record["ID"] == ID) {
tr = document.createElement('tr');
var Status_color;
if (record["Status"] == "Not Active")
Status_color = "rgb(180,0,0);";
else
Status_color = "rgb(0,100,0);"
tr.innerHTML =
"<th scope='row'>" + record['ID'] +
"</th><td>" + record['Name'] +
"</td><td>" + record['Membership_type'] +
"</td><td>" + record['Gender'] +
"</td><td>" + record['Period'] +
"</td><td> <p style='color:" + Status_color + " font-weight: bold;'>" + record['Status'] + "</p> </td>"
table.appendChild(tr);
break;
}
}
}
function renewMembership() {
type = document.getElementById('inputDuration').value;
period = document.getElementById('inputPeriod').value;
startDate = ($('#inputStartDate').datepicker().value());
}
</script>
</body>