forked from notkohlrexo/IXWare-Source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchat.php
275 lines (260 loc) · 10.4 KB
/
chat.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<?php
@session_start();
$title = 'Chat';
include_once 'includes/layout/header.php';
include_once 'includes/checks.php';
$getRank = pdoQuery($db, "SELECT `rank` FROM `users` WHERE `id`=?", [htmlspecialchars($_SESSION['ID'])])->fetchColumn();
$notificationSound = pdoQuery($db, "SELECT `notificationPath` FROM `users` WHERE `id`=?", [htmlspecialchars($_SESSION['ID'])])->fetchColumn();
if(isset($_SESSION['username'])){
$username = htmlspecialchars($_SESSION['username']);
}else{
$username = "Unknown";
}
?>
<body class="bg-dark">
<!--Main Navigation-->
<header>
<!-- Sidenav -->
<nav id="sidenav-1" class="sidenav bg-dark" data-hidden="false" data-accordion="true">
<a class="ripple d-flex justify-content-center py-4" href="#!" data-ripple-color="primary">
<img id="IXWARE Logo" src="resources/img/ixwarelogogif.gif" alt="IX Logo" draggable="false" style="width: 170px;" />
</a>
<ul class="sidenav-menu">
<li class="sidenav-item ml-4 mt-2 mb-1 text-white">
<span>General</span>
</li>
<li class="sidenav-item">
<a class="sidenav-link" href="dashboard">
<i class="fas fa-tachometer-slow fa-fw mr-3"></i><span>Dashboard</span>
</a>
</li>
<li class="sidenav-item">
<a class="sidenav-link active" href="chat">
<i class="fas fa-comments-alt fa-fw mr-3"></i><span>Chat</span>
</a>
</li>
<?php
if ($getRank == "User" || $getRank == "Admin"){
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='purchase'>
<i class='fas fa-shopping-basket fa-fw mr-3'></i><span>Purchase</span>
</a>
</li>";
}
?>
<li class="sidenav-item ml-4 mt-4 mb-1 text-white">
<span>Managing</span>
</li>
<li class="sidenav-item">
<a class="sidenav-link">
<i class="fas fa-users fa-fw mr-3"></i><span>Bots</span>
</a>
<ul class="sidenav-collapse">
<?php
if ($getRank == "Premium" || $getRank == "Admin"){
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='bots'>Stubs <span class='badge bg-danger ml-2' id='bot-logs'>0</span></a>
</li>";
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='jsBots'>Javascript <span class='badge bg-danger ml-2' id='cookie-logs'>0</span></a>
</li>";
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='psBots'>Phishing <span class='badge bg-danger ml-2' id='ps-logs'>0</span></a>
</li>";
}elseif($getRank == "User"){
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='jsBots'>Javascript <span class='badge bg-danger ml-2' id='cookie-logs'>0</span></a>
</li>";
}
?>
</ul>
</li>
<li class="sidenav-item">
<a class="sidenav-link">
<i class="fas fa-shield-virus fa-fw mr-3"></i><span>Builder</span>
</a>
<ul class="sidenav-collapse">
<?php
if ($getRank == "Premium" || $getRank == "Admin"){
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='builder'>Stub</a>
</li>";
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='jsBuilder'>Javascript</a>
</li>";
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='psBuilder'>Phishing</a>
</li>";
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='bmBuilder'>Bookmark</a>
</li>";
}elseif($getRank == "User"){
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='jsBuilder'>Javascript</a>
</li>";
}
?>
</ul>
</li>
<li class="sidenav-item">
<a class="sidenav-link">
<i class="fas fa-file-download fa-fw mr-3"></i><span>Builds</span>
</a>
<ul class="sidenav-collapse">
<?php
if ($getRank == "Premium" || $getRank == "Admin"){
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='builds'>Stub</a>
</li>";
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='jsBuilds'>Javascript</a>
</li>";
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='psBuilds'>Phishing</a>
</li>";
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='bmBuilds'>Bookmark</a>
</li>";
}elseif($getRank == "User"){
echo "<li class='sidenav-item'>
<a class='sidenav-link' href='jsBuilds'>Javascript</a>
</li>";
}
?>
</ul>
</li>
<li class="sidenav-item ml-4 mt-4 mb-1 text-white">
<span>Account</span>
</li>
<li class="sidenav-item">
<a class="sidenav-link">
<i class="fas fa-sliders-h fa-fw mr-3"></i><span>Settings</span>
</a>
<ul class="sidenav-collapse">
<li class="sidenav-item">
<a class="sidenav-link" href="settings">General</a>
</li>
<li class="sidenav-item">
<a class="sidenav-link" href="builder-settings">Builder</a>
</li>
</ul>
</li>
<li class="sidenav-item">
<a class="sidenav-link" href="ix-licenses">
<i class="fab fa-keycdn fa-fw mr-3"#></i><span>Licenses</span>
</a>
</li>
<li class="sidenav-item">
<a class="sidenav-link" href="support">
<i class="fas fa-question-circle fa-fw mr-3"#></i><span>Support</span>
</a>
</li>
<li class="sidenav-item">
<a class="sidenav-link" href="logout">
<i class="fal fa-sign-out fa-fw mr-3"></i><span>Logout</span>
</a>
</li>
</ul>
</nav>
<!-- Sidenav -->
<!-- Navbar -->
<nav
id="main-navbar"
class="navbar navbar-expand-lg navbar-light fixed-top bg-dark"
>
<!-- Container wrapper -->
<div class="container-fluid">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item text-white">Dashboard</li>
</ol>
</nav>
<!-- Toggler -->
<button
data-toggle="sidenav"
data-target="#sidenav-1"
class="btn shadow-0 p-0 mr-3 d-block d-xxl-none"
aria-controls="#sidenav-1"
aria-haspopup="true"
>
<i class="fas fa-bars fa-lg"></i>
</button>
<!-- Right links -->
<ul class="navbar-nav ml-auto d-flex flex-row">
<!-- Icon -->
<li class="nav-item">
<a class="nav-link mr-3 mr-lg-0 mt-2 text-white">
<?= $username ?>
</a>
</li>
<!-- Icon -->
<li class="nav-item">
<a class="nav-link mr-3 mr-lg-0 mt-2">
<?php
if ($getRank == "User"){
echo "<span class='badge bg-light text-dark'>Default</span>";
}elseif ($getRank == "Admin"){
echo "<span class='badge bg-danger'>Administrator</span>";
}elseif ($getRank == "Premium"){
echo "<span class='badge bg-warning text-dark'>Premium</span>";
}
?>
</a>
</li>
<!-- Icon -->
<li class="nav-item">
<a class="nav-link mr-3 mr-lg-0">
<?php
$getAvatar = pdoQuery($db, "SELECT `avatarURL` FROM `users` WHERE `id`=?", [htmlspecialchars($_SESSION['ID'])])->fetchColumn();
$av = htmlspecialchars($getAvatar);
if ($av == '0' || empty($av)){
echo "<img src='resources/img/logo.png' class='img-fluid rounded-circle profile-size' alt='' />";
}else{
echo "<img src='$av' class='img-fluid rounded-circle profile-size' alt='' />";
}
?>
</a>
</li>
</ul>
</div>
<!-- Container wrapper -->
</nav>
<!-- Navbar -->
</header>
<!--Main Navigation-->
<!--Main layout-->
<main style="margin-top: 100px" class="d-flex ml-5 mr-5">
<div class="container-fluid">
<div class="row">
<div class="col-xl-12">
<div class="card chat-card bg-dark" style="display: table;">
<div class="card-body d-flex flex-column">
<div id="msgarea" class="row">
<div class="col-md-4">
<div class="online-box-main">
<ul class="list-group list-group-flush" id="users"></ul>
</div>
</div>
<div class="col-md-8">
<div class="message-box-main" id="message-box" style="word-break: break-all;" ;>
<div class="mr-3" id="chat"></div>
</div>
<form id="messageForm">
<input type="submit" style="display: none;" />
<div class="form-group">
<div class="md-form mr-3">
<input autocomplete="off" id="message" type="text" class="form-control mt-2 bg-dark text-darkwhite" placeholder="Message" />
<div id="typing"></div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<!--Main layout-->
<?php require_once 'includes/layout/footer.php';?>