Upload files to "ui/ui"

Signed-off-by: nestict <icttechnest@gmail.com>
This commit is contained in:
nestict 2025-05-24 12:13:20 +02:00
parent fdadc713af
commit ce74640689
5 changed files with 491 additions and 0 deletions

61
ui/ui/dbstatus.tpl Normal file
View File

@ -0,0 +1,61 @@
{include file="sections/header.tpl"}
<div class="container-fluid">
<div class="row">
<div class="col-sm-7">
<div class="card card-primary">
<div class="card-header">Backup Database</div>
<form method="post" action="{$_url}settings/dbbackup">
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th width="50%">{Lang::T('Table Name')}</th>
<th>{Lang::T('Rows')}</th>
<th>Select</th>
</tr>
</thead>
<tbody>
{foreach $tables as $tbl}
<tr>
<td>{$tbl['name']}</td>
<td>{$tbl['rows']}</td>
<td><input type="checkbox" checked name="tables[]" value="{$tbl['name']}"></td>
</tr>
{/foreach}
</tbody>
</table>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">Dont select logs if it failed</div>
<div class="col-md-4 text-right">
<button type="submit" class="btn btn-primary btn-xs btn-block"><i
class="fa fa-download"></i>
{Lang::T('Download Database Backup')}</button>
</div>
</div>
</div>
</form>
</div>
</div>
<div class="col-sm-5">
<div class="card card-primary">
<div class="card-header">Restore Database</div>
<form method="post" action="{$_url}settings/dbrestore" enctype="multipart/form-data">
<div class="card-body">
<div class="row">
<div class="col-md-7"><input type="file" name="json" accept="application/json"></div>
<div class="col-md-5 text-right">
<button type="submit" class="btn btn-primary btn-block btn-xs"><i class="fa fa-upload"></i>
Restore Dabase</button>
</div>
</div>
</div>
</form>
<div class="card-footer">Restoring database will clean up data and then restore all the data</div>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

44
ui/ui/deposit.tpl Normal file
View File

@ -0,0 +1,44 @@
{include file="sections/header.tpl"}
<div class="container-fluid">
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="card card-primary card-hovered card-stacked mb30">
<div class="card-header">{Lang::T('Refill Balance')}</div>
<div class="card-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}plan/deposit-post">
<div class="form-group row">
<label class="col-md-4 control-label">{Lang::T('Select Account')}</label>
<div class="col-md-6">
<select id="personSelect" class="form-control select2" name="id_customer" style="width: 100%"
data-placeholder="{Lang::T('Select a customer')}...">
</select>
</div>
</div>
<div class="form-group row">
<label class="col-md-4 control-label"><a href="{$_url}services/balance">{Lang::T('Balance Plans')}</a></label>
<div class="col-md-6">
<select id="planSelect" class="form-control select2" name="id_plan" style="width: 100%"
data-placeholder="{Lang::T('Select Plans')}...">
<option></option>
{foreach $p as $pl}
<option value="{$pl['id']}">{if $pl['enabled'] neq 1}DISABLED PLAN &bull; {/if}{$pl['name_plan']} - {Lang::moneyFormat($pl['price'])}</option>
{/foreach}
</select>
</div>
</div>
<center>
<div class="form-group row">
<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-success"
type="submit">{Lang::T('Recharge')}</button>
Or <a href="{$_url}customers/list">{Lang::T('Cancel')}</a>
</div>
</div>
</center>
</form>
</div>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

222
ui/ui/hotspot-add.tpl Normal file
View File

@ -0,0 +1,222 @@
{include file="sections/header.tpl"}
<div class="container-fluid">
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="card card-primary card-hovered card-stacked mb30">
<div class="card-header">{Lang::T('Add Service Plan')}</div>
<div class="card-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}services/add-post">
<div class="form-group row">
<label class="col-md-2 control-label">{Lang::T('Status')}</label>
<div class="col-md-10">
<input type="radio" name="enabled" value="1" checked> Enable
<input type="radio" name="enabled" value="0"> Disable
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label">{Lang::T('Type')}</label>
<div class="col-md-10">
<input type="radio" name="prepaid" onclick="prePaid()" value="yes" checked> Prepaid
<input type="radio" name="prepaid" onclick="postPaid()" value="no"> Postpaid
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label">{Lang::T('Plan Type')}</label>
<div class="col-md-10">
<input type="radio" name="plan_type" value="Personal" checked> Personal
<input type="radio" name="plan_type" value="Business"> Business
</div>
</div>
{if $_c['radius_enable']}
<div class="form-group row">
<label class="col-md-2 control-label">Radius</label>
<div class="col-md-6">
<label class="radio-inline">
<input type="checkbox" name="radius" onclick="isRadius(this)" value="1"> Radius Plan
</label>
</div>
<p class="help-block col-md-4">{Lang::T('Cannot be change after saved')}</p>
</div>
{/if}
<div class="form-group row">
<label class="col-md-2 control-label">{Lang::T('Plan Name')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="name" name="name" maxlength="40">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label">{Lang::T('Plan Type')}</label>
<div class="col-md-10">
<input type="radio" id="Unlimited" name="typebp" value="Unlimited" checked>
{Lang::T('Unlimited')}
<input type="radio" id="Limited" name="typebp" value="Limited"> {Lang::T('Limited')}
</div>
</div>
<div style="display:none;" id="Type">
<div class="form-group row">
<label class="col-md-2 control-label">{Lang::T('Limit Type')}</label>
<div class="col-md-10">
<input type="radio" id="Time_Limit" name="limit_type" value="Time_Limit" checked>
{Lang::T('Time Limit')}
<input type="radio" id="Data_Limit" name="limit_type" value="Data_Limit">
{Lang::T('Data Limit')}
<input type="radio" id="Both_Limit" name="limit_type" value="Both_Limit">
{Lang::T('Both Limit')}
</div>
</div>
</div>
<div style="display:none;" id="TimeLimit">
<div class="form-group row">
<label class="col-md-2 control-label">{Lang::T('Time Limit')}</label>
<div class="col-md-4">
<input type="text" class="form-control" id="time_limit" name="time_limit" value="0">
</div>
<div class="col-md-2">
<select class="form-select select2" style="height: 52px; background-color: white;" id="time_unit" name="time_unit">
<option value="Hrs">{Lang::T('Hrs')}</option>
<option value="Mins">{Lang::T('Mins')}</option>
</select>
</div>
</div>
</div>
<div style="display:none;" id="DataLimit">
<div class="form-group row">
<label class="col-md-2 control-label">{Lang::T('Data Limit')}</label>
<div class="col-md-4">
<input type="text" class="form-control" id="data_limit" name="data_limit" value="0">
</div>
<div class="col-md-2">
<select class="form-select" style="height: 52px; background-color: white;" id="data_unit" name="data_unit">
<option value="MB">MBs</option>
<option value="GB">GBs</option>
</select>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label"><a
href="{$_url}bandwidth/add">{Lang::T('Bandwidth Name')}</a></label>
<div class="col-md-6">
<select id="id_bw" name="id_bw" class="form-select select2" style="height: 52px; background-color: white;">
<option value="">{Lang::T('Select Bandwidth')}...</option>
{foreach $d as $ds}
<option value="{$ds['id']}">{$ds['name_bw']}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label">{Lang::T('Plan Price')}</label>
<div class="col-md-6">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">{$_c['currency_code']}</span>
<input type="number" class="form-control" name="price" required>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label">{Lang::T('Shared Users')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="sharedusers" name="sharedusers" value="1">
<p class="help-block">{Lang::T('1 user can be used for many devices?')}</p>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label">{Lang::T('Plan Validity')}</label>
<div class="col-md-4">
<input type="text" class="form-control" id="validity" name="validity">
</div>
<div class="col-md-2">
<select class="form-select" style="height: 52px; background-color: white;" id="validity_unit" name="validity_unit">
</select>
</div>
<p class="help-block col-md-4">{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}</p>
</div>
<span id="routerChoose" class="">
<div class="form-group row">
<label class="col-md-2 control-label"><a
href="{$_url}routers/add">{Lang::T('Router Name')}</a></label>
<div class="col-md-6">
<select id="routers" name="routers" required class="form-select" style="height: 52px; background-color: white;">
<option value=''>{Lang::T('Select Routers')}</option>
{foreach $r as $rs}
<option value="{$rs['name']}">{$rs['name']}</option>
{/foreach}
</select>
<p class="help-block">{Lang::T('Cannot be change after saved')}</p>
</div>
</div>
</span>
<legend>{Lang::T('Expired Action')}</legend>
<div class="form-group row" id="ipPool">
<label class="col-md-2 control-label"><a
href="{$_url}pool/add">{Lang::T('Expired IP Pool')}</a></label>
<div class="col-md-6">
<select id="pool_expired" name="pool_expired" class="form-select select2" style="height: 52px; background-color: white;">
<option value=''>{Lang::T('Select Pool')}</option>
</select>
</div>
</div>
{* <div class="form-group row" id="AddressList">
<label class="col-md-2 control-label">{Lang::T('Address List')}</label>
<div class="col-md-6">
<input type="text" class="form-control" name="list_expired" id="list_expired">
</div>
</div> *}
<center>
<div class="form-group row">
<div class="col-md-offset-2 col-md-10">
<button class="btn btn-success" type="submit">{Lang::T('Save Changes')}</button>
Or <a href="{$_url}services/hotspot">{Lang::T('Cancel')}</a>
</div>
</div>
</center>
</form>
</div>
</div>
</div>
</div>
<script>
var preOpt = `<option value="Mins">{Lang::T('Mins')}</option>
<option value="Hrs">{Lang::T('Hrs')}</option>
<option value="Days">{Lang::T('Days')}</option>
<option value="Months">{Lang::T('Months')}</option>`;
var postOpt = `<option value="Period">{Lang::T('Period')}</option>`;
function prePaid() {
$("#validity_unit").html(preOpt);
}
function postPaid() {
$("#validity_unit").html(postOpt);
}
document.addEventListener("DOMContentLoaded", function(event) {
prePaid()
})
</script>
{if $_c['radius_enable']}
{literal}
<script>
function isRadius(cek) {
if (cek.checked) {
$("#routerChoose").addClass('hidden');
document.getElementById("routers").required = false;
$("#pool_expired").html('');
$.ajax({
url: "index.php?_route=autoload/pool",
data: "routers=radius",
cache: false,
success: function(msg) {
$("#pool_expired").html(msg);
}
});
} else {
document.getElementById("routers").required = true;
$("#routerChoose").removeClass('hidden');
}
}
</script>
{/literal}
{/if}
</div>
{include file="sections/footer.tpl"}

95
ui/ui/hotspot.tpl Normal file
View File

@ -0,0 +1,95 @@
{include file="sections/header.tpl"}
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="card card-hovered mb20 card-primary">
<div class="card-header">
{Lang::T('Hotspot Plans')}
<div class="btn-group pull-right">
<a class="btn btn-primary btn-xs" title="save" href="{$_url}services/sync/hotspot"
onclick="return confirm('This will sync/send hotspot plan to Mikrotik?')"><span
class="fa fa-refresh" aria-hidden="true"></span> sync</a>
</div>
</div>
<div class="card-body">
<div class="md-whiteframe-z1 mb20 text-center row" style="padding: 15px">
<div class="col-md-8">
<form id="site-search" method="post" action="{$_url}services/hotspot/">
<div class="input-group">
<div class="input-group-text" id="basic-addon1">
<span class="fa fa-search"></span>
</div>
<input type="text" name="name" class="form-control"
placeholder="{Lang::T('Search by Name')}...">
<div class="input-group-btn">
<button class="btn btn-success" id="button-addon2" style="height: 52px;" type="submit">{Lang::T('Search')}</button>
</div>
</div>
</form>
</div>
<div class="col-md-4">
<a href="{$_url}services/add" class="btn btn-primary btn-block"><i class="fa fa-plus">
</i> {Lang::T('New Service Plan')}</a>
</div>&nbsp;
</div>
<div class="table-responsive">
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{Lang::T('Plan Name')}</th>
<th>{Lang::T('Plan Type')}</th>
<th>{Lang::T('Bandwidth Plans')}</th>
<th>{Lang::T('Plan Category')}</th>
<th>{Lang::T('Plan Price')}</th>
<th>{Lang::T('Time Limit')}</th>
<th>{Lang::T('Data Limit')}</th>
<th>{Lang::T('Plan Validity')}</th>
<th>{Lang::T('Routers')}</th>
<th>{Lang::T('Expired IP Pool')}</th>
<th>{Lang::T('ID')}</th>
<th>{Lang::T('Manage')}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr {if $ds['enabled'] !=1}class="danger" title="disabled" {elseif $ds['prepaid'] !='yes'
}class="warning" title="Postpaid" {/if}>
<td class="headcol">{$ds['name_plan']}</td>
<td>{$ds['plan_type']}</td>
<td>{$ds['name_bw']}</td>
<td>{$ds['typebp']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td>
<td>{$ds['time_limit']} {$ds['time_unit']}</td>
<td>{$ds['data_limit']} {$ds['data_unit']}</td>
<td>{$ds['validity']} {$ds['validity_unit']}</td>
<td>
{if $ds['is_radius']}
<span class="label label-primary">RADIUS</span>
{else}
{if $ds['routers']!=''}
<a href="{$_url}routers/edit/0&name={$ds['routers']}">{$ds['routers']}</a>
{/if}
{/if}
</td>
<td>{$ds['pool_expired']}{if $ds['list_expired']}{if $ds['pool_expired']} |
{/if}{$ds['list_expired']}{/if}</td>
<td>{$ds['id']}</td>
<td>
<a href="{$_url}services/edit/{$ds['id']}"
class="btn btn-info btn-xs">{Lang::T('Edit')}</a>
<a href="{$_url}services/delete/{$ds['id']}" id="{$ds['id']}"
onclick="return confirm('{Lang::T('Delete')}?')"
class="btn btn-danger btn-xs"><i class="fa fa-trash"></i></a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{include file="pagination.tpl"}
</div>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

69
ui/ui/hotspot_users.tpl Normal file
View File

@ -0,0 +1,69 @@
{include file="sections/header.tpl"}
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="card card-hovered mb20 card">
<div class="card-header">{Lang::T('Hotspot Users')}</div>
<div class="card-body">
<div class="table-responsive table_mobile">
<table id="hotspot_users_table" class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{Lang::T('Username')}</th>
<th>{Lang::T('Address')}</th>
<th>{Lang::T('Uptime')}</th>
<th>{Lang::T('Server')}</th>
<th>{Lang::T('MAC Address')}</th>
<th>{Lang::T('Session Time')}</th>
<th style="color: red;">{Lang::T('Upload')}</th>
<th style="color: green;">{Lang::T('Download')}</th>
<th>{Lang::T('Total')}</th>
<th>{Lang::T('Action')}</th>
</tr>
</thead>
<tbody>
<!-- DataTables will populate the table body dynamically -->
</tbody>
</table>
</div>
</div>
</div>
{include file="pagination.tpl"}
</div>
</div>
</div>
{include file="sections/footer.tpl"}
<!-- Include jQuery and DataTables JS CDN -->
<!--<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>-->
<script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
<script>
$(document).ready(function() {
$('#hotspot_users_table').DataTable({
"ajax": {
"url": "{$_url}onlineusers/hotspot_users",
"dataSrc": ""
},
"columns": [
{ "data": "username", "render": function(data, type, row) {
return '<span style="color: blue;">' + data + '</span>';
}
},
{ "data": "address" },
{ "data": "uptime" },
{ "data": "server" },
{ "data": "mac" },
{ "data": "session_time" },
{ "data": "rx_bytes" },
{ "data": "tx_bytes" },
{ "data": "total" },
{ "data": null, "render": function(data, type, row) {
return '<form method="post" action="{$_url}onlineusers/disconnect/{$routerId}/' + row.username + '/hotspot">' +
'<button type="submit" class="btn btn-danger btn-sm" title="Disconnect"><i class="fa fa-times"></i></button>' +
'</form>';
}
}
]
});
});
</script>