-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoints.php
174 lines (156 loc) · 5.14 KB
/
points.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
<?php
session_start();
require_once("inc/config.inc.php");
require_once("inc/functions.inc.php");
//Überprüfe, dass der User eingeloggt ist
//Der Aufruf von check_user() muss in alle internen Seiten eingebaut sein
$user = check_user();
?>
<html lang="de">
<?php
include "templates/head.html";
?>
<body>
<?php
include "templates/menu.php";
?>
</div>
<div class="app-container">
<?php include "templates/app-header.php"; ?>
<div class="app-content">
<div class="content-wrapper">
<div class="container">
<div class="row">
<div class="col">
<div class="page-description">
<h1>PunkteSystem</h1>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<h5 class="card-title">Punkteverlauf</h5>
</div>
<div class="card-body">
<div id="apex2"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<?php
$stmt = $pdo->query("SELECT * FROM points");
while ($row = $stmt->fetch()) {
if($row["discord_id"] == $user["discord_id"]){
echo '<div class="alert alert-custom" role="alert">';
if($row["type"] == 0){
echo '<div class="custom-alert-icon icon-danger"><i
class="material-icons-outlined">keyboard_arrow_down</i></div>';
}else {
echo '<div class="custom-alert-icon icon-success"><i
class="material-icons-outlined">keyboard_arrow_up</i></div>';
}
echo '<div class="alert-content">
<span class="alert-title">'.$row["points"].' Punkte';
if($row["type"] == 0){
echo " ausgegeben";
}else {
echo " erhalten";
}
echo '<span style="float:right;" class="badge badge-style-bordered badge-info">'.date("d.m.Y, H:i", strtotime($row["datum"])).'</span></span>
<span class="alert-text">'.$row["grund"].'</span>
</div>
</div>';
}
}
?>
</div>
</div>
</div>
<?php include "templates/footer.html"; ?>
</div>
</div>
</div>
</div>
<?php
include "templates/javascript.html";
?>
<script>
var options2 = {
chart: {
height: 350,
type: 'area',
},
dataLabels: {
enabled: false
},
stroke: {
curve: 'smooth'
},
series: [ {
name: 'Punkte erhalten',
data: [<?php $stmt = $pdo->query("SELECT * FROM online ORDER BY firstDate DESC");
while ($row = $stmt->fetch()) {
if($row["discord_Id"] == $user["discord_id"]){
echo $row["minuten"].',';
}
}
?>]
}],
xaxis: {
type: 'datetime',
categories: [<?php $stmt = $pdo->query("SELECT * FROM online ORDER BY firstDate DESC");
while ($row = $stmt->fetch()) {
if($row["discord_Id"] == $user["discord_id"]){
echo '"'.$row["firstDate"].'",';
}
}
?>],
labels: {
style: {
colors: 'rgba(94, 96, 110, .5)'
}
}
},
tooltip: {
x: {
format: 'dd/MM/yy HH:mm'
},
},
grid: {
borderColor: 'rgba(94, 96, 110, .5)',
strokeDashArray: 4
},
markers: {
size: 0,
colors: undefined,
strokeColors: '#fff',
strokeWidth: 2,
strokeOpacity: 0.9,
strokeDashArray: 0,
fillOpacity: 1,
discrete: [],
shape: "circle",
radius: 2,
offsetX: 0,
offsetY: 0,
onClick: undefined,
onDblClick: undefined,
showNullDataPoints: true,
hover: {
size: undefined,
sizeOffset: 3
}
}
}
var chart2 = new ApexCharts(
document.querySelector("#apex2"),
options2
);
chart2.render();
</script>
</body>
</html>