-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadmin-add-new-donar.php
148 lines (121 loc) Β· 4.1 KB
/
admin-add-new-donar.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
140
141
142
143
144
145
146
147
148
<?php include_once('session-active.php'); ?>
<?php include("../../service/admin_service.php");?>
<!--dashboard options -->
<?php include("admindashboard.php");?>
<title>index</title>
<style>
input[type=text], select {
width: 100%;
padding: 8px 20px;
margin: 2px 0;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type=password] {
width: 100%;
padding: 8px 20px;
margin: 8px 0;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type=submit] {
width: 100%;
background-color: #4CAF50;
color: white;
padding: 10px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #45a049;
}
div #regdiv{
align: center;
border-radius: 4px;
background-color: #ECEDED;
padding: 20px;
width: 360px;
margin-left: 250px;
}
</style>
<hr style="color:red;" />
<div id="main" align="center">
<div id="Registration">
<h3 style="color:blue;">DONOR REGISTRATION FORM</h3>
<hr/>
</div>
</div>
<div id="regdiv">
<div align="center">
<h3 style="color:#4CAF50;margin-top:0px;">Registration Form</h3>
<hr/>
</div>
<div align="center">
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST'){
$name=$_POST['namefield'];
$gender=$_POST['gender'];
$email=$_POST['email'];
$blood_group=$_POST['bloodgroup'];
$address=$_POST['address'];
$contact_no=$_POST['contact'];
$organ_id=$_POST['organ_id'];
// echo $organ_name;
if(!empty($name) && !empty($address) && !empty($contact_no) &&
$organ_id!="Select organ"){
$res = get_all_organ_by_id($organ_id);
$row1 = mysqli_fetch_assoc($res);
$organ_name=$row1['organ_name'];
add_new_donar($organ_id, $name, $gender, $email, $blood_group,
$address, $contact_no, $organ_name);
echo '<label style="color:green">Successfully added.</label>';
}
else{
echo '<label style="color:red">Fill all the Fields</label>';
}
}
?>
</div>
<form action="admin-add-new-donar.php" method="post">
<label>Name<span style="color:red">*</span></label>
<input type="text" id="name" required name="namefield" placeholder="full name">
<label>Gender</label>
<select id="gender" name="gender">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
<label>E-mail Address<span style="color:red">(if any)</span></label>
<input type="text" id="email" name="email" placeholder="e-mail address">
<label>Blood Group</label>
<select id="bloodgroup" name="bloodgroup">
<option>AB+</option>
<option>AB-</option>
<option>B+</option>
<option>A+</option>
<option>O+</option>
<option>B-</option>
<option>A-</option>
<option>O-</option>
</select>
<label>Address<span style="color:red">*</span></label>
<input type="text" id="address" name="address" placeholder="address">
<label>Contact Number<span style="color:red">*</span></label>
<input type="text" id="contact" name="contact" placeholder="contact number">
<label>Select organ<span style="color:red">*</span></label>
<select id="organ_id" name="organ_id">
<option>Select organ</option>
<?php
$result = get_all_organ();
while($row = mysqli_fetch_assoc($result)){
echo '<option value="'.$row['id'].'">'.$row['organ_name'].'</option>';
}
?>
</select>
<br/>
<input type="submit" value="Apply">
</form>
</div>
<!--Bottom options -->
<?php //include("bottomfotor.php");?>