Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
laksa19 authored Jul 14, 2019
1 parent 6544261 commit 5ba6447
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 179 deletions.
20 changes: 4 additions & 16 deletions dashboard/aload.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
// get hotspot log
$getlog = $API->comm("/log/print", array("?topics" => "hotspot,info,debug", ));
$log = array_reverse($getlog);
$THotspotLog = count($getlog);
//$THotspotLog = count($getlog);

if ($livereport == "disable") {
$logh = "457px";
Expand All @@ -232,7 +232,7 @@
<table class="table table-sm table-bordered table-hover" style="font-size: 12px; td.padding:2px;">
<thead>
<tr>
<th><?= $_time ?></th>
<th><?= $_time .$THotspotLog; ?></th>
<th><?= $_users ?> (IP)</th>
<th><?= $_messages ?></th>
</tr>
Expand All @@ -241,20 +241,8 @@

<?php

if ($THotspotLog > 100) {
$n = 100;
} elseif ($THotspotLog > 200) {
$n = 200;
} elseif ($THotspotLog > 300) {
$n = 300;
} elseif ($THotspotLog > 400) {
$n = 400;
} elseif ($THotspotLog > 500) {
$n = 500;
} else {
$n = $THotspotLog;
}
for ($i = 0; $i < $n; $i++) {

for ($i = 0; $i < 20; $i++) {
$mess = explode(":", $log[$i]['message']);
$time = $log[$i]['time'];
echo "<tr>";
Expand Down
32 changes: 16 additions & 16 deletions dashboard/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
} else {
$logh = "350px";
$lreport = "style='display:block;'";
}
/*
// get selling report
$thisD = date("d");
$thisM = strtolower(date("M"));
Expand Down Expand Up @@ -105,7 +107,7 @@
$tBl += explode("-|-", $getSRBl[$i]['name'])[3];
}
}
}*/
}
?>

Expand All @@ -121,6 +123,7 @@
<?php
echo $clock['date'] . " " . $clock['time'] . "<br>
".$_uptime." : " . formatDTM($resource['uptime']);
$_SESSION[$session.'sdate'] = $clock['date'];
?>
</span>
</div>
Expand Down Expand Up @@ -170,7 +173,7 @@
<div class="row">
<div class="col-3 col-box-6">
<div class="box bg-blue bmh-75">
<a href="./?hotspot=active&session=<?= $session; ?>">
<a onclick="cancelPage()" href="./?hotspot=active&session=<?= $session; ?>">
<h1><?= $counthotspotactive; ?>
<span style="font-size: 15px;"><?= $hunit; ?></span>
</h1>
Expand All @@ -182,7 +185,7 @@
</div>
<div class="col-3 col-box-6">
<div class="box bg-green bmh-75">
<a href="./?hotspot=users&profile=all&session=<?= $session; ?>">
<a onclick="cancelPage()" href="./?hotspot=users&profile=all&session=<?= $session; ?>">
<h1><?= $countallusers; ?>
<span style="font-size: 15px;"><?= $uunit; ?></span>
</h1>
Expand All @@ -194,7 +197,7 @@
</div>
<div class="col-3 col-box-6">
<div class="box bg-yellow bmh-75">
<a href="./?hotspot-user=add&session=<?= $session; ?>">
<a onclick="cancelPage()" href="./?hotspot-user=add&session=<?= $session; ?>">
<div>
<h1><i class="fa fa-user-plus"></i>
<span style="font-size: 15px;"><?= $_add ?></span>
Expand All @@ -208,7 +211,7 @@
</div>
<div class="col-3 col-box-6">
<div class="box bg-red bmh-75">
<a href="./?hotspot-user=generate&session=<?= $session; ?>">
<a onclick="cancelPage()" href="./?hotspot-user=generate&session=<?= $session; ?>">
<div>
<h1><i class="fa fa-user-plus"></i>
<span style="font-size: 15px;"><?= $_generate ?></span>
Expand Down Expand Up @@ -355,17 +358,14 @@ function requestDatta(session,iface) {
<span >
<div id="reloadLreport">
<?php
if ($currency == in_array($currency, $cekindo['indo'])) {
$dincome = number_format($tHr, 0, ",", ".");
$mincome = number_format($tBl, 0, ",", ".");
if ($_SESSION[$session.'sdate'] == $_SESSION[$session.'idhr']){
echo $_income." <br/>" . "
".$_today." " . $_SESSION[$session.'totalHr'] . "vcr : " . $currency . " " . $_SESSION[$session.'dincome']. "<br/>
".$_this_month." " . $_SESSION[$session.'totalBl'] . "vcr : " . $currency . " " . $_SESSION[$session.'mincome'];
}else{
$dincome = number_format($tHr, 2);
$mincome = number_format($tBl, 2);
echo "<div id='loader' ><i><span> <i class='fa fa-circle-o-notch fa-spin'></i> ". $_processing." </i></div>";
}
echo $_income."<br/>" . "
".$_today." " . $TotalRHr . "vcr : " . $currency . " " . $dincome . "<br/>
".$_this_month." " . $TotalRBl . "vcr : " . $currency . " " . $mincome;
?>
?>
</div>
</span>
</div>
Expand All @@ -375,7 +375,7 @@ function requestDatta(session,iface) {
<div id="r_3" class="row">
<div class="card">
<div class="card-header">
<h3><a href="./?hotspot=log&session=<?= $session; ?>" title="Open Hotspot Log" ><i class="fa fa-align-justify"></i> <?= $_hotspot_log ?></a></h3></div>
<h3><a onclick="cancelPage()" href="./?hotspot=log&session=<?= $session; ?>" title="Open Hotspot Log" ><i class="fa fa-align-justify"></i> <?= $_hotspot_log ?></a></h3></div>
<div class="card-body">
<div style="padding: 5px; height: <?= $logh; ?> ;" class="mr-t-10 overflow">
<table class="table table-sm table-bordered table-hover" style="font-size: 12px; td.padding:2px;">
Expand All @@ -389,7 +389,7 @@ function requestDatta(session,iface) {
<tbody>
<tr>
<td colspan="3" class="text-center">
<div><i class="fa fa-spinner"></i> Loading logs</div>
<div id="loader" ><i><i class='fa fa-circle-o-notch fa-spin'></i> <?= $_processing ?> </i></div>
</td>
</tr>
</tbody>
Expand Down
18 changes: 18 additions & 0 deletions hotspot/adduserprofile.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"?dynamic" => "false",
));

$getpool = $API->comm("/ip/pool/print");

if (isset($_POST['name'])) {
$name = (preg_replace('/\s+/', '-',$_POST['name']));
$sharedusers = ($_POST['sharedusers']);
Expand All @@ -34,6 +36,7 @@
$validity = ($_POST['validity']);
$graceperiod = ($_POST['graceperiod']);
$getprice = ($_POST['price']);
$addrpool = ($_POST['ppool']);
if ($getprice == "") {
$price = "0";
} else {
Expand Down Expand Up @@ -79,6 +82,7 @@
$API->comm("/ip/hotspot/user/profile/add", array(
/*"add-mac-cookie" => "yes",*/
"name" => "$name",
"address-pool" => "$addrpool",
"rate-limit" => "$ratelimit",
"shared-users" => "$sharedusers",
"status-autorefresh" => "1m",
Expand Down Expand Up @@ -136,6 +140,20 @@
<tr>
<td class="align-middle"><?= $_name ?></td><td><input class="form-control" type="text" onchange="remSpace();" autocomplete="off" name="name" value="" required="1" autofocus></td>
</tr>
<tr>
<td class="align-middle">Address Pool</td>
<td>
<select class="form-control " name="ppool">
<option>none</option>
<?php $TotalReg = count($getpool);
for ($i = 0; $i < $TotalReg; $i++) {

echo "<option>" . $getpool[$i]['name'] . "</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td class="align-middle">Shared Users</td><td><input class="form-control" type="text" size="4" autocomplete="off" name="sharedusers" value="1" required="1"></td>
</tr>
Expand Down
22 changes: 21 additions & 1 deletion hotspot/userprofilebyname.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
}
}

$getpool = $API->comm("/ip/pool/print");

$getprofile = $API->comm("/ip/hotspot/user/profile/print", array(
"?.id" => "$userprofile"
));
Expand All @@ -44,9 +46,10 @@
$psharedu = $profiledetalis['shared-users'];
$pratelimit = $profiledetalis['rate-limit'];
$ponlogin = $profiledetalis['on-login'];
$ppool = $profiledetalis['address-pool'];
$sparent = $profiledetalis['parent-queue'];


if(empty($ppool)){$ppool = "none";}
if(empty($sparent)){$sparent = "none";}

$getexpmode = explode(",", $ponlogin)[1];
Expand Down Expand Up @@ -103,6 +106,7 @@
$validity = ($_POST['validity']);
$graceperiod = ($_POST['graceperiod']);
$getprice = ($_POST['price']);
$addrpool = ($_POST['ppool']);
if ($getprice == "") {
$price = "0";
} else {
Expand Down Expand Up @@ -150,6 +154,7 @@
/*"add-mac-cookie" => "yes",*/
".id" => "$pid",
"name" => "$name",
"address-pool" => "$addrpool",
"rate-limit" => "$ratelimit",
"shared-users" => "$sharedusers",
"status-autorefresh" => "1m",
Expand Down Expand Up @@ -202,6 +207,21 @@
<tr>
<td><?= $_name ?> <i class="fa fa-ci fa-circle <?= $moncolor ?>"></i></td><td><input class="form-control" type="text" onchange="remSpace();" autocomplete="off" name="name" value="<?= $pname; ?>" required="1" autofocus></td>
</tr>
<tr>
<td class="align-middle">Address Pool</td>
<td>
<select class="form-control " name="ppool">
<option><?= $ppool; ?></option>
<option>none</option>
<?php $TotalReg = count($getpool);
for ($i = 0; $i < $TotalReg; $i++) {

echo "<option>" . $getpool[$i]['name'] . "</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>Shared Users</td><td><input class="form-control" type="text" size="4" autocomplete="off" name="sharedusers" value="<?= $psharedu; ?>" required="1"></td>
</tr>
Expand Down
3 changes: 1 addition & 2 deletions include/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
if (!isset($_SESSION["mikhmon"])) {
header("Location:../admin.php?id=login");
} else {
$_SESSION["v"] = "3.15 07-02-2019";
//echo '<span style="display:none" id="ver">315</span>';
$_SESSION["v"] = "3.16 07-14-2019";

}
67 changes: 44 additions & 23 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@

$_SESSION["connect"] = "";

// time zone
date_default_timezone_set($_SESSION['timezone']);

// lang
include('./include/lang.php');
include('./lang/'.$langid.'.php');

// btkey
include('./include/btkey.php');
// quick bt
include('./include/quickbt.php');

// load config
include('./include/config.php');
Expand Down Expand Up @@ -222,13 +225,13 @@
}

// quick print
elseif ($hotspot == "quick-print") {
include_once('./hotspot/quickprint.php');
}
elseif ($hotspot == "quick-print") {
include_once('./hotspot/quickprint.php');
}

// quick print
elseif ($hotspot == "list-quick-print") {
include_once('./hotspot/listquickprint.php');
include_once('./hotspot/listquickprint.php');
}

// add hotspot user
Expand Down Expand Up @@ -272,7 +275,7 @@
echo "<b class='cl-w'><i class='fa fa-circle-o-notch fa-spin' style='font-size:24px'></i> Processing...</b>";

include_once('./process/removeexpiredhotspotuser.php');
}
}

// reset hotspot user
elseif ($resethotspotuser != "") {
Expand Down Expand Up @@ -415,6 +418,11 @@
include_once('./report/resumereport.php');
}

// selling
elseif ($report == "export") {
include_once('./report/export.php');
}

// selling
elseif ($removereport != "") {
echo "<b class='cl-w'><i class='fa fa-circle-o-notch fa-spin' style='font-size:24px'></i> Processing...</b>";
Expand Down Expand Up @@ -502,30 +510,42 @@
<?php
if ($hotspot == "dashboard" || substr(end(explode("/", $url)), 0, 8) == "?session") {
echo '<script>
$(document).ready(function(){
$("#r_3").load("./dashboard/aload.php?session=' . $session . '&load=logs #r_3");
var interval= "' . ($areload * 1000) . '";
setInterval(function() {
$("#r_3").load("./dashboard/aload.php?session=' . $session . '&load=logs #r_3");
var interval1 = "' . ($areload * 1000) . '";
var dashboard = setInterval(function() {
$("#r_1").load("./dashboard/aload.php?session=' . $session . '&load=sysresource #r_1");
$("#r_2").load("./dashboard/aload.php?session=' . $session . '&load=hotspot #r_2");
$("#r_3").load("./dashboard/aload.php?session=' . $session . '&load=logs #r_3");
}, interval);
})
</script>
}, interval1);
';
if ($livereport == "enable" || $livereport == "") {
echo '<script>
$(document).ready(function(){
var interval= "65432";
setInterval(function() {
if($_SESSION[$session.'sdate'] != $_SESSION[$session.'idhr']){
echo '$("#r_4").load("./report/livereport.php?session=' . $session . ' #r_4");';
}else if ($_SESSION[$session.'sdate'] == $_SESSION[$session.'idhr']){
}else{
echo '$("#r_4").load("./report/livereport.php?session=' . $session . ' #r_4");';
}
echo '
var interval2 = "65432";
var livereport = setInterval(function() {
$("#r_4").load("./report/livereport.php?session=' . $session . ' #r_4");
}, interval);
})
}, interval2);
';}
echo '
function cancelPage(){
window.stop();
clearInterval(dashboard);';
if ($livereport == "enable" || $livereport == "") {
echo '
clearInterval(livereport);';
}
echo '
}
</script>';
}

} elseif ($hotspot == "active" && $serveractive != "") {
echo '<script>
$(document).ready(function(){
Expand All @@ -545,7 +565,7 @@
} elseif ($userprofile == "add" || substr($userprofile, 0, 1) == "*" || $userprofile != "") {
echo "<script>
//enable disable input on ready
$(document).ready(function(){
$(document).ready(function(){
var exp = document.getElementById('expmode').value;
var val = document.getElementById('validity').style;
var vali = document.getElementById('validi');
Expand Down Expand Up @@ -577,7 +597,8 @@
});
});
</script>';
</script>
';
}
}
?>
Expand Down
2 changes: 1 addition & 1 deletion js/mikhmon-ui.blue.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5ba6447

Please sign in to comment.