Upload files to "ui/ui"

Signed-off-by: nestict <icttechnest@gmail.com>
This commit is contained in:
nestict 2025-05-24 12:20:12 +02:00
parent 712224be37
commit 6d4e964bf1
5 changed files with 599 additions and 0 deletions

69
ui/ui/ppp_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/ppp_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>

181
ui/ui/pppoe-add.tpl Normal file
View File

@ -0,0 +1,181 @@
{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">
<h3 class="card-title">{Lang::T('Add Service Plan')}</h3>
</div>
<div class="card-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}services/pppoe-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" checked name="enabled" value="1"> 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">
<input type="checkbox" name="radius" onclick="isRadius(this)" value="1"> Radius Plan
</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_plan" maxlength="40" name="name_plan">
</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" 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">{$_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('Plan Validity')}</label>
<div class="col-md-4 mb-2">
<input type="text" class="form-control" id="validity" name="validity">
</div>
<div class="col-md-2">
<select class="form-control" 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>
<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>
<div class="form-group row">
<label class="col-md-2 control-label"><a href="{$_url}pool/add">{Lang::T('IP Pool')}</a></label>
<div class="col-md-6">
<select id="pool_name" name="pool_name" required class="form-select" style="height: 52px; background-color: white;">
<option value=''>{Lang::T('Select Pool')}</option>
</select>
</div>
</div>
<legend>{Lang::T('Expired Action')} <sub>{Lang::T('Optional')}</sub></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" 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-primary mb-3"
type="submit">{Lang::T('Save Changes')}</button>
Or <a class="btn btn-outline-primary" href="{$_url}services/pppoe">{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) {
document.getElementById("routers").required = false;
document.getElementById("routers").disabled = true;
$.ajax({
url: "index.php?_route=autoload/pool",
data: "routers=radius",
cache: false,
success: function(msg) {
$("#pool_name").html(msg);
}
});
$.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;
document.getElementById("routers").disabled = false;
}
}
</script>
{/literal}
{/if}
</div>
{include file="sections/footer.tpl"}

183
ui/ui/pppoe-edit.tpl Normal file
View File

@ -0,0 +1,183 @@
{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">
<h3 class="card-title">{Lang::T('Edit Service Plan')} || {$d['name_plan']}</h3>
</div>
<div class="card-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}services/edit-pppoe-post">
<input type="hidden" name="id" value="{$d['id']}">
<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" {if $d['enabled'] == 1}checked{/if}> Enable
<input type="radio" name="enabled" value="0" {if $d['enabled'] == 0}checked{/if}> 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" {if $d['prepaid'] == yes}checked{/if}>
Prepaid
<input type="radio" name="prepaid" onclick="postPaid()" value="no" {if $d['prepaid'] == no}checked{/if}> 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"
{if $d['plan_type'] == 'Personal'}checked{/if}>
Personal
<input type="radio" name="plan_type" value="Business"
{if $d['plan_type'] == 'Business'}checked{/if}> Business
</div>
</div>
{if $_c['radius_enable'] and $d['is_radius']}
<div class="form-group row">
<label class="col-md-2 control-label">Radius</label>
<div class="col-md-10">
<label class="label label-primary">RADIUS</label>
</div>
</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_plan" maxlength="40" name="name_plan"
value="{$d['name_plan']}">
</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" style="height: 52px; background-color: white;">
{foreach $b as $bs}
<option value="{$bs['id']}" {if $d['id_bw'] eq $bs['id']} selected {/if}>
{$bs['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">{$_c['currency_code']}</span>
<input type="number" class="form-control" name="price" required value="{$d['price']}">
</div>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label">{Lang::T('Plan Validity')}</label>
<div class="col-md-4 mb-3">
<input type="text" class="form-control" id="validity" name="validity"
value="{$d['validity']}">
</div>
<div class="col-md-2">
<select class="form-control" id="validity_unit" name="validity_unit">
{if $d['prepaid'] == yes}
<option value="Mins" {if $d['validity_unit'] eq 'Mins'} selected {/if}>{Lang::T('Mins')}
</option>
<option value="Hrs" {if $d['validity_unit'] eq 'Hrs'} selected {/if}>{Lang::T('Hrs')}
</option>
<option value="Days" {if $d['validity_unit'] eq 'Days'} selected {/if}>{Lang::T('Days')}
</option>
<option value="Months" {if $d['validity_unit'] eq 'Months'} selected {/if}>
{Lang::T('Months')}</option>
{else}
<option value="Period" {if $d['validity_unit'] eq 'Period'} selected {/if}>
{Lang::T('Period')}</option>
{/if}
</select>
</div>
<p class="help-block col-md-4">
{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}</p>
</div>
<div class="form-group row">
<label class="col-md-2 control-label"><a href="{$_url}pool/add">{Lang::T('IP Pool')}</a></label>
<div class="col-md-6">
<select id="pool_name" name="pool_name" required class="form-select" style="height: 52px; background-color: white;">
{foreach $p as $ps}
<option value="{$ps['pool_name']}" {if $d['pool'] eq $ps['pool_name']} selected {/if}>
{$ps['pool_name']}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label">{Lang::T('Router Name')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="routers" name="routers" value="{$d['routers']}"
readonly>
</div>
</div>
<legend>{Lang::T('Expired Action')} <sub>{Lang::T('Optional')}</sub></legend>
<div class="form-group row">
<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" style="height: 52px; background-color: white;">
<option value=''>{Lang::T('Select Pool')}</option>
{foreach $p as $ps}
<option value="{$ps['pool_name']}" {if $d['pool_expired'] eq $ps['pool_name']} selected
{/if}>{$ps['pool_name']}</option>
{/foreach}
</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" value="{$d['list_expired']}">
</div>
</div> *}
<center>
<div class="form-group row">
<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-success mb-3" type="submit">{Lang::T('Save Changes')}</button>
Or <a class="btn btn-outline-primary" href="{$_url}services/pppoe">{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);
}
</script>
{if $_c['radius_enable'] && $d['is_radius']}
{literal}
<script>
document.getElementById("routers").required = false;
document.getElementById("routers").disabled = true;
setTimeout(() => {
$.ajax({
url: "index.php?_route=autoload/pool",
data: "routers=radius",
cache: false,
success: function(msg) {
$("#pool_expired").html(msg);
}
});
}, 2000);
</script>
{/literal}
{/if}
</div>
{include file="sections/footer.tpl"}

92
ui/ui/pppoe.tpl Normal file
View File

@ -0,0 +1,92 @@
{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">
<h3 class="card-title">{Lang::T('PPPOE Plans')}</h3>
<div class="btn-group pull-right">
<a class="btn btn-primary" title="save" href="{$_url}services/sync/pppoe"
onclick="return confirm('This will sync/send PPPOE 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">
<div class="col-md-8 mb-3">
<form id="site-search" method="post" action="{$_url}services/pppoe/">
<div class="input-group">
<div class="input-group-text">
<span class="fa fa-search"></span>
</div>
<input type="text" name="name" class="form-control"
placeholder="{Lang::T('Search by Name')}...">
<button class="btn btn-success input-group-btn" type="submit">{Lang::T('Search')}</button>
<!-- <div class="input-group-btn">
</div> -->
</div>
</form>
</div>
<div class="col-md-4">
<a href="{$_url}services/pppoe-add" class="btn btn-primary btn-block"><i
class="fa fa-add"> </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 Price')}</th>
<th>{Lang::T('Plan Validity')}</th>
<th>{Lang::T('IP Pool')}</th>
<th>{Lang::T('Expired IP Pool')}</th>
<th>{Lang::T('Routers')}</th>
<th>{Lang::T('Manage')}</th>
<th>ID</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr {if $ds['enabled'] != 1}class="danger" title="disabled"{/if}>
<td>{$ds['name_plan']}</td>
<td>{$ds['plan_type']} {if $ds['prepaid'] != 'yes'}<b>Postpaid</b>{else}Prepaid{/if}</td>
<td>{$ds['name_bw']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td>
<td>{$ds['validity']} {$ds['validity_unit']}</td>
<td>{$ds['pool']}</td>
<td>{$ds['pool_expired']}{if $ds['list_expired']}
{if $ds['pool_expired']} |
{/if}{$ds['list_expired']}
{/if}</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>
<a href="{$_url}services/pppoe-edit/{$ds['id']}"
class="btn btn-info btn-xs mb-1">{Lang::T('Edit')}</a>
<a href="{$_url}services/pppoe-delete/{$ds['id']}"
onclick="return confirm('{Lang::T('Delete')}?')" id="{$ds['id']}"
class="btn btn-danger btn-xs"><i class="fa fa-trash"></i></a>
</td>
<td>{$ds['id']}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{include file="pagination.tpl"}
</div>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

74
ui/ui/print-by-date.tpl Normal file
View File

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html>
<head>
<title>{$_title}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="ui/ui/styles/bootstrap.min.css" rel="stylesheet">
<link rel="shortcut icon" type="image/x-icon" href="ui/ui/images/favicon.ico">
<style type="text/css">
@media print
{
.no-print, .no-print *
{
display: none !important;
}
}
</style>
</head>
<body>
<div class="row">
<div class="col-md-12">
<div id="printable">
<h4>{Lang::T('All Transactions at Date')}: {date($_c['date_format'], strtotime($mdate))}</h4>
<div class="table-responsive">
<table class="table table-bordered table-condensed table-bordered" style="background: #ffffff">
<th class="text-center">{Lang::T('Username')}</th>
<th class="text-center">{Lang::T('Plan Name')}</th>
<th class="text-center">{Lang::T('Type')}</th>
<th class="text-center">{Lang::T('Plan Price')}</th>
<th class="text-center">{Lang::T('Created On')}</th>
<th class="text-center">{Lang::T('Expires On')}</th>
<th class="text-center">{Lang::T('Method')}</th>
<th class="text-center">{Lang::T('Routers')}</th>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td class="text-center">{$ds['plan_name']}</td>
<td class="text-center">{$ds['type']}</td>
<td class="text-right">{Lang::moneyFormat($ds['price'])}</td>
<td>{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}</td>
<td>{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
<td class="text-center">{$ds['method']}</td>
<td class="text-center">{$ds['routers']}</td>
</tr>
{/foreach}
</table>
</div>
<div class="clearfix text-right total-sum mb10">
<h4 class="text-uppercase text-bold">{Lang::T('Total Income')}:</h4>
<h3 class="sum">{$_c['currency_code']} {number_format($dr,2,$_c['dec_point'],$_c['thousands_sep'])}</h3>
</div>
</div>
<button type="button" id="actprint" class="btn btn-default btn-sm no-print">{Lang::T('Click Here to Print')}</button>
</div>
</div>
<script src="ui/ui/scripts/jquery-1.10.2.js"></script>
<script src="ui/ui/scripts/bootstrap.min.js"></script>
{if isset($xfooter)}
{$xfooter}
{/if}
<script>
jQuery(document).ready(function() {
// initiate layout and plugins
$("#actprint").click(function() {
window.print();
return false;
});
});
</script>
</body>
</html>