-
Notifications
You must be signed in to change notification settings - Fork 0
/
cht.php
264 lines (129 loc) · 9.43 KB
/
cht.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<?php include('ser_h1.php');?>
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-body">
<div class="table-responsive">
<?php
require('db.php');
if(isset($_POST['pid']))
{
$rvol_id=$_REQUEST['rvol_id'];
$pid=$_REQUEST['pid'];
$name=mysqli_real_escape_string($con,$_REQUEST['name']);
$title=mysqli_real_escape_string($con, $_REQUEST['title']);
$des=mysqli_real_escape_string($con, $_REQUEST['des']);
$addres=mysqli_real_escape_string($con,$_REQUEST['address']);
$phno=$_REQUEST['phone'];
$q="INSERT INTO `posts`(`post_id`, `name`, `title`, `adderss`, `des`, `phone`, `date`, `pt`, `vol_id`) VALUES ('$pid','$name','$title','$addres','$des','$phno',now(),1,'$rvol_id')";
$res=mysqli_query($con,$q);
if($res)
{
echo'<script>alert("Posted Sucessfully...")</script>';
}
}
?>
<table class="datatable table table-hover table-center mb-0">
<thead>
<tr>
<th>ID</th>
<th>Doctor Name</th>
<th>Locations</th>
<!-- <th>Speciality</th> -->
<!-- <th>Account Status</th> -->
<th>Action</th>
</tr>
</thead>
<tbody>
<div class="modal fade" id="model521235" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="ModalLabel">Make Request</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="" method="post" >
<div class="card card-primary">
<input type="hidden" id="pid" name="pid" value="<?php echo md5(time().date('ymd')); ?>">
<!-- /.card-header -->
<!-- form start -->
<div class="card-body">
<div class="form-group">
<label for="InputEmail1">Auto Genrated Id </label>
<input class="form-control" type="text" id="rvol_id" name="rvol_id" value="" readonly>
</div>
<div class="form-group">
<label for="InputEmail1">Name</label>
<input type="text" name="name" class="form-control" id="InputEmail1" placeholder=" Name" required>
</div>
<div class="form-group">
<label for="InputEmail1">Title</label>
<input type="text" name="title" class="form-control" id="InputEmail1" placeholder="Title" required>
</div>
<div class="form-group">
<label for="InputEmail1">Address</label>
<input type="text" name="address" class="form-control" id="InputEmail1" placeholder="Address" required>
</div>
<div class="form-group">
<label for="InputEmail1">Description of Post</label>
<textarea type="text" name="des" class="form-control" id="InputEmail1"></textarea>
</div>
<div class="form-group">
<label for="InputPassword1">Phone number</label>
<input type="number" name="phone" class="form-control" id="InputPassword1" placeholder="Phone number" required>
</div>
</div>
<!-- /.card-body -->
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<input type="submit" value="Send message" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
<?php
$q="SELECT * FROM volunteer,address,services,medical WHERE volunteer.address_id=address.address_id and volunteer.service_id=services.service_id and services.medical_id=medical.medical_id and medical.doc=1";
if(isset($_GET['city']))
{
$q=$q." and city='".$_GET['city']."'";
}
$count=1;
$res=mysqli_query($con,$q);
while($row=mysqli_fetch_array($res))
{
?>
<tr>
<td><?php echo $count;$count++; ?></td>
<td>
<h2 class="table-avatar">
<a href="#" class="avatar avatar-sm mr-2"><img class="avatar-img rounded-circle" src="assets\cpic\<?php echo $row['vol_id'].'.jpg'; ?>" onerror="this.onerror=null;this.src='assets/def.png';" alt="Docter Image"></a>
<a href="#"><?php echo $row['name'] ?></a>
</h2>
</td>
<td><?php echo $row['city'].",".$row['district'].",".$row['State']."-".$row['zipcode']; ?></td>
<td><button class="btn btn-danger" onclick="post_req_data('<?php echo $row['vol_id']; ?>')" data-toggle="modal" data-target="#model521235" data-whatever="@mdo">Make Request</button>
</div>
</td>
</tr>
<?php } ?>
<script>
function post_req_data(rvol_id)
{
var ipid=document.getElementById("rvol_id").value=rvol_id;
}
</script>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include("ser_h2.php"); ?>