forked from kevinowino869/mitrobill
show plan by nux-router
This commit is contained in:
@ -35,9 +35,19 @@ switch ($action) {
|
||||
}
|
||||
$ui->assign('_title', 'Order Plan');
|
||||
$ui->assign('_system_menu', 'package');
|
||||
$routers = ORM::for_table('tbl_routers')->find_many();
|
||||
$plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'PPPOE')->find_many();
|
||||
$plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Hotspot')->find_many();
|
||||
if(!empty($_SESSION['nux-router'])){
|
||||
$routers = ORM::for_table('tbl_routers')->where('id',$_SESSION['nux-router'])->find_many();
|
||||
$rs = [];
|
||||
foreach($routers as $r){
|
||||
$rs[] = $r['name'];
|
||||
}
|
||||
$plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('type', 'PPPOE')->find_many();
|
||||
$plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('type', 'Hotspot')->find_many();
|
||||
}else{
|
||||
$routers = ORM::for_table('tbl_routers')->find_many();
|
||||
$plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'PPPOE')->find_many();
|
||||
$plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Hotspot')->find_many();
|
||||
}
|
||||
$plans_balance = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Balance')->find_many();
|
||||
$ui->assign('routers', $routers);
|
||||
$ui->assign('plans_pppoe', $plans_pppoe);
|
||||
|
Reference in New Issue
Block a user