init: workspace opencode sync
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
echo "<meta http-equiv='refresh' content='0;url=../' />";
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
if (!isset($_SESSION["mikhmon"])) {
|
||||
header("Location:../admin.php?id=login");
|
||||
} else {
|
||||
|
||||
// array color
|
||||
$color = array('1' => 'bg-blue', 'bg-indigo', 'bg-purple', 'bg-pink', 'bg-red', 'bg-yellow', 'bg-green', 'bg-teal', 'bg-cyan', 'bg-grey', 'bg-light-blue');
|
||||
|
||||
if (isset($_POST['save'])) {
|
||||
|
||||
$suseradm = ($_POST['useradm']);
|
||||
$spassadm = encrypt($_POST['passadm']);
|
||||
$logobt = ($_POST['logobt']);
|
||||
$qrbt = ($_POST['qrbt']);
|
||||
|
||||
$cari = array('1' => "mikhmon<|<$useradm", "mikhmon>|>$passadm");
|
||||
$ganti = array('1' => "mikhmon<|<$suseradm", "mikhmon>|>$spassadm");
|
||||
|
||||
for ($i = 1; $i < 3; $i++) {
|
||||
$file = file("./include/config.php");
|
||||
$content = file_get_contents("./include/config.php");
|
||||
$newcontent = str_replace((string)$cari[$i], (string)$ganti[$i], "$content");
|
||||
file_put_contents("./include/config.php", "$newcontent");
|
||||
}
|
||||
|
||||
|
||||
$gen = '<?php $qrbt="' . $qrbt . '";?>';
|
||||
$key = './include/quickbt.php';
|
||||
$handle = fopen($key, 'w') or die('Cannot open file: ' . $key);
|
||||
$data = $gen;
|
||||
fwrite($handle, $data);
|
||||
echo "<script>window.location='./admin.php?id=sessions'</script>";
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
function Pass(id){
|
||||
var x = document.getElementById(id);
|
||||
if (x.type === 'password') {
|
||||
x.type = 'text';
|
||||
} else {
|
||||
x.type = 'password';
|
||||
}}
|
||||
</script>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-gear"></i> <?= $_admin_settings ?> | <i onclick="location.reload();" class="fa fa-refresh pointer " title="Reload data"></i></h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-server"></i> <?= $_router_list ?></h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<?php
|
||||
foreach (file('./include/config.php') as $line) {
|
||||
$value = explode("'", $line)[1];
|
||||
if ($value == "" || $value == "mikhmon") {
|
||||
} else { ?>
|
||||
<div class="col-12">
|
||||
<div class="box bmh-75 box-bordered <?= $color[rand(1, 11)]; ?>">
|
||||
<div class="box-group">
|
||||
|
||||
<div class="box-group-icon">
|
||||
<span class="connect pointer" id="<?= $value; ?>">
|
||||
<i class="fa fa-server"></i>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="box-group-area">
|
||||
<span>
|
||||
<?= $_hotspot_name ?> : <?= explode('%', $data[$value][4])[1]; ?><br>
|
||||
<?= $_session_name ?> : <?= $value; ?><br>
|
||||
<span class="connect pointer" id="<?= $value; ?>"><i class="fa fa-external-link"></i> <?= $_open ?></span>
|
||||
<a href="./admin.php?id=settings&session=<?= $value; ?>"><i class="fa fa-edit"></i> <?= $_edit ?></a>
|
||||
<a href="javascript:void(0)" onclick="if(confirm('Are you sure to delete data <?= $value;
|
||||
echo " (" . explode('%', $data[$value][4])[1] . ")"; ?>?')){loadpage('./admin.php?id=remove-session&session=<?= $value; ?>')}else{}"><i class="fa fa-remove"></i> <?= $_delete ?></a>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<form autocomplete="off" method="post" action="">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-user-circle"></i> <?= $_admin ?></h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-sm">
|
||||
<tr>
|
||||
<td class="align-middle"><?= $_user_name ?> </td><td><input class="form-control" id="useradm" type="text" size="10" name="useradm" title="User Admin" value="<?= $useradm; ?>" required="1"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="align-middle"><?= $_password ?> </td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<div class="input-group-11 col-box-10">
|
||||
<input class="group-item group-item-l" id="passadm" type="password" size="10" name="passadm" title="Password Admin" value="<?= decrypt($passadm); ?>" required="1"/>
|
||||
</div>
|
||||
<div class="input-group-1 col-box-2">
|
||||
<div class="group-item group-item-r pd-2p5 text-center align-middle">
|
||||
<input title="Show/Hide Password" type="checkbox" onclick="Pass('passadm')">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="align-middle"><?= $_quick_print ?> QR</td>
|
||||
<td>
|
||||
<select class="form-control" name="qrbt">
|
||||
<option><?= $qrbt ?></option>
|
||||
<option>enable</option>
|
||||
<option>disable</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td class="text-right">
|
||||
<div class="input-group-4">
|
||||
<input class="group-item group-item-l" type="submit" style="cursor: pointer;" name="save" value="<?= $_save ?>"/>
|
||||
</div>
|
||||
<div class="input-group-2">
|
||||
<div style="cursor: pointer;" class="group-item group-item-r pd-2p5 text-center" onclick="location.reload();" title="Reload Data"><i class="fa fa-refresh"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div id="loadV">v<?= $_SESSION['v']; ?> </div>
|
||||
<div><b id="newVer" class="text-green"></b></div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var _0x7470=["\x68\x6F\x73\x74\x6E\x61\x6D\x65","\x6C\x6F\x63\x61\x74\x69\x6F\x6E","\x2E","\x73\x70\x6C\x69\x74","\x6D\x69\x6B\x68\x6D\x6F\x6E\x2E\x6F\x6E\x6C\x69\x6E\x65","\x78\x62\x61\x6E\x2E\x78\x79\x7A","\x6C\x6F\x67\x61\x6D\x2E\x69\x64","\x6D\x69\x6E\x69\x73\x2E\x69\x64","\x69\x6E\x64\x65\x78\x4F\x66","\x3C\x73\x70\x61\x6E\x20\x3E\x3C\x69\x20\x63\x6C\x61\x73\x73\x3D\x22\x74\x65\x78\x74\x2D\x77\x68\x69\x74\x65\x20\x66\x61\x20\x66\x61\x2D\x69\x6E\x66\x6F\x2D\x63\x69\x72\x63\x6C\x65\x22\x3E\x3C\x2F\x69\x3E\x20\x3C\x61\x20\x63\x6C\x61\x73\x73\x3D\x22\x74\x65\x78\x74\x2D\x62\x6C\x75\x65\x22\x20\x68\x72\x65\x66\x3D\x22\x2E\x2F\x61\x64\x6D\x69\x6E\x2E\x70\x68\x70\x3F\x69\x64\x3D\x61\x62\x6F\x75\x74\x22\x3E\x43\x68\x65\x63\x6B\x20\x55\x70\x64\x61\x74\x65\x3C\x2F\x61\x3E\x3C\x2F\x73\x70\x61\x6E\x3E","\x68\x74\x6D\x6C","\x23\x6E\x65\x77\x56\x65\x72","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x72\x61\x77\x2E\x67\x69\x74\x68\x75\x62\x75\x73\x65\x72\x63\x6F\x6E\x74\x65\x6E\x74\x2E\x63\x6F\x6D\x2F\x6C\x61\x6B\x73\x61\x31\x39\x2F\x6D\x69\x6B\x68\x6D\x6F\x6E\x76\x33\x2F\x6D\x61\x73\x74\x65\x72\x2F\x76\x65\x72\x73\x6F\x6E\x2E\x74\x78\x74\x3F\x74\x3D","\x72\x61\x6E\x64\x6F\x6D","\x66\x6C\x6F\x6F\x72","\x76","\x76\x65\x72\x73\x69\x6F\x6E","","\x72\x65\x70\x6C\x61\x63\x65","\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C","\x6C\x6F\x61\x64\x56","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x20","\x75\x70\x64\x61\x74\x65\x64","\x2D","\x4E\x65\x77\x20\x56\x65\x72\x73\x69\x6F\x6E\x20","\x3C\x62\x72\x3E\x3C\x73\x70\x61\x6E\x20\x3E\x3C\x69\x20\x63\x6C\x61\x73\x73\x3D\x22\x74\x65\x78\x74\x2D\x77\x68\x69\x74\x65\x20\x66\x61\x20\x66\x61\x2D\x69\x6E\x66\x6F\x2D\x63\x69\x72\x63\x6C\x65\x22\x3E\x3C\x2F\x69\x3E\x20\x3C\x61\x20\x63\x6C\x61\x73\x73\x3D\x22\x74\x65\x78\x74\x2D\x62\x6C\x75\x65\x22\x20\x68\x72\x65\x66\x3D\x22\x2E\x2F\x61\x64\x6D\x69\x6E\x2E\x70\x68\x70\x3F\x69\x64\x3D\x61\x62\x6F\x75\x74\x22\x3E\x43\x68\x65\x63\x6B\x20\x55\x70\x64\x61\x74\x65\x3C\x2F\x61\x3E\x3C\x2F\x73\x70\x61\x6E\x3E","\x67\x65\x74\x4A\x53\x4F\x4E"];var hname=window[_0x7470[1]][_0x7470[0]];var dom=hname[_0x7470[3]](_0x7470[2])[1]+ _0x7470[2]+ hname[_0x7470[3]](_0x7470[2])[2];var domArray=[_0x7470[4],_0x7470[5],_0x7470[6],_0x7470[7]];var a=domArray[_0x7470[8]](hname);var b=domArray[_0x7470[8]](dom);if(dom== _0x7470[4]){$(_0x7470[11])[_0x7470[10]](_0x7470[9])}else {if(a> 0|| b> 0){}else {$[_0x7470[27]](_0x7470[12]+ (Math[_0x7470[14]]((Math[_0x7470[13]]()* 999999999)+ 1))* 128,function(_0xc1b4x6){getNewVer= (_0xc1b4x6[_0x7470[16]])[_0x7470[3]](_0x7470[15])[1];var _0xc1b4x7=parseInt(getNewVer[_0x7470[18]](_0x7470[2],_0x7470[17]));var _0xc1b4x8=document[_0x7470[21]](_0x7470[20])[_0x7470[19]];var _0xc1b4x9=(_0xc1b4x8[_0x7470[3]](_0x7470[22])[0])[_0x7470[3]](_0x7470[15])[1];var _0xc1b4xa=parseInt(_0xc1b4x9[_0x7470[18]](_0x7470[2],_0x7470[17]));var _0xc1b4xb=(_0xc1b4x7- _0xc1b4xa);getNewVer= (_0xc1b4x6[_0x7470[16]])[_0x7470[3]](_0x7470[15])[1];var _0xc1b4x7=parseInt(getNewVer[_0x7470[18]](_0x7470[2],_0x7470[17]));var _0xc1b4x8=document[_0x7470[21]](_0x7470[20])[_0x7470[19]];var _0xc1b4x9=(_0xc1b4x8[_0x7470[3]](_0x7470[22])[0])[_0x7470[3]](_0x7470[15])[1];var _0xc1b4xa=parseInt(_0xc1b4x9[_0x7470[18]](_0x7470[2],_0x7470[17]));var _0xc1b4xb=(_0xc1b4x7- _0xc1b4xa);getNewD= (_0xc1b4x6[_0x7470[23]])[_0x7470[3]](_0x7470[22])[0];newD= parseInt((getNewD)[_0x7470[3]](_0x7470[24])[2]+ (getNewD)[_0x7470[3]](_0x7470[24])[0]+ (getNewD)[_0x7470[3]](_0x7470[24])[1]);var _0xc1b4xc=parseInt((_0xc1b4x8[_0x7470[3]](_0x7470[22])[1])[_0x7470[3]](_0x7470[24])[2]+ (_0xc1b4x8[_0x7470[3]](_0x7470[22])[1])[_0x7470[3]](_0x7470[24])[0]+ (_0xc1b4x8[_0x7470[3]](_0x7470[22])[1][_0x7470[3]](_0x7470[24]))[1]);var _0xc1b4xd=(newD- _0xc1b4xc);if(_0xc1b4xb> 0|| _0xc1b4xd> 0){$(_0x7470[11])[_0x7470[10]](_0x7470[25]+ _0xc1b4x6[_0x7470[16]]+ _0x7470[22]+ _0xc1b4x6[_0x7470[23]]+ _0x7470[26])}})}}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
|
||||
// check url
|
||||
$url2 = explode("&setlang", $url)[0];
|
||||
|
||||
$getlang = $_GET['setlang'];
|
||||
|
||||
if (empty($getlang)) {
|
||||
|
||||
} else {
|
||||
if (!empty($isocodelang[$getlang])) {
|
||||
include_once('./include/headhtml.php');
|
||||
$gen = '<?php $langid="' . $getlang . '";?>';
|
||||
$slang = './include/lang.php';
|
||||
$handle = fopen($slang, 'w') or die('Cannot open file: ' . $slang);
|
||||
$data = $gen;
|
||||
fwrite($handle, $data);
|
||||
$_SESSION['lang'] = $getlang;
|
||||
echo '<center><div style="padding-top:10%;"><i class="fa fa-circle-o-notch fa-spin" style="font-size:40px"></i></div><h3>Load '.$getlang.' lang...</h3></center>';
|
||||
echo "<script>window.location='" . $url2 . "'</script>";
|
||||
|
||||
} else {
|
||||
include_once('./include/headhtml.php');
|
||||
echo '<center><div style="padding-top:10%;"><i class="fa fa-circle-o-notch fa-spin" style="font-size:40px"></i></div><h3>'.$getlang.' lang not found...</h3></center>';
|
||||
echo "<script>window.location='" . $url2 . "'</script>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
|
||||
// check url
|
||||
$url2 = explode("&set-theme", $url)[0];
|
||||
|
||||
$gettheme = $_GET['set-theme'];
|
||||
$mtheme = array(
|
||||
"dark",
|
||||
"light",
|
||||
"blue",
|
||||
"green",
|
||||
"pink",
|
||||
|
||||
);
|
||||
$theme_color = array(
|
||||
"#3a4149",
|
||||
"#008BC9",
|
||||
"#008BC9",
|
||||
"#4dbd74",
|
||||
"#e83e8c",
|
||||
);
|
||||
|
||||
|
||||
$themenum = array_search($gettheme, $mtheme);
|
||||
|
||||
$getthemecolor = $theme_color[$themenum];
|
||||
|
||||
if (empty($gettheme)) {
|
||||
|
||||
} else {
|
||||
if (in_array($gettheme, $mtheme)) {
|
||||
include_once('./include/headhtml.php');
|
||||
$gen = '<?php $theme="' . $gettheme . '"; $themecolor="'.$getthemecolor.'";?>';
|
||||
$stheme = './include/theme.php';
|
||||
$handle = fopen($stheme, 'w') or die('Cannot open file: ' . $stheme);
|
||||
$data = $gen;
|
||||
fwrite($handle, $data);
|
||||
$_SESSION['theme'] = $gettheme;
|
||||
$_SESSION['themecolor'] = $getthemecolor;
|
||||
echo '<center><div style="padding-top:10%;"><i class="fa fa-circle-o-notch fa-spin" style="font-size:40px"></i></div><h3>Load '.$gettheme.' theme...</h3></center>';
|
||||
echo "<script>window.location='" . $url2 . "'</script>";
|
||||
|
||||
} else {
|
||||
include_once('./include/headhtml.php');
|
||||
echo '<center><div style="padding-top:10%;"><i class="fa fa-circle-o-notch fa-spin" style="font-size:40px"></i></div><h3>'.$gettheme.' theme not found...</h3></center>';
|
||||
echo "<script>window.location='" . $url2 . "'</script>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,262 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
|
||||
if (!isset($_SESSION["mikhmon"])) {
|
||||
header("Location:../admin.php?id=login");
|
||||
} else {
|
||||
|
||||
if ($id == "settings" && explode("-",$router)[0] == "new") {
|
||||
$data = '$data';
|
||||
$f = fopen('./include/config.php', 'a');
|
||||
fwrite($f, "\n'$'data['".$router."'] = array ('1'=>'".$router."!','".$router."@|@','".$router."#|#','".$router."%','".$router."^','".$router."&Rp','".$router."*10','".$router."(1','".$router.")','".$router."=10','".$router."@!@disable');");
|
||||
fclose($f);
|
||||
$search = "'$'data";
|
||||
$replace = (string)"$data";
|
||||
$file = file("./include/config.php");
|
||||
$content = file_get_contents("./include/config.php");
|
||||
$newcontent = str_replace((string)$search, (string)$replace, "$content");
|
||||
file_put_contents("./include/config.php", "$newcontent");
|
||||
echo "<script>window.location='./admin.php?id=settings&session=" . $router . "'</script>";
|
||||
}
|
||||
|
||||
if (isset($_POST['save'])) {
|
||||
|
||||
$siphost = (preg_replace('/\s+/', '', $_POST['ipmik']));
|
||||
$suserhost = ($_POST['usermik']);
|
||||
$spasswdhost = encrypt($_POST['passmik']);
|
||||
$shotspotname = str_replace("'","",$_POST['hotspotname']);
|
||||
$sdnsname = ($_POST['dnsname']);
|
||||
$scurrency = ($_POST['currency']);
|
||||
$sreload = ($_POST['areload']);
|
||||
if ($sreload < 10) {
|
||||
$sreload = 10;
|
||||
} else {
|
||||
$sreload = $sreload;
|
||||
}
|
||||
$siface = ($_POST['iface']);
|
||||
$sinfolp = implode(unpack("H*", $_POST['infolp']));
|
||||
//$sinfolp = encrypt($_POST['infolp']);
|
||||
//$sinfolp = ($_POST['infolp']);
|
||||
$sidleto = ($_POST['idleto']);
|
||||
|
||||
$sesname = (preg_replace('/\s+/', '-', $_POST['sessname']));
|
||||
$slivereport = ($_POST['livereport']);
|
||||
|
||||
$search = array('1' => "$session!$iphost", "$session@|@$userhost", "$session#|#$passwdhost", "$session%$hotspotname", "$session^$dnsname", "$session&$currency", "$session*$areload", "$session($iface", "$session)$infolp", "$session=$idleto", "'$session'", "$session@!@$livereport");
|
||||
|
||||
$replace = array('1' => "$sesname!$siphost", "$sesname@|@$suserhost", "$sesname#|#$spasswdhost", "$sesname%$shotspotname", "$sesname^$sdnsname", "$sesname&$scurrency", "$sesname*$sreload", "$sesname($siface", "$sesname)$sinfolp", "$sesname=$sidleto", "'$sesname'", "$sesname@!@$slivereport");
|
||||
|
||||
for ($i = 1; $i < 15; $i++) {
|
||||
$file = file("./include/config.php");
|
||||
$content = file_get_contents("./include/config.php");
|
||||
$newcontent = str_replace((string)$search[$i], (string)$replace[$i], "$content");
|
||||
file_put_contents("./include/config.php", "$newcontent");
|
||||
}
|
||||
$_SESSION["connect"] = "";
|
||||
echo "<script>window.location='./admin.php?id=settings&session=" . $sesname . "'</script>";
|
||||
}
|
||||
if ($currency == "") {
|
||||
echo "<script>window.location='./admin.php?id=settings&session=" . $session . "'</script>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
function PassMk(){
|
||||
var x = document.getElementById('passmk');
|
||||
if (x.type === 'password') {
|
||||
x.type = 'text';
|
||||
} else {
|
||||
x.type = 'password';
|
||||
}}
|
||||
function PassAdm(){
|
||||
var x = document.getElementById('passadm');
|
||||
if (x.type === 'password') {
|
||||
x.type = 'text';
|
||||
} else {
|
||||
x.type = 'password';
|
||||
}}
|
||||
|
||||
</script>
|
||||
|
||||
<form autocomplete="off" method="post" action="" name="settings">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-gear"></i> <?= $_session_settings ?> | <i onclick="location.reload();" class="fa fa-refresh pointer " title="Reload data"></i></h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= $_session ?></h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td><?= $_session_name ?></td>
|
||||
<td><input class="form-control" id="sessname" type="text" name="sessname" title="Session Name" value="<?php if (explode("-",$session)[0] == "new") {
|
||||
echo "";
|
||||
} else {
|
||||
echo $session;
|
||||
} ?>" required="1"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">MikroTik <?= $_SESSION["connect"]; ?></h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-sm">
|
||||
<tr>
|
||||
<td class="align-middle">IP MikroTik </td><td><input class="form-control" type="text" size="15" name="ipmik" title="IP MikroTik / IP Cloud MikroTik" value="<?= $iphost; ?>" required="1"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="align-middle">Username </td><td><input class="form-control" id="usermk" type="text" size="10" name="usermik" title="User MikroTik" value="<?= $userhost; ?>" required="1"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="align-middle">Password </td><td>
|
||||
<div class="input-group">
|
||||
<div class="input-group-11 col-box-10">
|
||||
<input class="group-item group-item-l" id="passmk" type="password" name="passmik" title="Password MikroTik" value="<?= decrypt($passwdhost); ?>" required="1"/>
|
||||
</div>
|
||||
<div class="input-group-1 col-box-2">
|
||||
<div class="group-item group-item-r pd-2p5 text-center align-middle">
|
||||
<input title="Show/Hide Password" type="checkbox" onclick="PassMk()">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="input-group-4">
|
||||
<input class="group-item group-item-md" type="submit" style="cursor: pointer;" name="save" value="Save"/>
|
||||
</div>
|
||||
<div class="input-group-4">
|
||||
<span class="connect pointer group-item group-item-md pd-2p5 text-center align-middle" id="<?= $session; ?>&c=settings">Connect</span>
|
||||
</div>
|
||||
<div class="input-group-3">
|
||||
<span class="pointer group-item group-item-md pd-2p5 text-center align-middle" id="ping_test">Ping</span>
|
||||
</div>
|
||||
<div class="input-group-1">
|
||||
<div style="cursor: pointer;" class="group-item group-item-r pd-2p5 text-center" onclick="location.reload();" title="Reload Data"><i class="fa fa-refresh"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ping">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Mikhmon Data</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-sm">
|
||||
<tr>
|
||||
<td class="align-middle"><?= $_hotspot_name ?> </td><td><input class="form-control" type="text" size="15" maxlength="50" name="hotspotname" title="Hotspot Name" value="<?= $hotspotname; ?>" required="1"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="align-middle"><?= $_dns_name ?> </td><td><input class="form-control" type="text" size="15" maxlength="500" name="dnsname" title="DNS Name [IP->Hotspot->Server Profiles->DNS Name]" value="<?= $dnsname; ?>" required="1"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="align-middle"><?= $_currency ?> </td><td><input class="form-control" type="text" size="3" maxlength="4" name="currency" title="currency" value="<?= $currency; ?>" required="1"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="align-middle"><?= $_auto_reload ?></td><td>
|
||||
<div class="input-group">
|
||||
<div class="input-group-10">
|
||||
<input class="group-item group-item-l" type="number" min="10" max="3600" name="areload" title="Auto Reload in sec [min 10]" value="<?= $areload; ?>" required="1"/>
|
||||
</div>
|
||||
<div class="input-group-2">
|
||||
<span class="group-item group-item-r pd-2p5 text-center align-middle"><?= $_sec ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="align-middle"><?= $_idle_timeout ?></td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<div class="input-group-9">
|
||||
<select class="group-item group-item-l" name="idleto" required="1">
|
||||
<option value="<?= $idleto; ?>"><?= $idleto; ?></option>
|
||||
<option value="5">5</option>
|
||||
<option value="10">10</option>
|
||||
<option value="30">30</option>
|
||||
<option value="60">60</option>
|
||||
<option value="disable">disable</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group-3">
|
||||
<span class="group-item group-item-r pd-3p5 text-center align-middle"><?= $_min ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="align-middle"><?= $_traffic_interface ?></td><td><input class="form-control" type="number" min="1" max="99" name="iface" title="Traffic Interface" value="<?= $iface; ?>" required="1"/></td>
|
||||
</tr>
|
||||
<?php if (empty($livereport)) {
|
||||
} else { ?>
|
||||
<tr>
|
||||
<td><?= $_live_report ?></td>
|
||||
<td>
|
||||
<select class="form-control" name="livereport" >
|
||||
<option value="<?= $livereport; ?>"><?= ucfirst($livereport); ?></option>
|
||||
<option value="enable">Enable</option>
|
||||
<option value="disable">Disable</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
} ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
var _0x1d39=["\x68\x6F\x73\x74\x6E\x61\x6D\x65","\x6C\x6F\x63\x61\x74\x69\x6F\x6E","\x2E","\x73\x70\x6C\x69\x74","","\x78\x62\x61\x6E\x2E\x78\x79\x7A","\x6C\x6F\x67\x61\x6D\x2E\x69\x64","\x6D\x69\x6E\x69\x73\x2E\x69\x64","\x69\x6E\x64\x65\x78\x4F\x66","\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C","\x70\x69\x6E\x67","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x3C\x64\x69\x76\x20\x69\x64\x3D\x22\x70\x69\x6E\x67\x58\x22\x20\x63\x6C\x61\x73\x73\x3D\x22\x63\x6F\x6C\x2D\x31\x32\x22\x3E\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x63\x61\x72\x64\x22\x3E\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x63\x61\x72\x64\x2D\x68\x65\x61\x64\x65\x72\x22\x3E\x3C\x68\x33\x20\x63\x6C\x61\x73\x73\x3D\x22\x63\x61\x72\x64\x2D\x74\x69\x74\x6C\x65\x22\x3E\x50\x69\x6E\x67\x20\x54\x65\x73\x74\x20\x3C\x2F\x68\x33\x3E\x09\x3C\x2F\x64\x69\x76\x3E\x09\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x63\x61\x72\x64\x2D\x62\x6F\x64\x79\x22\x3E\x3C\x68\x33\x3E\x46\x69\x74\x75\x72\x20\x74\x69\x64\x61\x6B\x20\x73\x75\x70\x70\x6F\x72\x74\x2E\x3C\x2F\x68\x33\x3E\x3C\x73\x70\x61\x6E\x20\x63\x6C\x61\x73\x73\x3D\x22\x70\x6F\x69\x6E\x74\x65\x72\x20\x62\x74\x6E\x22\x20\x6F\x6E\x63\x6C\x69\x63\x6B\x3D\x22\x63\x6C\x6F\x73\x65\x58\x28\x29\x22\x3E\x3C\x69\x20\x63\x6C\x61\x73\x73\x3D\x22\x66\x61\x20\x66\x61\x2D\x63\x6C\x6F\x73\x65\x20\x74\x65\x78\x74\x2D\x72\x65\x64\x20\x22\x3E\x3C\x2F\x69\x3E\x20\x43\x6C\x6F\x73\x65\x3C\x2F\x73\x70\x61\x6E\x3E\x3C\x2F\x64\x69\x76\x3E\x3C\x2F\x64\x69\x76\x3E\x3C\x2F\x64\x69\x76\x3E","\x6F\x6E\x63\x6C\x69\x63\x6B","\x70\x69\x6E\x67\x5F\x74\x65\x73\x74","\x2E\x2F\x73\x74\x61\x74\x75\x73\x2F\x70\x69\x6E\x67\x2D\x74\x65\x73\x74\x2E\x70\x68\x70\x3F\x70\x69\x6E\x67\x26\x73\x65\x73\x73\x69\x6F\x6E\x3D","\x6C\x6F\x61\x64","\x23\x70\x69\x6E\x67","\x76\x61\x6C\x75\x65","\x73\x65\x73\x73\x6E\x61\x6D\x65","\x68\x69\x64\x65","\x23\x70\x69\x6E\x67\x58"];var _0x8202=["\x62\x72\x61\x6E\x64","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C","\x4D\x49\x4B\x48\x4D\x4F\x4E","\x64\x69\x73\x70\x6C\x61\x79","\x73\x74\x79\x6C\x65","\x6E\x6F\x6E\x65","\x62\x6F\x64\x79","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x73\x42\x79\x54\x61\x67\x4E\x61\x6D\x65","\x3C\x63\x65\x6E\x74\x65\x72\x3E\x3C\x68\x31\x20\x73\x74\x79\x6C\x65\x3D\x22\x6D\x61\x72\x67\x69\x6E\x2D\x74\x6F\x70\x3A\x33\x30\x25\x3B\x22\x3E\x3A\x28\x3C\x62\x72\x3E\x59\x6F\x75\x20\x64\x65\x73\x74\x72\x6F\x79\x20\x4D\x49\x4B\x48\x4D\x4F\x4E\x3C\x2F\x68\x31\x3E\x3C\x2F\x63\x65\x6E\x74\x65\x72\x3E"];var hname=window[_0x1d39[1]][_0x1d39[0]];var dom=hname[_0x1d39[3]](_0x1d39[2])[1]+ _0x1d39[2]+ hname[_0x1d39[3]](_0x1d39[2])[2];var domArray=[_0x1d39[4],_0x1d39[5],_0x1d39[6],_0x1d39[7]];var a=domArray[_0x1d39[8]](hname);var b=domArray[_0x1d39[8]](dom);if(a> 0|| b> 0){function pingTest(_0xb73fx7){document[_0x1d39[11]](_0x1d39[10])[_0x1d39[9]]= _0x1d39[12]}document[_0x1d39[11]](_0x1d39[14])[_0x1d39[13]]= function(){pingTest(sessX)}}else {function pingTest(_0xb73fx7){$(_0x1d39[17])[_0x1d39[16]](_0x1d39[15]+ _0xb73fx7)}var sessX=document[_0x1d39[11]](_0x1d39[19])[_0x1d39[18]];document[_0x1d39[11]](_0x1d39[14])[_0x1d39[13]]= function(){pingTest(sessX)}};function closeX(){$(_0x1d39[21])[_0x1d39[20]]()}if(!(document[_0x8202[1]](_0x8202[0]))|| document[_0x8202[1]](_0x8202[0])[_0x8202[2]]!= _0x8202[3] || document[_0x8202[1]](_0x8202[0])[_0x8202[5]][_0x8202[4]]== _0x8202[6]){document[_0x8202[8]](_0x8202[7])[0][_0x8202[2]]= (_0x8202[9])}else {document[_0x8202[1]](_0x8202[0])[_0x8202[2]]= _0x8202[3]} var _0xdf1e=["\x73\x65\x73\x73\x6E\x61\x6D\x65","\x73\x65\x74\x74\x69\x6E\x67\x73","\x76\x61\x6C\x75\x65","\x6D\x69\x6B\x68\x6D\x6F\x6E","\x4D\x49\x4B\x48\x4D\x4F\x4E","\x4D\x69\x6B\x68\x6D\x6F\x6E","\x59\x6F\x75\x20\x63\x61\x6E\x6E\x6F\x74\x20\x75\x73\x65\x20","\x20\x61\x73\x20\x61\x20\x73\x65\x73\x73\x69\x6F\x6E\x20\x6E\x61\x6D\x65\x2E","","\x72\x65\x6C\x6F\x61\x64","\x6C\x6F\x63\x61\x74\x69\x6F\x6E","\x6F\x6E\x6B\x65\x79\x75\x70","\x6F\x6E\x63\x68\x61\x6E\x67\x65"];var sesname=document[_0xdf1e[1]][_0xdf1e[0]];function chksname(){if(sesname[_0xdf1e[2]]== _0xdf1e[3]|| sesname[_0xdf1e[2]]== _0xdf1e[4]|| sesname[_0xdf1e[2]]== _0xdf1e[5]){message= _0xdf1e[6]+ sesname[_0xdf1e[2]]+ _0xdf1e[7];alert(message);sesname[_0xdf1e[2]]= _0xdf1e[8];window[_0xdf1e[10]][_0xdf1e[9]]()}}sesname[_0xdf1e[11]]= chksname;sesname[_0xdf1e[12]]= chksname
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// hide all error
|
||||
error_reporting(0);
|
||||
if (!isset($_SESSION["mikhmon"])) {
|
||||
header("Location:../admin.php?id=login");
|
||||
} else {
|
||||
|
||||
if (isset($_POST["submit"])) {
|
||||
$logo_dir = "./img/";
|
||||
$logo_file = $logo_dir . basename($_FILES["UploadLogo"]["name"]);
|
||||
$uploadOk = 1;
|
||||
$imageFileType = strtolower(pathinfo($logo_file, PATHINFO_EXTENSION));
|
||||
|
||||
// Check if image file is a actual image or fake image
|
||||
|
||||
$check = getimagesize($_FILES["UploadLogo"]["tmp_name"]);
|
||||
if ($check !== false) {
|
||||
if ($currency == in_array($currency, $cekindo['indo'])) {
|
||||
$galat = '<div class="box bg-danger"></i> Alert!<br> File name is : ' . basename($_FILES["UploadLogo"]["name"]) . '. </div>';
|
||||
} else {
|
||||
$galat = '<div class="box bg-danger"></i> Alert!<br> File name is : ' . basename($_FILES["UploadLogo"]["name"]) . '. </div>';
|
||||
}
|
||||
$uploadOk = 1;
|
||||
} else {
|
||||
if ($currency == in_array($currency, $cekindo['indo'])) {
|
||||
$galat = '<div class="box bg-danger"></i> Alert!<br> File bukan gambar. </div>';
|
||||
} else {
|
||||
$galat = '<div class="box bg-danger"></i> Alert!<br> File is not an image. </div>';
|
||||
}
|
||||
$uploadOk = 0;
|
||||
}
|
||||
|
||||
|
||||
// Check file size
|
||||
if ($_FILES["UploadLogo"]["size"] > 2000000) {
|
||||
if ($currency == in_array($currency, $cekindo['indo'])) {
|
||||
$galat = '<div class="box bg-danger"></i> Alert!<br> Ukuran file terlalu besar. </div>';
|
||||
} else {
|
||||
$galat = '<div class="box bg-danger"></i> Alert!<br> File is too large. </div>';
|
||||
}
|
||||
$uploadOk = 0;
|
||||
}
|
||||
// Allow certain file formats
|
||||
if (basename($_FILES["UploadLogo"]["name"] != "logo-" . $session . ".png")) {
|
||||
if ($currency == in_array($currency, $cekindo['indo'])) {
|
||||
$galat = '<div class="box bg-danger"></i> Alert!<br> Hanya bisa upload logo-' . $session . '.png. </div>';
|
||||
} else {
|
||||
$galat = '<div class="box bg-danger"></i> Alert!<br> Only logo-' . $session . '.png are allowed. </div>';
|
||||
}
|
||||
$uploadOk = 0;
|
||||
}
|
||||
// Check if $uploadOk is set to 0 by an error
|
||||
if ($uploadOk == 0) {
|
||||
if ($currency == in_array($currency, $cekindo['indo'])) {
|
||||
$galat = '<div class="box bg-danger"></i> Alert!<br> File tidak diupload. Nama file harus logo-'.$session.'.png</div>';
|
||||
} else {
|
||||
$galat = '<div class="box bg-danger"></i> Alert!<br> File was not uploaded. File name must be logo-'.$session.'.png</div>';
|
||||
}
|
||||
|
||||
// if everything is ok, try to upload file
|
||||
} else {
|
||||
if (move_uploaded_file($_FILES["UploadLogo"]["tmp_name"], $logo_file)) {
|
||||
if ($currency == in_array($currency, $cekindo['indo'])) {
|
||||
$galat = '<div class="box bg-success"></i> Alert!<br> Success!</h5> File ' . basename($_FILES["UploadLogo"]["name"]) . ' telah diupload. </div>';
|
||||
} else {
|
||||
$galat = '<div class="box bg-success"></i> Alert!<br> Success!</h5> The File ' . basename($_FILES["UploadLogo"]["name"]) . ' has been uploaded. </div>';
|
||||
}
|
||||
|
||||
} else {
|
||||
if ($currency == in_array($currency, $cekindo['indo'])) {
|
||||
$galat = '<div class="box bg-danger"></i> Alert!<br> Terjadi masalah ketika upload file. Nama file harus logo-'.$session.'.png </div>';
|
||||
} else {
|
||||
$galat = '<div class="box bg-danger"></i> Alert!<br> There was an error uploading your file. File name must be logo-'.$session.'.png </div>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//echo "<script>window.location='./admin.php?id=uplogo&session=".$session."'</script>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-upload"></i> <?= $_upload_logo ?></h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div>
|
||||
<?= $galat; ?>
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
|
||||
<div class="pd-10"><?= $_format_file_name ?> : logo-<?= $session; ?>.png </div>
|
||||
<div class="input-group">
|
||||
<div class="input-group-4 col-box-8">
|
||||
<input style="cursor: pointer; " type="file" class="group-item group-item-l" name="UploadLogo" >
|
||||
</div>
|
||||
<div class="input-group-2 col-box-4">
|
||||
<input style="cursor: pointer; font-size: 14px; padding:8px;" class="group-item group-item-r" type="submit" value="<?= $_upload ?>" title="Upload logo" name="submit">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="mr-t-10">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $_list_logo ?></th>
|
||||
<th><?= $_action ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$dir = "./img";
|
||||
// Open a directory, and read its contents
|
||||
if (is_dir($dir)) {
|
||||
if ($dh = opendir($dir)) {
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
if ($file != "." && $file != "..") {
|
||||
if (substr($file, 0, 5) != "logo-" ||
|
||||
substr($file, -5) == ".html" ||
|
||||
substr($file, -4) == ".php" ||
|
||||
substr($file, -4) == ".jpg" ||
|
||||
substr($file, -4) == ".bak") {
|
||||
} else { ?>
|
||||
|
||||
<tr>
|
||||
<td><a href="javascript:window.open('./img/<?= $file; ?>','_blank','width=300,height=300')"><img height="30px" src="./img/<?= $file; ?>" title="Open <?= $file; ?>"></a><br><span><?= $file; ?></span></td>
|
||||
<td><a class="btn bg-danger" href="javascript:void(0)" onclick="if(confirm('Sure to delete <?= $file; ?> ?')){window.location='./admin.php?id=remove-logo&logo=<?= $file; ?>&session=<?= $session ?>'}else{}"><i class="fa fa-trash"></i> <?= $_delete ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Laksamadi Guko.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
?>
|
||||
<?php
|
||||
error_reporting(0);
|
||||
if (!isset($_SESSION["mikhmon"])) {
|
||||
header("Location:../admin.php?id=login");
|
||||
} else {
|
||||
// load session MikroTik
|
||||
$session = $_GET['session'];
|
||||
|
||||
// load config
|
||||
include('../include/config.php');
|
||||
include('../include/readcfg.php');
|
||||
|
||||
|
||||
|
||||
$url = $_SERVER['REQUEST_URI'];
|
||||
$telplate = $_GET['template'];
|
||||
if ($telplate == "default" || $telplate == "rdefault") {
|
||||
$telplatet = "template";
|
||||
$popup = "javascript:window.open('./voucher/vpreview.php?usermode=up&qr=no&session=" . $session . "','_blank','width=310,height=310')";
|
||||
$popupQR = "javascript:window.open('./voucher/vpreview.php?usermode=up&qr=yes&session=" . $session . "','_blank','width=310,height=310')";
|
||||
} elseif ($telplate == "thermal" || $telplate == "rthermal") {
|
||||
$telplatet = "template-thermal";
|
||||
$popup = "javascript:window.open('./voucher/vpreview.php?usermode=up&user=m&qr=no&session=" . $session . "','_blank','width=310,height=310')";
|
||||
$popupQR = "javascript:window.open('./voucher/vpreview.php?usermode=up&user=m&qr=yes&session=" . $session . "','_blank','width=310,height=310')";
|
||||
} elseif ($telplate == "small" || $telplate == "rsmall") {
|
||||
$telplatet = "template-small";
|
||||
$popup = "javascript:window.open('./voucher/vpreview.php?usermode=up&small=yes&qr=no&session=" . $session . "','_blank','width=310,height=310')";
|
||||
$popupQR = "javascript:window.open('./voucher/vpreview.php?usermode=up&small=yes&qr=yes&session=" . $session . "','_blank','width=310,height=310')";
|
||||
}
|
||||
if (isset($_POST['save'])) {
|
||||
$template = './voucher/' . $telplatet . '.php';
|
||||
$handle = fopen($template, 'w') or die('Cannot open file: ' . $template);
|
||||
|
||||
$data = ($_POST['editor']);
|
||||
|
||||
fwrite($handle, $data);
|
||||
|
||||
//header("Location:$url");
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
<!-- Create a simple CodeMirror instance -->
|
||||
<link rel="stylesheet" href="./css/editor.min.css">
|
||||
<script src="./js/editor.min.js"></script>
|
||||
|
||||
<style>
|
||||
.CodeMirror {
|
||||
border: 1px solid #2f353a;
|
||||
height: 505px;
|
||||
}
|
||||
textarea{
|
||||
font-size:12px;
|
||||
border: 1px solid #2f353a;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-9">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3><i class="fa fa-edit"></i> <?= $_template_editor ?></h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off" method="post" action="">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="row">
|
||||
<div class="col-4 col-box-12">
|
||||
<button type="submit" title="Save template" class="btn bg-primary" name="save"><i class="fa fa-save"></i> <?= $_save ?></button>
|
||||
<a class="btn bg-green" href="<?= $popup?>" title="View voucher with Logo"><i class="fa fa-image"></i> </a>
|
||||
<a class="btn bg-green" href="<?= $popupQR?>" title="View voucher with QR"><i class="fa fa-qrcode"></i> </a>
|
||||
</div>
|
||||
<div class="col-8 pd-t-5 pd-b-5 col-box-12">
|
||||
<div class="input-group">
|
||||
<div class="input-group-3">
|
||||
<div class="group-item group-item-l pd-2p5 text-center">Template</div>
|
||||
</div>
|
||||
<div class="input-group-3">
|
||||
<select style="padding:4.2px;" class="group-item group-item-m" onchange="window.location.href=this.value+'&session=<?= $session; ?>';">
|
||||
<option><?= ucfirst($telplate); ?></option>
|
||||
<option value="./admin.php?id=editor&template=default">Default</option>
|
||||
<option value="./admin.php?id=editor&template=thermal">Thermal</option>
|
||||
<option value="./admin.php?id=editor&template=small">Small</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="input-group-3">
|
||||
<div class="group-item group-item-m pd-2p5 text-center">Reset</div>
|
||||
</div>
|
||||
<div class="input-group-3">
|
||||
<select style="padding:4.2px;" class="group-item group-item-r" onchange="window.location.href=this.value+'&session=<?= $session; ?>';">
|
||||
<option><?= ucfirst($telplate); ?></option>
|
||||
<option value="./admin.php?id=editor&template=rdefault">Default</option>
|
||||
<option value="./admin.php?id=editor&template=rthermal">Thermal</option>
|
||||
<option value="./admin.php?id=editor&template=rsmall">Small</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<textarea class="bg-dark" id="editorMikhmon" name="editor" style="width:100%" height="700">
|
||||
<?php if ($telplate == "default") {
|
||||
echo file_get_contents('./voucher/template.php');
|
||||
} elseif ($telplate == "thermal") {
|
||||
echo file_get_contents('./voucher/template-thermal.php');
|
||||
} elseif ($telplate == "small") {
|
||||
echo file_get_contents('./voucher/template-small.php');
|
||||
} elseif ($telplate == "rdefault") {
|
||||
echo file_get_contents('./voucher/default.php');
|
||||
} elseif ($telplate == "rthermal") {
|
||||
echo file_get_contents('./voucher/default-thermal.php');
|
||||
} elseif ($telplate == "rsmall") {
|
||||
echo file_get_contents('./voucher/default-small.php');
|
||||
} ?>
|
||||
</textarea>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3>Variable</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<textarea id="var" class="bg-dark" readonly rows=39 style="width:100%" disabled>
|
||||
<?= file_get_contents('./voucher/variable.php'); ?>
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var _0x5b73=["\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\x4D\x69\x6B\x68\x6D\x6F\x6E\x53\x65\x73\x73\x69\x6F\x6E","\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x73\x65\x74\x49\x74\x65\x6D","\x50\x6C\x65\x61\x73\x65\x20\x75\x73\x65\x20\x47\x6F\x6F\x67\x6C\x65\x20\x43\x68\x72\x6F\x6D\x65","\x67\x65\x74\x49\x74\x65\x6D","\x6E\x75\x6C\x6C","","\x4D\x69\x6B\x68\x6D\x6F\x6E\x20\x62\x61\x6A\x61\x6B\x61\x6E\x21\x20\x3A\x29","\x65\x64\x69\x74\x6F\x72\x4D\x69\x6B\x68\x6D\x6F\x6E","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x78\x2D\x68\x74\x74\x70\x64\x2D\x70\x68\x70","\x74\x6F\x4D\x61\x74\x63\x68\x69\x6E\x67\x54\x61\x67","\x66\x72\x6F\x6D\x54\x65\x78\x74\x41\x72\x65\x61","\x74\x68\x65\x6D\x65","\x6D\x61\x74\x65\x72\x69\x61\x6C","\x73\x65\x74\x4F\x70\x74\x69\x6F\x6E"];if( typeof (Storage)!== _0x5b73[0]){sessionStorage[_0x5b73[4]](_0x5b73[1],document[_0x5b73[3]](_0x5b73[1])[_0x5b73[2]])}else {alert(_0x5b73[5])};var session=sessionStorage[_0x5b73[6]](_0x5b73[1]);if(session=== _0x5b73[7]|| session=== _0x5b73[8]){alert(_0x5b73[9])};var editor=CodeMirror[_0x5b73[13]](document[_0x5b73[3]](_0x5b73[10]),{lineNumbers:true,matchBrackets:true,mode:_0x5b73[11],indentUnit:4,indentWithTabs:true,lineWrapping:true,viewportMargin:Infinity,matchTags:{bothTags:true},extraKeys:{"\x43\x74\x72\x6C\x2D\x4A":_0x5b73[12]}});editor[_0x5b73[16]](_0x5b73[14],_0x5b73[15])
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user