-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblood-donate.php
More file actions
163 lines (103 loc) · 4.45 KB
/
Copy pathblood-donate.php
File metadata and controls
163 lines (103 loc) · 4.45 KB
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
<?php include('security.php'); ?>
<?php include('includes/header.php');?>
<?php include('includes/navbar.php');?>
<style type="text/css">
.bg-name{
background-color: #FFC7C9;
}
.bg-address{
background-color: #DA2A47;
}
#myInput {
background-image: url('/css/searchicon.png'); /* Add a search icon to input */
background-position: 10px 12px; /* Position the search icon */
background-repeat: no-repeat; /* Do not repeat the icon image */
width: 100%; /* Full-width */
font-size: 16px; /* Increase font-size */
padding: 12px 20px 12px 40px; /* Add some padding */
border: 1px solid #ddd; /* Add a grey border */
margin-bottom: 12px; /* Add some space below the input */
}
</style>
<!-- Home Banner -->
<br><br><br>
<img src="img/blood/blood.jpg" class="img-fluid" width="100%" >
<!-- /Home Banner -->
<br><br> <br><br>
<!-- Start Align Area -->
<div class="whole-wrap">
<div class="container box_1170">
<div class="col-lg-12">
<h2 class="title-1 m-b-25">BloodBank Lists</h2>
<div class="table-responsive table--no-card m-b-40">
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for District" title="Type in a name">
<table class="table table-borderless table-striped table-earning" id="bloodcenters" data-aos-delay="200">
<br>
<thead>
<th class="bg-name">S.No.</th>
<th class="bg-address">Blood Bank Name</th>
<th class="bg-name">Address</th>
<th class="bg-address">City</th>
<th class="bg-name" >District</th>
<th class="bg-address">Category</th>
<th class="bg-name">Mobile No.</th>
<th class="bg-address">Landline</th>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'></script>
<script type="text/javascript">
$.ajax({
url:"https://api.data.gov.in/resource/fced6df9-a360-4e08-8ca0-f283fc74ce15?api-key=579b464db66ec23bdd0000016eb95066326649877300f6063b2b8d14&format=json&offset=0&limit=3000",
type:"GET",
dataType:"JSON",
success : function(blood_data) {
console.log(blood_data.records[0].__state);
var newArray = blood_data.records.filter(function (el) {
return el.__state === 'Tamil Nadu';
});
console.log(newArray);
var sno = 1;
$.each(newArray, function(key, value){
$("#bloodcenters").append("<tr>" +
"<td>" + sno + " </td>" +
"<td>" + value._blood_bank_name + "</td>" +
"<td>" + value.__address + "</td>" +
"<td>" + value.__district + "</td>" +
"<td>" + value.__city + "</td>" +
"<td>" + value.__category + " </td>" +
"<td>" + value._mobile + "</td>" +
"<td>" + value.__contact_no + "</td>" +
"</tr>" );
sno++;
});
}
});
</script>
<script type="text/javascript">
function myFunction() {
var input, filter, table, tr, td, i, txtValue;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("bloodcenters");
tr = table.getElementsByTagName("tr");
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[4];
if (td) {
txtValue = td.textContent || td.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
</script>
<?php include('includes/scripts.php');?>
<?php include('includes/footer.php');?>