Compare commits
9 Commits
2023.8.30
...
2023.9.1.1
Author | SHA1 | Date | |
---|---|---|---|
04c480cafa | |||
8be8737236 | |||
a8515b7d60 | |||
d71eb37f48 | |||
8fcca70ead | |||
59f6c180cf | |||
d53c4cf8c8 | |||
620bfaeb29 | |||
863dd65145 |
11
CHANGELOG.md
11
CHANGELOG.md
@ -2,6 +2,17 @@
|
||||
|
||||
# CHANGELOG
|
||||
|
||||
## 2023.9.1.1
|
||||
|
||||
- Fix cronjob Delete customer
|
||||
|
||||
## 2023.9.1
|
||||
|
||||
- Critical bug fixes, bug happen when user buy package, expired time will be calculated from last expired, not from when they buy the package
|
||||
- Time not change after user buy package for extending
|
||||
- Add Cancel Button to user dashboard when it show unpaid package
|
||||
- Fix username in user dashboard
|
||||
|
||||
## 2023.8.30
|
||||
|
||||
- Upload Logo from settings
|
||||
|
@ -39,7 +39,11 @@ class Lang
|
||||
|
||||
public static function dateTimeFormat($date){
|
||||
global $config;
|
||||
return date($config['date_format']. ' H:i', strtotime($date));
|
||||
if(strtotime($date) < strtotime("2000-01-01 00:00:00")){
|
||||
return "";
|
||||
}else{
|
||||
return date($config['date_format']. ' H:i', strtotime($date));
|
||||
}
|
||||
}
|
||||
|
||||
public static function dateAndTimeFormat($date, $time){
|
||||
|
@ -19,7 +19,7 @@ class Package
|
||||
*/
|
||||
public static function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel)
|
||||
{
|
||||
global $_c, $_L, $_notifmsg;
|
||||
global $_c;
|
||||
$date_now = date("Y-m-d H:i:s");
|
||||
$date_only = date("Y-m-d");
|
||||
$time_only = date("H:i:s");
|
||||
@ -102,7 +102,7 @@ class Package
|
||||
Mikrotik::addHotspotUser($client, $p, $c);
|
||||
}
|
||||
|
||||
if ($b['namebp'] == $p['name_plan']) {
|
||||
if ($b['namebp'] == $p['name_plan'] && $b['status'] == 'on') {
|
||||
// if it same internet plan, expired will extend
|
||||
if ($p['validity_unit'] == 'Months') {
|
||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||
@ -200,12 +200,14 @@ class Package
|
||||
}
|
||||
|
||||
|
||||
if ($b['namebp'] == $p['name_plan']) {
|
||||
if ($b['namebp'] == $p['name_plan'] && $b['status'] == 'on') {
|
||||
// if it same internet plan, expired will extend
|
||||
if ($p['validity_unit'] == 'Months') {
|
||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||
$time = $b['time'];
|
||||
} else if ($p['validity_unit'] == 'Days') {
|
||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
|
||||
$time = $b['time'];
|
||||
} else if ($p['validity_unit'] == 'Hrs') {
|
||||
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' hours')));
|
||||
$date_exp = $datetime[0];
|
||||
|
@ -229,12 +229,10 @@ switch ($action) {
|
||||
run_hook('save_settings'); #HOOK
|
||||
|
||||
|
||||
if ($_FILES['logo']['error'] > 0) {
|
||||
r2(U . 'settings/app', 'e', 'Failed to process logo');
|
||||
}
|
||||
if (!empty($_FILES['logo']['name'])) {
|
||||
if (file_exists('system/uploads/logo.png')) unlink('system/uploads/logo.png');
|
||||
File::resizeCropImage($_FILES['logo']['tmp_name'], 'system/uploads/logo.png', 1078, 200, 100);
|
||||
if (file_exists($_FILES['logo']['tmp_name'])) unlink($_FILES['logo']['tmp_name']);
|
||||
}
|
||||
if ($company == '') {
|
||||
r2(U . 'settings/app', 'e', $_L['All_field_is_required']);
|
||||
|
@ -19,8 +19,8 @@ ORM::configure('logging', true);
|
||||
include "autoload/Hookers.php";
|
||||
|
||||
// notification message
|
||||
if(file_exists("system/uploads/notifications.json")){
|
||||
$_notifmsg =json_decode(file_get_contents('system/uploads/notifications.json'), true);
|
||||
if (file_exists("system/uploads/notifications.json")) {
|
||||
$_notifmsg = json_decode(file_get_contents('system/uploads/notifications.json'), true);
|
||||
}
|
||||
$_notifmsg_default = json_decode(file_get_contents('system/uploads/notifications.default.json'), true);
|
||||
|
||||
@ -66,7 +66,7 @@ date_default_timezone_set($config['timezone']);
|
||||
$textExpired = Lang::getNotifText('expired');
|
||||
|
||||
$d = ORM::for_table('tbl_user_recharges')->where('status', 'on')->where_lte('expiration', date("Y-m-d"))->find_many();
|
||||
echo "Found ".count($d)." user(s)\n";
|
||||
echo "Found " . count($d) . " user(s)\n";
|
||||
run_hook('cronjob'); #HOOK
|
||||
|
||||
foreach ($d as $ds) {
|
||||
@ -84,6 +84,7 @@ foreach ($d as $ds) {
|
||||
$client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']);
|
||||
Mikrotik::setHotspotLimitUptime($client, $c['username']);
|
||||
Mikrotik::removeHotspotActiveUser($client, $c['username']);
|
||||
Mikrotik::removeHotspotUser($client, $c['username']);
|
||||
Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $textExpired, $config['user_notification_expired']);
|
||||
}
|
||||
//update database user dengan status off
|
||||
@ -106,10 +107,10 @@ foreach ($d as $ds) {
|
||||
"\nRouter: " . $router_name .
|
||||
"\nPrice: " . $p['price']);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
echo "no renewall | plan enabled: $p[enabled] | User balance: $c[balance] | price $p[price]\n";
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
echo "no renewall | balance $config[enable_balance] auto_renewal $c[auto_renewal]\n";
|
||||
}
|
||||
} else echo " : ACTIVE \r\n";
|
||||
@ -127,6 +128,7 @@ foreach ($d as $ds) {
|
||||
$client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']);
|
||||
Mikrotik::disablePpoeUser($client, $c['username']);
|
||||
Mikrotik::removePpoeActive($client, $c['username']);
|
||||
Mikrotik::removePpoeUser($client, $c['username']);
|
||||
Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $textExpired, $config['user_notification_expired']);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
<label class="col-md-2 control-label">{Lang::T('Company Logo')}</label>
|
||||
<div class="col-md-6">
|
||||
<input type="file" class="form-control" id="logo" name="logo" accept="image/*">
|
||||
<span class="help-block">For PDF Reports | Beset size 1078 x 200 | uploaded image will be autosize</span>
|
||||
<span class="help-block">For PDF Reports | Best size 1078 x 200 | uploaded image will be autosize</span>
|
||||
</div>
|
||||
<span class="help-block col-md-4">
|
||||
<a href="./{$logo}" target="_blank"><img src="./{$logo}" height="48" alt="logo for PDF"></a>
|
||||
|
@ -12,8 +12,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{Lang::T('expired')}</td>
|
||||
<td>{date({$_c['date_format']}, strtotime($unpaid['expired_date']))}
|
||||
{date('H:i', strtotime($unpaid['expired_date']))} </td>
|
||||
<td>{Lang::dateTimeFormat($unpaid['expired_date'])} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{$_L['Plan_Name']}</td>
|
||||
@ -30,10 +29,22 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="box-footer p-2">
|
||||
<a class="btn btn-danger btn-block btn-sm" href="{$_url}order/view/{$unpaid['id']}">
|
||||
<span class="icon"><i class="ion ion-card"></i></span>
|
||||
<span>{Lang::T('PAY NOW')}</span>
|
||||
</a>
|
||||
<div class="btn-group btn-group-justified mb15">
|
||||
<div class="btn-group">
|
||||
<a href="{$_url}order/view/{$unpaid['id']}/cancel" class="btn btn-danger btn-sm"
|
||||
onclick="return confirm('{Lang::T('Cancel it?')}')">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
{Lang::T('Cancel')}
|
||||
</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-success btn-block btn-sm" href="{$_url}order/view/{$unpaid['id']}">
|
||||
<span class="icon"><i class="ion ion-card"></i></span>
|
||||
<span>{Lang::T('PAY NOW')}</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@ -54,7 +65,7 @@
|
||||
<table class="table table-bordered table-striped table-bordered table-hover">
|
||||
<tr>
|
||||
<td class="small text-success text-uppercase text-normal">{$_L['Username']}</td>
|
||||
<td class="small mb15">{$_bill['username']}</td>
|
||||
<td class="small mb15">{$_user['username']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="small text-success text-uppercase text-normal">{$_L['Password']}</td>
|
||||
|
@ -70,10 +70,10 @@
|
||||
</div>
|
||||
<div class="btn-group btn-group-justified mb15">
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn btn-primary">{$_L['Login']}</button>
|
||||
<a href="{$_url}register" class="btn btn-success">{$_L['Register']}</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a href="{$_url}register" class="btn btn-success">{$_L['Register']}</a>
|
||||
<button type="submit" class="btn btn-primary">{$_L['Login']}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "2023.8.30"
|
||||
"version": "2023.9.1.1"
|
||||
}
|
Reference in New Issue
Block a user