-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hospital_Register_Php.php
139 lines (99 loc) · 4.56 KB
/
Hospital_Register_Php.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
<html>
<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.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
.modal {
display:block;
}
</style>
</head>
<body>
<?php
session_start();
//if(isset($_SESSION['IS_AUTHENTICATED']) && $_SESSION['IS_AUTHENTICATED'] == 1){
// require('DonorRegister.php');
if($_POST["HRegister"]=='Register')
{
$servername = "dbms.iiitdmj.ac.in";
$username = "2016135";
$password = "be5acb71";
$dbname = "2016135";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$UserName=$_POST["HUsername"];
$HospitalName=$_POST["HName"];
$HospitalAddress=$_POST["HAddress"];
$HospitalMobile=$_POST["HMobile"];
$Email=$_POST["HEmail"];
$Password=$_POST["Hpwd"];
$ConfirmPassword=$_POST["Hcpwd"];
$RecepName=$_POST["RecepFullName"];
$RecepEmail=$_POST["RecepEmail"];
$RecepAge=$_POST["RecepAge"];
$RecepGender=$_POST["RecepGender"];
$RecepMobile=$_POST["RecepMobile"];
$RecepAddress=$_POST["RecepAddress"];
$RecepCity=$_POST["RecepCity"];
$ManagerName=$_POST["MagFullName"];
$ManagerEmail=$_POST["MagEmail"];
$ManagerAge=$_POST["MagAge"];
$ManagerGender=$_POST["MagGender"];
$ManagerMobile=$_POST["MagMobile"];
$ManagerAddress=$_POST["MagAddress"];
$ManagerCity=$_POST["MagCity"];
$row1 = "INSERT INTO Hospital VALUES ('$UserName','$HospitalAddress','$Password','$HospitalMobile','$HospitalName','$Email');";
$results1 = $conn->query($row1);
if($results1==false){
echo 'query1 error';
}
$row2= "INSERT INTO Receptionist VALUES ('$RecepName','$RecepMobile','$RecepEmail','$RecepAddress','$UserName','$RecepAge','$Password','$RecepGender','$RecepCity');";
$results2 = $conn->query($row2);
if($results2==false){
echo 'query2 error';
}
$row3= "INSERT INTO Manager VALUES ('$UserName','$ManagerMobile','$ManagerAddress','$ManagerEmail','$ManagerName','$ManagerGender','$Password','$ManagerCity','$ManagerAge');";
$results3 = $conn->query($row3);
if($results3==false){
echo 'query3 error';
}
if($results1 == FALSE || $results2 == FALSE || $results3 == FALSE )
{ echo "<div class='modal fade in' id='myModal' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' style='display: block;'>
<div class='modal-dialog modal-sm' role='document'>
<div class='modal-content'>
<div class='modal-header'>
<h4 class='modal-title' id='myModalLabel'>Oops !</h4>
</div>
<div class='modal-body text-center'>
<p class='lead'>You haven't followed our constraints. Please fill the information carefully</p>
<a href='HospitalRegister.php' class='btn btn-default'>Go Back</a>
</div>
</div>
</div>
</div>
"; }
else {
echo "<div class='modal fade in' id='myModal' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' style='display: block;'>
<div class='modal-dialog modal-sm' role='document'>
<div class='modal-content'>
<div class='modal-header'>
<h4 class='modal-title' id='myModalLabel'>Thank You !</h4>
</div>
<div class='modal-body text-center'>
<p class='lead'>Contact form successfully submitted. Thank you!</p>
<a href='Page.php' class='btn btn-default'>Go to Home</a>
</div>
</div>
</div>
</div>
";
}
}
?>
</body>
</html>