-
Notifications
You must be signed in to change notification settings - Fork 1
/
add_donor.php
133 lines (120 loc) · 4.21 KB
/
add_donor.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
<?php include 'session.php'; ?>
<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.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.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/3.4.1/js/bootstrap.min.js"></script>
<style>
#sidebar{position:relative;margin-top:-20px}
#content{position:relative;margin-left:210px}
@media screen and (max-width: 600px) {
#content {
position:relative;margin-left:auto;margin-right:auto;
}
}
</style>
</head>
<body style="color:black">
<?php
include 'conn.php';
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) {
?>
<div id="header">
<?php $active="add"; include 'header.php';
?>
</div>
<div id="sidebar">
<?php include 'sidebar.php'; ?>
</div>
<div id="content">
<div class="content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-md-12 lg-12 sm-12">
<h1 class="page-title">Add Donor</h1>
</div>
</div>
<hr>
<form name="donor" action="save_donor_data.php" method="post">
<div class="row">
<div class="col-lg-4 mb-4"><br>
<div class="font-italic">Full Name<span style="color:red">*</span></div>
<div><input type="text" name="fullname" class="form-control" required></div>
</div>
<div class="col-lg-4 mb-4"><br>
<div class="font-italic">Mobile Number<span style="color:red">*</span></div>
<div><input type="text" name="mobileno" class="form-control" required></div>
</div>
<div class="col-lg-4 mb-4"><br>
<div class="font-italic">Email Id</div>
<div><input type="email" name="emailid" class="form-control"></div>
</div>
</div>
<div class="row">
<div class="col-lg-4 mb-4"><br>
<div class="font-italic">Age<span style="color:red">*</span></div>
<div><input type="text" name="age" class="form-control" required></div>
</div>
<div class="col-lg-4 mb-4"><br>
<div class="font-italic">Gender<span style="color:red">*</span></div>
<div><select name="gender" class="form-control" required>
<option value="">Select</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
</div>
</div>
<div class="col-lg-4 mb-4"><br>
<div class="font-italic">Blood Group<span style="color:red">*</span></div>
<div><select name="blood" class="form-control" required>
<option value=""selected disabled>Select</option>
<?php
include 'conn.php';
$sql= "select * from blood";
$result=mysqli_query($conn,$sql) or die("query unsuccessful.");
while($row=mysqli_fetch_assoc($result)){
?>
<option value=" <?php echo $row['blood_id'] ?>"> <?php echo $row['blood_group'] ?> </option>
<?php } ?>
</select>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-lg-4 mb-4">
<div class="font-italic">Address<span style="color:red">*</span></div>
<div><textarea class="form-control" name="address" required></textarea></div></div>
</div> <br>
<div class="row">
<div class="col-lg-4 mb-4">
<div><input type="submit" name="submit" class="btn btn-primary" value="Submit" style="cursor:pointer" onclick="popup()"></div>
</div>
</div>
</form>
</div>
</div>
</div>
<?php
} else {
echo '<div class="alert alert-danger"><b> Please Login First To Access Admin Portal.</b></div>';
?>
<form method="post" name="" action="login.php" class="form-horizontal">
<div class="form-group">
<div class="col-sm-8 col-sm-offset-4" style="float:left">
<button class="btn btn-primary" name="submit" type="submit">Go to Login Page</button>
</div>
</div>
</form>
<?php }
?>
<script>
function popup() {
alert("Data added Successfully.");
}
</script>
</body>
</html>