dont show disabled plan and routers

This commit is contained in:
Ibnu Maksum 2022-09-08 14:00:46 +07:00
parent 6afcdfe1fa
commit 99f9f73a70
No known key found for this signature in database
GPG key ID: 7FC82848810579E5
5 changed files with 25 additions and 17 deletions

View file

@ -87,6 +87,7 @@ $ui->setCompileDir('ui/compiled/');
$ui->setConfigDir('ui/conf/');
$ui->setCacheDir('ui/cache/');
$ui->assign('app_url', APP_URL);
$ui->assign('_domain', str_replace('www.', '', parse_url(APP_URL,PHP_URL_HOST)));
define('U', APP_URL . '/index.php?_route=');
$ui->assign('_url', APP_URL . '/index.php?_route=');
$ui->assign('_theme', $_theme);

View file

@ -20,7 +20,7 @@ switch ($action) {
break;
case 'server':
$d = ORM::for_table('tbl_routers')->find_many();
$d = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many();
$ui->assign('d',$d);
$ui->display('autoload-server.tpl');
@ -29,7 +29,7 @@ switch ($action) {
case 'plan':
$server = _post('server');
$jenis = _post('jenis');
$d = ORM::for_table('tbl_plans')->where('routers', $server)->where('type', $jenis)->find_many();
$d = ORM::for_table('tbl_plans')->where('routers', $server)->where('type', $jenis)->where('enabled', '1')->find_many();
$ui->assign('d',$d);
$ui->display('autoload.tpl');

View file

@ -20,7 +20,7 @@ switch ($action) {
break;
case 'ppoe':
$ui->assign('_title', 'Order PPOE Internet- '. $config['CompanyName']);$routers = ORM::for_table('tbl_routers')->find_many();
$plans = ORM::for_table('tbl_plans')->where('type', 'PPPOE')->find_many();
$plans = ORM::for_table('tbl_plans')->where('type', 'PPPOE')->where('enabled', '1')->find_many();
$ui->assign('routers',$routers);
$ui->assign('plans', $plans);
$ui->display('user-orderPPOE.tpl');
@ -28,7 +28,7 @@ switch ($action) {
case 'hotspot':
$ui->assign('_title', 'Order Hotspot Internet- '. $config['CompanyName']);
$routers = ORM::for_table('tbl_routers')->find_many();
$plans = ORM::for_table('tbl_plans')->where('type', 'Hotspot')->find_many();
$plans = ORM::for_table('tbl_plans')->where('type', 'Hotspot')->where('enabled', '1')->find_many();
$ui->assign('routers',$routers);
$ui->assign('plans', $plans);
$ui->display('user-orderHotspot.tpl');

View file

@ -43,9 +43,9 @@ switch ($action) {
case 'recharge':
$c = ORM::for_table('tbl_customers')->find_many();
$ui->assign('c', $c);
$p = ORM::for_table('tbl_plans')->find_many();
$p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many();
$ui->assign('p', $p);
$r = ORM::for_table('tbl_routers')->find_many();
$r = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many();
$ui->assign('r', $r);
$ui->display('recharge.tpl');
@ -57,9 +57,9 @@ switch ($action) {
$c = ORM::for_table('tbl_customers')->find_many();
$ui->assign('c', $c);
$p = ORM::for_table('tbl_plans')->find_many();
$p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many();
$ui->assign('p', $p);
$r = ORM::for_table('tbl_routers')->find_many();
$r = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many();
$ui->assign('r', $r);
$ui->display('recharge-user.tpl');
@ -82,7 +82,7 @@ switch ($action) {
if ($msg == '') {
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
$p = ORM::for_table('tbl_plans')->where('id', $plan)->find_one();
$p = ORM::for_table('tbl_plans')->where('id', $plan)->where('enabled', '1')->find_one();
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->find_one();
$mikrotik = Router::_info($server);
@ -457,7 +457,7 @@ switch ($action) {
$d = ORM::for_table('tbl_user_recharges')->find_one($id);
if ($d) {
$ui->assign('d', $d);
$p = ORM::for_table('tbl_plans')->find_many();
$p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many();
$ui->assign('p', $p);
$ui->display('prepaid-edit.tpl');
@ -552,7 +552,7 @@ switch ($action) {
if ($code != '') {
$ui->assign('code', $code);
$paginator = Paginator::bootstrap('tbl_voucher', 'code', '%' . $code . '%');
$d = ORM::for_table('tbl_plans')
$d = ORM::for_table('tbl_plans')->where('enabled', '1')
->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan'))
->where_like('tbl_plans.code', '%' . $code . '%')
->offset($paginator['startpoint'])
@ -560,7 +560,7 @@ switch ($action) {
->find_many();
} else {
$paginator = Paginator::bootstrap('tbl_voucher');
$d = ORM::for_table('tbl_plans')
$d = ORM::for_table('tbl_plans')->where('enabled', '1')
->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan'))
->offset($paginator['startpoint'])
->limit($paginator['limit'])->find_many();
@ -575,9 +575,9 @@ switch ($action) {
$c = ORM::for_table('tbl_customers')->find_many();
$ui->assign('c', $c);
$p = ORM::for_table('tbl_plans')->find_many();
$p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many();
$ui->assign('p', $p);
$r = ORM::for_table('tbl_routers')->find_many();
$r = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many();
$ui->assign('r', $r);
$ui->display('voucher-add.tpl');

View file

@ -37,8 +37,6 @@
</select>
</div>
</div>
</div>
<div class="panel-body">
<div class="form-group">
<label class="col-md-2 control-label">Radius Mode?</label>
<div class="col-md-6">
@ -51,6 +49,13 @@
<p class="help-block">With Radius user can use Hotspot or PPOE.</p>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">APP URL</label>
<div class="col-md-6">
<input type="text" readonly class="form-control" value="{$app_url}">
<p class="help-block">system/config.php</p>
</div>
</div>
</div>
<div class="panel-heading">Telegram Notification</div>
<div class="panel-body">
@ -115,8 +120,10 @@ add dst-host=*.tawk.to</pre>
</div>
</div>
</div>
<pre>/ip hotspot walled-garden
add dst-host={$_domain}
add dst-host=*.{$_domain}</pre>
</div>
</div>
</div>
</form>