add expired date

This commit is contained in:
Ibnu Maksum 2024-06-19 14:00:04 +07:00
parent 9ef181df6d
commit 16e2a6b139
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
5 changed files with 24 additions and 7 deletions

View File

@ -109,6 +109,7 @@ CREATE TABLE `tbl_plans` (
`is_radius` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 is radius',
`pool` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`plan_expired` int NOT NULL DEFAULT '0',
`expired_date` TINYINT(1) NOT NULL DEFAULT '20',
`enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0 disabled\r\n',
`prepaid` enum('yes','no') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'yes' COMMENT 'is prepaid',
`plan_type` enum('Business','Personal') COLLATE utf8mb4_general_ci DEFAULT 'Personal' COMMENT 'For selecting account type',

View File

@ -25,7 +25,7 @@ if (file_exists($cache) && time() - filemtime($cache) < (24 * 60 * 60)) {
$json = json_decode($txt, true);
if (empty($json['plugins']) && empty($json['payment_gateway'])) {
unlink($cache);
r2(U . 'dashboard', 'd', $txt);
r2(U . 'pluginmanager');
}
} else {
$data = Http::getData($plugin_repository);
@ -33,6 +33,10 @@ if (file_exists($cache) && time() - filemtime($cache) < (24 * 60 * 60)) {
$json = json_decode($data, true);
}
switch ($action) {
case 'refresh':
if (file_exists($cache)) unlink($cache);
r2(U . "pluginmanager", 's', 'Refresh success');
break;
case 'dlinstall':
if (!is_writeable($CACHE_PATH)) {
r2(U . "pluginmanager", 'e', 'Folder cache/ is not writable');

View File

@ -113,5 +113,8 @@
"2024.6.11" : [
"ALTER TABLE `tbl_plans` ADD `plan_expired` INT NOT NULL DEFAULT '0' AFTER `pool`;",
"ALTER TABLE `tbl_plans` DROP `pool_expired`, DROP `list_expired`;"
],
"2024.6.19" : [
"ALTER TABLE `tbl_plans` ADD `expired_date` TINYINT(1) NOT NULL DEFAULT '20' AFTER `plan_expired`;"
]
}

View File

@ -1,12 +1,15 @@
{include file="sections/header.tpl"}
<form method="post" enctype="multipart/form-data" onsubmit="return confirm('Warning, installing unknown source can damage your server, continue?')" action="{$_url}pluginmanager/dlinstall">
<form method="post" enctype="multipart/form-data"
onsubmit="return confirm('Warning, installing unknown source can damage your server, continue?')"
action="{$_url}pluginmanager/dlinstall">
<div class="panel panel-primary panel-hovered">
<div class="panel-heading">
{Lang::T('Plugin Installer')}
<div class="btn-group pull-right">
<a class="btn btn-warning btn-xs" title="save" href="https://github.com/hotspotbilling/phpnuxbill/wiki/Installing-Plugin-or-Payment-Gateway" target="_blank"><span
class="glyphicon glyphicon-info-sign" aria-hidden="true"></span></a>
<a class="btn btn-warning btn-xs" title="save"
href="https://github.com/hotspotbilling/phpnuxbill/wiki/Installing-Plugin-or-Payment-Gateway"
target="_blank"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span></a>
</div>
</div>
<div class="panel-body row">
@ -16,7 +19,8 @@
</div>
<div class="form-group col-md-7">
<label>Github url</label>
<input type="url" class="form-control" name="gh_url" placeholder="https://github.com/username/repository">
<input type="url" class="form-control" name="gh_url"
placeholder="https://github.com/username/repository">
</div>
<div class="col-md-1">
<br>
@ -27,7 +31,12 @@
</form>
<div class="panel panel-primary panel-hovered">
<div class="panel-heading">{Lang::T('Plugin')}</div>
<div class="panel-heading">{Lang::T('Plugin')}
<div class="btn-group pull-right">
<a class="btn btn-success btn-xs" title="refresh cache" href="{$_url}pluginmanager/refresh"><span
class="glyphicon glyphicon-refresh" aria-hidden="true"></span></a>
</div>
</div>
<div class="panel-body row">
{foreach $plugins as $plugin}
<div class="col-md-4">

View File

@ -475,8 +475,8 @@
href="{$_url}logs/radius">Radius</a>
</li>
{/if}
{$_MENU_LOGS}
</ul>
{$_MENU_LOGS}
</li>
{/if}
{$_MENU_AFTER_LOGS}