Repository navigation
Expand file tree
/
Copy pathdoctor_signup.html
More file actions
164 lines (134 loc) · 6.94 KB
/
Copy pathdoctor_signup.html
File metadata and controls
164 lines (134 loc) · 6.94 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>BHealthy</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="BHealthy demo project">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="styles/bootstrap4/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="styles/sign_up.css">
<link rel="stylesheet" type="text/css" href="plugins/font-awesome-4.7.0/css/font-awesome.min.css">
</head>
<body>
<script>
function signup() {
// import jwt_decode from 'jwt-decode';
const backendurl = "http://localhost:8181/";
const username = document.getElementById("username").value;
const email = document.getElementById("email").value;
const password = document.getElementById("password").value;
// const confirmpassword = document.getElementById("confirm-password").value;
// const degree = document.getElementById("degree").value;
// const gender = document.getElementById("gender").value;
// const department = document.getElementById("department").value;
// const visitinghour = document.getElementById("visiting-hour").value;
// const location = document.getElementById("location").value;
// const number_of_patients = document.getElementById("number-of-patients").value;
// const fees = document.getElementById("fees").value;
// const contact_number = document.getElementById("contact-number").value;
var myurl = backendurl + "api/auth/signup";
var $load = $("#loadMe").modal({
backdrop: "static", //remove ability to close modal with click
keyboard: false, //remove option to close with keyboard
show: true //Display loader!
});
var xhr = new XMLHttpRequest();
var data;
xhr.open("POST", myurl, true);
xhr.setRequestHeader("Content-Type", "application/json");
data = JSON.stringify({ "username": username,
"password": password,
"role" : DOCTOR });
var response = xhr.response;
xhr.onload = function () {
if (this.status == 200) {
// Here we go on the new page
var jsonResponse = JSON.parse(response);
$("#loadMe").modal("hide");
window.location.replace("home.html");
}
else {
$('#loadMe').hide();
alert("Wrong Phone Number or Password");
}
};
xhr.send(data);
}
</script>
<div class="container">
<div class="title">Create an account</div>
<div class="row row-lg-eq-height">
<div class="col-lg-8">
<div class="sub_container">
<div class="form">
<label class="label">username :</label>
<input type="text" class="input" id="user-name" placeholder="">
</div>
<div class="form">
<label class="label">email :</label>
<input type="text" class="input" id="email" placeholder="">
</div>
<div class="form">
<label class="label">password :</label>
<input type="password" class="input" id="password" placeholder="">
</div>
<div class="form">
<label class="label">confirm password :</label>
<input type="password" class="input" id="confirm-password" placeholder="">
</div>
<div class="form">
<label class="label">degree :</label>
<input type="text" class="input" id="degree" placeholder="">
</div>
<div class="form">
<label class="label">gender:</label>
<input type="text" class="input" id = "gender" placeholder="">
</div>
<div class="form">
<label class="label">department :</label>
<input type="number" class="input" id = "department" placeholder="">
</div>
<div class="form">
<label class="label">visiting hour :</label>
<input type="text" class="input" id="visiting-hour" placeholder="">
</div>
<div class="form">
<label class="label">location :</label>
<input type="text" class="input" id="location" placeholder="">
</div>
<div class="form">
<label class="label">number of patients :</label>
<input type="number" class="input" id="number of patients" placeholder="">
</div>
<div class="form">
<label class="label">fees :</label>
<input type="number" class="input" id="fees" placeholder="">
</div>
<div class="form">
<label class="label">contact number :</label>
<input type="number" class="input" id="contact-number" placeholder="">
</div>
<div class="reg">
<div class="button reg_btn">
<a href="javascript: signup();">Register Now!</a></div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="img_container">
<img src="images/profile_pic.png" alt="">
<input type="file" accept="image/">
</div>
</div>
</div>
</div>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="styles/bootstrap4/popper.js"></script>
<script src="styles/bootstrap4/bootstrap.min.js"></script>
<script src="plugins/OwlCarousel2-2.2.1/owl.carousel.js"></script>
<script src="plugins/easing/easing.js"></script>
<script src="plugins/parallax-js-master/parallax.min.js"></script>
<script src="js/custom.js"></script>
</body>
</html>