This repository was archived by the owner on Jul 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.php
More file actions
112 lines (94 loc) · 3.84 KB
/
Copy pathsearch.php
File metadata and controls
112 lines (94 loc) · 3.84 KB
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
<?php
// api and config
require 'mojang-api.class.php';
require 'config.php';
// if no post set, rec to startpage
if(!isset($_POST['username'])){
header('Location: '.$domain);
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title><?php echo $richname; ?></title>
<meta name="description" content="<?php echo $richtext; ?>">
<meta name="theme-color" content="#424242">
<meta charset="UTF-8">
<noscript>
<link rel="stylesheet" href="css/skel.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-xlarge.css" />
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
</noscript>
</head>
<body id="landing">
<!-- Header -->
<header id="header">
<h1><a href="<?php echo $maindomain; ?>"><?php echo $servername; ?></a></h1>
<nav id="nav">
<ul>
<li><a href="<?php echo $domain;?>">Startseite</a></li>
</ul>
</nav>
</header>
<!-- One -->
<section class="wrapper style special">
<header class="major">
<h2><?php echo $servername; ?></h2>
</header>
<div class="container">
<div class="row">
<div class="6u 12u$(medium)">
<section class="box">
<h3>Spieler suchen</h3>
<p></p>
<form id="login" action="search.php" method="post">
<p>Spielername oder Rang: <input type="text" name="username" class="form-control" placeholder="Spielername oder Rang" required /></p>
<p></p>
<input type="submit" value="Spieler suchen" />
<p></p>
</form>
</section>
</div>
<div class="6u 12u$(medium)">
<section class="box">
<h3>Stats </h3>
<?php
// convert name to uuid
$name = htmlspecialchars($_POST['username']);
$uuid = MojangAPI::getUuid($name);
$fulluuid = MojangAPI::formatUuid($uuid);
// mysql data
$statement = $pdo->prepare("SELECT * FROM bedwars WHERE UUID = ? LIMIT 1");
$statement->execute(array($fulluuid));
$anzahl_user = $statement->rowCount();
if ($anzahl_user != "0") {
// user found
while($row = $statement->fetch()) {
echo '<h4>von '.$row['NAME'].'</h4>';
echo '<p><img src="https://minotar.net/helm/'.$row['NAME'].'/100" class="img-responsive"></p>';
echo '<p>Spieler getötet: '.$row['KILLS'].'</p>';
echo '<p>Tode: '.$row['DEATHS'].'</p>';
echo '<p>Spiele gewonnen: '.$row['WINS'].'</p>';
echo '<p>Spiele gespielt: '.$row['PLAYED'].'</p>';
echo '<p>Betten zerstört '.$row['BED'].'</p>';
echo '<p>Punkte '.$row['POINTS'].'</p>';
}
} else {
// noch user found
?>
<h4>Der Spieler <?php echo $_POST['username'];?> wurde nicht gefunden, er hat anscheinend noch nie auf dem Server gespielt. <p>
<p>mh schade..</h4>
<?php
}
?>
</section>
</div>
</div>
</section>
<script src="js/jquery.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/skel-layers.min.js"></script>
<script src="js/init.js"></script>
</body>
</html>