Send plan to friend will pay for Additional Cost

This commit is contained in:
Ibnu Maksum 2024-03-14 14:55:49 +07:00
parent cc8d810d45
commit 78d1634470
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
4 changed files with 26 additions and 22 deletions

View File

@ -208,18 +208,18 @@ switch ($action) {
} else { } else {
$router_name = $plan['routers']; $router_name = $plan['routers'];
} }
$add_rem = User::getAttribute("Additional Remaining", $id_customer); if (isset($_POST['send']) && $_POST['send'] == 'plan') {
$target = ORM::for_table('tbl_customers')->where('username', _post('username'))->find_one();
$add_rem = User::getAttribute("Additional Remaining", $target['id']);
if ($add_rem != 0) { if ($add_rem != 0) {
$add_cost = User::getAttribute("Additional Cost", $id_customer); $add_cost = User::getAttribute("Additional Cost", $target['id']);
if (!empty($add_cost)) { if (!empty($add_cost)) {
$bills = User::getAttributes("Bill", $id_customer); $bills = User::getAttributes("Bill", $target['id']);
$ui->assign('bills', $bills); $ui->assign('bills', $bills);
$ui->assign('add_cost', $add_cost); $ui->assign('add_cost', $add_cost);
$plan['price'] += $add_cost; $plan['price'] += $add_cost;
} }
} }
if (isset($_POST['send']) && $_POST['send'] == 'plan') {
$target = ORM::for_table('tbl_customers')->where('username', _post('username'))->find_one();
if (!$target) { if (!$target) {
r2(U . 'home', 'd', Lang::T('Username not found')); r2(U . 'home', 'd', Lang::T('Username not found'));
} }

View File

@ -489,5 +489,7 @@
"Remaining": "Remaining", "Remaining": "Remaining",
"": "", "": "",
"Not_Found": "Not Found", "Not_Found": "Not Found",
"Cash": "Cash" "Cash": "Cash",
"Payment_not_found": "Payment not found",
"If_your_friend_have_Additional_Cost__you_will_pay_for_that_too": "If your friend have Additional Cost, you will pay for that too"
} }

View File

@ -113,8 +113,8 @@
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li> <li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
<li>{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</li> <li>{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</li>
</ol> </ol>
<div class="row">
{if Lang::arrayCount($radius_pppoe)>0} {if Lang::arrayCount($radius_pppoe)>0}
<div class="row">
{foreach $radius_pppoe as $plan} {foreach $radius_pppoe as $plan}
<div class="col col-md-4"> <div class="col col-md-4">
<div class="box box-primary"> <div class="box box-primary">
@ -157,13 +157,14 @@
</div> </div>
</div> </div>
{/foreach} {/foreach}
</div>
{/if} {/if}
{if Lang::arrayCount($radius_hotspot)>0} {if Lang::arrayCount($radius_hotspot)>0}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li> <li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
<li>{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}</li> <li>{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}</li>
</ol> </ol>
<div class="row">
{foreach $radius_hotspot as $plan} {foreach $radius_hotspot as $plan}
<div class="col col-md-4"> <div class="col col-md-4">
<div class="box box-primary"> <div class="box box-primary">
@ -206,10 +207,10 @@
</div> </div>
</div> </div>
{/foreach} {/foreach}
{/if}
</div> </div>
{/if} {/if}
{/if} {/if}
{/if}
{foreach $routers as $router} {foreach $routers as $router}
{if Validator::isRouterHasPlan($plans_hotspot, $router['name']) || Validator::isRouterHasPlan($plans_pppoe, $router['name'])} {if Validator::isRouterHasPlan($plans_hotspot, $router['name']) || Validator::isRouterHasPlan($plans_pppoe, $router['name'])}
<div class="box box-solid box-primary bg-gray"> <div class="box box-solid box-primary bg-gray">

View File

@ -47,6 +47,7 @@
value="plan"><i class="glyphicon glyphicon-send"></i></button> value="plan"><i class="glyphicon glyphicon-send"></i></button>
</div> </div>
</div> </div>
<p class="help-block text-center">{Lang::T('If your friend have Additional Cost, you will pay for that too')}</p>
</form> </form>
</div> </div>
</div> </div>