This repository has been archived by the owner on Mar 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
console.php
84 lines (73 loc) · 3.37 KB
/
console.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
<?php
$PAGE['title'] = "Console";
include 'inc/config.php';
include 'inc/sessions.php';
include 'inc/functions.php';
if ($_SESSION['user']['rank'] < 2) {
die('You must be a Senior Admin.');
}
?>
<!DOCTYPE html>
<html>
<head>
<?php include 'pageparts/head.php'; ?>
<script async src="js/console.js"></script>
</head>
<body>
<div id="wrapper">
<?php include 'pageparts/nav.php'; ?>
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">CJFreedom Panel <small>Console</small></h1>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<span class="pull-right">Auto Scroll <input type="checkbox" id="autoscroll" class="" checked/></span>
<textarea class="form-control" rows="10" id="cjfConsole"></textarea>
<div class="input-group">
<input type="text" id="commandInput" class="form-control">
<span class="input-group-btn">
<button class="btn btn-default" onclick="sendToServer('action=cmd&cmd=' + document.getElementById('commandInput').value + ''); document.getElementById('commandInput').value='';" id="submitCommand" type="button">Send Command</button>
</span>
</div><br />
<div class="input-group">
<input type="text" id="chatInput" class="form-control">
<span class="input-group-btn">
<button class="btn btn-default" onclick="sendToServer('action=chat&message=' + document.getElementById('chatInput').value + ''); document.getElementById('chatInput').value='';" id="submitCommand" type="button">Chat</button>
</span>
</div><br />
<div class="input-group">
<input type="text" id="adminchatInput" class="form-control">
<span class="input-group-btn">
<button class="btn btn-default" onclick="sendToServer('action=adminchat&message=' + document.getElementById('adminchatInput').value + ''); document.getElementById('adminchatInput').value='';" id="submitCommand" type="button">Admin Chat</button>
</span>
</div>
</div>
<!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->
<script>
var commandBox = document.getElementById('commandInput');
var chatBox = document.getElementById('chatInput');
var adminChatBox = document.getElementById('adminchatInput');
$(commandBox).keyup(function(e) {
if (e.keyCode == 13) {
sendToServer('action=cmd&cmd=' + document.getElementById('commandInput').value + ''); document.getElementById('commandInput').value='';
}
});
$(chatBox).keyup(function(e) {
if (e.keyCode == 13) {
sendToServer('action=chat&message=' + document.getElementById('chatInput').value + ''); document.getElementById('chatInput').value='';
}
});
$(adminChatBox).keyup(function(e) {
if (e.keyCode == 13) {
sendToServer('action=adminchat&message=' + document.getElementById('adminchatInput').value + ''); document.getElementById('adminchatInput').value='';
}
});
</script>
<?php include 'pageparts/footerjs.php'; ?>
</body>
</html>