-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
223 lines (200 loc) · 6.54 KB
/
admin.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="shortcut icon" href="icon.png" />
<title>Ali Diagnostics</title>
<script type="text/javascript" src="recep.js"></script>
<link rel="stylesheet" href="recep.css">
<style type="text/css">
#date_time
{
margin:15px;
color:Navy;
float:right;
}
#left
{
margin: 20px;
float:right;
padding: 20px;
}
#myBtn
{
float:right;
display:inline;
}
#noDisplay
{
display: none;
}
@import url("https://bootswatch.com/flatly/bootstrap.min.css");
body {
padding-top: 50px;
}
footer {
padding-left: 15px;
padding-right: 15px;
}
/*
* Off Canvas
* --------------------------------------------------
*/
@media screen and (max-width: 768px) {
.row-offcanvas {
position: relative;
-webkit-transition: all 0.25s ease-out;
-moz-transition: all 0.25s ease-out;
transition: all 0.25s ease-out;
background:#ecf0f1;
}
.row-offcanvas-left
.sidebar-offcanvas {
left: -40%;
}
.row-offcanvas-left.active {
left: 40%;
}
.sidebar-offcanvas {
position: absolute;
top: 0;
width: 40%;
margin-left: 12px;
}
}
#sidebar {
padding:15px;
margin-top:10px;
}
#about{
display: none;
}
#experience{
display: none;
}
</style>
</head>
<body>
<nav class="navbar navbar-light" style="background-color: #e3f2fd;">
<a class="navbar-brand" href="#">Ali Diagnostics Center</a>
<div id="date_time"></div>
<script type="text/javascript">window.onload = date_time('date_time');</script>
<div id="abc">
<img src="user.png" height=30px>
<b><?php
session_start();
$user = $_SESSION["user"];
echo $user;
?></b>
</div>
<button id="btn" type="button" class="btn btn-info" onclick="window.location.href = 'main.php';">Logout</button>
</nav>
<div class="container-fluid">
<div class="row row-offcanvas row-offcanvas-left">
<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar" role="navigation">
<div class="sidebar-nav">
<ul class="nav">
<li class="nav-item">
<a id = "abc1" class="nav-link js-scroll-trigger" href="#about">Add User</a>
</li>
<li class="nav-item">
<a id = "abc2" class="nav-link js-scroll-trigger" href="#experience">Check Account Detail</a>
</li>
</ul>
</div>
<!--/.well -->
</div>
<!--/span-->
<div class="col-xs-12 col-sm-9">
<section style="text-align:center;" class="resume-section p-3 p-lg-5 d-flex align-items-center" id="about">
<h3 >Create User</h3>
<br>
<form action="" >
<label>Name</label>
<input id = "name" type="text" name = "name"><br><br>
<label>Create Password</label>
<input id= "pass1" type="text" name = "pass"><br><br>
<label>User Types</label>
<select id = "user" name="user">
<option value="recp">Receptionist</option>
<option value="admin">Admin</option>
<option value="tech">Technician</option>
</select><br><br>
<button onclick="callAjax()"> Create User</button>
</form>
</section>
<section style= "text-align:center;"class="resume-section p-3 p-lg-5 d-flex align-items-center" id="experience">
<form action="" >
<label for="start">select date:</label>
<input type="date" id="start" name="trip-start"
value="2018-07-22"
min="2019-01-01" max="2020-12-31">
<br><br>
<button onclick="callAjax2()">Get Amount</button>
</form>
<h1 id= "amount" >waiting...</h1>
</section>
</div>
</div>
<script>
document.getElementById("abc1").addEventListener("click", myFunction);
document.getElementById("abc2").addEventListener("click", myFunction2);
function myFunction() {
var a = document.getElementById("experience");
a.style.display = "none";
var a = document.getElementById("about");
a.style.display = "block";
}
function myFunction2() {
var a = document.getElementById("experience");
a.style.display = "block";
var a = document.getElementById("about");
a.style.display = "none";
}
function callAjax(){
var name = document.getElementById("name").value;
var password = document.getElementById("pass1").value;
var user = document.getElementById("user").value;
// Returns successful data submission message when the entered information is stored in database.
var dataString = '&name1=' + name + '&password1=' + password + '&user1=' + user;
if (name == '' || password == '' || user == '') {
alert("Please Fill All Fields");
} else {
// AJAX code to submit form.
$.ajax({
type: "POST",
url: "ajaxjs.php",
data: dataString,
cache: false,
success: function(html) {
alert(html);
}
});
}
return false;
}
function callAjax2(){
var name = document.getElementById("start").value;
//Returns successful data submission message when the entered information is stored in database.
var dataString = '&name1=' + name ;
if (name == '' ) {
alert("Please select Date");
} else {
// AJAX code to submit form.
$.ajax({
type: "POST",
url: "ajaxjs2.php",
data: dataString,
cache: false,
success: function(html) {
document.getElementById("amount").innerHTML= html;
}
});
}
return false;
}
</script>
</body>