-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschemes.html
150 lines (129 loc) · 4.18 KB
/
schemes.html
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
<!DOCTYPE html>
<html lang="en">
<!-- Head -->
<head>
<!-- All Meta Information -->
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="Pregnancy Guide Website" />
<meta
name="keywords"
content="PregEdu, Pregnancy Guide Web App, Pregnancy Blogs, Pregnancy Cycle, Pregnancy Report Check"
/>
<meta
name="author"
content="Bharti Kumari, Diya Vijay, Shubhanshu Sharma"
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Page Title -->
<title>PregEdu</title>
<!-- Favicon Icon -->
<link rel="icon" type="image/x-icon" href="assets/favicon.png" />
<!-- Google Font Style -->
<link
href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet"
/>
<!-- Google Icon -->
<link
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"
rel="stylesheet"
/>
<!-- Fontawesome Icon -->
<script
defer
src="https://use.fontawesome.com/releases/v5.15.4/js/all.js"
integrity="sha384-rOA1PnstxnOBLzCLMcre8ybwbTmemjzdNlILg8O7z1lUkLXozs4DHonlDtnE7fpc"
crossorigin="anonymous"
></script>
<!-- External CSS -->
<link rel="stylesheet" type="text/css" href="dist/css/main.css" />
<!-- External JS -->
<script src="dist/js/main.js"></script>
<!-- Head Closing -->
</head>
<body onload="showTable()">
<!-- Main Body -->
<!-- Header -->
<header>
<!-- Navbar Starts-->
<nav>
<input type="checkbox" id="check" />
<label for="check" class="checkbtn">
<i class="fas fa-bars"></i>
</label>
<label class="logo">PregEdu</label>
<ul class="nav-item">
<li>
<a href="index.html">Home</a>
</li>
<li>
<a href="schemes.html">Schemes</a>
</li>
<li>
<a href="faq.html">FAQ</a>
</li>
<li>
<a href="contact.html">Contact</a>
</li>
</ul>
</nav>
<!-- Navbar Closing-->
</header>
<!-- Header Closing -->
<!-- Main Starting-->
<main class="main-heading">
<h1 class="content-heading">Government Schemes</h1>
<label for="filter">Filter by Country:</label>
<input
class="filterInput"
type="text"
id="filter"
placeholder="Enter a country name..."
/>
<button class="filteringButton" onclick="filterTable()">Filter</button>
</main>
<!-- Main Closing-->
<!-- <button onload="showTable()">Show Schemes</button> -->
<!-- <div class="filterButtonContainer">
<label for="filter">Filter by Country:</label>
<input
class="filterInput"
type="text"
id="filter"
placeholder="Enter a country name..."
/>
<button class="filteringButton" onclick="filterTable()">Filter</button>
</div> -->
<script>
function showTable() {
fetch("./dist/json/schemes.json")
.then((response) => response.json())
.then((data) => createTable(data));
}
function createTable(data) {
var table = "<table>";
table += `<tr>
<th style="width: 30%;">Scheme Title</th>
<th style="width: 50%;">Description</th>
<th style="width: 10%;">Country</th>
<th style="width: 10%;">Url</th>
</tr>`;
var tr = "";
for (let i = 0; i < data.schemes.length; i++) {
tr += "<tr>";
tr += `<td>${data.schemes[i].schemeTitle}</td>`;
tr += `<td style="width: 50%;">${data.schemes[i].description}</td>`;
tr += `<td>${data.schemes[i].country}</td>`;
tr += `<td style="width: 10%;"><a href="${data.schemes[i].url}">${data.schemes[i].url}</a></td>`;
tr += "</tr>";
}
table += tr + "</table>";
// append table to body
document.body.innerHTML += table;
}
</script>
<!-- Body Closing -->
</body>
<!-- HTML Closing -->
</html>