-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmitras.php
158 lines (132 loc) · 5.48 KB
/
mitras.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
<?php
include_once('./parts/entryCheck.php');
include_once('./server/db_connection.php');
include_once('./server/validation.php');
include_once('./server/functions.php');
include_once("./server/auto-routes.php");
$aboutSite = $connection->query('SELECT * FROM `system_data`');
$aboutSite = $aboutSite->fetch_array(MYSQLI_ASSOC);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="assets/css/mitras-style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins: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">
<link rel="stylesheet" href="./assets/css/all.min.css">
<link rel="stylesheet" href="./assets/css/navbar.css">
<link rel="stylesheet" href="./assets/css/boxicons/css/boxicons.min.css">
<link rel="shortcut icon" href="./<?php echo $aboutSite['system_logo']; ?>" type="image/x-icon">
<title>Mitras ~ <?php echo $aboutSite['system_name']; ?></title>
<style>
.mid-body {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.mid-body > *{
width: 70%;
}
.mitra-request-list-item:hover {
background-color: rgba(0, 0, 0, 0.2);
border-radius: 5px;
margin: 1px;
}
</style>
<?php include_once("../MitraPark/assets/css/dynamicColor.php"); ?>
</head>
<body>
<?php include_once("./parts/navbar.php") ?>
<div class="body">
<?php include_once("./parts/leftSidebar.php");?>
<div class="mid-body">
<div>
<div class="search-field">
<input placeholder="Search" type="text" id="search-field-inp">
<i class="fas fa-search"></i>
</div>
<div id="searchResult" class="left-inner-body" style="width: 100%; text-align:center;">
</div>
<hr>
<div class="mitra-request-list-item">
<a class="redirect-to-profile" href="mitrarequests.php">
<span class="uname">
View all Mitra Requests
</span>
</a>
</div>
<div class="mitra-request-list-item">
<a class="redirect-to-profile" href="allmitra.php">
<span class="uname">
View all Mitras
</span>
</a>
</div>
</div>
</div>
<?php
include_once("./parts/rightSidebar.php")
?>
</div>
</body>
<script src="./assets/scripts/jquery.js"></script>
<script>
let searchBox = document.getElementById("search-field-inp");
searchBox.addEventListener("keyup", (() => {
$.ajax({
url: './server/api/getUsers.php',
type: "POST",
data: {
search: searchBox.value
},
success: function(items) {
let itemsArr = JSON.parse(items);
let searchResultShow = document.getElementById("searchResult");
// console.log(JSON.parse(items));
if (itemsArr.length == 0) {
searchResultShow.innerHTML = '<span style="text-align: center;" cl ass="uname"> No result found </span>';
} else {
searchResultShow.innerHTML = "";
itemsArr.map((profile) => (
// console.log(profile),
searchResultShow.innerHTML += `
<div class="mitra-request-list-item" id="result-${(profile.uid)}">
<a class="redirect-to-profile" href="./user.php?id=${profile.uid}">
<img class="mitra-request-profile-list" src="${(profile.profile_picture!=null)?profile.profile_picture:"./assets/images/user.png"}">
<span class="uname">
${profile.name}
</span>
</a>
</div>
`
));
}
},
error: function(x) {
// console.log("fail");
// console.log(x);
}
})
}));
function getFriendRequests() {
let mitraRequestList = document.getElementById("mitraList");
$.ajax({
url: "./server/api/getFriendRequests.php",
success: function(success) {
mitraRequestList.innerHTML = success;
}
})
}
$(document).ready(getFriendRequests);
setInterval(() => {
getFriendRequests();
}, 5000);
</script>
<?php include_once("./parts/js-script-files/js-script.php"); ?>
<?php include_once("./parts/js-script-files/strict-and-activity-update.php"); ?>
</html>