This repository has been archived by the owner on Aug 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvillage.php
206 lines (177 loc) · 5.56 KB
/
village.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<?php
include_once("internal/backbone.php");
$u = htmlspecialchars(strip_tags($_GET['u']));
// check if get parameters is met
if(!isset($u)) {
header("Location: ./?msg=2");
}
$db->where("uuid", $u);
$v = $db->getOne("villages");
if(!$v) {
header("Location: ./?msg=3");
}
else {
$v2 = getVillageStats($db, $v['id']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="language" content="English">
<meta name="title" content="J-Stats | Village <?php echo $v['name'] ?>">
<meta name="description" content="View Village <?php echo $v['name'] ?> using J-Stats!">
<meta name="theme-color" content="#111111">
<meta content="https://j-stats.xyz/assets/img/icon.png" property="og:image" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="assets/style.css">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://j-stats.xyz/village?u=<?php echo $v['uuid'] ?>">
<link rel="icon" href="assets/img/icon.png">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-dark@5/dark.css" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script>
<title>J-Stats | Village <?php echo $v['name'] ?></title>
</head>
<body>
<?php include_once("includes/header.php"); ?>
<div class="container" style="margin-top:30px">
<h2><?php echo $v['name'] ?></h2>
<?php
$e = getUsernameUUID($db,$v['owner']);
?>
<p>Village <?php echo $v['name'] ?>'s Information owned by <strong><a href="./player?u=<?php echo $v['owner'] ?>"><?php echo $e; ?></a></strong></p>
<div class="row">
<div class="col-lg-4">
<div class="card bg-dark">
<div class="card-header">Location</div>
<div class="card-body">
<?php
$spawn = json_decode($v2['spawn'], true);
?>
<div class="card-title">
<label class='col-6 col-md-6' style='font-weight: bold;'>x</label>
<?php echo $spawn['x'] ?>
</div>
<div class="card-title">
<label class='col-6 col-md-6' style='font-weight: bold;'>y</label>
<?php echo $spawn['y'] ?>
</div>
<div class="card-title">
<label class='col-6 col-md-6' style='font-weight: bold;'>z</label>
<?php echo $spawn['z'] ?>
</div>
</div>
</div>
<br>
</div>
<div class="col-lg-4">
<div class="card bg-dark">
<div class="card-header">
<div class="d-flex justify-content-between">
<div class="item">
Flags
</div>
<div class="item">
(can't be set yet)
</div>
</div>
</div>
<div class="card-body">
<?php
$rule = json_decode($v2['flags'], true);
?>
<div class="card-title">
<label class='col-6 col-md-8' style='font-weight: bold;'>Invite enabled?</label>
<?php echo ft($rule['MEMBERS_CAN_INVITE']) ?>
</div>
<div class="card-title">
<label class='col-6 col-md-8' style='font-weight: bold;'>Mob Spawn Enabled?</label>
<?php echo ft($rule['MOBS_CAN_SPAWN']) ?>
</div>
<div class="card-title">
<label class='col-6 col-md-8' style='font-weight: bold;'>Outside Altering?</label>
<?php echo ft($rule['RANDOM_CAN_ALTER']) ?>
</div>
</div>
</div>
<br>
</div>
<div class="col-lg-4">
<div class="card bg-dark">
<div class="card-header">Statistics</div>
<div class="card-body">
<?php
$rule = json_decode($v2['flags'], true);
?>
<div class="card-title">
<label class='col-6 col-md-6' style='font-weight: bold;'>Assistants</label>
<?php echo $v2['assistantsCount'] ?>
</div>
<div class="card-title">
<label class='col-6 col-md-6' style='font-weight: bold;'>Members</label>
<?php echo $v2['memberCount'] ?>
</div>
<div class="card-title">
<label class='col-6 col-md-6' style='font-weight: bold;'>Claims</label>
<?php echo $v2['claims'] ?>
</div>
</div>
</div>
<br>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="card bg-dark">
<div class="card-header">Assistants</div>
<div class="card-body" style="max-height: 200px; overflow: scroll;">
<ul>
<?php
$a = json_decode($v2['assistants'], true);
if(empty($a)) {
echo "<li>No Assistants in this Village.</li>";
}
foreach ($a as $b) {
$n = getUsernameUUID($db,$b);
echo '<li><a href="./player?u='. $b . '">'. $n .'</a></li>';
}
?>
</ul>
</div>
</div>
<br>
</div>
<div class="col-lg-6">
<div class="card bg-dark">
<div class="card-header">Members</div>
<div class="card-body" style="max-height: 200px; overflow: scroll;">
<ul>
<?php
$b = json_decode($v2['members'], true);
if(empty($b)) {
echo "<li>No others in this Village.</li>";
}
foreach ($b as $c) {
$n = getUsernameUUID($db,$c);
echo '<li><a href="./player?u='. $c . '">'. $n .'</a></li>';
}
?>
</ul>
</div>
</div>
</div>
</div>
</div>
<script src="assets/js/app.js"></script>
<?php include_once("includes/footer.php"); ?>
</body>
</html>
<?php
}
?>