wrong variable again $c must be $b :))

This commit is contained in:
Ibnu Maksum 2024-06-21 23:15:27 +07:00
parent 00d3295632
commit b1d9e47096
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
2 changed files with 35 additions and 30 deletions

View File

@ -212,7 +212,7 @@ switch ($action) {
if ($b) { if ($b) {
$p = ORM::for_table('tbl_plans')->where('id', $b['plan_id'])->find_one(); $p = ORM::for_table('tbl_plans')->where('id', $b['plan_id'])->find_one();
if ($p) { if ($p) {
$p = ORM::for_table('tbl_plans')->where('id', $c['plan_id'])->find_one(); $p = ORM::for_table('tbl_plans')->where('id', $b['plan_id'])->find_one();
$c = User::_info($id_customer); $c = User::_info($id_customer);
$dvc = Package::getDevice($p); $dvc = Package::getDevice($p);
if ($_app_stage != 'demo') { if ($_app_stage != 'demo') {
@ -470,20 +470,20 @@ switch ($action) {
} }
$id = _post('id'); $id = _post('id');
$d = ORM::for_table('tbl_customers')->find_one($id); $c = ORM::for_table('tbl_customers')->find_one($id);
//lets find user Customers Attributes using id //lets find user Customers Attributes using id
$customFields = ORM::for_table('tbl_customers_fields') $customFields = ORM::for_table('tbl_customers_fields')
->where('customer_id', $id) ->where('customer_id', $id)
->find_many(); ->find_many();
if (!$d) { if (!$c) {
$msg .= Lang::T('Data Not Found') . '<br>'; $msg .= Lang::T('Data Not Found') . '<br>';
} }
$oldusername = $d['username']; $oldusername = $c['username'];
$oldPppoePassword = $d['password']; $oldPppoePassword = $c['password'];
$oldPassPassword = $d['pppoe_password']; $oldPassPassword = $c['pppoe_password'];
$userDiff = false; $userDiff = false;
$pppoeDiff = false; $pppoeDiff = false;
$passDiff = false; $passDiff = false;
@ -503,25 +503,25 @@ switch ($action) {
if ($msg == '') { if ($msg == '') {
if ($userDiff) { if ($userDiff) {
$d->username = $username; $c->username = $username;
} }
if ($password != '') { if ($password != '') {
$d->password = $password; $c->password = $password;
} }
$d->pppoe_password = $pppoe_password; $c->pppoe_password = $pppoe_password;
$d->fullname = $fullname; $c->fullname = $fullname;
$d->email = $email; $c->email = $email;
$d->account_type = $account_type; $c->account_type = $account_type;
$d->address = $address; $c->address = $address;
$d->status = $status; $c->status = $status;
$d->phonenumber = $phonenumber; $c->phonenumber = $phonenumber;
$d->service_type = $service_type; $c->service_type = $service_type;
$d->coordinates = $coordinates; $c->coordinates = $coordinates;
$d->city = $city; $c->city = $city;
$d->district = $district; $c->district = $district;
$d->state = $state; $c->state = $state;
$d->zip = $zip; $c->zip = $zip;
$d->save(); $c->save();
// Update Customers Attributes values in tbl_customers_fields table // Update Customers Attributes values in tbl_customers_fields table
@ -570,17 +570,17 @@ switch ($action) {
} }
if ($userDiff || $pppoeDiff || $passDiff) { if ($userDiff || $pppoeDiff || $passDiff) {
$c = ORM::for_table('tbl_user_recharges')->where('username', ($userDiff) ? $oldusername : $username)->find_one(); $tur = ORM::for_table('tbl_user_recharges')->where('username', ($userDiff) ? $oldusername : $username)->find_one();
if ($c) { if ($tur) {
$c->username = $username; $tur->username = $username;
$c->save(); $tur->save();
$p = ORM::for_table('tbl_plans')->find_one($c['plan_id']); $p = ORM::for_table('tbl_plans')->find_one($tur['plan_id']);
$dvc = Package::getDevice($p); $dvc = Package::getDevice($p);
if ($_app_stage != 'demo') { if ($_app_stage != 'demo') {
if (file_exists($dvc)) { if (file_exists($dvc)) {
require_once $dvc; require_once $dvc;
(new $p['device'])->remove_customer($d, $p); (new $p['device'])->remove_customer($c, $p);
(new $p['device'])->add_customer($d, $p); (new $p['device'])->add_customer($c, $p);
} else { } else {
new Exception(Lang::T("Devices Not Found")); new Exception(Lang::T("Devices Not Found"));
} }

View File

@ -512,5 +512,10 @@
"Rate": "Kecepatan", "Rate": "Kecepatan",
"Burst": "Meletus", "Burst": "Meletus",
"Router_Name___Location": "Nama\/Lokasi Router", "Router_Name___Location": "Nama\/Lokasi Router",
"Extend": "Memperpanjang" "Extend": "Memperpanjang",
"City": "Kota",
"": "",
"District": "Daerah",
"State": "Negara",
"Zip": "Ritsleting"
} }