-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreg_doc2.php
More file actions
361 lines (303 loc) · 13.3 KB
/
Copy pathreg_doc2.php
File metadata and controls
361 lines (303 loc) · 13.3 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
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
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script type="text/javascript"></script>
<link href="https://fonts.googleapis.com/css?family=Josefin+Sans&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/bootstrap.min.css">
<script src="../js/jquery-3.2.1.min.js"></script>
<script src="../js/bootstrap.js"></script>
<style>
.psh
{
margin-left: 50px;
margin: 20px;
}
</style>
</head>
<body>
<?php
global $conn;
if(isset($_POST['submit'])){
$servername = "localhost:3308";
$username = "bhavya";
$password = "1111";
$database="myDB";
// Create connection
$conn = mysqli_connect($servername, $username, $password,$database);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
@$user=mysqli_real_escape_string($conn,$_POST['user']);
@$id=mysqli_real_escape_string($conn,$_POST['doc_id']);
@$spec=mysqli_real_escape_string($conn,$_POST['spec']);
@$email=mysqli_real_escape_string($conn,$_POST['email']);
@$mobile=mysqli_real_escape_string($conn,$_POST['mobile']);
@$pass=mysqli_real_escape_string($conn,$_POST['pass']);
@$confirm=mysqli_real_escape_string($conn,$_POST['confirm']);
$sql = "INSERT INTO doctor(user,doc,spec,email,mobile,pass,conpass)
VALUES('$user','$id','$spec','$email','$mobile','$pass','$confirm')";
$sql1="SELECT doc, email from doctor WHERE email='$email'";
$result=mysqli_query($conn,$sql1);
$result=mysqli_connect($conn, $);
if(mysqli_num_rows($result ) > 0){
// echo"<script>alert('Someone has Registered With This Id')</script>";
die( "Someone Has Already Registrated With This Email Try Using Another Email ID!!" ) ;
}
// $result=mysqli_query($conn,$sql);
if(mysqli_query($conn, $sql)) {
echo "<script>alert('You have Registrated Successfully & mail is has been sent to your gmail account')</script>";
}
if($row=mysqli_fetch_assoc($result)){
$to_email = $_POST['email'];
$subject = 'Registration To Health Card';
$message = 'Your Data Has been Registrated and you Patient Id as following' .$row['doc']. 'And Password is ' .$pass . 'for more details contact to info@healthcard.com';
$headers = 'From: noreply@healhcard . com';
mail($to_email,$subject,$message,$headers);
// echo"$row";
// echo"<h3><center>Log In To See More Activity!</h3></center>";
}
else{
echo "Error creating database: " . mysqli_error($conn);
}
mysqli_close($conn);
}
?>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="index.php">Health Card</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="index.php">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.php">About us</a>
</li>
<li class="nav-item">
<a class="nav-link" href="faq.php">FAQ</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.php">Contact Us</a>
</li>
<!--<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li> -->
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>
<h1 class="text-center">Doctor Registration Form</h1>
<h6 class="text-danger font-weight-bold">*All Fields Are required</h6>
<form class="psh" method="post" action="reg_doc2.php" onsubmit="return validation()">
<!-- <section id="form2">-->
<div class="form-row">
<div class="form-group col-md-8">
<label for="">Enter Your Full Name</label>
<span id="username" class="text-danger font-weight-bold"> *</span>
<input type="text" class="form-control" id="user" name="user" placeholder="Full name" autocomplete="off">
<span id="username" class="text-danger font-weight-bold"> </span>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label for="">Enter Your Doc ID</label>
<span id="ids" class="text-danger font-weight-bold"> *</span>
<input type="text" class="form-control" id="doc_id" name="doc_id" autocomplete="off">
<span id="ids" class="text-danger font-weight-bold"> </span>
</div>
<div class="form-group col-md-5">
<label for="">Specialization</label>
<span id="special" class="text-danger font-weight-bold"> *</span>
<select id="spec" class="form-control" name="spec" required>
<option value="null"></option>
<option value="ALLERGY & IMMUNOLOGY">ALLERGY & IMMUNOLOGY</option>
<option value=" ANESTHESIOLOGY"> ANESTHESIOLOGY</option>
<option value="DERMATOLOGY">DERMATOLOGY</option>
<option value="DIAGNOSTIC RADIOLOGY">DIAGNOSTIC RADIOLOGY</option>
<option value="EMERGENCY MEDICINE">EMERGENCY MEDICINE</option>
<option value="FAMILY MEDICINE">FAMILY MEDICINE</option>
<option value="INTERNAL MEDICINE">INTERNAL MEDICINE</option>
<option value="MEDICAL GENETICS">MEDICAL GENETICS</option>
<option value=" NEUROLOGY">NEUROLOGY</option>
<option value="NUCLEAR MEDICINE">NUCLEAR MEDICINE</option>
<option value="OBSTETRICS AND GYNECOLOGY">OBSTETRICS AND GYNECOLOGY</option>
<option value="OPHTHALMOLOGY">OPHTHALMOLOGY</option>
<option value="PATHOLOGY">PATHOLOGY</option>
<option value="PEDIATRICS">PEDIATRICS</option>
<option value="PHYSICAL MEDICINE & REHABILITATION">PHYSICAL MEDICINE & REHABILITATION</option>
<option value=" PREVENTIVE MEDICINE">PREVENTIVE MEDICINE</option>
<option value="PSYCHIATRY">PSYCHIATRY</option>
<option value="RADIATION ONCOLOGY">RADIATION ONCOLOGY</option>
<option value="SURGEN">SURGEN</option>
<option value="UROLOGY">UROLOGY</option>
<option value="">OTHERS</option>
<span id="special" class="text-danger font-weight-bold"> </span>
<!-- <option selected value="null" >Choose...</option>-->
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="">Email</label>
<span id="emails" class="text-danger font-weight-bold"> *</span>
<input type="text" class="form-control" id="email" name="email" placeholder="Email" autocomplete="off">
<span id="emails" class="text-danger font-weight-bold"></span>
</div>
<div class="form-group">
<div class="form-group col-md-6">
<label for="">Mobile Number</label>
<span id="mobileno" class="text-danger font-weight-bold"></span>
<input type="text" class="form-control" id="mobile" name="mobile" placeholder="Phone" size="60" autocomplete="off">
<span id="mobileno" class="text-danger font-weight-bold"></span>
</div>
</div>
</div>
<!--
<div class="form-row">
<div class ="form-group col-md-3">
<label for="" >State</label>
<input type="text" name="state">
<select id required="required" ="" class="form-control">
<option selected>Choose...</option>
<option>...</option>
</select>
</div>
<div class="form-group col-md-3">
<label for="">City</label>
<input type="text" name="city">
<select id required="required" ="" class="form-control">
<option selected>Choose...</option>
<option>...</option>
</select>
</div>
<div class="form-group col-md-2">
<label for="">Pin code</label>
<input type="text" class="form-control" id="" required="required" name="pincode">
</div>
</div>
-->
<!--
<div class="form-group col-md-4">
<label for="">Adhhar number</label>
<input type="text" class="form-control" id="" required="required" name="aadhar">
</div>
-->
<div class="form-row">
<div class="form-group col-md-4">
<label for="inputPassword4">Password</label>
<span id="password" class="text-danger font-weight-bold"> *</span>
<input type="password" class="form-control" id="pass" name="pass" placeholder="password" autocomplete="off">
<span id="password" class="text-danger font-weight-bold"> </span>
</div>
<div class="form-group col-md-4">
<label for="inputPassword4">Confirm password</label>
<span id="conpass" class="text-danger font-weight-bold"> *</span>
<input type="password" class="form-control" id="confirm" name="confirm" placeholder="confirm password" autocomplete="off">
<span id="conpass" class="text-danger font-weight-bold"></span>
</div>
</div>
<!-- <div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="gridCheck">
<label class="form-check-label" for="gridCheck">
Check me out
</label>
</div>
</div> -->
<input type="submit" name="submit" value="Submit" class="btn btn-success" autocomplete="off">
<input type="reset" name="reset" value="Reset" class="btn btn-success" autocomplete="off">
</form>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<!-- Footer -->
<!-- Footer -->
<!-- Footer -->
<script type="text/javascript">
function validation(){
var user = document.getElementById('user').value;
var doc = document.getElementById('doc_id').value;
var spec = document.getElementById('spec').value;
var pass = document.getElementById('pass').value;
var confirmpass = document.getElementById('confirm').value;
var mobile = document.getElementById('mobile').value;
var email = document.getElementById('email').value;
if(user == ""){
document.getElementById('username').innerHTML =" ** Please fill the username field";
return false;
}
if((user.length <= 2) || (user.length > 20)) {
document.getElementById('username').innerHTML =" ** Username lenght must be between 2 and 20";
return false;
}
if(!isNaN(user)){
document.getElementById('username').innerHTML =" ** only characters are allowed";
return false;
}
if(doc == ""){
document.getElementById('ids').innerHTML =" ** Please fill the username field";
return false;
}
if((doc.length <= 2) || (doc.length > 20)) {
document.getElementById('ids').innerHTML =" ** Username lenght must be between 2 and 20";
return false;
}
if(spec == ""){
document.getElementById('special').innerHTML =" ** Please fill this field";
return false;
}
if(email== ""){
document.getElementById('emails').innerHTML =" ** Please fill the email id field";
return false;
}
if(email.indexOf('@') <= 0 ){
document.getElementById('emails').innerHTML =" ** @ Invalid Position";
return false;
}
if((email.charAt(email.length-4)!='.') && (email.charAt(emails.length-3)!='.')){
document.getElementById('emails').innerHTML =" ** . Invalid Position";
return false;
}
if(pass == ""){
document.getElementById('password').innerHTML =" ** Please fill the password field";
return false;
}
if(mobile == ""){
document.getElementById('mobileno').innerHTML =" ** Please fill the mobile NUmber field";
return false;
}
if(isNaN(mobile)){
document.getElementById('mobileno').innerHTML =" ** user must write digits only not characters";
return false;
}
if(mobile.length!=10){
document.getElementById('mobileno').innerHTML =" ** Mobile Number must be 10 digits only";
return false;
}
if((pass.length <= 5) || (pass.length > 20)) {
document.getElementById('password').innerHTML =" ** Passwords lenght must be between 5 and 20";
return false;
}
if(pass!=confirmpass){
document.getElementById('conpass').innerHTML =" ** Password does not match the confirm password";
return false;
}
if(confirmpass == ""){
document.getElementById('conpass').innerHTML =" ** Please fill the confirmpassword field";
return false;
}
}
</script>
</body>
</html>