Expired date at Internet plan
This commit is contained in:
parent
242d43f7c1
commit
703593d5e2
@ -64,20 +64,12 @@ class Package
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($p['validity_unit'] == 'Period') {
|
$day_exp = 20;
|
||||||
$day_exp = User::getAttribute("Expired Date", $c['id']); //ORM::for_table('tbl_customers_fields')->where('field_name', 'Expired Date')->where('customer_id', $c['id'])->find_one();
|
if ($p['prepaid'] == 'no') {
|
||||||
if (!$day_exp) {
|
$day_exp = $p['expired_date'];
|
||||||
$day_exp = 20;
|
}
|
||||||
// $day_exp = date('d', strtotime($c['created_at']));
|
if(empty($day_exp)){
|
||||||
// if (empty($day_exp) || $day_exp > 28) {
|
$day_exp = 20;
|
||||||
// $day_exp = 1;
|
|
||||||
// }
|
|
||||||
$f = ORM::for_table('tbl_customers_fields')->create();
|
|
||||||
$f->customer_id = $c['id'];
|
|
||||||
$f->field_name = 'Expired Date';
|
|
||||||
$f->field_value = $day_exp;
|
|
||||||
$f->save();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($router_name == 'balance') {
|
if ($router_name == 'balance') {
|
||||||
|
@ -1,126 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
|
|
||||||
* by https://t.me/ibnux
|
|
||||||
**/
|
|
||||||
|
|
||||||
_admin();
|
|
||||||
$ui->assign('_title', 'CodeCanyon.net');
|
|
||||||
$ui->assign('_system_menu', 'settings');
|
|
||||||
|
|
||||||
$plugin_repository = 'https://hotspotbilling.github.io/Plugin-Repository/repository.json';
|
|
||||||
|
|
||||||
$action = $routes['1'];
|
|
||||||
$ui->assign('_admin', $admin);
|
|
||||||
$cache = File::pathFixer($CACHE_PATH . '/codecanyon.json');
|
|
||||||
|
|
||||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
|
||||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
|
||||||
}
|
|
||||||
if (empty($config['envato_token'])) {
|
|
||||||
r2(U . 'settings/app', 'w', '<a href="' . U . 'settings/app#envato' . '">Envato Personal Access Token</a> is not set');
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($action) {
|
|
||||||
|
|
||||||
case 'install':
|
|
||||||
if (!is_writeable(File::pathFixer($CACHE_PATH . '/'))) {
|
|
||||||
r2(U . "codecanyon", 'e', 'Folder system/cache/ is not writable');
|
|
||||||
}
|
|
||||||
if (!is_writeable($PLUGIN_PATH)) {
|
|
||||||
r2(U . "codecanyon", 'e', 'Folder plugin/ is not writable');
|
|
||||||
}
|
|
||||||
if (!is_writeable($PAYMENTGATEWAY_PATH)) {
|
|
||||||
r2(U . "codecanyon", 'e', 'Folder paymentgateway/ is not writable');
|
|
||||||
}
|
|
||||||
set_time_limit(-1);
|
|
||||||
$item_id = $routes['2'];
|
|
||||||
$tipe = $routes['3'];
|
|
||||||
$result = Http::getData('https://api.envato.com/v3/market/buyer/download?item_id=' . $item_id, ['Authorization: Bearer ' . $config['envato_token']]);
|
|
||||||
$json = json_decode($result, true);
|
|
||||||
if (!isset($json['download_url'])) {
|
|
||||||
r2(U . 'codecanyon', 'e', 'Failed to get download url. ' . $json['description']);
|
|
||||||
}
|
|
||||||
$file = File::pathFixer($CACHE_PATH . '/codecanyon/');
|
|
||||||
if (!file_exists($file)) {
|
|
||||||
mkdir($file);
|
|
||||||
}
|
|
||||||
$file .= $item_id . '.zip';
|
|
||||||
if (file_exists($file))
|
|
||||||
unlink($file);
|
|
||||||
//download
|
|
||||||
$fp = fopen($file, 'w+');
|
|
||||||
$ch = curl_init($json['download_url']);
|
|
||||||
curl_setopt($ch, CURLOPT_POST, 0);
|
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
|
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
|
||||||
curl_setopt($ch, CURLOPT_FILE, $fp);
|
|
||||||
curl_exec($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
fclose($fp);
|
|
||||||
//extract
|
|
||||||
$target = File::pathFixer($CACHE_PATH . '/codecanyon/' . $item_id . '/');
|
|
||||||
$zip = new ZipArchive();
|
|
||||||
$zip->open($file);
|
|
||||||
$zip->extractTo($target);
|
|
||||||
$zip->close();
|
|
||||||
//moving
|
|
||||||
if (file_exists($target . 'plugin')) {
|
|
||||||
File::copyFolder($target . 'plugin', $PLUGIN_PATH . DIRECTORY_SEPARATOR);
|
|
||||||
} else if (file_exists($target . 'paymentgateway')) {
|
|
||||||
File::copyFolder($target . 'paymentgateway', $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR);
|
|
||||||
} else if (file_exists($target . 'theme')) {
|
|
||||||
File::copyFolder($target . 'theme', File::pathFixer('ui/themes/'));
|
|
||||||
}
|
|
||||||
//Cleaning
|
|
||||||
File::deleteFolder($target);
|
|
||||||
unlink($file);
|
|
||||||
r2(U . "codecanyon", 's', 'Installation success');
|
|
||||||
case 'reload':
|
|
||||||
if (file_exists($cache))
|
|
||||||
unlink($cache);
|
|
||||||
default:
|
|
||||||
if (class_exists('ZipArchive')) {
|
|
||||||
$zipExt = true;
|
|
||||||
} else {
|
|
||||||
$zipExt = false;
|
|
||||||
}
|
|
||||||
$ui->assign('zipExt', $zipExt);
|
|
||||||
|
|
||||||
if (file_exists($cache) && time() - filemtime($cache) < (24 * 60 * 60)) {
|
|
||||||
$txt = file_get_contents($cache);
|
|
||||||
$plugins = json_decode($txt, true);
|
|
||||||
$ui->assign('chached_until', date($config['date_format'] . ' H:i', filemtime($cache) + (24 * 60 * 60)));
|
|
||||||
if (count($plugins) == 0) {
|
|
||||||
unlink($cache);
|
|
||||||
r2(U . 'codecanyon');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$plugins = [];
|
|
||||||
$page = _get('page', 1);
|
|
||||||
back:
|
|
||||||
$result = Http::getData('https://api.envato.com/v3/market/buyer/list-purchases?&page=' . $page, ['Authorization: Bearer ' . $config['envato_token']]);
|
|
||||||
$items = json_decode($result, true);
|
|
||||||
if ($items && count($items['results']) > 0) {
|
|
||||||
foreach ($items['results'] as $item) {
|
|
||||||
$name = strtolower($item['item']['name']);
|
|
||||||
if (strpos($name, 'phpnuxbill') !== false) {
|
|
||||||
$plugins[] = $item;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$page++;
|
|
||||||
goto back;
|
|
||||||
}
|
|
||||||
if (count($plugins) > 0) {
|
|
||||||
file_put_contents($cache, json_encode($plugins));
|
|
||||||
if (file_exists($cache)) {
|
|
||||||
$ui->assign('chached_until', date($config['date_format'] . ' H:i', filemtime($cache) + (24 * 60 * 60)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$ui->assign('plugins', $plugins);
|
|
||||||
$ui->display('codecanyon.tpl');
|
|
||||||
}
|
|
@ -159,6 +159,7 @@ switch ($action) {
|
|||||||
$device = _post('device');
|
$device = _post('device');
|
||||||
$enabled = _post('enabled');
|
$enabled = _post('enabled');
|
||||||
$prepaid = _post('prepaid');
|
$prepaid = _post('prepaid');
|
||||||
|
$expired_date = _post('expired_date');
|
||||||
|
|
||||||
$msg = '';
|
$msg = '';
|
||||||
if (Validator::UnsignedNumber($validity) == false) {
|
if (Validator::UnsignedNumber($validity) == false) {
|
||||||
@ -209,6 +210,14 @@ switch ($action) {
|
|||||||
$d->enabled = $enabled;
|
$d->enabled = $enabled;
|
||||||
$d->prepaid = $prepaid;
|
$d->prepaid = $prepaid;
|
||||||
$d->device = $device;
|
$d->device = $device;
|
||||||
|
if($prepaid == 'no'){
|
||||||
|
if($expired_date>28 && $expired_date < 1){
|
||||||
|
$expired_date = 20;
|
||||||
|
}
|
||||||
|
$d->expired_date = $expired_date;
|
||||||
|
}else{
|
||||||
|
$d->expired_date = 0;
|
||||||
|
}
|
||||||
$d->save();
|
$d->save();
|
||||||
|
|
||||||
$dvc = Package::getDevice($d);
|
$dvc = Package::getDevice($d);
|
||||||
@ -246,6 +255,7 @@ switch ($action) {
|
|||||||
$enabled = _post('enabled');
|
$enabled = _post('enabled');
|
||||||
$prepaid = _post('prepaid');
|
$prepaid = _post('prepaid');
|
||||||
$routers = _post('routers');
|
$routers = _post('routers');
|
||||||
|
$expired_date = _post('expired_date');
|
||||||
$msg = '';
|
$msg = '';
|
||||||
if (Validator::UnsignedNumber($validity) == false) {
|
if (Validator::UnsignedNumber($validity) == false) {
|
||||||
$msg .= 'The validity must be a number' . '<br>';
|
$msg .= 'The validity must be a number' . '<br>';
|
||||||
@ -301,6 +311,14 @@ switch ($action) {
|
|||||||
$d->enabled = $enabled;
|
$d->enabled = $enabled;
|
||||||
$d->prepaid = $prepaid;
|
$d->prepaid = $prepaid;
|
||||||
$d->device = $device;
|
$d->device = $device;
|
||||||
|
if($prepaid == 'no'){
|
||||||
|
if($expired_date>28 && $expired_date < 1){
|
||||||
|
$expired_date = 20;
|
||||||
|
}
|
||||||
|
$d->expired_date = $expired_date;
|
||||||
|
}else{
|
||||||
|
$d->expired_date = 0;
|
||||||
|
}
|
||||||
$d->save();
|
$d->save();
|
||||||
|
|
||||||
$dvc = Package::getDevice($d);
|
$dvc = Package::getDevice($d);
|
||||||
@ -433,6 +451,7 @@ switch ($action) {
|
|||||||
$pool = _post('pool_name');
|
$pool = _post('pool_name');
|
||||||
$enabled = _post('enabled');
|
$enabled = _post('enabled');
|
||||||
$prepaid = _post('prepaid');
|
$prepaid = _post('prepaid');
|
||||||
|
$expired_date = _post('expired_date');
|
||||||
|
|
||||||
|
|
||||||
$msg = '';
|
$msg = '';
|
||||||
@ -491,6 +510,14 @@ switch ($action) {
|
|||||||
$d->is_radius = 0;
|
$d->is_radius = 0;
|
||||||
$d->routers = $routers;
|
$d->routers = $routers;
|
||||||
}
|
}
|
||||||
|
if($prepaid == 'no'){
|
||||||
|
if($expired_date>28 && $expired_date < 1){
|
||||||
|
$expired_date = 20;
|
||||||
|
}
|
||||||
|
$d->expired_date = $expired_date;
|
||||||
|
}else{
|
||||||
|
$d->expired_date = 0;
|
||||||
|
}
|
||||||
$d->enabled = $enabled;
|
$d->enabled = $enabled;
|
||||||
$d->prepaid = $prepaid;
|
$d->prepaid = $prepaid;
|
||||||
$d->device = $device;
|
$d->device = $device;
|
||||||
@ -524,6 +551,7 @@ switch ($action) {
|
|||||||
$plan_expired = _post('plan_expired');
|
$plan_expired = _post('plan_expired');
|
||||||
$enabled = _post('enabled');
|
$enabled = _post('enabled');
|
||||||
$prepaid = _post('prepaid');
|
$prepaid = _post('prepaid');
|
||||||
|
$expired_date = _post('expired_date');
|
||||||
|
|
||||||
$msg = '';
|
$msg = '';
|
||||||
if (Validator::UnsignedNumber($validity) == false) {
|
if (Validator::UnsignedNumber($validity) == false) {
|
||||||
@ -575,6 +603,14 @@ switch ($action) {
|
|||||||
$d->enabled = $enabled;
|
$d->enabled = $enabled;
|
||||||
$d->prepaid = $prepaid;
|
$d->prepaid = $prepaid;
|
||||||
$d->device = $device;
|
$d->device = $device;
|
||||||
|
if($prepaid == 'no'){
|
||||||
|
if($expired_date>28 && $expired_date < 1){
|
||||||
|
$expired_date = 20;
|
||||||
|
}
|
||||||
|
$d->expired_date = $expired_date;
|
||||||
|
}else{
|
||||||
|
$d->expired_date = 0;
|
||||||
|
}
|
||||||
$d->save();
|
$d->save();
|
||||||
|
|
||||||
$dvc = Package::getDevice($d);
|
$dvc = Package::getDevice($d);
|
||||||
|
@ -636,5 +636,11 @@
|
|||||||
"Device": "Device",
|
"Device": "Device",
|
||||||
"Expired_Internet_Plan": "Expired Internet Plan",
|
"Expired_Internet_Plan": "Expired Internet Plan",
|
||||||
"When_Expired__customer_will_be_move_to_selected_internet_plan": "When Expired, customer will be move to selected internet plan",
|
"When_Expired__customer_will_be_move_to_selected_internet_plan": "When Expired, customer will be move to selected internet plan",
|
||||||
"Plugin_Installer": "Plugin Installer"
|
"Plugin_Installer": "Plugin Installer",
|
||||||
|
"Expired_Date": "Expired Date",
|
||||||
|
"Expired": "Expired",
|
||||||
|
"Time": "Time",
|
||||||
|
"Data": "Data",
|
||||||
|
"Category": "Category",
|
||||||
|
"later": "later"
|
||||||
}
|
}
|
@ -1,54 +0,0 @@
|
|||||||
{include file="sections/header.tpl"}
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-12">
|
|
||||||
<div class="panel panel-primary panel-hovered">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<div class="btn-group pull-right">
|
|
||||||
<a class="btn btn-danger btn-xs" href="https://codecanyon.net/category/php-scripts?term=phpnuxbill"
|
|
||||||
target="_blank">Buy Plugin</a>
|
|
||||||
</div>
|
|
||||||
Plugin Purcashed
|
|
||||||
</div>
|
|
||||||
<div class="panel-body row">
|
|
||||||
{if Lang::arrayCount($plugins) > 0}
|
|
||||||
{foreach $plugins as $plugin}
|
|
||||||
<div class="col-md-4">
|
|
||||||
<div class="box box-hovered mb20 box-primary">
|
|
||||||
<div class="box-header">
|
|
||||||
<h3 class="box-title text1line">{$plugin['item']['name']}</h3>
|
|
||||||
</div>
|
|
||||||
<div class="box-body"><small><i>@{$plugin['item']['author_username']} • Last update:
|
|
||||||
{Lang::dateFormat($plugin['item']['updated_at'])}</i></small></div>
|
|
||||||
<div class="box-footer ">
|
|
||||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
|
||||||
<a href="{$plugin['item']['author_url']}" target="_blank" class="btn btn-primary"><i
|
|
||||||
class="ion ion-chatboxes"></i> Author</a>
|
|
||||||
<a href="{$plugin['item']['url']}" target="_blank" class="btn btn-success"><i
|
|
||||||
class="ion ion-chatboxes"></i> Product</a>
|
|
||||||
<a {if $zipExt } href="{$_url}codecanyon/install/{$plugin['item']['id']}"
|
|
||||||
onclick="return confirm('Installing plugin will take some time to complete, do not close the page while it loading to install the plugin')"
|
|
||||||
{else} href="#" onclick="alert('PHP ZIP extension is not installed')"
|
|
||||||
{/if}
|
|
||||||
class="btn btn-danger"><i class="ion ion-chatboxes"></i> Install</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/foreach}
|
|
||||||
{else}
|
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="alert alert-info">
|
|
||||||
<i class="fa fa-info-circle"></i> No plugins purcashed yet.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
<div class="panel-footer">
|
|
||||||
{if $chached_until}Cached Until {$chached_until} <a href="{$_url}codecanyon/reload">Force reload</a>
|
|
||||||
• {/if}<a
|
|
||||||
href="https://github.com/hotspotbilling/phpnuxbill/wiki/Selling-Paid-Plugin-or-Payment-Gateway"
|
|
||||||
target="_blank"> Sell your own plugin/paymentgateway/theme?</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{include file="sections/footer.tpl"}
|
|
@ -176,6 +176,16 @@
|
|||||||
<p class="help-block col-md-4">{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}
|
<p class="help-block col-md-4">{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group hidden" id="expired_date">
|
||||||
|
<label class="col-md-2 control-label">{Lang::T('Expired Date')}
|
||||||
|
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
|
||||||
|
data-trigger="focus" data-container="body"
|
||||||
|
data-content="Expired will be this date every month, 0 will be when customer buy internet plan">?</a>
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input type="number" class="form-control" name="expired_date" maxlength="2" value="20" min="1" max="28" step="1" >
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<span id="routerChoose" class="">
|
<span id="routerChoose" class="">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-2 control-label"><a
|
<label class="col-md-2 control-label"><a
|
||||||
@ -210,10 +220,12 @@
|
|||||||
var postOpt = `<option value="Period">{Lang::T('Period')}</option>`;
|
var postOpt = `<option value="Period">{Lang::T('Period')}</option>`;
|
||||||
function prePaid() {
|
function prePaid() {
|
||||||
$("#validity_unit").html(preOpt);
|
$("#validity_unit").html(preOpt);
|
||||||
|
$('#expired_date').addClass('hidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
function postPaid() {
|
function postPaid() {
|
||||||
$("#validity_unit").html(postOpt);
|
$("#validity_unit").html(postOpt);
|
||||||
|
$("#expired_date").removeClass('hidden');
|
||||||
}
|
}
|
||||||
document.addEventListener("DOMContentLoaded", function(event) {
|
document.addEventListener("DOMContentLoaded", function(event) {
|
||||||
prePaid()
|
prePaid()
|
||||||
|
@ -26,10 +26,10 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
<input type="radio" name="prepaid" onclick="prePaid()" value="yes"
|
<input type="radio" name="prepaid" onclick="prePaid()" value="yes"
|
||||||
{if $d['prepaid'] == yes}checked{/if}>
|
{if $d['prepaid'] == 'yes'}checked{/if}>
|
||||||
Prepaid
|
Prepaid
|
||||||
<input type="radio" name="prepaid" onclick="postPaid()" value="no"
|
<input type="radio" name="prepaid" onclick="postPaid()" value="no"
|
||||||
{if $d['prepaid'] == no}checked{/if}> Postpaid
|
{if $d['prepaid'] == 'no'}checked{/if}> Postpaid
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -206,6 +206,17 @@
|
|||||||
<p class="help-block col-md-4">{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}
|
<p class="help-block col-md-4">{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group {if $d['prepaid'] == yes}hidden{/if}" id="expired_date">
|
||||||
|
<label class="col-md-2 control-label">{Lang::T('Expired Date')}
|
||||||
|
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
|
||||||
|
data-trigger="focus" data-container="body"
|
||||||
|
data-content="Expired will be this date every month, 0 will be when customer buy internet plan">?</a>
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input type="number" class="form-control" name="expired_date" maxlength="2"
|
||||||
|
value="{$d['expired_date']}" min="1" max="28" step="1">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<span id="routerChoose" class="{if $d['is_radius']}hidden{/if}">
|
<span id="routerChoose" class="{if $d['is_radius']}hidden{/if}">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-2 control-label"><a
|
<label class="col-md-2 control-label"><a
|
||||||
@ -252,10 +263,12 @@
|
|||||||
var postOpt = `<option value="Period">{Lang::T('Period')}</option>`;
|
var postOpt = `<option value="Period">{Lang::T('Period')}</option>`;
|
||||||
function prePaid() {
|
function prePaid() {
|
||||||
$("#validity_unit").html(preOpt);
|
$("#validity_unit").html(preOpt);
|
||||||
|
$('#expired_date').addClass('hidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
function postPaid() {
|
function postPaid() {
|
||||||
$("#validity_unit").html(postOpt);
|
$("#validity_unit").html(postOpt);
|
||||||
|
$("#expired_date").removeClass('hidden');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -35,62 +35,74 @@
|
|||||||
<table class="table table-bordered table-striped table-condensed">
|
<table class="table table-bordered table-striped table-condensed">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{Lang::T('Plan Name')}</th>
|
<th></th>
|
||||||
<th>{Lang::T('Plan Type')}</th>
|
<th colspan="5" class="text-center">{Lang::T('Internet Plan')}</th>
|
||||||
<th>{Lang::T('Bandwidth Plans')}</th>
|
<th colspan="2" class="text-center" style="background-color: rgb(246, 244, 244);">Limit</th>
|
||||||
<th>{Lang::T('Plan Category')}</th>
|
<th colspan="2"></th>
|
||||||
<th>{Lang::T('Plan Price')}</th>
|
<th colspan="2" class="text-center" style="background-color: rgb(243, 241, 172);">{Lang::T('Expired')}</th>
|
||||||
<th>{Lang::T('Time Limit')}</th>
|
<th colspan="3"></th>
|
||||||
<th>{Lang::T('Data Limit')}</th>
|
</tr>
|
||||||
<th>{Lang::T('Plan Validity')}</th>
|
<tr>
|
||||||
|
<th>{Lang::T('Name')}</th>
|
||||||
|
<th>{Lang::T('Type')}</th>
|
||||||
|
<th>{Lang::T('Bandwidth')}</th>
|
||||||
|
<th>{Lang::T('Category')}</th>
|
||||||
|
<th>{Lang::T('Price')}</th>
|
||||||
|
<th>{Lang::T('Validity')}</th>
|
||||||
|
<th style="background-color: rgb(246, 244, 244);">{Lang::T('Time')}</th>
|
||||||
|
<th style="background-color: rgb(246, 244, 244);">{Lang::T('Data')}</th>
|
||||||
<th>{Lang::T('Routers')}</th>
|
<th>{Lang::T('Routers')}</th>
|
||||||
<th>{Lang::T('Device')}</th>
|
<th>{Lang::T('Device')}</th>
|
||||||
<th>{Lang::T('Expired Internet Plan')}</th>
|
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Internet Plan')}</th>
|
||||||
|
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Date')}</th>
|
||||||
<th>{Lang::T('ID')}</th>
|
<th>{Lang::T('ID')}</th>
|
||||||
<th>{Lang::T('Manage')}</th>
|
<th>{Lang::T('Manage')}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{foreach $d as $ds}
|
{foreach $d as $ds}
|
||||||
<tr {if $ds['enabled'] !=1}class="danger" title="disabled" {elseif $ds['prepaid'] !='yes'
|
<tr {if $ds['enabled'] !=1}class="danger" title="disabled" {elseif $ds['prepaid'] !='yes'
|
||||||
}class="warning" title="Postpaid" {/if}>
|
}class="warning" title="Postpaid" {/if}>
|
||||||
<td class="headcol">{$ds['name_plan']}</td>
|
<td class="headcol">{$ds['name_plan']}</td>
|
||||||
<td>{$ds['plan_type']}</td>
|
<td>{if $ds['prepaid'] == no}<b>Postpaid</b>{else}Prepaid{/if} {$ds['plan_type']}</td>
|
||||||
<td>{$ds['name_bw']}</td>
|
<td>{$ds['name_bw']}</td>
|
||||||
<td>{$ds['typebp']}</td>
|
<td>{$ds['typebp']}</td>
|
||||||
<td>{Lang::moneyFormat($ds['price'])}</td>
|
<td>{Lang::moneyFormat($ds['price'])}</td>
|
||||||
<td>{$ds['time_limit']} {$ds['time_unit']}</td>
|
<td>{$ds['validity']} {$ds['validity_unit']}</td>
|
||||||
<td>{$ds['data_limit']} {$ds['data_unit']}</td>
|
<td>{$ds['time_limit']} {$ds['time_unit']}</td>
|
||||||
<td>{$ds['validity']} {$ds['validity_unit']}</td>
|
<td>{$ds['data_limit']} {$ds['data_unit']}</td>
|
||||||
<td>
|
<td>
|
||||||
{if $ds['is_radius']}
|
{if $ds['is_radius']}
|
||||||
<span class="label label-primary">RADIUS</span>
|
<span class="label label-primary">RADIUS</span>
|
||||||
{else}
|
{else}
|
||||||
{if $ds['routers']!=''}
|
{if $ds['routers']!=''}
|
||||||
<a href="{$_url}routers/edit/0&name={$ds['routers']}">{$ds['routers']}</a>
|
<a href="{$_url}routers/edit/0&name={$ds['routers']}">{$ds['routers']}</a>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
<td>{$ds['device']}</td>
|
<td>{$ds['device']}</td>
|
||||||
<td>{if $ds['plan_expired']}<a href="{$_url}services/edit/{$ds['plan_expired']}">Yes</a>{else}No{/if}</td>
|
<td>{if $ds['plan_expired']}<a
|
||||||
<td>{$ds['id']}</td>
|
href="{$_url}services/edit/{$ds['plan_expired']}">Yes</a>{else}No
|
||||||
<td>
|
{/if}</td>
|
||||||
<a href="{$_url}services/edit/{$ds['id']}"
|
<td>{if $ds['prepaid'] == no}{$ds['expired_date']}{/if}</td>
|
||||||
class="btn btn-info btn-xs">{Lang::T('Edit')}</a>
|
<td>{$ds['id']}</td>
|
||||||
<a href="{$_url}services/delete/{$ds['id']}" id="{$ds['id']}"
|
<td>
|
||||||
onclick="return confirm('{Lang::T('Delete')}?')"
|
<a href="{$_url}services/edit/{$ds['id']}"
|
||||||
class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>
|
class="btn btn-info btn-xs">{Lang::T('Edit')}</a>
|
||||||
</td>
|
<a href="{$_url}services/delete/{$ds['id']}" id="{$ds['id']}"
|
||||||
</tr>
|
onclick="return confirm('{Lang::T('Delete')}?')"
|
||||||
|
class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{include file="pagination.tpl"}
|
{include file="pagination.tpl"}
|
||||||
<div class="bs-callout bs-callout-info" id="callout-navbar-role">
|
<div class="bs-callout bs-callout-info" id="callout-navbar-role">
|
||||||
<h4>Create expired Internet Plan</h4>
|
<h4>Create expired Internet Plan</h4>
|
||||||
<p>When customer expired, you can move it to Expired Internet Plan</p>
|
<p>When customer expired, you can move it to Expired Internet Plan</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
<input type="radio" name="prepaid" onclick="postPaid()" value="no"> Postpaid
|
<input type="radio" name="prepaid" onclick="postPaid()" value="no"> Postpaid
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-2 control-label">{Lang::T('Plan Type')}
|
<label class="col-md-2 control-label">{Lang::T('Plan Type')}
|
||||||
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
|
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
|
||||||
@ -40,7 +39,6 @@
|
|||||||
<input type="radio" name="plan_type" value="Business"> Business
|
<input type="radio" name="plan_type" value="Business"> Business
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{if $_c['radius_enable']}
|
{if $_c['radius_enable']}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-2 control-label">Radius
|
<label class="col-md-2 control-label">Radius
|
||||||
@ -116,6 +114,16 @@
|
|||||||
<p class="help-block col-md-4">{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}
|
<p class="help-block col-md-4">{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group hidden" id="expired_date">
|
||||||
|
<label class="col-md-2 control-label">{Lang::T('Expired Date')}
|
||||||
|
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
|
||||||
|
data-trigger="focus" data-container="body"
|
||||||
|
data-content="Expired will be this date every month, 0 will be when customer buy internet plan">?</a>
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input type="number" class="form-control" name="expired_date" maxlength="2" value="20" min="1" max="28" step="1" >
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-2 control-label"><a
|
<label class="col-md-2 control-label"><a
|
||||||
href="{$_url}routers/add">{Lang::T('Router Name')}</a></label>
|
href="{$_url}routers/add">{Lang::T('Router Name')}</a></label>
|
||||||
@ -156,10 +164,12 @@
|
|||||||
var postOpt = `<option value="Period">{Lang::T('Period')}</option>`;
|
var postOpt = `<option value="Period">{Lang::T('Period')}</option>`;
|
||||||
function prePaid() {
|
function prePaid() {
|
||||||
$("#validity_unit").html(preOpt);
|
$("#validity_unit").html(preOpt);
|
||||||
|
$('#expired_date').addClass('hidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
function postPaid() {
|
function postPaid() {
|
||||||
$("#validity_unit").html(postOpt);
|
$("#validity_unit").html(postOpt);
|
||||||
|
$("#expired_date").removeClass('hidden');
|
||||||
}
|
}
|
||||||
document.addEventListener("DOMContentLoaded", function(event) {
|
document.addEventListener("DOMContentLoaded", function(event) {
|
||||||
prePaid()
|
prePaid()
|
||||||
|
@ -26,10 +26,10 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
<input type="radio" name="prepaid" onclick="prePaid()" value="yes"
|
<input type="radio" name="prepaid" onclick="prePaid()" value="yes"
|
||||||
{if $d['prepaid'] == yes}checked{/if}>
|
{if $d['prepaid'] == 'yes'}checked{/if}>
|
||||||
Prepaid
|
Prepaid
|
||||||
<input type="radio" name="prepaid" onclick="postPaid()" value="no"
|
<input type="radio" name="prepaid" onclick="postPaid()" value="no"
|
||||||
{if $d['prepaid'] == no}checked{/if}> Postpaid
|
{if $d['prepaid'] == 'no'}checked{/if}> Postpaid
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -136,6 +136,17 @@
|
|||||||
<p class="help-block col-md-4">
|
<p class="help-block col-md-4">
|
||||||
{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}</p>
|
{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group {if $d['prepaid'] == yes}hidden{/if}" id="expired_date">
|
||||||
|
<label class="col-md-2 control-label">{Lang::T('Expired Date')}
|
||||||
|
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
|
||||||
|
data-trigger="focus" data-container="body"
|
||||||
|
data-content="Expired will be this date every month">?</a>
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input type="number" class="form-control" name="expired_date" maxlength="2"
|
||||||
|
value="{$d['expired_date']}" min="1" max="28" step="1">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-2 control-label"><a href="{$_url}pool/add">{Lang::T('IP Pool')}</a></label>
|
<label class="col-md-2 control-label"><a href="{$_url}pool/add">{Lang::T('IP Pool')}</a></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@ -190,10 +201,12 @@
|
|||||||
var postOpt = `<option value="Period">{Lang::T('Period')}</option>`;
|
var postOpt = `<option value="Period">{Lang::T('Period')}</option>`;
|
||||||
function prePaid() {
|
function prePaid() {
|
||||||
$("#validity_unit").html(preOpt);
|
$("#validity_unit").html(preOpt);
|
||||||
|
$('#expired_date').addClass('hidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
function postPaid() {
|
function postPaid() {
|
||||||
$("#validity_unit").html(postOpt);
|
$("#validity_unit").html(postOpt);
|
||||||
|
$("#expired_date").removeClass('hidden');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{include file="sections/footer.tpl"}
|
{include file="sections/footer.tpl"}
|
@ -34,6 +34,13 @@
|
|||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-bordered table-striped table-condensed">
|
<table class="table table-bordered table-striped table-condensed">
|
||||||
<thead>
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<th colspan="4" class="text-center">{Lang::T('Internet Plan')}</th>
|
||||||
|
<th></th>
|
||||||
|
<th colspan="2" class="text-center" style="background-color: rgb(243, 241, 172);">{Lang::T('Expired')}</th>
|
||||||
|
<th colspan="4"></th>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{Lang::T('Plan Name')}</th>
|
<th>{Lang::T('Plan Name')}</th>
|
||||||
<th>{Lang::T('Plan Type')}</th>
|
<th>{Lang::T('Plan Type')}</th>
|
||||||
@ -41,7 +48,8 @@
|
|||||||
<th>{Lang::T('Plan Price')}</th>
|
<th>{Lang::T('Plan Price')}</th>
|
||||||
<th>{Lang::T('Plan Validity')}</th>
|
<th>{Lang::T('Plan Validity')}</th>
|
||||||
<th>{Lang::T('IP Pool')}</th>
|
<th>{Lang::T('IP Pool')}</th>
|
||||||
<th>{Lang::T('Expired Internet Plan')}</th>
|
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Internet Plan')}</th>
|
||||||
|
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Date')}</th>
|
||||||
<th>{Lang::T('Routers')}</th>
|
<th>{Lang::T('Routers')}</th>
|
||||||
<th>{Lang::T('Device')}</th>
|
<th>{Lang::T('Device')}</th>
|
||||||
<th>{Lang::T('Manage')}</th>
|
<th>{Lang::T('Manage')}</th>
|
||||||
@ -58,6 +66,7 @@
|
|||||||
<td>{$ds['validity']} {$ds['validity_unit']}</td>
|
<td>{$ds['validity']} {$ds['validity_unit']}</td>
|
||||||
<td>{$ds['pool']}</td>
|
<td>{$ds['pool']}</td>
|
||||||
<td>{if $ds['plan_expired']}<a href="{$_url}services/edit/{$ds['plan_expired']}">Yes</a>{else}No{/if}</td>
|
<td>{if $ds['plan_expired']}<a href="{$_url}services/edit/{$ds['plan_expired']}">Yes</a>{else}No{/if}</td>
|
||||||
|
<td>{if $ds['prepaid'] == no}{$ds['expired_date']}{/if}</td>
|
||||||
<td>
|
<td>
|
||||||
{if $ds['is_radius']}
|
{if $ds['is_radius']}
|
||||||
<span class="label label-primary">RADIUS</span>
|
<span class="label label-primary">RADIUS</span>
|
||||||
|
@ -451,10 +451,6 @@
|
|||||||
<a href="{$_url}pluginmanager"><i class="glyphicon glyphicon-tasks"></i>
|
<a href="{$_url}pluginmanager"><i class="glyphicon glyphicon-tasks"></i>
|
||||||
{Lang::T('Plugin Manager')} <small class="label pull-right">Free</small></a>
|
{Lang::T('Plugin Manager')} <small class="label pull-right">Free</small></a>
|
||||||
</li>
|
</li>
|
||||||
{* <li {if $_routes[0] eq 'codecanyon' }class="active" {/if}>
|
|
||||||
<a href="{$_url}codecanyon"><i class="glyphicon glyphicon-shopping-cart"></i>
|
|
||||||
Codecanyon.net <small class="label pull-right">Paid</small></a>
|
|
||||||
</li> *}
|
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user