mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-27 03:03:31 +01:00
Stage 6 has been completed, and some classes have been merged into one
This commit is contained in:
+852
-85
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -22,8 +23,10 @@ if (isset(CoreUtilities::$rRequest['id'])) {
|
||||
}
|
||||
|
||||
$_TITLE = (!is_null($rRecordings) ? 'Recordings' : 'TV Archive');
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
@@ -147,7 +150,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
+8
-2
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -8,8 +9,10 @@ if (!checkPermissions()) {
|
||||
}
|
||||
|
||||
$_TITLE = "ASN's";
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
@@ -81,7 +84,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
|
||||
+366
-360
@@ -1,360 +1,366 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Backups';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<form action="#" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Backups</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS) : ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Backup settings successfully updated!
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="alert alert-info alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Backups will not contain any logs, restoring a database will therefore clear all of your logs.<br />If you want to keep your logs you should manually create your own backups.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#backups" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-backup-restore mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Backups</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="backups">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="automatic_backups">Automatic Backups <i title="Generate full SQL backups periodically." class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-2">
|
||||
<select name="automatic_backups" id="automatic_backups" class="form-control" data-toggle="select2">
|
||||
<?php foreach (array('off' => 'Off', 'hourly' => 'Hourly', 'daily' => 'Daily', 'weekly' => 'Weekly', 'monthly' => 'Monthly') as $rType => $rText) : ?>
|
||||
<option value="<?php echo $rType; ?>" <?php if ($rSettings['automatic_backups'] == $rType) echo ' selected'; ?>><?php echo $rText; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-md-4 col-form-label" for="backups_to_keep">Local Backups to Keep <i title="Enter 0 for unlimited. Oldest will be deleted." class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-2">
|
||||
<input type="text" class="form-control text-center" id="backups_to_keep" name="backups_to_keep" value="<?php echo htmlspecialchars($rSettings['backups_to_keep'] ?: 0); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="dropbox_remote">Dropbox Backups <i title="Once a local backup is generated, upload it to Dropbox for safe remote storage." class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-2">
|
||||
<input name="dropbox_remote" id="dropbox_remote" type="checkbox" <?php if ($rSettings['dropbox_remote']) echo 'checked '; ?>data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
<label class="col-md-4 col-form-label" for="dropbox_keep">Dropbox Backups to Keep <i title="Enter 0 for unlimited. Oldest will be deleted." class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-2">
|
||||
<input type="text" class="form-control text-center" id="dropbox_keep" name="dropbox_keep" value="<?php echo htmlspecialchars($rSettings['dropbox_keep'] ?: 0); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="dropbox_token">Dropbox Token <i title="Create an application in the Dropbox Developer section, set the expiration to never then generate a token." class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" id="dropbox_token" name="dropbox_token" value="<?php echo htmlspecialchars($rSettings['dropbox_token']); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<?php if (strlen($rSettings['dropbox_token']) > 0 && !checkRemote()) : ?>
|
||||
<div class="alert alert-danger text-center" role="alert">
|
||||
Could not access your Dropbox through the API key provided above. Please generate a new one or check that your key is correct.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<table class="table table-striped table-borderless mb-0" id="datatable-backups">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Date</th>
|
||||
<th class="text-center">Filename</th>
|
||||
<th class="text-center">Filesize</th>
|
||||
<th class="text-center">Local</th>
|
||||
<th class="text-center">Dropbox</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0" style="margin-top:30px;">
|
||||
<li class="list-inline-item">
|
||||
<button id="create_backup" onClick="api('', 'backup')" class="btn btn-info">Create Backup Now</button>
|
||||
</li>
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="submit_settings" type="submit" class="btn btn-primary" value="Save Changes" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function api(rID, rType, rConfirm = false) {
|
||||
if ((rType == "delete") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Delete",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to delete this backup?",
|
||||
confirm: function() {
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else if ((rType == "restore") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Restore",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to restore from this backup? This will erase your current database.",
|
||||
confirm: function() {
|
||||
$.toast("Restoring backup in background, please exit the system until complete.");
|
||||
$(".content-page").fadeOut();
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else {
|
||||
rConfirm = true;
|
||||
}
|
||||
if (rType == "backup") {
|
||||
$.toast("Creating backup in background, this may take a few minutes.");
|
||||
$("#create_backup").attr("disabled", true);
|
||||
}
|
||||
if (rConfirm) {
|
||||
$.getJSON("./api?action=backup&sub=" + rType + "&filename=" + encodeURIComponent(rID), function(data) {
|
||||
if (data.result === true) {
|
||||
if (rType == "delete") {
|
||||
$.toast("Backup successfully deleted.");
|
||||
}
|
||||
if (rType != "backup") {
|
||||
$("#datatable-backups").DataTable().ajax.reload(null, false);
|
||||
}
|
||||
} else {
|
||||
$.toast("An error occured while processing your request.");
|
||||
if (rType == "backup") {
|
||||
$("#create_backup").attr("disabled", false);
|
||||
}
|
||||
if (!$(".content-page").is(":visible")) {
|
||||
$(".content-page").fadeIn();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('select').select2({
|
||||
width: '100%'
|
||||
});
|
||||
$("#datatable-backups").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
drawCallback: function() {
|
||||
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
bInfo: false,
|
||||
paging: false,
|
||||
searching: false,
|
||||
bSort: false,
|
||||
responsive: false,
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "./table",
|
||||
"data": function(d) {
|
||||
d.id = "backups"
|
||||
}
|
||||
},
|
||||
columnDefs: [{
|
||||
"className": "dt-center",
|
||||
"targets": [0, 1, 2, 3, 4, 5]
|
||||
}],
|
||||
});
|
||||
$("#datatable-backups").css("width", "100%");
|
||||
$("#backups_to_keep").inputFilter(function(value) {
|
||||
return /^\d*$/.test(value);
|
||||
});
|
||||
$("#dropbox_keep").inputFilter(function(value) {
|
||||
return /^\d*$/.test(value);
|
||||
});
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Backups';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<form action="#" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Backups</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS) : ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Backup settings successfully updated!
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="alert alert-info alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Backups will not contain any logs, restoring a database will therefore clear all of your logs.<br />If you want to keep your logs you should manually create your own backups.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#backups" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-backup-restore mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Backups</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="backups">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="automatic_backups">Automatic Backups <i title="Generate full SQL backups periodically." class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-2">
|
||||
<select name="automatic_backups" id="automatic_backups" class="form-control" data-toggle="select2">
|
||||
<?php foreach (array('off' => 'Off', 'hourly' => 'Hourly', 'daily' => 'Daily', 'weekly' => 'Weekly', 'monthly' => 'Monthly') as $rType => $rText) : ?>
|
||||
<option value="<?php echo $rType; ?>" <?php if ($rSettings['automatic_backups'] == $rType) echo ' selected'; ?>><?php echo $rText; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-md-4 col-form-label" for="backups_to_keep">Local Backups to Keep <i title="Enter 0 for unlimited. Oldest will be deleted." class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-2">
|
||||
<input type="text" class="form-control text-center" id="backups_to_keep" name="backups_to_keep" value="<?php echo htmlspecialchars($rSettings['backups_to_keep'] ?: 0); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="dropbox_remote">Dropbox Backups <i title="Once a local backup is generated, upload it to Dropbox for safe remote storage." class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-2">
|
||||
<input name="dropbox_remote" id="dropbox_remote" type="checkbox" <?php if ($rSettings['dropbox_remote']) echo 'checked '; ?>data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
<label class="col-md-4 col-form-label" for="dropbox_keep">Dropbox Backups to Keep <i title="Enter 0 for unlimited. Oldest will be deleted." class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-2">
|
||||
<input type="text" class="form-control text-center" id="dropbox_keep" name="dropbox_keep" value="<?php echo htmlspecialchars($rSettings['dropbox_keep'] ?: 0); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="dropbox_token">Dropbox Token <i title="Create an application in the Dropbox Developer section, set the expiration to never then generate a token." class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" id="dropbox_token" name="dropbox_token" value="<?php echo htmlspecialchars($rSettings['dropbox_token']); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<?php if (strlen($rSettings['dropbox_token']) > 0 && !checkRemote()) : ?>
|
||||
<div class="alert alert-danger text-center" role="alert">
|
||||
Could not access your Dropbox through the API key provided above. Please generate a new one or check that your key is correct.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<table class="table table-striped table-borderless mb-0" id="datatable-backups">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Date</th>
|
||||
<th class="text-center">Filename</th>
|
||||
<th class="text-center">Filesize</th>
|
||||
<th class="text-center">Local</th>
|
||||
<th class="text-center">Dropbox</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0" style="margin-top:30px;">
|
||||
<li class="list-inline-item">
|
||||
<button id="create_backup" onClick="api('', 'backup')" class="btn btn-info">Create Backup Now</button>
|
||||
</li>
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="submit_settings" type="submit" class="btn btn-primary" value="Save Changes" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function api(rID, rType, rConfirm = false) {
|
||||
if ((rType == "delete") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Delete",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to delete this backup?",
|
||||
confirm: function() {
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else if ((rType == "restore") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Restore",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to restore from this backup? This will erase your current database.",
|
||||
confirm: function() {
|
||||
$.toast("Restoring backup in background, please exit the system until complete.");
|
||||
$(".content-page").fadeOut();
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else {
|
||||
rConfirm = true;
|
||||
}
|
||||
if (rType == "backup") {
|
||||
$.toast("Creating backup in background, this may take a few minutes.");
|
||||
$("#create_backup").attr("disabled", true);
|
||||
}
|
||||
if (rConfirm) {
|
||||
$.getJSON("./api?action=backup&sub=" + rType + "&filename=" + encodeURIComponent(rID), function(data) {
|
||||
if (data.result === true) {
|
||||
if (rType == "delete") {
|
||||
$.toast("Backup successfully deleted.");
|
||||
}
|
||||
if (rType != "backup") {
|
||||
$("#datatable-backups").DataTable().ajax.reload(null, false);
|
||||
}
|
||||
} else {
|
||||
$.toast("An error occured while processing your request.");
|
||||
if (rType == "backup") {
|
||||
$("#create_backup").attr("disabled", false);
|
||||
}
|
||||
if (!$(".content-page").is(":visible")) {
|
||||
$(".content-page").fadeIn();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('select').select2({
|
||||
width: '100%'
|
||||
});
|
||||
$("#datatable-backups").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
drawCallback: function() {
|
||||
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
bInfo: false,
|
||||
paging: false,
|
||||
searching: false,
|
||||
bSort: false,
|
||||
responsive: false,
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "./table",
|
||||
"data": function(d) {
|
||||
d.id = "backups"
|
||||
}
|
||||
},
|
||||
columnDefs: [{
|
||||
"className": "dt-center",
|
||||
"targets": [0, 1, 2, 3, 4, 5]
|
||||
}],
|
||||
});
|
||||
$("#datatable-backups").css("width", "100%");
|
||||
$("#backups_to_keep").inputFilter(function(value) {
|
||||
return /^\d*$/.test(value);
|
||||
});
|
||||
$("#dropbox_keep").inputFilter(function(value) {
|
||||
return /^\d*$/.test(value);
|
||||
});
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
if (!isset($__viewMode)):
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
@@ -50,7 +51,9 @@ if (!isset($rBouquetArr)) {
|
||||
}
|
||||
|
||||
$_TITLE = 'Bouquets';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
endif; // !$__viewMode
|
||||
echo '<div class="wrapper boxed-layout"';
|
||||
|
||||
if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
@@ -308,7 +311,8 @@ if (!isset($rBouquetArr)) {
|
||||
}
|
||||
|
||||
echo "\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t" . '</form>' . "\n\t\t\t\t\t" . '</div>' . "\n\t\t\t\t" . '</div>' . "\n\t\t\t" . '</div>' . "\n\t\t" . '</div>' . "\n\t" . '</div>' . "\n" . '</div>' . "\n";
|
||||
include 'footer.php'; ?>
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin'); ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
@@ -490,4 +494,4 @@ include 'footer.php'; ?>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
+284
-278
@@ -1,278 +1,284 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Bouquet Order';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('bouquet_order'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS_REPLACE) : ?>
|
||||
<div class="alert alert-success show" role="alert">
|
||||
Bouquet order has taken effect and <strong>all</strong> lines and packages have been modified to utilise the new bouquet order.
|
||||
</div>
|
||||
<?php elseif (isset($_STATUS) && $_STATUS == STATUS_SUCCESS) : ?>
|
||||
<div class="alert alert-success show" role="alert">
|
||||
Bouquet order has taken effect, any <strong>new</strong> lines and packages will use this order.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST">
|
||||
<input type="hidden" id="bouquet_order_array" name="bouquet_order_array" value="" />
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#order-stream" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-flower-tulip-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline"><?php echo $language::get('bouquet_order'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="order-stream">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="sub-header"><?php echo $language::get('bouquet_sort_text'); ?></p>
|
||||
<select multiple id="sort_bouquet" class="form-control" style="min-height:400px;">
|
||||
<?php foreach (getBouquets() as $rBouquet) : ?>
|
||||
<option value="<?php echo $rBouquet['id']; ?>"><?php echo $rBouquet['bouquet_name']; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="custom-control custom-checkbox add-margin-top-20">
|
||||
<input type="checkbox" class="custom-control-input" name="confirmReplace" id="confirmReplace">
|
||||
<label class="custom-control-label" for="confirmReplace">Replace bouquet order for all users and packages retrospectively. This can take a while.</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0 add-margin-top-20">
|
||||
<li class="list-inline-item">
|
||||
<a href="javascript: void(0);" onClick="MoveUp()" class="btn btn-purple"><i class="mdi mdi-chevron-up"></i></a>
|
||||
<a href="javascript: void(0);" onClick="MoveDown()" class="btn btn-purple"><i class="mdi mdi-chevron-down"></i></a>
|
||||
<a href="javascript: void(0);" onClick="MoveTop()" class="btn btn-pink"><i class="mdi mdi-chevron-triple-up"></i></a>
|
||||
<a href="javascript: void(0);" onClick="MoveBottom()" class="btn btn-pink"><i class="mdi mdi-chevron-triple-down"></i></a>
|
||||
<a href="javascript: void(0);" onClick="AtoZ()" class="btn btn-info"><?php echo $language::get('a_to_z'); ?></a>
|
||||
</li>
|
||||
<li class="list-inline-item float-right">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light"><?php echo $language::get('save_changes'); ?></button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function AtoZ() {
|
||||
$("#sort_bouquet").append($("#sort_bouquet option").remove().sort(function(a, b) {
|
||||
var at = $(a).text().toUpperCase(),
|
||||
bt = $(b).text().toUpperCase();
|
||||
return (at > bt) ? 1 : ((at < bt) ? -1 : 0);
|
||||
}));
|
||||
}
|
||||
|
||||
function MoveUp() {
|
||||
var rSelected = $('#sort_bouquet option:selected');
|
||||
if (rSelected.length) {
|
||||
var rPrevious = rSelected.first().prev()[0];
|
||||
if ($(rPrevious).html() != '') {
|
||||
rSelected.first().prev().before(rSelected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function MoveDown() {
|
||||
var rSelected = $('#sort_bouquet option:selected');
|
||||
if (rSelected.length) {
|
||||
rSelected.last().next().after(rSelected);
|
||||
}
|
||||
}
|
||||
|
||||
function MoveTop() {
|
||||
var rSelected = $('#sort_bouquet option:selected');
|
||||
if (rSelected.length) {
|
||||
rSelected.prependTo($('#sort_bouquet'));
|
||||
}
|
||||
}
|
||||
|
||||
function MoveBottom() {
|
||||
var rSelected = $('#sort_bouquet option:selected');
|
||||
if (rSelected.length) {
|
||||
rSelected.appendTo($('#sort_bouquet'));
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('.select2').select2({
|
||||
width: '100%'
|
||||
});
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
rOrder = [];
|
||||
$('#sort_bouquet option').each(function() {
|
||||
rOrder.push($(this).val());
|
||||
});
|
||||
$("#bouquet_order_array").val(JSON.stringify(rOrder));
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Bouquet Order';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('bouquet_order'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS_REPLACE) : ?>
|
||||
<div class="alert alert-success show" role="alert">
|
||||
Bouquet order has taken effect and <strong>all</strong> lines and packages have been modified to utilise the new bouquet order.
|
||||
</div>
|
||||
<?php elseif (isset($_STATUS) && $_STATUS == STATUS_SUCCESS) : ?>
|
||||
<div class="alert alert-success show" role="alert">
|
||||
Bouquet order has taken effect, any <strong>new</strong> lines and packages will use this order.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST">
|
||||
<input type="hidden" id="bouquet_order_array" name="bouquet_order_array" value="" />
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#order-stream" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-flower-tulip-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline"><?php echo $language::get('bouquet_order'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="order-stream">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="sub-header"><?php echo $language::get('bouquet_sort_text'); ?></p>
|
||||
<select multiple id="sort_bouquet" class="form-control" style="min-height:400px;">
|
||||
<?php foreach (getBouquets() as $rBouquet) : ?>
|
||||
<option value="<?php echo $rBouquet['id']; ?>"><?php echo $rBouquet['bouquet_name']; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="custom-control custom-checkbox add-margin-top-20">
|
||||
<input type="checkbox" class="custom-control-input" name="confirmReplace" id="confirmReplace">
|
||||
<label class="custom-control-label" for="confirmReplace">Replace bouquet order for all users and packages retrospectively. This can take a while.</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0 add-margin-top-20">
|
||||
<li class="list-inline-item">
|
||||
<a href="javascript: void(0);" onClick="MoveUp()" class="btn btn-purple"><i class="mdi mdi-chevron-up"></i></a>
|
||||
<a href="javascript: void(0);" onClick="MoveDown()" class="btn btn-purple"><i class="mdi mdi-chevron-down"></i></a>
|
||||
<a href="javascript: void(0);" onClick="MoveTop()" class="btn btn-pink"><i class="mdi mdi-chevron-triple-up"></i></a>
|
||||
<a href="javascript: void(0);" onClick="MoveBottom()" class="btn btn-pink"><i class="mdi mdi-chevron-triple-down"></i></a>
|
||||
<a href="javascript: void(0);" onClick="AtoZ()" class="btn btn-info"><?php echo $language::get('a_to_z'); ?></a>
|
||||
</li>
|
||||
<li class="list-inline-item float-right">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light"><?php echo $language::get('save_changes'); ?></button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function AtoZ() {
|
||||
$("#sort_bouquet").append($("#sort_bouquet option").remove().sort(function(a, b) {
|
||||
var at = $(a).text().toUpperCase(),
|
||||
bt = $(b).text().toUpperCase();
|
||||
return (at > bt) ? 1 : ((at < bt) ? -1 : 0);
|
||||
}));
|
||||
}
|
||||
|
||||
function MoveUp() {
|
||||
var rSelected = $('#sort_bouquet option:selected');
|
||||
if (rSelected.length) {
|
||||
var rPrevious = rSelected.first().prev()[0];
|
||||
if ($(rPrevious).html() != '') {
|
||||
rSelected.first().prev().before(rSelected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function MoveDown() {
|
||||
var rSelected = $('#sort_bouquet option:selected');
|
||||
if (rSelected.length) {
|
||||
rSelected.last().next().after(rSelected);
|
||||
}
|
||||
}
|
||||
|
||||
function MoveTop() {
|
||||
var rSelected = $('#sort_bouquet option:selected');
|
||||
if (rSelected.length) {
|
||||
rSelected.prependTo($('#sort_bouquet'));
|
||||
}
|
||||
}
|
||||
|
||||
function MoveBottom() {
|
||||
var rSelected = $('#sort_bouquet option:selected');
|
||||
if (rSelected.length) {
|
||||
rSelected.appendTo($('#sort_bouquet'));
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('.select2').select2({
|
||||
width: '100%'
|
||||
});
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
rOrder = [];
|
||||
$('#sort_bouquet option').each(function() {
|
||||
rOrder.push($(this).val());
|
||||
});
|
||||
$("#bouquet_order_array").val(JSON.stringify(rOrder));
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+591
-585
File diff suppressed because it is too large
Load Diff
+232
-224
@@ -1,224 +1,232 @@
|
||||
<?php include 'session.php'; ?>
|
||||
<?php include 'functions.php'; ?>
|
||||
|
||||
<?php if (checkPermissions()): ?>
|
||||
<?php else: goHome(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $rBouquets = getBouquets(); ?>
|
||||
<?php $_TITLE = 'Bouquets'; ?>
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
<div class="wrapper boxed-layout-ext" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest'): ?><?php else: ?> style="display: none;" <?php endif; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('bouquets'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (!(isset($_STATUS) && $_STATUS == STATUS_SUCCESS)): ?>
|
||||
<?php else: ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Bouquet has been added / modified.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th><?php echo $language::get('bouquet_name'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('streams'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('movies'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('series'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('stations'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($rBouquets as $rBouquet): ?>
|
||||
<tr id="bouquet-<?php echo intval($rBouquet['id']); ?>">
|
||||
<td class="text-center"><?php echo intval($rBouquet['id']); ?></td>
|
||||
<td><?php echo htmlspecialchars($rBouquet['bouquet_name']); ?></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light"><?php echo number_format(count(json_decode($rBouquet['bouquet_channels'], true)), 0); ?></button></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light"><?php echo number_format(count(json_decode($rBouquet['bouquet_movies'], true)), 0); ?></button></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light"><?php echo number_format(count(json_decode($rBouquet['bouquet_series'], true)), 0); ?></button></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light"><?php echo number_format(count(json_decode($rBouquet['bouquet_radios'], true)), 0); ?></button></td>
|
||||
<td class="text-center">
|
||||
<?php if (hasPermissions('adv', 'edit_bouquet')): ?>
|
||||
<div class="btn-group">
|
||||
<a href="./bouquet_sort?id=<?php echo intval($rBouquet['id']); ?>"><button type="button" title="<?php echo $language::get('reorder_bouquet'); ?>" class="btn btn-light waves-effect waves-light btn-xs tooltip"><i class="mdi mdi-format-line-spacing"></i></button></a>
|
||||
<a href="./bouquet?id=<?php echo intval($rBouquet['id']); ?>"><button type="button" title="<?php echo $language::get('edit_bouquet'); ?>" class="btn btn-light waves-effect waves-light btn-xs tooltip"><i class="mdi mdi-pencil-outline"></i></button></a>
|
||||
<a href="./bouquet?duplicate=<?php echo intval($rBouquet['id']); ?>"><button type="button" title="Duuplicate Bouquet" class="btn btn-light waves-effect waves-light btn-xs tooltip"><i class="mdi mdi-content-copy"></i></button></a>
|
||||
<button type="button" title="<?php echo $language::get('delete_bouquet'); ?>" class="btn btn-light waves-effect waves-light btn-xs tooltip" onClick="api(<?php echo intval($rBouquet['id']); ?>, 'delete');"><i class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
<?php else: ?>--
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function api(rID, rType, rConfirm=false) {' . "\r\n\t\t\t" . 'if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('delete_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=bouquet&sub=" + rType + "&bouquet_id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {' . "\r\n" . ' $("#datatable").DataTable().rows(rRow).remove().draw(false);' . "\r\n" . ' }' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('deleted_bouquet');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\r\n" . ' bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php'; ?>
|
||||
<?php include 'functions.php'; ?>
|
||||
|
||||
<?php if (checkPermissions()): ?>
|
||||
<?php else: goHome(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $rBouquets = getBouquets(); ?>
|
||||
<?php $_TITLE = 'Bouquets'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper boxed-layout-ext" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest'): ?><?php else: ?> style="display: none;" <?php endif; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('bouquets'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (!(isset($_STATUS) && $_STATUS == STATUS_SUCCESS)): ?>
|
||||
<?php else: ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Bouquet has been added / modified.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th><?php echo $language::get('bouquet_name'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('streams'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('movies'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('series'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('stations'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($rBouquets as $rBouquet): ?>
|
||||
<tr id="bouquet-<?php echo intval($rBouquet['id']); ?>">
|
||||
<td class="text-center"><?php echo intval($rBouquet['id']); ?></td>
|
||||
<td><?php echo htmlspecialchars($rBouquet['bouquet_name']); ?></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light"><?php echo number_format(count(json_decode($rBouquet['bouquet_channels'], true)), 0); ?></button></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light"><?php echo number_format(count(json_decode($rBouquet['bouquet_movies'], true)), 0); ?></button></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light"><?php echo number_format(count(json_decode($rBouquet['bouquet_series'], true)), 0); ?></button></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light"><?php echo number_format(count(json_decode($rBouquet['bouquet_radios'], true)), 0); ?></button></td>
|
||||
<td class="text-center">
|
||||
<?php if (hasPermissions('adv', 'edit_bouquet')): ?>
|
||||
<div class="btn-group">
|
||||
<a href="./bouquet_sort?id=<?php echo intval($rBouquet['id']); ?>"><button type="button" title="<?php echo $language::get('reorder_bouquet'); ?>" class="btn btn-light waves-effect waves-light btn-xs tooltip"><i class="mdi mdi-format-line-spacing"></i></button></a>
|
||||
<a href="./bouquet?id=<?php echo intval($rBouquet['id']); ?>"><button type="button" title="<?php echo $language::get('edit_bouquet'); ?>" class="btn btn-light waves-effect waves-light btn-xs tooltip"><i class="mdi mdi-pencil-outline"></i></button></a>
|
||||
<a href="./bouquet?duplicate=<?php echo intval($rBouquet['id']); ?>"><button type="button" title="Duuplicate Bouquet" class="btn btn-light waves-effect waves-light btn-xs tooltip"><i class="mdi mdi-content-copy"></i></button></a>
|
||||
<button type="button" title="<?php echo $language::get('delete_bouquet'); ?>" class="btn btn-light waves-effect waves-light btn-xs tooltip" onClick="api(<?php echo intval($rBouquet['id']); ?>, 'delete');"><i class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
<?php else: ?>--
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function api(rID, rType, rConfirm=false) {' . "\r\n\t\t\t" . 'if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('delete_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=bouquet&sub=" + rType + "&bouquet_id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {' . "\r\n" . ' $("#datatable").DataTable().rows(rRow).remove().draw(false);' . "\r\n" . ' }' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('deleted_bouquet');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\r\n" . ' bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+9
-3
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php'; ?>
|
||||
<?php include 'functions.php'; ?>
|
||||
|
||||
@@ -9,8 +10,10 @@
|
||||
CoreUtilities::$rSettings = CoreUtilities::getSettings(true);
|
||||
$rSettings = CoreUtilities::$rSettings;
|
||||
$_TITLE = 'Cache & Redis Settings';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper boxed-layout-ext" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
echo '';
|
||||
@@ -267,7 +270,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
@@ -473,4 +479,4 @@ include 'header.php';
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
+570
-564
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php if (!isset($__viewMode)):
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
@@ -8,7 +8,9 @@ if (!checkPermissions()) {
|
||||
}
|
||||
|
||||
$_TITLE = 'Client Logs';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
endif;
|
||||
?>
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
@@ -78,7 +80,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
+424
-418
@@ -1,418 +1,424 @@
|
||||
<?php include 'session.php';
|
||||
include 'functions.php';
|
||||
if (checkPermissions()) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
if (isset(CoreUtilities::$rRequest['id']) && !($rCode = getCode(CoreUtilities::$rRequest['id']))) {
|
||||
exit();
|
||||
}
|
||||
$_TITLE = 'Access Code';
|
||||
include 'header.php'; ?>
|
||||
<div class="wrapper boxed-layout"
|
||||
<?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else { ?>
|
||||
style="display: none;" <?php } ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php if (isset($rCode)) {
|
||||
echo 'Edit Code';
|
||||
} else {
|
||||
echo 'Add Code';
|
||||
} ?>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<?php if (!(isset($rCode) && getCurrentCode() == $rCode['code'])) {
|
||||
} else { ?>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
You are editing the Access Code you're currently using to access the system. Ensure you have set up
|
||||
another access code before disabling or modifying the access rights of this group.
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST" data-parsley-validate="">
|
||||
<?php if (!isset($rCode)) {
|
||||
} else { ?>
|
||||
<input type="hidden" name="edit" value="<?php echo $rCode['id']; ?>" />
|
||||
<?php } ?>
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#code-details" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-account-card-details-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline"><?php echo $language::get('details'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#groups" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-account-group mr-1"></i>
|
||||
<span class="d-none d-sm-inline"><?php echo $language::get('groups'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#restrictions" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-hazard-lights mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Restrictions</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="code-details">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="code">Access Code <i
|
||||
title="Enter a secure access code that cannot be guessed. It needs to be at least 8 characters and should be random."
|
||||
class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-9 input-group">
|
||||
<input type="text" maxlength="16" class="form-control" id="code"
|
||||
name="code"
|
||||
value="<?php if (isset($rCode)) {
|
||||
echo htmlspecialchars($rCode['code']);
|
||||
} ?>"
|
||||
required data-parsley-trigger="change">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-info waves-effect waves-light"
|
||||
onClick="generateCode();" type="button"><i
|
||||
class="mdi mdi-refresh"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="type">Access Type <i
|
||||
title="Select what access to grant."
|
||||
class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-4">
|
||||
<select id="type" name="type" class="form-control select2">
|
||||
<?php foreach (array('Admin', 'Reseller', 'Ministra', 'Admin API', 'Reseller API', 6 => 'Web Player') as $rID => $rValue) { ?>
|
||||
<option
|
||||
<?php if (isset($rCode) && $rCode['type'] == $rID) {
|
||||
echo 'selected';
|
||||
} ?>
|
||||
value="<?php echo $rID; ?>">
|
||||
<?php echo $rValue; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-md- 3col-form-label"
|
||||
for="enabled">Enabled</label>
|
||||
<div class="col-md-2">
|
||||
<input name="enabled" id="enabled" type="checkbox"
|
||||
<?php if (isset($rCode) && $rCode['enabled'] == 1) {
|
||||
echo 'checked';
|
||||
} else if (!isset($rCode)) {
|
||||
echo 'checked';
|
||||
} ?>
|
||||
data-plugin="switchery" class="js-switch"
|
||||
data-color="#039cfd" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="nextb list-inline-item float-right">
|
||||
<a href="javascript: void(0);"
|
||||
class="btn btn-secondary"><?php echo $language::get('next'); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane" id="groups">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<?php foreach (getMemberGroups() as $rGroup) { ?>
|
||||
<div class="col-md-6">
|
||||
<div class="custom-control custom-checkbox mt-1">
|
||||
<input type="checkbox"
|
||||
class="custom-control-input group-checkbox"
|
||||
id="group-<?php echo $rGroup['group_id']; ?>"
|
||||
data-id="<?php echo $rGroup['group_id']; ?>"
|
||||
name="groups[]"
|
||||
value="<?php echo $rGroup['group_id']; ?>"
|
||||
<?php if (isset($rCode) && in_array($rGroup['group_id'], json_decode($rCode['groups'], true))) {
|
||||
echo ' checked';
|
||||
} ?>>
|
||||
<label class="custom-control-label"
|
||||
for="group-<?php echo $rGroup['group_id']; ?>"><?php echo $rGroup['group_name']; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="prevb list-inline-item">
|
||||
<a href="javascript: void(0);"
|
||||
class="btn btn-secondary"><?php echo $language::get('prev'); ?></a>
|
||||
</li>
|
||||
<li class="list-inline-item">
|
||||
<a href="javascript: void(0);" onClick="selectAll()"
|
||||
class="btn btn-secondary"><?php echo $language::get('select_all'); ?></a>
|
||||
<a href="javascript: void(0);" onClick="selectNone()"
|
||||
class="btn btn-secondary"><?php echo $language::get('deselect_all'); ?></a>
|
||||
</li>
|
||||
<li class="nextb list-inline-item float-right">
|
||||
<a href="javascript: void(0);" class="btn btn-secondary">Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane" id="restrictions">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="ip_field">Allowed IP
|
||||
Addresses <i
|
||||
title="Restrict access to specific IP addresses."
|
||||
class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-8 input-group">
|
||||
<input type="text" id="ip_field" class="form-control"
|
||||
value="">
|
||||
<div class="input-group-append">
|
||||
<a href="javascript:void(0)" id="add_ip"
|
||||
class="btn btn-primary waves-effect waves-light"><i
|
||||
class="mdi mdi-plus"></i></a>
|
||||
<a href="javascript:void(0)" id="remove_ip"
|
||||
class="btn btn-danger waves-effect waves-light"><i
|
||||
class="mdi mdi-close"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label"
|
||||
for="whitelist"> </label>
|
||||
<div class="col-md-8">
|
||||
<select id="whitelist" name="whitelist[]" size="6"
|
||||
class="form-control" multiple="multiple">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (isset($rCode)) {
|
||||
foreach (json_decode($rCode['whitelist'], true) as $rIP) { ?>
|
||||
<option value="<?php echo $rIP; ?>"><?php echo $rIP; ?></option>
|
||||
<?php }
|
||||
} ?>
|
||||
</select>
|
||||
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="prevb list-inline-item"><a href="javascript: void(0);" class="btn btn-secondary">Previous</a></li>
|
||||
<li class="list-inline-item float-right"><input name="submit" type="submit" class="btn btn-primary" value="Save"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function generateCode() {
|
||||
var result = '';
|
||||
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
var charactersLength = characters.length;
|
||||
for (var i = 0; i < 8; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
$("#code").val(result);
|
||||
}
|
||||
|
||||
function selectAll() {
|
||||
$(".group-checkbox").each(function() {
|
||||
$(this).prop('checked', true);
|
||||
});
|
||||
}
|
||||
|
||||
function selectNone() {
|
||||
$(".group-checkbox").each(function() {
|
||||
$(this).prop('checked', false);
|
||||
});
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('.select2').select2({
|
||||
width: '100%'
|
||||
});
|
||||
$('#code').keydown(function(e) {
|
||||
var k = e.which;
|
||||
var ok = k >= 65 && k <= 90 || // A-Z
|
||||
k >= 96 && k <= 105 || // a-z
|
||||
k >= 35 && k <= 40 || // arrows
|
||||
k == 8 || // Backspaces
|
||||
(!e.shiftKey && k >= 48 && k <= 57); // 0-9
|
||||
|
||||
if (!ok) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$("#whitelist option").prop('selected', true);
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
$("#add_ip").click(function() {
|
||||
if (($("#ip_field").val()) && (isValidIP($("#ip_field").val()))) {
|
||||
var o = new Option($("#ip_field").val(), $("#ip_field").val());
|
||||
$("#whitelist").append(o);
|
||||
$("#ip_field").val("");
|
||||
} else {
|
||||
$.toast("Please enter a valid IP address.");
|
||||
}
|
||||
});
|
||||
$("#remove_ip").click(function() {
|
||||
$('#whitelist option:selected').remove();
|
||||
});
|
||||
|
||||
<?php if (!isset($rCode)) echo 'generateCode();'; ?>
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php';
|
||||
include 'functions.php';
|
||||
if (checkPermissions()) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
if (isset(CoreUtilities::$rRequest['id']) && !($rCode = getCode(CoreUtilities::$rRequest['id']))) {
|
||||
exit();
|
||||
}
|
||||
$_TITLE = 'Access Code';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin'); ?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout"
|
||||
<?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else { ?>
|
||||
style="display: none;" <?php } ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php if (isset($rCode)) {
|
||||
echo 'Edit Code';
|
||||
} else {
|
||||
echo 'Add Code';
|
||||
} ?>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<?php if (!(isset($rCode) && getCurrentCode() == $rCode['code'])) {
|
||||
} else { ?>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
You are editing the Access Code you're currently using to access the system. Ensure you have set up
|
||||
another access code before disabling or modifying the access rights of this group.
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST" data-parsley-validate="">
|
||||
<?php if (!isset($rCode)) {
|
||||
} else { ?>
|
||||
<input type="hidden" name="edit" value="<?php echo $rCode['id']; ?>" />
|
||||
<?php } ?>
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#code-details" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-account-card-details-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline"><?php echo $language::get('details'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#groups" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-account-group mr-1"></i>
|
||||
<span class="d-none d-sm-inline"><?php echo $language::get('groups'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#restrictions" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-hazard-lights mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Restrictions</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="code-details">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="code">Access Code <i
|
||||
title="Enter a secure access code that cannot be guessed. It needs to be at least 8 characters and should be random."
|
||||
class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-9 input-group">
|
||||
<input type="text" maxlength="16" class="form-control" id="code"
|
||||
name="code"
|
||||
value="<?php if (isset($rCode)) {
|
||||
echo htmlspecialchars($rCode['code']);
|
||||
} ?>"
|
||||
required data-parsley-trigger="change">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-info waves-effect waves-light"
|
||||
onClick="generateCode();" type="button"><i
|
||||
class="mdi mdi-refresh"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="type">Access Type <i
|
||||
title="Select what access to grant."
|
||||
class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-4">
|
||||
<select id="type" name="type" class="form-control select2">
|
||||
<?php foreach (array('Admin', 'Reseller', 'Ministra', 'Admin API', 'Reseller API', 6 => 'Web Player') as $rID => $rValue) { ?>
|
||||
<option
|
||||
<?php if (isset($rCode) && $rCode['type'] == $rID) {
|
||||
echo 'selected';
|
||||
} ?>
|
||||
value="<?php echo $rID; ?>">
|
||||
<?php echo $rValue; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-md- 3col-form-label"
|
||||
for="enabled">Enabled</label>
|
||||
<div class="col-md-2">
|
||||
<input name="enabled" id="enabled" type="checkbox"
|
||||
<?php if (isset($rCode) && $rCode['enabled'] == 1) {
|
||||
echo 'checked';
|
||||
} else if (!isset($rCode)) {
|
||||
echo 'checked';
|
||||
} ?>
|
||||
data-plugin="switchery" class="js-switch"
|
||||
data-color="#039cfd" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="nextb list-inline-item float-right">
|
||||
<a href="javascript: void(0);"
|
||||
class="btn btn-secondary"><?php echo $language::get('next'); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane" id="groups">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<?php foreach (getMemberGroups() as $rGroup) { ?>
|
||||
<div class="col-md-6">
|
||||
<div class="custom-control custom-checkbox mt-1">
|
||||
<input type="checkbox"
|
||||
class="custom-control-input group-checkbox"
|
||||
id="group-<?php echo $rGroup['group_id']; ?>"
|
||||
data-id="<?php echo $rGroup['group_id']; ?>"
|
||||
name="groups[]"
|
||||
value="<?php echo $rGroup['group_id']; ?>"
|
||||
<?php if (isset($rCode) && in_array($rGroup['group_id'], json_decode($rCode['groups'], true))) {
|
||||
echo ' checked';
|
||||
} ?>>
|
||||
<label class="custom-control-label"
|
||||
for="group-<?php echo $rGroup['group_id']; ?>"><?php echo $rGroup['group_name']; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="prevb list-inline-item">
|
||||
<a href="javascript: void(0);"
|
||||
class="btn btn-secondary"><?php echo $language::get('prev'); ?></a>
|
||||
</li>
|
||||
<li class="list-inline-item">
|
||||
<a href="javascript: void(0);" onClick="selectAll()"
|
||||
class="btn btn-secondary"><?php echo $language::get('select_all'); ?></a>
|
||||
<a href="javascript: void(0);" onClick="selectNone()"
|
||||
class="btn btn-secondary"><?php echo $language::get('deselect_all'); ?></a>
|
||||
</li>
|
||||
<li class="nextb list-inline-item float-right">
|
||||
<a href="javascript: void(0);" class="btn btn-secondary">Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane" id="restrictions">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="ip_field">Allowed IP
|
||||
Addresses <i
|
||||
title="Restrict access to specific IP addresses."
|
||||
class="tooltip text-secondary far fa-circle"></i></label>
|
||||
<div class="col-md-8 input-group">
|
||||
<input type="text" id="ip_field" class="form-control"
|
||||
value="">
|
||||
<div class="input-group-append">
|
||||
<a href="javascript:void(0)" id="add_ip"
|
||||
class="btn btn-primary waves-effect waves-light"><i
|
||||
class="mdi mdi-plus"></i></a>
|
||||
<a href="javascript:void(0)" id="remove_ip"
|
||||
class="btn btn-danger waves-effect waves-light"><i
|
||||
class="mdi mdi-close"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label"
|
||||
for="whitelist"> </label>
|
||||
<div class="col-md-8">
|
||||
<select id="whitelist" name="whitelist[]" size="6"
|
||||
class="form-control" multiple="multiple">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (isset($rCode)) {
|
||||
foreach (json_decode($rCode['whitelist'], true) as $rIP) { ?>
|
||||
<option value="<?php echo $rIP; ?>"><?php echo $rIP; ?></option>
|
||||
<?php }
|
||||
} ?>
|
||||
</select>
|
||||
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="prevb list-inline-item"><a href="javascript: void(0);" class="btn btn-secondary">Previous</a></li>
|
||||
<li class="list-inline-item float-right"><input name="submit" type="submit" class="btn btn-primary" value="Save"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function generateCode() {
|
||||
var result = '';
|
||||
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
var charactersLength = characters.length;
|
||||
for (var i = 0; i < 8; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
$("#code").val(result);
|
||||
}
|
||||
|
||||
function selectAll() {
|
||||
$(".group-checkbox").each(function() {
|
||||
$(this).prop('checked', true);
|
||||
});
|
||||
}
|
||||
|
||||
function selectNone() {
|
||||
$(".group-checkbox").each(function() {
|
||||
$(this).prop('checked', false);
|
||||
});
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('.select2').select2({
|
||||
width: '100%'
|
||||
});
|
||||
$('#code').keydown(function(e) {
|
||||
var k = e.which;
|
||||
var ok = k >= 65 && k <= 90 || // A-Z
|
||||
k >= 96 && k <= 105 || // a-z
|
||||
k >= 35 && k <= 40 || // arrows
|
||||
k == 8 || // Backspaces
|
||||
(!e.shiftKey && k >= 48 && k <= 57); // 0-9
|
||||
|
||||
if (!ok) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$("#whitelist option").prop('selected', true);
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
$("#add_ip").click(function() {
|
||||
if (($("#ip_field").val()) && (isValidIP($("#ip_field").val()))) {
|
||||
var o = new Option($("#ip_field").val(), $("#ip_field").val());
|
||||
$("#whitelist").append(o);
|
||||
$("#ip_field").val("");
|
||||
} else {
|
||||
$.toast("Please enter a valid IP address.");
|
||||
}
|
||||
});
|
||||
$("#remove_ip").click(function() {
|
||||
$('#whitelist option:selected').remove();
|
||||
});
|
||||
|
||||
<?php if (!isset($rCode)) echo 'generateCode();'; ?>
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+11
-3
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php'; ?>
|
||||
<?php include 'functions.php'; ?>
|
||||
|
||||
@@ -6,7 +7,11 @@
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $_TITLE = 'Access Codes'; ?>
|
||||
<?php include 'header.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'): ?> style="display: none;" <?php endif; ?>>
|
||||
<div class="container-fluid">
|
||||
@@ -77,7 +82,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
@@ -264,4 +272,4 @@
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
+756
-750
File diff suppressed because one or more lines are too long
+648
-642
File diff suppressed because it is too large
Load Diff
+306
-300
File diff suppressed because one or more lines are too long
@@ -1,10 +1,13 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php';
|
||||
include 'functions.php';
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
$_TITLE = 'Credit Logs';
|
||||
include 'header.php'; ?>
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin'); ?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
@@ -65,7 +68,10 @@ include 'header.php'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
@@ -66,12 +67,11 @@ if (isset(CoreUtilities::$rRequest['server_id'])) {
|
||||
$rOrderedServers = $rServers;
|
||||
array_multisort(array_column($rOrderedServers, 'order'), SORT_ASC, $rOrderedServers);
|
||||
|
||||
$rLicenseType = 'License';
|
||||
|
||||
$_TITLE = 'Dashboard';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
|
||||
<?php endif; ?>
|
||||
<div class="wrapper">
|
||||
<div class="container-fluid">
|
||||
<?php if (hasPermissions('adv', 'index')): ?>
|
||||
@@ -734,7 +734,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php';?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
@@ -922,4 +925,4 @@ echo ' $("#server_id").change(function() {' . "\r\n" . '
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -353,7 +353,7 @@ function display_select($sth, $q) {
|
||||
|
||||
function print_header() {
|
||||
global $err_msg, $VERSION, $DBSERVERS, $SRV, $DB, $dbh, $self, $is_sht, $xurl, $SHOW_T;
|
||||
$dbn = $DB['db'];
|
||||
$dbn = $DB['db'] ?? '';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -729,7 +729,7 @@ function print_header() {
|
||||
|
||||
<div class="inv">
|
||||
<a href="http://phpminiadmin.sourceforge.net/" target="_blank"><b>phpMiniAdmin <?php eo($VERSION) ?></b></a>
|
||||
<?php if ($_SESSION['is_logged'] && $dbh) {
|
||||
<?php if (!empty($_SESSION['is_logged']) && $dbh) {
|
||||
if ($DBSERVERS) { ?>
|
||||
| Servers: <select name="srv" onChange="frefresh()">
|
||||
<option value=''>- select/refresh -</option>
|
||||
@@ -753,7 +753,7 @@ function print_header() {
|
||||
<?php } ?>
|
||||
| <a href="?showcfg=1">Settings</a>
|
||||
<?php } ?>
|
||||
<?php if ($_SESSION['is_logged']) {
|
||||
<?php if (!empty($_SESSION['is_logged'])) {
|
||||
?> | <a href="?<?php eo($xurl) ?>&logoff=1" onclick="logoff()">Logoff</a>
|
||||
<?php } ?>
|
||||
| <a href="?pi=1">phpinfo</a>
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php';
|
||||
include 'functions.php';
|
||||
$_TITLE = 'Edit Profile';
|
||||
include 'header.php'; ?>
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin'); ?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
@@ -70,7 +73,7 @@ include 'header.php'; ?>
|
||||
<label class="col-md-4 col-form-label" for="theme">System Theme</label>
|
||||
<div class="col-md-8">
|
||||
<select name="theme" id="theme" class="form-control" data-toggle="select2">
|
||||
<?php foreach ($rThemes as $rValue => $rArray) { ?>
|
||||
<?php foreach ((is_array($rThemes ?? null) ? $rThemes : []) as $rValue => $rArray) { ?>
|
||||
<option <?php if ($rUserInfo['theme'] == $rValue) {
|
||||
echo 'selected ';
|
||||
} ?>value="<?php echo $rValue; ?>"><?php echo $rArray['name']; ?></option>
|
||||
@@ -82,7 +85,7 @@ include 'header.php'; ?>
|
||||
<label class="col-md-4 col-form-label" for="hue">Topbar Theme</label>
|
||||
<div class="col-md-8">
|
||||
<select name="hue" id="hue" class="form-control" data-toggle="select2">
|
||||
<?php foreach ($rHues as $rValue => $rText) { ?>
|
||||
<?php foreach ((is_array($rHues ?? null) ? $rHues : []) as $rValue => $rText) { ?>
|
||||
<option <?php if ($rUserInfo['hue'] == $rValue) {
|
||||
echo 'selected ';
|
||||
} ?>value="<?php echo $rValue; ?>"><?php echo $rText; ?></option>
|
||||
@@ -94,7 +97,7 @@ include 'header.php'; ?>
|
||||
<label class="col-md-4 col-form-label" for="lang">Language</label>
|
||||
<div class="col-md-8">
|
||||
<select name="lang" id="lang" class="form-control" data-toggle="select2">
|
||||
<?php foreach ($allowedLangs as $rText) { ?>
|
||||
<?php foreach ((is_array($allowedLangs ?? null) ? $allowedLangs : []) as $rText) { ?>
|
||||
<option <?php if ($rUserInfo['lang'] == $rText) {
|
||||
echo 'selected ';
|
||||
} ?>value="<?php echo $rText; ?>"><?php echo $rText; ?></option>
|
||||
@@ -134,7 +137,10 @@ include 'header.php'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
if (!isset($__viewMode)):
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
@@ -24,7 +25,9 @@ if (!isset($rDevice) || isset($rDevice['user'])) {
|
||||
}
|
||||
|
||||
$_TITLE = 'Enigma Device';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
endif; // !$__viewMode
|
||||
echo '<div class="wrapper boxed-layout"';
|
||||
|
||||
if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
@@ -291,7 +294,8 @@ if (isset($rDevice)) {
|
||||
}
|
||||
|
||||
echo '" />' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '</li>' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '</ul>' . "\r\n\t\t\t\t\t\t\t\t\t" . '</div>' . "\r\n\t\t\t\t\t\t\t\t" . '</div> ' . "\r\n\t\t\t\t\t\t\t" . '</div> ' . "\r\n\t\t\t\t\t\t" . '</form>' . "\r\n\t\t\t\t\t" . '</div> ' . "\r\n\t\t\t\t" . '</div> ' . "\r\n\t\t\t" . '</div> ' . "\r\n\t\t" . '</div>' . "\r\n\t" . '</div>' . "\r\n" . '</div>' . "\r\n";
|
||||
include 'footer.php'; ?>
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin'); ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
+451
-445
File diff suppressed because one or more lines are too long
+290
-284
@@ -1,284 +1,290 @@
|
||||
<?php include 'session.php';
|
||||
include 'functions.php';
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
$_TITLE = 'Enigma Devices';
|
||||
include 'header.php'; ?>
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('enigma_devices'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS) { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Device has been added / modified.
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<div id="collapse_filters" class="form-group row mb-4 <?php echo $rMobile ? 'collapse' : ''; ?>">
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" id="e2_search" value="<?php echo isset(CoreUtilities::$rRequest['search']) ? htmlspecialchars(CoreUtilities::$rRequest['search']) : ''; ?>" placeholder="<?php echo $language::get('search_devices'); ?>...">
|
||||
</div>
|
||||
<label class="col-md-2 col-form-label text-center" for="e2_reseller">Filter Results <button type="button" class="btn btn-light waves-effect waves-light btn-xs" onClick="clearOwner();"><i class="mdi mdi-close"></i></button></label>
|
||||
<div class="col-md-3">
|
||||
<select id="e2_reseller" class="form-control" data-toggle="select2">
|
||||
<?php if (isset(CoreUtilities::$rRequest['owner']) && ($rOwner = getRegisteredUser(intval(CoreUtilities::$rRequest['owner'])))) { ?>
|
||||
<option value="<?php echo intval($rOwner['id']); ?>" selected="selected"><?php echo $rOwner['username']; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select id="e2_filter" class="form-control" data-toggle="select2">
|
||||
<option value="" <?php if (!isset(CoreUtilities::$rRequest['filter'])) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $language::get('no_filter'); ?></option>
|
||||
<option value="1" <?php if (isset(CoreUtilities::$rRequest['filter']) && CoreUtilities::$rRequest['filter'] == 1) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $language::get('active'); ?></option>
|
||||
<option value="2" <?php if (isset(CoreUtilities::$rRequest['filter']) && CoreUtilities::$rRequest['filter'] == 2) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $language::get('disabled'); ?></option>
|
||||
<option value="3" <?php if (isset(CoreUtilities::$rRequest['filter']) && CoreUtilities::$rRequest['filter'] == 3) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $language::get('banned'); ?></option>
|
||||
<option value="4" <?php if (isset(CoreUtilities::$rRequest['filter']) && CoreUtilities::$rRequest['filter'] == 4) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $language::get('expired'); ?></option>
|
||||
<option value="5" <?php if (isset(CoreUtilities::$rRequest['filter']) && CoreUtilities::$rRequest['filter'] == 5) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $language::get('trial'); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center" for="e2_show_entries"><?php echo $language::get('show'); ?></label>
|
||||
<div class="col-md-1">
|
||||
<select id="e2_show_entries" class="form-control" data-toggle="select2">
|
||||
<?php foreach (array(10, 25, 50, 250, 500, 1000) as $rShow) { ?>
|
||||
<option value="<?php echo $rShow; ?>" <?php if ((isset(CoreUtilities::$rRequest['entries']) && CoreUtilities::$rRequest['entries'] == $rShow) || (!isset(CoreUtilities::$rRequest['entries']) && $rSettings['default_entries'] == $rShow)) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $rShow; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<table id="datatable-users" class="table table-striped table-borderless dt-responsive nowrap font-normal">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th><?php echo $language::get('username'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('mac_address'); ?></th>
|
||||
<th class="text-center">Public IP</th>
|
||||
<th><?php echo $language::get('owner'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('status'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('online'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('trial'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('expiration'); ?></th>
|
||||
<th class="text-center">Last Connection</th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' var rClearing = false;' . "\r\n" . ' var rSelected = [];' . "\r\n\r\n\t\t" . 'function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((window.rSelected) && (window.rSelected.length > 0)) {' . "\r\n" . ' $.toast("Individual actions disabled in multi-select mode.");' . "\r\n" . ' return;' . "\r\n" . ' }' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('device_delete_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n" . ' } else if ((rType == "convert") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Convert",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to conver this Device to a User Line?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=enigma&sub=" + rType + "&e2_id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('device_confirmed_1');
|
||||
echo '");' . "\r\n" . ' } else if (rType == "enable") {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('device_confirmed_2');
|
||||
echo '");' . "\r\n" . ' } else if (rType == "disable") {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('device_confirmed_3');
|
||||
echo '");' . "\r\n" . ' } else if (rType == "unban") {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('device_confirmed_4');
|
||||
echo '");' . "\r\n" . ' } else if (rType == "ban") {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('device_confirmed_5');
|
||||
echo '");' . "\r\n" . ' } else if (rType == "convert") {' . "\r\n" . ' if (data.line_id) {' . "\r\n" . ' navigate("line?id=" + data.line_id);' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("Failed to convert to user line.");' . "\r\n" . ' }' . "\r\n" . ' }' . "\r\n" . ' $("#datatable-users").DataTable().ajax.reload(null, false);' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n" . ' function multiAPI(rType, rConfirm=false) {' . "\r\n" . ' if (rType == "clear") {' . "\r\n" . ' if ("#header_stats") {' . "\r\n" . ' $("#header_stats").show();' . "\r\n" . ' }' . "\r\n" . ' window.rSelected = [];' . "\r\n" . ' $(".multiselect").hide();' . "\r\n" . " \$(\"#datatable-users tr\").removeClass('selectedfilter').removeClass('ui-selected').removeClass(\"selected\");" . "\r\n" . ' return;' . "\r\n" . ' }' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to delete these devices?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' multiAPI(rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n" . ' } else if ((rType == "purge") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Kill",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to kill all connections?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' multiAPI(rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n" . ' } else if ((rType == "convert") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Convert",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to convert these devices to normal lines?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' multiAPI(rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=multi&type=enigma&sub=" + rType + "&ids=" + JSON.stringify(window.rSelected), function(data) {' . "\r\n" . ' if (data.result == true) {' . "\r\n" . ' if (rType == "convert") {' . "\r\n" . ' $.toast("Devices have been converted to normal lines.");' . "\r\n" . ' } else if (rType == "purge") {' . "\r\n" . ' $.toast("Connections have been killed.");' . "\r\n" . ' } else if (rType == "delete") {' . "\r\n" . ' $.toast("Devices have been deleted.");' . "\r\n" . ' refreshTable();' . "\r\n" . ' } else if (rType == "ban") {' . "\r\n" . ' $.toast("Devices have been banned.");' . "\r\n" . ' } else if (rType == "unban") {' . "\r\n" . ' $.toast("Devices have been unbanned.");' . "\r\n" . ' } else if (rType == "enable") {' . "\r\n" . ' $.toast("Devices have been enabled.");' . "\r\n" . ' } else if (rType == "disable") {' . "\r\n" . ' $.toast("Devices have been disabled.");' . "\r\n" . ' }' . "\r\n" . ' $("#datatable-users").DataTable().ajax.reload(null, false);' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("An error occured while processing your request.");' . "\r\n" . ' }' . "\r\n" . ' }).fail(function() {' . "\r\n" . ' $.toast("An error occured while processing your request.");' . "\r\n" . ' });' . "\r\n" . ' multiAPI("clear");' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\t\t" . 'function getFilter() {' . "\r\n\t\t\t" . 'return $("#e2_filter").val();' . "\r\n\t\t" . '}' . "\r\n\t\t" . 'function getReseller() {' . "\r\n\t\t\t" . 'return $("#e2_reseller").val();' . "\r\n\t\t" . '}' . "\r\n\t\t" . 'function clearFilters() {' . "\r\n\t\t\t" . 'window.rClearing = true;' . "\r\n\t\t\t" . "\$(\"#e2_search\").val(\"\").trigger('change');" . "\r\n\t\t\t" . "\$('#e2_filter').val(\"\").trigger('change');" . "\r\n\t\t\t" . "\$('#e2_reseller').val(\"\").trigger('change');" . "\r\n\t\t\t" . "\$('#e2_show_entries').val(\"";
|
||||
echo (intval($rSettings['default_entries']) ?: 10);
|
||||
echo "\").trigger('change');" . "\r\n\t\t\t" . 'window.rClearing = false;' . "\r\n\t\t\t" . "\$('#datatable-users').DataTable().search(\$(\"#e2_search\").val());" . "\r\n\t\t\t" . "\$('#datatable-users').DataTable().page.len(\$('#e2_show_entries').val());" . "\r\n\t\t\t" . "\$(\"#datatable-users\").DataTable().page(0).draw('page');" . "\r\n\t\t\t" . '$("#datatable-users").DataTable().ajax.reload( null, false );' . "\r\n" . ' delParams(["search", "filter", "owner", "page", "entries"]);' . "\r\n\t\t\t" . 'checkClear();' . "\r\n\t\t" . '}' . "\r\n" . ' function checkClear() {' . "\r\n\t\t\t" . 'if (!hasParams(["search", "filter", "owner"])) {' . "\r\n\t\t\t\t" . '$("#clearFilters").prop("disabled", true);' . "\r\n\t\t\t" . '} else {' . "\r\n\t\t\t\t" . '$("#clearFilters").prop("disabled", false);' . "\r\n\t\t\t" . '}' . "\r\n\t\t" . '}' . "\r\n\t\t" . 'function refreshTable() {' . "\r\n\t\t\t" . '$("#datatable-users").DataTable().ajax.reload( null, false );' . "\r\n\t\t" . '}' . "\r\n" . ' function clearOwner() {' . "\r\n" . " \$('#e2_reseller').val(\"\").trigger('change');" . "\r\n" . ' }' . "\r\n" . ' var rSearch;' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . "\$('select').select2({width: '100%'});" . "\r\n" . " \$('#e2_reseller').select2({" . "\r\n\t\t\t" . ' ajax: {' . "\r\n\t\t\t\t" . "url: './api'," . "\r\n\t\t\t\t" . "dataType: 'json'," . "\r\n\t\t\t\t" . 'data: function (params) {' . "\r\n\t\t\t\t" . ' return {' . "\r\n\t\t\t\t\t" . 'search: params.term,' . "\r\n\t\t\t\t\t" . "action: 'reguserlist'," . "\r\n\t\t\t\t\t" . 'page: params.page' . "\r\n\t\t\t\t" . ' };' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'processResults: function (data, params) {' . "\r\n\t\t\t\t" . ' params.page = params.page || 1;' . "\r\n\t\t\t\t" . ' return {' . "\r\n\t\t\t\t\t" . 'results: data.items,' . "\r\n\t\t\t\t\t" . 'pagination: {' . "\r\n\t\t\t\t\t\t" . 'more: (params.page * 100) < data.total_count' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . ' };' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'cache: true,' . "\r\n\t\t\t\t" . 'width: "100%"' . "\r\n\t\t\t" . ' },' . "\r\n\t\t\t" . " placeholder: 'Search for an owner...'" . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . 'var rPage = getParam("page");' . "\r\n" . ' if (!rPage) { rPage = 1; }' . "\r\n" . ' var rEntries = getParam("entries");' . "\r\n" . ' if (!rEntries) { rEntries = ';
|
||||
echo intval($rSettings['default_entries']);
|
||||
echo '; }' . "\r\n\t\t\t" . 'var rTable = $("#datatable-users").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"," . "\r\n\t\t\t\t\t" . '},' . "\r\n\t\t\t\t\t" . 'infoFiltered: ""' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n" . ' if ($("#datatable-users").DataTable().page.info().page > 0) {' . "\r\n" . ' setParam("page", $("#datatable-users").DataTable().page.info().page+1);' . "\r\n" . ' } else {' . "\r\n" . ' delParam("page");' . "\r\n" . ' }' . "\r\n" . ' var rOrder = $("#datatable-users").DataTable().order()[0];' . "\r\n" . ' setParam("order", rOrder[0]); setParam("dir", rOrder[1]);' . "\r\n" . ' ';
|
||||
|
||||
if (hasPermissions('adv', 'edit_e2')) {
|
||||
echo ' // Multi Actions' . "\r\n" . ' multiAPI("clear");' . "\r\n" . ' $("#datatable-users tr").click(function() {' . "\r\n" . ' if (window.rShiftHeld) {' . "\r\n" . " if (\$(this).hasClass('selectedfilter')) {" . "\r\n" . " \$(this).removeClass('selectedfilter').removeClass('ui-selected').removeClass(\"selected\");" . "\r\n" . ' window.rSelected.splice($.inArray($(this).find("td:eq(0)").text(), window.rSelected), 1);' . "\r\n" . ' } else { ' . "\r\n" . " \$(this).addClass('selectedfilter').addClass('ui-selected').addClass(\"selected\");" . "\r\n" . ' window.rSelected.push($(this).find("td:eq(0)").text());' . "\r\n" . ' }' . "\r\n" . ' }' . "\r\n" . ' $("#multi_enigmas_selected").html(window.rSelected.length + " devices");' . "\r\n" . ' if (window.rSelected.length > 0) {' . "\r\n" . ' if ("#header_stats") {' . "\r\n" . ' $("#header_stats").hide();' . "\r\n" . ' }' . "\r\n" . ' $("#multiselect_enigmas").show();' . "\r\n" . ' } else {' . "\r\n" . ' if ("#header_stats") {' . "\r\n" . ' $("#header_stats").show();' . "\r\n" . ' }' . "\r\n" . ' $("#multiselect_enigmas").hide();' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'serverSide: true,' . "\r\n" . ' searchDelay: 250,' . "\r\n\t\t\t\t" . 'ajax: {' . "\r\n\t\t\t\t\t" . 'url: "./table",' . "\r\n\t\t\t\t\t" . '"data": function(d) {' . "\r\n\t\t\t\t\t\t" . 'd.id = "enigmas",' . "\r\n\t\t\t\t\t\t" . 'd.filter = getFilter(),' . "\r\n\t\t\t\t\t\t" . 'd.reseller = getReseller()' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [0,2,3,5,6,7,8,9,10]},' . "\r\n\t\t\t\t\t";
|
||||
|
||||
if (CoreUtilities::$rSettings['redis_handler']) {
|
||||
echo "\t\t\t\t\t" . '{"orderable": false, "targets": [6,10]},' . "\r\n\t\t\t\t\t";
|
||||
} else {
|
||||
echo "\t\t\t\t\t" . '{"orderable": false, "targets": [10]},' . "\r\n\t\t\t\t\t";
|
||||
}
|
||||
|
||||
echo "\t\t\t\t\t" . '{"visible": false, "targets": [1]}' . "\r\n\t\t\t\t" . '],' . "\r\n" . ' ';
|
||||
|
||||
if ($rMobile) {
|
||||
echo 'scrollX: true,';
|
||||
}
|
||||
|
||||
echo "\t\t\t\t" . 'order: [[ ';
|
||||
echo (isset(CoreUtilities::$rRequest['order']) ? intval(CoreUtilities::$rRequest['order']) : 0);
|
||||
echo ', "';
|
||||
echo (in_array(strtolower(CoreUtilities::$rRequest['dir'] ?? ''), ['asc', 'desc'], true) ? strtolower(CoreUtilities::$rRequest['dir']) : 'desc');
|
||||
echo '" ]],' . "\r\n\t\t\t\t" . 'pageLength: parseInt(rEntries),' . "\r\n\t\t\t\t" . 'lengthMenu: [10, 25, 50, 250, 500, 1000],' . "\r\n" . ' displayStart: (parseInt(rPage)-1) * parseInt(rEntries)' . "\r\n\t\t\t" . '});' . "\r\n" . ' function doSearch(rValue) {' . "\r\n" . ' clearTimeout(window.rSearch); window.rSearch = setTimeout(function(){ rTable.search(rValue).draw(); }, 500);' . "\r\n" . ' }' . "\r\n\t\t\t" . '$("#datatable-users").css("width", "100%");' . "\r\n\t\t\t" . "\$('#e2_search').keyup(function(){" . "\r\n\t\t\t\t" . 'if (!window.rClearing) {' . "\r\n" . ' delParam("page");' . "\r\n" . ' rTable.page(0);' . "\r\n\t\t\t\t\t" . 'if ($("#e2_search").val()) {' . "\r\n\t\t\t\t\t\t" . 'setParam("search", $("#e2_search").val());' . "\r\n\t\t\t\t\t" . '} else {' . "\r\n\t\t\t\t\t\t" . 'delParam("search");' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t\t" . 'checkClear();' . "\r\n\t\t\t\t\t" . 'doSearch($(this).val());' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . "\$('#e2_show_entries').change(function(){" . "\r\n\t\t\t\t" . 'if (!window.rClearing) {' . "\r\n" . ' delParam("page");' . "\r\n" . ' rTable.page(0);' . "\r\n\t\t\t\t\t" . 'if ($("#e2_show_entries").val()) {' . "\r\n\t\t\t\t\t\t" . 'setParam("entries", $("#e2_show_entries").val());' . "\r\n\t\t\t\t\t" . '} else {' . "\r\n\t\t\t\t\t\t" . 'delParam("entries");' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t\t" . 'checkClear();' . "\r\n\t\t\t\t\t" . 'rTable.page.len($(this).val()).draw();' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . "\$('#e2_filter').change(function(){" . "\r\n\t\t\t\t" . 'if (!window.rClearing) {' . "\r\n" . ' delParam("page");' . "\r\n" . ' rTable.page(0);' . "\r\n\t\t\t\t\t" . 'if ($("#e2_filter").val()) {' . "\r\n\t\t\t\t\t\t" . 'setParam("filter", $("#e2_filter").val());' . "\r\n\t\t\t\t\t" . '} else {' . "\r\n\t\t\t\t\t\t" . 'delParam("filter");' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t\t" . 'checkClear();' . "\r\n\t\t\t\t\t" . 'rTable.ajax.reload( null, false );' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . "\$('#e2_reseller').change(function(){" . "\r\n\t\t\t\t" . 'if (!window.rClearing) {' . "\r\n" . ' delParam("page");' . "\r\n" . ' rTable.page(0);' . "\r\n\t\t\t\t\t" . 'if ($("#e2_reseller").val()) {' . "\r\n\t\t\t\t\t\t" . 'setParam("owner", $("#e2_reseller").val());' . "\r\n\t\t\t\t\t" . '} else {' . "\r\n\t\t\t\t\t\t" . 'delParam("owner");' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t\t" . 'checkClear();' . "\r\n\t\t\t\t\t" . 'rTable.ajax.reload( null, false );' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . "if (\$('#e2_search').val()) {" . "\r\n\t\t\t\t" . "rTable.search(\$('#e2_search').val()).draw();" . "\r\n\t\t\t" . '}' . "\r\n" . ' $("#btn-export-csv").click(function() {' . "\r\n" . ' $.toast("Generating CSV report...");' . "\r\n" . ' window.location.href = "api?action=report¶ms=" + encodeURIComponent(JSON.stringify($("#datatable-users").DataTable().ajax.params()));' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . 'checkClear();' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php';
|
||||
include 'functions.php';
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
$_TITLE = 'Enigma Devices';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin'); ?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('enigma_devices'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS) { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Device has been added / modified.
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<div id="collapse_filters" class="form-group row mb-4 <?php echo $rMobile ? 'collapse' : ''; ?>">
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" id="e2_search" value="<?php echo isset(CoreUtilities::$rRequest['search']) ? htmlspecialchars(CoreUtilities::$rRequest['search']) : ''; ?>" placeholder="<?php echo $language::get('search_devices'); ?>...">
|
||||
</div>
|
||||
<label class="col-md-2 col-form-label text-center" for="e2_reseller">Filter Results <button type="button" class="btn btn-light waves-effect waves-light btn-xs" onClick="clearOwner();"><i class="mdi mdi-close"></i></button></label>
|
||||
<div class="col-md-3">
|
||||
<select id="e2_reseller" class="form-control" data-toggle="select2">
|
||||
<?php if (isset(CoreUtilities::$rRequest['owner']) && ($rOwner = getRegisteredUser(intval(CoreUtilities::$rRequest['owner'])))) { ?>
|
||||
<option value="<?php echo intval($rOwner['id']); ?>" selected="selected"><?php echo $rOwner['username']; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select id="e2_filter" class="form-control" data-toggle="select2">
|
||||
<option value="" <?php if (!isset(CoreUtilities::$rRequest['filter'])) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $language::get('no_filter'); ?></option>
|
||||
<option value="1" <?php if (isset(CoreUtilities::$rRequest['filter']) && CoreUtilities::$rRequest['filter'] == 1) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $language::get('active'); ?></option>
|
||||
<option value="2" <?php if (isset(CoreUtilities::$rRequest['filter']) && CoreUtilities::$rRequest['filter'] == 2) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $language::get('disabled'); ?></option>
|
||||
<option value="3" <?php if (isset(CoreUtilities::$rRequest['filter']) && CoreUtilities::$rRequest['filter'] == 3) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $language::get('banned'); ?></option>
|
||||
<option value="4" <?php if (isset(CoreUtilities::$rRequest['filter']) && CoreUtilities::$rRequest['filter'] == 4) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $language::get('expired'); ?></option>
|
||||
<option value="5" <?php if (isset(CoreUtilities::$rRequest['filter']) && CoreUtilities::$rRequest['filter'] == 5) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $language::get('trial'); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center" for="e2_show_entries"><?php echo $language::get('show'); ?></label>
|
||||
<div class="col-md-1">
|
||||
<select id="e2_show_entries" class="form-control" data-toggle="select2">
|
||||
<?php foreach (array(10, 25, 50, 250, 500, 1000) as $rShow) { ?>
|
||||
<option value="<?php echo $rShow; ?>" <?php if ((isset(CoreUtilities::$rRequest['entries']) && CoreUtilities::$rRequest['entries'] == $rShow) || (!isset(CoreUtilities::$rRequest['entries']) && $rSettings['default_entries'] == $rShow)) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $rShow; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<table id="datatable-users" class="table table-striped table-borderless dt-responsive nowrap font-normal">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th><?php echo $language::get('username'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('mac_address'); ?></th>
|
||||
<th class="text-center">Public IP</th>
|
||||
<th><?php echo $language::get('owner'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('status'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('online'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('trial'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('expiration'); ?></th>
|
||||
<th class="text-center">Last Connection</th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' var rClearing = false;' . "\r\n" . ' var rSelected = [];' . "\r\n\r\n\t\t" . 'function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((window.rSelected) && (window.rSelected.length > 0)) {' . "\r\n" . ' $.toast("Individual actions disabled in multi-select mode.");' . "\r\n" . ' return;' . "\r\n" . ' }' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('device_delete_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n" . ' } else if ((rType == "convert") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Convert",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to conver this Device to a User Line?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=enigma&sub=" + rType + "&e2_id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('device_confirmed_1');
|
||||
echo '");' . "\r\n" . ' } else if (rType == "enable") {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('device_confirmed_2');
|
||||
echo '");' . "\r\n" . ' } else if (rType == "disable") {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('device_confirmed_3');
|
||||
echo '");' . "\r\n" . ' } else if (rType == "unban") {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('device_confirmed_4');
|
||||
echo '");' . "\r\n" . ' } else if (rType == "ban") {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('device_confirmed_5');
|
||||
echo '");' . "\r\n" . ' } else if (rType == "convert") {' . "\r\n" . ' if (data.line_id) {' . "\r\n" . ' navigate("line?id=" + data.line_id);' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("Failed to convert to user line.");' . "\r\n" . ' }' . "\r\n" . ' }' . "\r\n" . ' $("#datatable-users").DataTable().ajax.reload(null, false);' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n" . ' function multiAPI(rType, rConfirm=false) {' . "\r\n" . ' if (rType == "clear") {' . "\r\n" . ' if ("#header_stats") {' . "\r\n" . ' $("#header_stats").show();' . "\r\n" . ' }' . "\r\n" . ' window.rSelected = [];' . "\r\n" . ' $(".multiselect").hide();' . "\r\n" . " \$(\"#datatable-users tr\").removeClass('selectedfilter').removeClass('ui-selected').removeClass(\"selected\");" . "\r\n" . ' return;' . "\r\n" . ' }' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to delete these devices?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' multiAPI(rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n" . ' } else if ((rType == "purge") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Kill",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to kill all connections?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' multiAPI(rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n" . ' } else if ((rType == "convert") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Convert",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to convert these devices to normal lines?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' multiAPI(rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=multi&type=enigma&sub=" + rType + "&ids=" + JSON.stringify(window.rSelected), function(data) {' . "\r\n" . ' if (data.result == true) {' . "\r\n" . ' if (rType == "convert") {' . "\r\n" . ' $.toast("Devices have been converted to normal lines.");' . "\r\n" . ' } else if (rType == "purge") {' . "\r\n" . ' $.toast("Connections have been killed.");' . "\r\n" . ' } else if (rType == "delete") {' . "\r\n" . ' $.toast("Devices have been deleted.");' . "\r\n" . ' refreshTable();' . "\r\n" . ' } else if (rType == "ban") {' . "\r\n" . ' $.toast("Devices have been banned.");' . "\r\n" . ' } else if (rType == "unban") {' . "\r\n" . ' $.toast("Devices have been unbanned.");' . "\r\n" . ' } else if (rType == "enable") {' . "\r\n" . ' $.toast("Devices have been enabled.");' . "\r\n" . ' } else if (rType == "disable") {' . "\r\n" . ' $.toast("Devices have been disabled.");' . "\r\n" . ' }' . "\r\n" . ' $("#datatable-users").DataTable().ajax.reload(null, false);' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("An error occured while processing your request.");' . "\r\n" . ' }' . "\r\n" . ' }).fail(function() {' . "\r\n" . ' $.toast("An error occured while processing your request.");' . "\r\n" . ' });' . "\r\n" . ' multiAPI("clear");' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\t\t" . 'function getFilter() {' . "\r\n\t\t\t" . 'return $("#e2_filter").val();' . "\r\n\t\t" . '}' . "\r\n\t\t" . 'function getReseller() {' . "\r\n\t\t\t" . 'return $("#e2_reseller").val();' . "\r\n\t\t" . '}' . "\r\n\t\t" . 'function clearFilters() {' . "\r\n\t\t\t" . 'window.rClearing = true;' . "\r\n\t\t\t" . "\$(\"#e2_search\").val(\"\").trigger('change');" . "\r\n\t\t\t" . "\$('#e2_filter').val(\"\").trigger('change');" . "\r\n\t\t\t" . "\$('#e2_reseller').val(\"\").trigger('change');" . "\r\n\t\t\t" . "\$('#e2_show_entries').val(\"";
|
||||
echo (intval($rSettings['default_entries']) ?: 10);
|
||||
echo "\").trigger('change');" . "\r\n\t\t\t" . 'window.rClearing = false;' . "\r\n\t\t\t" . "\$('#datatable-users').DataTable().search(\$(\"#e2_search\").val());" . "\r\n\t\t\t" . "\$('#datatable-users').DataTable().page.len(\$('#e2_show_entries').val());" . "\r\n\t\t\t" . "\$(\"#datatable-users\").DataTable().page(0).draw('page');" . "\r\n\t\t\t" . '$("#datatable-users").DataTable().ajax.reload( null, false );' . "\r\n" . ' delParams(["search", "filter", "owner", "page", "entries"]);' . "\r\n\t\t\t" . 'checkClear();' . "\r\n\t\t" . '}' . "\r\n" . ' function checkClear() {' . "\r\n\t\t\t" . 'if (!hasParams(["search", "filter", "owner"])) {' . "\r\n\t\t\t\t" . '$("#clearFilters").prop("disabled", true);' . "\r\n\t\t\t" . '} else {' . "\r\n\t\t\t\t" . '$("#clearFilters").prop("disabled", false);' . "\r\n\t\t\t" . '}' . "\r\n\t\t" . '}' . "\r\n\t\t" . 'function refreshTable() {' . "\r\n\t\t\t" . '$("#datatable-users").DataTable().ajax.reload( null, false );' . "\r\n\t\t" . '}' . "\r\n" . ' function clearOwner() {' . "\r\n" . " \$('#e2_reseller').val(\"\").trigger('change');" . "\r\n" . ' }' . "\r\n" . ' var rSearch;' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . "\$('select').select2({width: '100%'});" . "\r\n" . " \$('#e2_reseller').select2({" . "\r\n\t\t\t" . ' ajax: {' . "\r\n\t\t\t\t" . "url: './api'," . "\r\n\t\t\t\t" . "dataType: 'json'," . "\r\n\t\t\t\t" . 'data: function (params) {' . "\r\n\t\t\t\t" . ' return {' . "\r\n\t\t\t\t\t" . 'search: params.term,' . "\r\n\t\t\t\t\t" . "action: 'reguserlist'," . "\r\n\t\t\t\t\t" . 'page: params.page' . "\r\n\t\t\t\t" . ' };' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'processResults: function (data, params) {' . "\r\n\t\t\t\t" . ' params.page = params.page || 1;' . "\r\n\t\t\t\t" . ' return {' . "\r\n\t\t\t\t\t" . 'results: data.items,' . "\r\n\t\t\t\t\t" . 'pagination: {' . "\r\n\t\t\t\t\t\t" . 'more: (params.page * 100) < data.total_count' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . ' };' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'cache: true,' . "\r\n\t\t\t\t" . 'width: "100%"' . "\r\n\t\t\t" . ' },' . "\r\n\t\t\t" . " placeholder: 'Search for an owner...'" . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . 'var rPage = getParam("page");' . "\r\n" . ' if (!rPage) { rPage = 1; }' . "\r\n" . ' var rEntries = getParam("entries");' . "\r\n" . ' if (!rEntries) { rEntries = ';
|
||||
echo intval($rSettings['default_entries']);
|
||||
echo '; }' . "\r\n\t\t\t" . 'var rTable = $("#datatable-users").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"," . "\r\n\t\t\t\t\t" . '},' . "\r\n\t\t\t\t\t" . 'infoFiltered: ""' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n" . ' if ($("#datatable-users").DataTable().page.info().page > 0) {' . "\r\n" . ' setParam("page", $("#datatable-users").DataTable().page.info().page+1);' . "\r\n" . ' } else {' . "\r\n" . ' delParam("page");' . "\r\n" . ' }' . "\r\n" . ' var rOrder = $("#datatable-users").DataTable().order()[0];' . "\r\n" . ' setParam("order", rOrder[0]); setParam("dir", rOrder[1]);' . "\r\n" . ' ';
|
||||
|
||||
if (hasPermissions('adv', 'edit_e2')) {
|
||||
echo ' // Multi Actions' . "\r\n" . ' multiAPI("clear");' . "\r\n" . ' $("#datatable-users tr").click(function() {' . "\r\n" . ' if (window.rShiftHeld) {' . "\r\n" . " if (\$(this).hasClass('selectedfilter')) {" . "\r\n" . " \$(this).removeClass('selectedfilter').removeClass('ui-selected').removeClass(\"selected\");" . "\r\n" . ' window.rSelected.splice($.inArray($(this).find("td:eq(0)").text(), window.rSelected), 1);' . "\r\n" . ' } else { ' . "\r\n" . " \$(this).addClass('selectedfilter').addClass('ui-selected').addClass(\"selected\");" . "\r\n" . ' window.rSelected.push($(this).find("td:eq(0)").text());' . "\r\n" . ' }' . "\r\n" . ' }' . "\r\n" . ' $("#multi_enigmas_selected").html(window.rSelected.length + " devices");' . "\r\n" . ' if (window.rSelected.length > 0) {' . "\r\n" . ' if ("#header_stats") {' . "\r\n" . ' $("#header_stats").hide();' . "\r\n" . ' }' . "\r\n" . ' $("#multiselect_enigmas").show();' . "\r\n" . ' } else {' . "\r\n" . ' if ("#header_stats") {' . "\r\n" . ' $("#header_stats").show();' . "\r\n" . ' }' . "\r\n" . ' $("#multiselect_enigmas").hide();' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'serverSide: true,' . "\r\n" . ' searchDelay: 250,' . "\r\n\t\t\t\t" . 'ajax: {' . "\r\n\t\t\t\t\t" . 'url: "./table",' . "\r\n\t\t\t\t\t" . '"data": function(d) {' . "\r\n\t\t\t\t\t\t" . 'd.id = "enigmas",' . "\r\n\t\t\t\t\t\t" . 'd.filter = getFilter(),' . "\r\n\t\t\t\t\t\t" . 'd.reseller = getReseller()' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [0,2,3,5,6,7,8,9,10]},' . "\r\n\t\t\t\t\t";
|
||||
|
||||
if (CoreUtilities::$rSettings['redis_handler']) {
|
||||
echo "\t\t\t\t\t" . '{"orderable": false, "targets": [6,10]},' . "\r\n\t\t\t\t\t";
|
||||
} else {
|
||||
echo "\t\t\t\t\t" . '{"orderable": false, "targets": [10]},' . "\r\n\t\t\t\t\t";
|
||||
}
|
||||
|
||||
echo "\t\t\t\t\t" . '{"visible": false, "targets": [1]}' . "\r\n\t\t\t\t" . '],' . "\r\n" . ' ';
|
||||
|
||||
if ($rMobile) {
|
||||
echo 'scrollX: true,';
|
||||
}
|
||||
|
||||
echo "\t\t\t\t" . 'order: [[ ';
|
||||
echo (isset(CoreUtilities::$rRequest['order']) ? intval(CoreUtilities::$rRequest['order']) : 0);
|
||||
echo ', "';
|
||||
echo (in_array(strtolower(CoreUtilities::$rRequest['dir'] ?? ''), ['asc', 'desc'], true) ? strtolower(CoreUtilities::$rRequest['dir']) : 'desc');
|
||||
echo '" ]],' . "\r\n\t\t\t\t" . 'pageLength: parseInt(rEntries),' . "\r\n\t\t\t\t" . 'lengthMenu: [10, 25, 50, 250, 500, 1000],' . "\r\n" . ' displayStart: (parseInt(rPage)-1) * parseInt(rEntries)' . "\r\n\t\t\t" . '});' . "\r\n" . ' function doSearch(rValue) {' . "\r\n" . ' clearTimeout(window.rSearch); window.rSearch = setTimeout(function(){ rTable.search(rValue).draw(); }, 500);' . "\r\n" . ' }' . "\r\n\t\t\t" . '$("#datatable-users").css("width", "100%");' . "\r\n\t\t\t" . "\$('#e2_search').keyup(function(){" . "\r\n\t\t\t\t" . 'if (!window.rClearing) {' . "\r\n" . ' delParam("page");' . "\r\n" . ' rTable.page(0);' . "\r\n\t\t\t\t\t" . 'if ($("#e2_search").val()) {' . "\r\n\t\t\t\t\t\t" . 'setParam("search", $("#e2_search").val());' . "\r\n\t\t\t\t\t" . '} else {' . "\r\n\t\t\t\t\t\t" . 'delParam("search");' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t\t" . 'checkClear();' . "\r\n\t\t\t\t\t" . 'doSearch($(this).val());' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . "\$('#e2_show_entries').change(function(){" . "\r\n\t\t\t\t" . 'if (!window.rClearing) {' . "\r\n" . ' delParam("page");' . "\r\n" . ' rTable.page(0);' . "\r\n\t\t\t\t\t" . 'if ($("#e2_show_entries").val()) {' . "\r\n\t\t\t\t\t\t" . 'setParam("entries", $("#e2_show_entries").val());' . "\r\n\t\t\t\t\t" . '} else {' . "\r\n\t\t\t\t\t\t" . 'delParam("entries");' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t\t" . 'checkClear();' . "\r\n\t\t\t\t\t" . 'rTable.page.len($(this).val()).draw();' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . "\$('#e2_filter').change(function(){" . "\r\n\t\t\t\t" . 'if (!window.rClearing) {' . "\r\n" . ' delParam("page");' . "\r\n" . ' rTable.page(0);' . "\r\n\t\t\t\t\t" . 'if ($("#e2_filter").val()) {' . "\r\n\t\t\t\t\t\t" . 'setParam("filter", $("#e2_filter").val());' . "\r\n\t\t\t\t\t" . '} else {' . "\r\n\t\t\t\t\t\t" . 'delParam("filter");' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t\t" . 'checkClear();' . "\r\n\t\t\t\t\t" . 'rTable.ajax.reload( null, false );' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . "\$('#e2_reseller').change(function(){" . "\r\n\t\t\t\t" . 'if (!window.rClearing) {' . "\r\n" . ' delParam("page");' . "\r\n" . ' rTable.page(0);' . "\r\n\t\t\t\t\t" . 'if ($("#e2_reseller").val()) {' . "\r\n\t\t\t\t\t\t" . 'setParam("owner", $("#e2_reseller").val());' . "\r\n\t\t\t\t\t" . '} else {' . "\r\n\t\t\t\t\t\t" . 'delParam("owner");' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t\t" . 'checkClear();' . "\r\n\t\t\t\t\t" . 'rTable.ajax.reload( null, false );' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . "if (\$('#e2_search').val()) {" . "\r\n\t\t\t\t" . "rTable.search(\$('#e2_search').val()).draw();" . "\r\n\t\t\t" . '}' . "\r\n" . ' $("#btn-export-csv").click(function() {' . "\r\n" . ' $.toast("Generating CSV report...");' . "\r\n" . ' window.location.href = "api?action=report¶ms=" + encodeURIComponent(JSON.stringify($("#datatable-users").DataTable().ajax.params()));' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . 'checkClear();' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+9
-3
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -8,8 +9,10 @@ if (isset(CoreUtilities::$rRequest['id']) && !($rEPGArr = getEPG(CoreUtilities::
|
||||
}
|
||||
|
||||
$_TITLE = 'EPG';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
echo ' style="display: block;"';
|
||||
} ?>>
|
||||
@@ -118,7 +121,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
@@ -282,4 +288,4 @@ include 'header.php';
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -51,8 +52,10 @@ foreach (range(max($rPageInt - 2, 1), min($rPageInt + 2, $rPages)) as $i) {
|
||||
$rPagination[] = $i;
|
||||
}
|
||||
$_TITLE = 'TV Guide';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper " <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
@@ -170,7 +173,10 @@ include 'header.php';
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
@@ -319,4 +325,4 @@ include 'header.php';
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
+235
-229
@@ -1,229 +1,235 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
exit;
|
||||
}
|
||||
|
||||
$_TITLE = 'EPG Files';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo 'style="display: none;"' ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('epgs'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS) { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
EPG has been added and will be scanned during the next cron run.
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th><?php echo $language::get('epg_name'); ?></th>
|
||||
<th><?php echo $language::get('source'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('days_to_keep'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('last_updated'); ?></th>
|
||||
<th class="text-center">Channels</th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getEPGs() as $rEPG) { ?>
|
||||
<tr id="epg-<?php echo $rEPG['id']; ?>">
|
||||
<td class="text-center"><?php echo $rEPG['id']; ?></td>
|
||||
<td><?php echo $rEPG['epg_name']; ?></td>
|
||||
<td><?php echo parse_url($rEPG['epg_file'])['host']; ?></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed-min"><?php echo $rEPG['days_keep']; ?></button></td>
|
||||
<td class="text-center"><?php echo $rEPG['last_updated'] ? date('Y-m-d H:i', $rEPG['last_updated']) : $language::get('never'); ?></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed-min"><?php echo number_format(count(json_decode($rEPG['data'] ?? '[]', true) ?? []), 0); ?></button></td>
|
||||
<td class="text-center">
|
||||
<?php if (hasPermissions('adv', 'epg_edit')) { ?>
|
||||
<div class="btn-group">
|
||||
<a href="./epg?id=<?php echo $rEPG['id']; ?>"><button type="button" title="<?php echo $language::get('edit_epg'); ?>" class="tooltip btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-pencil-outline"></i></button></a>
|
||||
<button type="button" title="Force Reload" class="tooltip btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rEPG['id']; ?>, 'reload');"><i class="mdi mdi-refresh"></i></button>
|
||||
<button type="button" title="<?php echo $language::get('delete_epg'); ?>" class="tooltip btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rEPG['id']; ?>, 'delete');"><i class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
<?php } else {
|
||||
echo '--';
|
||||
} ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('epg_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=epg&sub=" + rType + "&epg_id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {' . "\r\n" . ' $("#datatable").DataTable().rows(rRow).remove().draw(false);' . "\r\n" . ' }' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('epg_deleted');
|
||||
echo '");' . "\r\n" . ' } else if (rType == "reload") {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('updating_epg');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\t\t" . 'function forceUpdate() {' . "\r\n\t\t\t" . '$("#force_update").attr("disabled", true);' . "\r\n\t\t\t" . '$.toast("';
|
||||
echo $language::get('updating_epg');
|
||||
echo '");' . "\r\n\t\t\t" . '$.getJSON("./api?action=force_epg", function(data) {' . "\r\n\t\t\t" . '});' . "\r\n\t\t" . '}' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n" . ' bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n" . ' order: [[ 4, "desc" ]],' . "\r\n" . ' columnDefs: [' . "\r\n\t\t\t\t\t" . '{"visible": false, "targets": [0]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t\t" . 'responsive: false' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t\t" . "\$('select').select2({width: '100%'});" . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
exit;
|
||||
}
|
||||
|
||||
$_TITLE = 'EPG Files';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo 'style="display: none;"' ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('epgs'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS) { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
EPG has been added and will be scanned during the next cron run.
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th><?php echo $language::get('epg_name'); ?></th>
|
||||
<th><?php echo $language::get('source'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('days_to_keep'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('last_updated'); ?></th>
|
||||
<th class="text-center">Channels</th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getEPGs() as $rEPG) { ?>
|
||||
<tr id="epg-<?php echo $rEPG['id']; ?>">
|
||||
<td class="text-center"><?php echo $rEPG['id']; ?></td>
|
||||
<td><?php echo $rEPG['epg_name']; ?></td>
|
||||
<td><?php echo parse_url($rEPG['epg_file'])['host']; ?></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed-min"><?php echo $rEPG['days_keep']; ?></button></td>
|
||||
<td class="text-center"><?php echo $rEPG['last_updated'] ? date('Y-m-d H:i', $rEPG['last_updated']) : $language::get('never'); ?></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed-min"><?php echo number_format(count(json_decode($rEPG['data'] ?? '[]', true) ?? []), 0); ?></button></td>
|
||||
<td class="text-center">
|
||||
<?php if (hasPermissions('adv', 'epg_edit')) { ?>
|
||||
<div class="btn-group">
|
||||
<a href="./epg?id=<?php echo $rEPG['id']; ?>"><button type="button" title="<?php echo $language::get('edit_epg'); ?>" class="tooltip btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-pencil-outline"></i></button></a>
|
||||
<button type="button" title="Force Reload" class="tooltip btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rEPG['id']; ?>, 'reload');"><i class="mdi mdi-refresh"></i></button>
|
||||
<button type="button" title="<?php echo $language::get('delete_epg'); ?>" class="tooltip btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rEPG['id']; ?>, 'delete');"><i class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
<?php } else {
|
||||
echo '--';
|
||||
} ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('epg_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=epg&sub=" + rType + "&epg_id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {' . "\r\n" . ' $("#datatable").DataTable().rows(rRow).remove().draw(false);' . "\r\n" . ' }' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('epg_deleted');
|
||||
echo '");' . "\r\n" . ' } else if (rType == "reload") {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('updating_epg');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\t\t" . 'function forceUpdate() {' . "\r\n\t\t\t" . '$("#force_update").attr("disabled", true);' . "\r\n\t\t\t" . '$.toast("';
|
||||
echo $language::get('updating_epg');
|
||||
echo '");' . "\r\n\t\t\t" . '$.getJSON("./api?action=force_epg", function(data) {' . "\r\n\t\t\t" . '});' . "\r\n\t\t" . '}' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n" . ' bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n" . ' order: [[ 4, "desc" ]],' . "\r\n" . ' columnDefs: [' . "\r\n\t\t\t\t\t" . '{"visible": false, "targets": [0]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t\t" . 'responsive: false' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t\t" . "\$('select').select2({width: '100%'});" . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
|
||||
@@ -84,7 +85,9 @@ if (isset($rEpisode)) {
|
||||
}
|
||||
|
||||
$_TITLE = 'Episode';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
endif;
|
||||
echo '<div class="wrapper boxed-layout"';
|
||||
|
||||
if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
@@ -538,7 +541,8 @@ if (isset($rMulti)) {
|
||||
|
||||
|
||||
echo "\t\t\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t" . '</div> ' . "\n\t\t\t" . '</div> ' . "\n\t\t" . '</div>' . "\n\t" . '</div>' . "\n" . '</div>' . "\n";
|
||||
include 'footer.php'; ?>
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin'); ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
@@ -1094,4 +1098,4 @@ include 'footer.php'; ?>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -20,7 +21,9 @@ foreach ($db->get_rows() as $rRow) {
|
||||
$rVideoCodecs[] = $rRow['video_codec'];
|
||||
}
|
||||
$_TITLE = 'Episodes';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
endif;
|
||||
echo '<div class="wrapper"';
|
||||
|
||||
if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
@@ -292,7 +295,8 @@ echo $language::get('player');
|
||||
echo '</th>' . "\n" . ' <th class="text-center">';
|
||||
echo $language::get('stream_info');
|
||||
echo '</th>' . "\n" . ' </tr>' . "\n" . ' </thead>' . "\n" . ' <tbody></tbody>' . "\n" . ' </table>' . "\n" . ' </div> ' . "\n" . ' </div> ' . "\n" . ' </div>' . "\n" . ' </div>' . "\n" . ' </div>' . "\n" . '</div>' . "\n";
|
||||
include 'footer.php'; ?>
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin'); ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -37,8 +38,10 @@ foreach ($rServers as $rServer) {
|
||||
}
|
||||
|
||||
$_TITLE = 'Mass Edit Episodes';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout-xl" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo 'style="display: none;"' ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
@@ -321,7 +324,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php';
|
||||
include 'functions.php';
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
$_TITLE = 'Fingerprint Stream';
|
||||
include 'header.php'; ?>
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin'); ?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout-ext">
|
||||
<?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
@@ -166,7 +169,10 @@ include 'header.php'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
+7
-5
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
if (!isset($__viewMode)):
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +47,9 @@ if (!isset($rGroup)) {
|
||||
}
|
||||
|
||||
$_TITLE = 'Group';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
endif; // !$__viewMode
|
||||
echo '<div class="wrapper boxed-layout"';
|
||||
|
||||
if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
@@ -475,7 +476,8 @@ if (isset($rGroup)) {
|
||||
|
||||
|
||||
echo '" />' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '</li>' . "\n\t\t\t\t\t\t\t\t\t\t" . '</ul>' . "\n\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t\t\t" . '</form>' . "\n\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t" . '</div> ' . "\n\t\t\t" . '</div> ' . "\n\t\t" . '</div>' . "\n\t" . '</div>' . "\n" . '</div>' . "\n";
|
||||
include 'footer.php'; ?>
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin'); ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
@@ -819,4 +821,4 @@ include 'footer.php'; ?>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
+251
-245
@@ -1,245 +1,251 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Groups';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('groups'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<?php echo $language::get('group_success'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th><?php echo $language::get('group_name'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('is_admin'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('is_reseller'); ?></th>
|
||||
<th class="text-center">Subresellers</th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getMemberGroups() as $rGroup): ?>
|
||||
<tr id="group-<?php echo $rGroup['group_id']; ?>">
|
||||
<td class="text-center"><?php echo $rGroup['group_id']; ?></td>
|
||||
<td><?php echo $rGroup['group_name']; ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($rGroup['is_admin']): ?>
|
||||
<i class='text-success mdi mdi-circle'></i>
|
||||
<?php else: ?>
|
||||
<i class='text-secondary mdi mdi-circle'></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if ($rGroup['is_reseller']): ?>
|
||||
<i class='text-success mdi mdi-circle'></i>
|
||||
<?php else: ?>
|
||||
<i class='text-secondary mdi mdi-circle'></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if ($rGroup['create_sub_resellers']): ?>
|
||||
<i class='text-success mdi mdi-circle'></i>
|
||||
<?php else: ?>
|
||||
<i class='text-secondary mdi mdi-circle'></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<?php if (hasPermissions('adv', 'edit_group')): ?>
|
||||
<a href="./group?id=<?php echo $rGroup['group_id']; ?>">
|
||||
<button type="button" data-toggle="tooltip" data-placement="top" title="<?php echo $language::get('edit_group'); ?>" class="btn btn-light waves-effect waves-light btn-xs">
|
||||
<i class="mdi mdi-pencil-outline"></i>
|
||||
</button>
|
||||
</a>
|
||||
<?php if ($rGroup['can_delete']): ?>
|
||||
<button type="button" data-toggle="tooltip" data-placement="top" title="<?php echo $language::get('delete_group'); ?>" class="btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rGroup['group_id']; ?>, 'delete');">
|
||||
<i class="mdi mdi-close"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('group_delete_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=group&sub=" + rType + "&group_id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {' . "\r\n" . ' $("#datatable").DataTable().rows(rRow).remove().draw(false);' . "\r\n" . ' }' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('group_deleted');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n" . ' bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n" . ' order: [[ 1, "asc" ]],' . "\r\n" . ' columnDefs: [' . "\r\n\t\t\t\t\t" . '{"visible": false, "targets": [0]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t\t" . 'responsive: false' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Groups';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('groups'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<?php echo $language::get('group_success'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th><?php echo $language::get('group_name'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('is_admin'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('is_reseller'); ?></th>
|
||||
<th class="text-center">Subresellers</th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getMemberGroups() as $rGroup): ?>
|
||||
<tr id="group-<?php echo $rGroup['group_id']; ?>">
|
||||
<td class="text-center"><?php echo $rGroup['group_id']; ?></td>
|
||||
<td><?php echo $rGroup['group_name']; ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($rGroup['is_admin']): ?>
|
||||
<i class='text-success mdi mdi-circle'></i>
|
||||
<?php else: ?>
|
||||
<i class='text-secondary mdi mdi-circle'></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if ($rGroup['is_reseller']): ?>
|
||||
<i class='text-success mdi mdi-circle'></i>
|
||||
<?php else: ?>
|
||||
<i class='text-secondary mdi mdi-circle'></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if ($rGroup['create_sub_resellers']): ?>
|
||||
<i class='text-success mdi mdi-circle'></i>
|
||||
<?php else: ?>
|
||||
<i class='text-secondary mdi mdi-circle'></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<?php if (hasPermissions('adv', 'edit_group')): ?>
|
||||
<a href="./group?id=<?php echo $rGroup['group_id']; ?>">
|
||||
<button type="button" data-toggle="tooltip" data-placement="top" title="<?php echo $language::get('edit_group'); ?>" class="btn btn-light waves-effect waves-light btn-xs">
|
||||
<i class="mdi mdi-pencil-outline"></i>
|
||||
</button>
|
||||
</a>
|
||||
<?php if ($rGroup['can_delete']): ?>
|
||||
<button type="button" data-toggle="tooltip" data-placement="top" title="<?php echo $language::get('delete_group'); ?>" class="btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rGroup['group_id']; ?>, 'delete');">
|
||||
<i class="mdi mdi-close"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('group_delete_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=group&sub=" + rType + "&group_id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {' . "\r\n" . ' $("#datatable").DataTable().rows(rRow).remove().draw(false);' . "\r\n" . ' }' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('group_deleted');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n" . ' bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n" . ' order: [[ 1, "asc" ]],' . "\r\n" . ' columnDefs: [' . "\r\n\t\t\t\t\t" . '{"visible": false, "targets": [0]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t\t" . 'responsive: false' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+251
-247
@@ -1,247 +1,251 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['id']) && !($rHMAC = getHMACToken(CoreUtilities::$rRequest['id']))) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$_TITLE = 'HMAC Key';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">
|
||||
<?php echo isset($rHMAC) ? 'Edit HMAC Key' : 'Add HMAC Key'; ?>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="alert alert-info" role="alert">
|
||||
Use this tool to generate a key you can use to generate HMAC tokens that can access a stream or movie. Visit the XC_VM documentation for more information on how to use it.<br /><br /><strong>Write down the HMAC key as you will not see it again, it will also be encrypted in the database so cannot be extracted.</strong>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST" data-parsley-validate="">
|
||||
<?php if (isset($rHMAC)): ?>
|
||||
<input type="hidden" name="edit" value="<?php echo $rHMAC['id']; ?>" />
|
||||
<?php endif; ?>
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#hmac-details" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-account-card-details-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline"><?php echo $language::get('details'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="hmac-details">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="notes">Description</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" id="notes" name="notes" value="<?php echo isset($rHMAC) ? htmlspecialchars($rHMAC['notes']) : ''; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="keygen">HMAC Key</label>
|
||||
<div class="col-md-5 input-group">
|
||||
<input readonly type="text" maxlength="32" class="form-control" id="keygen" name="keygen" value="<?php echo isset($rHMAC) ? 'HMAC KEY HIDDEN' : ''; ?>" required data-parsley-trigger="change">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-info waves-effect waves-light" onClick="generateCode();" type="button"><i class="mdi mdi-refresh"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-md-2 col-form-label" for="enabled">Enabled</label>
|
||||
<div class="col-md-2">
|
||||
<input name="enabled" id="enabled" type="checkbox" <?php echo isset($rHMAC) && $rHMAC['enabled'] == 1 ? 'checked' : 'checked'; ?> data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="submit_key" type="submit" class="btn btn-primary" value="<?php echo isset($rHMAC) ? $language::get('edit') : $language::get('add'); ?>" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function generateCode() {
|
||||
var result = '';
|
||||
var characters = 'ABCDEF0123456789';
|
||||
var charactersLength = characters.length;
|
||||
for (var i = 0; i < 32; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
$("#keygen").val(result);
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
<?php if (!isset($rHMAC)): ?>
|
||||
generateCode();
|
||||
<?php endif; ?>
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['id']) && !($rHMAC = getHMACToken(CoreUtilities::$rRequest['id']))) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$_TITLE = 'HMAC Key';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
<?php endif; ?>
|
||||
?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">
|
||||
<?php echo isset($rHMAC) ? 'Edit HMAC Key' : 'Add HMAC Key'; ?>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="alert alert-info" role="alert">
|
||||
Use this tool to generate a key you can use to generate HMAC tokens that can access a stream or movie. Visit the XC_VM documentation for more information on how to use it.<br /><br /><strong>Write down the HMAC key as you will not see it again, it will also be encrypted in the database so cannot be extracted.</strong>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST" data-parsley-validate="">
|
||||
<?php if (isset($rHMAC)): ?>
|
||||
<input type="hidden" name="edit" value="<?php echo $rHMAC['id']; ?>" />
|
||||
<?php endif; ?>
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#hmac-details" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-account-card-details-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline"><?php echo $language::get('details'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="hmac-details">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="notes">Description</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" id="notes" name="notes" value="<?php echo isset($rHMAC) ? htmlspecialchars($rHMAC['notes']) : ''; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="keygen">HMAC Key</label>
|
||||
<div class="col-md-5 input-group">
|
||||
<input readonly type="text" maxlength="32" class="form-control" id="keygen" name="keygen" value="<?php echo isset($rHMAC) ? 'HMAC KEY HIDDEN' : ''; ?>" required data-parsley-trigger="change">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-info waves-effect waves-light" onClick="generateCode();" type="button"><i class="mdi mdi-refresh"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-md-2 col-form-label" for="enabled">Enabled</label>
|
||||
<div class="col-md-2">
|
||||
<input name="enabled" id="enabled" type="checkbox" <?php echo isset($rHMAC) && $rHMAC['enabled'] == 1 ? 'checked' : 'checked'; ?> data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="submit_key" type="submit" class="btn btn-primary" value="<?php echo isset($rHMAC) ? $language::get('edit') : $language::get('add'); ?>" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin'); ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function generateCode() {
|
||||
var result = '';
|
||||
var characters = 'ABCDEF0123456789';
|
||||
var charactersLength = characters.length;
|
||||
for (var i = 0; i < 32; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
$("#keygen").val(result);
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
<?php if (!isset($rHMAC)): ?>
|
||||
generateCode();
|
||||
<?php endif; ?>
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+275
-269
@@ -1,269 +1,275 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'HMAC Keys';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">HMAC Keys</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
HMAC Token has been authenticated and can now be used.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?= $language::get('id'); ?></th>
|
||||
<th>Description</th>
|
||||
<th class="text-center">Enabled</th>
|
||||
<th class="text-center"><?= $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getHMACTokens() as $rHMAC): ?>
|
||||
<tr id="hmac-<?= $rHMAC['id']; ?>">
|
||||
<td class="text-center"><?= $rHMAC['id']; ?></td>
|
||||
<td><?= $rHMAC['notes']; ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($rHMAC['enabled']): ?>
|
||||
<i class="text-success fas fa-square"></i>
|
||||
<?php else: ?>
|
||||
<i class="text-secondary fas fa-square"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<a href="./hmac?id=<?= $rHMAC['id']; ?>">
|
||||
<button type="button" data-toggle="tooltip" data-placement="top" title="" data-original-title="Edit Key" class="btn btn-light waves-effect waves-light btn-xs">
|
||||
<i class="mdi mdi-pencil-outline"></i>
|
||||
</button>
|
||||
</a>
|
||||
<button type="button" data-toggle="tooltip" data-placement="top" title="" data-original-title="Delete Key" class="btn btn-light waves-effect waves-light btn-xs" onClick="api(<?= $rHMAC['id']; ?>, 'delete');"">
|
||||
<i class=" mdi mdi-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function api(rID, rType, rConfirm = false) {
|
||||
if ((rType == "delete") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Delete",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to delete this HMAC Key?",
|
||||
confirm: function() {
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else {
|
||||
rConfirm = true;
|
||||
}
|
||||
if (rConfirm) {
|
||||
$.getJSON("./api?action=hmac&sub=" + rType + "&hmac_id=" + rID, function(data) {
|
||||
if (data.result === true) {
|
||||
if (rType == "delete") {
|
||||
if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {
|
||||
$("#datatable").DataTable().rows(rRow).remove().draw(false);
|
||||
}
|
||||
$.toast("HMAC Key has been deleted.");
|
||||
}
|
||||
} else {
|
||||
$.toast("<?= $language::get('error_occured'); ?>");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$("#datatable").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
order: [
|
||||
[1, "asc"]
|
||||
],
|
||||
columnDefs: [{
|
||||
"visible": false,
|
||||
"targets": [0]
|
||||
}],
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
responsive: false
|
||||
});
|
||||
$("#datatable").css("width", "100%");
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'HMAC Keys';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">HMAC Keys</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
HMAC Token has been authenticated and can now be used.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?= $language::get('id'); ?></th>
|
||||
<th>Description</th>
|
||||
<th class="text-center">Enabled</th>
|
||||
<th class="text-center"><?= $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getHMACTokens() as $rHMAC): ?>
|
||||
<tr id="hmac-<?= $rHMAC['id']; ?>">
|
||||
<td class="text-center"><?= $rHMAC['id']; ?></td>
|
||||
<td><?= $rHMAC['notes']; ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($rHMAC['enabled']): ?>
|
||||
<i class="text-success fas fa-square"></i>
|
||||
<?php else: ?>
|
||||
<i class="text-secondary fas fa-square"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<a href="./hmac?id=<?= $rHMAC['id']; ?>">
|
||||
<button type="button" data-toggle="tooltip" data-placement="top" title="" data-original-title="Edit Key" class="btn btn-light waves-effect waves-light btn-xs">
|
||||
<i class="mdi mdi-pencil-outline"></i>
|
||||
</button>
|
||||
</a>
|
||||
<button type="button" data-toggle="tooltip" data-placement="top" title="" data-original-title="Delete Key" class="btn btn-light waves-effect waves-light btn-xs" onClick="api(<?= $rHMAC['id']; ?>, 'delete');"">
|
||||
<i class=" mdi mdi-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function api(rID, rType, rConfirm = false) {
|
||||
if ((rType == "delete") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Delete",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to delete this HMAC Key?",
|
||||
confirm: function() {
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else {
|
||||
rConfirm = true;
|
||||
}
|
||||
if (rConfirm) {
|
||||
$.getJSON("./api?action=hmac&sub=" + rType + "&hmac_id=" + rID, function(data) {
|
||||
if (data.result === true) {
|
||||
if (rType == "delete") {
|
||||
if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {
|
||||
$("#datatable").DataTable().rows(rRow).remove().draw(false);
|
||||
}
|
||||
$.toast("HMAC Key has been deleted.");
|
||||
}
|
||||
} else {
|
||||
$.toast("<?= $language::get('error_occured'); ?>");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$("#datatable").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
order: [
|
||||
[1, "asc"]
|
||||
],
|
||||
columnDefs: [{
|
||||
"visible": false,
|
||||
"targets": [0]
|
||||
}],
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
responsive: false
|
||||
});
|
||||
$("#datatable").css("width", "100%");
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+223
-217
@@ -1,217 +1,223 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Blocked IP';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('block_ip'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST" data-parsley-validate="">
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#ip-details" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-account-card-details-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline"><?php echo $language::get('details'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="ip-details">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="ip"><?php echo $language::get('ip_address'); ?></label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" id="ip" name="ip" value="" required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="notes"><?php echo $language::get('notes'); ?></label>
|
||||
<div class="col-md-8">
|
||||
<textarea class="form-control" id="notes" name="notes" required data-parsley-trigger="change"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="submit_ip" type="submit" class="btn btn-primary" value="<?php echo $language::get('block'); ?>" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Blocked IP';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
<?php endif; ?>
|
||||
?>
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('block_ip'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST" data-parsley-validate="">
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#ip-details" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-account-card-details-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline"><?php echo $language::get('details'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="ip-details">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="ip"><?php echo $language::get('ip_address'); ?></label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" id="ip" name="ip" value="" required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="notes"><?php echo $language::get('notes'); ?></label>
|
||||
<div class="col-md-8">
|
||||
<textarea class="form-control" id="notes" name="notes" required data-parsley-trigger="change"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="submit_ip" type="submit" class="btn btn-primary" value="<?php echo $language::get('block'); ?>" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+229
-223
@@ -1,223 +1,229 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['flush'])) {
|
||||
flushIPs();
|
||||
header('Location: ./ips?status=' . STATUS_FLUSH);
|
||||
exit;
|
||||
}
|
||||
|
||||
$_TITLE = "Blocked IP's";
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('blocked_ip_addresses'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
IP has been added to the block list and propagated across all servers.
|
||||
</div>
|
||||
<?php elseif (isset($_STATUS) && $_STATUS == STATUS_FLUSH): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
All blocked IP's have been flushed from the database.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('ip_address'); ?></th>
|
||||
<th><?php echo $language::get('notes'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('date'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getBlockedIPs() as $rIP): ?>
|
||||
<tr id="ip-<?php echo $rIP['id']; ?>">
|
||||
<td class="text-center"><?php echo $rIP['id']; ?></td>
|
||||
<td class="text-center"><?php echo $rIP['ip']; ?></td>
|
||||
<td><?php echo $rIP['notes']; ?></td>
|
||||
<td class="text-center"><?php echo date('Y-m-d H:i:s', $rIP['date']); ?></td>
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rIP['id']; ?>, 'delete');"><i class="mdi mdi-close"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('block_ip_delete_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=ip&sub=" + rType + "&ip=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {' . "\r\n" . ' $("#datatable").DataTable().rows(rRow).remove().draw(false);' . "\r\n" . ' }' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('blocked_ip_deleted');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("An error occured while processing your request.");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n" . ' bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n" . ' order: [[ 3, "desc" ]],' . "\r\n" . ' columnDefs: [' . "\r\n\t\t\t\t\t" . '{"visible": false, "targets": [0]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t\t" . 'responsive: false' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['flush'])) {
|
||||
flushIPs();
|
||||
header('Location: ./ips?status=' . STATUS_FLUSH);
|
||||
exit;
|
||||
}
|
||||
|
||||
$_TITLE = "Blocked IP's";
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('blocked_ip_addresses'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
IP has been added to the block list and propagated across all servers.
|
||||
</div>
|
||||
<?php elseif (isset($_STATUS) && $_STATUS == STATUS_FLUSH): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
All blocked IP's have been flushed from the database.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('ip_address'); ?></th>
|
||||
<th><?php echo $language::get('notes'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('date'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getBlockedIPs() as $rIP): ?>
|
||||
<tr id="ip-<?php echo $rIP['id']; ?>">
|
||||
<td class="text-center"><?php echo $rIP['id']; ?></td>
|
||||
<td class="text-center"><?php echo $rIP['ip']; ?></td>
|
||||
<td><?php echo $rIP['notes']; ?></td>
|
||||
<td class="text-center"><?php echo date('Y-m-d H:i:s', $rIP['date']); ?></td>
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rIP['id']; ?>, 'delete');"><i class="mdi mdi-close"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('block_ip_delete_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=ip&sub=" + rType + "&ip=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {' . "\r\n" . ' $("#datatable").DataTable().rows(rRow).remove().draw(false);' . "\r\n" . ' }' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('blocked_ip_deleted');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("An error occured while processing your request.");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n" . ' bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n" . ' order: [[ 3, "desc" ]],' . "\r\n" . ' columnDefs: [' . "\r\n\t\t\t\t\t" . '{"visible": false, "targets": [0]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t\t" . 'responsive: false' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+231
-225
@@ -1,225 +1,231 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (!isset(CoreUtilities::$rRequest['id']) || ($rISPArr = getISP(CoreUtilities::$rRequest['id']))) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Blocked ISP';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo isset($rISPArr) ? 'Edit' : 'Block'; ?> ISP</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST" data-parsley-validate="">
|
||||
<?php if (isset($rISPArr)): ?>
|
||||
<input type="hidden" name="edit" value="<?php echo $rISPArr['id']; ?>" />
|
||||
<?php endif; ?>
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#isp-details" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-account-card-details-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Details</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="isp-details">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="isp">ISP Name</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" id="isp" name="isp" value="<?php echo isset($rISPArr) ? htmlspecialchars($rISPArr['isp']) : ''; ?>" required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="blocked">Blocked</label>
|
||||
<div class="col-md-2">
|
||||
<input name="blocked" id="blocked" type="checkbox" <?php echo isset($rISPArr) && $rISPArr['blocked'] == 1 ? 'checked' : ''; ?> data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="submit_isp" type="submit" class="btn btn-primary" value="<?php echo isset($rISPArr) ? 'Edit' : 'Block'; ?>" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (!isset(CoreUtilities::$rRequest['id']) || ($rISPArr = getISP(CoreUtilities::$rRequest['id']))) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Blocked ISP';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
<?php endif; ?>
|
||||
?>
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo isset($rISPArr) ? 'Edit' : 'Block'; ?> ISP</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST" data-parsley-validate="">
|
||||
<?php if (isset($rISPArr)): ?>
|
||||
<input type="hidden" name="edit" value="<?php echo $rISPArr['id']; ?>" />
|
||||
<?php endif; ?>
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#isp-details" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-account-card-details-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Details</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="isp-details">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="isp">ISP Name</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" id="isp" name="isp" value="<?php echo isset($rISPArr) ? htmlspecialchars($rISPArr['isp']) : ''; ?>" required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="blocked">Blocked</label>
|
||||
<div class="col-md-2">
|
||||
<input name="blocked" id="blocked" type="checkbox" <?php echo isset($rISPArr) && $rISPArr['blocked'] == 1 ? 'checked' : ''; ?> data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="submit_isp" type="submit" class="btn btn-primary" value="<?php echo isset($rISPArr) ? 'Edit' : 'Block'; ?>" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+266
-260
@@ -1,260 +1,266 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = "Blocked ISP's";
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Blocked ISP's</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
ISP has been blocked on all servers.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<th>ISP Name</th>
|
||||
<th class="text-center">Blocked</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getISPs() as $rISP): ?>
|
||||
<tr id="isp-<?php echo $rISP['id']; ?>">
|
||||
<td class="text-center"><?php echo $rISP['id']; ?></td>
|
||||
<td><?php echo $rISP['isp']; ?></td>
|
||||
<td class="text-center">
|
||||
<?php echo $rISP['blocked'] ? '<i class="text-success fas fa-square"></i>' : '<i class="text-secondary fas fa-square"></i>'; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<a href="./isp?id=<?php echo $rISP['id']; ?>"><button type="button" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-pencil-outline"></i></button></a>
|
||||
<button type="button" class="btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rISP['id']; ?>, 'delete');"><i class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function api(rID, rType, rConfirm = false) {
|
||||
if ((rType == "delete") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Delete",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to delete this ISP?",
|
||||
confirm: function() {
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else {
|
||||
rConfirm = true;
|
||||
}
|
||||
if (rConfirm) {
|
||||
$.getJSON("./api?action=isp&sub=" + rType + "&isp_id=" + rID, function(data) {
|
||||
if (data.result === true) {
|
||||
if (rType == "delete") {
|
||||
if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {
|
||||
$("#datatable").DataTable().rows(rRow).remove().draw(false);
|
||||
}
|
||||
$.toast("ISP successfully deleted.");
|
||||
}
|
||||
} else {
|
||||
$.toast("An error occured while processing your request.");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#datatable").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
order: [
|
||||
[1, "asc"]
|
||||
],
|
||||
columnDefs: [{
|
||||
"visible": false,
|
||||
"targets": [0]
|
||||
}],
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
responsive: false
|
||||
});
|
||||
$("#datatable").css("width", "100%");
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = "Blocked ISP's";
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Blocked ISP's</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
ISP has been blocked on all servers.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<th>ISP Name</th>
|
||||
<th class="text-center">Blocked</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getISPs() as $rISP): ?>
|
||||
<tr id="isp-<?php echo $rISP['id']; ?>">
|
||||
<td class="text-center"><?php echo $rISP['id']; ?></td>
|
||||
<td><?php echo $rISP['isp']; ?></td>
|
||||
<td class="text-center">
|
||||
<?php echo $rISP['blocked'] ? '<i class="text-success fas fa-square"></i>' : '<i class="text-secondary fas fa-square"></i>'; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<a href="./isp?id=<?php echo $rISP['id']; ?>"><button type="button" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-pencil-outline"></i></button></a>
|
||||
<button type="button" class="btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rISP['id']; ?>, 'delete');"><i class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function api(rID, rType, rConfirm = false) {
|
||||
if ((rType == "delete") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Delete",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to delete this ISP?",
|
||||
confirm: function() {
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else {
|
||||
rConfirm = true;
|
||||
}
|
||||
if (rConfirm) {
|
||||
$.getJSON("./api?action=isp&sub=" + rType + "&isp_id=" + rID, function(data) {
|
||||
if (data.result === true) {
|
||||
if (rType == "delete") {
|
||||
if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {
|
||||
$("#datatable").DataTable().rows(rRow).remove().draw(false);
|
||||
}
|
||||
$.toast("ISP successfully deleted.");
|
||||
}
|
||||
} else {
|
||||
$.toast("An error occured while processing your request.");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#datatable").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
order: [
|
||||
[1, "asc"]
|
||||
],
|
||||
columnDefs: [{
|
||||
"visible": false,
|
||||
"targets": [0]
|
||||
}],
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
responsive: false
|
||||
});
|
||||
$("#datatable").css("width", "100%");
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+8
-3
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php if (!isset($__viewMode)):
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
@@ -42,7 +42,9 @@ if (isset(CoreUtilities::$rRequest['id'])) {
|
||||
|
||||
$rRegisteredUsers = getRegisteredUsers();
|
||||
$_TITLE = 'Line';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
endif;
|
||||
?>
|
||||
<div class="wrapper boxed-layout" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
echo '';
|
||||
@@ -382,7 +384,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php if (!isset($__viewMode)):
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
@@ -19,7 +19,9 @@ if (!isset(CoreUtilities::$rRequest['stream_id'])) {
|
||||
}
|
||||
|
||||
$_TITLE = 'Activity Logs';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
endif;
|
||||
?>
|
||||
|
||||
<div class="wrapper" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
@@ -122,7 +124,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php if (!isset($__viewMode)):
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
@@ -10,7 +10,9 @@ if (!checkPermissions()) {
|
||||
$rRange = (intval(CoreUtilities::$rRequest['range']) ?: 0);
|
||||
$rLineIPs = (igbinary_unserialize(file_get_contents(CACHE_TMP_PATH . 'lines_per_ip')) ?: array());
|
||||
$_TITLE = 'Line IP Usage';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
endif;
|
||||
?>
|
||||
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
@@ -90,7 +92,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php if (!isset($__viewMode)):
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
@@ -8,7 +8,9 @@ if (!checkPermissions()) {
|
||||
}
|
||||
|
||||
$_TITLE = 'Mass Edit Lines';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
endif;
|
||||
?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
@@ -336,7 +338,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
+10
-2
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php'; ?>
|
||||
<?php include 'functions.php'; ?>
|
||||
|
||||
@@ -6,7 +7,11 @@
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $_TITLE = 'Lines'; ?>
|
||||
<?php include 'header.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
@@ -117,7 +122,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
@@ -15,7 +16,9 @@ if (isset(CoreUtilities::$rRequest['stream_id'])) {
|
||||
}
|
||||
|
||||
$_TITLE = 'Live Connections';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
<?php endif; ?>
|
||||
?>
|
||||
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
@@ -156,7 +159,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
@@ -338,4 +344,4 @@ include 'header.php';
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
+259
-251
@@ -1,251 +1,259 @@
|
||||
<?php include 'session.php'; ?>
|
||||
<?php include 'functions.php'; ?>
|
||||
|
||||
<?php if (!checkPermissions()): ?>
|
||||
<?php goHome(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $_TITLE = 'Login Logs'; ?>
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
<div class="wrapper" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Login Logs</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('date'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('type'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('status'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('username'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('access_code'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('ip'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function api(rID, rType, rConfirm = false) {
|
||||
if ((rType == "block") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Block",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to block this IP address?",
|
||||
confirm: function() {
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else {
|
||||
rConfirm = true;
|
||||
}
|
||||
if (rConfirm) {
|
||||
$.getJSON("./api?action=mysql_syslog&sub=" + rType + "&ip=" + rID, function(data) {
|
||||
if (data.result === true) {
|
||||
if (rType == "block") {
|
||||
$.toast("IP has been blocked.");
|
||||
}
|
||||
$("#datatable").DataTable().ajax.reload(null, false);
|
||||
} else {
|
||||
$.toast("<?php echo $language::get('error_occured'); ?>");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#datatable").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
responsive: false,
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "./table",
|
||||
"data": function(d) {
|
||||
d.id = "login_logs";
|
||||
}
|
||||
},
|
||||
columnDefs: [{
|
||||
"className": "dt-center",
|
||||
"targets": [0, 1, 2, 3, 4, 5, 6]
|
||||
}],
|
||||
order: [
|
||||
[0, "desc"]
|
||||
]
|
||||
});
|
||||
$("#datatable").css("width", "100%");
|
||||
$("#btn-export-csv").click(function() {
|
||||
$.toast("Generating CSV report...");
|
||||
window.location.href = "api?action=report¶ms=" + encodeURIComponent(JSON.stringify($("#datatable").DataTable().ajax.params()));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php'; ?>
|
||||
<?php include 'functions.php'; ?>
|
||||
|
||||
<?php if (!checkPermissions()): ?>
|
||||
<?php goHome(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $_TITLE = 'Login Logs'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include __DIR__ . '/topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Login Logs</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('date'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('type'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('status'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('username'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('access_code'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('ip'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function api(rID, rType, rConfirm = false) {
|
||||
if ((rType == "block") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Block",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to block this IP address?",
|
||||
confirm: function() {
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else {
|
||||
rConfirm = true;
|
||||
}
|
||||
if (rConfirm) {
|
||||
$.getJSON("./api?action=mysql_syslog&sub=" + rType + "&ip=" + rID, function(data) {
|
||||
if (data.result === true) {
|
||||
if (rType == "block") {
|
||||
$.toast("IP has been blocked.");
|
||||
}
|
||||
$("#datatable").DataTable().ajax.reload(null, false);
|
||||
} else {
|
||||
$.toast("<?php echo $language::get('error_occured'); ?>");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#datatable").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
responsive: false,
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "./table",
|
||||
"data": function(d) {
|
||||
d.id = "login_logs";
|
||||
}
|
||||
},
|
||||
columnDefs: [{
|
||||
"className": "dt-center",
|
||||
"targets": [0, 1, 2, 3, 4, 5, 6]
|
||||
}],
|
||||
order: [
|
||||
[0, "desc"]
|
||||
]
|
||||
});
|
||||
$("#datatable").css("width", "100%");
|
||||
$("#btn-export-csv").click(function() {
|
||||
$.toast("Generating CSV report...");
|
||||
window.location.href = "api?action=report¶ms=" + encodeURIComponent(JSON.stringify($("#datatable").DataTable().ajax.params()));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+736
-730
File diff suppressed because it is too large
Load Diff
+200
-194
@@ -1,194 +1,200 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'MAG Events';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('mag_events'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('date'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('mac_address'); ?></th>
|
||||
<th><?php echo $language::get('event'); ?></th>
|
||||
<th><?php echo $language::get('message'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n" . ' function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('device_delete_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=mag_event&sub=" + rType + "&mag_id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('event_confirmed');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' $("#datatable").DataTable().ajax.reload(null, false);' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'serverSide: true,' . "\r\n\t\t\t\t" . 'ajax: {' . "\r\n\t\t\t\t\t" . 'url: "./table",' . "\r\n\t\t\t\t\t" . '"data": function(d) {' . "\r\n\t\t\t\t\t\t" . 'd.id = "mag_events";' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [0,1,4]}' . "\r\n\t\t\t\t" . ']' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n" . ' $("#btn-export-csv").click(function() {' . "\r\n" . ' $.toast("Generating CSV report...");' . "\r\n" . ' window.location.href = "api?action=report¶ms=" + encodeURIComponent(JSON.stringify($("#datatable").DataTable().ajax.params()));' . "\r\n\t\t\t" . '});' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'MAG Events';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('mag_events'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('date'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('mac_address'); ?></th>
|
||||
<th><?php echo $language::get('event'); ?></th>
|
||||
<th><?php echo $language::get('message'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n" . ' function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('device_delete_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=mag_event&sub=" + rType + "&mag_id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('event_confirmed');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' $("#datatable").DataTable().ajax.reload(null, false);' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'serverSide: true,' . "\r\n\t\t\t\t" . 'ajax: {' . "\r\n\t\t\t\t\t" . 'url: "./table",' . "\r\n\t\t\t\t\t" . '"data": function(d) {' . "\r\n\t\t\t\t\t\t" . 'd.id = "mag_events";' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [0,1,4]}' . "\r\n\t\t\t\t" . ']' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n" . ' $("#btn-export-csv").click(function() {' . "\r\n" . ' $.toast("Generating CSV report...");' . "\r\n" . ' window.location.href = "api?action=report¶ms=" + encodeURIComponent(JSON.stringify($("#datatable").DataTable().ajax.params()));' . "\r\n\t\t\t" . '});' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+532
-526
File diff suppressed because one or more lines are too long
+9
-3
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
@@ -8,8 +9,10 @@ if (!checkPermissions()) {
|
||||
}
|
||||
|
||||
$_TITLE = 'MAG Devices';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo 'style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
@@ -96,7 +99,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
@@ -289,4 +295,4 @@ include 'header.php';
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
+307
-301
@@ -1,301 +1,307 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'MAGSCAN Settings';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">MAGSCAN Settings</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST" data-parsley-validate="">
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#scan_nav_2" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-face-profile mr-1"></i>
|
||||
<span class="d-none d-sm-inline">WhiteList MAC</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#scan_nav_3" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-checkbox-marked-circle-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline">BlackList MAC</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#scan_nav_4" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-checkbox-marked-circle-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline">WhiteList IP</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
|
||||
<div class="tab-pane mt-2" id="scan_nav_2">
|
||||
<h4>White List of MAC Addresses</h4>
|
||||
<p>Enter MAC address that you want to bypass the block!</p>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-4 col-form-label" for="whitelist_mac">MAC Address</label>
|
||||
<div class="col-8 input-group">
|
||||
<input type="text" id="whitelist_mac" class="form-control" value="" maxlength="17">
|
||||
<div class="input-group-append">
|
||||
<a href="javascript:void(0)" id="add_mac" class="btn btn-primary waves-effect waves-light"><i class="mdi mdi-plus"></i></a>
|
||||
<a href="javascript:void(0)" id="remove_mac" class="btn btn-danger waves-effect waves-light"><i class="mdi mdi-close"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-4 col-form-label" for="whitelist_macs"> </label>
|
||||
<div class="col-8">
|
||||
<select id="whitelist_macs" name="whitelist_macs[]" size="10" class="form-control" multiple="multiple">
|
||||
<?php if (isset($gData) && count($gData['value']['whitelist_macs']) > 0) { ?>
|
||||
<?php foreach ($gData['value']['whitelist_macs'] as $gDataWhiteListMac) { ?>
|
||||
<option value="<?php echo $gDataWhiteListMac; ?>"><?php echo $gDataWhiteListMac; ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane mt-2" id="scan_nav_3">
|
||||
<h4>Black List of MAC Addresses</h4>
|
||||
<p>Enter MAC address that you want to block immediately on first request!</p>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-4 col-form-label" for="blacklist_mac">MAC Address</label>
|
||||
<div class="col-8 input-group">
|
||||
<input type="text" id="blacklist_mac" class="form-control" value="" maxlength="17">
|
||||
<div class="input-group-append">
|
||||
<a href="javascript:void(0)" id="add_black_mac" class="btn btn-primary waves-effect waves-light"><i class="mdi mdi-plus"></i></a>
|
||||
<a href="javascript:void(0)" id="remove_black_mac" class="btn btn-danger waves-effect waves-light"><i class="mdi mdi-close"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-4 col-form-label" for="blacklist_macs"> </label>
|
||||
<div class="col-8">
|
||||
<select id="blacklist_macs" name="blacklist_macs[]" size="10" class="form-control" multiple="multiple">
|
||||
<?php if (isset($gData) && count($gData['value']['blacklist_macs']) > 0) { ?>
|
||||
<?php foreach ($gData['value']['blacklist_macs'] as $gDataBlackListMac) { ?>
|
||||
<option value="<?php echo $gDataBlackListMac; ?>"><?php echo $gDataBlackListMac; ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane mt-2" id="scan_nav_4">
|
||||
<h4>White List of IP Addresses</h4>
|
||||
<p>Enter IP address that you want to bypass the block!</p>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-4 col-form-label" for="whitelist_ip">IP Address</label>
|
||||
<div class="col-8 input-group">
|
||||
<input type="text" id="whitelist_ip" class="form-control" value="">
|
||||
<div class="input-group-append">
|
||||
<a href="javascript:void(0)" id="add_ip" class="btn btn-primary waves-effect waves-light"><i class="mdi mdi-plus"></i></a>
|
||||
<a href="javascript:void(0)" id="remove_ip" class="btn btn-danger waves-effect waves-light"><i class="mdi mdi-close"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-4 col-form-label" for="whitelist_ips"> </label>
|
||||
<div class="col-8">
|
||||
<select id="whitelist_ips" name="whitelist_ips[]" size="10" class="form-control" multiple="multiple">
|
||||
<?php if (isset($gData) && count($gData['value']['whitelist_ips']) > 0) { ?>
|
||||
<?php foreach ($gData['value']['whitelist_ips'] as $gDataWhiteListIp) { ?>
|
||||
<option value="<?php echo $gDataWhiteListIp; ?>"><?php echo $gDataWhiteListIp; ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="list-inline wizard mt-4 mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="submit_magscan" type="submit" class="btn btn-success" value="Save Settings">
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div> <!-- tab-content -->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
var macAddressWhite = document.getElementById("whitelist_mac");
|
||||
var macAddressBlack = document.getElementById("blacklist_mac");
|
||||
|
||||
function formatMAC(e) {
|
||||
var r = /([a-f0-9]{2})([a-f0-9]{2})/i,
|
||||
str = e.target.value.replace(/[^a-f0-9]/ig, "");
|
||||
|
||||
while (r.test(str)) {
|
||||
str = str.replace(r, '$1' + ':' + '$2');
|
||||
}
|
||||
|
||||
e.target.value = str.slice(0, 17);
|
||||
};
|
||||
|
||||
macAddressWhite.addEventListener("keyup", formatMAC, false);
|
||||
macAddressBlack.addEventListener("keyup", formatMAC, false);
|
||||
|
||||
//Checkboxes
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html);
|
||||
});
|
||||
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$("form").attr('autocomplete', 'off');
|
||||
|
||||
//Add MAC
|
||||
$("#add_mac").click(function() {
|
||||
if ($("#whitelist_mac").val().length > 0) {
|
||||
var macAddress = $("#whitelist_mac").val();
|
||||
var macAddressRegex = /^([0-9A-Fa-f]{2}[:\-]){5}([0-9A-Fa-f]{2})$/;
|
||||
if (macAddressRegex.test(macAddress)) {
|
||||
// Check if the MAC address already exists
|
||||
var options = $("#whitelist_macs option");
|
||||
var exists = false;
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
if (options[i].value == macAddress) {
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!exists) {
|
||||
var o = new Option(macAddress, macAddress);
|
||||
$("#whitelist_macs").append(o);
|
||||
$("#whitelist_mac").val("");
|
||||
} else {
|
||||
$.toast("MAC Address is already whitelisted.");
|
||||
}
|
||||
} else {
|
||||
$.toast("Please enter a valid MAC Address.");
|
||||
}
|
||||
} else {
|
||||
$.toast("Please enter MAC Address.");
|
||||
}
|
||||
});
|
||||
$("#remove_mac").click(function() {
|
||||
$('#whitelist_macs option:selected').remove();
|
||||
});
|
||||
|
||||
//Black
|
||||
$("#add_black_mac").click(function() {
|
||||
if ($("#blacklist_mac").val().length > 0) {
|
||||
var macAddress = $("#blacklist_mac").val();
|
||||
var macAddressRegex = /^([0-9A-Fa-f]{2}[:\-]){5}([0-9A-Fa-f]{2})$/;
|
||||
if (macAddressRegex.test(macAddress)) {
|
||||
// Check if the MAC address already exists
|
||||
var options = $("#blacklist_macs option");
|
||||
var exists = false;
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
if (options[i].value == macAddress) {
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!exists) {
|
||||
var o = new Option(macAddress, macAddress);
|
||||
$("#blacklist_macs").append(o);
|
||||
$("#blacklist_mac").val("");
|
||||
} else {
|
||||
$.toast("MAC Address is already blacklisted.");
|
||||
}
|
||||
} else {
|
||||
$.toast("Please enter a valid MAC Address.");
|
||||
}
|
||||
} else {
|
||||
$.toast("Please enter MAC Address.");
|
||||
}
|
||||
});
|
||||
$("#remove_black_mac").click(function() {
|
||||
$('#blacklist_macs option:selected').remove();
|
||||
});
|
||||
|
||||
//Add IP
|
||||
$("#add_ip").click(function() {
|
||||
if ($("#whitelist_ip").val().length > 0) {
|
||||
var ipAddress = $("#whitelist_ip").val();
|
||||
var ipAddressRegex = /^([0-9]{1,3}\.){3}[0-9]{1,3}$/;
|
||||
if (ipAddressRegex.test(ipAddress)) {
|
||||
// Check if the IP address already exists
|
||||
var options = $("#whitelist_ips option");
|
||||
var exists = false;
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
if (options[i].value == ipAddress) {
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!exists) {
|
||||
var o = new Option(ipAddress, ipAddress);
|
||||
$("#whitelist_ips").append(o);
|
||||
$("#whitelist_ip").val("");
|
||||
} else {
|
||||
$.toast("IP Address is already whitelisted.");
|
||||
}
|
||||
} else {
|
||||
$.toast("Please enter a valid IP Address.");
|
||||
}
|
||||
} else {
|
||||
$.toast("Please enter IP Address.");
|
||||
}
|
||||
});
|
||||
|
||||
$("#remove_ip").click(function() {
|
||||
$('#whitelist_ips option:selected').remove();
|
||||
});
|
||||
|
||||
//Form Submit
|
||||
// $("#scan_settings").submit(function(e){
|
||||
// $("#whitelist_macs option").prop('selected', true);
|
||||
// $("#blacklist_macs option").prop('selected', true);
|
||||
// $("#whitelist_ips option").prop('selected', true);
|
||||
// });
|
||||
});
|
||||
</script>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'MAGSCAN Settings';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">MAGSCAN Settings</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST" data-parsley-validate="">
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#scan_nav_2" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-face-profile mr-1"></i>
|
||||
<span class="d-none d-sm-inline">WhiteList MAC</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#scan_nav_3" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-checkbox-marked-circle-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline">BlackList MAC</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#scan_nav_4" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-checkbox-marked-circle-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline">WhiteList IP</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
|
||||
<div class="tab-pane mt-2" id="scan_nav_2">
|
||||
<h4>White List of MAC Addresses</h4>
|
||||
<p>Enter MAC address that you want to bypass the block!</p>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-4 col-form-label" for="whitelist_mac">MAC Address</label>
|
||||
<div class="col-8 input-group">
|
||||
<input type="text" id="whitelist_mac" class="form-control" value="" maxlength="17">
|
||||
<div class="input-group-append">
|
||||
<a href="javascript:void(0)" id="add_mac" class="btn btn-primary waves-effect waves-light"><i class="mdi mdi-plus"></i></a>
|
||||
<a href="javascript:void(0)" id="remove_mac" class="btn btn-danger waves-effect waves-light"><i class="mdi mdi-close"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-4 col-form-label" for="whitelist_macs"> </label>
|
||||
<div class="col-8">
|
||||
<select id="whitelist_macs" name="whitelist_macs[]" size="10" class="form-control" multiple="multiple">
|
||||
<?php if (isset($gData) && count($gData['value']['whitelist_macs']) > 0) { ?>
|
||||
<?php foreach ($gData['value']['whitelist_macs'] as $gDataWhiteListMac) { ?>
|
||||
<option value="<?php echo $gDataWhiteListMac; ?>"><?php echo $gDataWhiteListMac; ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane mt-2" id="scan_nav_3">
|
||||
<h4>Black List of MAC Addresses</h4>
|
||||
<p>Enter MAC address that you want to block immediately on first request!</p>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-4 col-form-label" for="blacklist_mac">MAC Address</label>
|
||||
<div class="col-8 input-group">
|
||||
<input type="text" id="blacklist_mac" class="form-control" value="" maxlength="17">
|
||||
<div class="input-group-append">
|
||||
<a href="javascript:void(0)" id="add_black_mac" class="btn btn-primary waves-effect waves-light"><i class="mdi mdi-plus"></i></a>
|
||||
<a href="javascript:void(0)" id="remove_black_mac" class="btn btn-danger waves-effect waves-light"><i class="mdi mdi-close"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-4 col-form-label" for="blacklist_macs"> </label>
|
||||
<div class="col-8">
|
||||
<select id="blacklist_macs" name="blacklist_macs[]" size="10" class="form-control" multiple="multiple">
|
||||
<?php if (isset($gData) && count($gData['value']['blacklist_macs']) > 0) { ?>
|
||||
<?php foreach ($gData['value']['blacklist_macs'] as $gDataBlackListMac) { ?>
|
||||
<option value="<?php echo $gDataBlackListMac; ?>"><?php echo $gDataBlackListMac; ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane mt-2" id="scan_nav_4">
|
||||
<h4>White List of IP Addresses</h4>
|
||||
<p>Enter IP address that you want to bypass the block!</p>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-4 col-form-label" for="whitelist_ip">IP Address</label>
|
||||
<div class="col-8 input-group">
|
||||
<input type="text" id="whitelist_ip" class="form-control" value="">
|
||||
<div class="input-group-append">
|
||||
<a href="javascript:void(0)" id="add_ip" class="btn btn-primary waves-effect waves-light"><i class="mdi mdi-plus"></i></a>
|
||||
<a href="javascript:void(0)" id="remove_ip" class="btn btn-danger waves-effect waves-light"><i class="mdi mdi-close"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-4 col-form-label" for="whitelist_ips"> </label>
|
||||
<div class="col-8">
|
||||
<select id="whitelist_ips" name="whitelist_ips[]" size="10" class="form-control" multiple="multiple">
|
||||
<?php if (isset($gData) && count($gData['value']['whitelist_ips']) > 0) { ?>
|
||||
<?php foreach ($gData['value']['whitelist_ips'] as $gDataWhiteListIp) { ?>
|
||||
<option value="<?php echo $gDataWhiteListIp; ?>"><?php echo $gDataWhiteListIp; ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="list-inline wizard mt-4 mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="submit_magscan" type="submit" class="btn btn-success" value="Save Settings">
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div> <!-- tab-content -->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
var macAddressWhite = document.getElementById("whitelist_mac");
|
||||
var macAddressBlack = document.getElementById("blacklist_mac");
|
||||
|
||||
function formatMAC(e) {
|
||||
var r = /([a-f0-9]{2})([a-f0-9]{2})/i,
|
||||
str = e.target.value.replace(/[^a-f0-9]/ig, "");
|
||||
|
||||
while (r.test(str)) {
|
||||
str = str.replace(r, '$1' + ':' + '$2');
|
||||
}
|
||||
|
||||
e.target.value = str.slice(0, 17);
|
||||
};
|
||||
|
||||
macAddressWhite.addEventListener("keyup", formatMAC, false);
|
||||
macAddressBlack.addEventListener("keyup", formatMAC, false);
|
||||
|
||||
//Checkboxes
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html);
|
||||
});
|
||||
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$("form").attr('autocomplete', 'off');
|
||||
|
||||
//Add MAC
|
||||
$("#add_mac").click(function() {
|
||||
if ($("#whitelist_mac").val().length > 0) {
|
||||
var macAddress = $("#whitelist_mac").val();
|
||||
var macAddressRegex = /^([0-9A-Fa-f]{2}[:\-]){5}([0-9A-Fa-f]{2})$/;
|
||||
if (macAddressRegex.test(macAddress)) {
|
||||
// Check if the MAC address already exists
|
||||
var options = $("#whitelist_macs option");
|
||||
var exists = false;
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
if (options[i].value == macAddress) {
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!exists) {
|
||||
var o = new Option(macAddress, macAddress);
|
||||
$("#whitelist_macs").append(o);
|
||||
$("#whitelist_mac").val("");
|
||||
} else {
|
||||
$.toast("MAC Address is already whitelisted.");
|
||||
}
|
||||
} else {
|
||||
$.toast("Please enter a valid MAC Address.");
|
||||
}
|
||||
} else {
|
||||
$.toast("Please enter MAC Address.");
|
||||
}
|
||||
});
|
||||
$("#remove_mac").click(function() {
|
||||
$('#whitelist_macs option:selected').remove();
|
||||
});
|
||||
|
||||
//Black
|
||||
$("#add_black_mac").click(function() {
|
||||
if ($("#blacklist_mac").val().length > 0) {
|
||||
var macAddress = $("#blacklist_mac").val();
|
||||
var macAddressRegex = /^([0-9A-Fa-f]{2}[:\-]){5}([0-9A-Fa-f]{2})$/;
|
||||
if (macAddressRegex.test(macAddress)) {
|
||||
// Check if the MAC address already exists
|
||||
var options = $("#blacklist_macs option");
|
||||
var exists = false;
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
if (options[i].value == macAddress) {
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!exists) {
|
||||
var o = new Option(macAddress, macAddress);
|
||||
$("#blacklist_macs").append(o);
|
||||
$("#blacklist_mac").val("");
|
||||
} else {
|
||||
$.toast("MAC Address is already blacklisted.");
|
||||
}
|
||||
} else {
|
||||
$.toast("Please enter a valid MAC Address.");
|
||||
}
|
||||
} else {
|
||||
$.toast("Please enter MAC Address.");
|
||||
}
|
||||
});
|
||||
$("#remove_black_mac").click(function() {
|
||||
$('#blacklist_macs option:selected').remove();
|
||||
});
|
||||
|
||||
//Add IP
|
||||
$("#add_ip").click(function() {
|
||||
if ($("#whitelist_ip").val().length > 0) {
|
||||
var ipAddress = $("#whitelist_ip").val();
|
||||
var ipAddressRegex = /^([0-9]{1,3}\.){3}[0-9]{1,3}$/;
|
||||
if (ipAddressRegex.test(ipAddress)) {
|
||||
// Check if the IP address already exists
|
||||
var options = $("#whitelist_ips option");
|
||||
var exists = false;
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
if (options[i].value == ipAddress) {
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!exists) {
|
||||
var o = new Option(ipAddress, ipAddress);
|
||||
$("#whitelist_ips").append(o);
|
||||
$("#whitelist_ip").val("");
|
||||
} else {
|
||||
$.toast("IP Address is already whitelisted.");
|
||||
}
|
||||
} else {
|
||||
$.toast("Please enter a valid IP Address.");
|
||||
}
|
||||
} else {
|
||||
$.toast("Please enter IP Address.");
|
||||
}
|
||||
});
|
||||
|
||||
$("#remove_ip").click(function() {
|
||||
$('#whitelist_ips option:selected').remove();
|
||||
});
|
||||
|
||||
//Form Submit
|
||||
// $("#scan_settings").submit(function(e){
|
||||
// $("#whitelist_macs option").prop('selected', true);
|
||||
// $("#blacklist_macs option").prop('selected', true);
|
||||
// $("#whitelist_ips option").prop('selected', true);
|
||||
// });
|
||||
});
|
||||
</script>
|
||||
|
||||
+894
-888
File diff suppressed because one or more lines are too long
+8
-2
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -60,8 +61,10 @@ if (isset($rMovie)) {
|
||||
}
|
||||
|
||||
$_TITLE = 'Movie';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'): ?> style="display: none;" <?php endif; ?>>
|
||||
<div class="container-fluid">
|
||||
@@ -644,7 +647,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -26,8 +27,10 @@ foreach ($rServers as $rServer) {
|
||||
$rServerTree[] = array('id' => $rServer['id'], 'parent' => 'offline', 'text' => $rServer['server_name'], 'icon' => 'mdi mdi-server-network', 'state' => array('opened' => true));
|
||||
}
|
||||
$_TITLE = 'Mass Edit Movies';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout-xl" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
@@ -315,7 +318,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -22,8 +23,10 @@ foreach ($db->get_rows() as $rRow) {
|
||||
}
|
||||
|
||||
$_TITLE = 'Movies';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo 'style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
@@ -166,7 +169,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
+253
-247
@@ -1,247 +1,253 @@
|
||||
<?php include 'session.php'; ?>
|
||||
<?php include 'functions.php'; ?>
|
||||
|
||||
<?php if (!checkPermissions()) {
|
||||
goHome();
|
||||
} ?>
|
||||
|
||||
<?php $_TITLE = 'System Logs'; ?>
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'): ?> style="display: none;" <?php endif; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">System Logs</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('date'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('server'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('type'); ?></th>
|
||||
<th><?php echo $language::get('error'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('ip'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function api(rID, rType, rConfirm = false) {
|
||||
if ((rType == "block") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Block",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to block this IP address?",
|
||||
confirm: function() {
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else {
|
||||
rConfirm = true;
|
||||
}
|
||||
if (rConfirm) {
|
||||
$.getJSON("./api?action=mysql_syslog&sub=" + rType + "&ip=" + rID, function(data) {
|
||||
if (data.result === true) {
|
||||
if (rType == "block") {
|
||||
$.toast("IP has been blocked.");
|
||||
}
|
||||
$("#datatable").DataTable().ajax.reload(null, false);
|
||||
} else {
|
||||
$.toast("<?php echo $language::get('error_occured'); ?>");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#datatable").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
responsive: false,
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "./table",
|
||||
"data": function(d) {
|
||||
d.id = "mysql_syslog";
|
||||
}
|
||||
},
|
||||
columnDefs: [{
|
||||
"className": "dt-center",
|
||||
"targets": [0, 1, 2, 4, 5]
|
||||
}],
|
||||
order: [
|
||||
[0, "desc"]
|
||||
]
|
||||
});
|
||||
$("#datatable").css("width", "100%");
|
||||
$("#btn-export-csv").click(function() {
|
||||
$.toast("Generating CSV report...");
|
||||
window.location.href = "api?action=report¶ms=" + encodeURIComponent(JSON.stringify($("#datatable").DataTable().ajax.params()));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php'; ?>
|
||||
<?php include 'functions.php'; ?>
|
||||
|
||||
<?php if (!checkPermissions()) {
|
||||
goHome();
|
||||
} ?>
|
||||
|
||||
<?php $_TITLE = 'System Logs'; ?>
|
||||
<?php require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php'; ?>
|
||||
<?php renderUnifiedLayoutHeader('admin'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'): ?> style="display: none;" <?php endif; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">System Logs</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('date'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('server'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('type'); ?></th>
|
||||
<th><?php echo $language::get('error'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('ip'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function api(rID, rType, rConfirm = false) {
|
||||
if ((rType == "block") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Block",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to block this IP address?",
|
||||
confirm: function() {
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else {
|
||||
rConfirm = true;
|
||||
}
|
||||
if (rConfirm) {
|
||||
$.getJSON("./api?action=mysql_syslog&sub=" + rType + "&ip=" + rID, function(data) {
|
||||
if (data.result === true) {
|
||||
if (rType == "block") {
|
||||
$.toast("IP has been blocked.");
|
||||
}
|
||||
$("#datatable").DataTable().ajax.reload(null, false);
|
||||
} else {
|
||||
$.toast("<?php echo $language::get('error_occured'); ?>");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#datatable").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
responsive: false,
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "./table",
|
||||
"data": function(d) {
|
||||
d.id = "mysql_syslog";
|
||||
}
|
||||
},
|
||||
columnDefs: [{
|
||||
"className": "dt-center",
|
||||
"targets": [0, 1, 2, 4, 5]
|
||||
}],
|
||||
order: [
|
||||
[0, "desc"]
|
||||
]
|
||||
});
|
||||
$("#datatable").css("width", "100%");
|
||||
$("#btn-export-csv").click(function() {
|
||||
$.toast("Generating CSV report...");
|
||||
window.location.href = "api?action=report¶ms=" + encodeURIComponent(JSON.stringify($("#datatable").DataTable().ajax.params()));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+13
-5
@@ -1,16 +1,21 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php'; ?>
|
||||
<?php include 'functions.php'; ?>
|
||||
<?php $_TITLE = 'On-Demand Scanner'; ?>
|
||||
<?php include 'header.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'): ?> style="display: none;" <?php endif; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<div class="page-title-right">
|
||||
<?php include __DIR__ . '/topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">On-Demand Scanner</h4>
|
||||
</div>
|
||||
</div>
|
||||
@@ -86,7 +91,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
+671
-665
File diff suppressed because one or more lines are too long
+241
-235
@@ -1,235 +1,241 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Packages';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('packages'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<?php echo $language::get('package_success'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th><?php echo $language::get('package_name'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('trial'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('official'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getPackages() as $rPackage): ?>
|
||||
<?php if (!$rPackage['is_addon']): ?>
|
||||
<tr id="package-<?php echo $rPackage['id']; ?>">
|
||||
<td class="text-center"><?php echo $rPackage['id']; ?></td>
|
||||
<td><?php echo $rPackage['package_name']; ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($rPackage['is_trial']): ?>
|
||||
<i class='text-success mdi mdi-circle'></i>
|
||||
<?php else: ?>
|
||||
<i class='text-secondary mdi mdi-circle'></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if ($rPackage['is_official']): ?>
|
||||
<i class='text-success mdi mdi-circle'></i>
|
||||
<?php else: ?>
|
||||
<i class='text-secondary mdi mdi-circle'></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if (hasPermissions('adv', 'edit_package')): ?>
|
||||
<div class="btn-group">
|
||||
<a href="./package?id=<?php echo $rPackage['id']; ?>"><button type="button" data-toggle="tooltip" data-placement="top" title="<?php echo $language::get('edit_package'); ?>" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-pencil-outline"></i></button></a>
|
||||
<button type="button" data-toggle="tooltip" data-placement="top" title="<?php echo $language::get('delete_package'); ?>" class="btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rPackage['id']; ?>, 'delete');"><i class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
--
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('package_delete_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=package&sub=" + rType + "&package_id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {' . "\r\n" . ' $("#datatable").DataTable().rows(rRow).remove().draw(false);' . "\r\n" . ' }' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('package_deleted');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n" . ' bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n" . ' order: [[ 1, "asc" ]],' . "\r\n" . ' columnDefs: [' . "\r\n\t\t\t\t\t" . '{"visible": false, "targets": [0]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t\t" . 'responsive: false' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Packages';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('packages'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<?php echo $language::get('package_success'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th><?php echo $language::get('package_name'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('trial'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('official'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getPackages() as $rPackage): ?>
|
||||
<?php if (!$rPackage['is_addon']): ?>
|
||||
<tr id="package-<?php echo $rPackage['id']; ?>">
|
||||
<td class="text-center"><?php echo $rPackage['id']; ?></td>
|
||||
<td><?php echo $rPackage['package_name']; ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($rPackage['is_trial']): ?>
|
||||
<i class='text-success mdi mdi-circle'></i>
|
||||
<?php else: ?>
|
||||
<i class='text-secondary mdi mdi-circle'></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if ($rPackage['is_official']): ?>
|
||||
<i class='text-success mdi mdi-circle'></i>
|
||||
<?php else: ?>
|
||||
<i class='text-secondary mdi mdi-circle'></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if (hasPermissions('adv', 'edit_package')): ?>
|
||||
<div class="btn-group">
|
||||
<a href="./package?id=<?php echo $rPackage['id']; ?>"><button type="button" data-toggle="tooltip" data-placement="top" title="<?php echo $language::get('edit_package'); ?>" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-pencil-outline"></i></button></a>
|
||||
<button type="button" data-toggle="tooltip" data-placement="top" title="<?php echo $language::get('delete_package'); ?>" class="btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rPackage['id']; ?>, 'delete');"><i class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
--
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('package_delete_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=package&sub=" + rType + "&package_id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {' . "\r\n" . ' $("#datatable").DataTable().rows(rRow).remove().draw(false);' . "\r\n" . ' }' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('package_deleted');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n" . ' bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n" . ' order: [[ 1, "asc" ]],' . "\r\n" . ' columnDefs: [' . "\r\n\t\t\t\t\t" . '{"visible": false, "targets": [0]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t\t" . 'responsive: false' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -8,8 +9,10 @@ if (!checkPermissions()) {
|
||||
}
|
||||
|
||||
$_TITLE = 'Panel Errors';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
@@ -46,7 +49,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
@@ -276,6 +282,8 @@ include 'header.php';
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
<?php endif; ?>
|
||||
+23
-16
@@ -1,16 +1,23 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Plex Sync';
|
||||
$rPlexServers = getPlexServers();
|
||||
|
||||
include 'header.php';
|
||||
include dirname(__DIR__) . '/modules/plex/views/index.php';
|
||||
include 'footer.php';
|
||||
include dirname(__DIR__) . '/modules/plex/views/library_scripts.php';
|
||||
<?php
|
||||
|
||||
if (!isset($__viewMode)):
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Plex Sync';
|
||||
$rPlexServers = getPlexServers();
|
||||
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
|
||||
endif; // !$__viewMode
|
||||
include dirname(__DIR__) . '/modules/plex/views/index.php';
|
||||
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
include dirname(__DIR__) . '/modules/plex/views/library_scripts.php';
|
||||
|
||||
+10
-3
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (!isset($__viewMode)):
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
@@ -15,7 +17,12 @@ if (!isset(CoreUtilities::$rRequest['id']) || ($rFolder = getWatchFolder(CoreUti
|
||||
$rBouquets = getBouquets();
|
||||
$_TITLE = 'Add Library';
|
||||
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
|
||||
endif; // !$__viewMode
|
||||
include dirname(__DIR__) . '/modules/plex/views/library_edit.php';
|
||||
include 'footer.php';
|
||||
include dirname(__DIR__) . '/modules/plex/views/library_edit_scripts.php';
|
||||
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
include dirname(__DIR__) . '/modules/plex/views/library_edit_scripts.php';
|
||||
|
||||
+484
-478
@@ -1,479 +1,485 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (!isset(CoreUtilities::$rRequest['server']) || !isset($rServers[CoreUtilities::$rRequest['server']])) {
|
||||
CoreUtilities::$rRequest['server'] = SERVER_ID;
|
||||
}
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['clear'])) {
|
||||
freeTemp(CoreUtilities::$rRequest['server']);
|
||||
header('Location: ./process_monitor?server=' . CoreUtilities::$rRequest['server']);
|
||||
exit();
|
||||
}
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['clear_s'])) {
|
||||
freeStreams(CoreUtilities::$rRequest['server']);
|
||||
header('Location: ./process_monitor?server=' . CoreUtilities::$rRequest['server']);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
$rStreams = getStreamPIDs(CoreUtilities::$rRequest['server']) ?: array();
|
||||
$rFS = getFreeSpace(CoreUtilities::$rRequest['server']) ?: array();
|
||||
$rProcesses = getPIDs(CoreUtilities::$rRequest['server']) ?: array();
|
||||
$rStatus = array('D' => 'Uninterruptible Sleep', 'I' => 'Idle', 'R' => 'Running', 'S' => 'Interruptible Sleep', 'T' => 'Stopped', 'W' => 'Paging', 'X' => 'Dead', 'Z' => 'Zombie');
|
||||
$_TITLE = 'Process Monitor';
|
||||
include 'header.php'; ?>
|
||||
<div class="wrapper" <?= empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest' ? '' : ' style="display: none;"' ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li>
|
||||
<a href="process_monitor?server=<?= intval(CoreUtilities::$rRequest['server']) ?>" style="margin-right:10px;">
|
||||
<button type="button" class="btn btn-dark waves-effect waves-light btn-sm">
|
||||
<i class="mdi mdi-refresh"></i> <?= $language::get('refresh') ?>
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title"><?= $language::get('process_monitor') ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (!$rMobile) { ?>
|
||||
<?php if (count($rFS) > 0) { ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table class="table table-borderless mb-0">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th><?= $language::get('mount_point') ?></th>
|
||||
<th class="text-center"><?= $language::get('size') ?></th>
|
||||
<th class="text-center"><?= $language::get('used') ?></th>
|
||||
<th class="text-center"><?= $language::get('available') ?></th>
|
||||
<th class="text-center"><?= $language::get('used') ?> %</th>
|
||||
<th class="text-center"><?= $language::get('actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($rFS as $fs) {
|
||||
if ($fs['percentage'] >= 80) {
|
||||
$_STATUS = STATUS_SPACE_ISSUE;
|
||||
} ?>
|
||||
<tr>
|
||||
<td><?= $fs['mount'] ?></td>
|
||||
<td class="text-center"><?= $fs['size'] ?></td>
|
||||
<td class="text-center"><?= $fs['used'] ?></td>
|
||||
<td class="text-center"><?= $fs['avail'] ?></td>
|
||||
<td class="text-center">
|
||||
<?php if (intval(rtrim($fs['percentage'], '%')) >= 80) {
|
||||
echo "<span class='text-danger'>" . $fs['percentage'] . '</span>';
|
||||
} else {
|
||||
echo $fs['percentage'];
|
||||
} ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<?php if (substr($fs['mount'], -3) == 'tmp') { ?>
|
||||
<a href="./process_monitor?server=<?= intval(CoreUtilities::$rRequest['server']) ?>&clear">
|
||||
<button data-toggle="tooltip" data-placement="top" title="<?= $language::get('clear_temp') ?>" type="button" class="btn btn-light waves-effect waves-light btn-xs">
|
||||
<i class="mdi mdi-close"></i>
|
||||
</button>
|
||||
</a>
|
||||
<?php } elseif (substr($fs['mount'], -7) == 'streams') { ?>
|
||||
<a href="./process_monitor?server=<?= intval(CoreUtilities::$rRequest['server']) ?>&clear_s">
|
||||
<button data-toggle="tooltip" data-placement="top" title="<?= $language::get('clear_streams') ?>" type="button" class="btn btn-light waves-effect waves-light btn-xs">
|
||||
<i class="mdi mdi-close"></i>
|
||||
</button>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SPACE_ISSUE) { ?>
|
||||
<div class="alert alert-danger text-center" role="alert">
|
||||
<strong>You are running out of space on one or more of your mount points. You should resolve this before issues occur.</strong>
|
||||
</div>
|
||||
<?php }
|
||||
$ramdiskUsage = getStreamsRamdisk(CoreUtilities::$rRequest['server']);
|
||||
$db->query('SELECT `stream_id`, `stream_display_name`, `bitrate` FROM `streams_servers` LEFT JOIN `streams` ON `streams`.`id` = `streams_servers`.`stream_id` WHERE `server_id` = ? AND `pid` > 0;', CoreUtilities::$rRequest['server']);
|
||||
$rStreamNames = $db->get_rows(true, 'stream_id');
|
||||
$streamUsage = array();
|
||||
foreach ($ramdiskUsage as $rStreamID => $rUsage) {
|
||||
if (isset($rStreamNames[$rStreamID])) {
|
||||
$streamUsage[$rStreamID] = $rUsage;
|
||||
}
|
||||
}
|
||||
asort($streamUsage);
|
||||
$streamUsage = array_reverse($streamUsage, true);
|
||||
$halfCount = ceil(count($streamUsage) / 2);
|
||||
if ($halfCount > 10) {
|
||||
$halfCount = 10;
|
||||
}
|
||||
$topUsage = array_slice($streamUsage, 0, $halfCount, true);
|
||||
$bottomUsage = array_slice($streamUsage, $halfCount, $halfCount, true);
|
||||
if ($halfCount > 0) { ?>
|
||||
<div class="row" style="overflow-x:auto;">
|
||||
<div class="col-md-6">
|
||||
<div class="card-box">
|
||||
<table class="table table-borderless mb-0">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th class="text-center">Stream ID</th>
|
||||
<th>Stream Name</th>
|
||||
<th class="text-center">Bitrate</th>
|
||||
<th class="text-center">Mount Usage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($topUsage as $rStreamID => $rUsage) { ?>
|
||||
<tr>
|
||||
<td class="text-center"><a class="text-dark" href="stream_view?id=<?= $rStreamID ?>"><?= $rStreamID ?></a></td>
|
||||
<td><a class="text-dark" href="stream_view?id=<?= $rStreamID ?>"><?= $rStreamNames[$rStreamID]['stream_display_name'] ?></a></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed-min"><?= number_format($rStreamNames[$rStreamID]['bitrate'], 0) ?> Kbps</button></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed-min"><?= number_format($rUsage / 1024 / 1024, 0) ?> MB</button></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card-box">
|
||||
<table class="table table-borderless mb-0">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th class="text-center">Stream ID</th>
|
||||
<th>Stream Name</th>
|
||||
<th class="text-center">Bitrate</th>
|
||||
<th class="text-center">Mount Usage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($bottomUsage as $rStreamID => $rUsage) { ?>
|
||||
<tr>
|
||||
<td class="text-center"><a class="text-dark" href="stream_view?id=<?= $rStreamID ?>"><?= $rStreamID ?></a></td>
|
||||
<td><a class="text-dark" href="stream_view?id=<?= $rStreamID ?>"><?= $rStreamNames[$rStreamID]['stream_display_name'] ?></a></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed-min"><?= number_format($rStreamNames[$rStreamID]['bitrate'], 0) ?> Kbps</button></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed-min"><?= number_format($rUsage / 1024 / 1024, 0) ?> MB</button></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<!-- Tabela de processos - sempre exibida -->
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<form id="line_activity_search">
|
||||
<div class="form-group row mb-4">
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" id="live_search" value="" placeholder="<?= $language::get('search_processes') ?>...">
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center" for="live_filter"><?= $language::get('server') ?></label>
|
||||
<div class="col-md-3">
|
||||
<select id="live_filter" class="form-control" data-toggle="select2">
|
||||
<?php foreach ($rServers as $rServer) { ?>
|
||||
<option value="<?= $rServer['id'] ?>" <?= CoreUtilities::$rRequest['server'] == $rServer['id'] ? ' selected' : '' ?>><?= $rServer['server_name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center" for="live_show_entries"><?= $language::get('show') ?></label>
|
||||
<div class="col-md-1">
|
||||
<select id="live_show_entries" class="form-control" data-toggle="select2">
|
||||
<?php foreach (array(10, 25, 50, 250, 500, 1000) as $rShow) { ?>
|
||||
<option value="<?= $rShow ?>" <?= $rSettings['default_entries'] == $rShow ? ' selected' : '' ?>><?= $rShow ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php if (empty($rProcesses)): ?>
|
||||
<div class="alert alert-warning text-center">
|
||||
<i class="mdi mdi-alert-circle-outline"></i> Unable to retrieve process list. The server API may be temporarily unavailable. Please try refreshing the page.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<table id="datatable-activity" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $language::get('pid') ?></th>
|
||||
<th><?= $language::get('type') ?></th>
|
||||
<th style="max-width: 100px !important;"><?= $language::get('process') ?></th>
|
||||
<th><?= $language::get('cpu_%') ?></th>
|
||||
<th><?= $language::get('mem_mb') ?></th>
|
||||
<th>Runtime</th>
|
||||
<th>CPU Time</th>
|
||||
<th><?= $language::get('actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($rProcesses as $rProcess) {
|
||||
// Calculate Uptime
|
||||
$uptime = (int) $rProcess['etime'];
|
||||
|
||||
$days = intdiv($uptime, 86400);
|
||||
$hours = intdiv($uptime, 3600) % 24;
|
||||
$minutes = intdiv($uptime, 60) % 60;
|
||||
$seconds = $uptime % 60;
|
||||
|
||||
$uptime = $uptime >= 86400 ? sprintf('%02dd %02dh %02dm', $days, $hours, $minutes) : sprintf('%02dh %02dm %02ds', $hours, $minutes, $seconds);
|
||||
|
||||
// Calculate CPU Time
|
||||
$cpuTime = (int) $rProcess['time'];
|
||||
|
||||
$days = intdiv($cpuTime, 86400);
|
||||
$hours = intdiv($cpuTime, 3600) % 24;
|
||||
$minutes = intdiv($cpuTime, 60) % 60;
|
||||
$seconds = $cpuTime % 60;
|
||||
|
||||
$cpuTime = $cpuTime >= 86400 ? sprintf('%02dd %02dh %02dm', $days, $hours, $minutes) : sprintf('%02dh %02dm %02ds', $hours, $minutes, $seconds);
|
||||
|
||||
$A134afcd6d59abf6 = array('proxy' => 'Live Proxy', 'llod' => 'LLOD', 'loopback' => 'Loopback', 'queue' => 'VOD Queue', 'ondemand' => 'On-Demand Instant Off', 'plex_item' => 'Plex Item Scan', 'watch_item' => 'Watch Item Scan', 'cache_handler' => 'Cache Handler', 'certbot' => 'Certbot SSL Automation', 'closed_cons' => 'Closed Connection Handler', 'signals' => 'Signal Handler', 'watchdog' => 'Server Watchdog');
|
||||
$rCrons = array('plex' => 'Plex Sync', 'cache_engine' => 'Cache Generator', 'activity' => 'Activity Cron', 'backups' => 'Backup Cron', 'cache' => 'Cache Cron', 'epg' => 'EPG Cron', 'lines_logs' => 'Line Logging Cron', 'root_signals' => 'Root Signal Cron', 'series' => 'Series Cron', 'servers' => 'Servers Cron', 'stats' => 'Stats Cron', 'streams' => 'Streams Cron', 'streams_logs' => 'Stream Logging Cron', 'tmdb' => 'TMDb Refresh Cron', 'tmp' => 'Temp Cron', 'users' => 'Users Cron', 'vod' => 'VOD Cron', 'watch' => 'Watch Folder Cron');
|
||||
|
||||
if (isset($A134afcd6d59abf6[basename(explode(' ', trim(explode('#', $rProcess['command'])[0]))[0], '.php')])) {
|
||||
$rProcess['command'] = $A134afcd6d59abf6[basename(explode(' ', trim(explode('#', $rProcess['command'])[0]))[0], '.php')];
|
||||
$rType = 'XC_VM CLI';
|
||||
} else {
|
||||
if (isset($A134afcd6d59abf6[basename(trim(explode('#', $rProcess['command'])[0]), '.php')])) {
|
||||
$rProcess['command'] = $A134afcd6d59abf6[basename(trim(explode('#', $rProcess['command'])[0]), '.php')];
|
||||
$rType = 'XC_VM CLI';
|
||||
} else {
|
||||
if (isset($rCrons[basename(explode(' ', trim(explode('#', $rProcess['command'])[0]))[0], '.php')])) {
|
||||
$rProcess['command'] = $rCrons[basename(explode(' ', trim(explode('#', $rProcess['command'])[0]))[0], '.php')];
|
||||
$rType = 'XC_VM Cron';
|
||||
} else {
|
||||
if (stripos($rProcess['command'], 'nginx: master process') !== false) {
|
||||
$rProcess['command'] = 'NGINX Master Process';
|
||||
$rType = 'NGINX Master';
|
||||
} else {
|
||||
if (stripos($rProcess['command'], 'nginx: worker process') !== false) {
|
||||
$rProcess['command'] = 'NGINX Worker Process';
|
||||
$rType = 'NGINX Pool';
|
||||
} else {
|
||||
if (stripos($rProcess['command'], 'php-fpm: master process') !== false) {
|
||||
$rProcess['command'] = 'PHP Master Process';
|
||||
$rType = 'PHP Master';
|
||||
} else {
|
||||
if (stripos($rProcess['command'], 'redis-server') !== false) {
|
||||
$rProcess['command'] = 'Redis Server';
|
||||
$rType = 'Redis';
|
||||
} else {
|
||||
$rProcess['command'] = 'Command: ' . $rProcess['command'];
|
||||
$rType = array('pid' => $language::get('main') . ' - ', 'vframes' => $language::get('thumbnail') . ' - ', 'monitor_pid' => $language::get('monitor') . ' - ', 'delay_pid' => $language::get('delayed') . ' - ', 'activity' => $language::get('line_activity') . ' - ', 'timeshift' => $language::get('timeshift') . ' - ', null => '')[$rStreams[$rProcess['pid']]['pid_type'] ?? null] . array(1 => $language::get('stream'), 2 => $language::get('movie'), 3 => $language::get('created_channel'), 4 => $language::get('radio'), 5 => $language::get('episode'), null => $language::get('system'))[$rStreams[$rProcess['pid']]['type'] ?? null];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?= $rProcess['pid'] ?></td>
|
||||
<td><?= $rType ?></td>
|
||||
<td style="max-width: 700px !important; overflow: hidden;"><?= $rProcess['command'] ?></td>
|
||||
<td><button type="button" class="btn btn-light btn-xs waves-effect waves-light"><?= number_format($rProcess['cpu'], 2) ?>%</button><br /><small>avg: <?= number_format($rProcess['load_average'], 2) ?>%</small></td>
|
||||
<td><button type="button" class="btn btn-light btn-xs waves-effect waves-light"><?= number_format($rProcess['rss'] / 1024, 0) ?></button></td>
|
||||
<td><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed"><?= $uptime ?></button></td>
|
||||
<td><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed"><?= $cpuTime ?></button></td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<?php if (isset($rStreams[$rProcess['pid']])) { ?>
|
||||
<a href="<?= array(1 => 'stream_view', 2 => 'stream_view', 3 => 'stream_view', 4 => 'stream_view', 5 => 'stream_view')[$rStreams[$rProcess['pid']]['type']] . '?id=' . $rStreams[$rProcess['pid']]['id'] ?>">
|
||||
<button data-toggle="tooltip" data-placement="top" title="<?= $language::get('view') ?>" type="button" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-eye"></i></button>
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<button disabled type="button" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-eye"></i></button>
|
||||
<?php } ?>
|
||||
<button data-toggle="tooltip" data-placement="top" title="<?= $language::get('kill_process_info') ?>" type="button" class="btn btn-light waves-effect waves-light btn-xs" onClick="kill(<?= intval(CoreUtilities::$rRequest['server']) ?>, <?= $rProcess['pid'] ?>);"><i class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function kill(rServerID, rID) {' . "\r\n\t\t\t" . '$.getJSON("./api?action=process&pid=" + rID + "&server=" + rServerID, function(data) {' . "\r\n\t\t\t\t" . 'if (data.result === true) {' . "\r\n\t\t\t\t\t" . '$.toast("';
|
||||
echo $language::get('process_has_been_killed_wait');
|
||||
echo '");' . "\r\n\t\t\t\t" . '} else {' . "\r\n\t\t\t\t\t" . '$.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n\t\t" . '}' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . "\$('select').select2({width: '100%'});" . "\r\n\t\t\t" . 'if ($("#datatable-activity").length) {' . "\r\n\t\t\t\t" . '$("#datatable-activity").DataTable({' . "\r\n\t\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t\t" . '},' . "\r\n\t\t\t\t\t\t" . 'infoFiltered: ""' . "\r\n\t\t\t\t\t" . '},' . "\r\n\t\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t\t" . '},' . "\r\n\t\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t\t" . '{"className": "dt-center", "targets": [0,3,4,5,6]}' . "\r\n\t\t\t\t\t" . '],' . "\r\n\t\t\t\t\t";
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['mem'])) {
|
||||
echo 'order: [[ 4, "desc" ]],' . "\r\n\t\t\t\t\t";
|
||||
} else {
|
||||
echo 'order: [[ 3, "desc" ]],' . "\r\n\t\t\t\t\t";
|
||||
}
|
||||
|
||||
echo 'pageLength: ';
|
||||
echo (intval($rSettings['default_entries']) ?: 10);
|
||||
echo ',' . "\r\n\t\t\t\t\t" . 'lengthMenu: [10, 25, 50, 250, 500, 1000]' . "\r\n\t\t\t\t" . '});' . "\r\n\t\t\t\t" . '$("#datatable-activity").css("width", "100%");' . "\r\n\t\t\t\t" . "\$('#live_search').keyup(function(){" . "\r\n\t\t\t\t\t" . "\$('#datatable-activity').DataTable().search(\$(this).val()).draw();" . "\r\n\t\t\t\t" . '});' . "\r\n\t\t\t\t" . "\$('#live_show_entries').change(function(){" . "\r\n\t\t\t\t\t" . "\$('#datatable-activity').DataTable().page.len(\$(this).val()).draw();" . "\r\n\t\t\t\t" . '});' . "\r\n\t\t\t\t" . "\$('#live_filter').change(function(){" . "\r\n\t\t\t\t\t" . 'navigate("./process_monitor?server=" + $(this).val());' . "\r\n\t\t\t\t" . '});' . "\r\n\t\t\t\t" . "\$('#datatable-activity').DataTable().search(\$('#live_search').val()).draw();" . "\r\n\t\t\t" . '}' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (!isset(CoreUtilities::$rRequest['server']) || !isset($rServers[CoreUtilities::$rRequest['server']])) {
|
||||
CoreUtilities::$rRequest['server'] = SERVER_ID;
|
||||
}
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['clear'])) {
|
||||
freeTemp(CoreUtilities::$rRequest['server']);
|
||||
header('Location: ./process_monitor?server=' . CoreUtilities::$rRequest['server']);
|
||||
exit();
|
||||
}
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['clear_s'])) {
|
||||
freeStreams(CoreUtilities::$rRequest['server']);
|
||||
header('Location: ./process_monitor?server=' . CoreUtilities::$rRequest['server']);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
$rStreams = getStreamPIDs(CoreUtilities::$rRequest['server']) ?: array();
|
||||
$rFS = getFreeSpace(CoreUtilities::$rRequest['server']) ?: array();
|
||||
$rProcesses = getPIDs(CoreUtilities::$rRequest['server']) ?: array();
|
||||
$rStatus = array('D' => 'Uninterruptible Sleep', 'I' => 'Idle', 'R' => 'Running', 'S' => 'Interruptible Sleep', 'T' => 'Stopped', 'W' => 'Paging', 'X' => 'Dead', 'Z' => 'Zombie');
|
||||
$_TITLE = 'Process Monitor';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin'); ?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper" <?= empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest' ? '' : ' style="display: none;"' ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li>
|
||||
<a href="process_monitor?server=<?= intval(CoreUtilities::$rRequest['server']) ?>" style="margin-right:10px;">
|
||||
<button type="button" class="btn btn-dark waves-effect waves-light btn-sm">
|
||||
<i class="mdi mdi-refresh"></i> <?= $language::get('refresh') ?>
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title"><?= $language::get('process_monitor') ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (!$rMobile) { ?>
|
||||
<?php if (count($rFS) > 0) { ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table class="table table-borderless mb-0">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th><?= $language::get('mount_point') ?></th>
|
||||
<th class="text-center"><?= $language::get('size') ?></th>
|
||||
<th class="text-center"><?= $language::get('used') ?></th>
|
||||
<th class="text-center"><?= $language::get('available') ?></th>
|
||||
<th class="text-center"><?= $language::get('used') ?> %</th>
|
||||
<th class="text-center"><?= $language::get('actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($rFS as $fs) {
|
||||
if ($fs['percentage'] >= 80) {
|
||||
$_STATUS = STATUS_SPACE_ISSUE;
|
||||
} ?>
|
||||
<tr>
|
||||
<td><?= $fs['mount'] ?></td>
|
||||
<td class="text-center"><?= $fs['size'] ?></td>
|
||||
<td class="text-center"><?= $fs['used'] ?></td>
|
||||
<td class="text-center"><?= $fs['avail'] ?></td>
|
||||
<td class="text-center">
|
||||
<?php if (intval(rtrim($fs['percentage'], '%')) >= 80) {
|
||||
echo "<span class='text-danger'>" . $fs['percentage'] . '</span>';
|
||||
} else {
|
||||
echo $fs['percentage'];
|
||||
} ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<?php if (substr($fs['mount'], -3) == 'tmp') { ?>
|
||||
<a href="./process_monitor?server=<?= intval(CoreUtilities::$rRequest['server']) ?>&clear">
|
||||
<button data-toggle="tooltip" data-placement="top" title="<?= $language::get('clear_temp') ?>" type="button" class="btn btn-light waves-effect waves-light btn-xs">
|
||||
<i class="mdi mdi-close"></i>
|
||||
</button>
|
||||
</a>
|
||||
<?php } elseif (substr($fs['mount'], -7) == 'streams') { ?>
|
||||
<a href="./process_monitor?server=<?= intval(CoreUtilities::$rRequest['server']) ?>&clear_s">
|
||||
<button data-toggle="tooltip" data-placement="top" title="<?= $language::get('clear_streams') ?>" type="button" class="btn btn-light waves-effect waves-light btn-xs">
|
||||
<i class="mdi mdi-close"></i>
|
||||
</button>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SPACE_ISSUE) { ?>
|
||||
<div class="alert alert-danger text-center" role="alert">
|
||||
<strong>You are running out of space on one or more of your mount points. You should resolve this before issues occur.</strong>
|
||||
</div>
|
||||
<?php }
|
||||
$ramdiskUsage = getStreamsRamdisk(CoreUtilities::$rRequest['server']);
|
||||
$db->query('SELECT `stream_id`, `stream_display_name`, `bitrate` FROM `streams_servers` LEFT JOIN `streams` ON `streams`.`id` = `streams_servers`.`stream_id` WHERE `server_id` = ? AND `pid` > 0;', CoreUtilities::$rRequest['server']);
|
||||
$rStreamNames = $db->get_rows(true, 'stream_id');
|
||||
$streamUsage = array();
|
||||
foreach ($ramdiskUsage as $rStreamID => $rUsage) {
|
||||
if (isset($rStreamNames[$rStreamID])) {
|
||||
$streamUsage[$rStreamID] = $rUsage;
|
||||
}
|
||||
}
|
||||
asort($streamUsage);
|
||||
$streamUsage = array_reverse($streamUsage, true);
|
||||
$halfCount = ceil(count($streamUsage) / 2);
|
||||
if ($halfCount > 10) {
|
||||
$halfCount = 10;
|
||||
}
|
||||
$topUsage = array_slice($streamUsage, 0, $halfCount, true);
|
||||
$bottomUsage = array_slice($streamUsage, $halfCount, $halfCount, true);
|
||||
if ($halfCount > 0) { ?>
|
||||
<div class="row" style="overflow-x:auto;">
|
||||
<div class="col-md-6">
|
||||
<div class="card-box">
|
||||
<table class="table table-borderless mb-0">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th class="text-center">Stream ID</th>
|
||||
<th>Stream Name</th>
|
||||
<th class="text-center">Bitrate</th>
|
||||
<th class="text-center">Mount Usage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($topUsage as $rStreamID => $rUsage) { ?>
|
||||
<tr>
|
||||
<td class="text-center"><a class="text-dark" href="stream_view?id=<?= $rStreamID ?>"><?= $rStreamID ?></a></td>
|
||||
<td><a class="text-dark" href="stream_view?id=<?= $rStreamID ?>"><?= $rStreamNames[$rStreamID]['stream_display_name'] ?></a></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed-min"><?= number_format($rStreamNames[$rStreamID]['bitrate'], 0) ?> Kbps</button></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed-min"><?= number_format($rUsage / 1024 / 1024, 0) ?> MB</button></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card-box">
|
||||
<table class="table table-borderless mb-0">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th class="text-center">Stream ID</th>
|
||||
<th>Stream Name</th>
|
||||
<th class="text-center">Bitrate</th>
|
||||
<th class="text-center">Mount Usage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($bottomUsage as $rStreamID => $rUsage) { ?>
|
||||
<tr>
|
||||
<td class="text-center"><a class="text-dark" href="stream_view?id=<?= $rStreamID ?>"><?= $rStreamID ?></a></td>
|
||||
<td><a class="text-dark" href="stream_view?id=<?= $rStreamID ?>"><?= $rStreamNames[$rStreamID]['stream_display_name'] ?></a></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed-min"><?= number_format($rStreamNames[$rStreamID]['bitrate'], 0) ?> Kbps</button></td>
|
||||
<td class="text-center"><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed-min"><?= number_format($rUsage / 1024 / 1024, 0) ?> MB</button></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<!-- Tabela de processos - sempre exibida -->
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<form id="line_activity_search">
|
||||
<div class="form-group row mb-4">
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" id="live_search" value="" placeholder="<?= $language::get('search_processes') ?>...">
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center" for="live_filter"><?= $language::get('server') ?></label>
|
||||
<div class="col-md-3">
|
||||
<select id="live_filter" class="form-control" data-toggle="select2">
|
||||
<?php foreach ($rServers as $rServer) { ?>
|
||||
<option value="<?= $rServer['id'] ?>" <?= CoreUtilities::$rRequest['server'] == $rServer['id'] ? ' selected' : '' ?>><?= $rServer['server_name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center" for="live_show_entries"><?= $language::get('show') ?></label>
|
||||
<div class="col-md-1">
|
||||
<select id="live_show_entries" class="form-control" data-toggle="select2">
|
||||
<?php foreach (array(10, 25, 50, 250, 500, 1000) as $rShow) { ?>
|
||||
<option value="<?= $rShow ?>" <?= $rSettings['default_entries'] == $rShow ? ' selected' : '' ?>><?= $rShow ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php if (empty($rProcesses)): ?>
|
||||
<div class="alert alert-warning text-center">
|
||||
<i class="mdi mdi-alert-circle-outline"></i> Unable to retrieve process list. The server API may be temporarily unavailable. Please try refreshing the page.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<table id="datatable-activity" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $language::get('pid') ?></th>
|
||||
<th><?= $language::get('type') ?></th>
|
||||
<th style="max-width: 100px !important;"><?= $language::get('process') ?></th>
|
||||
<th><?= $language::get('cpu_%') ?></th>
|
||||
<th><?= $language::get('mem_mb') ?></th>
|
||||
<th>Runtime</th>
|
||||
<th>CPU Time</th>
|
||||
<th><?= $language::get('actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($rProcesses as $rProcess) {
|
||||
// Calculate Uptime
|
||||
$uptime = (int) $rProcess['etime'];
|
||||
|
||||
$days = intdiv($uptime, 86400);
|
||||
$hours = intdiv($uptime, 3600) % 24;
|
||||
$minutes = intdiv($uptime, 60) % 60;
|
||||
$seconds = $uptime % 60;
|
||||
|
||||
$uptime = $uptime >= 86400 ? sprintf('%02dd %02dh %02dm', $days, $hours, $minutes) : sprintf('%02dh %02dm %02ds', $hours, $minutes, $seconds);
|
||||
|
||||
// Calculate CPU Time
|
||||
$cpuTime = (int) $rProcess['time'];
|
||||
|
||||
$days = intdiv($cpuTime, 86400);
|
||||
$hours = intdiv($cpuTime, 3600) % 24;
|
||||
$minutes = intdiv($cpuTime, 60) % 60;
|
||||
$seconds = $cpuTime % 60;
|
||||
|
||||
$cpuTime = $cpuTime >= 86400 ? sprintf('%02dd %02dh %02dm', $days, $hours, $minutes) : sprintf('%02dh %02dm %02ds', $hours, $minutes, $seconds);
|
||||
|
||||
$A134afcd6d59abf6 = array('proxy' => 'Live Proxy', 'llod' => 'LLOD', 'loopback' => 'Loopback', 'queue' => 'VOD Queue', 'ondemand' => 'On-Demand Instant Off', 'plex_item' => 'Plex Item Scan', 'watch_item' => 'Watch Item Scan', 'cache_handler' => 'Cache Handler', 'certbot' => 'Certbot SSL Automation', 'closed_cons' => 'Closed Connection Handler', 'signals' => 'Signal Handler', 'watchdog' => 'Server Watchdog');
|
||||
$rCrons = array('plex' => 'Plex Sync', 'cache_engine' => 'Cache Generator', 'activity' => 'Activity Cron', 'backups' => 'Backup Cron', 'cache' => 'Cache Cron', 'epg' => 'EPG Cron', 'lines_logs' => 'Line Logging Cron', 'root_signals' => 'Root Signal Cron', 'series' => 'Series Cron', 'servers' => 'Servers Cron', 'stats' => 'Stats Cron', 'streams' => 'Streams Cron', 'streams_logs' => 'Stream Logging Cron', 'tmdb' => 'TMDb Refresh Cron', 'tmp' => 'Temp Cron', 'users' => 'Users Cron', 'vod' => 'VOD Cron', 'watch' => 'Watch Folder Cron');
|
||||
|
||||
if (isset($A134afcd6d59abf6[basename(explode(' ', trim(explode('#', $rProcess['command'])[0]))[0], '.php')])) {
|
||||
$rProcess['command'] = $A134afcd6d59abf6[basename(explode(' ', trim(explode('#', $rProcess['command'])[0]))[0], '.php')];
|
||||
$rType = 'XC_VM CLI';
|
||||
} else {
|
||||
if (isset($A134afcd6d59abf6[basename(trim(explode('#', $rProcess['command'])[0]), '.php')])) {
|
||||
$rProcess['command'] = $A134afcd6d59abf6[basename(trim(explode('#', $rProcess['command'])[0]), '.php')];
|
||||
$rType = 'XC_VM CLI';
|
||||
} else {
|
||||
if (isset($rCrons[basename(explode(' ', trim(explode('#', $rProcess['command'])[0]))[0], '.php')])) {
|
||||
$rProcess['command'] = $rCrons[basename(explode(' ', trim(explode('#', $rProcess['command'])[0]))[0], '.php')];
|
||||
$rType = 'XC_VM Cron';
|
||||
} else {
|
||||
if (stripos($rProcess['command'], 'nginx: master process') !== false) {
|
||||
$rProcess['command'] = 'NGINX Master Process';
|
||||
$rType = 'NGINX Master';
|
||||
} else {
|
||||
if (stripos($rProcess['command'], 'nginx: worker process') !== false) {
|
||||
$rProcess['command'] = 'NGINX Worker Process';
|
||||
$rType = 'NGINX Pool';
|
||||
} else {
|
||||
if (stripos($rProcess['command'], 'php-fpm: master process') !== false) {
|
||||
$rProcess['command'] = 'PHP Master Process';
|
||||
$rType = 'PHP Master';
|
||||
} else {
|
||||
if (stripos($rProcess['command'], 'redis-server') !== false) {
|
||||
$rProcess['command'] = 'Redis Server';
|
||||
$rType = 'Redis';
|
||||
} else {
|
||||
$rProcess['command'] = 'Command: ' . $rProcess['command'];
|
||||
$rType = array('pid' => $language::get('main') . ' - ', 'vframes' => $language::get('thumbnail') . ' - ', 'monitor_pid' => $language::get('monitor') . ' - ', 'delay_pid' => $language::get('delayed') . ' - ', 'activity' => $language::get('line_activity') . ' - ', 'timeshift' => $language::get('timeshift') . ' - ', null => '')[$rStreams[$rProcess['pid']]['pid_type'] ?? null] . array(1 => $language::get('stream'), 2 => $language::get('movie'), 3 => $language::get('created_channel'), 4 => $language::get('radio'), 5 => $language::get('episode'), null => $language::get('system'))[$rStreams[$rProcess['pid']]['type'] ?? null];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?= $rProcess['pid'] ?></td>
|
||||
<td><?= $rType ?></td>
|
||||
<td style="max-width: 700px !important; overflow: hidden;"><?= $rProcess['command'] ?></td>
|
||||
<td><button type="button" class="btn btn-light btn-xs waves-effect waves-light"><?= number_format($rProcess['cpu'], 2) ?>%</button><br /><small>avg: <?= number_format($rProcess['load_average'], 2) ?>%</small></td>
|
||||
<td><button type="button" class="btn btn-light btn-xs waves-effect waves-light"><?= number_format($rProcess['rss'] / 1024, 0) ?></button></td>
|
||||
<td><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed"><?= $uptime ?></button></td>
|
||||
<td><button type="button" class="btn btn-light btn-xs waves-effect waves-light btn-fixed"><?= $cpuTime ?></button></td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<?php if (isset($rStreams[$rProcess['pid']])) { ?>
|
||||
<a href="<?= array(1 => 'stream_view', 2 => 'stream_view', 3 => 'stream_view', 4 => 'stream_view', 5 => 'stream_view')[$rStreams[$rProcess['pid']]['type']] . '?id=' . $rStreams[$rProcess['pid']]['id'] ?>">
|
||||
<button data-toggle="tooltip" data-placement="top" title="<?= $language::get('view') ?>" type="button" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-eye"></i></button>
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<button disabled type="button" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-eye"></i></button>
|
||||
<?php } ?>
|
||||
<button data-toggle="tooltip" data-placement="top" title="<?= $language::get('kill_process_info') ?>" type="button" class="btn btn-light waves-effect waves-light btn-xs" onClick="kill(<?= intval(CoreUtilities::$rRequest['server']) ?>, <?= $rProcess['pid'] ?>);"><i class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function kill(rServerID, rID) {' . "\r\n\t\t\t" . '$.getJSON("./api?action=process&pid=" + rID + "&server=" + rServerID, function(data) {' . "\r\n\t\t\t\t" . 'if (data.result === true) {' . "\r\n\t\t\t\t\t" . '$.toast("';
|
||||
echo $language::get('process_has_been_killed_wait');
|
||||
echo '");' . "\r\n\t\t\t\t" . '} else {' . "\r\n\t\t\t\t\t" . '$.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n\t\t" . '}' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . "\$('select').select2({width: '100%'});" . "\r\n\t\t\t" . 'if ($("#datatable-activity").length) {' . "\r\n\t\t\t\t" . '$("#datatable-activity").DataTable({' . "\r\n\t\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t\t" . '},' . "\r\n\t\t\t\t\t\t" . 'infoFiltered: ""' . "\r\n\t\t\t\t\t" . '},' . "\r\n\t\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t\t" . '},' . "\r\n\t\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t\t" . '{"className": "dt-center", "targets": [0,3,4,5,6]}' . "\r\n\t\t\t\t\t" . '],' . "\r\n\t\t\t\t\t";
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['mem'])) {
|
||||
echo 'order: [[ 4, "desc" ]],' . "\r\n\t\t\t\t\t";
|
||||
} else {
|
||||
echo 'order: [[ 3, "desc" ]],' . "\r\n\t\t\t\t\t";
|
||||
}
|
||||
|
||||
echo 'pageLength: ';
|
||||
echo (intval($rSettings['default_entries']) ?: 10);
|
||||
echo ',' . "\r\n\t\t\t\t\t" . 'lengthMenu: [10, 25, 50, 250, 500, 1000]' . "\r\n\t\t\t\t" . '});' . "\r\n\t\t\t\t" . '$("#datatable-activity").css("width", "100%");' . "\r\n\t\t\t\t" . "\$('#live_search').keyup(function(){" . "\r\n\t\t\t\t\t" . "\$('#datatable-activity').DataTable().search(\$(this).val()).draw();" . "\r\n\t\t\t\t" . '});' . "\r\n\t\t\t\t" . "\$('#live_show_entries').change(function(){" . "\r\n\t\t\t\t\t" . "\$('#datatable-activity').DataTable().page.len(\$(this).val()).draw();" . "\r\n\t\t\t\t" . '});' . "\r\n\t\t\t\t" . "\$('#live_filter').change(function(){" . "\r\n\t\t\t\t\t" . 'navigate("./process_monitor?server=" + $(this).val());' . "\r\n\t\t\t\t" . '});' . "\r\n\t\t\t\t" . "\$('#datatable-activity').DataTable().search(\$('#live_search').val()).draw();" . "\r\n\t\t\t" . '}' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
?>
|
||||
+655
-649
File diff suppressed because it is too large
Load Diff
+255
-249
@@ -1,249 +1,255 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (checkPermissions()) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Transcoding Profiles';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('transcode_profiles'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (!(isset($_STATUS) && $_STATUS == STATUS_SUCCESS)) {
|
||||
} else { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<?php echo $language::get('profile_success'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th><?php echo $language::get('profile_name'); ?></th>
|
||||
<th class="text-center">GPU</th>
|
||||
<th class="text-center">Video</th>
|
||||
<th class="text-center">Audio</th>
|
||||
<th class="text-center">Resolution</th>
|
||||
<th class="text-center">Logo</th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getTranscodeProfiles() as $rProfile) {
|
||||
$rProfileOptions = json_decode($rProfile['profile_options'], true); ?>
|
||||
<tr id="profile-<?php echo $rProfile['profile_id']; ?>">
|
||||
<td class="text-center"><?php echo $rProfile['profile_id']; ?></td>
|
||||
<td><?php echo $rProfile['profile_name']; ?></td>
|
||||
<td class="text-center">
|
||||
<?php if (isset($rProfileOptions['gpu'])) {
|
||||
echo '<i class="text-success fas fa-square"></i>';
|
||||
} else {
|
||||
echo '<i class="text-secondary fas fa-square"></i>';
|
||||
} ?>
|
||||
</td>
|
||||
<td class="text-center"><?php echo ($rProfileOptions['-vcodec'] ?: 'None'); ?></td>
|
||||
<td class="text-center"><?php echo ($rProfileOptions['-acodec'] ?: 'None'); ?></td>
|
||||
<td class="text-center">
|
||||
<?php if (isset($rProfileOptions['gpu'])) {
|
||||
echo ($rProfileOptions['gpu']['resize'] ?: str_replace(':', 'x', $rProfileOptions[9]['val']));
|
||||
} else {
|
||||
echo str_replace(':', 'x', $rProfileOptions[9]['val']);
|
||||
} ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if (isset($rProfileOptions[16])) {
|
||||
echo '<i class="text-success fas fa-square"></i>';
|
||||
} else {
|
||||
echo '<i class="text-secondary fas fa-square"></i>';
|
||||
} ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if (hasPermissions('adv', 'edit_tprofile')) { ?>
|
||||
<div class="btn-group">
|
||||
<a href="./profile?id=<?php echo $rProfile['profile_id']; ?>"><button type="button" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-pencil-outline"></i></button></a>
|
||||
<button type="button" class="btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rProfile['profile_id']; ?>, 'delete');"><i class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
<?php } else {
|
||||
echo '--';
|
||||
} ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('profile_delete_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=profile&sub=" + rType + "&profile_id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {' . "\r\n" . ' $("#datatable").DataTable().rows(rRow).remove().draw(false);' . "\r\n" . ' }' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('profile_deleted');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n" . ' bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n" . ' order: [[ 1, "asc" ]],' . "\r\n" . ' columnDefs: [' . "\r\n\t\t\t\t\t" . '{"visible": false, "targets": [0]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t\t" . 'responsive: false' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (checkPermissions()) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Transcoding Profiles';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $language::get('transcode_profiles'); ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (!(isset($_STATUS) && $_STATUS == STATUS_SUCCESS)) {
|
||||
} else { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<?php echo $language::get('profile_success'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th><?php echo $language::get('profile_name'); ?></th>
|
||||
<th class="text-center">GPU</th>
|
||||
<th class="text-center">Video</th>
|
||||
<th class="text-center">Audio</th>
|
||||
<th class="text-center">Resolution</th>
|
||||
<th class="text-center">Logo</th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getTranscodeProfiles() as $rProfile) {
|
||||
$rProfileOptions = json_decode($rProfile['profile_options'], true); ?>
|
||||
<tr id="profile-<?php echo $rProfile['profile_id']; ?>">
|
||||
<td class="text-center"><?php echo $rProfile['profile_id']; ?></td>
|
||||
<td><?php echo $rProfile['profile_name']; ?></td>
|
||||
<td class="text-center">
|
||||
<?php if (isset($rProfileOptions['gpu'])) {
|
||||
echo '<i class="text-success fas fa-square"></i>';
|
||||
} else {
|
||||
echo '<i class="text-secondary fas fa-square"></i>';
|
||||
} ?>
|
||||
</td>
|
||||
<td class="text-center"><?php echo ($rProfileOptions['-vcodec'] ?: 'None'); ?></td>
|
||||
<td class="text-center"><?php echo ($rProfileOptions['-acodec'] ?: 'None'); ?></td>
|
||||
<td class="text-center">
|
||||
<?php if (isset($rProfileOptions['gpu'])) {
|
||||
echo ($rProfileOptions['gpu']['resize'] ?: str_replace(':', 'x', $rProfileOptions[9]['val']));
|
||||
} else {
|
||||
echo str_replace(':', 'x', $rProfileOptions[9]['val']);
|
||||
} ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if (isset($rProfileOptions[16])) {
|
||||
echo '<i class="text-success fas fa-square"></i>';
|
||||
} else {
|
||||
echo '<i class="text-secondary fas fa-square"></i>';
|
||||
} ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if (hasPermissions('adv', 'edit_tprofile')) { ?>
|
||||
<div class="btn-group">
|
||||
<a href="./profile?id=<?php echo $rProfile['profile_id']; ?>"><button type="button" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-pencil-outline"></i></button></a>
|
||||
<button type="button" class="btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rProfile['profile_id']; ?>, 'delete');"><i class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
<?php } else {
|
||||
echo '--';
|
||||
} ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "';
|
||||
echo $language::get('profile_delete_confirm');
|
||||
echo '",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=profile&sub=" + rType + "&profile_id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {' . "\r\n" . ' $("#datatable").DataTable().rows(rRow).remove().draw(false);' . "\r\n" . ' }' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('profile_deleted');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n" . ' bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n" . ' order: [[ 1, "asc" ]],' . "\r\n" . ' columnDefs: [' . "\r\n\t\t\t\t\t" . '{"visible": false, "targets": [0]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t\t" . 'responsive: false' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+398
-392
@@ -1,392 +1,398 @@
|
||||
<?php
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['id']) && !($rProvider = getStreamProvider(CoreUtilities::$rRequest['id']))) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$_TITLE = 'Stream Provider';
|
||||
include 'header.php'; ?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') : ?><?php else : ?> style="display: none;" <?php endif; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php if (isset($rProvider)) : ?><?php echo $language::get('edit'); ?><?php else : ?><?php echo $language::get('add'); ?><?php endif; ?> Provider</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST" data-parsley-validate="">
|
||||
<?php if (!isset($rProvider)) : ?><?php else : ?>
|
||||
<input type="hidden" name="edit" value="<?php echo $rProvider['id']; ?>" />
|
||||
<input class='copyfrom' tabindex='-1' aria-hidden='true' id="stream_url" value="" style="position: absolute; left: -9999px;">
|
||||
<?php endif; ?>
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#category-details" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-account-card-details-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline"><?php echo $language::get('details'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php if (!isset($rProvider)) : ?><?php else : ?>
|
||||
<li class="nav-item">
|
||||
<a href="#view-streams" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-play mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Available Streams</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#view-movies" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-movie mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Available Movies</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="category-details">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="name">Provider Name</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" id="name" name="name" value="<?php if (!isset($rProvider)) : ?><?php else : ?><?php echo htmlspecialchars($rProvider['name']); ?><?php endif; ?>" required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="ip">Server IP / Domain</label>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" id="ip" name="ip" value="<?php if (!isset($rProvider)) : ?><?php else : ?><?php echo htmlspecialchars($rProvider['ip']); ?><?php endif; ?>" required data-parsley-trigger="change">
|
||||
</div>
|
||||
<label class="col-md-3 col-form-label" for="port">Broadcast Port</label>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control text-center" id="port" name="port" value="<?php if (isset($rProvider)) : ?><?php echo htmlspecialchars($rProvider['port']); ?><?php else : ?>80<?php endif; ?>" required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="username">Username</label>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" id="username" name="username" value="<?php if (!isset($rProvider)) : ?><?php else : ?><?php echo htmlspecialchars($rProvider['username']); ?><?php endif; ?>" required data-parsley-trigger="change">
|
||||
</div>
|
||||
<label class="col-md-3 col-form-label" for="password">Password</label>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" id="password" name="password" value="<?php if (!isset($rProvider)) : ?><?php else : ?><?php echo htmlspecialchars($rProvider['password']); ?><?php endif; ?>" required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="enabled">Enabled</label>
|
||||
<div class="col-md-3">
|
||||
<input name="enabled" id="enabled" type="checkbox" <?php if (isset($rProvider)) : ?><?php if ($rProvider['enabled'] == 1) : ?>checked<?php endif; ?><?php else : ?>checked<?php endif; ?> data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
<label class="col-md-3 col-form-label" for="ssl">SSL</label>
|
||||
<div class="col-md-3">
|
||||
<input name="ssl" id="ssl" type="checkbox" <?php if (isset($rProvider) && $rProvider['ssl'] == 1) : ?>checked<?php endif; ?> data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="legacy">Legacy XC</label>
|
||||
<div class="col-md-3">
|
||||
<input name="legacy" id="legacy" type="checkbox" <?php if (isset($rProvider) && $rProvider['legacy'] == 1) : ?>checked<?php endif; ?> data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
<label class="col-md-3 col-form-label" for="hls">Use HLS</label>
|
||||
<div class="col-md-3">
|
||||
<input name="hls" id="hls" type="checkbox" <?php if (isset($rProvider) && $rProvider['hls'] == 1) : ?>checked<?php endif; ?> data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="submit_provider" type="submit" class="btn btn-primary" value="<?php if (isset($rProvider)) : ?><?php echo $language::get('edit'); ?><?php else : ?><?php echo $language::get('add'); ?><?php endif; ?>" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (isset($rProvider)) : ?>
|
||||
<!-- Available Streams Tab Pane -->
|
||||
<div class="tab-pane" id="view-streams">
|
||||
<div class="row">
|
||||
<div class="col-12" style="overflow-x:auto;">
|
||||
<table id="datatable-streams" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<th>Stream Name</th>
|
||||
<th>Categories</th>
|
||||
<th class="text-center">Modified</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $db->query('SELECT `stream_id`, `category_array`, `stream_display_name`, `modified`, `stream_icon` FROM `providers_streams` WHERE `provider_id` = ? AND `type` = \'live\' ORDER BY `modified` DESC, `stream_id` ASC;', CoreUtilities::$rRequest['id']); ?>
|
||||
<?php foreach ($db->get_rows() as $rRow) : ?>
|
||||
<?php
|
||||
$rStreamURL = (($rProvider['ssl'] ? 'https' : 'http')) . '://' . $rProvider['ip'] . ':' . $rProvider['port'] . '/live/' . $rProvider['username'] . '/' . $rProvider['password'] . '/' . $rRow['stream_id'] . (($rProvider['hls'] ? '.m3u8' : ($rProvider['legacy'] ? '.ts' : '')));
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo $rRow['stream_id']; ?></td>
|
||||
<td><?php echo $rRow['stream_display_name']; ?></td>
|
||||
<td><?php echo implode(', ', json_decode($rRow['category_array'], true)); ?></td>
|
||||
<td class="text-center"><?php echo date('Y-m-d', $rRow['modified']) . "<br/><small class='text-secondary'>" . date('H:i:s', $rRow['modified']) . '</small>'; ?></td>
|
||||
<td class="text-center">
|
||||
<a href="stream?title=<?php echo urlencode($rRow['stream_display_name']); ?>&url=<?php echo urlencode($rStreamURL); ?>&icon=<?php echo urlencode($rRow['stream_icon']); ?>"><button type="button" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-plus"></i></button></a>
|
||||
<button type="button" class="btn btn-light waves-effect waves-light btn-xs tooltip" title="Copy URL" onClick="copyURL('<?php echo $rStreamURL; ?>');"><i class="mdi mdi-clipboard"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Available Movies Tab Pane -->
|
||||
<div class="tab-pane" id="view-movies">
|
||||
<div class="row">
|
||||
<div class="col-12" style="overflow-x:auto;">
|
||||
<table id="datatable-movies" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<th>Movie Name</th>
|
||||
<th>Categories</th>
|
||||
<th class="text-center">Modified</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $db->query('SELECT `stream_id`, `category_array`, `stream_display_name`, `modified`, `stream_icon`, `channel_id` FROM `providers_streams` WHERE `provider_id` = ? AND `type` = \'movie\' ORDER BY `modified` DESC, `stream_id` ASC;', CoreUtilities::$rRequest['id']); ?>
|
||||
<?php foreach ($db->get_rows() as $rRow) : ?>
|
||||
<?php
|
||||
$rStreamURL = (($rRow['ssl'] ? 'https' : 'http')) . '://' . $rProvider['ip'] . ':' . $rProvider['port'] . '/movie/' . $rProvider['username'] . '/' . $rProvider['password'] . '/' . $rRow['stream_id'] . '.' . $rRow['channel_id'];
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo $rRow['stream_id']; ?></td>
|
||||
<td><?php echo $rRow['stream_display_name']; ?></td>
|
||||
<td><?php echo implode(', ', json_decode($rRow['category_array'], true)); ?></td>
|
||||
<td class="text-center"><?php echo date('Y-m-d', $rRow['modified']) . "<br/><small class='text-secondary'>" . date('H:i:s', $rRow['modified']) . '</small>'; ?></td>
|
||||
<td class="text-center">
|
||||
<a href="movie?title=<?php echo urlencode($rRow['stream_display_name']); ?>&path=<?php echo urlencode($rStreamURL); ?>"><button type="button" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-plus"></i></button></a>
|
||||
<button type="button" class="btn btn-light waves-effect waves-light btn-xs tooltip" title="Copy URL" onClick="copyURL('<?php echo $rStreamURL; ?>');"><i class="mdi mdi-clipboard"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function copyURL(rURL) {
|
||||
$("#stream_url").val(rURL);
|
||||
$("#stream_url").select();
|
||||
document.execCommand("copy");
|
||||
$.toast("URL has been copied to clipboard.");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#datatable-streams").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
order: [
|
||||
[3, "desc"]
|
||||
],
|
||||
responsive: false,
|
||||
bAutoWidth: false,
|
||||
bInfo: false
|
||||
});
|
||||
$("#datatable-movies").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
order: [
|
||||
[3, "desc"]
|
||||
],
|
||||
responsive: false,
|
||||
bAutoWidth: false,
|
||||
bInfo: false
|
||||
});
|
||||
$("#port").inputFilter(function(value) {
|
||||
return /^\d*$/.test(value);
|
||||
});
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['id']) && !($rProvider = getStreamProvider(CoreUtilities::$rRequest['id']))) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$_TITLE = 'Stream Provider';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin'); ?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout-ext" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') : ?><?php else : ?> style="display: none;" <?php endif; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title"><?php if (isset($rProvider)) : ?><?php echo $language::get('edit'); ?><?php else : ?><?php echo $language::get('add'); ?><?php endif; ?> Provider</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST" data-parsley-validate="">
|
||||
<?php if (!isset($rProvider)) : ?><?php else : ?>
|
||||
<input type="hidden" name="edit" value="<?php echo $rProvider['id']; ?>" />
|
||||
<input class='copyfrom' tabindex='-1' aria-hidden='true' id="stream_url" value="" style="position: absolute; left: -9999px;">
|
||||
<?php endif; ?>
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#category-details" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-account-card-details-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline"><?php echo $language::get('details'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php if (!isset($rProvider)) : ?><?php else : ?>
|
||||
<li class="nav-item">
|
||||
<a href="#view-streams" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-play mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Available Streams</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#view-movies" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-movie mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Available Movies</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="category-details">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="name">Provider Name</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" id="name" name="name" value="<?php if (!isset($rProvider)) : ?><?php else : ?><?php echo htmlspecialchars($rProvider['name']); ?><?php endif; ?>" required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="ip">Server IP / Domain</label>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" id="ip" name="ip" value="<?php if (!isset($rProvider)) : ?><?php else : ?><?php echo htmlspecialchars($rProvider['ip']); ?><?php endif; ?>" required data-parsley-trigger="change">
|
||||
</div>
|
||||
<label class="col-md-3 col-form-label" for="port">Broadcast Port</label>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control text-center" id="port" name="port" value="<?php if (isset($rProvider)) : ?><?php echo htmlspecialchars($rProvider['port']); ?><?php else : ?>80<?php endif; ?>" required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="username">Username</label>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" id="username" name="username" value="<?php if (!isset($rProvider)) : ?><?php else : ?><?php echo htmlspecialchars($rProvider['username']); ?><?php endif; ?>" required data-parsley-trigger="change">
|
||||
</div>
|
||||
<label class="col-md-3 col-form-label" for="password">Password</label>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" id="password" name="password" value="<?php if (!isset($rProvider)) : ?><?php else : ?><?php echo htmlspecialchars($rProvider['password']); ?><?php endif; ?>" required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="enabled">Enabled</label>
|
||||
<div class="col-md-3">
|
||||
<input name="enabled" id="enabled" type="checkbox" <?php if (isset($rProvider)) : ?><?php if ($rProvider['enabled'] == 1) : ?>checked<?php endif; ?><?php else : ?>checked<?php endif; ?> data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
<label class="col-md-3 col-form-label" for="ssl">SSL</label>
|
||||
<div class="col-md-3">
|
||||
<input name="ssl" id="ssl" type="checkbox" <?php if (isset($rProvider) && $rProvider['ssl'] == 1) : ?>checked<?php endif; ?> data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-3 col-form-label" for="legacy">Legacy XC</label>
|
||||
<div class="col-md-3">
|
||||
<input name="legacy" id="legacy" type="checkbox" <?php if (isset($rProvider) && $rProvider['legacy'] == 1) : ?>checked<?php endif; ?> data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
<label class="col-md-3 col-form-label" for="hls">Use HLS</label>
|
||||
<div class="col-md-3">
|
||||
<input name="hls" id="hls" type="checkbox" <?php if (isset($rProvider) && $rProvider['hls'] == 1) : ?>checked<?php endif; ?> data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="submit_provider" type="submit" class="btn btn-primary" value="<?php if (isset($rProvider)) : ?><?php echo $language::get('edit'); ?><?php else : ?><?php echo $language::get('add'); ?><?php endif; ?>" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (isset($rProvider)) : ?>
|
||||
<!-- Available Streams Tab Pane -->
|
||||
<div class="tab-pane" id="view-streams">
|
||||
<div class="row">
|
||||
<div class="col-12" style="overflow-x:auto;">
|
||||
<table id="datatable-streams" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<th>Stream Name</th>
|
||||
<th>Categories</th>
|
||||
<th class="text-center">Modified</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $db->query('SELECT `stream_id`, `category_array`, `stream_display_name`, `modified`, `stream_icon` FROM `providers_streams` WHERE `provider_id` = ? AND `type` = \'live\' ORDER BY `modified` DESC, `stream_id` ASC;', CoreUtilities::$rRequest['id']); ?>
|
||||
<?php foreach ($db->get_rows() as $rRow) : ?>
|
||||
<?php
|
||||
$rStreamURL = (($rProvider['ssl'] ? 'https' : 'http')) . '://' . $rProvider['ip'] . ':' . $rProvider['port'] . '/live/' . $rProvider['username'] . '/' . $rProvider['password'] . '/' . $rRow['stream_id'] . (($rProvider['hls'] ? '.m3u8' : ($rProvider['legacy'] ? '.ts' : '')));
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo $rRow['stream_id']; ?></td>
|
||||
<td><?php echo $rRow['stream_display_name']; ?></td>
|
||||
<td><?php echo implode(', ', json_decode($rRow['category_array'], true)); ?></td>
|
||||
<td class="text-center"><?php echo date('Y-m-d', $rRow['modified']) . "<br/><small class='text-secondary'>" . date('H:i:s', $rRow['modified']) . '</small>'; ?></td>
|
||||
<td class="text-center">
|
||||
<a href="stream?title=<?php echo urlencode($rRow['stream_display_name']); ?>&url=<?php echo urlencode($rStreamURL); ?>&icon=<?php echo urlencode($rRow['stream_icon']); ?>"><button type="button" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-plus"></i></button></a>
|
||||
<button type="button" class="btn btn-light waves-effect waves-light btn-xs tooltip" title="Copy URL" onClick="copyURL('<?php echo $rStreamURL; ?>');"><i class="mdi mdi-clipboard"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Available Movies Tab Pane -->
|
||||
<div class="tab-pane" id="view-movies">
|
||||
<div class="row">
|
||||
<div class="col-12" style="overflow-x:auto;">
|
||||
<table id="datatable-movies" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<th>Movie Name</th>
|
||||
<th>Categories</th>
|
||||
<th class="text-center">Modified</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $db->query('SELECT `stream_id`, `category_array`, `stream_display_name`, `modified`, `stream_icon`, `channel_id` FROM `providers_streams` WHERE `provider_id` = ? AND `type` = \'movie\' ORDER BY `modified` DESC, `stream_id` ASC;', CoreUtilities::$rRequest['id']); ?>
|
||||
<?php foreach ($db->get_rows() as $rRow) : ?>
|
||||
<?php
|
||||
$rStreamURL = (($rRow['ssl'] ? 'https' : 'http')) . '://' . $rProvider['ip'] . ':' . $rProvider['port'] . '/movie/' . $rProvider['username'] . '/' . $rProvider['password'] . '/' . $rRow['stream_id'] . '.' . $rRow['channel_id'];
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo $rRow['stream_id']; ?></td>
|
||||
<td><?php echo $rRow['stream_display_name']; ?></td>
|
||||
<td><?php echo implode(', ', json_decode($rRow['category_array'], true)); ?></td>
|
||||
<td class="text-center"><?php echo date('Y-m-d', $rRow['modified']) . "<br/><small class='text-secondary'>" . date('H:i:s', $rRow['modified']) . '</small>'; ?></td>
|
||||
<td class="text-center">
|
||||
<a href="movie?title=<?php echo urlencode($rRow['stream_display_name']); ?>&path=<?php echo urlencode($rStreamURL); ?>"><button type="button" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-plus"></i></button></a>
|
||||
<button type="button" class="btn btn-light waves-effect waves-light btn-xs tooltip" title="Copy URL" onClick="copyURL('<?php echo $rStreamURL; ?>');"><i class="mdi mdi-clipboard"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function copyURL(rURL) {
|
||||
$("#stream_url").val(rURL);
|
||||
$("#stream_url").select();
|
||||
document.execCommand("copy");
|
||||
$.toast("URL has been copied to clipboard.");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#datatable-streams").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
order: [
|
||||
[3, "desc"]
|
||||
],
|
||||
responsive: false,
|
||||
bAutoWidth: false,
|
||||
bInfo: false
|
||||
});
|
||||
$("#datatable-movies").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
order: [
|
||||
[3, "desc"]
|
||||
],
|
||||
responsive: false,
|
||||
bAutoWidth: false,
|
||||
bInfo: false
|
||||
});
|
||||
$("#port").inputFilter(function(value) {
|
||||
return /^\d*$/.test(value);
|
||||
});
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+306
-300
@@ -1,300 +1,306 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Stream Providers';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Stream Providers</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Provider has been added to the database and will be periodically scanned.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th class="text-center">Status</th>
|
||||
<th>Provider</th>
|
||||
<th class="text-center">Username</th>
|
||||
<th class="text-center">Connections</th>
|
||||
<th class="text-center">Streams</th>
|
||||
<th class="text-center">Movies</th>
|
||||
<th class="text-center">Series</th>
|
||||
<th class="text-center">Expires</th>
|
||||
<th class="text-center">Last Changed</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getStreamProviders() as $rProvider):
|
||||
$rData = json_decode($rProvider['data'], true);
|
||||
$rStatus = !$rProvider['enabled'] ? '<i class="text-secondary fas fa-square"></i>' : ($rProvider['enabled'] && $rProvider['status'] ? '<i class="text-success fas fa-square"></i>' : '<i class="text-danger fas fa-square"></i>');
|
||||
?>
|
||||
<tr id="provider-<?php echo $rProvider['id']; ?>">
|
||||
<td class="text-center"><?php echo $rProvider['id']; ?></td>
|
||||
<td class="text-center"><?php echo $rStatus; ?></td>
|
||||
<td><?php echo $rProvider['name']; ?><br /><small><?php echo $rProvider['ip']; ?>:<?php echo $rProvider['port']; ?></small></td>
|
||||
<td class="text-center"><?php echo $rProvider['username']; ?></td>
|
||||
<td class="text-center">
|
||||
<?php
|
||||
if ($rData['max_connections'] > 0) {
|
||||
$rColour = $rData['max_connections'] * 0.75 < $rData['active_connections'] ? 'danger' : ($rData['max_connections'] * 0.5 < $rData['active_connections'] ? 'warning' : 'success');
|
||||
echo '<a href="streams?search=' . urlencode(strtolower($rProvider['ip'])) . '&filter=1"><button type="button" class="btn btn-' . $rColour . ' btn-xs waves-effect waves-light">' . number_format($rData['active_connections'], 0) . ' / ' . number_format($rData['max_connections'], 0) . '</button></a>';
|
||||
} else {
|
||||
echo '<a href="streams?search=' . urlencode(strtolower($rProvider['ip'])) . '&filter=1"><button type="button" class="btn btn-success btn-xs waves-effect waves-light">' . number_format($rData['active_connections'], 0) . ' / ∞</button></a>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-<?php echo $rData['streams'] > 0 ? 'info' : 'secondary'; ?> btn-xs waves-effect waves-light"><?php echo number_format($rData['streams'], 0); ?></button>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-<?php echo $rData['movies'] > 0 ? 'info' : 'secondary'; ?> btn-xs waves-effect waves-light"><?php echo number_format($rData['movies'], 0); ?></button>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-<?php echo $rData['series'] > 0 ? 'info' : 'secondary'; ?> btn-xs waves-effect waves-light"><?php echo number_format($rData['series'], 0); ?></button>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php echo $rData['exp_date'] == -1 ? 'Unknown' : ($rData['exp_date'] ? date('Y-m-d', $rData['exp_date']) . "<br/><small class='text-secondary'>" . date('H:i:s', $rData['exp_date']) . '</small>' : 'Never'); ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php echo $rProvider['last_changed'] ? date('Y-m-d', $rProvider['last_changed']) . "<br/><small class='text-secondary'>" . date('H:i:s', $rProvider['last_changed']) . '</small>' : 'Never'; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<a href="provider?id=<?php echo $rProvider['id']; ?>"><button type="button" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-pencil"></i></button></a>
|
||||
<button type="button" title="Force Reload" class="tooltip btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rProvider['id']; ?>, 'reload');"><i class="mdi mdi-refresh"></i></button>
|
||||
<button type="button" class="btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rProvider['id']; ?>, 'delete');"><i class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
function api(rID, rType, rConfirm = false) {
|
||||
if ((rType == "delete") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Delete",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to delete this provider?<br/>This won't affect your streams.",
|
||||
confirm: function() {
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else {
|
||||
rConfirm = true;
|
||||
}
|
||||
if (rConfirm) {
|
||||
$.getJSON("./api?action=provider&sub=" + rType + "&id=" + rID, function(data) {
|
||||
if (data.result === true) {
|
||||
if (rType == "delete") {
|
||||
if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {
|
||||
$("#datatable").DataTable().rows(rRow).remove().draw(false);
|
||||
}
|
||||
$.toast("Provider has been deleted.");
|
||||
} else if (rType == "reload") {
|
||||
$.toast("Updating provider in background...");
|
||||
}
|
||||
} else {
|
||||
$.toast("An error occured while processing your request.");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#datatable").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
order: [
|
||||
[9, "desc"]
|
||||
],
|
||||
columnDefs: [{
|
||||
"visible": false,
|
||||
"targets": [0]
|
||||
}],
|
||||
responsive: false
|
||||
});
|
||||
$("#datatable").css("width", "100%");
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Stream Providers';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Stream Providers</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Provider has been added to the database and will be periodically scanned.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th class="text-center">Status</th>
|
||||
<th>Provider</th>
|
||||
<th class="text-center">Username</th>
|
||||
<th class="text-center">Connections</th>
|
||||
<th class="text-center">Streams</th>
|
||||
<th class="text-center">Movies</th>
|
||||
<th class="text-center">Series</th>
|
||||
<th class="text-center">Expires</th>
|
||||
<th class="text-center">Last Changed</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getStreamProviders() as $rProvider):
|
||||
$rData = json_decode($rProvider['data'], true);
|
||||
$rStatus = !$rProvider['enabled'] ? '<i class="text-secondary fas fa-square"></i>' : ($rProvider['enabled'] && $rProvider['status'] ? '<i class="text-success fas fa-square"></i>' : '<i class="text-danger fas fa-square"></i>');
|
||||
?>
|
||||
<tr id="provider-<?php echo $rProvider['id']; ?>">
|
||||
<td class="text-center"><?php echo $rProvider['id']; ?></td>
|
||||
<td class="text-center"><?php echo $rStatus; ?></td>
|
||||
<td><?php echo $rProvider['name']; ?><br /><small><?php echo $rProvider['ip']; ?>:<?php echo $rProvider['port']; ?></small></td>
|
||||
<td class="text-center"><?php echo $rProvider['username']; ?></td>
|
||||
<td class="text-center">
|
||||
<?php
|
||||
if ($rData['max_connections'] > 0) {
|
||||
$rColour = $rData['max_connections'] * 0.75 < $rData['active_connections'] ? 'danger' : ($rData['max_connections'] * 0.5 < $rData['active_connections'] ? 'warning' : 'success');
|
||||
echo '<a href="streams?search=' . urlencode(strtolower($rProvider['ip'])) . '&filter=1"><button type="button" class="btn btn-' . $rColour . ' btn-xs waves-effect waves-light">' . number_format($rData['active_connections'], 0) . ' / ' . number_format($rData['max_connections'], 0) . '</button></a>';
|
||||
} else {
|
||||
echo '<a href="streams?search=' . urlencode(strtolower($rProvider['ip'])) . '&filter=1"><button type="button" class="btn btn-success btn-xs waves-effect waves-light">' . number_format($rData['active_connections'], 0) . ' / ∞</button></a>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-<?php echo $rData['streams'] > 0 ? 'info' : 'secondary'; ?> btn-xs waves-effect waves-light"><?php echo number_format($rData['streams'], 0); ?></button>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-<?php echo $rData['movies'] > 0 ? 'info' : 'secondary'; ?> btn-xs waves-effect waves-light"><?php echo number_format($rData['movies'], 0); ?></button>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-<?php echo $rData['series'] > 0 ? 'info' : 'secondary'; ?> btn-xs waves-effect waves-light"><?php echo number_format($rData['series'], 0); ?></button>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php echo $rData['exp_date'] == -1 ? 'Unknown' : ($rData['exp_date'] ? date('Y-m-d', $rData['exp_date']) . "<br/><small class='text-secondary'>" . date('H:i:s', $rData['exp_date']) . '</small>' : 'Never'); ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php echo $rProvider['last_changed'] ? date('Y-m-d', $rProvider['last_changed']) . "<br/><small class='text-secondary'>" . date('H:i:s', $rProvider['last_changed']) . '</small>' : 'Never'; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<a href="provider?id=<?php echo $rProvider['id']; ?>"><button type="button" class="btn btn-light waves-effect waves-light btn-xs"><i class="mdi mdi-pencil"></i></button></a>
|
||||
<button type="button" title="Force Reload" class="tooltip btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rProvider['id']; ?>, 'reload');"><i class="mdi mdi-refresh"></i></button>
|
||||
<button type="button" class="btn btn-light waves-effect waves-light btn-xs" onClick="api(<?php echo $rProvider['id']; ?>, 'delete');"><i class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
function api(rID, rType, rConfirm = false) {
|
||||
if ((rType == "delete") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Delete",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to delete this provider?<br/>This won't affect your streams.",
|
||||
confirm: function() {
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else {
|
||||
rConfirm = true;
|
||||
}
|
||||
if (rConfirm) {
|
||||
$.getJSON("./api?action=provider&sub=" + rType + "&id=" + rID, function(data) {
|
||||
if (data.result === true) {
|
||||
if (rType == "delete") {
|
||||
if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {
|
||||
$("#datatable").DataTable().rows(rRow).remove().draw(false);
|
||||
}
|
||||
$.toast("Provider has been deleted.");
|
||||
} else if (rType == "reload") {
|
||||
$.toast("Updating provider in background...");
|
||||
}
|
||||
} else {
|
||||
$.toast("An error occured while processing your request.");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#datatable").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
order: [
|
||||
[9, "desc"]
|
||||
],
|
||||
columnDefs: [{
|
||||
"visible": false,
|
||||
"targets": [0]
|
||||
}],
|
||||
responsive: false
|
||||
});
|
||||
$("#datatable").css("width", "100%");
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -9,7 +10,9 @@ if (!checkPermissions()) {
|
||||
|
||||
CoreUtilities::$rServers = CoreUtilities::getServers(true);
|
||||
$_TITLE = 'Proxy Servers';
|
||||
include 'header.php'; ?>
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo 'style="display: none;"' ?>>
|
||||
@@ -61,11 +64,7 @@ include 'header.php'; ?>
|
||||
<td class="text-center"><?= $rServer['id']; ?></td>
|
||||
<td class="text-center">
|
||||
|
||||
<?
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if (!$rServer['enabled']) {
|
||||
echo '<i class="text-secondary fas fa-square tooltip" title="Disabled"></i>';
|
||||
} else {
|
||||
@@ -245,7 +244,10 @@ include 'header.php'; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
+8
-2
File diff suppressed because one or more lines are too long
+196
-190
@@ -1,190 +1,196 @@
|
||||
<?php include 'session.php'; ?>
|
||||
<?php include 'functions.php'; ?>
|
||||
|
||||
<?php if (!checkPermissions()) {
|
||||
goHome();
|
||||
} ?>
|
||||
|
||||
<?php $_TITLE = 'Encoding Queue'; ?>
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Encoding Queue</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Position</th>
|
||||
<th>Stream</th>
|
||||
<th>Server</th>
|
||||
<th class="text-center">Status</th>
|
||||
<th class="text-center">Added</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n" . ' function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to delete this item from the queue?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else if ((rType == "stop") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Stop & Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to stop encoding this item?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=queue&sub=" + rType + "&id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' $.toast("Item has been deleted from the encoding queue.");' . "\r\n" . ' } else if (rType == "stop") {' . "\r\n" . ' $.toast("Item encoding has been stopped and removed from the encoding queue.");' . "\r\n" . ' }' . "\r\n" . ' $("#datatable").DataTable().ajax.reload(null, false);' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'serverSide: true,' . "\r\n\t\t\t\t" . 'ajax: {' . "\r\n\t\t\t\t\t" . 'url: "./table",' . "\r\n\t\t\t\t\t" . '"data": function(d) {' . "\r\n\t\t\t\t\t\t" . 'd.id = "queue";' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [0,3,4,5]}' . "\r\n\t\t\t\t" . '],' . "\r\n" . ' order: [[ 0, "asc" ]]' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n" . ' $("#btn-export-csv").click(function() {' . "\r\n" . ' $.toast("Generating CSV report...");' . "\r\n" . ' window.location.href = "api?action=report¶ms=" + encodeURIComponent(JSON.stringify($("#datatable").DataTable().ajax.params()));' . "\r\n\t\t\t" . '});' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php'; ?>
|
||||
<?php include 'functions.php'; ?>
|
||||
|
||||
<?php if (!checkPermissions()) {
|
||||
goHome();
|
||||
} ?>
|
||||
|
||||
<?php $_TITLE = 'Encoding Queue'; ?>
|
||||
<?php require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Encoding Queue</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Position</th>
|
||||
<th>Stream</th>
|
||||
<th>Server</th>
|
||||
<th class="text-center">Status</th>
|
||||
<th class="text-center">Added</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n" . ' function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "delete") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to delete this item from the queue?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else if ((rType == "stop") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Stop & Delete",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to stop encoding this item?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=queue&sub=" + rType + "&id=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "delete") {' . "\r\n" . ' $.toast("Item has been deleted from the encoding queue.");' . "\r\n" . ' } else if (rType == "stop") {' . "\r\n" . ' $.toast("Item encoding has been stopped and removed from the encoding queue.");' . "\r\n" . ' }' . "\r\n" . ' $("#datatable").DataTable().ajax.reload(null, false);' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'serverSide: true,' . "\r\n\t\t\t\t" . 'ajax: {' . "\r\n\t\t\t\t\t" . 'url: "./table",' . "\r\n\t\t\t\t\t" . '"data": function(d) {' . "\r\n\t\t\t\t\t\t" . 'd.id = "queue";' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [0,3,4,5]}' . "\r\n\t\t\t\t" . '],' . "\r\n" . ' order: [[ 0, "asc" ]]' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n" . ' $("#btn-export-csv").click(function() {' . "\r\n" . ' $.toast("Generating CSV report...");' . "\r\n" . ' window.location.href = "api?action=report¶ms=" + encodeURIComponent(JSON.stringify($("#datatable").DataTable().ajax.params()));' . "\r\n\t\t\t" . '});' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+695
-689
File diff suppressed because it is too large
Load Diff
+533
-527
File diff suppressed because it is too large
Load Diff
+529
-523
File diff suppressed because one or more lines are too long
+308
-302
File diff suppressed because one or more lines are too long
+69
-65
@@ -1,65 +1,69 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$rAvailableServers = $rServers = array();
|
||||
$rStream = $rProgramme = null;
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['id'])) {
|
||||
$rStream = getStream(CoreUtilities::$rRequest['id']);
|
||||
$rProgramme = CoreUtilities::getProgramme(CoreUtilities::$rRequest['id'], CoreUtilities::$rRequest['programme']);
|
||||
|
||||
if ($rStream && $rStream['type'] == 1 && $rProgramme) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
} else {
|
||||
if (isset(CoreUtilities::$rRequest['archive'])) {
|
||||
$rArchive = json_decode(base64_decode(CoreUtilities::$rRequest['archive']), true);
|
||||
$rStream = getStream($rArchive['stream_id']);
|
||||
$rProgramme = array('start' => $rArchive['start'], 'end' => $rArchive['end'], 'title' => $rArchive['title'], 'description' => $rArchive['description'], 'archive' => true);
|
||||
|
||||
if ($rStream && $rStream['type'] == 1 && $rProgramme) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
} else {
|
||||
if (!isset(CoreUtilities::$rRequest['stream_id'])) {
|
||||
} else {
|
||||
$rStream = getStream(CoreUtilities::$rRequest['stream_id']);
|
||||
$rProgramme = array('start' => strtotime(CoreUtilities::$rRequest['start_date']), 'end' => strtotime(CoreUtilities::$rRequest['start_date']) + intval(CoreUtilities::$rRequest['duration']) * 60, 'title' => '', 'description' => '');
|
||||
|
||||
if (!(!$rStream || $rStream['type'] != 1 || !$rProgramme || $rProgramme['end'] < time())) {
|
||||
} else {
|
||||
header('Location: record');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$rStream) {
|
||||
} else {
|
||||
$rBitrate = null;
|
||||
$db->query('SELECT `server_id`, `bitrate` FROM `streams_servers` WHERE `stream_id` = ?;', $rStream['id']);
|
||||
|
||||
foreach ($db->get_rows() as $rRow) {
|
||||
$rAvailableServers[] = $rRow['server_id'];
|
||||
|
||||
if (!(!$rBitrate && $rRow['bitrate'] || $rRow['bitrate'] && $rBitrate < $rRow['bitrate'])) {
|
||||
} else {
|
||||
$rBitrate = $rRow['bitrate'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$_TITLE = 'Record';
|
||||
|
||||
include 'header.php';
|
||||
include dirname(__DIR__) . '/modules/watch/views/record.php';
|
||||
include 'footer.php';
|
||||
include dirname(__DIR__) . '/modules/watch/views/record_scripts.php';
|
||||
<?php
|
||||
|
||||
if (!isset($__viewMode)):
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$rAvailableServers = $rServers = array();
|
||||
$rStream = $rProgramme = null;
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['id'])) {
|
||||
$rStream = getStream(CoreUtilities::$rRequest['id']);
|
||||
$rProgramme = CoreUtilities::getProgramme(CoreUtilities::$rRequest['id'], CoreUtilities::$rRequest['programme']);
|
||||
|
||||
if ($rStream && $rStream['type'] == 1 && $rProgramme) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
} else {
|
||||
if (isset(CoreUtilities::$rRequest['archive'])) {
|
||||
$rArchive = json_decode(base64_decode(CoreUtilities::$rRequest['archive']), true);
|
||||
$rStream = getStream($rArchive['stream_id']);
|
||||
$rProgramme = array('start' => $rArchive['start'], 'end' => $rArchive['end'], 'title' => $rArchive['title'], 'description' => $rArchive['description'], 'archive' => true);
|
||||
|
||||
if ($rStream && $rStream['type'] == 1 && $rProgramme) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
} else {
|
||||
if (!isset(CoreUtilities::$rRequest['stream_id'])) {
|
||||
} else {
|
||||
$rStream = getStream(CoreUtilities::$rRequest['stream_id']);
|
||||
$rProgramme = array('start' => strtotime(CoreUtilities::$rRequest['start_date']), 'end' => strtotime(CoreUtilities::$rRequest['start_date']) + intval(CoreUtilities::$rRequest['duration']) * 60, 'title' => '', 'description' => '');
|
||||
|
||||
if (!(!$rStream || $rStream['type'] != 1 || !$rProgramme || $rProgramme['end'] < time())) {
|
||||
} else {
|
||||
header('Location: record');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$rStream) {
|
||||
} else {
|
||||
$rBitrate = null;
|
||||
$db->query('SELECT `server_id`, `bitrate` FROM `streams_servers` WHERE `stream_id` = ?;', $rStream['id']);
|
||||
|
||||
foreach ($db->get_rows() as $rRow) {
|
||||
$rAvailableServers[] = $rRow['server_id'];
|
||||
|
||||
if (!(!$rBitrate && $rRow['bitrate'] || $rRow['bitrate'] && $rBitrate < $rRow['bitrate'])) {
|
||||
} else {
|
||||
$rBitrate = $rRow['bitrate'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$_TITLE = 'Record';
|
||||
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
endif; // !$__viewMode
|
||||
include dirname(__DIR__) . '/modules/watch/views/record.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
include dirname(__DIR__) . '/modules/watch/views/record_scripts.php';
|
||||
|
||||
+208
-201
@@ -1,201 +1,208 @@
|
||||
<?php include 'session.php'; ?>
|
||||
<?php include 'functions.php'; ?>
|
||||
|
||||
<?php if (!checkPermissions()) {
|
||||
goHome();
|
||||
} ?>
|
||||
|
||||
<?php $_TITLE = 'Restream Detection Logs'; ?>
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
<div class="wrapper boxed-layout-ext"
|
||||
<?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<h4 class="page-title">Restream Detection Logs</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="alert alert-info" role="alert">
|
||||
<?php
|
||||
if (CoreUtilities::$rSettings['detect_restream_block_user'] && CoreUtilities::$rSettings['detect_restream_block_ip']) {
|
||||
echo 'Your service is set up to automatically block the lines and IP addresses of those detected restreaming without permission.';
|
||||
} elseif (!CoreUtilities::$rSettings['detect_restream_block_user'] && CoreUtilities::$rSettings['detect_restream_block_ip']) {
|
||||
echo 'Your service is set up to automatically block the IP addresses of those detected restreaming without permission. Lines will remain active.';
|
||||
} elseif (CoreUtilities::$rSettings['detect_restream_block_user'] && !CoreUtilities::$rSettings['detect_restream_block_ip']) {
|
||||
echo "Your service is set up to automatically block the lines of those detected restreaming without permission. IP's will not be automatically blocked.";
|
||||
} else {
|
||||
echo "Your service is set up to detect restreaming without permission, however it won't automatically block IP addresses or lines.";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th><?php echo $language::get('username'); ?></th>
|
||||
<th><?php echo $language::get('stream'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('ip'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('date'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n" . ' function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "block") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Block",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to block this IP address?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=mysql_syslog&sub=" + rType + "&ip=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "block") {' . "\r\n" . ' $.toast("IP has been blocked.");' . "\r\n" . ' }' . "\r\n" . ' $("#datatable").DataTable().ajax.reload(null, false);' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'serverSide: true,' . "\r\n\t\t\t\t" . 'ajax: {' . "\r\n\t\t\t\t\t" . 'url: "./table",' . "\r\n\t\t\t\t\t" . '"data": function(d) {' . "\r\n\t\t\t\t\t\t" . 'd.id = "restream_logs";' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [3,4,5]},' . "\r\n" . ' {"visible": false, "targets": [0]}' . "\r\n\t\t\t\t" . '],' . "\r\n" . ' order: [[ 4, "desc" ]]' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php'; ?>
|
||||
<?php include 'functions.php'; ?>
|
||||
|
||||
<?php if (!checkPermissions()) {
|
||||
goHome();
|
||||
} ?>
|
||||
|
||||
<?php $_TITLE = 'Restream Detection Logs'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper boxed-layout-ext"
|
||||
<?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<h4 class="page-title">Restream Detection Logs</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="alert alert-info" role="alert">
|
||||
<?php
|
||||
if (CoreUtilities::$rSettings['detect_restream_block_user'] && CoreUtilities::$rSettings['detect_restream_block_ip']) {
|
||||
echo 'Your service is set up to automatically block the lines and IP addresses of those detected restreaming without permission.';
|
||||
} elseif (!CoreUtilities::$rSettings['detect_restream_block_user'] && CoreUtilities::$rSettings['detect_restream_block_ip']) {
|
||||
echo 'Your service is set up to automatically block the IP addresses of those detected restreaming without permission. Lines will remain active.';
|
||||
} elseif (CoreUtilities::$rSettings['detect_restream_block_user'] && !CoreUtilities::$rSettings['detect_restream_block_ip']) {
|
||||
echo "Your service is set up to automatically block the lines of those detected restreaming without permission. IP's will not be automatically blocked.";
|
||||
} else {
|
||||
echo "Your service is set up to detect restreaming without permission, however it won't automatically block IP addresses or lines.";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $language::get('id'); ?></th>
|
||||
<th><?php echo $language::get('username'); ?></th>
|
||||
<th><?php echo $language::get('stream'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('ip'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('date'); ?></th>
|
||||
<th class="text-center"><?php echo $language::get('actions'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n" . ' function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "block") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Block",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to block this IP address?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=mysql_syslog&sub=" + rType + "&ip=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "block") {' . "\r\n" . ' $.toast("IP has been blocked.");' . "\r\n" . ' }' . "\r\n" . ' $("#datatable").DataTable().ajax.reload(null, false);' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'serverSide: true,' . "\r\n\t\t\t\t" . 'ajax: {' . "\r\n\t\t\t\t\t" . 'url: "./table",' . "\r\n\t\t\t\t\t" . '"data": function(d) {' . "\r\n\t\t\t\t\t\t" . 'd.id = "restream_logs";' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [3,4,5]},' . "\r\n" . ' {"visible": false, "targets": [0]}' . "\r\n\t\t\t\t" . '],' . "\r\n" . ' order: [[ 4, "desc" ]]' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php include 'session.php';
|
||||
include 'functions.php'; ?>
|
||||
|
||||
@@ -167,8 +168,10 @@ if (isset($rImport) && $rImport) {
|
||||
|
||||
$rLogoSet = $rCategorySet = array();
|
||||
$_TITLE = 'Review';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper<?php if (!isset($rImport)) {
|
||||
echo ' boxed-layout-ext';
|
||||
@@ -705,7 +708,10 @@ include 'header.php';
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
@@ -11,7 +12,9 @@ if (isset(CoreUtilities::$rRequest['id']) && !($rIPArr = getRTMPIP(CoreUtilities
|
||||
}
|
||||
|
||||
$_TITLE = 'RTMP IP';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
<?php endif; ?>
|
||||
?>
|
||||
|
||||
<div class="wrapper boxed-layout"
|
||||
@@ -121,7 +124,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
@@ -265,4 +271,4 @@ include 'header.php';
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
+287
-281
@@ -1,281 +1,287 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = "RTMP IP's";
|
||||
include 'header.php';
|
||||
?>
|
||||
|
||||
<div class="wrapper boxed-layout-ext"
|
||||
<?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">RTMP IP Addresses</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<?php echo $language::get('rtmp_success'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<th class="text-center">IP Address</th>
|
||||
<th class="text-center">Password</th>
|
||||
<th class="text-center">Push</th>
|
||||
<th class="text-center">Pull</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getRTMPIPs() as $rIP): ?>
|
||||
<tr id="ip-<?php echo $rIP['id']; ?>">
|
||||
<td class="text-center"><?php echo $rIP['id']; ?></td>
|
||||
<td class="text-center"><?php echo $rIP['ip']; ?></td>
|
||||
<td class="text-center"><?php echo $rIP['password']; ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($rIP['push']): ?>
|
||||
<i class="text-success fas fa-square"></i>
|
||||
<?php else: ?>
|
||||
<i class="text-secondary fas fa-square"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if ($rIP['pull']): ?>
|
||||
<i class="text-success fas fa-square"></i>
|
||||
<?php else: ?>
|
||||
<i class="text-secondary fas fa-square"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<?php if (hasPermissions('adv', 'add_rtmp')): ?>
|
||||
<a href="./rtmp_ip?id=<?php echo $rIP['id']; ?>"><button type="button"
|
||||
class="btn btn-light waves-effect waves-light btn-xs"><i
|
||||
class="mdi mdi-pencil-outline"></i></button></a>
|
||||
<?php endif; ?>
|
||||
<button type="button" class="btn btn-light waves-effect waves-light btn-xs"
|
||||
onClick="api(<?php echo $rIP['id']; ?>, 'delete');"><i
|
||||
class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function api(rID, rType, rConfirm = false) {
|
||||
if ((rType == "delete") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Delete",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to delete this IP?",
|
||||
confirm: function() {
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else {
|
||||
rConfirm = true;
|
||||
}
|
||||
if (rConfirm) {
|
||||
$.getJSON("./api?action=rtmp_ip&sub=" + rType + "&ip=" + rID, function(data) {
|
||||
if (data.result === true) {
|
||||
if (rType == "delete") {
|
||||
if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {
|
||||
$("#datatable").DataTable().rows(rRow).remove().draw(false);
|
||||
}
|
||||
$.toast("IP successfully deleted.");
|
||||
}
|
||||
} else {
|
||||
$.toast("An error occured while processing your request.");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#datatable").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
order: [
|
||||
[1, "asc"]
|
||||
],
|
||||
columnDefs: [{
|
||||
"visible": false,
|
||||
"targets": [0]
|
||||
}],
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
responsive: false
|
||||
});
|
||||
$("#datatable").css("width", "100%");
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = "RTMP IP's";
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper boxed-layout-ext"
|
||||
<?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">RTMP IP Addresses</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<?php echo $language::get('rtmp_success'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<th class="text-center">IP Address</th>
|
||||
<th class="text-center">Password</th>
|
||||
<th class="text-center">Push</th>
|
||||
<th class="text-center">Pull</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (getRTMPIPs() as $rIP): ?>
|
||||
<tr id="ip-<?php echo $rIP['id']; ?>">
|
||||
<td class="text-center"><?php echo $rIP['id']; ?></td>
|
||||
<td class="text-center"><?php echo $rIP['ip']; ?></td>
|
||||
<td class="text-center"><?php echo $rIP['password']; ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($rIP['push']): ?>
|
||||
<i class="text-success fas fa-square"></i>
|
||||
<?php else: ?>
|
||||
<i class="text-secondary fas fa-square"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if ($rIP['pull']): ?>
|
||||
<i class="text-success fas fa-square"></i>
|
||||
<?php else: ?>
|
||||
<i class="text-secondary fas fa-square"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<?php if (hasPermissions('adv', 'add_rtmp')): ?>
|
||||
<a href="./rtmp_ip?id=<?php echo $rIP['id']; ?>"><button type="button"
|
||||
class="btn btn-light waves-effect waves-light btn-xs"><i
|
||||
class="mdi mdi-pencil-outline"></i></button></a>
|
||||
<?php endif; ?>
|
||||
<button type="button" class="btn btn-light waves-effect waves-light btn-xs"
|
||||
onClick="api(<?php echo $rIP['id']; ?>, 'delete');"><i
|
||||
class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function api(rID, rType, rConfirm = false) {
|
||||
if ((rType == "delete") && (!rConfirm)) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Delete",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to delete this IP?",
|
||||
confirm: function() {
|
||||
api(rID, rType, true);
|
||||
}
|
||||
}).open();
|
||||
} else {
|
||||
rConfirm = true;
|
||||
}
|
||||
if (rConfirm) {
|
||||
$.getJSON("./api?action=rtmp_ip&sub=" + rType + "&ip=" + rID, function(data) {
|
||||
if (data.result === true) {
|
||||
if (rType == "delete") {
|
||||
if (rRow = findRowByID($("#datatable").DataTable(), 0, rID)) {
|
||||
$("#datatable").DataTable().rows(rRow).remove().draw(false);
|
||||
}
|
||||
$.toast("IP successfully deleted.");
|
||||
}
|
||||
} else {
|
||||
$.toast("An error occured while processing your request.");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#datatable").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
order: [
|
||||
[1, "asc"]
|
||||
],
|
||||
columnDefs: [{
|
||||
"visible": false,
|
||||
"targets": [0]
|
||||
}],
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
responsive: false
|
||||
});
|
||||
$("#datatable").css("width", "100%");
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+346
-340
@@ -1,340 +1,346 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (!isset(CoreUtilities::$rRequest['server']) || !isset($rServers[CoreUtilities::$rRequest['server']])) {
|
||||
CoreUtilities::$rRequest['server'] = SERVER_ID;
|
||||
}
|
||||
|
||||
$rRTMPInfo = getRTMPStats(CoreUtilities::$rRequest['server']);
|
||||
$_TITLE = 'RTMP Monitor';
|
||||
include 'header.php';
|
||||
?>
|
||||
|
||||
<div class="wrapper"
|
||||
<?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li>
|
||||
<a href="javascript:void(0);" onClick="navigate('rtmp_monitor');"
|
||||
style="margin-right:10px;">
|
||||
<button type="button" class="btn btn-dark waves-effect waves-light btn-sm">
|
||||
<i class="mdi mdi-refresh"></i> <?php echo $language::get('refresh'); ?>
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">RTMP Monitor</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table class="table table-borderless mb-0">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th class="text-center">RTMP PID</th>
|
||||
<th class="text-center">NGINX Version</th>
|
||||
<th class="text-center">FLV Version</th>
|
||||
<th class="text-center">Uptime</th>
|
||||
<th class="text-center">Input Mbps</th>
|
||||
<th class="text-center">Output Mbps</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo $rRTMPInfo['pid']; ?></td>
|
||||
<td class="text-center"><?php echo $rRTMPInfo['nginx_version']; ?></td>
|
||||
<td class="text-center"><?php echo $rRTMPInfo['nginx_http_flv_version']; ?></td>
|
||||
<td class="text-center">
|
||||
<button type='button'
|
||||
class='btn btn-success btn-xs waves-effect waves-light btn-fixed'><?php
|
||||
$rUptime = $rRTMPInfo['uptime'];
|
||||
if ($rUptime >= 86400) {
|
||||
echo sprintf('%02dd %02dh %02dm', $rUptime / 86400, ($rUptime / 3600) % 24, ($rUptime / 60) % 60);
|
||||
} else {
|
||||
echo sprintf('%02dh %02dm %02ds', $rUptime / 3600, ($rUptime / 60) % 60, $rUptime % 60);
|
||||
}
|
||||
?></button>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php echo number_format($rRTMPInfo['bw_in'] / 1000 / 1000, 2); ?> Mbps</td>
|
||||
<td class="text-center">
|
||||
<?php echo number_format($rRTMPInfo['bw_out'] / 1000 / 1000, 2); ?> Mbps</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<form id="line_activity_search">
|
||||
<div class="form-group row mb-4">
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control" id="live_search" value=""
|
||||
placeholder="Search Streams...">
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center"
|
||||
for="live_filter"><?php echo $language::get('server'); ?></label>
|
||||
<div class="col-md-4">
|
||||
<select id="live_filter" class="form-control" data-toggle="select2">
|
||||
<?php foreach ($rServers as $rServer) { ?>
|
||||
<option value="<?php echo $rServer['id']; ?>"
|
||||
<?php if (CoreUtilities::$rRequest['server'] == $rServer['id']) {
|
||||
echo ' selected';
|
||||
} ?>>
|
||||
<?php echo $rServer['server_name']; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center"
|
||||
for="live_show_entries"><?php echo $language::get('show'); ?></label>
|
||||
<div class="col-md-2">
|
||||
<select id="live_show_entries" class="form-control" data-toggle="select2">
|
||||
<?php foreach (array(10, 25, 50, 250, 500, 1000) as $rShow) { ?>
|
||||
<option<?php if ($rSettings['default_entries'] == $rShow) {
|
||||
echo ' selected';
|
||||
} ?>
|
||||
value="<?php echo $rShow; ?>"><?php echo $rShow; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="datatable-activity"
|
||||
class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<th>RTMP URL</th>
|
||||
<th class="text-center">Publisher IP</th>
|
||||
<th class="text-center">Uptime</th>
|
||||
<th class="text-center">Clients</th>
|
||||
<th class="text-center">Stream Info</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$rStreams = $rRTMPInfo['server']['application']['live']['stream'];
|
||||
if (isset($rStreams['name'])) {
|
||||
$rStreams = array($rStreams);
|
||||
}
|
||||
foreach ($rStreams as $rStream) {
|
||||
if (isset($rStream['client']['id'])) {
|
||||
$rStream['client'] = array($rStream['client']);
|
||||
}
|
||||
$rClientCount = count($rStream['client']);
|
||||
$rPublisher = '';
|
||||
foreach ($rStream['client'] as $rClient) {
|
||||
if ($rStream['time'] <= $rClient['time']) {
|
||||
$rPublisher = "<a onClick=\"whois('" . $rClient['address'] . "');\" href='javascript: void(0);'>" . $rClient['address'] . '</a>';
|
||||
$rClientCount--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$rClients = $rClientCount > 0 ? "<button type='button' class='btn btn-info btn-xs waves-effect waves-light'>" . $rClientCount . '</button>' : "<button type='button' class='btn btn-secondary btn-xs waves-effect waves-light'>0</button>";
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo $rStream['name']; ?></td>
|
||||
<td><?php echo htmlspecialchars(CoreUtilities::$rServers[intval(CoreUtilities::$rRequest['server'])]['rtmp_server']) . $rStream['name']; ?>
|
||||
</td>
|
||||
<td class="text-center"><?php echo $rPublisher; ?></td>
|
||||
<td class="text-center">
|
||||
<button type='button'
|
||||
class='btn btn-success btn-xs waves-effect waves-light btn-fixed'>
|
||||
<?php
|
||||
$rUptime = $rStream['time'] / 1000;
|
||||
if ($rUptime >= 86400) {
|
||||
echo sprintf('%02dd %02dh %02dm', $rUptime / 86400, ($rUptime / 3600) % 24, ($rUptime / 60) % 60);
|
||||
} else {
|
||||
echo sprintf('%02dh %02dm %02ds', $rUptime / 3600, ($rUptime / 60) % 60, $rUptime % 60);
|
||||
}
|
||||
?>
|
||||
</button>
|
||||
</td>
|
||||
<td class="text-center"><?php echo $rClients; ?></td>
|
||||
<td class="text-center">
|
||||
<div style="white-space: nowrap; width: 300px;" class="stream-info">
|
||||
<?php echo number_format($rStream['bw_in'] / 1000, 0); ?> Kbps<br>
|
||||
<?php echo $rStream['meta']['video']['width'] . ' x ' . $rStream['meta']['video']['height']; ?><br>
|
||||
<?php echo $rStream['meta']['video']['codec']; ?><br>
|
||||
<?php echo $rStream['meta']['audio']['codec']; ?><br>
|
||||
<?php echo round($rStream['meta']['video']['frame_rate'], 0); ?> FPS
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button data-toggle="tooltip" title="Kill Stream" type="button"
|
||||
class="btn tooltip btn-light waves-effect waves-light btn-xs"
|
||||
onClick="kill(<?php echo intval(CoreUtilities::$rRequest['server']); ?>, '<?php echo $rStream['name']; ?>');"><i
|
||||
class="mdi mdi-close"></ i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function kill(rServerID, rID) {' . "\r\n\t\t\t" . '$.getJSON("./api?action=rtmp_kill&name=" + rID + "&server=" + rServerID, function(data) {' . "\r\n\t\t\t\t" . 'if (data.result === true) {' . "\r\n\t\t\t\t\t" . '$.toast("Stream has been killed. Unless you revoke authentication to this user, it will reconnect.");' . "\r\n\t\t\t\t" . '} else {' . "\r\n\t\t\t\t\t" . '$.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n\t\t" . '}' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . "\$('select').select2({width: '100%'});" . "\r\n\t\t\t" . '$("#datatable-activity").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '},' . "\r\n\t\t\t\t\t" . 'infoFiltered: ""' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'order: [[ 0, "asc" ]],' . "\r\n\t\t\t\t" . 'pageLength: ';
|
||||
echo (intval($rSettings['default_entries']) ?: 10);
|
||||
echo ',' . "\r\n\t\t\t\t" . 'lengthMenu: [10, 25, 50, 250, 500, 1000]' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable-activity").css("width", "100%");' . "\r\n\t\t\t" . "\$('#live_search').keyup(function(){" . "\r\n\t\t\t\t" . "\$('#datatable-activity').DataTable().search(\$(this).val()).draw();" . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . "\$('#live_show_entries').change(function(){" . "\r\n\t\t\t\t" . "\$('#datatable-activity').DataTable().page.len(\$(this).val()).draw();" . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . "\$('#live_filter').change(function(){" . "\r\n\t\t\t\t" . 'navigate("./rtmp_monitor?server=" + $(this).val());' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . "\$('#datatable-activity').DataTable().search(\$('#live_search').val()).draw();" . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (!isset(CoreUtilities::$rRequest['server']) || !isset($rServers[CoreUtilities::$rRequest['server']])) {
|
||||
CoreUtilities::$rRequest['server'] = SERVER_ID;
|
||||
}
|
||||
|
||||
$rRTMPInfo = getRTMPStats(CoreUtilities::$rRequest['server']);
|
||||
$_TITLE = 'RTMP Monitor';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
<?php endif; ?>
|
||||
?>
|
||||
|
||||
<div class="wrapper"
|
||||
<?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li>
|
||||
<a href="javascript:void(0);" onClick="navigate('rtmp_monitor');"
|
||||
style="margin-right:10px;">
|
||||
<button type="button" class="btn btn-dark waves-effect waves-light btn-sm">
|
||||
<i class="mdi mdi-refresh"></i> <?php echo $language::get('refresh'); ?>
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">RTMP Monitor</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<table class="table table-borderless mb-0">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th class="text-center">RTMP PID</th>
|
||||
<th class="text-center">NGINX Version</th>
|
||||
<th class="text-center">FLV Version</th>
|
||||
<th class="text-center">Uptime</th>
|
||||
<th class="text-center">Input Mbps</th>
|
||||
<th class="text-center">Output Mbps</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo $rRTMPInfo['pid']; ?></td>
|
||||
<td class="text-center"><?php echo $rRTMPInfo['nginx_version']; ?></td>
|
||||
<td class="text-center"><?php echo $rRTMPInfo['nginx_http_flv_version']; ?></td>
|
||||
<td class="text-center">
|
||||
<button type='button'
|
||||
class='btn btn-success btn-xs waves-effect waves-light btn-fixed'><?php
|
||||
$rUptime = $rRTMPInfo['uptime'];
|
||||
if ($rUptime >= 86400) {
|
||||
echo sprintf('%02dd %02dh %02dm', $rUptime / 86400, ($rUptime / 3600) % 24, ($rUptime / 60) % 60);
|
||||
} else {
|
||||
echo sprintf('%02dh %02dm %02ds', $rUptime / 3600, ($rUptime / 60) % 60, $rUptime % 60);
|
||||
}
|
||||
?></button>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php echo number_format($rRTMPInfo['bw_in'] / 1000 / 1000, 2); ?> Mbps</td>
|
||||
<td class="text-center">
|
||||
<?php echo number_format($rRTMPInfo['bw_out'] / 1000 / 1000, 2); ?> Mbps</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<form id="line_activity_search">
|
||||
<div class="form-group row mb-4">
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control" id="live_search" value=""
|
||||
placeholder="Search Streams...">
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center"
|
||||
for="live_filter"><?php echo $language::get('server'); ?></label>
|
||||
<div class="col-md-4">
|
||||
<select id="live_filter" class="form-control" data-toggle="select2">
|
||||
<?php foreach ($rServers as $rServer) { ?>
|
||||
<option value="<?php echo $rServer['id']; ?>"
|
||||
<?php if (CoreUtilities::$rRequest['server'] == $rServer['id']) {
|
||||
echo ' selected';
|
||||
} ?>>
|
||||
<?php echo $rServer['server_name']; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center"
|
||||
for="live_show_entries"><?php echo $language::get('show'); ?></label>
|
||||
<div class="col-md-2">
|
||||
<select id="live_show_entries" class="form-control" data-toggle="select2">
|
||||
<?php foreach (array(10, 25, 50, 250, 500, 1000) as $rShow) { ?>
|
||||
<option<?php if ($rSettings['default_entries'] == $rShow) {
|
||||
echo ' selected';
|
||||
} ?>
|
||||
value="<?php echo $rShow; ?>"><?php echo $rShow; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="datatable-activity"
|
||||
class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<th>RTMP URL</th>
|
||||
<th class="text-center">Publisher IP</th>
|
||||
<th class="text-center">Uptime</th>
|
||||
<th class="text-center">Clients</th>
|
||||
<th class="text-center">Stream Info</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$rStreams = $rRTMPInfo['server']['application']['live']['stream'];
|
||||
if (isset($rStreams['name'])) {
|
||||
$rStreams = array($rStreams);
|
||||
}
|
||||
foreach ($rStreams as $rStream) {
|
||||
if (isset($rStream['client']['id'])) {
|
||||
$rStream['client'] = array($rStream['client']);
|
||||
}
|
||||
$rClientCount = count($rStream['client']);
|
||||
$rPublisher = '';
|
||||
foreach ($rStream['client'] as $rClient) {
|
||||
if ($rStream['time'] <= $rClient['time']) {
|
||||
$rPublisher = "<a onClick=\"whois('" . $rClient['address'] . "');\" href='javascript: void(0);'>" . $rClient['address'] . '</a>';
|
||||
$rClientCount--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$rClients = $rClientCount > 0 ? "<button type='button' class='btn btn-info btn-xs waves-effect waves-light'>" . $rClientCount . '</button>' : "<button type='button' class='btn btn-secondary btn-xs waves-effect waves-light'>0</button>";
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo $rStream['name']; ?></td>
|
||||
<td><?php echo htmlspecialchars(CoreUtilities::$rServers[intval(CoreUtilities::$rRequest['server'])]['rtmp_server']) . $rStream['name']; ?>
|
||||
</td>
|
||||
<td class="text-center"><?php echo $rPublisher; ?></td>
|
||||
<td class="text-center">
|
||||
<button type='button'
|
||||
class='btn btn-success btn-xs waves-effect waves-light btn-fixed'>
|
||||
<?php
|
||||
$rUptime = $rStream['time'] / 1000;
|
||||
if ($rUptime >= 86400) {
|
||||
echo sprintf('%02dd %02dh %02dm', $rUptime / 86400, ($rUptime / 3600) % 24, ($rUptime / 60) % 60);
|
||||
} else {
|
||||
echo sprintf('%02dh %02dm %02ds', $rUptime / 3600, ($rUptime / 60) % 60, $rUptime % 60);
|
||||
}
|
||||
?>
|
||||
</button>
|
||||
</td>
|
||||
<td class="text-center"><?php echo $rClients; ?></td>
|
||||
<td class="text-center">
|
||||
<div style="white-space: nowrap; width: 300px;" class="stream-info">
|
||||
<?php echo number_format($rStream['bw_in'] / 1000, 0); ?> Kbps<br>
|
||||
<?php echo $rStream['meta']['video']['width'] . ' x ' . $rStream['meta']['video']['height']; ?><br>
|
||||
<?php echo $rStream['meta']['video']['codec']; ?><br>
|
||||
<?php echo $rStream['meta']['audio']['codec']; ?><br>
|
||||
<?php echo round($rStream['meta']['video']['frame_rate'], 0); ?> FPS
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button data-toggle="tooltip" title="Kill Stream" type="button"
|
||||
class="btn tooltip btn-light waves-effect waves-light btn-xs"
|
||||
onClick="kill(<?php echo intval(CoreUtilities::$rRequest['server']); ?>, '<?php echo $rStream['name']; ?>');"><i
|
||||
class="mdi mdi-close"></ i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . 'function kill(rServerID, rID) {' . "\r\n\t\t\t" . '$.getJSON("./api?action=rtmp_kill&name=" + rID + "&server=" + rServerID, function(data) {' . "\r\n\t\t\t\t" . 'if (data.result === true) {' . "\r\n\t\t\t\t\t" . '$.toast("Stream has been killed. Unless you revoke authentication to this user, it will reconnect.");' . "\r\n\t\t\t\t" . '} else {' . "\r\n\t\t\t\t\t" . '$.toast("';
|
||||
echo $language::get('error_occured');
|
||||
echo '");' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n\t\t" . '}' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . "\$('select').select2({width: '100%'});" . "\r\n\t\t\t" . '$("#datatable-activity").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '},' . "\r\n\t\t\t\t\t" . 'infoFiltered: ""' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'order: [[ 0, "asc" ]],' . "\r\n\t\t\t\t" . 'pageLength: ';
|
||||
echo (intval($rSettings['default_entries']) ?: 10);
|
||||
echo ',' . "\r\n\t\t\t\t" . 'lengthMenu: [10, 25, 50, 250, 500, 1000]' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable-activity").css("width", "100%");' . "\r\n\t\t\t" . "\$('#live_search').keyup(function(){" . "\r\n\t\t\t\t" . "\$('#datatable-activity').DataTable().search(\$(this).val()).draw();" . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . "\$('#live_show_entries').change(function(){" . "\r\n\t\t\t\t" . "\$('#datatable-activity').DataTable().page.len(\$(this).val()).draw();" . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . "\$('#live_filter').change(function(){" . "\r\n\t\t\t\t" . 'navigate("./rtmp_monitor?server=" + $(this).val());' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . "\$('#datatable-activity').DataTable().search(\$('#live_search').val()).draw();" . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+8
-2
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -26,8 +27,10 @@ foreach ($rServers as $rServer) {
|
||||
$rServerTree[] = array('id' => $rServer['id'], 'parent' => 'offline', 'text' => $rServer['server_name'], 'icon' => 'mdi mdi-server-network', 'state' => array('opened' => true));
|
||||
}
|
||||
$_TITLE = 'TV Series';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper boxed-layout" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH'] ?? '') == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
<div class="container-fluid">
|
||||
@@ -464,7 +467,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -9,8 +10,10 @@ if (!checkPermissions()) {
|
||||
|
||||
$rCategories = getCategories('series');
|
||||
$_TITLE = 'TV Series';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrapper"
|
||||
<?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') echo ' style="display: none;"'; ?>>
|
||||
@@ -106,7 +109,10 @@ include 'header.php';
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -9,8 +10,10 @@ if (!checkPermissions()) {
|
||||
|
||||
$rCategories = getCategories('series');
|
||||
$_TITLE = 'Mass Edit Series';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout-xl"
|
||||
<?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
@@ -207,7 +210,10 @@ include 'header.php';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
+883
-877
File diff suppressed because it is too large
Load Diff
+401
-397
@@ -1,397 +1,401 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$rType = isset(CoreUtilities::$rRequest['proxy']) ? 1 : 2;
|
||||
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['id'])) {
|
||||
if ($rType == 1) {
|
||||
$rServerArr = $rProxyServers[intval(CoreUtilities::$rRequest['id'])];
|
||||
} else {
|
||||
$rServerArr = $allServers[intval(CoreUtilities::$rRequest['id'])];
|
||||
}
|
||||
|
||||
if (!$rServerArr) {
|
||||
goHome();
|
||||
}
|
||||
}
|
||||
|
||||
$_TITLE = $rType == 1 ? 'Install Proxy' : 'Install Server';
|
||||
|
||||
include 'header.php';
|
||||
echo '<div class="wrapper boxed-layout"';
|
||||
|
||||
if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
echo ' style="display: none;"';
|
||||
}
|
||||
|
||||
echo '>' . "\n" . ' <div class="container-fluid">' . "\n\t\t" . '<div class="row">' . "\n\t\t\t" . '<div class="col-12">' . "\n\t\t\t\t" . '<div class="page-title-box">' . "\n\t\t\t\t\t" . '<div class="page-title-right">' . "\n" . ' ';
|
||||
include 'topbar.php';
|
||||
echo "\t\t\t\t\t" . '</div>' . "\n" . ' ';
|
||||
|
||||
if ($rType == 1) {
|
||||
echo "\t\t\t\t\t" . '<h4 class="page-title">';
|
||||
|
||||
if (isset($rServerArr)) {
|
||||
if (isset(CoreUtilities::$rRequest['update'])) {
|
||||
echo 'Update Proxy';
|
||||
} else {
|
||||
echo 'Reinstall Proxy';
|
||||
}
|
||||
} else {
|
||||
echo 'Proxy Installation';
|
||||
}
|
||||
|
||||
echo '</h4>' . "\n" . ' ';
|
||||
} else {
|
||||
echo ' <h4 class="page-title">';
|
||||
|
||||
if (isset($rServerArr)) {
|
||||
if (isset(CoreUtilities::$rRequest['update'])) {
|
||||
echo 'Update Server';
|
||||
} else {
|
||||
echo 'Reinstall Server';
|
||||
}
|
||||
} else {
|
||||
echo 'Server Installation';
|
||||
}
|
||||
|
||||
echo '</h4>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t\t\t" . '</div>' . "\n\t\t\t" . '</div>' . "\n\t\t" . '</div>' . "\n\t\t" . '<div class="row">' . "\n\t\t\t" . '<div class="col-xl-12">' . "\n\t\t\t\t" . '<div class="card">' . "\n\t\t\t\t\t" . '<div class="card-body">' . "\n" . ' ';
|
||||
|
||||
if (isset($rServerArr) && $rServerArr['is_main'] == 1) {
|
||||
echo ' <div class="alert alert-danger" role="alert">' . "\n" . ' This is your main server, you cannot reinstall it from the XC_VM panel. To reinstall this server, please use the installation instructions on the billing panel.' . "\n" . ' </div>' . "\n" . ' ';
|
||||
} else {
|
||||
echo "\t\t\t\t\t\t" . '<form action="#" method="POST" data-parsley-validate="">' . "\n" . ' ';
|
||||
|
||||
if (!isset($rServerArr)) {
|
||||
} else {
|
||||
echo "\t\t\t\t\t\t\t" . '<input type="hidden" name="edit" value="';
|
||||
echo $rServerArr['id'];
|
||||
echo '" />' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo ' <input type="hidden" id="parent_id" name="parent_id" value="" />' . "\n" . ' <input type="hidden" name="type" value="';
|
||||
echo $rType;
|
||||
echo '" />' . "\n\t\t\t\t\t\t\t" . '<div id="basicwizard">' . "\n\t\t\t\t\t\t\t\t" . '<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">' . "\n\t\t\t\t\t\t\t\t\t" . '<li class="nav-item">' . "\n\t\t\t\t\t\t\t\t\t\t" . '<a href="#server-details" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2"> ' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<i class="mdi mdi-creation mr-1"></i>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<span class="d-none d-sm-inline">';
|
||||
echo $language::get('details');
|
||||
echo '</span>' . "\n\t\t\t\t\t\t\t\t\t\t" . '</a>' . "\n\t\t\t\t\t\t\t\t\t" . '</li>' . "\n" . ' ';
|
||||
|
||||
if ($rType != 1) {
|
||||
} else {
|
||||
echo ' <li class="nav-item">' . "\n\t\t\t\t\t\t\t\t\t\t" . '<a href="#server-coverage" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2"> ' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<i class="mdi mdi-server mr-1"></i>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<span class="d-none d-sm-inline">Server Coverage</span>' . "\n\t\t\t\t\t\t\t\t\t\t" . '</a>' . "\n\t\t\t\t\t\t\t\t\t" . '</li>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t\t\t\t\t\t\t" . '</ul>' . "\n\t\t\t\t\t\t\t\t" . '<div class="tab-content b-0 mb-0 pt-0">' . "\n\t\t\t\t\t\t\t\t\t" . '<div class="tab-pane" id="server-details">' . "\n\t\t\t\t\t\t\t\t\t\t" . '<div class="row">' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-12">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="form-group row mb-4">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<label class="col-md-3 col-form-label" for="server_name">';
|
||||
echo $language::get('server_name');
|
||||
echo '</label>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-md-9">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="text" class="form-control" id="server_name" name="server_name" ';
|
||||
|
||||
if (!isset($rServerArr)) {
|
||||
} else {
|
||||
echo 'readonly ';
|
||||
}
|
||||
|
||||
echo 'value="';
|
||||
|
||||
if (!isset($rServerArr)) {
|
||||
} else {
|
||||
echo htmlspecialchars($rServerArr['server_name']);
|
||||
}
|
||||
|
||||
echo '" required data-parsley-trigger="change">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="form-group row mb-4">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<label class="col-md-3 col-form-label" for="server_ip">Server IP</label>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="text" class="form-control" id="server_ip" name="server_ip" ';
|
||||
|
||||
if (!isset($rServerArr)) {
|
||||
} else {
|
||||
echo 'readonly ';
|
||||
}
|
||||
|
||||
echo 'value="';
|
||||
|
||||
if (!isset($rServerArr)) {
|
||||
} else {
|
||||
echo htmlspecialchars($rServerArr['server_ip']);
|
||||
}
|
||||
|
||||
echo '" required data-parsley-trigger="change">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' <label class="col-md-3 col-form-label" for="server_ip">SSH Port</label>' . "\n" . ' <div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="text" class="form-control text-center" id="ssh_port" name="ssh_port" value="22" required data-parsley-trigger="change">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' <div class="form-group row mb-4">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<label class="col-md-3 col-form-label" for="root_username">SSH Username <i title="This needs to be either the root user, or sudoer. Root is recommended." class="tooltip text-secondary far fa-circle"></i></label>' . "\n" . ' <div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="text" class="form-control" id="root_username" name="root_username" value="root" required data-parsley-trigger="change">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' <label class="col-md-3 col-form-label" for="root_username">SSH Password</label>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="text" class="form-control" id="root_password" name="root_password" value="" required data-parsley-trigger="change">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' ';
|
||||
|
||||
if ($rType == 1) {
|
||||
echo ' <div class="form-group row mb-4">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . "<label class=\"col-md-3 col-form-label\" for=\"http_broadcast_port\">HTTP Port <i title=\"Enter a port number between 1024 and 65535. As XC_VM doesn't run as root, it cannot run on a port lower than 1024. This cannot be changed later.\" class=\"tooltip text-secondary far fa-circle\"></i></label>" . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="text" class="form-control text-center" id="http_broadcast_port" name="http_broadcast_port" value="80" required data-parsley-trigger="change">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . " <label class=\"col-md-3 col-form-label\" for=\"https_broadcast_port\">HTTPS Port <i title=\"Enter a port number between 1024 and 65535. As XC_VM doesn't run as root, it cannot run on a port lower than 1024. This cannot be changed later.\" class=\"tooltip text-secondary far fa-circle\"></i></label>" . "\n" . ' <div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="text" class="form-control text-center" id="https_broadcast_port" name="https_broadcast_port" value="443" required data-parsley-trigger="change">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo ' <div class="form-group row mb-4">' . "\n" . " <label class=\"col-md-3 col-form-label\" for=\"update_sysctl\">Update sysctl.conf <i title=\"Use the XC_VM sysctl.conf file. If you have your own custom sysctl.conf, then disable this or it will be overwritten. If you don't know what a sysctl configuration is, use this as it will correctly set your TCP settings and open file limits.\" class=\"tooltip text-secondary far fa-circle\"></i></label>" . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input name="update_sysctl" id="update_sysctl" type="checkbox" data-plugin="switchery" class="js-switch" checked data-color="#039cfd"/>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' </div>' . "\n" . ' ';
|
||||
|
||||
if ($rType != 1) {
|
||||
} else {
|
||||
echo ' <div class="form-group row mb-4">' . "\n" . " <label class=\"col-md-3 col-form-label\" for=\"use_private_ip\">Use Private IP <i title=\"Use the private IP of the load balancer you've selected to route traffic internally.\" class=\"tooltip text-secondary far fa-circle\"></i></label>" . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input name="use_private_ip" id="use_private_ip" type="checkbox" data-plugin="switchery" class="js-switch" data-color="#039cfd"/>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' </div>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
if (isset($rServerArr) && isset(CoreUtilities::$rRequest['update'])) {
|
||||
echo ' <div class="alert alert-info" role="alert">' . "\n" . ' In order to update your XC_VM core from v';
|
||||
echo $rServerArr['xc_vm_version'];
|
||||
echo ' to v';
|
||||
echo $allServers[SERVER_ID]['xc_vm_version'];
|
||||
echo ", you will need to enter root SSH details.<br/>This will reinstall your server with the most up to date software, it shouldn't take too long, however your server will be offline to customers during the update process." . "\n" . ' </div>' . "\n" . ' ';
|
||||
} else {
|
||||
echo ' <div class="alert alert-warning mb-4" role="alert">' . "\n" . ' ';
|
||||
|
||||
if ($rType == 1) {
|
||||
echo ' You will not be able to change the port or any other settings through the XC_VM Admin Panel after installation, you will be required to reinstall the proxy server entirely.<br/><br/>Installation will begin immediately, you will be alerted of progress on the Server View page.' . "\n" . ' ';
|
||||
} else {
|
||||
echo ' Installation will begin immediately, you will be alerted of progress on the Server View page. After installation is complete you can amend the ports and other server settings.' . "\n" . ' ';
|
||||
}
|
||||
|
||||
if (isset($rServerArr)) {
|
||||
echo ' <br/><br/>As you are reinstalling the server, it will go offline until the installation is complete.' . "\n" . ' ';
|
||||
} else {
|
||||
echo ' <br/><br/>With new installations, the file limit is set in the system. A reboot is required for this, but you can do it at your own pace.' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo ' </div>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo ' </div>' . "\n\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t" . '<ul class="list-inline wizard mb-0">' . "\n" . ' ';
|
||||
|
||||
if ($rType == 1) {
|
||||
echo "\t\t\t\t\t\t\t\t\t\t\t" . '<li class="nextb list-inline-item float-right">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<a href="javascript: void(0);" class="btn btn-secondary">Next</a>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '</li>' . "\n" . ' ';
|
||||
} else {
|
||||
echo ' <li class="list-inline-item float-right">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<input name="submit_server" type="submit" class="btn btn-primary" value="';
|
||||
echo $language::get('install_server');
|
||||
echo '" />' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '</li>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t\t\t\t\t\t\t\t\t" . '</ul>' . "\n\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' ';
|
||||
|
||||
if ($rType == 1) {
|
||||
echo ' <div class="tab-pane" id="server-coverage">' . "\n\t\t\t\t\t\t\t\t\t\t" . '<div class="row">' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-12">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="form-group row mb-4">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<table id="datatable" class="table table-borderless mb-0">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<thead class="bg-light">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<tr>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<th class="text-center">ID</th>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<th>Server Name</th>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<th class="text-center">Server IP</th>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</tr>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</thead>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<tbody>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
|
||||
|
||||
foreach (CoreUtilities::$rServers as $d58b4f8653a391d8 => $A08adcff1f387f4c) {
|
||||
if ($A08adcff1f387f4c['server_type'] == 0) {
|
||||
echo "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<tr';
|
||||
|
||||
if (!(isset($rServerArr) && in_array($A08adcff1f387f4c['id'], CoreUtilities::$rServers[$rServerArr['id']]['parent_id']))) {
|
||||
} else {
|
||||
echo " class='selected selectedfilter ui-selected'";
|
||||
}
|
||||
|
||||
echo '>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<td class="text-center">';
|
||||
echo $A08adcff1f387f4c['id'];
|
||||
echo '</td>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<td>';
|
||||
echo $A08adcff1f387f4c['server_name'];
|
||||
echo '</td>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<td class="text-center">';
|
||||
echo $A08adcff1f387f4c['server_ip'];
|
||||
echo '</td>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</tr>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
|
||||
}
|
||||
}
|
||||
echo "\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</tbody>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</table>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t" . '<ul class="list-inline wizard mb-0">' . "\n" . ' <li class="prevb list-inline-item">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<a href="javascript: void(0);" class="btn btn-secondary">Previous</a>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '</li>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<li class="list-inline-item float-right">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<input name="submit_server" type="submit" class="btn btn-primary" value="';
|
||||
echo $language::get('install_server');
|
||||
echo '" />' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '</li>' . "\n\t\t\t\t\t\t\t\t\t\t" . '</ul>' . "\n\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t\t\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t\t\t" . '</form>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t" . '</div> ' . "\n\t\t\t" . '</div> ' . "\n\t\t" . '</div>' . "\n\t" . '</div>' . "\n" . '</div>' . "\n";
|
||||
include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
$(document).ready(function() {
|
||||
$('select').select2({
|
||||
width: '100%'
|
||||
});
|
||||
$("#ssh_port").inputFilter(function(value) {
|
||||
return /^\d*$/.test(value);
|
||||
});
|
||||
$("#rtmp_port").inputFilter(function(value) {
|
||||
return /^\d*$/.test(value) && (value === "" || parseInt(value) <= 65535);
|
||||
});
|
||||
$("#http_broadcast_port").inputFilter(function(value) {
|
||||
return /^\d*$/.test(value) && (value === "" || parseInt(value) <= 65535);
|
||||
});
|
||||
$("#https_broadcast_port").inputFilter(function(value) {
|
||||
return /^\d*$/.test(value) && (value === "" || parseInt(value) <= 65535);
|
||||
});
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
<?php if ($rType == 1): ?>
|
||||
var rServers = [];
|
||||
$("#datatable tr.selected").each(function() {
|
||||
rServers.push($(this).find("td:eq(0)").text());
|
||||
});
|
||||
if (rServers.length == 0) {
|
||||
$.toast("Please select at least one server to apply the proxy to.");
|
||||
return;
|
||||
}
|
||||
$("#parent_id").val("[" + rServers.join(",") + "]");
|
||||
<?php endif; ?>
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
<?php if ($rType == 1): ?>
|
||||
$("#datatable").DataTable({
|
||||
columnDefs: [{
|
||||
"className": "dt-center",
|
||||
"targets": [0, 2]
|
||||
}],
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
paging: false,
|
||||
bInfo: false,
|
||||
searching: false
|
||||
});
|
||||
$("#datatable").selectable({
|
||||
filter: 'tr',
|
||||
selected: function(event, ui) {
|
||||
if ($(ui.selected).hasClass('selectedfilter')) {
|
||||
$(ui.selected).removeClass('selectedfilter').removeClass('ui-selected').removeClass("selected");
|
||||
} else {
|
||||
$(ui.selected).addClass('selectedfilter').addClass('ui-selected').addClass("selected");
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
});
|
||||
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php
|
||||
|
||||
if (!isset($__viewMode)):
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$rType = isset(CoreUtilities::$rRequest['proxy']) ? 1 : 2;
|
||||
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['id'])) {
|
||||
if ($rType == 1) {
|
||||
$rServerArr = $rProxyServers[intval(CoreUtilities::$rRequest['id'])];
|
||||
} else {
|
||||
$rServerArr = $allServers[intval(CoreUtilities::$rRequest['id'])];
|
||||
}
|
||||
|
||||
if (!$rServerArr) {
|
||||
goHome();
|
||||
}
|
||||
}
|
||||
|
||||
$_TITLE = $rType == 1 ? 'Install Proxy' : 'Install Server';
|
||||
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
endif; // !$__viewMode
|
||||
echo '<div class="wrapper boxed-layout"';
|
||||
|
||||
if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
echo ' style="display: none;"';
|
||||
}
|
||||
|
||||
echo '>' . "\n" . ' <div class="container-fluid">' . "\n\t\t" . '<div class="row">' . "\n\t\t\t" . '<div class="col-12">' . "\n\t\t\t\t" . '<div class="page-title-box">' . "\n\t\t\t\t\t" . '<div class="page-title-right">' . "\n" . ' ';
|
||||
include 'topbar.php';
|
||||
echo "\t\t\t\t\t" . '</div>' . "\n" . ' ';
|
||||
|
||||
if ($rType == 1) {
|
||||
echo "\t\t\t\t\t" . '<h4 class="page-title">';
|
||||
|
||||
if (isset($rServerArr)) {
|
||||
if (isset(CoreUtilities::$rRequest['update'])) {
|
||||
echo 'Update Proxy';
|
||||
} else {
|
||||
echo 'Reinstall Proxy';
|
||||
}
|
||||
} else {
|
||||
echo 'Proxy Installation';
|
||||
}
|
||||
|
||||
echo '</h4>' . "\n" . ' ';
|
||||
} else {
|
||||
echo ' <h4 class="page-title">';
|
||||
|
||||
if (isset($rServerArr)) {
|
||||
if (isset(CoreUtilities::$rRequest['update'])) {
|
||||
echo 'Update Server';
|
||||
} else {
|
||||
echo 'Reinstall Server';
|
||||
}
|
||||
} else {
|
||||
echo 'Server Installation';
|
||||
}
|
||||
|
||||
echo '</h4>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t\t\t" . '</div>' . "\n\t\t\t" . '</div>' . "\n\t\t" . '</div>' . "\n\t\t" . '<div class="row">' . "\n\t\t\t" . '<div class="col-xl-12">' . "\n\t\t\t\t" . '<div class="card">' . "\n\t\t\t\t\t" . '<div class="card-body">' . "\n" . ' ';
|
||||
|
||||
if (isset($rServerArr) && $rServerArr['is_main'] == 1) {
|
||||
echo ' <div class="alert alert-danger" role="alert">' . "\n" . ' This is your main server, you cannot reinstall it from the XC_VM panel. To reinstall this server, please use the installation instructions on the billing panel.' . "\n" . ' </div>' . "\n" . ' ';
|
||||
} else {
|
||||
echo "\t\t\t\t\t\t" . '<form action="#" method="POST" data-parsley-validate="">' . "\n" . ' ';
|
||||
|
||||
if (!isset($rServerArr)) {
|
||||
} else {
|
||||
echo "\t\t\t\t\t\t\t" . '<input type="hidden" name="edit" value="';
|
||||
echo $rServerArr['id'];
|
||||
echo '" />' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo ' <input type="hidden" id="parent_id" name="parent_id" value="" />' . "\n" . ' <input type="hidden" name="type" value="';
|
||||
echo $rType;
|
||||
echo '" />' . "\n\t\t\t\t\t\t\t" . '<div id="basicwizard">' . "\n\t\t\t\t\t\t\t\t" . '<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">' . "\n\t\t\t\t\t\t\t\t\t" . '<li class="nav-item">' . "\n\t\t\t\t\t\t\t\t\t\t" . '<a href="#server-details" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2"> ' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<i class="mdi mdi-creation mr-1"></i>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<span class="d-none d-sm-inline">';
|
||||
echo $language::get('details');
|
||||
echo '</span>' . "\n\t\t\t\t\t\t\t\t\t\t" . '</a>' . "\n\t\t\t\t\t\t\t\t\t" . '</li>' . "\n" . ' ';
|
||||
|
||||
if ($rType != 1) {
|
||||
} else {
|
||||
echo ' <li class="nav-item">' . "\n\t\t\t\t\t\t\t\t\t\t" . '<a href="#server-coverage" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2"> ' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<i class="mdi mdi-server mr-1"></i>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<span class="d-none d-sm-inline">Server Coverage</span>' . "\n\t\t\t\t\t\t\t\t\t\t" . '</a>' . "\n\t\t\t\t\t\t\t\t\t" . '</li>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t\t\t\t\t\t\t" . '</ul>' . "\n\t\t\t\t\t\t\t\t" . '<div class="tab-content b-0 mb-0 pt-0">' . "\n\t\t\t\t\t\t\t\t\t" . '<div class="tab-pane" id="server-details">' . "\n\t\t\t\t\t\t\t\t\t\t" . '<div class="row">' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-12">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="form-group row mb-4">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<label class="col-md-3 col-form-label" for="server_name">';
|
||||
echo $language::get('server_name');
|
||||
echo '</label>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-md-9">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="text" class="form-control" id="server_name" name="server_name" ';
|
||||
|
||||
if (!isset($rServerArr)) {
|
||||
} else {
|
||||
echo 'readonly ';
|
||||
}
|
||||
|
||||
echo 'value="';
|
||||
|
||||
if (!isset($rServerArr)) {
|
||||
} else {
|
||||
echo htmlspecialchars($rServerArr['server_name']);
|
||||
}
|
||||
|
||||
echo '" required data-parsley-trigger="change">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="form-group row mb-4">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<label class="col-md-3 col-form-label" for="server_ip">Server IP</label>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="text" class="form-control" id="server_ip" name="server_ip" ';
|
||||
|
||||
if (!isset($rServerArr)) {
|
||||
} else {
|
||||
echo 'readonly ';
|
||||
}
|
||||
|
||||
echo 'value="';
|
||||
|
||||
if (!isset($rServerArr)) {
|
||||
} else {
|
||||
echo htmlspecialchars($rServerArr['server_ip']);
|
||||
}
|
||||
|
||||
echo '" required data-parsley-trigger="change">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' <label class="col-md-3 col-form-label" for="server_ip">SSH Port</label>' . "\n" . ' <div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="text" class="form-control text-center" id="ssh_port" name="ssh_port" value="22" required data-parsley-trigger="change">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' <div class="form-group row mb-4">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<label class="col-md-3 col-form-label" for="root_username">SSH Username <i title="This needs to be either the root user, or sudoer. Root is recommended." class="tooltip text-secondary far fa-circle"></i></label>' . "\n" . ' <div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="text" class="form-control" id="root_username" name="root_username" value="root" required data-parsley-trigger="change">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' <label class="col-md-3 col-form-label" for="root_username">SSH Password</label>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="text" class="form-control" id="root_password" name="root_password" value="" required data-parsley-trigger="change">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' ';
|
||||
|
||||
if ($rType == 1) {
|
||||
echo ' <div class="form-group row mb-4">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . "<label class=\"col-md-3 col-form-label\" for=\"http_broadcast_port\">HTTP Port <i title=\"Enter a port number between 1024 and 65535. As XC_VM doesn't run as root, it cannot run on a port lower than 1024. This cannot be changed later.\" class=\"tooltip text-secondary far fa-circle\"></i></label>" . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="text" class="form-control text-center" id="http_broadcast_port" name="http_broadcast_port" value="80" required data-parsley-trigger="change">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . " <label class=\"col-md-3 col-form-label\" for=\"https_broadcast_port\">HTTPS Port <i title=\"Enter a port number between 1024 and 65535. As XC_VM doesn't run as root, it cannot run on a port lower than 1024. This cannot be changed later.\" class=\"tooltip text-secondary far fa-circle\"></i></label>" . "\n" . ' <div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="text" class="form-control text-center" id="https_broadcast_port" name="https_broadcast_port" value="443" required data-parsley-trigger="change">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo ' <div class="form-group row mb-4">' . "\n" . " <label class=\"col-md-3 col-form-label\" for=\"update_sysctl\">Update sysctl.conf <i title=\"Use the XC_VM sysctl.conf file. If you have your own custom sysctl.conf, then disable this or it will be overwritten. If you don't know what a sysctl configuration is, use this as it will correctly set your TCP settings and open file limits.\" class=\"tooltip text-secondary far fa-circle\"></i></label>" . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input name="update_sysctl" id="update_sysctl" type="checkbox" data-plugin="switchery" class="js-switch" checked data-color="#039cfd"/>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' </div>' . "\n" . ' ';
|
||||
|
||||
if ($rType != 1) {
|
||||
} else {
|
||||
echo ' <div class="form-group row mb-4">' . "\n" . " <label class=\"col-md-3 col-form-label\" for=\"use_private_ip\">Use Private IP <i title=\"Use the private IP of the load balancer you've selected to route traffic internally.\" class=\"tooltip text-secondary far fa-circle\"></i></label>" . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-md-3">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input name="use_private_ip" id="use_private_ip" type="checkbox" data-plugin="switchery" class="js-switch" data-color="#039cfd"/>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' </div>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
if (isset($rServerArr) && isset(CoreUtilities::$rRequest['update'])) {
|
||||
echo ' <div class="alert alert-info" role="alert">' . "\n" . ' In order to update your XC_VM core from v';
|
||||
echo $rServerArr['xc_vm_version'];
|
||||
echo ' to v';
|
||||
echo $allServers[SERVER_ID]['xc_vm_version'];
|
||||
echo ", you will need to enter root SSH details.<br/>This will reinstall your server with the most up to date software, it shouldn't take too long, however your server will be offline to customers during the update process." . "\n" . ' </div>' . "\n" . ' ';
|
||||
} else {
|
||||
echo ' <div class="alert alert-warning mb-4" role="alert">' . "\n" . ' ';
|
||||
|
||||
if ($rType == 1) {
|
||||
echo ' You will not be able to change the port or any other settings through the XC_VM Admin Panel after installation, you will be required to reinstall the proxy server entirely.<br/><br/>Installation will begin immediately, you will be alerted of progress on the Server View page.' . "\n" . ' ';
|
||||
} else {
|
||||
echo ' Installation will begin immediately, you will be alerted of progress on the Server View page. After installation is complete you can amend the ports and other server settings.' . "\n" . ' ';
|
||||
}
|
||||
|
||||
if (isset($rServerArr)) {
|
||||
echo ' <br/><br/>As you are reinstalling the server, it will go offline until the installation is complete.' . "\n" . ' ';
|
||||
} else {
|
||||
echo ' <br/><br/>With new installations, the file limit is set in the system. A reboot is required for this, but you can do it at your own pace.' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo ' </div>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo ' </div>' . "\n\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t" . '<ul class="list-inline wizard mb-0">' . "\n" . ' ';
|
||||
|
||||
if ($rType == 1) {
|
||||
echo "\t\t\t\t\t\t\t\t\t\t\t" . '<li class="nextb list-inline-item float-right">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<a href="javascript: void(0);" class="btn btn-secondary">Next</a>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '</li>' . "\n" . ' ';
|
||||
} else {
|
||||
echo ' <li class="list-inline-item float-right">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<input name="submit_server" type="submit" class="btn btn-primary" value="';
|
||||
echo $language::get('install_server');
|
||||
echo '" />' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '</li>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t\t\t\t\t\t\t\t\t" . '</ul>' . "\n\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' ';
|
||||
|
||||
if ($rType == 1) {
|
||||
echo ' <div class="tab-pane" id="server-coverage">' . "\n\t\t\t\t\t\t\t\t\t\t" . '<div class="row">' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-12">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="form-group row mb-4">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<table id="datatable" class="table table-borderless mb-0">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<thead class="bg-light">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<tr>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<th class="text-center">ID</th>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<th>Server Name</th>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<th class="text-center">Server IP</th>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</tr>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</thead>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<tbody>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
|
||||
|
||||
foreach (CoreUtilities::$rServers as $d58b4f8653a391d8 => $A08adcff1f387f4c) {
|
||||
if ($A08adcff1f387f4c['server_type'] == 0) {
|
||||
echo "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<tr';
|
||||
|
||||
if (!(isset($rServerArr) && in_array($A08adcff1f387f4c['id'], CoreUtilities::$rServers[$rServerArr['id']]['parent_id']))) {
|
||||
} else {
|
||||
echo " class='selected selectedfilter ui-selected'";
|
||||
}
|
||||
|
||||
echo '>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<td class="text-center">';
|
||||
echo $A08adcff1f387f4c['id'];
|
||||
echo '</td>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<td>';
|
||||
echo $A08adcff1f387f4c['server_name'];
|
||||
echo '</td>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<td class="text-center">';
|
||||
echo $A08adcff1f387f4c['server_ip'];
|
||||
echo '</td>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</tr>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
|
||||
}
|
||||
}
|
||||
echo "\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</tbody>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</table>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t" . '<ul class="list-inline wizard mb-0">' . "\n" . ' <li class="prevb list-inline-item">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<a href="javascript: void(0);" class="btn btn-secondary">Previous</a>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '</li>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<li class="list-inline-item float-right">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<input name="submit_server" type="submit" class="btn btn-primary" value="';
|
||||
echo $language::get('install_server');
|
||||
echo '" />' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '</li>' . "\n\t\t\t\t\t\t\t\t\t\t" . '</ul>' . "\n\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t\t\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t\t\t" . '</form>' . "\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t" . '</div> ' . "\n\t\t\t" . '</div> ' . "\n\t\t" . '</div>' . "\n\t" . '</div>' . "\n" . '</div>' . "\n";
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin'); ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
$(document).ready(function() {
|
||||
$('select').select2({
|
||||
width: '100%'
|
||||
});
|
||||
$("#ssh_port").inputFilter(function(value) {
|
||||
return /^\d*$/.test(value);
|
||||
});
|
||||
$("#rtmp_port").inputFilter(function(value) {
|
||||
return /^\d*$/.test(value) && (value === "" || parseInt(value) <= 65535);
|
||||
});
|
||||
$("#http_broadcast_port").inputFilter(function(value) {
|
||||
return /^\d*$/.test(value) && (value === "" || parseInt(value) <= 65535);
|
||||
});
|
||||
$("#https_broadcast_port").inputFilter(function(value) {
|
||||
return /^\d*$/.test(value) && (value === "" || parseInt(value) <= 65535);
|
||||
});
|
||||
$("form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
<?php if ($rType == 1): ?>
|
||||
var rServers = [];
|
||||
$("#datatable tr.selected").each(function() {
|
||||
rServers.push($(this).find("td:eq(0)").text());
|
||||
});
|
||||
if (rServers.length == 0) {
|
||||
$.toast("Please select at least one server to apply the proxy to.");
|
||||
return;
|
||||
}
|
||||
$("#parent_id").val("[" + rServers.join(",") + "]");
|
||||
<?php endif; ?>
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("form")[0]));
|
||||
});
|
||||
<?php if ($rType == 1): ?>
|
||||
$("#datatable").DataTable({
|
||||
columnDefs: [{
|
||||
"className": "dt-center",
|
||||
"targets": [0, 2]
|
||||
}],
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
paging: false,
|
||||
bInfo: false,
|
||||
searching: false
|
||||
});
|
||||
$("#datatable").selectable({
|
||||
filter: 'tr',
|
||||
selected: function(event, ui) {
|
||||
if ($(ui.selected).hasClass('selectedfilter')) {
|
||||
$(ui.selected).removeClass('selectedfilter').removeClass('ui-selected').removeClass("selected");
|
||||
} else {
|
||||
$(ui.selected).addClass('selectedfilter').addClass('ui-selected').addClass("selected");
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
});
|
||||
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+250
-244
@@ -1,244 +1,250 @@
|
||||
<?php
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$rOrderedServers = $rServers;
|
||||
array_multisort(array_column($rOrderedServers, 'order'), SORT_ASC, $rOrderedServers);
|
||||
$_TITLE = 'Server Order';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout"
|
||||
<?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Server Order</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Servers have been re-ordered.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#servers" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-server mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Servers</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="servers">
|
||||
<form action="#" method="POST" id="server_form">
|
||||
<input type="hidden" id="server_order" name="server_order" value="" />
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="sub-header">
|
||||
To re-order a server, drag it up or down the list using the <i
|
||||
class="mdi mdi-view-sequential"></i> icon. Click Save Changes at
|
||||
the bottom once finished.<br />Servers will be ordered as below on
|
||||
the dashboard, with offline servers moved to the end of the list
|
||||
automatically.
|
||||
</p>
|
||||
<div class="custom-dd dd" id="server_items">
|
||||
<ol class="dd-list">
|
||||
<?php foreach ($rOrderedServers as $rServer): ?>
|
||||
<li class="dd-item dd3-item server-<?= $rServer['id']; ?>"
|
||||
data-id="<?= $rServer['id']; ?>">
|
||||
<div class="dd-handle dd3-handle"></div>
|
||||
<div class="dd3-content">#<?= $rServer['id']; ?> -
|
||||
<?= $rServer['server_name']; ?>
|
||||
<span style="float:right;"></span>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0 add-margin-top-20">
|
||||
<li class="list-inline-item float-right">
|
||||
<button type="submit"
|
||||
class="btn btn-primary waves-effect waves-light">Save
|
||||
Changes</button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#server_items").nestable({
|
||||
maxDepth: 1
|
||||
});
|
||||
$("#server_form").submit(function(e) {
|
||||
$("#server_order").val(JSON.stringify($('#server_items.dd').nestable('serialize')));
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("#server_form")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$rOrderedServers = $rServers;
|
||||
array_multisort(array_column($rOrderedServers, 'order'), SORT_ASC, $rOrderedServers);
|
||||
$_TITLE = 'Server Order';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout"
|
||||
<?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Server Order</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Servers have been re-ordered.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#servers" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-server mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Servers</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="servers">
|
||||
<form action="#" method="POST" id="server_form">
|
||||
<input type="hidden" id="server_order" name="server_order" value="" />
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="sub-header">
|
||||
To re-order a server, drag it up or down the list using the <i
|
||||
class="mdi mdi-view-sequential"></i> icon. Click Save Changes at
|
||||
the bottom once finished.<br />Servers will be ordered as below on
|
||||
the dashboard, with offline servers moved to the end of the list
|
||||
automatically.
|
||||
</p>
|
||||
<div class="custom-dd dd" id="server_items">
|
||||
<ol class="dd-list">
|
||||
<?php foreach ($rOrderedServers as $rServer): ?>
|
||||
<li class="dd-item dd3-item server-<?= $rServer['id']; ?>"
|
||||
data-id="<?= $rServer['id']; ?>">
|
||||
<div class="dd-handle dd3-handle"></div>
|
||||
<div class="dd3-content">#<?= $rServer['id']; ?> -
|
||||
<?= $rServer['server_name']; ?>
|
||||
<span style="float:right;"></span>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0 add-margin-top-20">
|
||||
<li class="list-inline-item float-right">
|
||||
<button type="submit"
|
||||
class="btn btn-primary waves-effect waves-light">Save
|
||||
Changes</button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#server_items").nestable({
|
||||
maxDepth: 1
|
||||
});
|
||||
$("#server_form").submit(function(e) {
|
||||
$("#server_order").val(JSON.stringify($('#server_items.dd').nestable('serialize')));
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("#server_form")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+1004
-998
File diff suppressed because it is too large
Load Diff
+847
-841
File diff suppressed because it is too large
Load Diff
+12
-4
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (!isset($__settingsViewMode)):
|
||||
|
||||
include "session.php";
|
||||
include "functions.php";
|
||||
|
||||
@@ -15,7 +17,10 @@ $GeoISP = json_decode(file_get_contents(BIN_PATH . "maxmind/version.json"), true
|
||||
$Nginx = trim(shell_exec(BIN_PATH . "nginx/sbin/nginx -v 2>&1 | cut -d'/' -f2"));
|
||||
|
||||
$_TITLE = "Settings";
|
||||
include "header.php";
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
|
||||
endif; // !$__settingsViewMode
|
||||
?>
|
||||
|
||||
<div class="wrapper boxed-layout-ext" <?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'): ?> style="display: none;" <?php endif; ?>>
|
||||
@@ -49,24 +54,26 @@ include "header.php";
|
||||
} ?>
|
||||
<div class="card bg-info text-white cta-box">
|
||||
<?php
|
||||
if (is_array($rUpdate) && $rUpdate["version"] && (0 < version_compare($rUpdate["version"], XC_VM_VERSION) || (version_compare($rUpdate["version"], XC_VM_VERSION) == 0))) {
|
||||
if (isset($rUpdate) && is_array($rUpdate) && !empty($rUpdate["version"]) && (0 < version_compare($rUpdate["version"], XC_VM_VERSION) || (version_compare($rUpdate["version"], XC_VM_VERSION) == 0))) {
|
||||
?>
|
||||
<div class="card-body" style="max-height: 250px;">
|
||||
<h5 class="card-title text-white">Update Available</h5>
|
||||
<p>Official Release v <?= $rUpdate["version"]; ?> is now available to download.</p>
|
||||
<?php
|
||||
if (!empty($rUpdate["changelog"]) && is_array($rUpdate["changelog"])) {
|
||||
foreach ($rUpdate["changelog"] as $rItem) {
|
||||
echo '<h5 class="card-title text-white mt-1">Changelog - v';
|
||||
echo $rItem["version"];
|
||||
echo '</h5><ul>';
|
||||
|
||||
foreach ($rItem["changes"] as $rChange) {
|
||||
foreach ((is_array($rItem["changes"] ?? null) ? $rItem["changes"] : []) as $rChange) {
|
||||
echo '<li>';
|
||||
echo $rChange;
|
||||
echo '</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<br />
|
||||
<a href="<?= str_replace('" ', '"', $rUpdate["url"]) ?> " class="text-white font-weight-semibold text-uppercase">Go to Release Thread <i class="mdi mdi-arrow-right"></i></a>
|
||||
@@ -2315,7 +2322,8 @@ include "header.php";
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
include 'footer.php'; ?>
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin'); ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -10,7 +10,9 @@ if (!checkPermissions()) {
|
||||
$rBouquets = getBouquets();
|
||||
$_TITLE = 'Plex Settings';
|
||||
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
include dirname(__DIR__) . '/modules/plex/views/settings.php';
|
||||
include 'footer.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
include dirname(__DIR__) . '/modules/plex/views/settings_scripts.php';
|
||||
@@ -10,7 +10,9 @@ if (!checkPermissions()) {
|
||||
$rBouquets = getBouquets();
|
||||
$_TITLE = 'Watch Settings';
|
||||
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
include dirname(__DIR__) . '/modules/watch/views/settings_watch.php';
|
||||
include 'footer.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
include dirname(__DIR__) . '/modules/watch/views/settings_watch_scripts.php';
|
||||
|
||||
+6
-2
@@ -132,7 +132,8 @@ if (!isset(CoreUtilities::$rRequest['update'])):
|
||||
|
||||
$_TITLE = 'Database Migration';
|
||||
$_SETUP = true;
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
?>
|
||||
<div class="wrapper boxed-layout" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
@@ -299,7 +300,10 @@ if (!isset(CoreUtilities::$rRequest['update'])):
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<?php if ($rMigrating): ?>
|
||||
<script>
|
||||
function getMigrationStatus() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -70,7 +71,9 @@ if (isset($rStream)) {
|
||||
}
|
||||
|
||||
$_TITLE = 'Stream';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
<?php endif; ?>
|
||||
?>
|
||||
|
||||
<div class="wrapper boxed-layout-ext"
|
||||
@@ -903,7 +906,8 @@ include 'header.php';
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'footer.php'; ?>
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin'); ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
+379
-373
@@ -1,373 +1,379 @@
|
||||
<?php
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$rCategories = array(1 => getCategories(), 2 => getCategories('movie'), 3 => getCategories('series'), 4 => getCategories('radio'));
|
||||
$rMainCategories = array(1 => array(), 2 => array(), 3 => array());
|
||||
|
||||
foreach (array(1, 2, 3, 4) as $rID) {
|
||||
foreach ($rCategories[$rID] as $rCategoryID => $rCategoryData) {
|
||||
$rMainCategories[$rID][] = $rCategoryData;
|
||||
}
|
||||
}
|
||||
$_TITLE = 'Stream Categories';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Categories</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS) { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Your new Category has been added. You can move it up the list to re-order it.
|
||||
</div>
|
||||
<?php } elseif (isset($_STATUS) && $_STATUS == STATUS_SUCCESS_MULTI) { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Categories have been re-ordered.
|
||||
</div>
|
||||
<?php } elseif (isset($_STATUS) && $_STATUS == STATUS_SUCCESS_REPLACE) { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Categories will be added automatically.
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#category-order-1" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-play mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Streams</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#category-order-2" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-movie mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Movies</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#category-order-3" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-youtube-tv mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Series</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#category-order-4" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-radio mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Radio</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<?php foreach (array(1, 2, 3, 4) as $tabID) { ?>
|
||||
<div class="tab-pane" id="category-order-<?php echo $tabID; ?>">
|
||||
<form action="#" method="POST" id="stream_categories_form-<?php echo $tabID; ?>">
|
||||
<input type="hidden" id="categories_input-<?php echo $tabID; ?>"
|
||||
name="categories" value="" />
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="sub-header">
|
||||
To re-order a category, drag it up or down the list using the <i
|
||||
class="mdi mdi-view-sequential"></i> icon. Click Save Changes at
|
||||
the bottom once finished.
|
||||
</p>
|
||||
<div class="custom-dd dd" id="category_order-<?php echo $tabID; ?>">
|
||||
<ol class="dd-list">
|
||||
<?php foreach ($rMainCategories[$tabID] as $rCategory) { ?>
|
||||
<li class="dd-item dd3-item category-<?php echo $rCategory['id']; ?>"
|
||||
data-id="<?php echo $rCategory['id']; ?>">
|
||||
<div class="dd-handle dd3-handle"></div>
|
||||
<div class="dd3-content">
|
||||
<?php echo $rCategory['category_name']; ?>
|
||||
<?php if ($rCategory['is_adult']) { ?>
|
||||
<i class='text-pink mdi mdi-record'></i>
|
||||
<?php } ?>
|
||||
<span style="float:right;">
|
||||
<?php if (hasPermissions('adv', 'edit_cat')) { ?>
|
||||
<div class="btn-group">
|
||||
<button type="button"
|
||||
onClick="navigate('stream_category?id=<?php echo $rCategory['id']; ?>');"
|
||||
class="btn btn-light waves-effect waves-light sml-button"><i
|
||||
class="mdi mdi-pencil-outline"></i></button>
|
||||
<button type="button"
|
||||
class="btn btn-light waves-effect waves-light sml-button"
|
||||
onClick="deleteCategory(<?php echo $rCategory['id']; ?>)"><i
|
||||
class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0 add-margin-top-20">
|
||||
<li class="list-inline-item float-right">
|
||||
<button type="submit"
|
||||
class="btn btn-primary waves-effect waves-light">Save
|
||||
Changes</button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function importTmdbCategories() {
|
||||
$(".wrapper").fadeOut();
|
||||
$("#status").fadeIn();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "post.php?action=import_tmdb_categories",
|
||||
data: "", // или FormData если нужно передать файлы/данные
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(rReturn) {
|
||||
try {
|
||||
var rJSON = $.parseJSON(rReturn);
|
||||
} catch (e) {
|
||||
var rJSON = {
|
||||
"status": 0,
|
||||
"result": false
|
||||
};
|
||||
}
|
||||
// Вызываем callback и перезагружаем страницу
|
||||
callbackForm(rJSON);
|
||||
window.location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Обработка ошибок с перезагрузкой
|
||||
console.error('Ошибка:', error);
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deleteCategory(rID) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Delete",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to delete this category? All streams attached will be uncategorised.",
|
||||
confirm: function() {
|
||||
$.getJSON("./api?action=category&sub=delete&category_id=" + rID, function(data) {
|
||||
if (data.result === true) {
|
||||
$(".category-" + rID).remove();
|
||||
$.toast("Category successfully deleted.");
|
||||
} else {
|
||||
$.toast("An error occured while processing your request.");
|
||||
}
|
||||
});
|
||||
}
|
||||
}).open();
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$("#category_order-1").nestable({
|
||||
maxDepth: 1
|
||||
});
|
||||
$("#category_order-2").nestable({
|
||||
maxDepth: 1
|
||||
});
|
||||
$("#category_order-3").nestable({
|
||||
maxDepth: 1
|
||||
});
|
||||
$("#category_order-4").nestable({
|
||||
maxDepth: 1
|
||||
});
|
||||
$("#stream_categories_form-1").submit(function(e) {
|
||||
$("#categories_input-1").val(JSON.stringify($('#category_order-1.dd').nestable('serialize')));
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("#stream_categories_form-1")[0]));
|
||||
});
|
||||
$("#stream_categories_form-2").submit(function(e) {
|
||||
$("#categories_input-2").val(JSON.stringify($('#category_order-2.dd').nestable('serialize')));
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("#stream_categories_form-2")[0]));
|
||||
});
|
||||
$("#stream_categories_form-3").submit(function(e) {
|
||||
$("#categories_input-3").val(JSON.stringify($('#category_order-3.dd').nestable('serialize')));
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("#stream_categories_form-3")[0]));
|
||||
});
|
||||
$("#stream_categories_form-4").submit(function(e) {
|
||||
$("#categories_input-4").val(JSON.stringify($('#category_order-4.dd').nestable('serialize')));
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("#stream_categories_form-4")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$rCategories = array(1 => getCategories(), 2 => getCategories('movie'), 3 => getCategories('series'), 4 => getCategories('radio'));
|
||||
$rMainCategories = array(1 => array(), 2 => array(), 3 => array());
|
||||
|
||||
foreach (array(1, 2, 3, 4) as $rID) {
|
||||
foreach ($rCategories[$rID] as $rCategoryID => $rCategoryData) {
|
||||
$rMainCategories[$rID][] = $rCategoryData;
|
||||
}
|
||||
}
|
||||
$_TITLE = 'Stream Categories';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
<?php endif; ?>
|
||||
?>
|
||||
<div class="wrapper boxed-layout" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Categories</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_SUCCESS) { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Your new Category has been added. You can move it up the list to re-order it.
|
||||
</div>
|
||||
<?php } elseif (isset($_STATUS) && $_STATUS == STATUS_SUCCESS_MULTI) { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Categories have been re-ordered.
|
||||
</div>
|
||||
<?php } elseif (isset($_STATUS) && $_STATUS == STATUS_SUCCESS_REPLACE) { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Categories will be added automatically.
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#category-order-1" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-play mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Streams</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#category-order-2" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-movie mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Movies</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#category-order-3" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-youtube-tv mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Series</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#category-order-4" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-radio mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Radio</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<?php foreach (array(1, 2, 3, 4) as $tabID) { ?>
|
||||
<div class="tab-pane" id="category-order-<?php echo $tabID; ?>">
|
||||
<form action="#" method="POST" id="stream_categories_form-<?php echo $tabID; ?>">
|
||||
<input type="hidden" id="categories_input-<?php echo $tabID; ?>"
|
||||
name="categories" value="" />
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="sub-header">
|
||||
To re-order a category, drag it up or down the list using the <i
|
||||
class="mdi mdi-view-sequential"></i> icon. Click Save Changes at
|
||||
the bottom once finished.
|
||||
</p>
|
||||
<div class="custom-dd dd" id="category_order-<?php echo $tabID; ?>">
|
||||
<ol class="dd-list">
|
||||
<?php foreach ($rMainCategories[$tabID] as $rCategory) { ?>
|
||||
<li class="dd-item dd3-item category-<?php echo $rCategory['id']; ?>"
|
||||
data-id="<?php echo $rCategory['id']; ?>">
|
||||
<div class="dd-handle dd3-handle"></div>
|
||||
<div class="dd3-content">
|
||||
<?php echo $rCategory['category_name']; ?>
|
||||
<?php if ($rCategory['is_adult']) { ?>
|
||||
<i class='text-pink mdi mdi-record'></i>
|
||||
<?php } ?>
|
||||
<span style="float:right;">
|
||||
<?php if (hasPermissions('adv', 'edit_cat')) { ?>
|
||||
<div class="btn-group">
|
||||
<button type="button"
|
||||
onClick="navigate('stream_category?id=<?php echo $rCategory['id']; ?>');"
|
||||
class="btn btn-light waves-effect waves-light sml-button"><i
|
||||
class="mdi mdi-pencil-outline"></i></button>
|
||||
<button type="button"
|
||||
class="btn btn-light waves-effect waves-light sml-button"
|
||||
onClick="deleteCategory(<?php echo $rCategory['id']; ?>)"><i
|
||||
class="mdi mdi-close"></i></button>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0 add-margin-top-20">
|
||||
<li class="list-inline-item float-right">
|
||||
<button type="submit"
|
||||
class="btn btn-primary waves-effect waves-light">Save
|
||||
Changes</button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function importTmdbCategories() {
|
||||
$(".wrapper").fadeOut();
|
||||
$("#status").fadeIn();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "post.php?action=import_tmdb_categories",
|
||||
data: "", // или FormData если нужно передать файлы/данные
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(rReturn) {
|
||||
try {
|
||||
var rJSON = $.parseJSON(rReturn);
|
||||
} catch (e) {
|
||||
var rJSON = {
|
||||
"status": 0,
|
||||
"result": false
|
||||
};
|
||||
}
|
||||
// Вызываем callback и перезагружаем страницу
|
||||
callbackForm(rJSON);
|
||||
window.location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Обработка ошибок с перезагрузкой
|
||||
console.error('Ошибка:', error);
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deleteCategory(rID) {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Delete",
|
||||
cancelButton: "Cancel",
|
||||
content: "Are you sure you want to delete this category? All streams attached will be uncategorised.",
|
||||
confirm: function() {
|
||||
$.getJSON("./api?action=category&sub=delete&category_id=" + rID, function(data) {
|
||||
if (data.result === true) {
|
||||
$(".category-" + rID).remove();
|
||||
$.toast("Category successfully deleted.");
|
||||
} else {
|
||||
$.toast("An error occured while processing your request.");
|
||||
}
|
||||
});
|
||||
}
|
||||
}).open();
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$("#category_order-1").nestable({
|
||||
maxDepth: 1
|
||||
});
|
||||
$("#category_order-2").nestable({
|
||||
maxDepth: 1
|
||||
});
|
||||
$("#category_order-3").nestable({
|
||||
maxDepth: 1
|
||||
});
|
||||
$("#category_order-4").nestable({
|
||||
maxDepth: 1
|
||||
});
|
||||
$("#stream_categories_form-1").submit(function(e) {
|
||||
$("#categories_input-1").val(JSON.stringify($('#category_order-1.dd').nestable('serialize')));
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("#stream_categories_form-1")[0]));
|
||||
});
|
||||
$("#stream_categories_form-2").submit(function(e) {
|
||||
$("#categories_input-2").val(JSON.stringify($('#category_order-2.dd').nestable('serialize')));
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("#stream_categories_form-2")[0]));
|
||||
});
|
||||
$("#stream_categories_form-3").submit(function(e) {
|
||||
$("#categories_input-3").val(JSON.stringify($('#category_order-3.dd').nestable('serialize')));
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("#stream_categories_form-3")[0]));
|
||||
});
|
||||
$("#stream_categories_form-4").submit(function(e) {
|
||||
$("#categories_input-4").val(JSON.stringify($('#category_order-4.dd').nestable('serialize')));
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("#stream_categories_form-4")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+328
-322
@@ -1,322 +1,328 @@
|
||||
<?php
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (checkPermissions()) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (!isset(CoreUtilities::$rRequest['id'])) {
|
||||
} else {
|
||||
$rCategoryArr = getCategory(CoreUtilities::$rRequest['id']);
|
||||
|
||||
if ($rCategoryArr && hasPermissions('adv', 'edit_cat')) {
|
||||
} else {
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
$_TITLE = 'Stream Category';
|
||||
include 'header.php'; ?>
|
||||
<div class="wrapper boxed-layout" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else { ?> style="display: none;" <?php } ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">
|
||||
<?php if (isset($rCategoryArr)) {
|
||||
echo 'Edit';
|
||||
} else {
|
||||
echo 'Add';
|
||||
} ?>
|
||||
Category</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST" data-parsley-validate="">
|
||||
<?php if (!isset($rCategoryArr)) {
|
||||
} else { ?>
|
||||
<input type="hidden" name="edit" value="<?= intval($rCategoryArr['id']); ?>" />
|
||||
<input type="hidden" name="cat_order" value="<?= intval($rCategoryArr['cat_order']); ?>" />
|
||||
<?php } ?>
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#category-details" data-toggle="tab"
|
||||
class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-account-card-details-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Details</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php if (!isset($rCategoryArr)) {
|
||||
} else { ?>
|
||||
<li class="nav-item">
|
||||
<a href="#view-channels" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-play mr-1"></i>
|
||||
<span class="d-none d-sm-inline">View Streams</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="category-details">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (!isset($rCategoryArr)) { ?>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="category_type">Category
|
||||
Type</label>
|
||||
<div class="col-md-8">
|
||||
<select name="category_type" id="category_type"
|
||||
class="form-control select2" data-toggle="select2">
|
||||
<?php foreach (array('live' => 'Live TV', 'movie' => 'Movie', 'series' => 'TV Series', 'radio' => 'Radio Station') as $rGroupID => $rGroup) { ?>
|
||||
<option <?php if (!isset($rCategoryArr)) {
|
||||
} else {
|
||||
if ($rCategoryArr['category_type'] == $rGroupID) {
|
||||
echo 'selected ';
|
||||
}
|
||||
} ?> value="<?= $rGroupID; ?>"><?= $rGroup; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="category_type"
|
||||
value="<?= htmlspecialchars($rCategoryArr['category_type']); ?>" />
|
||||
<?php } ?>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="category_name">Category
|
||||
Name</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" id="category_name"
|
||||
name="category_name"
|
||||
value="<?= isset($rCategoryArr) ? htmlspecialchars($rCategoryArr['category_name']) : ''; ?>"
|
||||
required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="is_adult">Adult
|
||||
Content</label>
|
||||
<div class="col-md-2">
|
||||
<input name="is_adult" id="is_adult" type="checkbox" <?php if (!isset($rCategoryArr)) {
|
||||
} else {
|
||||
if ($rCategoryArr['is_adult'] == 1) {
|
||||
echo 'checked ';
|
||||
}
|
||||
} ?>data-plugin="switchery" class="js-switch"
|
||||
data-color="#039cfd" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="submit_category" type="submit" class="btn btn-primary"
|
||||
value="<?php if (isset($rCategoryArr)) {
|
||||
echo 'Edit';
|
||||
} else {
|
||||
echo 'Add';
|
||||
} ?>" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane" id="view-channels">
|
||||
<div class="row">
|
||||
<div class="col-12" style="overflow-x:auto;">
|
||||
<table id="datatable"
|
||||
class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Stream ID</th>
|
||||
<th>Stream Name</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . "\$('select').select2({width: '100%'})" . "\r\n\t\t\t";
|
||||
|
||||
if (!isset($rCategoryArr)) {
|
||||
} else {
|
||||
echo "\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'bAutoWidth: false,' . "\r\n\t\t\t\t" . 'bInfo: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'serverSide: true,' . "\r\n\t\t\t\t" . 'ajax: {' . "\r\n\t\t\t\t\t" . 'url: "./table",' . "\r\n\t\t\t\t\t" . '"data": function(d) {' . "\r\n\t\t\t\t\t\t";
|
||||
|
||||
if ($rCategoryArr['category_type'] == 'live') {
|
||||
echo "\t\t\t\t\t\t" . 'd.id = "streams_short";' . "\r\n\t\t\t\t\t\t";
|
||||
} else {
|
||||
if ($rCategoryArr['category_type'] == 'movie') {
|
||||
echo "\t\t\t\t\t\t" . 'd.id = "movies_short";' . "\r\n\t\t\t\t\t\t";
|
||||
} else {
|
||||
if ($rCategoryArr['category_type'] == 'radio') {
|
||||
echo "\t\t\t\t\t\t" . 'd.id = "radios_short";' . "\r\n\t\t\t\t\t\t";
|
||||
} else {
|
||||
echo "\t\t\t\t\t\t" . 'd.id = "series_short";' . "\r\n\t\t\t\t\t\t";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "\t\t\t\t\t\t" . 'd.category_id = ';
|
||||
echo $rCategoryArr['id'];
|
||||
echo ';' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [0,2]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t";
|
||||
}
|
||||
|
||||
echo ' $("form").submit(function(e){' . "\r\n" . ' e.preventDefault();' . "\r\n" . " \$(':input[type=\"submit\"]').prop('disabled', true);" . "\r\n" . ' submitForm(window.rCurrentPage, new FormData($("form")[0]));' . "\r\n" . ' });' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (checkPermissions()) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (!isset(CoreUtilities::$rRequest['id'])) {
|
||||
} else {
|
||||
$rCategoryArr = getCategory(CoreUtilities::$rRequest['id']);
|
||||
|
||||
if ($rCategoryArr && hasPermissions('adv', 'edit_cat')) {
|
||||
} else {
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
$_TITLE = 'Stream Category';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin'); ?>
|
||||
<?php endif; ?>
|
||||
<div class="wrapper boxed-layout" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else { ?> style="display: none;" <?php } ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">
|
||||
<?php if (isset($rCategoryArr)) {
|
||||
echo 'Edit';
|
||||
} else {
|
||||
echo 'Add';
|
||||
} ?>
|
||||
Category</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="#" method="POST" data-parsley-validate="">
|
||||
<?php if (!isset($rCategoryArr)) {
|
||||
} else { ?>
|
||||
<input type="hidden" name="edit" value="<?= intval($rCategoryArr['id']); ?>" />
|
||||
<input type="hidden" name="cat_order" value="<?= intval($rCategoryArr['cat_order']); ?>" />
|
||||
<?php } ?>
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#category-details" data-toggle="tab"
|
||||
class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-account-card-details-outline mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Details</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php if (!isset($rCategoryArr)) {
|
||||
} else { ?>
|
||||
<li class="nav-item">
|
||||
<a href="#view-channels" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-play mr-1"></i>
|
||||
<span class="d-none d-sm-inline">View Streams</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="category-details">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (!isset($rCategoryArr)) { ?>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="category_type">Category
|
||||
Type</label>
|
||||
<div class="col-md-8">
|
||||
<select name="category_type" id="category_type"
|
||||
class="form-control select2" data-toggle="select2">
|
||||
<?php foreach (array('live' => 'Live TV', 'movie' => 'Movie', 'series' => 'TV Series', 'radio' => 'Radio Station') as $rGroupID => $rGroup) { ?>
|
||||
<option <?php if (!isset($rCategoryArr)) {
|
||||
} else {
|
||||
if ($rCategoryArr['category_type'] == $rGroupID) {
|
||||
echo 'selected ';
|
||||
}
|
||||
} ?> value="<?= $rGroupID; ?>"><?= $rGroup; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="category_type"
|
||||
value="<?= htmlspecialchars($rCategoryArr['category_type']); ?>" />
|
||||
<?php } ?>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="category_name">Category
|
||||
Name</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" id="category_name"
|
||||
name="category_name"
|
||||
value="<?= isset($rCategoryArr) ? htmlspecialchars($rCategoryArr['category_name']) : ''; ?>"
|
||||
required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="is_adult">Adult
|
||||
Content</label>
|
||||
<div class="col-md-2">
|
||||
<input name="is_adult" id="is_adult" type="checkbox" <?php if (!isset($rCategoryArr)) {
|
||||
} else {
|
||||
if ($rCategoryArr['is_adult'] == 1) {
|
||||
echo 'checked ';
|
||||
}
|
||||
} ?>data-plugin="switchery" class="js-switch"
|
||||
data-color="#039cfd" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="submit_category" type="submit" class="btn btn-primary"
|
||||
value="<?php if (isset($rCategoryArr)) {
|
||||
echo 'Edit';
|
||||
} else {
|
||||
echo 'Add';
|
||||
} ?>" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane" id="view-channels">
|
||||
<div class="row">
|
||||
<div class="col-12" style="overflow-x:auto;">
|
||||
<table id="datatable"
|
||||
class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Stream ID</th>
|
||||
<th>Stream Name</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . "\$('select').select2({width: '100%'})" . "\r\n\t\t\t";
|
||||
|
||||
if (!isset($rCategoryArr)) {
|
||||
} else {
|
||||
echo "\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'bAutoWidth: false,' . "\r\n\t\t\t\t" . 'bInfo: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'serverSide: true,' . "\r\n\t\t\t\t" . 'ajax: {' . "\r\n\t\t\t\t\t" . 'url: "./table",' . "\r\n\t\t\t\t\t" . '"data": function(d) {' . "\r\n\t\t\t\t\t\t";
|
||||
|
||||
if ($rCategoryArr['category_type'] == 'live') {
|
||||
echo "\t\t\t\t\t\t" . 'd.id = "streams_short";' . "\r\n\t\t\t\t\t\t";
|
||||
} else {
|
||||
if ($rCategoryArr['category_type'] == 'movie') {
|
||||
echo "\t\t\t\t\t\t" . 'd.id = "movies_short";' . "\r\n\t\t\t\t\t\t";
|
||||
} else {
|
||||
if ($rCategoryArr['category_type'] == 'radio') {
|
||||
echo "\t\t\t\t\t\t" . 'd.id = "radios_short";' . "\r\n\t\t\t\t\t\t";
|
||||
} else {
|
||||
echo "\t\t\t\t\t\t" . 'd.id = "series_short";' . "\r\n\t\t\t\t\t\t";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "\t\t\t\t\t\t" . 'd.category_id = ';
|
||||
echo $rCategoryArr['id'];
|
||||
echo ';' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [0,2]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t";
|
||||
}
|
||||
|
||||
echo ' $("form").submit(function(e){' . "\r\n" . ' e.preventDefault();' . "\r\n" . " \$(':input[type=\"submit\"]').prop('disabled', true);" . "\r\n" . ' submitForm(window.rCurrentPage, new FormData($("form")[0]));' . "\r\n" . ' });' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+350
-344
@@ -1,344 +1,350 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Stream Errors';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper"
|
||||
<?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Stream Logs</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<div class="form-group row mb-4">
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" id="log_search" value=""
|
||||
placeholder="Search Logs...">
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center" for="reseller">Server</label>
|
||||
<div class="col-md-3">
|
||||
<select id="reseller" class="form-control" data-toggle="select2">
|
||||
<option value="" selected>All Servers</option>
|
||||
<?php foreach (getStreamingServers() as $rServer) { ?>
|
||||
<option value="<?= intval($rServer['id']); ?>"><?= $rServer['server_name']; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center" for="range">Dates</label>
|
||||
<div class="col-md-2">
|
||||
<input type="text" class="form-control text-center date" id="range" name="range"
|
||||
data-toggle="date-picker" data-single-date-picker="true" autocomplete="off"
|
||||
placeholder="All Dates">
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center" for="show_entries">Show</label>
|
||||
<div class="col-md-1">
|
||||
<select id="show_entries" class="form-control" data-toggle="select2">
|
||||
<?php foreach (array(10, 25, 50, 250, 500, 1000) as $rShow) { ?>
|
||||
<option<?php if ($rSettings['default_entries'] == $rShow) {
|
||||
echo ' selected';
|
||||
} ?>
|
||||
value="<?= $rShow; ?>"><?= $rShow; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<table id="datatable-activity"
|
||||
class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<th>Stream</th>
|
||||
<th>Server</th>
|
||||
<th>Error</th>
|
||||
<th class="text-center">Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function getServer() {
|
||||
return $("#server").val();
|
||||
}
|
||||
|
||||
function getRange() {
|
||||
return $("#range").val();
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('select').select2({
|
||||
width: '100%'
|
||||
});
|
||||
$('#range').daterangepicker({
|
||||
singleDatePicker: false,
|
||||
showDropdowns: true,
|
||||
locale: {
|
||||
format: 'YYYY-MM-DD'
|
||||
},
|
||||
autoUpdateInput: false
|
||||
}).val("");
|
||||
$('#range').on('apply.daterangepicker', function(ev, picker) {
|
||||
$(this).val(picker.startDate.format('YYYY-MM-DD') + ' - ' + picker.endDate.format('YYYY-MM-DD'));
|
||||
$("#datatable-activity").DataTable().ajax.reload(null, false);
|
||||
});
|
||||
$('#range').on('cancel.daterangepicker', function(ev, picker) {
|
||||
$(this).val('');
|
||||
$("#datatable-activity").DataTable().ajax.reload(null, false);
|
||||
});
|
||||
$('#range').on('change', function() {
|
||||
$("#datatable-activity").DataTable().ajax.reload(null, false);
|
||||
});
|
||||
$('#range_clear_to').daterangepicker({
|
||||
singleDatePicker: true,
|
||||
showDropdowns: true,
|
||||
locale: {
|
||||
format: 'YYYY-MM-DD'
|
||||
},
|
||||
autoUpdateInput: false
|
||||
}).val("");
|
||||
$('#range_clear_from').daterangepicker({
|
||||
singleDatePicker: true,
|
||||
showDropdowns: true,
|
||||
locale: {
|
||||
format: 'YYYY-MM-DD'
|
||||
},
|
||||
autoUpdateInput: false
|
||||
}).val("");
|
||||
$('#range_clear_from').on('apply.daterangepicker', function(ev, picker) {
|
||||
$(this).val(picker.startDate.format('YYYY-MM-DD'));
|
||||
});
|
||||
$('#range_clear_from').on('cancel.daterangepicker', function(ev, picker) {
|
||||
$(this).val('');
|
||||
});
|
||||
$('#range_clear_to').on('apply.daterangepicker', function(ev, picker) {
|
||||
$(this).val(picker.startDate.format('YYYY-MM-DD'));
|
||||
});
|
||||
$('#range_clear_to').on('cancel.daterangepicker', function(ev, picker) {
|
||||
$(this).val('');
|
||||
});
|
||||
$("#btn-clear-logs").click(function() {
|
||||
$(".bs-logs-modal-center").modal("show");
|
||||
});
|
||||
$("#clear_logs").click(function() {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Delete",
|
||||
cancelButton: "Cancel",
|
||||
content: "<?php echo $language::get('clear_confirm'); ?>",
|
||||
confirm: function() {
|
||||
$(".bs-logs-modal-center").modal("hide");
|
||||
$.getJSON("./api?action=clear_logs&type=streams_errors&from=" + encodeURIComponent($("#range_clear_from").val()) + "&to=" + encodeURIComponent($("#range_clear_to").val()), function(data) {
|
||||
$.toast("Logs have been cleared.");
|
||||
$("#datatable-activity").DataTable().ajax.reload(null, false);
|
||||
});
|
||||
}
|
||||
}).open();
|
||||
});
|
||||
$("#datatable-activity").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
},
|
||||
infoFiltered: ""
|
||||
},
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
responsive: false,
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "./table",
|
||||
"data": function(d) {
|
||||
d.id = "stream_errors",
|
||||
d.range = getRange(),
|
||||
d.server = getServer()
|
||||
}
|
||||
},
|
||||
columnDefs: [{
|
||||
"className": "dt-center",
|
||||
"targets": [0, 4]
|
||||
}],
|
||||
"order": [
|
||||
[0, "desc"]
|
||||
],
|
||||
pageLength: <?php echo (intval($rSettings['default_entries']) ?: 10); ?>
|
||||
});
|
||||
$("#datatable-activity").css("width", "100%");
|
||||
$('#log_search').keyup(function() {
|
||||
$('#datatable-activity').DataTable().search($(this).val()).draw();
|
||||
})
|
||||
$('#show_entries').change(function() {
|
||||
$('#datatable-activity').DataTable().page.len($(this).val()).draw();
|
||||
})
|
||||
$('#server').change(function() {
|
||||
$("#datatable-activity").DataTable().ajax.reload(null, false);
|
||||
})
|
||||
$("#btn-export-csv").click(function() {
|
||||
$.toast("Generating CSV report...");
|
||||
window.location.href = "api?action=report¶ms=" + encodeURIComponent(JSON.stringify($("#datatable-activity").DataTable().ajax.params()));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Stream Errors';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
<?php endif; ?>
|
||||
?>
|
||||
<div class="wrapper"
|
||||
<?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Stream Logs</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<div class="form-group row mb-4">
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" id="log_search" value=""
|
||||
placeholder="Search Logs...">
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center" for="reseller">Server</label>
|
||||
<div class="col-md-3">
|
||||
<select id="reseller" class="form-control" data-toggle="select2">
|
||||
<option value="" selected>All Servers</option>
|
||||
<?php foreach (getStreamingServers() as $rServer) { ?>
|
||||
<option value="<?= intval($rServer['id']); ?>"><?= $rServer['server_name']; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center" for="range">Dates</label>
|
||||
<div class="col-md-2">
|
||||
<input type="text" class="form-control text-center date" id="range" name="range"
|
||||
data-toggle="date-picker" data-single-date-picker="true" autocomplete="off"
|
||||
placeholder="All Dates">
|
||||
</div>
|
||||
<label class="col-md-1 col-form-label text-center" for="show_entries">Show</label>
|
||||
<div class="col-md-1">
|
||||
<select id="show_entries" class="form-control" data-toggle="select2">
|
||||
<?php foreach (array(10, 25, 50, 250, 500, 1000) as $rShow) { ?>
|
||||
<option<?php if ($rSettings['default_entries'] == $rShow) {
|
||||
echo ' selected';
|
||||
} ?>
|
||||
value="<?= $rShow; ?>"><?= $rShow; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<table id="datatable-activity"
|
||||
class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<th>Stream</th>
|
||||
<th>Server</th>
|
||||
<th>Error</th>
|
||||
<th class="text-center">Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function getServer() {
|
||||
return $("#server").val();
|
||||
}
|
||||
|
||||
function getRange() {
|
||||
return $("#range").val();
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('select').select2({
|
||||
width: '100%'
|
||||
});
|
||||
$('#range').daterangepicker({
|
||||
singleDatePicker: false,
|
||||
showDropdowns: true,
|
||||
locale: {
|
||||
format: 'YYYY-MM-DD'
|
||||
},
|
||||
autoUpdateInput: false
|
||||
}).val("");
|
||||
$('#range').on('apply.daterangepicker', function(ev, picker) {
|
||||
$(this).val(picker.startDate.format('YYYY-MM-DD') + ' - ' + picker.endDate.format('YYYY-MM-DD'));
|
||||
$("#datatable-activity").DataTable().ajax.reload(null, false);
|
||||
});
|
||||
$('#range').on('cancel.daterangepicker', function(ev, picker) {
|
||||
$(this).val('');
|
||||
$("#datatable-activity").DataTable().ajax.reload(null, false);
|
||||
});
|
||||
$('#range').on('change', function() {
|
||||
$("#datatable-activity").DataTable().ajax.reload(null, false);
|
||||
});
|
||||
$('#range_clear_to').daterangepicker({
|
||||
singleDatePicker: true,
|
||||
showDropdowns: true,
|
||||
locale: {
|
||||
format: 'YYYY-MM-DD'
|
||||
},
|
||||
autoUpdateInput: false
|
||||
}).val("");
|
||||
$('#range_clear_from').daterangepicker({
|
||||
singleDatePicker: true,
|
||||
showDropdowns: true,
|
||||
locale: {
|
||||
format: 'YYYY-MM-DD'
|
||||
},
|
||||
autoUpdateInput: false
|
||||
}).val("");
|
||||
$('#range_clear_from').on('apply.daterangepicker', function(ev, picker) {
|
||||
$(this).val(picker.startDate.format('YYYY-MM-DD'));
|
||||
});
|
||||
$('#range_clear_from').on('cancel.daterangepicker', function(ev, picker) {
|
||||
$(this).val('');
|
||||
});
|
||||
$('#range_clear_to').on('apply.daterangepicker', function(ev, picker) {
|
||||
$(this).val(picker.startDate.format('YYYY-MM-DD'));
|
||||
});
|
||||
$('#range_clear_to').on('cancel.daterangepicker', function(ev, picker) {
|
||||
$(this).val('');
|
||||
});
|
||||
$("#btn-clear-logs").click(function() {
|
||||
$(".bs-logs-modal-center").modal("show");
|
||||
});
|
||||
$("#clear_logs").click(function() {
|
||||
new jBox("Confirm", {
|
||||
confirmButton: "Delete",
|
||||
cancelButton: "Cancel",
|
||||
content: "<?php echo $language::get('clear_confirm'); ?>",
|
||||
confirm: function() {
|
||||
$(".bs-logs-modal-center").modal("hide");
|
||||
$.getJSON("./api?action=clear_logs&type=streams_errors&from=" + encodeURIComponent($("#range_clear_from").val()) + "&to=" + encodeURIComponent($("#range_clear_to").val()), function(data) {
|
||||
$.toast("Logs have been cleared.");
|
||||
$("#datatable-activity").DataTable().ajax.reload(null, false);
|
||||
});
|
||||
}
|
||||
}).open();
|
||||
});
|
||||
$("#datatable-activity").DataTable({
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
},
|
||||
infoFiltered: ""
|
||||
},
|
||||
drawCallback: function() {
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
},
|
||||
responsive: false,
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "./table",
|
||||
"data": function(d) {
|
||||
d.id = "stream_errors",
|
||||
d.range = getRange(),
|
||||
d.server = getServer()
|
||||
}
|
||||
},
|
||||
columnDefs: [{
|
||||
"className": "dt-center",
|
||||
"targets": [0, 4]
|
||||
}],
|
||||
"order": [
|
||||
[0, "desc"]
|
||||
],
|
||||
pageLength: <?php echo (intval($rSettings['default_entries']) ?: 10); ?>
|
||||
});
|
||||
$("#datatable-activity").css("width", "100%");
|
||||
$('#log_search').keyup(function() {
|
||||
$('#datatable-activity').DataTable().search($(this).val()).draw();
|
||||
})
|
||||
$('#show_entries').change(function() {
|
||||
$('#datatable-activity').DataTable().page.len($(this).val()).draw();
|
||||
})
|
||||
$('#server').change(function() {
|
||||
$("#datatable-activity").DataTable().ajax.reload(null, false);
|
||||
})
|
||||
$("#btn-export-csv").click(function() {
|
||||
$.toast("Generating CSV report...");
|
||||
window.location.href = "api?action=report¶ms=" + encodeURIComponent(JSON.stringify($("#datatable-activity").DataTable().ajax.params()));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
@@ -17,7 +18,9 @@ foreach ($rServers as $rServer) {
|
||||
$rServerTree[] = array('id' => intval($rServer['id']), 'parent' => 'offline', 'text' => htmlspecialchars($rServer['server_name']), 'icon' => 'mdi mdi-server-network', 'state' => array('opened' => true));
|
||||
}
|
||||
$_TITLE = 'Mass Edit Streams';
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
endif;
|
||||
echo '<div class="wrapper boxed-layout-xl"';
|
||||
|
||||
if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
@@ -187,7 +190,10 @@ foreach (array('Disabled', 'FFMPEG', 'PHP') as $rValue => $rText) {
|
||||
echo '</option>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
|
||||
}
|
||||
echo "\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</select>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' <label class="col-md-3 col-form-label" for="tv_archive_duration">Timeshift Days</label>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-md-2">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input disabled type="text" class="form-control text-center" id="tv_archive_duration" name="tv_archive_duration" value="0" />' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' <div class="checkbox checkbox-single col-md-1 checkbox-offset checkbox-primary text-center">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input type="checkbox" class="activate" data-name="tv_archive_duration" name="c_tv_archive_duration">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<label></label>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' <div class="form-group row mb-4">' . "\n" . ' <div class="col-md-1"></div>' . "\n" . ' <label class="col-md-3 col-form-label" for="restart_on_edit">Restart on Edit</label>' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<div class="col-md-2">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<input name="restart_on_edit" id="restart_on_edit" type="checkbox" data-plugin="switchery" class="js-switch" data-color="#039cfd" />' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' </div>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t\t\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t\t\t\t\t\t\t" . '<ul class="list-inline wizard mb-0">' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<li class="prevb list-inline-item">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<a href="javascript: void(0);" class="btn btn-secondary">Previous</a>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '</li>' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '<li class="nextb list-inline-item float-right">' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '<input name="submit_stream" type="submit" class="btn btn-primary" value="Edit Streams" />' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '</li>' . "\n\t\t\t\t\t\t\t\t\t\t" . '</ul>' . "\n\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t\t\t" . '</form>' . "\n\t\t\t\t\t" . '</div> ' . "\n\t\t\t\t" . '</div> ' . "\n\t\t\t" . '</div> ' . "\n\t\t" . '</div>' . "\n\t" . '</div>' . "\n" . '</div>' . "\n";
|
||||
include 'footer.php'; ?>
|
||||
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
+257
-251
@@ -1,251 +1,257 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (checkPermissions()) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$rStreamTypes = array(1 => 'Live Stream', 2 => 'Movie', 3 => 'Created Channel', 4 => 'Radio Station', 5 => 'Episode');
|
||||
$rPeriod = (CoreUtilities::$rRequest['period'] ?: 'all');
|
||||
$db->query('SELECT `streams_stats`.*, `streams`.`stream_display_name` FROM `streams_stats` INNER JOIN `streams` ON `streams`.`id` = `streams_stats`.`stream_id` WHERE `streams_stats`.`type` = ? AND `streams`.`type` IN (1,3) GROUP BY `stream_id` ORDER BY `streams_stats`.`rank` ASC LIMIT 500;', $rPeriod);
|
||||
$rRows = $db->get_rows();
|
||||
$_TITLE = 'Stream Rank';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout-ext"
|
||||
<?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else { ?>
|
||||
style="display: none;" <?php } ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Stream Rank</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<div class="form-group row mb-4">
|
||||
<div class="col-md-7">
|
||||
<input type="text" class="form-control" id="log_search" value=""
|
||||
placeholder="Search Logs...">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<select id="period" class="form-control" data-toggle="select2">
|
||||
<option value="today" <?php if ($rPeriod == 'today') { ?> selected<?php } ?>>Today
|
||||
</option>
|
||||
<option value="week" <?php if ($rPeriod == 'week') { ?> selected<?php } ?>>This Week
|
||||
</option>
|
||||
<option value="month" <?php if ($rPeriod == 'month') { ?> selected<?php } ?>>This
|
||||
Month</option>
|
||||
<option value="all" <?php if ($rPeriod == 'all') { ?> selected<?php } ?>>All Time
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select id="show_entries" class="form-control" data-toggle="select2">
|
||||
<?php foreach (array(10, 25, 50, 250, 500, 1000) as $rShow) { ?>
|
||||
<option<?php if ($rSettings['default_entries'] == $rShow) { ?> selected<?php } ?>
|
||||
value="<?php echo $rShow; ?>"><?php echo $rShow; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<table id="datatable-activity"
|
||||
class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Rank #</th>
|
||||
<th>Stream Name</th>
|
||||
<th class="text-center">Time Watched</th>
|
||||
<th class="text-center">Total Connections</th>
|
||||
<th class="text-center">Total Users</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $i = 0;
|
||||
foreach ($rRows as $rRow) {
|
||||
$i++;
|
||||
$rTime = $rRow['time'];
|
||||
if (86400 <= $rTime) {
|
||||
$rTime = sprintf('%02dd %02dh %02dm', $rTime / 86400, ($rTime / 3600) % 24, ($rTime / 60) % 60);
|
||||
} else {
|
||||
$rTime = sprintf('%02dh %02dm %02ds', $rTime / 3600, ($rTime / 60) % 60, $rTime % 60);
|
||||
} ?>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo $i; ?></td>
|
||||
<td><a
|
||||
href="stream_view?id=<?php echo intval($rRow['id']); ?>"><?php echo $rRow['stream_display_name']; ?></a>
|
||||
</td>
|
||||
<td class="text-center"><button type='button'
|
||||
class='btn btn-light btn-xs waves-effect waves-light btn-fixed'><?php echo $rTime; ?></button>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button type='button'
|
||||
class='btn btn-light btn-xs waves-effect waves-light btn-fixed'><?php echo number_format($rRow['connections'], 0); ?></button>
|
||||
</td>
|
||||
<td class="text-center"><button type='button'
|
||||
class='btn btn-light btn-xs waves-effect waves-light btn-fixed'><?php echo number_format($rRow['users'], 0); ?></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . "\$('select').select2({width: '100%'});" . "\r\n\t\t\t" . "\$('#period').on('change', function() {" . "\r\n\t\t\t\t" . "navigate(\"stream_rank?period=\" + \$('#period').val());" . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . 'var rTable = $("#datatable-activity").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '},' . "\r\n\t\t\t\t\t" . 'infoFiltered: ""' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [0,2,3,4]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t\t" . '"order": [[ 0, "asc" ]],' . "\r\n\t\t\t\t" . 'pageLength: ';
|
||||
echo (intval($rSettings['default_entries']) ?: 10);
|
||||
echo "\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable-activity").css("width", "100%");' . "\r\n" . " \$('#log_search').keyup(function(){" . "\r\n\t\t\t\t" . 'rTable.search($(this).val()).draw();' . "\r\n\t\t\t" . '});' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (checkPermissions()) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$rStreamTypes = array(1 => 'Live Stream', 2 => 'Movie', 3 => 'Created Channel', 4 => 'Radio Station', 5 => 'Episode');
|
||||
$rPeriod = (CoreUtilities::$rRequest['period'] ?: 'all');
|
||||
$db->query('SELECT `streams_stats`.*, `streams`.`stream_display_name` FROM `streams_stats` INNER JOIN `streams` ON `streams`.`id` = `streams_stats`.`stream_id` WHERE `streams_stats`.`type` = ? AND `streams`.`type` IN (1,3) GROUP BY `stream_id` ORDER BY `streams_stats`.`rank` ASC LIMIT 500;', $rPeriod);
|
||||
$rRows = $db->get_rows();
|
||||
$_TITLE = 'Stream Rank';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
<?php endif; ?>
|
||||
?>
|
||||
<div class="wrapper boxed-layout-ext"
|
||||
<?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else { ?>
|
||||
style="display: none;" <?php } ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Stream Rank</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" style="overflow-x:auto;">
|
||||
<div class="form-group row mb-4">
|
||||
<div class="col-md-7">
|
||||
<input type="text" class="form-control" id="log_search" value=""
|
||||
placeholder="Search Logs...">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<select id="period" class="form-control" data-toggle="select2">
|
||||
<option value="today" <?php if ($rPeriod == 'today') { ?> selected<?php } ?>>Today
|
||||
</option>
|
||||
<option value="week" <?php if ($rPeriod == 'week') { ?> selected<?php } ?>>This Week
|
||||
</option>
|
||||
<option value="month" <?php if ($rPeriod == 'month') { ?> selected<?php } ?>>This
|
||||
Month</option>
|
||||
<option value="all" <?php if ($rPeriod == 'all') { ?> selected<?php } ?>>All Time
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select id="show_entries" class="form-control" data-toggle="select2">
|
||||
<?php foreach (array(10, 25, 50, 250, 500, 1000) as $rShow) { ?>
|
||||
<option<?php if ($rSettings['default_entries'] == $rShow) { ?> selected<?php } ?>
|
||||
value="<?php echo $rShow; ?>"><?php echo $rShow; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<table id="datatable-activity"
|
||||
class="table table-striped table-borderless dt-responsive nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Rank #</th>
|
||||
<th>Stream Name</th>
|
||||
<th class="text-center">Time Watched</th>
|
||||
<th class="text-center">Total Connections</th>
|
||||
<th class="text-center">Total Users</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $i = 0;
|
||||
foreach ($rRows as $rRow) {
|
||||
$i++;
|
||||
$rTime = $rRow['time'];
|
||||
if (86400 <= $rTime) {
|
||||
$rTime = sprintf('%02dd %02dh %02dm', $rTime / 86400, ($rTime / 3600) % 24, ($rTime / 60) % 60);
|
||||
} else {
|
||||
$rTime = sprintf('%02dh %02dm %02ds', $rTime / 3600, ($rTime / 60) % 60, $rTime % 60);
|
||||
} ?>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo $i; ?></td>
|
||||
<td><a
|
||||
href="stream_view?id=<?php echo intval($rRow['id']); ?>"><?php echo $rRow['stream_display_name']; ?></a>
|
||||
</td>
|
||||
<td class="text-center"><button type='button'
|
||||
class='btn btn-light btn-xs waves-effect waves-light btn-fixed'><?php echo $rTime; ?></button>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button type='button'
|
||||
class='btn btn-light btn-xs waves-effect waves-light btn-fixed'><?php echo number_format($rRow['connections'], 0); ?></button>
|
||||
</td>
|
||||
<td class="text-center"><button type='button'
|
||||
class='btn btn-light btn-xs waves-effect waves-light btn-fixed'><?php echo number_format($rRow['users'], 0); ?></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo "\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . "\$('select').select2({width: '100%'});" . "\r\n\t\t\t" . "\$('#period').on('change', function() {" . "\r\n\t\t\t\t" . "navigate(\"stream_rank?period=\" + \$('#period').val());" . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . 'var rTable = $("#datatable-activity").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '},' . "\r\n\t\t\t\t\t" . 'infoFiltered: ""' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [0,2,3,4]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t\t" . '"order": [[ 0, "asc" ]],' . "\r\n\t\t\t\t" . 'pageLength: ';
|
||||
echo (intval($rSettings['default_entries']) ?: 10);
|
||||
echo "\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable-activity").css("width", "100%");' . "\r\n" . " \$('#log_search').keyup(function(){" . "\r\n\t\t\t\t" . 'rTable.search($(this).val()).draw();' . "\r\n\t\t\t" . '});' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+450
-444
@@ -1,444 +1,450 @@
|
||||
<?php
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (checkPermissions()) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['save_changes'])) {
|
||||
$rChanges = array();
|
||||
|
||||
foreach (array_keys(CoreUtilities::$rRequest) as $rKey) {
|
||||
$rSplit = explode('_', $rKey);
|
||||
|
||||
if (!($rSplit[0] == 'modified' && CoreUtilities::$rRequest[$rKey] == 1)) {
|
||||
} else {
|
||||
$rID = intval($rSplit[1]);
|
||||
$rChanges[$rID] = array();
|
||||
|
||||
foreach (array('name', 'channel_id', 'epg_id') as $rChangeKey) {
|
||||
$rChanges[$rID][$rChangeKey] = CoreUtilities::$rRequest[$rChangeKey . '_' . $rID];
|
||||
}
|
||||
|
||||
foreach (array('bouquets', 'categories') as $rChangeKey) {
|
||||
$rChanges[$rID][$rChangeKey] = json_decode(CoreUtilities::$rRequest[$rChangeKey . '_' . $rID], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($rChanges as $rID => $rStream) {
|
||||
if (!CoreUtilities::$rRequest['save_bouquets']) {
|
||||
} else {
|
||||
$rHasBouquets = array();
|
||||
|
||||
foreach (CoreUtilities::$rBouquets as $rBouquetID => $rBouquet) {
|
||||
if (!(in_array($rID, $rBouquet['streams']) || in_array($rID, $rBouquet['channels']))) {
|
||||
} else {
|
||||
$rHasBouquets[] = $rBouquetID;
|
||||
}
|
||||
}
|
||||
$rDelBouquet = $rAddBouquet = array();
|
||||
|
||||
foreach ($rHasBouquets as $rBouquetID) {
|
||||
if (in_array($rBouquetID, $rStream['bouquets'])) {
|
||||
} else {
|
||||
removeFromBouquet('stream', $rBouquetID, $rID);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($rStream['bouquets'] as $rBouquetID) {
|
||||
if (in_array($rBouquetID, $rHasBouquets)) {
|
||||
} else {
|
||||
$rAddBouquet[] = $rBouquetID;
|
||||
addToBouquet('stream', $rBouquetID, $rID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (CoreUtilities::$rRequest['save_categories'] && CoreUtilities::$rRequest['save_epg']) {
|
||||
$db->query('UPDATE `streams` SET `stream_display_name` = ?, `category_id` = ?, `channel_id` = ?, `epg_id` = ? WHERE `id` = ?;', $rStream['name'], '[' . implode(',', array_map('intval', $rStream['categories'])) . ']', ($rStream['channel_id'] ?: null), (is_null($rStream['epg_id']) ? null : $rStream['epg_id']), $rID);
|
||||
} else {
|
||||
if (CoreUtilities::$rRequest['save_categories']) {
|
||||
$db->query('UPDATE `streams` SET `stream_display_name` = ?, `category_id` = ? WHERE `id` = ?;', $rStream['name'], '[' . implode(',', array_map('intval', $rStream['categories'])) . ']', $rID);
|
||||
} else {
|
||||
if (CoreUtilities::$rRequest['save_epg']) {
|
||||
$db->query('UPDATE `streams` SET `stream_display_name` = ?, `channel_id` = ?, `epg_id` = ?, WHERE `id` = ?;', $rStream['name'], ($rStream['channel_id'] ?: null), (is_null($rStream['epg_id']) ? null : $rStream['epg_id']), $rID);
|
||||
} else {
|
||||
$db->query('UPDATE `streams` SET `stream_display_name` = ? WHERE `id` = ?;', $rStream['name'], $rID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
header('Location: ./streams?status=' . STATUS_SUCCESS);
|
||||
|
||||
exit();
|
||||
} else {
|
||||
if (!isset(CoreUtilities::$rRequest['streams'])) {
|
||||
} else {
|
||||
$rStreams = json_decode(CoreUtilities::$rRequest['streams'], true);
|
||||
$rCategories = getCategories('live');
|
||||
$rBouquets = getBouquets();
|
||||
$rStreamBouquets = array();
|
||||
foreach ($rBouquets as $rBouquet) {
|
||||
$rBouquetChannels = json_decode($rBouquet['bouquet_channels'], true);
|
||||
|
||||
foreach ($rBouquetChannels as $rStreamID) {
|
||||
if (!in_array($rStreamID, $rStreams)) {
|
||||
} else {
|
||||
$rStreamBouquets[$rStreamID][] = $rBouquet['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$rOptions = array('categories' => isset(CoreUtilities::$rRequest['edit_categories']), 'epg' => isset(CoreUtilities::$rRequest['edit_epg']), 'bouquets' => isset(CoreUtilities::$rRequest['edit_bouquets']));
|
||||
$rWidth = array(25, 20, 20);
|
||||
|
||||
if ($rOptions['categories'] || $rOptions['bouquets'] || $rOptions['epg']) {
|
||||
} else {
|
||||
$rWidth = array(90, 0, 0);
|
||||
}
|
||||
|
||||
$rImport = array();
|
||||
|
||||
if (0 >= count($rStreams)) {
|
||||
} else {
|
||||
$db->query('SELECT * FROM `streams` WHERE `id` IN (' . implode(',', array_map('intval', $rStreams)) . ');');
|
||||
|
||||
foreach ($db->get_rows() as $rRow) {
|
||||
$rImport[] = array('id' => $rRow['id'], 'channel_id' => ($rRow['channel_id'] ?: ''), 'epg_id' => ($rRow['epg_id'] ?: ''), 'title' => ($rRow['stream_display_name'] ?: ''), 'category' => json_decode($rRow['category_id'], true), 'bouquets' => ($rStreamBouquets[$rRow['id']] ?: array()));
|
||||
}
|
||||
}
|
||||
|
||||
if (count($rImport) != 0) {
|
||||
} else {
|
||||
$_STATUS = STATUS_NO_SOURCES;
|
||||
$rImport = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
$_TITLE = 'Review';
|
||||
include 'header.php';
|
||||
?>
|
||||
|
||||
<div class="wrapper<?= $rImport ? '' : ' boxed-layout-ext' ?>"
|
||||
<?= empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest' ? '' : ' style="display: none;"' ?>>
|
||||
<div class="container-fluid">
|
||||
<form action="./stream_review" method="POST" id="stream_form" data-parsley-validate="">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Mass Edit & Review <small id="selected_count"></small></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_NO_SOURCES): ?>
|
||||
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
No streams were selected for review.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php if (isset($rImport)): ?>
|
||||
<input type="hidden" name="save_changes" value="1" />
|
||||
<input type="hidden" name="save_categories"
|
||||
value="<?= intval($rOptions['categories']) ?>" />
|
||||
<input type="hidden" name="save_bouquets" value="<?= intval($rOptions['bouquets']) ?>" />
|
||||
<input type="hidden" name="save_epg" value="<?= intval($rOptions['epg']) ?>" />
|
||||
<?php
|
||||
foreach ($rImport as $rStream) {
|
||||
include 'stream_import_logic.php';
|
||||
}
|
||||
?>
|
||||
<?php else: ?>
|
||||
<input type="hidden" name="streams" id="streams" value="" />
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#stream-selection" data-toggle="tab"
|
||||
class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-play mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Stream Selection</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="stream-selection">
|
||||
<div class="row" style="margin-bottom: 40px;">
|
||||
<label class="col-md-2 col-form-label" for="edit_categories">Edit
|
||||
Categories</label>
|
||||
<div class="col-md-2">
|
||||
<input name="edit_categories" id="edit_categories" type="checkbox"
|
||||
checked data-plugin="switchery" class="js-switch"
|
||||
data-color="#039cfd" />
|
||||
</div>
|
||||
<label class="col-md-2 col-form-label" for="edit_bouquets">Edit
|
||||
Bouquets</label>
|
||||
<div class="col-md-2">
|
||||
<input name="edit_bouquets" id="edit_bouquets" type="checkbox" checked
|
||||
data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
<label class="col-md-2 col-form-label" for="edit_epg">Edit EPG</label>
|
||||
<div class="col-md-2">
|
||||
<input name="edit_epg" id="edit_epg" type="checkbox" checked
|
||||
data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-6">
|
||||
<input type="text" class="form-control" id="stream_search" value=""
|
||||
placeholder="Search Streams...">
|
||||
</div>
|
||||
<div class="col-md-3 col-6">
|
||||
<select id="category_search" class="form-control" data-toggle="select2">
|
||||
<option value="" selected>All Categories</option>
|
||||
<?php foreach (getCategories('live') as $rCategory): ?>
|
||||
<option value="<?= intval($rCategory['id']) ?>"
|
||||
<?= isset(CoreUtilities::$rRequest['category']) && CoreUtilities::$rRequest['category'] == $rCategory['id'] ? ' selected' : '' ?>>
|
||||
<?= htmlspecialchars($rCategory['category_name']) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3 col-6">
|
||||
<select id="stream_filter" class="form-control" data-toggle="select2">
|
||||
<option value="">No Filter</option>
|
||||
<option value="1">Online</option>
|
||||
<option value="2">Down</option>
|
||||
<option value="3">Stopped</option>
|
||||
<option value="4">Starting</option>
|
||||
<option value="5">On Demand</option>
|
||||
<option value="6">Direct</option>
|
||||
<option value="7">Timeshift</option>
|
||||
<option value="8">Looping</option>
|
||||
<option value="9">Has EPG</option>
|
||||
<option value="10">No EPG</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2 col-8">
|
||||
<select id="show_entries" class="form-control" data-toggle="select2">
|
||||
<?php foreach (array(10, 25, 50, 250, 500, 1000) as $rShow): ?>
|
||||
<option
|
||||
<?= $rSettings['default_entries'] == $rShow ? ' selected' : '' ?>
|
||||
value="<?= $rShow ?>">
|
||||
<?= $rShow ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-1 col-2">
|
||||
<button type="button" class="btn btn-info waves-effect waves-light"
|
||||
onClick="toggleStreams()">
|
||||
<i class="mdi mdi-selection"></i>
|
||||
</button>
|
||||
</div>
|
||||
<table id="datatable-mass" class="table table-borderless mb-0">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<th>Stream Name</th>
|
||||
<th>Category</th>
|
||||
<th class="text-center">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n" . ' var rPages = [];' . "\r\n" . ' var rData = [];' . "\r\n" . ' var rSelected = [];' . "\r\n\r\n\t\t" . 'function getCategory() {' . "\r\n\t\t\t" . 'return $("#category_search").val();' . "\r\n\t\t" . '}' . "\r\n" . ' function getFilter() {' . "\r\n\t\t\t" . 'return $("#stream_filter").val();' . "\r\n\t\t" . '}' . "\r\n\t\t" . 'function toggleStreams() {' . "\r\n\t\t\t" . '$("#datatable-mass tr").each(function() {' . "\r\n\t\t\t\t" . "if (\$(this).hasClass('selected')) {" . "\r\n\t\t\t\t\t" . "\$(this).removeClass('selectedfilter').removeClass('ui-selected').removeClass(\"selected\");" . "\r\n\t\t\t\t\t" . 'if ($(this).find("td:eq(0)").text()) {' . "\r\n\t\t\t\t\t\t" . 'window.rSelected.splice($.inArray($(this).find("td:eq(0)").text(), window.rSelected), 1);' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '} else { ' . "\r\n\t\t\t\t\t" . "\$(this).addClass('selectedfilter').addClass('ui-selected').addClass(\"selected\");" . "\r\n\t\t\t\t\t" . 'if ($(this).find("td:eq(0)").text()) {' . "\r\n\t\t\t\t\t\t" . 'window.rSelected.push($(this).find("td:eq(0)").text());' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#selected_count").html(" - " + window.rSelected.length + " selected")' . "\r\n\t\t" . '}' . "\r\n" . ' ';
|
||||
|
||||
if (isset($rOptions) && $rOptions['epg']) {
|
||||
echo ' function clearEPG(elem) {' . "\r\n" . ' var rEPG = $("#epg_api_" + $(elem).data("id")).val();' . "\r\n" . ' if (rEPG) {' . "\r\n" . ' $("#modified_" + $(elem).data("id")).val(1);' . "\r\n" . ' $("#epg_api_" + $(elem).data("id")).val("").trigger("change");' . "\r\n" . ' }' . "\r\n" . ' }' . "\r\n";
|
||||
}
|
||||
|
||||
echo ' function evaluateChanges() {' . "\r\n" . ' $(".name_input").change(function() {' . "\r\n" . ' var rID = $(this).data("id");' . "\r\n" . ' $("#modified_" + rID).val(1);' . "\r\n" . ' $("#name_s_" + rID).val($(this).val());' . "\r\n" . ' });' . "\r\n" . ' ';
|
||||
|
||||
if (!(isset($rOptions) && $rOptions['bouquets'])) {
|
||||
} else {
|
||||
echo ' $(".bouquet").change(function() {' . "\r\n" . ' var rID = $(this).data("id");' . "\r\n" . ' $("#modified_" + rID).val(1);' . "\r\n" . ' $("#bouquets_s_" + rID).val(JSON.stringify($("#bouquets_" + rID).val()));' . "\r\n" . ' });' . "\r\n" . ' ';
|
||||
}
|
||||
|
||||
if (!(isset($rOptions) && $rOptions['categories'])) {
|
||||
} else {
|
||||
echo ' $(".category_id").change(function() {' . "\r\n" . ' var rID = $(this).data("id");' . "\r\n" . ' $("#modified_" + rID).val(1);' . "\r\n" . ' $("#categories_s_" + rID).val(JSON.stringify($("#category_id_" + rID).val()));' . "\r\n" . ' });' . "\r\n" . ' ';
|
||||
}
|
||||
|
||||
if (isset($rOptions) && $rOptions['epg']) {
|
||||
echo ' $(".epg_api").change(function() {' . "\r\n" . ' var rID = $(this).data("id");' . "\r\n" . ' if (window.rData[rID]) {' . "\r\n" . ' var rData = window.rData[rID];' . "\r\n" . ' window.rData[rID] = null;' . "\r\n" . ' } else {' . "\r\n" . ' var rData = $("#epg_api_" + rID).select2("data")[0];' . "\r\n" . ' }' . "\r\n" . ' $("#modified_" + rID).val(1);' . "\r\n" . ' if (rData) {' . "\r\n" . ' $("#clear_epg_" + rID).removeClass("btn-secondary").addClass("btn-warning");' . "\r\n" . ' $("#epg_type_s_" + rID).val(rData.type);' . "\r\n" . ' if (rData.type == 1) {' . "\r\n" . ' $("#view_epg_" + rID).removeClass("btn-secondary").addClass("btn-success");' . "\r\n" . ' $("#view_epg_" + rID + " i").removeClass("far").addClass("fas");' . "\r\n" . ' $("#epg_id_s_" + rID).val(0);' . "\r\n" . ' $("#channel_id_s_" + rID).val(rData.id);' . "\r\n" . ' } else {' . "\r\n" . ' $("#view_epg_" + rID).removeClass("btn-success").addClass("btn-secondary");' . "\r\n" . ' $("#view_epg_" + rID + " i").removeClass("fas").addClass("far");' . "\r\n" . ' $("#epg_id_s_" + rID).val(rData.epg_id);' . "\r\n" . ' $("#channel_id_s_" + rID).val(rData.id);' . "\r\n" . ' }' . "\r\n" . ' } else {' . "\r\n" . ' $("#clear_epg_" + rID).removeClass("btn-warning").addClass("btn-secondary");' . "\r\n" . ' $("#view_epg_" + rID).removeClass("btn-success").addClass("btn-secondary");' . "\r\n" . ' $("#view_epg_" + rID + " i").removeClass("fas").addClass("far");' . "\r\n" . ' $("#epg_id_s_" + rID).val(0);' . "\r\n" . ' $("#epg_type_s_" + rID).val(0);' . "\r\n" . ' $("#channel_id_s_" + rID).val("");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' ';
|
||||
}
|
||||
|
||||
echo ' }' . "\r\n" . ' $(document).ready(function() {' . "\r\n\t\t\t" . "\$('select').select2({width: '100%'});" . "\r\n" . ' lazyload();' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
|
||||
if (isset($rImport)) {
|
||||
if (!(isset($rOptions) && $rOptions['epg'])) {
|
||||
} else {
|
||||
echo " \$('.epg_api').select2({" . "\r\n" . ' ajax: {' . "\r\n" . " url: './api'," . "\r\n" . " dataType: 'json'," . "\r\n" . ' data: function (params) {' . "\r\n" . ' return {' . "\r\n" . ' search: params.term,' . "\r\n" . " action: 'epglist'," . "\r\n" . ' page: params.page' . "\r\n" . ' };' . "\r\n" . ' },' . "\r\n" . ' processResults: function (data, params) {' . "\r\n" . ' params.page = params.page || 1;' . "\r\n" . ' return {' . "\r\n" . ' results: data.items,' . "\r\n" . ' pagination: {' . "\r\n" . ' more: (params.page * 100) < data.total_count' . "\r\n" . ' }' . "\r\n" . ' };' . "\r\n" . ' },' . "\r\n" . ' cache: true' . "\r\n" . ' },' . "\r\n" . " placeholder: 'Search EPG API...'" . "\r\n" . ' });' . "\r\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n" . ' bindHref(); refreshTooltips();' . "\r\n" . ' if ($.inArray($("#datatable").DataTable().page.info().page, window.rPages) == -1) {' . "\r\n" . ' ';
|
||||
echo ' window.rPages.push($("#datatable").DataTable().page.info().page);' . "\r\n" . ' }' . "\r\n" . ' evaluateChanges();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'bAutoWidth: false,' . "\r\n" . ' responsive: false,' . "\r\n" . ' searching: false,' . "\r\n" . ' bSort: false,' . "\r\n" . ' paging: true,' . "\r\n" . ' pageLength: 50,' . "\r\n" . ' lengthChange: false' . "\r\n" . ' });' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n" . ' $("#btn-submit").click(function() {' . "\r\n" . ' $("form").trigger("submit");' . "\r\n\t\t\t" . '});' . "\r\n" . ' ';
|
||||
} else {
|
||||
echo "\t\t\t" . "\$('select').select2({width: '100%'});" . "\r\n\t\t\t" . 'rTable = $("#datatable-mass").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n" . ' $("#datatable-mass a").removeAttr("href");' . "\r\n" . ' bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'serverSide: true,' . "\r\n\t\t\t\t" . 'ajax: {' . "\r\n\t\t\t\t\t" . 'url: "./table",' . "\r\n\t\t\t\t\t" . '"data": function(d) {' . "\r\n\t\t\t\t\t\t" . 'd.id = "stream_list",' . "\r\n\t\t\t\t\t\t" . 'd.category = getCategory(),' . "\r\n" . ' d.filter = getFilter()' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [0,3]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t\t" . '"rowCallback": function(row, data) {' . "\r\n\t\t\t\t\t" . 'if ($.inArray(data[0], window.rSelected) !== -1) {' . "\r\n\t\t\t\t\t\t" . "\$(row).addClass('selectedfilter').addClass('ui-selected').addClass(\"selected\");" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'pageLength: ';
|
||||
echo (intval($rSettings['default_entries']) ?: 10);
|
||||
echo "\t\t\t" . '});' . "\r\n\t\t\t" . "\$('#stream_search').keyup(function(){" . "\r\n\t\t\t\t" . 'rTable.search($(this).val()).draw();' . "\r\n\t\t\t" . '})' . "\r\n\t\t\t" . "\$('#show_entries').change(function(){" . "\r\n\t\t\t\t" . 'rTable.page.len($(this).val()).draw();' . "\r\n\t\t\t" . '})' . "\r\n" . " \$('#stream_filter').change(function(){" . "\r\n\t\t\t\t" . 'rTable.ajax.reload(null, false);' . "\r\n\t\t\t" . '})' . "\r\n\t\t\t" . "\$('#category_search').change(function(){" . "\r\n\t\t\t\t" . 'rTable.ajax.reload(null, false);' . "\r\n\t\t\t" . '})' . "\r\n\t\t\t" . '$("#datatable-mass").selectable({' . "\r\n\t\t\t\t" . "filter: 'tr'," . "\r\n\t\t\t\t" . 'selected: function (event, ui) {' . "\r\n\t\t\t\t\t" . "if (\$(ui.selected).hasClass('selectedfilter')) {" . "\r\n\t\t\t\t\t\t" . "\$(ui.selected).removeClass('selectedfilter').removeClass('ui-selected').removeClass(\"selected\");" . "\r\n\t\t\t\t\t\t" . 'window.rSelected.splice($.inArray($(ui.selected).find("td:eq(0)").text(), window.rSelected), 1);' . "\r\n\t\t\t\t\t" . '} else { ' . "\r\n\t\t\t\t\t\t" . "\$(ui.selected).addClass('selectedfilter').addClass('ui-selected').addClass(\"selected\");" . "\r\n\t\t\t\t\t\t" . 'window.rSelected.push($(ui.selected).find("td:eq(0)").text());' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t\t" . '$("#selected_count").html(" - " + window.rSelected.length + " selected")' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n" . ' $("#btn-submit").click(function() {' . "\r\n" . ' if (window.rSelected.length >= 250) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Review",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to review " + window.rSelected.length + " streams at once?<br/>Editing too many can crash your browser or cause the edit page to load really slowly.",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' $("form").trigger("submit");' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n" . ' } else {' . "\r\n" . ' $("form").trigger("submit");' . "\r\n" . ' }' . "\r\n\t\t\t" . '});' . "\r\n" . ' $("form").submit(function(e) {' . "\r\n\t\t\t\t" . 'if (window.rSelected.length == 0) {' . "\r\n\t\t\t\t\t" . '$.toast("Select at least one stream to edit.");' . "\r\n" . ' e.preventDefault();' . "\r\n\t\t\t\t" . '} else {' . "\r\n" . ' $("#streams").val(JSON.stringify(window.rSelected));' . "\r\n" . ' }' . "\r\n\t\t\t" . '});' . "\r\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (checkPermissions()) {
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
|
||||
if (isset(CoreUtilities::$rRequest['save_changes'])) {
|
||||
$rChanges = array();
|
||||
|
||||
foreach (array_keys(CoreUtilities::$rRequest) as $rKey) {
|
||||
$rSplit = explode('_', $rKey);
|
||||
|
||||
if (!($rSplit[0] == 'modified' && CoreUtilities::$rRequest[$rKey] == 1)) {
|
||||
} else {
|
||||
$rID = intval($rSplit[1]);
|
||||
$rChanges[$rID] = array();
|
||||
|
||||
foreach (array('name', 'channel_id', 'epg_id') as $rChangeKey) {
|
||||
$rChanges[$rID][$rChangeKey] = CoreUtilities::$rRequest[$rChangeKey . '_' . $rID];
|
||||
}
|
||||
|
||||
foreach (array('bouquets', 'categories') as $rChangeKey) {
|
||||
$rChanges[$rID][$rChangeKey] = json_decode(CoreUtilities::$rRequest[$rChangeKey . '_' . $rID], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($rChanges as $rID => $rStream) {
|
||||
if (!CoreUtilities::$rRequest['save_bouquets']) {
|
||||
} else {
|
||||
$rHasBouquets = array();
|
||||
|
||||
foreach (CoreUtilities::$rBouquets as $rBouquetID => $rBouquet) {
|
||||
if (!(in_array($rID, $rBouquet['streams']) || in_array($rID, $rBouquet['channels']))) {
|
||||
} else {
|
||||
$rHasBouquets[] = $rBouquetID;
|
||||
}
|
||||
}
|
||||
$rDelBouquet = $rAddBouquet = array();
|
||||
|
||||
foreach ($rHasBouquets as $rBouquetID) {
|
||||
if (in_array($rBouquetID, $rStream['bouquets'])) {
|
||||
} else {
|
||||
removeFromBouquet('stream', $rBouquetID, $rID);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($rStream['bouquets'] as $rBouquetID) {
|
||||
if (in_array($rBouquetID, $rHasBouquets)) {
|
||||
} else {
|
||||
$rAddBouquet[] = $rBouquetID;
|
||||
addToBouquet('stream', $rBouquetID, $rID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (CoreUtilities::$rRequest['save_categories'] && CoreUtilities::$rRequest['save_epg']) {
|
||||
$db->query('UPDATE `streams` SET `stream_display_name` = ?, `category_id` = ?, `channel_id` = ?, `epg_id` = ? WHERE `id` = ?;', $rStream['name'], '[' . implode(',', array_map('intval', $rStream['categories'])) . ']', ($rStream['channel_id'] ?: null), (is_null($rStream['epg_id']) ? null : $rStream['epg_id']), $rID);
|
||||
} else {
|
||||
if (CoreUtilities::$rRequest['save_categories']) {
|
||||
$db->query('UPDATE `streams` SET `stream_display_name` = ?, `category_id` = ? WHERE `id` = ?;', $rStream['name'], '[' . implode(',', array_map('intval', $rStream['categories'])) . ']', $rID);
|
||||
} else {
|
||||
if (CoreUtilities::$rRequest['save_epg']) {
|
||||
$db->query('UPDATE `streams` SET `stream_display_name` = ?, `channel_id` = ?, `epg_id` = ?, WHERE `id` = ?;', $rStream['name'], ($rStream['channel_id'] ?: null), (is_null($rStream['epg_id']) ? null : $rStream['epg_id']), $rID);
|
||||
} else {
|
||||
$db->query('UPDATE `streams` SET `stream_display_name` = ? WHERE `id` = ?;', $rStream['name'], $rID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
header('Location: ./streams?status=' . STATUS_SUCCESS);
|
||||
|
||||
exit();
|
||||
} else {
|
||||
if (!isset(CoreUtilities::$rRequest['streams'])) {
|
||||
} else {
|
||||
$rStreams = json_decode(CoreUtilities::$rRequest['streams'], true);
|
||||
$rCategories = getCategories('live');
|
||||
$rBouquets = getBouquets();
|
||||
$rStreamBouquets = array();
|
||||
foreach ($rBouquets as $rBouquet) {
|
||||
$rBouquetChannels = json_decode($rBouquet['bouquet_channels'], true);
|
||||
|
||||
foreach ($rBouquetChannels as $rStreamID) {
|
||||
if (!in_array($rStreamID, $rStreams)) {
|
||||
} else {
|
||||
$rStreamBouquets[$rStreamID][] = $rBouquet['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$rOptions = array('categories' => isset(CoreUtilities::$rRequest['edit_categories']), 'epg' => isset(CoreUtilities::$rRequest['edit_epg']), 'bouquets' => isset(CoreUtilities::$rRequest['edit_bouquets']));
|
||||
$rWidth = array(25, 20, 20);
|
||||
|
||||
if ($rOptions['categories'] || $rOptions['bouquets'] || $rOptions['epg']) {
|
||||
} else {
|
||||
$rWidth = array(90, 0, 0);
|
||||
}
|
||||
|
||||
$rImport = array();
|
||||
|
||||
if (0 >= count($rStreams)) {
|
||||
} else {
|
||||
$db->query('SELECT * FROM `streams` WHERE `id` IN (' . implode(',', array_map('intval', $rStreams)) . ');');
|
||||
|
||||
foreach ($db->get_rows() as $rRow) {
|
||||
$rImport[] = array('id' => $rRow['id'], 'channel_id' => ($rRow['channel_id'] ?: ''), 'epg_id' => ($rRow['epg_id'] ?: ''), 'title' => ($rRow['stream_display_name'] ?: ''), 'category' => json_decode($rRow['category_id'], true), 'bouquets' => ($rStreamBouquets[$rRow['id']] ?: array()));
|
||||
}
|
||||
}
|
||||
|
||||
if (count($rImport) != 0) {
|
||||
} else {
|
||||
$_STATUS = STATUS_NO_SOURCES;
|
||||
$rImport = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
$_TITLE = 'Review';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
<?php endif; ?>
|
||||
?>
|
||||
|
||||
<div class="wrapper<?= $rImport ? '' : ' boxed-layout-ext' ?>"
|
||||
<?= empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest' ? '' : ' style="display: none;"' ?>>
|
||||
<div class="container-fluid">
|
||||
<form action="./stream_review" method="POST" id="stream_form" data-parsley-validate="">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Mass Edit & Review <small id="selected_count"></small></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == STATUS_NO_SOURCES): ?>
|
||||
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
No streams were selected for review.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php if (isset($rImport)): ?>
|
||||
<input type="hidden" name="save_changes" value="1" />
|
||||
<input type="hidden" name="save_categories"
|
||||
value="<?= intval($rOptions['categories']) ?>" />
|
||||
<input type="hidden" name="save_bouquets" value="<?= intval($rOptions['bouquets']) ?>" />
|
||||
<input type="hidden" name="save_epg" value="<?= intval($rOptions['epg']) ?>" />
|
||||
<?php
|
||||
foreach ($rImport as $rStream) {
|
||||
include 'stream_import_logic.php';
|
||||
}
|
||||
?>
|
||||
<?php else: ?>
|
||||
<input type="hidden" name="streams" id="streams" value="" />
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#stream-selection" data-toggle="tab"
|
||||
class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-play mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Stream Selection</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="stream-selection">
|
||||
<div class="row" style="margin-bottom: 40px;">
|
||||
<label class="col-md-2 col-form-label" for="edit_categories">Edit
|
||||
Categories</label>
|
||||
<div class="col-md-2">
|
||||
<input name="edit_categories" id="edit_categories" type="checkbox"
|
||||
checked data-plugin="switchery" class="js-switch"
|
||||
data-color="#039cfd" />
|
||||
</div>
|
||||
<label class="col-md-2 col-form-label" for="edit_bouquets">Edit
|
||||
Bouquets</label>
|
||||
<div class="col-md-2">
|
||||
<input name="edit_bouquets" id="edit_bouquets" type="checkbox" checked
|
||||
data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
<label class="col-md-2 col-form-label" for="edit_epg">Edit EPG</label>
|
||||
<div class="col-md-2">
|
||||
<input name="edit_epg" id="edit_epg" type="checkbox" checked
|
||||
data-plugin="switchery" class="js-switch" data-color="#039cfd" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-6">
|
||||
<input type="text" class="form-control" id="stream_search" value=""
|
||||
placeholder="Search Streams...">
|
||||
</div>
|
||||
<div class="col-md-3 col-6">
|
||||
<select id="category_search" class="form-control" data-toggle="select2">
|
||||
<option value="" selected>All Categories</option>
|
||||
<?php foreach (getCategories('live') as $rCategory): ?>
|
||||
<option value="<?= intval($rCategory['id']) ?>"
|
||||
<?= isset(CoreUtilities::$rRequest['category']) && CoreUtilities::$rRequest['category'] == $rCategory['id'] ? ' selected' : '' ?>>
|
||||
<?= htmlspecialchars($rCategory['category_name']) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3 col-6">
|
||||
<select id="stream_filter" class="form-control" data-toggle="select2">
|
||||
<option value="">No Filter</option>
|
||||
<option value="1">Online</option>
|
||||
<option value="2">Down</option>
|
||||
<option value="3">Stopped</option>
|
||||
<option value="4">Starting</option>
|
||||
<option value="5">On Demand</option>
|
||||
<option value="6">Direct</option>
|
||||
<option value="7">Timeshift</option>
|
||||
<option value="8">Looping</option>
|
||||
<option value="9">Has EPG</option>
|
||||
<option value="10">No EPG</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2 col-8">
|
||||
<select id="show_entries" class="form-control" data-toggle="select2">
|
||||
<?php foreach (array(10, 25, 50, 250, 500, 1000) as $rShow): ?>
|
||||
<option
|
||||
<?= $rSettings['default_entries'] == $rShow ? ' selected' : '' ?>
|
||||
value="<?= $rShow ?>">
|
||||
<?= $rShow ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-1 col-2">
|
||||
<button type="button" class="btn btn-info waves-effect waves-light"
|
||||
onClick="toggleStreams()">
|
||||
<i class="mdi mdi-selection"></i>
|
||||
</button>
|
||||
</div>
|
||||
<table id="datatable-mass" class="table table-borderless mb-0">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<th>Stream Name</th>
|
||||
<th>Category</th>
|
||||
<th class="text-center">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
echo ' ' . "\r\n" . ' var rPages = [];' . "\r\n" . ' var rData = [];' . "\r\n" . ' var rSelected = [];' . "\r\n\r\n\t\t" . 'function getCategory() {' . "\r\n\t\t\t" . 'return $("#category_search").val();' . "\r\n\t\t" . '}' . "\r\n" . ' function getFilter() {' . "\r\n\t\t\t" . 'return $("#stream_filter").val();' . "\r\n\t\t" . '}' . "\r\n\t\t" . 'function toggleStreams() {' . "\r\n\t\t\t" . '$("#datatable-mass tr").each(function() {' . "\r\n\t\t\t\t" . "if (\$(this).hasClass('selected')) {" . "\r\n\t\t\t\t\t" . "\$(this).removeClass('selectedfilter').removeClass('ui-selected').removeClass(\"selected\");" . "\r\n\t\t\t\t\t" . 'if ($(this).find("td:eq(0)").text()) {' . "\r\n\t\t\t\t\t\t" . 'window.rSelected.splice($.inArray($(this).find("td:eq(0)").text(), window.rSelected), 1);' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '} else { ' . "\r\n\t\t\t\t\t" . "\$(this).addClass('selectedfilter').addClass('ui-selected').addClass(\"selected\");" . "\r\n\t\t\t\t\t" . 'if ($(this).find("td:eq(0)").text()) {' . "\r\n\t\t\t\t\t\t" . 'window.rSelected.push($(this).find("td:eq(0)").text());' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#selected_count").html(" - " + window.rSelected.length + " selected")' . "\r\n\t\t" . '}' . "\r\n" . ' ';
|
||||
|
||||
if (isset($rOptions) && $rOptions['epg']) {
|
||||
echo ' function clearEPG(elem) {' . "\r\n" . ' var rEPG = $("#epg_api_" + $(elem).data("id")).val();' . "\r\n" . ' if (rEPG) {' . "\r\n" . ' $("#modified_" + $(elem).data("id")).val(1);' . "\r\n" . ' $("#epg_api_" + $(elem).data("id")).val("").trigger("change");' . "\r\n" . ' }' . "\r\n" . ' }' . "\r\n";
|
||||
}
|
||||
|
||||
echo ' function evaluateChanges() {' . "\r\n" . ' $(".name_input").change(function() {' . "\r\n" . ' var rID = $(this).data("id");' . "\r\n" . ' $("#modified_" + rID).val(1);' . "\r\n" . ' $("#name_s_" + rID).val($(this).val());' . "\r\n" . ' });' . "\r\n" . ' ';
|
||||
|
||||
if (!(isset($rOptions) && $rOptions['bouquets'])) {
|
||||
} else {
|
||||
echo ' $(".bouquet").change(function() {' . "\r\n" . ' var rID = $(this).data("id");' . "\r\n" . ' $("#modified_" + rID).val(1);' . "\r\n" . ' $("#bouquets_s_" + rID).val(JSON.stringify($("#bouquets_" + rID).val()));' . "\r\n" . ' });' . "\r\n" . ' ';
|
||||
}
|
||||
|
||||
if (!(isset($rOptions) && $rOptions['categories'])) {
|
||||
} else {
|
||||
echo ' $(".category_id").change(function() {' . "\r\n" . ' var rID = $(this).data("id");' . "\r\n" . ' $("#modified_" + rID).val(1);' . "\r\n" . ' $("#categories_s_" + rID).val(JSON.stringify($("#category_id_" + rID).val()));' . "\r\n" . ' });' . "\r\n" . ' ';
|
||||
}
|
||||
|
||||
if (isset($rOptions) && $rOptions['epg']) {
|
||||
echo ' $(".epg_api").change(function() {' . "\r\n" . ' var rID = $(this).data("id");' . "\r\n" . ' if (window.rData[rID]) {' . "\r\n" . ' var rData = window.rData[rID];' . "\r\n" . ' window.rData[rID] = null;' . "\r\n" . ' } else {' . "\r\n" . ' var rData = $("#epg_api_" + rID).select2("data")[0];' . "\r\n" . ' }' . "\r\n" . ' $("#modified_" + rID).val(1);' . "\r\n" . ' if (rData) {' . "\r\n" . ' $("#clear_epg_" + rID).removeClass("btn-secondary").addClass("btn-warning");' . "\r\n" . ' $("#epg_type_s_" + rID).val(rData.type);' . "\r\n" . ' if (rData.type == 1) {' . "\r\n" . ' $("#view_epg_" + rID).removeClass("btn-secondary").addClass("btn-success");' . "\r\n" . ' $("#view_epg_" + rID + " i").removeClass("far").addClass("fas");' . "\r\n" . ' $("#epg_id_s_" + rID).val(0);' . "\r\n" . ' $("#channel_id_s_" + rID).val(rData.id);' . "\r\n" . ' } else {' . "\r\n" . ' $("#view_epg_" + rID).removeClass("btn-success").addClass("btn-secondary");' . "\r\n" . ' $("#view_epg_" + rID + " i").removeClass("fas").addClass("far");' . "\r\n" . ' $("#epg_id_s_" + rID).val(rData.epg_id);' . "\r\n" . ' $("#channel_id_s_" + rID).val(rData.id);' . "\r\n" . ' }' . "\r\n" . ' } else {' . "\r\n" . ' $("#clear_epg_" + rID).removeClass("btn-warning").addClass("btn-secondary");' . "\r\n" . ' $("#view_epg_" + rID).removeClass("btn-success").addClass("btn-secondary");' . "\r\n" . ' $("#view_epg_" + rID + " i").removeClass("fas").addClass("far");' . "\r\n" . ' $("#epg_id_s_" + rID).val(0);' . "\r\n" . ' $("#epg_type_s_" + rID).val(0);' . "\r\n" . ' $("#channel_id_s_" + rID).val("");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' ';
|
||||
}
|
||||
|
||||
echo ' }' . "\r\n" . ' $(document).ready(function() {' . "\r\n\t\t\t" . "\$('select').select2({width: '100%'});" . "\r\n" . ' lazyload();' . "\r\n" . ' ' . "\r\n" . ' ';
|
||||
|
||||
if (isset($rImport)) {
|
||||
if (!(isset($rOptions) && $rOptions['epg'])) {
|
||||
} else {
|
||||
echo " \$('.epg_api').select2({" . "\r\n" . ' ajax: {' . "\r\n" . " url: './api'," . "\r\n" . " dataType: 'json'," . "\r\n" . ' data: function (params) {' . "\r\n" . ' return {' . "\r\n" . ' search: params.term,' . "\r\n" . " action: 'epglist'," . "\r\n" . ' page: params.page' . "\r\n" . ' };' . "\r\n" . ' },' . "\r\n" . ' processResults: function (data, params) {' . "\r\n" . ' params.page = params.page || 1;' . "\r\n" . ' return {' . "\r\n" . ' results: data.items,' . "\r\n" . ' pagination: {' . "\r\n" . ' more: (params.page * 100) < data.total_count' . "\r\n" . ' }' . "\r\n" . ' };' . "\r\n" . ' },' . "\r\n" . ' cache: true' . "\r\n" . ' },' . "\r\n" . " placeholder: 'Search EPG API...'" . "\r\n" . ' });' . "\r\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n" . ' bindHref(); refreshTooltips();' . "\r\n" . ' if ($.inArray($("#datatable").DataTable().page.info().page, window.rPages) == -1) {' . "\r\n" . ' ';
|
||||
echo ' window.rPages.push($("#datatable").DataTable().page.info().page);' . "\r\n" . ' }' . "\r\n" . ' evaluateChanges();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'bAutoWidth: false,' . "\r\n" . ' responsive: false,' . "\r\n" . ' searching: false,' . "\r\n" . ' bSort: false,' . "\r\n" . ' paging: true,' . "\r\n" . ' pageLength: 50,' . "\r\n" . ' lengthChange: false' . "\r\n" . ' });' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n" . ' $("#btn-submit").click(function() {' . "\r\n" . ' $("form").trigger("submit");' . "\r\n\t\t\t" . '});' . "\r\n" . ' ';
|
||||
} else {
|
||||
echo "\t\t\t" . "\$('select').select2({width: '100%'});" . "\r\n\t\t\t" . 'rTable = $("#datatable-mass").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n" . ' $("#datatable-mass a").removeAttr("href");' . "\r\n" . ' bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'serverSide: true,' . "\r\n\t\t\t\t" . 'ajax: {' . "\r\n\t\t\t\t\t" . 'url: "./table",' . "\r\n\t\t\t\t\t" . '"data": function(d) {' . "\r\n\t\t\t\t\t\t" . 'd.id = "stream_list",' . "\r\n\t\t\t\t\t\t" . 'd.category = getCategory(),' . "\r\n" . ' d.filter = getFilter()' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [0,3]}' . "\r\n\t\t\t\t" . '],' . "\r\n\t\t\t\t" . '"rowCallback": function(row, data) {' . "\r\n\t\t\t\t\t" . 'if ($.inArray(data[0], window.rSelected) !== -1) {' . "\r\n\t\t\t\t\t\t" . "\$(row).addClass('selectedfilter').addClass('ui-selected').addClass(\"selected\");" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'pageLength: ';
|
||||
echo (intval($rSettings['default_entries']) ?: 10);
|
||||
echo "\t\t\t" . '});' . "\r\n\t\t\t" . "\$('#stream_search').keyup(function(){" . "\r\n\t\t\t\t" . 'rTable.search($(this).val()).draw();' . "\r\n\t\t\t" . '})' . "\r\n\t\t\t" . "\$('#show_entries').change(function(){" . "\r\n\t\t\t\t" . 'rTable.page.len($(this).val()).draw();' . "\r\n\t\t\t" . '})' . "\r\n" . " \$('#stream_filter').change(function(){" . "\r\n\t\t\t\t" . 'rTable.ajax.reload(null, false);' . "\r\n\t\t\t" . '})' . "\r\n\t\t\t" . "\$('#category_search').change(function(){" . "\r\n\t\t\t\t" . 'rTable.ajax.reload(null, false);' . "\r\n\t\t\t" . '})' . "\r\n\t\t\t" . '$("#datatable-mass").selectable({' . "\r\n\t\t\t\t" . "filter: 'tr'," . "\r\n\t\t\t\t" . 'selected: function (event, ui) {' . "\r\n\t\t\t\t\t" . "if (\$(ui.selected).hasClass('selectedfilter')) {" . "\r\n\t\t\t\t\t\t" . "\$(ui.selected).removeClass('selectedfilter').removeClass('ui-selected').removeClass(\"selected\");" . "\r\n\t\t\t\t\t\t" . 'window.rSelected.splice($.inArray($(ui.selected).find("td:eq(0)").text(), window.rSelected), 1);' . "\r\n\t\t\t\t\t" . '} else { ' . "\r\n\t\t\t\t\t\t" . "\$(ui.selected).addClass('selectedfilter').addClass('ui-selected').addClass(\"selected\");" . "\r\n\t\t\t\t\t\t" . 'window.rSelected.push($(ui.selected).find("td:eq(0)").text());' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t\t" . '$("#selected_count").html(" - " + window.rSelected.length + " selected")' . "\r\n\t\t\t\t" . '}' . "\r\n\t\t\t" . '});' . "\r\n" . ' $("#btn-submit").click(function() {' . "\r\n" . ' if (window.rSelected.length >= 250) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Review",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to review " + window.rSelected.length + " streams at once?<br/>Editing too many can crash your browser or cause the edit page to load really slowly.",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' $("form").trigger("submit");' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n" . ' } else {' . "\r\n" . ' $("form").trigger("submit");' . "\r\n" . ' }' . "\r\n\t\t\t" . '});' . "\r\n" . ' $("form").submit(function(e) {' . "\r\n\t\t\t\t" . 'if (window.rSelected.length == 0) {' . "\r\n\t\t\t\t\t" . '$.toast("Select at least one stream to edit.");' . "\r\n" . ' e.preventDefault();' . "\r\n\t\t\t\t" . '} else {' . "\r\n" . ' $("#streams").val(JSON.stringify(window.rSelected));' . "\r\n" . ' }' . "\r\n\t\t\t" . '});' . "\r\n" . ' ';
|
||||
}
|
||||
|
||||
echo "\t\t" . '});' . "\r\n" . ' ' . "\r\n\t\t";
|
||||
?>
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+382
-376
@@ -1,376 +1,382 @@
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Stream Tools';
|
||||
include 'header.php';
|
||||
?>
|
||||
<div class="wrapper boxed-layout"
|
||||
<?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Stream Tools</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == 1) { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Stream DNS replacement was successful.
|
||||
</div>
|
||||
<?php } elseif (isset($_STATUS) && $_STATUS == 2) { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Streams have been moved from the source server to the replacement server.
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#dns-replacement" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-dns mr-1"></i>
|
||||
<span class="d-none d-sm-inline">DNS Replacement</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#move-streams" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-folder-move mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Move Streams</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#url-decrypt" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-lock-open mr-1"></i>
|
||||
<span class="d-none d-sm-inline">URL Decrypt</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="dns-replacement">
|
||||
<form action="#" method="POST" id="dns_form" data-parsley-validate="">
|
||||
<input type="hidden" name="replace_dns" value="true" />
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="sub-header">
|
||||
The DNS replacement tool can be used to replace the domain name of a
|
||||
stream with another. It can replace any text within a stream, such
|
||||
as username and password.
|
||||
</p>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="old_dns">Old DNS</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" id="old_dns"
|
||||
name="old_dns" value="" placeholder="http://example.com"
|
||||
required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="new_dns">New DNS</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" id="new_dns"
|
||||
name="new_dns" value="" placeholder="http://newdns.com"
|
||||
required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="replace_dns" id="replace_dns" type="submit"
|
||||
class="btn btn-primary" value="Replace DNS" />
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="move-streams">
|
||||
<form action="#" method="POST" id="move_form" data-parsley-validate="">
|
||||
<input type="hidden" name="move_streams" value="true" />
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="sub-header">
|
||||
This tool will allow you to move all streams from one server to
|
||||
another.
|
||||
</p>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label"
|
||||
for="content_type">Content</label>
|
||||
<div class="col-md-8">
|
||||
<select name="content_type" id="content_type"
|
||||
class="form-control select2" data-toggle="select2">
|
||||
<?php foreach (array('Everything', 'Live Streams', 3 => 'Created Channels', 2 => 'Movies', 5 => 'TV Shows', 4 => 'Radio Stations') as $rID => $rType) { ?>
|
||||
<option value="<?php echo $rID; ?>"><?php echo $rType; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="source_server">Source
|
||||
Server</label>
|
||||
<div class="col-md-8">
|
||||
<select name="source_server" id="source_server"
|
||||
class="form-control select2" data-toggle="select2">
|
||||
<?php foreach ($rServers as $rServer) { ?>
|
||||
<option value="<?php echo intval($rServer['id']); ?>">
|
||||
<?php echo htmlspecialchars($rServer['server_name']); ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label"
|
||||
for="replacement_server">Replacement Server</label>
|
||||
<div class="col-md-8">
|
||||
<select name="replacement_server" id="replacement_server"
|
||||
class="form-control select2" data-toggle="select2">
|
||||
<?php foreach ($rServers as $rServer) { ?>
|
||||
<option value="<?php echo intval($rServer['id']); ?>">
|
||||
<?php echo htmlspecialchars($rServer['server_name']); ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="move_streams" id="move_streams" type="submit"
|
||||
class="btn btn-primary" value="Move Streams" />
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="url-decrypt">
|
||||
<form action="#" method="POST" id="decrypt_form" data-parsley-validate="">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="sub-header">
|
||||
This tool will allow you to decrypt URLs or parts of an URL that
|
||||
your service encrypted.
|
||||
</p>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label"
|
||||
for="encrypted_text">Encrypted Text</label>
|
||||
<div class="col-md-8">
|
||||
<textarea class="form-control" id="encrypted_text"
|
||||
name="encrypted_text" rows="8"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label"
|
||||
for="decrypted_text">Decrypted Text</label>
|
||||
<div class="col-md-8">
|
||||
<textarea class="form-control" id="decrypted_text"
|
||||
name="decrypted_text" rows="8" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="url_decrypt" id="url_decrypt" type="button"
|
||||
onClick="decryptText();" class="btn btn-primary"
|
||||
value="Decrypt Text" />
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function decryptText() {
|
||||
var rText = $("#encrypted_text").val();
|
||||
$("#decrypted_text").val("");
|
||||
if (rText.length > 0) {
|
||||
$.getJSON("./api?action=decrypt_text&text=" + encodeURIComponent(rText), function(rData) {
|
||||
if ("data" in rData) {
|
||||
$("#decrypted_text").val(rData.data.join("\n\n"));
|
||||
} else {
|
||||
$.toast("Text could not be decrypted...");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.toast("Please enter data in the encrypted text field.");
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('select').select2({
|
||||
width: '100%'
|
||||
});
|
||||
$("#dns_form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("#dns_form")[0]));
|
||||
});
|
||||
$("#move_form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("#move_form")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
include 'session.php';
|
||||
include 'functions.php';
|
||||
|
||||
if (!checkPermissions()) {
|
||||
goHome();
|
||||
}
|
||||
|
||||
$_TITLE = 'Stream Tools';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
<?php endif; ?>
|
||||
?>
|
||||
<div class="wrapper boxed-layout"
|
||||
<?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
} else {
|
||||
echo ' style="display: none;"';
|
||||
} ?>>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<?php include 'topbar.php'; ?>
|
||||
</div>
|
||||
<h4 class="page-title">Stream Tools</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<?php if (isset($_STATUS) && $_STATUS == 1) { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Stream DNS replacement was successful.
|
||||
</div>
|
||||
<?php } elseif (isset($_STATUS) && $_STATUS == 2) { ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
Streams have been moved from the source server to the replacement server.
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div id="basicwizard">
|
||||
<ul class="nav nav-pills bg-light nav-justified form-wizard-header mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="#dns-replacement" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-dns mr-1"></i>
|
||||
<span class="d-none d-sm-inline">DNS Replacement</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#move-streams" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-folder-move mr-1"></i>
|
||||
<span class="d-none d-sm-inline">Move Streams</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#url-decrypt" data-toggle="tab" class="nav-link rounded-0 pt-2 pb-2">
|
||||
<i class="mdi mdi-lock-open mr-1"></i>
|
||||
<span class="d-none d-sm-inline">URL Decrypt</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content b-0 mb-0 pt-0">
|
||||
<div class="tab-pane" id="dns-replacement">
|
||||
<form action="#" method="POST" id="dns_form" data-parsley-validate="">
|
||||
<input type="hidden" name="replace_dns" value="true" />
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="sub-header">
|
||||
The DNS replacement tool can be used to replace the domain name of a
|
||||
stream with another. It can replace any text within a stream, such
|
||||
as username and password.
|
||||
</p>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="old_dns">Old DNS</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" id="old_dns"
|
||||
name="old_dns" value="" placeholder="http://example.com"
|
||||
required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="new_dns">New DNS</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" id="new_dns"
|
||||
name="new_dns" value="" placeholder="http://newdns.com"
|
||||
required data-parsley-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="replace_dns" id="replace_dns" type="submit"
|
||||
class="btn btn-primary" value="Replace DNS" />
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="move-streams">
|
||||
<form action="#" method="POST" id="move_form" data-parsley-validate="">
|
||||
<input type="hidden" name="move_streams" value="true" />
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="sub-header">
|
||||
This tool will allow you to move all streams from one server to
|
||||
another.
|
||||
</p>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label"
|
||||
for="content_type">Content</label>
|
||||
<div class="col-md-8">
|
||||
<select name="content_type" id="content_type"
|
||||
class="form-control select2" data-toggle="select2">
|
||||
<?php foreach (array('Everything', 'Live Streams', 3 => 'Created Channels', 2 => 'Movies', 5 => 'TV Shows', 4 => 'Radio Stations') as $rID => $rType) { ?>
|
||||
<option value="<?php echo $rID; ?>"><?php echo $rType; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label" for="source_server">Source
|
||||
Server</label>
|
||||
<div class="col-md-8">
|
||||
<select name="source_server" id="source_server"
|
||||
class="form-control select2" data-toggle="select2">
|
||||
<?php foreach ($rServers as $rServer) { ?>
|
||||
<option value="<?php echo intval($rServer['id']); ?>">
|
||||
<?php echo htmlspecialchars($rServer['server_name']); ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label"
|
||||
for="replacement_server">Replacement Server</label>
|
||||
<div class="col-md-8">
|
||||
<select name="replacement_server" id="replacement_server"
|
||||
class="form-control select2" data-toggle="select2">
|
||||
<?php foreach ($rServers as $rServer) { ?>
|
||||
<option value="<?php echo intval($rServer['id']); ?>">
|
||||
<?php echo htmlspecialchars($rServer['server_name']); ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="move_streams" id="move_streams" type="submit"
|
||||
class="btn btn-primary" value="Move Streams" />
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="url-decrypt">
|
||||
<form action="#" method="POST" id="decrypt_form" data-parsley-validate="">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="sub-header">
|
||||
This tool will allow you to decrypt URLs or parts of an URL that
|
||||
your service encrypted.
|
||||
</p>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label"
|
||||
for="encrypted_text">Encrypted Text</label>
|
||||
<div class="col-md-8">
|
||||
<textarea class="form-control" id="encrypted_text"
|
||||
name="encrypted_text" rows="8"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-4">
|
||||
<label class="col-md-4 col-form-label"
|
||||
for="decrypted_text">Decrypted Text</label>
|
||||
<div class="col-md-8">
|
||||
<textarea class="form-control" id="decrypted_text"
|
||||
name="decrypted_text" rows="8" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-inline wizard mb-0">
|
||||
<li class="list-inline-item float-right">
|
||||
<input name="url_decrypt" id="url_decrypt" type="button"
|
||||
onClick="decryptText();" class="btn btn-primary"
|
||||
value="Decrypt Text" />
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin');
|
||||
?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
resizeObserver.observe(document.body)
|
||||
$("form").attr('autocomplete', 'off');
|
||||
$(document).keypress(function(event) {
|
||||
if (event.which == 13 && event.target.nodeName != "TEXTAREA") return false;
|
||||
});
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function(html) {
|
||||
var switchery = new Switchery(html, {
|
||||
'color': '#414d5f'
|
||||
});
|
||||
window.rSwitches[$(html).attr("id")] = switchery;
|
||||
});
|
||||
setTimeout(pingSession, 30000);
|
||||
<?php if (!$rMobile && $rSettings['header_stats']): ?>
|
||||
headerStats();
|
||||
<?php endif; ?>
|
||||
bindHref();
|
||||
refreshTooltips();
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 200) {
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeOut();
|
||||
}
|
||||
$('#scrollToTop').fadeIn();
|
||||
} else {
|
||||
$('#scrollToTop').fadeOut();
|
||||
if ($(document).height() > $(window).height()) {
|
||||
$('#scrollToBottom').fadeIn();
|
||||
} else {
|
||||
$('#scrollToBottom').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#scrollToTop").unbind("click");
|
||||
$('#scrollToTop').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$("#scrollToBottom").unbind("click");
|
||||
$('#scrollToBottom').click(function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(document).height()
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
$(window).scroll();
|
||||
$(".nextb").unbind("click");
|
||||
$(".nextb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$(".nav .nav-item").each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
$(".prevb").unbind("click");
|
||||
$(".prevb").click(function() {
|
||||
var rPos = 0;
|
||||
var rActive = null;
|
||||
$($(".nav .nav-item").get().reverse()).each(function() {
|
||||
if ($(this).find(".nav-link").hasClass("active")) {
|
||||
rActive = rPos;
|
||||
}
|
||||
if (rActive !== null && rPos > rActive && !$(this).find("a").hasClass("disabled") && $(this).is(":visible")) {
|
||||
$(this).find(".nav-link").trigger("click");
|
||||
return false;
|
||||
}
|
||||
rPos += 1;
|
||||
});
|
||||
});
|
||||
(function($) {
|
||||
$.fn.inputFilter = function(inputFilter) {
|
||||
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
||||
if (inputFilter(this.value)) {
|
||||
this.oldValue = this.value;
|
||||
this.oldSelectionStart = this.selectionStart;
|
||||
this.oldSelectionEnd = this.selectionEnd;
|
||||
} else if (this.hasOwnProperty("oldValue")) {
|
||||
this.value = this.oldValue;
|
||||
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
<?php if ($rSettings['js_navigate']): ?>
|
||||
$(".navigation-menu li").mouseenter(function() {
|
||||
$(this).find(".submenu").show();
|
||||
});
|
||||
delParam("status");
|
||||
$(window).on("popstate", function() {
|
||||
if (window.rRealURL) {
|
||||
if (window.rRealURL.split("/").reverse()[0].split("?")[0].split(".")[0] != window.location.href.split("/").reverse()[0].split("?")[0].split(".")[0]) {
|
||||
navigate(window.location.href.split("/").reverse()[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = true;
|
||||
}
|
||||
});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 16) {
|
||||
window.rShiftHeld = false;
|
||||
}
|
||||
});
|
||||
document.onselectstart = function() {
|
||||
if (window.rShiftHeld) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function decryptText() {
|
||||
var rText = $("#encrypted_text").val();
|
||||
$("#decrypted_text").val("");
|
||||
if (rText.length > 0) {
|
||||
$.getJSON("./api?action=decrypt_text&text=" + encodeURIComponent(rText), function(rData) {
|
||||
if ("data" in rData) {
|
||||
$("#decrypted_text").val(rData.data.join("\n\n"));
|
||||
} else {
|
||||
$.toast("Text could not be decrypted...");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.toast("Please enter data in the encrypted text field.");
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('select').select2({
|
||||
width: '100%'
|
||||
});
|
||||
$("#dns_form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("#dns_form")[0]));
|
||||
});
|
||||
$("#move_form").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
submitForm(window.rCurrentPage, new FormData($("#move_form")[0]));
|
||||
});
|
||||
});
|
||||
<?php if (CoreUtilities::$rSettings['enable_search']): ?>
|
||||
$(document).ready(function() {
|
||||
initSearch();
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="assets/js/listings.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if (!isset($__viewMode)): ?>
|
||||
<?php
|
||||
|
||||
|
||||
@@ -83,7 +84,9 @@ if ($rStream['type'] != 5) {
|
||||
|
||||
$rStreamStats = getStreamStats($rStream['id']);
|
||||
$_TITLE = 'View ' . $rTypeString;
|
||||
include 'header.php';
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/admin.php';
|
||||
renderUnifiedLayoutHeader('admin');
|
||||
endif;
|
||||
echo '<div class="wrapper boxed-layout-ext"';
|
||||
|
||||
if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
|
||||
@@ -596,7 +599,8 @@ if ($rStream['type'] == 1) {
|
||||
|
||||
|
||||
echo "\t\t\t\t\t" . '</div>' . "\r\n\t\t\t\t" . '</div>' . "\r\n\t\t\t" . '</div> ' . "\r\n\t\t" . '</div>' . "\r\n\t" . '</div>' . "\r\n" . '</div>' . "\r\n";
|
||||
include 'footer.php'; ?>
|
||||
require_once __DIR__ . '/../interfaces/Http/Views/layouts/footer.php';
|
||||
renderUnifiedLayoutFooter('admin'); ?>
|
||||
<script id="scripts">
|
||||
var resizeObserver = new ResizeObserver(entries => $(window).scroll());
|
||||
$(document).ready(function() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user