Compare commits

...

8 Commits

Author SHA1 Message Date
8be8737236 2023.9.1 2023-09-01 09:21:35 +07:00
a8515b7d60 Fix Username in user dashboard 2023-09-01 09:18:17 +07:00
d71eb37f48 add Cancel Button in user dashboard 2023-09-01 09:16:40 +07:00
8fcca70ead Time will not change while extending package 2023-09-01 09:06:00 +07:00
59f6c180cf Critical Fix extending user package 2023-09-01 09:02:39 +07:00
d53c4cf8c8 Best 2023-08-30 15:14:18 +07:00
620bfaeb29 unlink after upload 2023-08-30 11:24:08 +07:00
863dd65145 remove debug echo 2023-08-30 10:22:58 +07:00
8 changed files with 39 additions and 17 deletions

View File

@ -2,6 +2,13 @@
# CHANGELOG # CHANGELOG
## 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 ## 2023.8.30
- Upload Logo from settings - Upload Logo from settings

View File

@ -39,7 +39,11 @@ class Lang
public static function dateTimeFormat($date){ public static function dateTimeFormat($date){
global $config; 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){ public static function dateAndTimeFormat($date, $time){

View File

@ -102,7 +102,7 @@ class Package
Mikrotik::addHotspotUser($client, $p, $c); 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 it same internet plan, expired will extend
if ($p['validity_unit'] == 'Months') { if ($p['validity_unit'] == 'Months') {
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' 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 it same internet plan, expired will extend
if ($p['validity_unit'] == 'Months') { if ($p['validity_unit'] == 'Months') {
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months')); $date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
$time = $b['time'];
} else if ($p['validity_unit'] == 'Days') { } else if ($p['validity_unit'] == 'Days') {
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days')); $date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
$time = $b['time'];
} else if ($p['validity_unit'] == 'Hrs') { } else if ($p['validity_unit'] == 'Hrs') {
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' hours'))); $datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' hours')));
$date_exp = $datetime[0]; $date_exp = $datetime[0];

View File

@ -229,12 +229,10 @@ switch ($action) {
run_hook('save_settings'); #HOOK 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 (!empty($_FILES['logo']['name'])) {
if (file_exists('system/uploads/logo.png')) unlink('system/uploads/logo.png'); 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); 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 == '') { if ($company == '') {
r2(U . 'settings/app', 'e', $_L['All_field_is_required']); r2(U . 'settings/app', 'e', $_L['All_field_is_required']);

View File

@ -24,7 +24,7 @@
<label class="col-md-2 control-label">{Lang::T('Company Logo')}</label> <label class="col-md-2 control-label">{Lang::T('Company Logo')}</label>
<div class="col-md-6"> <div class="col-md-6">
<input type="file" class="form-control" id="logo" name="logo" accept="image/*"> <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> </div>
<span class="help-block col-md-4"> <span class="help-block col-md-4">
<a href="./{$logo}" target="_blank"><img src="./{$logo}" height="48" alt="logo for PDF"></a> <a href="./{$logo}" target="_blank"><img src="./{$logo}" height="48" alt="logo for PDF"></a>

View File

@ -12,8 +12,7 @@
<tbody> <tbody>
<tr> <tr>
<td>{Lang::T('expired')}</td> <td>{Lang::T('expired')}</td>
<td>{date({$_c['date_format']}, strtotime($unpaid['expired_date']))} <td>{Lang::dateTimeFormat($unpaid['expired_date'])} </td>
{date('H:i', strtotime($unpaid['expired_date']))} </td>
</tr> </tr>
<tr> <tr>
<td>{$_L['Plan_Name']}</td> <td>{$_L['Plan_Name']}</td>
@ -30,10 +29,22 @@
</tbody> </tbody>
</table> </table>
<div class="box-footer p-2"> <div class="box-footer p-2">
<a class="btn btn-danger btn-block btn-sm" href="{$_url}order/view/{$unpaid['id']}"> <div class="btn-group btn-group-justified mb15">
<span class="icon"><i class="ion ion-card"></i></span> <div class="btn-group">
<span>{Lang::T('PAY NOW')}</span> <a href="{$_url}order/view/{$unpaid['id']}/cancel" class="btn btn-danger btn-sm"
</a> 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>
</div> </div>
{/if} {/if}
@ -54,7 +65,7 @@
<table class="table table-bordered table-striped table-bordered table-hover"> <table class="table table-bordered table-striped table-bordered table-hover">
<tr> <tr>
<td class="small text-success text-uppercase text-normal">{$_L['Username']}</td> <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>
<tr> <tr>
<td class="small text-success text-uppercase text-normal">{$_L['Password']}</td> <td class="small text-success text-uppercase text-normal">{$_L['Password']}</td>

View File

@ -70,10 +70,10 @@
</div> </div>
<div class="btn-group btn-group-justified mb15"> <div class="btn-group btn-group-justified mb15">
<div class="btn-group"> <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>
<div class="btn-group"> <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>
</div> </div>
</form> </form>

View File

@ -1,3 +1,3 @@
{ {
"version": "2023.8.30" "version": "2023.9.1"
} }