forked from kevinowino869/mitrobill
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
8be8737236 | |||
a8515b7d60 | |||
d71eb37f48 | |||
8fcca70ead | |||
59f6c180cf | |||
d53c4cf8c8 | |||
620bfaeb29 | |||
863dd65145 |
@ -2,6 +2,13 @@
|
||||
|
||||
# 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
|
||||
|
||||
- Upload Logo from settings
|
||||
|
@ -39,8 +39,12 @@ class Lang
|
||||
|
||||
public static function dateTimeFormat($date){
|
||||
global $config;
|
||||
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){
|
||||
global $config;
|
||||
|
@ -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']);
|
||||
|
@ -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,12 +29,24 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<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">
|
||||
<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}
|
||||
<div class="box box-info box-solid">
|
||||
<div class="box-header">
|
||||
@ -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"
|
||||
}
|
Reference in New Issue
Block a user