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 Sep 9, 2018
1 parent 82a750b commit 17f1243
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 13 deletions.
2 changes: 1 addition & 1 deletion include/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<h3><i class="fa fa-info-circle"></i> About</h3>
</div>
<div class="card-body">
<h3>MIKHMON V3.1</h3>
<h3>MIKHMON V3.2</h3>
<p>
Aplikasi ini dipersembahkan untuk pengusaha hotspot di manapun Anda berada.
Semoga makin sukses.
Expand Down
4 changes: 2 additions & 2 deletions include/adduser.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ function PassUser(){
</div>
<div class="input-group-2 col-box-3">
<select style="padding:4.2px;" class="group-item group-item-r" name="mbgb" required="1">
<option value=1000000>MB</option>
<option value=1000000000>GB</option>
<option value=1048576>MB</option>
<option value=1073741824>GB</option>
</select>
</div>
</div>
Expand Down
23 changes: 21 additions & 2 deletions include/adduserprofile.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
header("Location:../admin.php?id=login");
}else{

$getallqueue = $API->comm("/queue/simple/print", array(
"?dynamic"=> "false",
));

if(isset($_POST['name'])){
$name = ($_POST['name']);
$sharedusers = ($_POST['sharedusers']);
Expand All @@ -33,6 +37,7 @@
if($getprice == ""){$price = "0";}else{$price = $getprice;}
$getlock = ($_POST['lockunlock']);
if($getlock == Enable){$lock = ';[:local mac $"mac-address"; /ip hotspot user set mac-address=$mac [find where name=$user]]';}else{$lock = "";}
$parent = ($_POST['parent']);

$onlogin1 = ':put (",rem,'.$price.','.$validity.','.$graceperiod.',,'.$getlock.',"); {:local date [/system clock get date ];:local time [/system clock get time ];:local uptime ('.$validity.');[/system scheduler add disabled=no interval=$uptime name=$user on-event="[/ip hotspot active remove [find where user=$user]];[/ip hotspot user set limit-uptime=1s [find where name=$user]];[/sys sch re [find where name=$user]];[/sys script run [find where name=$user]];[/sys script re [find where name=$user]]" start-date=$date start-time=$time];[/system script add name=$user source=":local date [/system clock get date ];:local time [/system clock get time ];:local uptime ('.$graceperiod.');[/system scheduler add disabled=no interval=\$uptime name=$user on-event= \"[/ip hotspot user remove [find where name=$user]];[/ip hotspot active remove [find where user=$user]];[/sys sch re [find where name=$user]]\"]"]';
$onlogin2 = ':put (",ntf,'.$price.','.$validity.',,,'.$getlock.',"); {:local date [/system clock get date ];:local time [/system clock get time ];:local uptime ('.$validity.');[/system scheduler add disabled=no interval=$uptime name=$user on-event= "[/ip hotspot user set limit-uptime=1s [find where name=$user]];[/ip hotspot active remove [find where user=$user]];[/sys sch re [find where name=$user]]" start-date=$date start-time=$time]';
Expand Down Expand Up @@ -61,6 +66,7 @@
"status-autorefresh" => "1m",
"transparent-proxy" => "yes",
"on-login" => "$onlogin",
"parent-queue" => "$parent",
));

$getprofile = $API->comm("/ip/hotspot/user/profile/print", array(
Expand Down Expand Up @@ -117,12 +123,25 @@
<tr>
<td>Lock User</td><td>
<select class="form-control" id="lockunlock" name="lockunlock" required="1">
<option value="<?php echo $getlocku;?>"><?php echo $getlocku;?></option>
<option value="Enable">Enable</option>
<option value="Disable">Disable</option>
<option value="Enable">Enable</option>
</select>
</td>
</tr>
<tr>
<td class="align-middle">Parent Queue</td>
<td>
<select class="form-control " name="parent">
<option>none</option>
<?php $TotalReg = count($getallqueue);
for ($i=0; $i<$TotalReg; $i++){

echo "<option>" . $getallqueue[$i]['name'] . "</option>";
}
?>
</select>
</td>
</tr>
</table>
</form>
</div>
Expand Down
4 changes: 2 additions & 2 deletions include/generateuser.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@
</div>
<div class="input-group-2 col-box-3">
<select style="padding:4.2px;" class="group-item group-item-r" name="mbgb" required="1">
<option value=1000000>MB</option>
<option value=1000000000>GB</option>
<option value=1048576>MB</option>
<option value=1073741824>GB</option>
</select>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions include/hotspotactive.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<th>Mac Address</th>
<th>Uptime</th>
<th>Bytes Out</th>
<th>Time Left</th>
<th>Login By</th>
<th>Comment</th>
</tr>
Expand All @@ -83,6 +84,7 @@
$address = $hotspotactive['address'];
$mac = $hotspotactive['mac-address'];
$uptime = formatDTM($hotspotactive['uptime']);
$usesstime = formatDTM($hotspotactive['session-time-left']);
$byteso = formatBytes($hotspotactive['bytes-out'], 2);
$loginby = $hotspotactive['login-by'];
$comment = $hotspotactive['comment'];
Expand All @@ -95,6 +97,7 @@
echo "<td>" . $mac . "</td>";
echo "<td style='text-align:right;'>" . $uptime . "</td>";
echo "<td style='text-align:right;'>" . $byteso . "</td>";
echo "<td style='text-align:right;'>" . $usesstime . "</td>";
echo "<td>" . $loginby . "</td>";
echo "<td>" . $comment . "</td>";
echo "</tr>";
Expand Down
10 changes: 5 additions & 5 deletions include/userbyname.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
$ucomment = $userdetails['comment'];

if(substr(formatBytes2($udatalimit,2),-2) == "MB"){
$udatalimit = $udatalimit/1000000;
$udatalimit = $udatalimit/1048576;
$MG = "MB";
}elseif(substr(formatBytes2($udatalimit,2),-2) == "GB"){
$udatalimit = $udatalimit/1000000000;
$udatalimit = $udatalimit/1073741824;
$MG = "GB";
}elseif($udatalimit == ""){
$udatalimit = "";
Expand Down Expand Up @@ -279,9 +279,9 @@ function PassUser(){
</div>
<div class="input-group-2 col-box-3">
<select style="padding: 4.2px;" class="group-item group-item-r" name="mbgb" required="1">
<option value="<?php if($MG == "MB"){echo "1000000";}elseif($MG == "GB"){echo "1000000000";}?>"><?php echo $MG;?></option>
<option value=1000000>MB</option>
<option value=1000000000>GB</option>
<option value="<?php if($MG == "MB"){echo "1048576";}elseif($MG == "GB"){echo "1073741824";}?>"><?php echo $MG;?></option>
<option value=1048576>MB</option>
<option value=1073741824>GB</option>
</select>
</div>
</div>
Expand Down
22 changes: 22 additions & 0 deletions include/userprofilebyname.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
$psharedu = $profiledetalis['shared-users'];
$pratelimit = $profiledetalis['rate-limit'];
$ponlogin = $profiledetalis['on-login'];
$sparent = $profiledetalis['parent-queue'];

$getexpmode = explode(",",$ponlogin)[1];

Expand All @@ -67,6 +68,10 @@
$getlocku = explode(",",$ponlogin)[6];
if($getlocku == ""){$getprice = "Disable";}else{$getlocku = $getlocku;}

$getallqueue = $API->comm("/queue/simple/print", array(
"?dynamic"=> "false",
));

if(isset($_POST['name'])){
$name = ($_POST['name']);
$sharedusers = ($_POST['sharedusers']);
Expand All @@ -78,6 +83,7 @@
if($getprice == ""){$price = "0";}else{$price = $getprice;}
$getlock = ($_POST['lockunlock']);
if($getlock == Enable){$lock = ';[:local mac $"mac-address"; /ip hotspot user set mac-address=$mac [find where name=$user]]';}else{$lock = "";}
$parent = ($_POST['parent']);

$onlogin1 = ':put (",rem,'.$price.','.$validity.','.$graceperiod.',,'.$getlock.',"); {:local date [/system clock get date ];:local time [/system clock get time ];:local uptime ('.$validity.');[/system scheduler add disabled=no interval=$uptime name=$user on-event="[/ip hotspot active remove [find where user=$user]];[/ip hotspot user set limit-uptime=1s [find where name=$user]];[/sys sch re [find where name=$user]];[/sys script run [find where name=$user]];[/sys script re [find where name=$user]]" start-date=$date start-time=$time];[/system script add name=$user source=":local date [/system clock get date ];:local time [/system clock get time ];:local uptime ('.$graceperiod.');[/system scheduler add disabled=no interval=\$uptime name=$user on-event= \"[/ip hotspot user remove [find where name=$user]];[/ip hotspot active remove [find where user=$user]];[/sys sch re [find where name=$user]]\"]"]';
$onlogin2 = ':put (",ntf,'.$price.','.$validity.',,,'.$getlock.',"); {:local date [/system clock get date ];:local time [/system clock get time ];:local uptime ('.$validity.');[/system scheduler add disabled=no interval=$uptime name=$user on-event= "[/ip hotspot user set limit-uptime=1s [find where name=$user]];[/ip hotspot active remove [find where user=$user]];[/sys sch re [find where name=$user]]" start-date=$date start-time=$time]';
Expand Down Expand Up @@ -107,6 +113,7 @@
"status-autorefresh" => "1m",
"transparent-proxy" => "yes",
"on-login" => "$onlogin",
"parent-queue" => "$parent",
));
echo "<script>window.location='./app.php?user-profile=".$pid."&session=".$session."'</script>";
}
Expand Down Expand Up @@ -165,6 +172,21 @@
</select>
</td>
</tr>
<tr>
<td class="align-middle">Parent Queue</td>
<td>
<select class="form-control " name="parent">
<option><?php echo $sparent;?></option>
<option>none</option>
<?php $TotalReg = count($getallqueue);
for ($i=0; $i<$TotalReg; $i++){

echo "<option>" . $getallqueue[$i]['name'] . "</option>";
}
?>
</select>
</td>
</tr>
</table>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion include/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
$utimelimit = $userdetails['limit-uptime'];
if($utimelimit == '1s'){$utimelimit = ' expired';}else{$utimelimit = ' '.$utimelimit;}
$udatalimit = $userdetails['limit-bytes-total'];
if($udatalimit == ''){$udatalimit = '';}else{$udatalimit = ' '.formatBytes2($udatalimit,2);}
if($udatalimit == ''){$udatalimit = '';}else{$udatalimit = ' '.formatBytes($udatalimit,2);}

echo "<tr>";
echo "<td style='text-align:center;'><a title='Remove ".$uname. "' href=./app.php?remove-hotspot-user=".$uid ."&session=".$session."><i class='fa fa-minus-square text-danger'></i></a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp";
Expand Down

0 comments on commit 17f1243

Please sign in to comment.