-
Notifications
You must be signed in to change notification settings - Fork 0
/
Staffregistration.php
76 lines (70 loc) · 2.36 KB
/
Staffregistration.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
<html>
<head>
<title></title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="static/css/materialize.min.css" media="screen,projection"/>
<link rel="stylesheet" type="text/css" href="static/prelogin.css">
</head>
<body>
<div class="a1">
<?php
echo "<h3><p>Staff</p></h3>";
?>
</div>
<div class="container">
<div class="a">
<p><em><h4>"Individual commitment to a group effort - that is what makes a team work, a company work, a society work, a civilization work."</h4></em></p>
</div>
<div class="row">
<div class="col s6 m6">
<div class="card white darken-1">
<div class="card-content black-text">
<span class="card-title">Login </span>
</div>
<div class="card-action">
<a href="Stafflogin.html"><b>Click here to login</b></a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<?php
$conn=mysqli_connect("localhost","root","","blooddonation");
//echo "ok";
if(!$conn)
{
die("connection failed".mysqli_connect_error());
echo "fail";
}
$UHID=$_POST['UHID'];
$Password=$_POST['Password'];
$FirstName=$_POST['FirstName'];
$LastName=$_POST['LastName'];
$Designation=$_POST['Designation'];
$StaffID=$_POST['StaffID'];
$Contact=$_POST['Contact'];
$BloodGroup=$_POST['BloodGroup'];
// "ok done";
$sql= "SELECT * FROM hospitalstaff WHERE UHID='$UHID' AND StaffID= '$StaffID'";
$result = $conn->query($sql);
if (!$row = $result->fetch_assoc())
{
echo("Your staff ID is not associated with mentioned hospital");
//header("Location: Staffregistration.html");
}
else {
$query="insert into stafftable(Password,FirstName,LastName,Designation,StaffID,Contact,BloodGroup) VALUES ('$Password','$FirstName','$LastName','$Designation','$StaffID','$Contact','$BloodGroup')"; //Inserts the value to table users
if(mysqli_query($conn, $query))
{
echo "Records inserted successfully.";
header("Location: Stafflogin.html");
} else
{
echo "ERROR: Could not able to execute $query. " . mysqli_error($conn);
}
}
mysqli_close($conn);
?>