-
Notifications
You must be signed in to change notification settings - Fork 1
/
verifications_check.php
executable file
·98 lines (92 loc) · 3.33 KB
/
verifications_check.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
<?php
require_once './include/page.php';
$page = new Page("verifications_check");
$id = (isset($_GET["id"]) ? $_GET["id"] : -1);
$uuid = (isset($_GET["uuid"]) ? $_GET["uuid"] : null);
if($uuid != null){
// add '-' to have real UUID
if(!(preg_match("/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i", $uuid))){
$nextUUID = "";
$i = 1;
foreach (str_split($uuid) as $char) {
$nextUUID .= $char;
if($i == 8 || $i == 12 || $i == 16 || $i == 20)
$nextUUID .= "-";
$i++;
}
$uuid = $nextUUID;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php $page->print_common_head(); ?>
</head>
<body>
<?php
$page->show_topbar();
?>
<div class="page-wrapper">
<?php
$page->show_header();
?>
<div class="content-wrapper">
<?php
if($id == -1 && $uuid == null){
?>
<div class="container">
<h1><?php echo $page->msg("error.not_found.verifications"); ?></h1>
</div>
<?php
} else {
$stVerif = null;
$request = "";
if($id != -1){
$stVerif = $page->conn->prepare("SELECT * FROM negativity_verifications WHERE id = ?;");
$stVerif->execute(array($id));
} else if($uuid != null){
$stVerif = $page->conn->prepare("SELECT * FROM negativity_verifications WHERE uuid = ?;");
$stVerif->execute(array($uuid));
}
$allRowVerif = $stVerif->fetchAll(PDO::FETCH_ASSOC);
$stVerif->closeCursor();
if(count($allRowVerif) == 0){
?>
<div class="container">
<h1><?php echo $page->msg("error.not_found.verifications"); ?></h1>
</div>
<?php
} else {
echo '<div class="container"><table>';
?>
<thead>
<tr>
<th style="width: 10%"><?php echo $page->msg("column.name"); ?></th>
<th style="width: 10%"><?php echo $page->msg("column.started_by"); ?></th>
<th style="width: 50%"><?php echo $page->msg("verifications.result"); ?></th>
</tr>
</thead>
<?php
foreach ($allRowVerif as $rowVerif) {
?>
<tr>
<td rowspan=1><?php echo $page->get_avatar($page->get_name($rowVerif["uuid"]), $rowVerif["uuid"]); ?></td>
<td rowspan=1><?php echo $page->get_avatar($rowVerif["startedBy"], $page->get_uuid($rowVerif["startedBy"])); ?></td>
<td rowspan=2><?php echo str_replace("\n", "<br>", $page->addColorFromResult($rowVerif["result"])); ?></td>
</tr>
<tr>
<td><?php echo $page->parse_version_name($rowVerif["player_version"]); ?></td>
<td><?php echo strtolower($rowVerif["creation_time"]); ?></td>
</tr>
<?php
}
echo '</table></div><br/>';
$page->show_footer();
}
}
?>
</div>
</div>
</body>
</html>