diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 01c637a..6d906a6 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -22,16 +22,12 @@ $routes->get('/home', 'Home\Home::dashboard'); */ $routes->group('board', ['namespace' => 'App\Controllers\Board'], function ($routes) { - // /board/notice/lists + /** + * 공지사항 + */ $routes->get('notice/lists', 'Notice::notice'); - - // /board/notice/detail/(:num) $routes->get('notice/detail/(:num)', 'Notice::detail/$1'); - - // /board/notice/write $routes->get('notice/write', 'Notice::write'); - - // /board/notice/modify/(:num) $routes->get('notice/modify/(:num)', 'Notice::modify/$1'); // API @@ -66,6 +62,7 @@ $routes->group('manage', ['namespace' => 'App\Controllers\Manage'], function ($r $routes->post('user/save', 'User::saveUser'); $routes->post('user/remove', 'User::removeUser'); $routes->get('user/excel', 'User::excel'); + $routes->post('user/saveSms', 'User::saveSms'); /** API - 조직관리 */ $routes->get('dept/getDeptList', 'Dept::getDeptList'); diff --git a/app/Controllers/manage/User.php b/app/Controllers/manage/User.php index 6cbc138..cae6870 100644 --- a/app/Controllers/manage/User.php +++ b/app/Controllers/manage/User.php @@ -155,6 +155,30 @@ class User extends BaseController } } + + // SMS 인증여부 일괄저장 + public function saveSms() + { + try { + + $useYn = $this->request->getPost('useYn') ?: 'Y'; + + // UPDATE users + $this->userModel->updateUserSmsYn($useYn); + + return $this->response->setJSON([ + 'code' => '0', + 'msg' => 'success' + ]); + + } catch (\Exception $e) { + return $this->response->setJSON([ + 'code' => '9', + 'msg' => $e->getMessage(), + ]); + } + } + // 엑셀다운로드 public function excel() { diff --git a/app/Models/manage/UserModel.php b/app/Models/manage/UserModel.php index 3394a8a..f21520e 100644 --- a/app/Models/manage/UserModel.php +++ b/app/Models/manage/UserModel.php @@ -349,6 +349,28 @@ class UserModel extends Model ]; } + // 유저 SMS 인증정보 일괄 수정 + public function updateUserSmsYn($useYn) + { + $sql = "UPDATE users + SET sms_auth_yn = {$useYn}} + WHERE use_yn = 'Y' "; + + $this->db->query($sql); + + if ($this->db->transStatus() === false) { + return [ + 'success' => false, + 'msg' => '저장실패', + ]; + } + + // 성공 + return [ + 'success' => true, + ]; + } + // 엑셀 다운로드 조회 public function getExcelUserList($data) { diff --git a/app/Views/pages/manage/dept/lists.php b/app/Views/pages/manage/dept/lists.php index 84c3553..886c0d1 100644 --- a/app/Views/pages/manage/dept/lists.php +++ b/app/Views/pages/manage/dept/lists.php @@ -13,6 +13,11 @@ .blockUI { z-index: 1500 !important; } + + .swal2-cancel { + background-color: #ff0000 !important; + color: #fff !important; + }

조직 관리

diff --git a/app/Views/pages/manage/permit/lists.php b/app/Views/pages/manage/permit/lists.php index 5d64cb7..ab69d60 100644 --- a/app/Views/pages/manage/permit/lists.php +++ b/app/Views/pages/manage/permit/lists.php @@ -33,10 +33,8 @@
-

메뉴 목록

-
@@ -103,7 +107,27 @@
-
사용자 관리
+
+

사용자 목록

+ + +
+ + + +
+ + +
+
+
@@ -412,6 +436,71 @@ myModal.show(); }); + // SMS 일괄저장 + $("#btnSmsSave").on("click", function () { + + swal.fire({ + text: "저장 하시겠습니까?", + type: "warning", + showCancelButton: true, + confirmButtonText: "예", + cancelButtonText: "아니오", + closeOnConfirm: false, + closeOnCancel: true, + confirmButtonColor: "#3085d6", + cancelButtonColor: "#d33", + }).then((result) => { + if (result.isConfirmed) { + $.ajax({ + url: '/manage/user/saveSms', + contentType: 'application/x-www-form-urlencoded;charset=UTF-8', + method: 'POST', + data: { 'useYn': $("#srcUseYn").val() }, + beforeSend: function () { + blockUI.blockPage({ + message: tpl + }) + }, + complete: function () { + blockUI.unblockPage() + }, + error: function (xhr, error, thrown) { + blockUI.unblockPage() + var msg = ""; + if (xhr.responseText != null) { + msg = xhr.responseText + } else { + msg = "잠시후 다시 시도해 주세요." + } + + Swal.fire({ + title: msg, + icon: "error" + }) + }, + success: function (result) { + + if (result.code == '0') { + userModalHide() + $("#btnSearch").trigger('click') + Swal.fire({ + title: '정상 처리되었습니다.', + icon: "success" + + }) + } else { + Swal.fire({ + title: result.msg, + icon: "error" + }) + } + } + }); + } + }); + + }); + // 유저정보저장 $("#userSave").on("click", function () { @@ -502,10 +591,7 @@ } }); } - - - - }) + }); });