-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch_don.php
87 lines (78 loc) · 2.1 KB
/
search_don.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
<?php
include "config.php";
if(!empty($_POST["str"]))
{
$sql="SELECT * FROM blood_donor WHERE ({$_POST["STYPE"]} LIKE '%{$_POST["str"]}%' AND BLOOD='{$_POST["BLOOD"]}' AND STATUS=1)";
$result=$con->query($sql);
if($result->num_rows>0)
{
$i=0;
echo "<div class='table-responsive '><table class='table table-striped table-bordered'>
<tr class='text-primary'>
<th>Sno</th>
<th>Picture</th>
<th>Blood Group</th>
<th>Name</th>
<th>Area</th>
<th>Pincode</th>
<th>City</th>
<th>State</th>
<th>Cell</th>
</tr>
";
while($row=$result->fetch_assoc())
{
$sdate=$row["LAST_D_DATE"];
$n=null;
$date2=date_create($sdate);
$cdate=date_create(date("Y-m-d"));
$days=date_diff($date2,$cdate);
$n=$days->format("%R%a");
if($n>90)
{
$i++;
echo"<tr>";
echo"<td>$i</td>";
echo"<td><img src='{$row["DONOR_PIC"]}' class='don_img' height='50px' width='50px'></td>";
echo"<td>{$row["BLOOD"]}</td>";
echo"<td>{$row["NAME"]}</td>";
echo"<td>{$row["AREA"]}</td>";
echo"<td>{$row["PINCODE"]}</td>";
echo"<td>{$row["CITY"]}</td>";
echo"<td>{$row["STATE"]}</td>";
echo"<td>{$row["CONTACT_1"]}</td>";
echo"</tr>";
}
}
echo "</table></div>";
if($i==0)
{
echo "<div class='alert alert-danger'><i class='fa fa-users'></i> Our Donors already donated</div>";
}
}
else
{
echo "<div class='alert alert-danger'><i class='fa fa-users'></i> No Donors Found</div>";
}
}
else
{
echo "<script>alert('Please Type Search Text..');</script>";
}
?>
<div class="modal fade" id="Mymodal">
<div class="modal-content">
<div class="modal-body">
<img src='' id="md_img" height="100%" width="100%">
</div>
</div>
</div>
<script>
$(document).ready(function(){
$(".don_img").click(function(){
var a=$(this).attr("src");
$("#md_img").attr("src",a);
$("#Mymodal").modal();
});
});
</script>