-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexplore.php
104 lines (93 loc) · 2.46 KB
/
explore.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
<?php
include("initial.php");
include("classes/User.php");
include("current_user.php");
?>
<!DOCTYPE html>
<html>
<head>
<title>Explore</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Rubik&display=swap" rel="stylesheet">
</head>
<style type="text/css">
body {
background: #000000;
color: #FFFFFF;
text-align: center;
font-size: 1.5vw;
font-family: Rubik;
}
#display {
background: rgba(0, 0, 0, 0.3);
margin-bottom: 10px;
margin-top: 0px;
}
.container {
background: #fffacd;
}
.btn {
background-color: #fffacd;
width: 100%;
font-size: 2vw;
}
.btn:hover {
background: rgba(0, 0, 0, 0.4);
}
@media (min-width: 300px) and (max-width: 480px) {
body {
font-size: 3.5vw;
}
}
</style>
<body>
<nav class="navbar navbar-expand navbar-dark bg-dark" id="navBar">
<a href="#" class="navbar-brand nav-link disabled" id="user">Form Builder</a>
<ul class="navbar-nav mr-auto ml-4">
<li class="nav-item">
<a class="nav-link border-0" href="index.php">HOME</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link rounded" href="logout.php?signOut=true">SIGN OUT</a>
</li>
</ul>
</nav>
<div class="container rounded mt-lg-4 mx-md-auto m-sm-0">
<div class="row">
<div class="col-sm-6">
<button type="button" class="btn" id="byDate">ORDER BY DATE</button>
</div>
<div class="col-sm-6">
<button type="button" class="btn" id="trending">TRENDING</button>
</div>
</div>
<table id="display" class="table rounded">
</table>
</div>
</body>
</html>
<script type="text/javascript">
var byDate = document.querySelector("#byDate");
var trending = document.querySelector("#trending");
var httpRequest = new XMLHttpRequest();
byDate.addEventListener("click",function(){
ajaxCall(0);
});
trending.addEventListener("click",function(){
ajaxCall(1);
});
function displayList(){
var response = httpRequest.responseText;
document.querySelector("#display").innerHTML = response;
}
function ajaxCall(option){
httpRequest.onreadystatechange = displayList;
httpRequest.open('POST','fetchFormExplore.php');
httpRequest.setRequestHeader('Content-type','application/x-www-form-urlencoded');
httpRequest.send('option='+ option);
}
window.onload = ajaxCall(1);
</script>