From 98d8b4fe4e9c09970c6eb15a55370cef6f27606d Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Fri, 21 Jun 2024 19:55:51 +0700 Subject: [PATCH] change whereIdIn to where_in --- system/controllers/plan.php | 2 +- system/controllers/services.php | 4 ++-- system/devices/Radius.php | 8 ++++---- system/lan/indonesia.json | 18 +++++++++++++++++- system/lan/turkish.json | 4 +++- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/system/controllers/plan.php b/system/controllers/plan.php index d3a1d144..a77af78f 100644 --- a/system/controllers/plan.php +++ b/system/controllers/plan.php @@ -386,7 +386,7 @@ switch ($action) { $ui->assign('customers', ORM::for_table('tbl_voucher')->distinct()->select("user")->whereNotEqual("user", '0')->findArray()); // option plans $plns = ORM::for_table('tbl_voucher')->distinct()->select("id_plan")->findArray(); - $ui->assign('plans', ORM::for_table('tbl_plans')->selects(["id", 'name_plan'])->whereIdIn(array_column($plns, 'id_plan'))->findArray()); + $ui->assign('plans', ORM::for_table('tbl_plans')->selects(["id", 'name_plan'])->where_in('id', array_column($plns, 'id_plan'))->findArray()); $ui->assign('routers', array_column(ORM::for_table('tbl_voucher')->distinct()->select("routers")->findArray(), 'routers')); diff --git a/system/controllers/services.php b/system/controllers/services.php index 812e029e..1daad2e1 100644 --- a/system/controllers/services.php +++ b/system/controllers/services.php @@ -82,7 +82,7 @@ switch ($action) { . "&router=" . urlencode($router); $bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'Hotspot')->findArray(); - $ui->assign('bws', ORM::for_table('tbl_bandwidth')->selects(["id", 'name_bw'])->whereIdIn(array_column($bws, 'id_bw'))->findArray()); + $ui->assign('bws', ORM::for_table('tbl_bandwidth')->selects(["id", 'name_bw'])->where_in('id', array_column($bws, 'id_bw'))->findArray()); $ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type")); $ui->assign('type3s', ORM::for_table('tbl_plans')->getEnum("typebp")); $ui->assign('valids', ORM::for_table('tbl_plans')->getEnum("validity_unit")); @@ -447,7 +447,7 @@ switch ($action) { . "&router=" . urlencode($router); $bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->findArray(); - $ui->assign('bws', ORM::for_table('tbl_bandwidth')->selects(["id", 'name_bw'])->whereIdIn(array_column($bws, 'id_bw'))->findArray()); + $ui->assign('bws', ORM::for_table('tbl_bandwidth')->selects(["id", 'name_bw'])->where_in('id', array_column($bws, 'id_bw'))->findArray()); $ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type")); $ui->assign('type3s', ORM::for_table('tbl_plans')->getEnum("typebp")); $ui->assign('valids', ORM::for_table('tbl_plans')->getEnum("validity_unit")); diff --git a/system/devices/Radius.php b/system/devices/Radius.php index b8e62a7a..7cd59f77 100644 --- a/system/devices/Radius.php +++ b/system/devices/Radius.php @@ -220,7 +220,7 @@ class Radius { if ($p) { // if exists $this->delAtribute($this->getTableCustomer(), 'Max-All-Session', 'username', $customer['username']); - //$this->delAtribute($this->getTableCustomer(), 'Max-Volume', 'username', $customer['username']); + $this->delAtribute($this->getTableCustomer(), 'Max-Volume', 'username', $customer['username']); $this->delAtribute($this->getTableCustomer(), 'Max-Data', 'username', $customer['username']); $p->groupname = "plan_" . $plan['id']; $p->save(); @@ -238,7 +238,7 @@ class Radius { else $timelimit = $plan['time_limit'] * 60; $this->upsertCustomer($customer['username'], 'Max-All-Session', $timelimit); - //$this->upsertCustomer($customer['username'], 'Expire-After', $timelimit); + $this->upsertCustomer($customer['username'], 'Expire-After', $timelimit); } else if ($plan['limit_type'] == "Data_Limit") { if ($plan['data_unit'] == 'GB') $datalimit = $plan['data_limit'] . "000000000"; @@ -281,7 +281,7 @@ class Radius { if ($expired != null) { //$this->upsertCustomer($customer['username'], 'access-period', strtotime($expired) - time()); $this->upsertCustomer($customer['username'], 'Max-All-Session', strtotime($expired) - time()); - //$this->upsertCustomer($customer['username'], 'expiration', date('d M Y H:i:s', strtotime($expired))); + $this->upsertCustomer($customer['username'], 'expiration', date('d M Y H:i:s', strtotime($expired))); // Mikrotik Spesific $this->upsertCustomer( $customer['username'], @@ -291,7 +291,7 @@ class Radius { } else { $this->delAtribute($this->getTableCustomer(), 'Max-All-Session', 'username', $customer['username']); //$this->delAtribute($this->getTableCustomer(), 'access-period', 'username', $customer['username']); - //$this->delAtribute($this->getTableCustomer(), 'expiration', 'username', $customer['username']); + $this->delAtribute($this->getTableCustomer(), 'expiration', 'username', $customer['username']); } if ($plan['type'] == 'PPPOE') { diff --git a/system/lan/indonesia.json b/system/lan/indonesia.json index e1b4bb89..c0df641f 100644 --- a/system/lan/indonesia.json +++ b/system/lan/indonesia.json @@ -494,5 +494,21 @@ "Tax_Rates_in_percentage": "Tarif Pajak dalam persentase", "Custom_Tax_Rate": "Tarif Pajak Khusus", "Enter_Custom_Tax_Rate": "Masukkan Tarif Pajak Khusus", - "Enter_the_custom_tax_rate__e_g___3_75_for_3_75__": "Masukkan tarif pajak khusus (misalnya 3,75 untuk 3,75%)" + "Enter_the_custom_tax_rate__e_g___3_75_for_3_75__": "Masukkan tarif pajak khusus (misalnya 3,75 untuk 3,75%)", + "Local_IP": "IP lokal", + "Business": "Bisnis", + "Category": "Kategori", + "Device": "Perangkat", + "Expired": "Kedaluwarsa", + "Time": "Waktu", + "Data": "Data", + "1_Period___1_Month__Expires_the_20th_of_each_month": "1 Periode = 1 Bulan, Berakhir pada tanggal 20 setiap bulannya", + "Expired_Date": "Tanggal kadaluarsa", + "Expired_Action": "Tindakan Kedaluwarsa", + "Optional": "Opsional", + "Expired_Internet_Plan": "Paket Internet Kedaluwarsa", + "When_Expired__customer_will_be_move_to_selected_internet_plan": "Ketika Expired, pelanggan akan dipindahkan ke paket internet yang dipilih", + "Period": "Periode", + "Rate": "Kecepatan", + "Burst": "Meletus" } \ No newline at end of file diff --git a/system/lan/turkish.json b/system/lan/turkish.json index bf8337b4..96cb21e0 100644 --- a/system/lan/turkish.json +++ b/system/lan/turkish.json @@ -389,5 +389,7 @@ "Maintenance_Mode": "Bak\u0131m Modu", "Logs": "K\u00fct\u00fckler", "Language_Editor": "Dil Edit\u00f6r\u00fc", - "Change_title_in_user_Plan_order": "Kullan\u0131c\u0131 Plan\u0131 s\u0131ras\u0131ndaki ba\u015fl\u0131\u011f\u0131 de\u011fi\u015ftir" + "Change_title_in_user_Plan_order": "Kullan\u0131c\u0131 Plan\u0131 s\u0131ras\u0131ndaki ba\u015fl\u0131\u011f\u0131 de\u011fi\u015ftir", + "Local_IP": "Yerel IP", + "Prev": "\u00d6nceki" } \ No newline at end of file