-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
159 lines (139 loc) · 3.8 KB
/
index.php
File metadata and controls
159 lines (139 loc) · 3.8 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
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
<?php
session_start();
$_SITE_INCLUDED = true;
require_once "config.inc.php";
require_once "function.inc.php";
require_once 'oauth.inc.php';
require_once "rcon.php";
use Thedudeguy\Rcon;
$mysqli = new mysqli($mysql_host, $mysql_user, $mysql_pw, $mysql_db);
$oauth = new oauth("twitch", $twitch_base_url, $twitch_client_id, $twitch_client_secret);
$rcon = new Rcon($mc_host, $mc_port, $mc_password, $mc_timeout);
$display_error = false;
//session timeout
if (!array_key_exists('sess_timeout', $_SESSION))
{
$_SESSION['sess_timeout'] = 0;
}
//timeout check
$spawn_timeout = false;
$spawn_timeout_time = 0;
if ($_SESSION['sess_timeout'] > time())
{
$spawn_timeout = true;
$spawn_timeout_time = $_SESSION['sess_timeout'] - time();
}
//tab control
$active_tab = 0;
if (array_key_exists('tab', $_GET))
{
if(is_numeric($_GET['tab']))
{
$active_tab = $_GET['tab'];
if ($active_tab != 0 && $active_tab != 1 && $active_tab != 2)
{
$active_tab = 0;
}
}
}
require_once 'login.inc.php';
require_once 'spawn.inc.php';
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Manipuliere das Spiel</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<style>
body {
background-color: #343a40;
color: white;
margin-top: 15px;
}
h2 {
margin-bottom: 15px;
}
/**
* Special thanks to: http://blog.koalite.com/bbg/
*/
.btn-twitch {
color: #FFFFFF;
background-color: #6441A5;
border-color: #2F1F4E;
}
.btn-twitch:hover,
.btn-twitch:focus,
.btn-twitch:active,
.btn-twitch.active,
.open .dropdown-toggle.btn-twitch {
color: #FFFFFF;
background-color: #472e75;
border-color: #2F1F4E;
}
.btn-twitch:active,
.btn-twitch.active,
.open .dropdown-toggle.btn-twitch {
background-image: none;
}
.btn-twitch.disabled,
.btn-twitch[disabled],
fieldset[disabled] .btn-twitch,
.btn-twitch.disabled:hover,
.btn-twitch[disabled]:hover,
fieldset[disabled] .btn-twitch:hover,
.btn-twitch.disabled:focus,
.btn-twitch[disabled]:focus,
fieldset[disabled] .btn-twitch:focus,
.btn-twitch.disabled:active,
.btn-twitch[disabled]:active,
fieldset[disabled] .btn-twitch:active,
.btn-twitch.disabled.active,
.btn-twitch[disabled].active,
fieldset[disabled] .btn-twitch.active {
background-color: #6441A5;
border-color: #2F1F4E;
}
.btn-twitch .badge {
color: #6441A5;
background-color: #FFFFFF;
}
</style>
<script>
window.setInterval(function(){
$('.js-countdown').each(function () {
var time = $(this).html();
time--;
if (time < 0)
{
time = 0;
clearInterval();
$('.js-spawnbutton').each(function () {
$(this).html("Spawn");
$(this).removeClass("btn-secondary");
$(this).addClass("btn-primary");
$(this).removeClass("disabled");
});
}
$(this).html(time);
});
}, 1000);
</script>
<script src="https://kit.fontawesome.com/259161033a.js" crossorigin="anonymous"></script>
</head>
<body>
<?php
include "table.inc.php";
?>
<?php
if ($display_error)
{?>
<script>alert('<?php echo $display_error; ?>');</script>
<?php } ?>
<!-- Scripts am Ende //-->
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</body>
</html>