check if router has plan
This commit is contained in:
parent
c5b96df43f
commit
c9eeefcf3d
@ -299,4 +299,23 @@ class Validator
|
|||||||
return (bool)in_array($format, $formats);
|
return (bool)in_array($format, $formats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function countRouterPlan($plans, $router){
|
||||||
|
$n = 0;
|
||||||
|
foreach ($plans as $plan){
|
||||||
|
if($plan['routers'] == $router){
|
||||||
|
$n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $n;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function isRouterHasPlan($plans, $router){
|
||||||
|
foreach ($plans as $plan){
|
||||||
|
if($plan['routers'] == $router){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{foreach $routers as $router}
|
{foreach $routers as $router}
|
||||||
|
{if Validator::isRouterHasPlan($plans_hotspot, $router['name'])>0 && Validator::isRouterHasPlan($plans_pppoe, $router['name'])>0}
|
||||||
<div class="box box-solid box-info">
|
<div class="box box-solid box-info">
|
||||||
<div class="box-header text-black">{$router['name']}</div>
|
<div class="box-header text-black">{$router['name']}</div>
|
||||||
{if $router['description'] != ''}
|
{if $router['description'] != ''}
|
||||||
@ -42,7 +43,7 @@
|
|||||||
{$router['description']}
|
{$router['description']}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{if count($plans_hotspot)>0}
|
{if Validator::countRouterPlan($plans_hotspot, $router['name'])>0}
|
||||||
<div class="box-header">{Lang::T('Hotspot Plan')}</div>
|
<div class="box-header">{Lang::T('Hotspot Plan')}</div>
|
||||||
<div class="box-body row">
|
<div class="box-body row">
|
||||||
{foreach $plans_hotspot as $plan}
|
{foreach $plans_hotspot as $plan}
|
||||||
@ -91,7 +92,7 @@
|
|||||||
{/foreach}
|
{/foreach}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{if count($plans_pppoe)>0}
|
{if Validator::countRouterPlan($plans_pppoe,$router['name'])>0}
|
||||||
<div class="box-header text-sm">{Lang::T('PPPOE Plan')}</div>
|
<div class="box-header text-sm">{Lang::T('PPPOE Plan')}</div>
|
||||||
<div class="box-body row">
|
<div class="box-body row">
|
||||||
{foreach $plans_pppoe as $plan}
|
{foreach $plans_pppoe as $plan}
|
||||||
@ -141,6 +142,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user