-
Notifications
You must be signed in to change notification settings - Fork 0
/
recipient.php
197 lines (182 loc) · 9.28 KB
/
recipient.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
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
<?php
include "php/dbcon.php";
if(isset($_POST['submitBtn'])){
$name = $_POST['name'];
$sex = $_POST['sex'];
$bType = $_POST['b_type'];
$dob = $_POST['dob'];
$address = $_POST['address'];
$mobile = $_POST['mobile'];
$hospital = $_POST['hospital'];
$se1=mysql_query("select * from project.doctors where hospitalid='1'") or die(mysql_error());
$sobj1=mysql_fetch_object($se1);
$doctor=$sobj1->doctorid;
$comments = $_POST['comments'];
$patient_type ="d";
$today=date("Y-m-d");
$liver=$_POST['liver'];
$kidney=$_POST['kidney'];
$eyes=$_POST['eyes'];
$bp=$_POST['bp'];
$weight=$_POST['weight'];
$hemoglobin=$_POST['hemoglobin'];
$hbsag=$_POST['hbsag'];
$duedate=$_POST['duedate'];
$hematocrit=$_POST['hematocrit'];
if($liver){
$org="$liver".',';
}
if($kidney){
$org .="$kidney".',';
}
if($liver){
$org .="$eyes".',';
}
$ins=mysql_query("insert into project.patient(hospital_id,address,pname,sex,dob,comments,doctor_id,contact_no,organname,bloodgroup_id,patient_type,date_donation) values('$hospital','$address','$name','$sex','$dob','$comments','$doctor','$mobile','$org','$bType','$patient_type','$today')") or die(mysql_error());
$insid=mysql_insert_id();
$ins1=mysql_query("insert into project.patientr(patient_id,bp,wg,hgb,duedate,haematocrit) values('$insid','$bp','$weight','$hemoglobin','$duedate','$hematocrit')") or die(mysql_error());
header("location:hhome.php");
}
$title = "Recipient";
$setDonorActive = "active";
include 'layout/_header.php';
include 'layout/_top_nav.php';
?>
<div class="container">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<?php if(isset($success)): ?>
<div class="alert-success fade-out-5"><?= $success; ?></div>
<?php endif; ?>
<?php if(isset($message)): ?>
<div class="alert-danger fade-out-5"><?= $message; ?></div>
<?php endif; ?>
<form method="post" class="form-horizontal" role="form" action="">
<div class="panel panel-default">
<div class="panel-heading">
<h5>Recipient Basic Info</h5>
</div>
<div class="panel-body">
<div class="form-group">
<label class="col-sm-4">Name</label>
<div class="col-sm-3">
<input type="text" name="name" placeholder="Name" class="form-control" required="true">
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Gender</label>
<div class="col-sm-4 radio-inline">
<input type="radio" value="male" name="sex" checked="true">Male
</div>
<input type="radio" value="female" name="sex">Female
</div>
<div class="form-group">
<label class="col-sm-4">Blood Type:</label>
<div class="col-sm-8">
<select name="b_type" class="form-control">
<option value="">Select Blood Group</option>
<?php
$hospital1 = mysql_query("Select * from project.bloodgroup order by groupid");
while($hobj1=mysql_fetch_object($hospital1)){
?>
<option value="<?php echo $hobj1->groupid; ?>"><?php echo $hobj1->groupname; ?></option>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">D.O.B</label>
<div class="col-sm-8">
<input type="date" name="dob" class="form-control" required="true">
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Address</label>
<div class="col-sm-8">
<textarea rows="8" name="address" class="form-control" required="true"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Mobile</label>
<div class="col-sm-8">
<input type="number" min="0" max="10000000000" name="mobile" class="form-control" required="true">
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Hospital</label>
<div class="col-sm-8">
<select name="hospital" class="form-control">
<option value="">Select Hospital</option>
<?php
$hospital = mysql_query("Select * from project.register where usertype='h'");
while($hobj=mysql_fetch_object($hospital)){
?>
<option value="<?php echo $hobj->userid; ?>"><?php echo $hobj->name; ?></option>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Diseases</label>
<div class="col-sm-8">
<textarea name="comments" rows="8" class="form-control"> </textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Organ</label>
<div class="col-sm-8">
<input type="checkbox" name="liver" value="liver"> Liver<br/>
<input type="checkbox" name="kidney" value="kidney"> Kidney<br/>
<input type="checkbox" name="eyes" value="eyes"> Eyes<br/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Blood Pressure</label>
<div class="col-sm-8">
<input type="text" name="bp" value="" placeholder="mmHg" class="form-control" required="true"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Weight</label>
<div class="col-sm-8">
<input type="decimal" name="weight" value="" placeholder="Kg" required="true" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Hemoglobin</label>
<div class="col-sm-8">
<input type="text" name="hemoglobin" value="" placeholder="Normal: 11.6-15.6 g/dl" required="true" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Hematocrit </label>
<div class="col-sm-8">
<input type="text" name="hematocrit" placeholder="Normal:34-36 %"value="" required="true" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Due Date</label>
<div class="col-sm-8">
<input type="date" name="duedate" class="form-control" required="true">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-4"> </label>
<div class="col-sm-8">
<button class="btn btn-success" name="submitBtn" >Add Recipient</button>
</div>
</div>
</div>
</div>
</form>
</div>
<div class="col-md-3"></div>
</div>
</div>
<?php include 'layout/_footer.php'; ?>