show customer is online or not and Rearange Customer View

This commit is contained in:
Ibnu Maksum 2024-10-07 15:04:44 +07:00
parent e70a6c4dae
commit 5adb09efcf
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
3 changed files with 149 additions and 132 deletions

View File

@ -2,6 +2,12 @@
# CHANGELOG # CHANGELOG
## 2024.10.7
- Show Customer is Online or not
- Change Invoice Theme for printing
- Rearange Customer View
## 2024.9.23 ## 2024.9.23
- Discount Price - Discount Price

View File

@ -100,7 +100,8 @@
<li class="list-group-item"> <li class="list-group-item">
<b>{Lang::T('Coordinates')}</b> <span class="pull-right"> <b>{Lang::T('Coordinates')}</b> <span class="pull-right">
<i class="glyphicon glyphicon-road"></i> <a style="color: black;" <i class="glyphicon glyphicon-road"></i> <a style="color: black;"
href="https://www.google.com/maps/dir//{$d['coordinates']}/" target="_blank">{Lang::T('Get Directions')}</a> href="https://www.google.com/maps/dir//{$d['coordinates']}/"
target="_blank">{Lang::T('Get Directions')}</a>
</span> </span>
<div id="map" style="width: '100%'; height: 100px;"></div> <div id="map" style="width: '100%'; height: 100px;"></div>
</li> </li>
@ -119,141 +120,151 @@
</div> </div>
</div> </div>
</div> </div>
{foreach $packages as $package} </div>
<div class="box box-{if $package['status']=='on'}success{else}danger{/if}"> <div class="col-sm-8 col-md-8">
<div class="box-body box-profile"> <div class="box box-info">
<h4 class="text-center">{$package['type']} - {$package['namebp']}</h4> <ul class="nav nav-tabs">
<ul class="list-group list-group-unbordered"> <li role="presentation" {if $v=='order' }class="active" {/if}><a
<li class="list-group-item"> href="{$_url}customers/view/{$d['id']}/order">30 {Lang::T('Order History')}</a></li>
{Lang::T('Active')} <span class="pull-right">{if <li role="presentation" {if $v=='activation' }class="active" {/if}><a
$package['status']=='on'}yes{else}no href="{$_url}customers/view/{$d['id']}/activation">30 {Lang::T('Activation History')}</a></li>
{/if}</span> </ul>
</li> <div class="table-responsive" style="background-color: white;">
<li class="list-group-item"> <table id="datatable" class="table table-bordered table-striped">
{Lang::T('Type')} <span class="pull-right"> {if Lang::arrayCount($activation)}
{if $package['prepaid'] eq yes}Prepaid{else}<b>Postpaid</b>{/if}</span> <thead>
</li> <tr>
<li class="list-group-item"> <th>{Lang::T('Invoice')}</th>
{Lang::T('Bandwidth')} <span class="pull-right"> <th>{Lang::T('Username')}</th>
{$package['name_bw']}</span> <th>{Lang::T('Plan Name')}</th>
</li> <th>{Lang::T('Plan Price')}</th>
<li class="list-group-item"> <th>{Lang::T('Type')}</th>
{Lang::T('Created On')} <span <th>{Lang::T('Created On')}</th>
class="pull-right">{Lang::dateAndTimeFormat($package['recharged_on'],$package['recharged_time'])}</span> <th>{Lang::T('Expires On')}</th>
</li> <th>{Lang::T('Method')}</th>
<li class="list-group-item"> </tr>
{Lang::T('Expires On')} <span class="pull-right">{Lang::dateAndTimeFormat($package['expiration'], </thead>
$package['time'])}</span> <tbody>
</li> {foreach $activation as $ds}
<li class="list-group-item"> <tr onclick="window.location.href = '{$_url}plan/view/{$ds['id']}'" style="cursor:pointer;">
{$package['routers']} <span class="pull-right">{$package['method']}</span> <td>{$ds['invoice']}</td>
</li> <td>{$ds['username']}</td>
</ul> <td>{$ds['plan_name']}</td>
<div class="row"> <td>{Lang::moneyFormat($ds['price'])}</td>
<div class="col-xs-4"> <td>{$ds['type']}</td>
<a href="{$_url}customers/deactivate/{$d['id']}/{$package['plan_id']}" id="{$d['id']}" <td class="text-success">
class="btn btn-danger btn-block btn-sm" {Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}
onclick="return confirm('This will deactivate Customer Plan, and make it expired')">{Lang::T('Deactivate')}</a> </td>
</div> <td class="text-danger">{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
<div class="col-xs-8"> <td>{$ds['method']}</td>
<a href="{$_url}customers/recharge/{$d['id']}/{$package['plan_id']}" </tr>
class="btn btn-success btn-sm btn-block">{Lang::T('Recharge')}</a> {/foreach}
</tbody>
{/if}
{if Lang::arrayCount($order)}
<thead>
<tr>
<th>{Lang::T('Plan Name')}</th>
<th>{Lang::T('Gateway')}</th>
<th>{Lang::T('Routers')}</th>
<th>{Lang::T('Type')}</th>
<th>{Lang::T('Plan Price')}</th>
<th>{Lang::T('Created On')}</th>
<th>{Lang::T('Expires On')}</th>
<th>{Lang::T('Date Done')}</th>
<th>{Lang::T('Method')}</th>
</tr>
</thead>
<tbody>
{foreach $order as $ds}
<tr>
<td>{$ds['plan_name']}</td>
<td>{$ds['gateway']}</td>
<td>{$ds['routers']}</td>
<td>{$ds['payment_channel']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td>
<td class="text-primary">{Lang::dateTimeFormat($ds['created_date'])}</td>
<td class="text-danger">{Lang::dateTimeFormat($ds['expired_date'])}</td>
<td class="text-success">{if $ds['status']!=1}{Lang::dateTimeFormat($ds['paid_date'])}{/if}
</td>
<td>{if $ds['status']==1}{Lang::T('UNPAID')}
{elseif $ds['status']==2}{Lang::T('PAID')}
{elseif $ds['status']==3}{$_L['FAILED']}
{elseif $ds['status']==4}{Lang::T('CANCELED')}
{elseif $ds['status']==5}{Lang::T('UNKNOWN')}
{/if}</td>
</tr>
{/foreach}
</tbody>
{/if}
</table>
</div>
{include file="pagination.tpl"}
</div>
<div class="row">
{foreach $packages as $package}
<div class="col-md-6">
<div class="box box-{if $package['status']=='on'}success{else}danger{/if}">
<div class="box-body box-profile">
<h4 class="text-center">{$package['type']} - {$package['namebp']} <span
api-get-text="{$_url}autoload/customer_is_active/{$package['username']}/{$package['plan_id']}"></span>
</h4>
<ul class="list-group list-group-unbordered">
<li class="list-group-item">
{Lang::T('Active')} <span class="pull-right">{if
$package['status']=='on'}yes{else}no
{/if}</span>
</li>
<li class="list-group-item">
{Lang::T('Type')} <span class="pull-right">
{if $package['prepaid'] eq yes}Prepaid{else}<b>Postpaid</b>{/if}</span>
</li>
<li class="list-group-item">
{Lang::T('Bandwidth')} <span class="pull-right">
{$package['name_bw']}</span>
</li>
<li class="list-group-item">
{Lang::T('Created On')} <span
class="pull-right">{Lang::dateAndTimeFormat($package['recharged_on'],$package['recharged_time'])}</span>
</li>
<li class="list-group-item">
{Lang::T('Expires On')} <span class="pull-right">{Lang::dateAndTimeFormat($package['expiration'],
$package['time'])}</span>
</li>
<li class="list-group-item">
{$package['routers']} <span class="pull-right">{$package['method']}</span>
</li>
</ul>
<div class="row">
<div class="col-xs-4">
<a href="{$_url}customers/deactivate/{$d['id']}/{$package['plan_id']}" id="{$d['id']}"
class="btn btn-danger btn-block btn-sm"
onclick="return confirm('This will deactivate Customer Plan, and make it expired')">{Lang::T('Deactivate')}</a>
</div>
<div class="col-xs-8">
<a href="{$_url}customers/recharge/{$d['id']}/{$package['plan_id']}"
class="btn btn-success btn-sm btn-block">{Lang::T('Recharge')}</a>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> {/foreach}
{/foreach}
<div class="row">
<div class="col-xs-4">
<a href="{$_url}customers/list" class="btn btn-primary btn-sm btn-block">{Lang::T('Back')}</a>
</div>
<div class="col-xs-4">
<a href="{$_url}customers/sync/{$d['id']}"
onclick="return confirm('This will sync Customer to Mikrotik?')"
class="btn btn-info btn-sm btn-block">{Lang::T('Sync')}</a>
</div>
<div class="col-xs-4">
<a href="{$_url}message/send/{$d['id']}" class="btn btn-success btn-sm btn-block">{Lang::T('Send
Message')}</a>
</div>
</div> </div>
</div> </div>
<div class="col-sm-8 col-md-8"> </div>
<ul class="nav nav-tabs"> <hr>
<li role="presentation" {if $v=='order' }class="active" {/if}><a <div class="row">
href="{$_url}customers/view/{$d['id']}/order">30 {Lang::T('Order History')}</a></li> <div class="col-xs-4">
<li role="presentation" {if $v=='activation' }class="active" {/if}><a <a href="{$_url}customers/list" class="btn btn-primary btn-sm btn-block">{Lang::T('Back')}</a>
href="{$_url}customers/view/{$d['id']}/activation">30 {Lang::T('Activation History')}</a></li> </div>
</ul> <div class="col-xs-4">
<div class="table-responsive" style="background-color: white;"> <a href="{$_url}customers/sync/{$d['id']}" onclick="return confirm('This will sync Customer to Mikrotik?')"
<table id="datatable" class="table table-bordered table-striped"> class="btn btn-info btn-sm btn-block">{Lang::T('Sync')}</a>
{if Lang::arrayCount($activation)} </div>
<thead> <div class="col-xs-4">
<tr> <a href="{$_url}message/send/{$d['id']}" class="btn btn-success btn-sm btn-block">{Lang::T('Send
<th>{Lang::T('Invoice')}</th> Message')}</a>
<th>{Lang::T('Username')}</th>
<th>{Lang::T('Plan Name')}</th>
<th>{Lang::T('Plan Price')}</th>
<th>{Lang::T('Type')}</th>
<th>{Lang::T('Created On')}</th>
<th>{Lang::T('Expires On')}</th>
<th>{Lang::T('Method')}</th>
</tr>
</thead>
<tbody>
{foreach $activation as $ds}
<tr onclick="window.location.href = '{$_url}plan/view/{$ds['id']}'" style="cursor:pointer;">
<td>{$ds['invoice']}</td>
<td>{$ds['username']}</td>
<td>{$ds['plan_name']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td>
<td>{$ds['type']}</td>
<td class="text-success">{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}
</td>
<td class="text-danger">{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
<td>{$ds['method']}</td>
</tr>
{/foreach}
</tbody>
{/if}
{if Lang::arrayCount($order)}
<thead>
<tr>
<th>{Lang::T('Plan Name')}</th>
<th>{Lang::T('Gateway')}</th>
<th>{Lang::T('Routers')}</th>
<th>{Lang::T('Type')}</th>
<th>{Lang::T('Plan Price')}</th>
<th>{Lang::T('Created On')}</th>
<th>{Lang::T('Expires On')}</th>
<th>{Lang::T('Date Done')}</th>
<th>{Lang::T('Method')}</th>
</tr>
</thead>
<tbody>
{foreach $order as $ds}
<tr>
<td>{$ds['plan_name']}</td>
<td>{$ds['gateway']}</td>
<td>{$ds['routers']}</td>
<td>{$ds['payment_channel']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td>
<td class="text-primary">{Lang::dateTimeFormat($ds['created_date'])}</td>
<td class="text-danger">{Lang::dateTimeFormat($ds['expired_date'])}</td>
<td class="text-success">{if $ds['status']!=1}{Lang::dateTimeFormat($ds['paid_date'])}{/if}</td>
<td>{if $ds['status']==1}{Lang::T('UNPAID')}
{elseif $ds['status']==2}{Lang::T('PAID')}
{elseif $ds['status']==3}{$_L['FAILED']}
{elseif $ds['status']==4}{Lang::T('CANCELED')}
{elseif $ds['status']==5}{Lang::T('UNKNOWN')}
{/if}</td>
</tr>
{/foreach}
</tbody>
{/if}
</table>
</div>
{include file="pagination.tpl"}
</div> </div>
</div> </div>

View File

@ -1,3 +1,3 @@
{ {
"version": "2024.9.25" "version": "2024.10.7"
} }