From 1fbd393fa38aab3e4096237455e9f69eb6070440 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Tue, 25 Jun 2024 14:31:12 +0700 Subject: [PATCH] Phone otp update from customer --- system/controllers/accounts.php | 3 ++- system/controllers/plan.php | 11 +++++++++-- system/lan/indonesia.json | 14 +++++++++++++- ui/ui/user-phone-update.tpl | 4 ++-- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/system/controllers/accounts.php b/system/controllers/accounts.php index 50282c55..9e050ca3 100644 --- a/system/controllers/accounts.php +++ b/system/controllers/accounts.php @@ -119,6 +119,7 @@ switch ($action) { if ($d) { //run_hook('customer_view_edit_profile'); #HOOK $ui->assign('d', $d); + $ui->assign('new_phone', $_SESSION['new_phone']); $ui->display('user-phone-update.tpl'); } else { r2(U . 'home', 'e', Lang::T('Account Not Found')); @@ -129,7 +130,7 @@ switch ($action) { $phone = Lang::phoneFormat(_post('phone')); $username = $user['username']; $otpPath = $CACHE_PATH . '/sms/'; - + $_SESSION['new_phone'] = $phone; // Validate the phone number format if (!preg_match('/^[0-9]{10,}$/', $phone)) { r2(U . 'accounts/phone-update', 'e', Lang::T('Invalid phone number format')); diff --git a/system/controllers/plan.php b/system/controllers/plan.php index ab4b4164..0386ba2d 100644 --- a/system/controllers/plan.php +++ b/system/controllers/plan.php @@ -247,9 +247,16 @@ switch ($action) { $ui->assign('d', $d); $p = ORM::for_table('tbl_plans')->find_one($d['plan_id']); if (in_array($admin['user_type'], array('SuperAdmin', 'Admin'))) { - $ps = ORM::for_table('tbl_plans')->where('type', $p['type'])->where('is_radius', $p['is_radius'])->find_many(); + $ps = ORM::for_table('tbl_plans') + ->where('type', $p['type']) + ->where('is_radius', $p['is_radius']) + ->find_many(); } else { - $ps = ORM::for_table('tbl_plans')->where("enabled", 1)->where('is_radius', $p['is_radius'])->where('type', $p['type'])->find_many(); + $ps = ORM::for_table('tbl_plans') + ->where("enabled", 1) + ->where('is_radius', $p['is_radius']) + ->where('type', $p['type']) + ->find_many(); } $ui->assign('p', $ps); run_hook('view_edit_customer_plan'); #HOOK diff --git a/system/lan/indonesia.json b/system/lan/indonesia.json index 4eba06b0..87448522 100644 --- a/system/lan/indonesia.json +++ b/system/lan/indonesia.json @@ -547,5 +547,17 @@ "Customer_Name": "Nama Pelanggan", "Customer_Username": "Nama Pengguna Pelanggan", "Customer_Phone": "Telepon Pelanggan", - "Your_Company_Name": "Nama perusahaan Anda" + "Your_Company_Name": "Nama perusahaan Anda", + "Change": "Mengubah", + "Change_Phone_Number": "Ubah Nomor Telepon", + "Current_Number": "Nomor Saat Ini", + "New_Number": "Nomor baru", + "Input_your_phone_number": "Masukkan nomor telepon Anda", + "OTP": "OTP", + "Enter_OTP_that_was_sent_to_your_phone": "Masukkan OTP yang dikirimkan ke ponsel Anda", + "Update": "Memperbarui", + "Verification_code_has_been_sent_to_your_phone": "Kode verifikasi telah dikirimkan ke ponsel Anda", + "Please_wait_1039_seconds_before_sending_another_SMS": "Harap tunggu 1039 detik sebelum mengirim SMS lainnya", + "Please_wait_1015_seconds_before_sending_another_SMS": "Harap tunggu 1015 detik sebelum mengirim SMS lainnya", + "Phone_number_updated_successfully": "Nomor telepon berhasil diperbarui" } \ No newline at end of file diff --git a/ui/ui/user-phone-update.tpl b/ui/ui/user-phone-update.tpl index 65f528ca..1553842c 100644 --- a/ui/ui/user-phone-update.tpl +++ b/ui/ui/user-phone-update.tpl @@ -24,7 +24,7 @@
+ - @@ -47,7 +47,7 @@
-
+
Or {Lang::T('Cancel')}