This commit is contained in:
30
app/Cells/MenuCell.php
Normal file
30
app/Cells/MenuCell.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace App\Cells;
|
||||
|
||||
use App\Models\common\MenuModel;
|
||||
class MenuCell
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$model = new MenuModel();
|
||||
$menus = $model->getMenuList();
|
||||
|
||||
$menuIcons = [
|
||||
'M1' => 'pe-7s-note2',
|
||||
'M2' => 'pe-7s-monitor',
|
||||
'M3' => 'pe-7s-mail',
|
||||
'M4' => 'pe-7s-display2',
|
||||
'M5' => 'pe-7s-config',
|
||||
'M6' => '',
|
||||
'M7' => 'pe-7s-monitor',
|
||||
'M8' => 'pe-7s-server',
|
||||
'M9' => 'pe-7s-graph2',
|
||||
];
|
||||
|
||||
return view('layouts/sidebar', [
|
||||
'mMenu' => $menus["mainMenu"],
|
||||
'sMenu' => $menus["subMenu"],
|
||||
'icons' => $menuIcons,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -25,29 +25,29 @@ class Database extends Config
|
||||
* @var array<string, mixed>
|
||||
*/
|
||||
public array $default = [
|
||||
'DSN' => '',
|
||||
'hostname' => 'localhost',
|
||||
'username' => '',
|
||||
'password' => '',
|
||||
'database' => '',
|
||||
'DBDriver' => 'MySQLi',
|
||||
'DBPrefix' => '',
|
||||
'pConnect' => false,
|
||||
'DBDebug' => true,
|
||||
'charset' => 'utf8mb4',
|
||||
'DBCollat' => 'utf8mb4_general_ci',
|
||||
'swapPre' => '',
|
||||
'encrypt' => false,
|
||||
'compress' => false,
|
||||
'strictOn' => false,
|
||||
'failover' => [],
|
||||
'port' => 3306,
|
||||
'DSN' => '',
|
||||
'hostname' => '192.168.10.246',
|
||||
'username' => 'confirms',
|
||||
'password' => 'zjsvjatm',
|
||||
'database' => 'db_confirms',
|
||||
'DBDriver' => 'MySQLi',
|
||||
'DBPrefix' => '',
|
||||
'pConnect' => false,
|
||||
'DBDebug' => true,
|
||||
'charset' => 'utf8mb4',
|
||||
'DBCollat' => 'utf8mb4_general_ci',
|
||||
'swapPre' => '',
|
||||
'encrypt' => false,
|
||||
'compress' => false,
|
||||
'strictOn' => false,
|
||||
'failover' => [],
|
||||
'port' => 3306,
|
||||
'numberNative' => false,
|
||||
'foundRows' => false,
|
||||
'dateFormat' => [
|
||||
'date' => 'Y-m-d',
|
||||
'foundRows' => false,
|
||||
'dateFormat' => [
|
||||
'date' => 'Y-m-d',
|
||||
'datetime' => 'Y-m-d H:i:s',
|
||||
'time' => 'H:i:s',
|
||||
'time' => 'H:i:s',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -163,29 +163,29 @@ class Database extends Config
|
||||
* @var array<string, mixed>
|
||||
*/
|
||||
public array $tests = [
|
||||
'DSN' => '',
|
||||
'hostname' => '127.0.0.1',
|
||||
'username' => '',
|
||||
'password' => '',
|
||||
'database' => ':memory:',
|
||||
'DBDriver' => 'SQLite3',
|
||||
'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE FOR CI DEVS
|
||||
'pConnect' => false,
|
||||
'DBDebug' => true,
|
||||
'charset' => 'utf8',
|
||||
'DBCollat' => '',
|
||||
'swapPre' => '',
|
||||
'encrypt' => false,
|
||||
'compress' => false,
|
||||
'strictOn' => false,
|
||||
'failover' => [],
|
||||
'port' => 3306,
|
||||
'DSN' => '',
|
||||
'hostname' => '127.0.0.1',
|
||||
'username' => '',
|
||||
'password' => '',
|
||||
'database' => ':memory:',
|
||||
'DBDriver' => 'SQLite3',
|
||||
'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE FOR CI DEVS
|
||||
'pConnect' => false,
|
||||
'DBDebug' => true,
|
||||
'charset' => 'utf8',
|
||||
'DBCollat' => '',
|
||||
'swapPre' => '',
|
||||
'encrypt' => false,
|
||||
'compress' => false,
|
||||
'strictOn' => false,
|
||||
'failover' => [],
|
||||
'port' => 3306,
|
||||
'foreignKeys' => true,
|
||||
'busyTimeout' => 1000,
|
||||
'dateFormat' => [
|
||||
'date' => 'Y-m-d',
|
||||
'dateFormat' => [
|
||||
'date' => 'Y-m-d',
|
||||
'datetime' => 'Y-m-d H:i:s',
|
||||
'time' => 'H:i:s',
|
||||
'time' => 'H:i:s',
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
@@ -25,15 +25,16 @@ class Filters extends BaseFilters
|
||||
* or [filter_name => [classname1, classname2, ...]]
|
||||
*/
|
||||
public array $aliases = [
|
||||
'csrf' => CSRF::class,
|
||||
'toolbar' => DebugToolbar::class,
|
||||
'honeypot' => Honeypot::class,
|
||||
'invalidchars' => InvalidChars::class,
|
||||
'csrf' => CSRF::class,
|
||||
'toolbar' => DebugToolbar::class,
|
||||
'honeypot' => Honeypot::class,
|
||||
'invalidchars' => InvalidChars::class,
|
||||
'secureheaders' => SecureHeaders::class,
|
||||
'cors' => Cors::class,
|
||||
'forcehttps' => ForceHTTPS::class,
|
||||
'pagecache' => PageCache::class,
|
||||
'performance' => PerformanceMetrics::class,
|
||||
'cors' => Cors::class,
|
||||
'forcehttps' => ForceHTTPS::class,
|
||||
'pagecache' => PageCache::class,
|
||||
'performance' => PerformanceMetrics::class,
|
||||
'auth' => \App\Filters\AuthCheck::class,
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -75,6 +76,17 @@ class Filters extends BaseFilters
|
||||
// 'honeypot',
|
||||
// 'csrf',
|
||||
// 'invalidchars',
|
||||
'auth' => [
|
||||
'except' => [
|
||||
'login', // GET /login
|
||||
'login/*', // /login/* 모두
|
||||
'index.php/login', // /index.php/login
|
||||
'index.php/login/*', // /index.php/login/*
|
||||
'register', // 회원가입 등
|
||||
'register/*',
|
||||
'api/*', // 필요하면 API는 예외
|
||||
],
|
||||
],
|
||||
],
|
||||
'after' => [
|
||||
// 'honeypot',
|
||||
|
||||
@@ -5,9 +5,60 @@ use CodeIgniter\Router\RouteCollection;
|
||||
/**
|
||||
* @var RouteCollection $routes
|
||||
*/
|
||||
$routes->get('/', 'Home::index');
|
||||
|
||||
$routes->get('/hello', 'Home::hello');
|
||||
$routes->setAutoRoute(true);
|
||||
|
||||
/**
|
||||
* 화면
|
||||
*/
|
||||
|
||||
$routes->get("/login", "Login::index");
|
||||
$routes->get("/logout", "Login::out");
|
||||
$routes->get('/', 'Home\Home::dashboard');
|
||||
$routes->get('/home', 'Home\Home::dashboard');
|
||||
|
||||
$routes->get('/board/notice/lists', 'Board\Notice::notice'); // 공지사항
|
||||
$routes->get('/board/notice/detail/(:num)', 'Board\Notice::detail/$1'); // 공지사항 상세
|
||||
$routes->get('/board/notice/write', 'Board\Notice::write'); // 공지사항 작성
|
||||
$routes->get('/board/notice/modify/(:num)', 'Board\Notice::modify/$1'); // 공지사항 수정
|
||||
|
||||
/**
|
||||
* 시스템관리
|
||||
*/
|
||||
$routes->get('/manage/user/lists', 'Manage\User::user'); // 사용자관리
|
||||
$routes->get('/manage/dept/lists', 'Manage\Dept::dept'); // 조직관리
|
||||
$routes->get('/manage/dept/getchkuser', 'Manage\Dept::getchkuser'); // 총괄팀장 페이지
|
||||
|
||||
$routes->get('/manage/menu/lists', 'Manage\Menu::lists'); // 메뉴관리
|
||||
$routes->get('/manage/dupl_phone/lists', 'Manage\Phone::lists'); // 전화확인관리
|
||||
$routes->get('/manage/loginlog/lists', 'Manage\LoginLog::lists'); // 로그인이력
|
||||
|
||||
|
||||
$routes->get('/dashboard', 'Main::dashboard');
|
||||
/**
|
||||
* API ROUTES
|
||||
*/
|
||||
$routes->post('/login/chkLogin', 'Login::chkLogin'); // 로그인 요청
|
||||
$routes->get('/board/notice/getNoticeList', 'Board\Notice::getNoticeList'); // 공지사항 목록 조회
|
||||
$routes->post('/board/notice/actWrite', 'Board\Notice::actWrite'); // 공지사항 작성 요청
|
||||
$routes->post('/board/notice/actModify', 'Board\Notice::actModify'); // 공지사항 작성 요청
|
||||
$routes->post('/board/notice/remove', 'Board\Notice::actRemove'); // 공지사항 삭제 요청
|
||||
$routes->get('/board/notice/download/(:num)', 'Board\Notice::download/$1'); // 첨부파일 다운로드
|
||||
|
||||
// 시스템관리
|
||||
$routes->get('/manage/user/getUserList', 'Manage\User::getUserList'); // 유저 목록 조회
|
||||
$routes->post('/manage/user/save', 'Manage\User::saveUser'); // 유저정보저장
|
||||
$routes->post('/manage/user/remove', 'Manage\User::removeUser'); // 유저정보삭제
|
||||
$routes->get('/manage/user/excel', 'Manage\User::excel'); // 유저 엑셀다운로드
|
||||
|
||||
$routes->get('/manage/dept/getDeptList', 'Manage\Dept::getDeptList'); // 조직목록 조회
|
||||
$routes->get('/manage/dept/getUserList', 'Manage\Dept::getUserList'); // 유저 목록 조회
|
||||
$routes->get('/manage/dept/getPdept', 'Manage\Dept::getPdept'); // 상위조직 조회
|
||||
$routes->post('/manage/dept/saveDept', 'Manage\Dept::saveDept'); // 상위조직 조회
|
||||
|
||||
$routes->post('/manage/menu/getMenuList', 'Manage\Menu::getMenuList'); // 메뉴 목록 조회
|
||||
|
||||
$routes->get('/manage/dupl_phone/getDuplPhoneList', 'Manage\Phone::getDuplPhoneList'); // 전화확인 목록조회
|
||||
$routes->post('/manage/dupl_phone/savePhone', 'Manage\Phone::savePhone'); // 전화정보저장
|
||||
|
||||
$routes->get('/manage/loginlog/getLogList', 'Manage\LoginLog::getLogList'); // 로그 목록 조회
|
||||
$routes->get('/manage/loginlog/excel', 'Manage\LoginLog::excel'); // 엑셀다운로드
|
||||
|
||||
@@ -1,58 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
use App\Models\common\MenuModel;
|
||||
|
||||
use CodeIgniter\Controller;
|
||||
use CodeIgniter\HTTP\CLIRequest;
|
||||
use CodeIgniter\HTTP\IncomingRequest;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
/**
|
||||
* Class BaseController
|
||||
*
|
||||
* BaseController provides a convenient place for loading components
|
||||
* and performing functions that are needed by all your controllers.
|
||||
* Extend this class in any new controllers:
|
||||
* class Home extends BaseController
|
||||
*
|
||||
* For security be sure to declare any new methods as protected or private.
|
||||
*/
|
||||
abstract class BaseController extends Controller
|
||||
{
|
||||
/**
|
||||
* Instance of the main Request object.
|
||||
*
|
||||
* @var CLIRequest|IncomingRequest
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* An array of helpers to be loaded automatically upon
|
||||
* class instantiation. These helpers will be available
|
||||
* to all other controllers that extend BaseController.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $helpers = [];
|
||||
protected $session;
|
||||
protected $data = [];
|
||||
|
||||
/**
|
||||
* Be sure to declare properties for any property fetch you initialized.
|
||||
* The creation of dynamic property is deprecated in PHP 8.2.
|
||||
*/
|
||||
// protected $session;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
public function initController($request, $response, $logger)
|
||||
{
|
||||
// Do Not Edit This Line
|
||||
parent::initController($request, $response, $logger);
|
||||
|
||||
// Preload any models, libraries, etc, here.
|
||||
$this->session = \Config\Services::session();
|
||||
|
||||
// E.g.: $this->session = service('session');
|
||||
// 메뉴 전역 로딩
|
||||
$menuModel = new MenuModel();
|
||||
$menus = $menuModel->getMenuList();
|
||||
$this->data['menus'] = $menus["mainMenu"];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
class Home extends BaseController
|
||||
{
|
||||
public function index(): string
|
||||
{
|
||||
return view('welcome_message');
|
||||
}
|
||||
|
||||
public function hello() : string {
|
||||
return 'hello111';
|
||||
}
|
||||
}
|
||||
164
app/Controllers/Login.php
Normal file
164
app/Controllers/Login.php
Normal file
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\common\LoginModel;
|
||||
|
||||
class Login extends BaseController
|
||||
{
|
||||
private $loginModel;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->loginModel = new LoginModel();
|
||||
}
|
||||
|
||||
public function index(): string
|
||||
{
|
||||
return view('pages/login');
|
||||
}
|
||||
|
||||
// 로그인
|
||||
public function chkLogin()
|
||||
{
|
||||
$logs = [
|
||||
'usr_id' => $this->request->getPost('user_id'),
|
||||
'userIp' => $this->get_user_ip(),
|
||||
'userAgent' => $_SERVER['HTTP_USER_AGENT'] ?: '',
|
||||
];
|
||||
|
||||
try {
|
||||
|
||||
/** ------------------------------------
|
||||
* 1) 유효성 검사
|
||||
* ------------------------------------*/
|
||||
$rules = [
|
||||
'user_id' => [
|
||||
'rules' => 'required|min_length[4]|max_length[20]',
|
||||
'errors' => [
|
||||
'required' => '아이디를 입력해주세요.',
|
||||
'min_length' => '아이디는 최소 {param}자 이상이어야 합니다.',
|
||||
'max_length' => '아이디는 최대 {param}자까지 가능합니다.',
|
||||
],
|
||||
],
|
||||
'user_pw' => [
|
||||
'rules' => 'required|min_length[4]|max_length[30]',
|
||||
'errors' => [
|
||||
'required' => '비밀번호를 입력해주세요.',
|
||||
'min_length' => '비밀번호는 최소 {param}자 이상이어야 합니다.',
|
||||
'max_length' => '비밀번호는 최대 {param}자까지 가능합니다.',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
if (!$this->validate($rules)) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '1',
|
||||
'errors' => $this->validator->getErrors()
|
||||
]);
|
||||
}
|
||||
|
||||
/** ------------------------------------
|
||||
* 2) 로그인 정보 조회
|
||||
* ------------------------------------*/
|
||||
$userId = $this->request->getPost('user_id');
|
||||
$userPw = $this->request->getPost('user_pw');
|
||||
|
||||
$this->loginModel = new LoginModel();
|
||||
$user = $this->loginModel->getUserByIdPw($userId, $userPw);
|
||||
|
||||
if (!$user) {
|
||||
$logs['results'] = 0;
|
||||
$logs['usr_sq'] = null;
|
||||
$logs['reason'] = '존재하지 않는 아이디입니다.';
|
||||
|
||||
$this->loginModel->insertUserLog($logs);
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '1',
|
||||
'msg' => '존재하지 않는 아이디입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
if (strcmp($user['usr_pw'], $user['chk_pw']) !== 0) {
|
||||
$logs['results'] = 0;
|
||||
$logs['usr_sq'] = $user['usr_sq'];
|
||||
$logs['reason'] = '잘못된 비밀번호 입니다.';
|
||||
|
||||
$this->loginModel->insertUserLog($logs);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'code' => '1',
|
||||
'msg' => '잘못된 비밀번호 입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/** ------------------------------------
|
||||
* 3) 세션 저장
|
||||
* ------------------------------------*/
|
||||
$newdata = [
|
||||
'usr_sq' => $user['usr_sq'],
|
||||
'usr_id' => $user['usr_id'],
|
||||
'usr_nm' => $user['usr_nm'],
|
||||
'dept_sq' => $user['dept_sq'],
|
||||
'dept_nm' => $user['dept_nm'],
|
||||
'bonbu_sq' => $user['bonbu_sq'],
|
||||
'bonbu_nm' => $user['bonbu_nm'],
|
||||
'usr_level' => $user['usr_level'],
|
||||
'depth' => $user['depth'],
|
||||
'logged_in' => true
|
||||
];
|
||||
|
||||
$logs['results'] = 1;
|
||||
$logs['usr_sq'] = $user['usr_sq'];
|
||||
$logs['reason'] = '로그인 성공';
|
||||
|
||||
$this->loginModel->insertUserLog($logs);
|
||||
|
||||
$this->session->set($newdata);
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success'
|
||||
]);
|
||||
|
||||
} catch (\Throwable $e) {
|
||||
|
||||
/** ------------------------------------
|
||||
* 4) 예외발생 처리 (DB 오류, 세션 오류 등)
|
||||
* ------------------------------------*/
|
||||
log_message('error', '[LOGIN ERROR] ' . $e->getMessage());
|
||||
log_message('error', $e->getTraceAsString());
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => '서버 내부 오류가 발생했습니다. 잠시 후 다시 시도해주세요.'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function out()
|
||||
{
|
||||
$this->session->destroy();
|
||||
return redirect()->to('/login');
|
||||
}
|
||||
|
||||
|
||||
private function get_user_ip()
|
||||
{
|
||||
$ip_address = '';
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
|
||||
$ip_address = $_SERVER['HTTP_CLIENT_IP'];
|
||||
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
// Check for multiple IPs in the header, take the first one (most likely the client)
|
||||
$ip_address = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])[0];
|
||||
} else {
|
||||
$ip_address = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
return $ip_address;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
use mysqli;
|
||||
|
||||
class Main extends BaseController
|
||||
{
|
||||
function __construct() {
|
||||
|
||||
}
|
||||
|
||||
public function dashboard() : string
|
||||
{
|
||||
return view('pages/dashboard');
|
||||
}
|
||||
|
||||
}
|
||||
298
app/Controllers/board/Notice.php
Normal file
298
app/Controllers/board/Notice.php
Normal file
@@ -0,0 +1,298 @@
|
||||
<?php
|
||||
namespace App\Controllers\board;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\board\NoticeModel;
|
||||
|
||||
class Notice extends BaseController
|
||||
{
|
||||
private $notice;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->notice = new NoticeModel();
|
||||
}
|
||||
|
||||
public function notice(): string
|
||||
{
|
||||
return view('pages/board/notice');
|
||||
}
|
||||
|
||||
|
||||
public function getNoticeList()
|
||||
{
|
||||
|
||||
$start = (int) $this->request->getGet('start') ?: 0;
|
||||
$end = (int) $this->request->getGet('length') ?: 10;
|
||||
|
||||
$data = [
|
||||
'srchType' => $this->request->getGet('srchType') ?: '',
|
||||
'srchTxt' => $this->request->getGet('srchTxt') ?: '',
|
||||
];
|
||||
|
||||
$totalCount = $this->notice->getTotalCount($data);
|
||||
|
||||
|
||||
$datas = $this->notice->getNoticeList($start, $end, $data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'recordsTotal' => $totalCount,
|
||||
'recordsFiltered' => $totalCount,
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 공지사항 상세
|
||||
public function detail($id = null)
|
||||
{
|
||||
$id = (int) $id;
|
||||
|
||||
if ($id <= 0) {
|
||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
// 데이터 조회
|
||||
$data = $this->notice->getNoticeData($id);
|
||||
|
||||
if (!$data) {
|
||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
return view('pages/board/noticeDetail', $data);
|
||||
}
|
||||
|
||||
// 첨부파일 다운로드
|
||||
public function download($fileSq = null)
|
||||
{
|
||||
$fileSq = (int) $fileSq;
|
||||
|
||||
if ($fileSq <= 0) {
|
||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
// 1) DB에서 파일 정보 조회
|
||||
$fileInfo = $this->notice->getFile($fileSq);
|
||||
|
||||
if (!$fileInfo) {
|
||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
// DB에 이렇게 저장했다고 가정:
|
||||
// file_path : /var/www/html/writable/upload/notice
|
||||
// file_name : 실제 서버 파일명 (orig or new)
|
||||
|
||||
// dd($fileInfo);
|
||||
|
||||
$filePath = rtrim($fileInfo['file_path'], '/\\') . DIRECTORY_SEPARATOR . $fileInfo['file_name'];
|
||||
|
||||
if (!is_file($filePath)) {
|
||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
// 브라우저에 보여줄 다운로드 파일명 (원본 이름)
|
||||
$downloadName = $fileInfo['orig_name'];
|
||||
|
||||
// 2) CI4 내장 다운로드 헬퍼 사용
|
||||
return $this->response->download($filePath, null)->setFileName($downloadName);
|
||||
}
|
||||
|
||||
|
||||
// 공지사항 작성 화면
|
||||
public function write(): string
|
||||
{
|
||||
return view('pages/board/noticeWrite');
|
||||
}
|
||||
|
||||
// 공지사항 작성
|
||||
public function actWrite()
|
||||
{
|
||||
|
||||
|
||||
try {
|
||||
|
||||
|
||||
$data = [
|
||||
'subject' => $this->request->getPost('subject'),
|
||||
'content' => $this->request->getPost('content'),
|
||||
'insert_usr' => session()->get('usr_id'),
|
||||
'insert_nm' => session()->get('usr_nm'),
|
||||
];
|
||||
|
||||
|
||||
|
||||
$file = $this->request->getFile('file');
|
||||
|
||||
if ($file && $file->isValid() && !$file->hasMoved()) {
|
||||
$origName = $file->getClientName();
|
||||
$ext = $file->getClientExtension();
|
||||
$size = $file->getSize();
|
||||
$mime = $file->getMimeType();
|
||||
$type = $file->getClientMimeType();
|
||||
$tempName = $file->getTempName();
|
||||
$imgYn = (strpos($mime, 'image/') === 0) ? 'Y' : 'N';
|
||||
|
||||
// 저장 경로
|
||||
$saveDir = WRITEPATH . 'upload/notice';
|
||||
if (!is_dir($saveDir)) {
|
||||
mkdir($saveDir, 0777, true);
|
||||
}
|
||||
|
||||
// 서버 저장 이름 (덮어쓰기 방지를 위해 랜덤으로 추천)
|
||||
$newName = $file->getRandomName();
|
||||
$file->move($saveDir, $newName);
|
||||
|
||||
// 모델로 넘길 파일 정보
|
||||
$data['file'] = [
|
||||
'orig_name' => $origName,
|
||||
'new_name' => $newName,
|
||||
'file_path' => $saveDir,
|
||||
'ext' => $ext,
|
||||
'size' => $size,
|
||||
'img_yn' => $imgYn,
|
||||
'img_height' => null,
|
||||
'img_width' => null,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
$result = $this->notice->write($data);
|
||||
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success'
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
log_message('error', '[LOGIN ERROR] ' . $e->getMessage());
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 공지사항 수정
|
||||
public function modify($id = null): string
|
||||
{
|
||||
|
||||
$id = (int) $id;
|
||||
|
||||
|
||||
if ($id <= 0) {
|
||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
// 데이터 조회
|
||||
$data = $this->notice->getNoticeData($id);
|
||||
|
||||
if (!$data) {
|
||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
|
||||
return view('pages/board/noticeModify', $data);
|
||||
|
||||
}
|
||||
|
||||
// 공지사항 수정요청
|
||||
public function actModify()
|
||||
{
|
||||
try {
|
||||
|
||||
$data = [
|
||||
'bbs_sq' => $this->request->getPost('bbs_sq'),
|
||||
'subject' => $this->request->getPost('subject'),
|
||||
'content' => $this->request->getPost('content'),
|
||||
'update_usr' => session()->get('usr_id'),
|
||||
'update_nm' => session()->get('usr_nm'),
|
||||
];
|
||||
|
||||
|
||||
|
||||
$file = $this->request->getFile('file');
|
||||
|
||||
if ($file && $file->isValid() && !$file->hasMoved()) {
|
||||
$origName = $file->getClientName();
|
||||
$ext = $file->getClientExtension();
|
||||
$size = $file->getSize();
|
||||
$mime = $file->getMimeType(); // ★ move() 전에!
|
||||
$type = $file->getClientMimeType();
|
||||
$tempName = $file->getTempName();
|
||||
$imgYn = (strpos($mime, 'image/') === 0) ? 'Y' : 'N';
|
||||
|
||||
// 저장 경로
|
||||
$saveDir = WRITEPATH . 'upload/notice';
|
||||
if (!is_dir($saveDir)) {
|
||||
mkdir($saveDir, 0777, true);
|
||||
}
|
||||
|
||||
// 서버 저장 이름 (덮어쓰기 방지를 위해 랜덤으로 추천)
|
||||
$newName = $file->getRandomName();
|
||||
$file->move($saveDir, $newName);
|
||||
|
||||
// 모델로 넘길 파일 정보
|
||||
$data['file'] = [
|
||||
'file_sq' => $this->request->getPost('file_sq'),
|
||||
'orig_name' => $origName,
|
||||
'new_name' => $newName,
|
||||
'file_path' => $saveDir, // 필요에 따라 상대경로로만 저장
|
||||
'ext' => $ext,
|
||||
'size' => $size,
|
||||
'img_yn' => $imgYn,
|
||||
// 높이/폭은 나중에 getimagesize 등으로 구해도 됨
|
||||
'img_height' => null,
|
||||
'img_width' => null,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
$result = $this->notice->modify($data);
|
||||
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success'
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
log_message('error', '[LOGIN ERROR] ' . $e->getMessage());
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 공지사항 삭제요청
|
||||
public function actRemove()
|
||||
{
|
||||
try {
|
||||
|
||||
$data = [
|
||||
'bbs_sq' => $this->request->getPost('bbs_sq'),
|
||||
'update_usr' => session()->get('usr_id'),
|
||||
'update_nm' => session()->get('usr_nm'),
|
||||
];
|
||||
|
||||
$this->notice->remove($data);
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success'
|
||||
]);
|
||||
|
||||
|
||||
} catch (\Exception $e) {
|
||||
log_message('error', '[LOGIN ERROR] ' . $e->getMessage());
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
45
app/Controllers/home/Home.php
Normal file
45
app/Controllers/home/Home.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\home;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\Home\HomeModel;
|
||||
|
||||
class Home extends BaseController
|
||||
{
|
||||
private $homeModel;
|
||||
|
||||
private $sdate = '';
|
||||
private $edate = '';
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
$this->sdate = date('Y-m-d', strtotime('-1 month'));
|
||||
$this->edate = date('Y-m-d');
|
||||
|
||||
$this->homeModel = new HomeModel();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function dashboard(): string
|
||||
{
|
||||
|
||||
$notice = $this->homeModel->getNoticeList();
|
||||
$statistics = $this->homeModel->getHomeStatistics($this->sdate, $this->edate);
|
||||
|
||||
|
||||
return view('pages/home/dashboard', [
|
||||
'menus' => $this->data,
|
||||
'notice' => $notice,
|
||||
'statistics' => $statistics,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
188
app/Controllers/listfax/ListFax.php
Normal file
188
app/Controllers/listfax/ListFax.php
Normal file
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
namespace App\Controllers\listfax;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Libraries\Common;
|
||||
use App\Models\listfax\ListFaxModel;
|
||||
|
||||
|
||||
class ListFax extends BaseController
|
||||
{
|
||||
|
||||
private $todo = ''; // 검색, 엑셀다운 구분
|
||||
private $menuid = ''; // 레프트메뉴아이디
|
||||
|
||||
private $page = ''; // 현재페이지
|
||||
private $pagesize = ''; // 페이징 개수
|
||||
|
||||
private $atcl_no = ''; // 매물번호
|
||||
private $stat_cd = ''; // 현재상태
|
||||
private $chk_atcl_no = ''; // 매물번호 입력/미입력 구분
|
||||
private $realtor_nm = ''; // 중개소
|
||||
private $recv_stime = ''; // 수신기간(시간)
|
||||
private $recv_etime = ''; // 수신기간(시간)
|
||||
private $complete_stime = ''; // 처리기간(전송)
|
||||
private $complete_etime = ''; // 처리기간(전송)
|
||||
private $sido = ''; // 시도
|
||||
private $gugun = ''; // 시군구
|
||||
private $dong = ''; // 읍면동
|
||||
private $target_yn = ''; // 작업대상여부(정상여부)
|
||||
private $cpid = ''; // 매체사(CP)ID
|
||||
private $caller_no = ''; // 발신번호
|
||||
private $charger = ''; // 담당자
|
||||
private $charger_gbn = ''; // 담당구분 1: 서류/전화, 2: 등기부등본
|
||||
private $dept1_sq = ''; // 본부
|
||||
private $dept2_sq = ''; // 팀
|
||||
private $assign_yn = ''; // 배정여부 1: 배정, 2: 미배정
|
||||
private $checking = '0'; // 조회여부 확인
|
||||
|
||||
private $pars = [];
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->initParams();
|
||||
}
|
||||
|
||||
|
||||
public function initParams()
|
||||
{
|
||||
// parent::__construct();
|
||||
|
||||
$this->todo = $this->request->getGet('todo', TRUE);
|
||||
$this->menuid = $this->request->getGet('m', TRUE);
|
||||
|
||||
$this->page = $this->request->getGet('page', TRUE);
|
||||
$this->pagesize = $this->request->getGet('pagesize', TRUE);
|
||||
|
||||
if (empty($this->todo)) {
|
||||
$this->todo = 'inq';
|
||||
}
|
||||
|
||||
$this->atcl_no = $this->request->getGet('atcl_no', TRUE);
|
||||
$this->stat_cd = $this->request->getGet('stat_cd', TRUE);
|
||||
$this->chk_atcl_no = $this->request->getGet('chk_atcl_no', TRUE);
|
||||
$this->realtor_nm = $this->request->getGet('realtor_nm', TRUE);
|
||||
$this->recv_stime = $this->request->getGet('recv_stime', TRUE);
|
||||
$this->recv_etime = $this->request->getGet('recv_etime', TRUE);
|
||||
$this->complete_stime = $this->request->getGet('complete_stime', TRUE);
|
||||
$this->complete_etime = $this->request->getGet('complete_etime', TRUE);
|
||||
$this->sido = $this->request->getGet('sido', TRUE);
|
||||
$this->gugun = $this->request->getGet('gugun', TRUE);
|
||||
$this->dong = $this->request->getGet('dong', TRUE);
|
||||
$this->target_yn = $this->request->getGet('target_yn', TRUE);
|
||||
$this->cpid = $this->request->getGet('cpid', TRUE);
|
||||
$this->caller_no = $this->request->getGet('caller_no', TRUE);
|
||||
$this->charger = $this->request->getGet('charger', TRUE);
|
||||
$this->charger_gbn = $this->request->getGet('charger_gbn', TRUE);
|
||||
$this->dept1_sq = $this->request->getGet('dept1_sq', TRUE);
|
||||
$this->dept2_sq = $this->request->getGet('dept2_sq', TRUE);
|
||||
$this->assign_yn = $this->request->getGet('assign_yn', TRUE);
|
||||
$this->checking = $this->request->getGet('checking', TRUE);
|
||||
|
||||
// 기본 선택 - 기본값을 수신시간을 당일로 처리한다.
|
||||
$toDay = date('Y-m-d');
|
||||
if (empty($this->recv_stime))
|
||||
$this->recv_stime = date("Y-m-d", strtotime("-7 days")) . ' 00:00:00';
|
||||
if (empty($this->recv_etime))
|
||||
$this->recv_etime = $toDay . ' 23:59:59';
|
||||
|
||||
if (empty($this->assign_yn))
|
||||
$this->assign_yn = 'A';
|
||||
|
||||
$this->pars = array(
|
||||
'm' => $this->menuid,
|
||||
'todo' => $this->todo,
|
||||
'page' => $this->page,
|
||||
'pagesize' => $this->pagesize,
|
||||
|
||||
'atcl_no' => $this->atcl_no,
|
||||
'stat_cd' => $this->stat_cd,
|
||||
'chk_atcl_no' => $this->chk_atcl_no,
|
||||
'realtor_nm' => $this->realtor_nm,
|
||||
'recv_stime' => $this->recv_stime,
|
||||
'recv_etime' => $this->recv_etime,
|
||||
'complete_stime' => $this->complete_stime,
|
||||
'complete_etime' => $this->complete_etime,
|
||||
'sido' => $this->sido,
|
||||
'gugun' => $this->gugun,
|
||||
'dong' => $this->dong,
|
||||
'target_yn' => $this->target_yn,
|
||||
'cpid' => $this->cpid,
|
||||
'caller_no' => $this->caller_no,
|
||||
'charger' => $this->charger,
|
||||
'charger_gbn' => $this->charger_gbn,
|
||||
'dept1_sq' => $this->dept1_sq,
|
||||
'dept2_sq' => $this->dept2_sq,
|
||||
'assign_yn' => $this->assign_yn,
|
||||
'checking' => $this->checking,
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 홍보확인서 팩스 목록
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
// CI3 __construct 대체
|
||||
$this->initParams();
|
||||
|
||||
// CI3: $base_uri = '/listfax/listfax/lists';
|
||||
$base_uri = '/listfax/listfax/lists';
|
||||
|
||||
// CI3: $this->load->model('v2/listfax_model', 'listfax_model');
|
||||
$listfaxModel = new ListFaxModel();
|
||||
|
||||
// CI3: $this->load->helper('array_helper');
|
||||
helper(filenames: 'array'); // array_helper => array 로 이름 바꿨다면 이렇게
|
||||
|
||||
// CI3: $this->load->library('common');
|
||||
$common = new Common();
|
||||
|
||||
// checking 값에 따라 조회 여부 결정
|
||||
if ($this->pars['checking'] === '0') {
|
||||
$resultData = [
|
||||
'data' => [],
|
||||
'total' => 0,
|
||||
];
|
||||
} else {
|
||||
$resultData = $listfaxModel->getLists(
|
||||
$this->todo,
|
||||
$this->page,
|
||||
$this->pagesize,
|
||||
$this->recv_stime,
|
||||
$this->recv_etime,
|
||||
$this->caller_no
|
||||
);
|
||||
}
|
||||
|
||||
// total 기본값 처리
|
||||
if (!isset($resultData['total'])) {
|
||||
$resultData['total'] = 0;
|
||||
}
|
||||
|
||||
// 페이지네이션 (기존 common 라이브러리 그대로 사용)
|
||||
$pagination = $common->make_pagenation(
|
||||
$base_uri,
|
||||
$this->pars,
|
||||
$resultData['total'],
|
||||
$this->page,
|
||||
$this->pagesize
|
||||
);
|
||||
|
||||
$data = [
|
||||
'pars' => $this->pars,
|
||||
'dataList' => $resultData['data'] ?? [],
|
||||
'total' => $resultData['total'],
|
||||
'pagination' => $pagination,
|
||||
];
|
||||
|
||||
// BaseController에서 메뉴 등 공통 $this->data 세팅했다면 같이 합쳐서 넘겨도 됨
|
||||
// return view('listfax/listfax/lists', array_merge($this->data, $data));
|
||||
return view('listfax/listfax/lists', $data);
|
||||
}
|
||||
|
||||
}
|
||||
137
app/Controllers/manage/Dept.php
Normal file
137
app/Controllers/manage/Dept.php
Normal file
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
namespace App\Controllers\manage;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\manage\DeptModel;
|
||||
|
||||
class Dept extends BaseController
|
||||
{
|
||||
|
||||
private $deptModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->deptModel = new DeptModel();
|
||||
}
|
||||
|
||||
|
||||
public function dept(): string
|
||||
{
|
||||
return view("pages/manage/dept/lists");
|
||||
}
|
||||
|
||||
// 총괄팀장 페이지
|
||||
public function getchkuser(): string
|
||||
{
|
||||
return view("pages/manage/dept/users");
|
||||
}
|
||||
|
||||
public function getDeptList()
|
||||
{
|
||||
$start = (int) $this->request->getGet('start') ?: 0;
|
||||
$end = (int) $this->request->getGet('length') ?: 10;
|
||||
|
||||
$data = [
|
||||
'srchDepth' => $this->request->getGet('srchDepth') ?: '',
|
||||
'srcDeptNm' => $this->request->getGet('srcDeptNm') ?: '',
|
||||
'srcDeptHead' => $this->request->getGet('srcDeptHead') ?: '',
|
||||
'useYn' => $this->request->getGet('useYn') ?: '',
|
||||
];
|
||||
|
||||
$totalCount = $this->deptModel->getTotalCount($data);
|
||||
|
||||
|
||||
$datas = $this->deptModel->getDeptList($start, $end, $data);
|
||||
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'recordsTotal' => $totalCount,
|
||||
'recordsFiltered' => $totalCount,
|
||||
'data' => $datas,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
// 유저목록 조회
|
||||
public function getUserList()
|
||||
{
|
||||
$start = (int) $this->request->getGet('start') ?: 0;
|
||||
$end = (int) $this->request->getGet('length') ?: 10;
|
||||
|
||||
$totalCount = $this->deptModel->getUserCount();
|
||||
|
||||
|
||||
$datas = $this->deptModel->getUserList($start, $end);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'recordsTotal' => $totalCount,
|
||||
'recordsFiltered' => $totalCount,
|
||||
'data' => $datas,
|
||||
]);
|
||||
}
|
||||
|
||||
// 상위조직 조회
|
||||
public function getPdept()
|
||||
{
|
||||
|
||||
$datas = $this->deptModel->getPdept();
|
||||
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
// 조직정보 저장
|
||||
public function saveDept()
|
||||
{
|
||||
try {
|
||||
|
||||
$type = $this->request->getPost('type');
|
||||
|
||||
if ($type == "create") {
|
||||
$data = [
|
||||
$this->request->getPost("addPdept"), // 상위조직
|
||||
$this->request->getPost("addDeptNm"), // 조직명칭
|
||||
$this->request->getPost("addDeptDesc"), // 부서설명
|
||||
$this->request->getPost("addDeptHead"), // 총괄팀장
|
||||
$this->request->getPost(index: "addUseYn"), // 사용여부
|
||||
$this->request->getPost(index: "addDepth"), // 조직구분
|
||||
session('usr_sq'),
|
||||
session('usr_sq'),
|
||||
];
|
||||
|
||||
// INSERT departments
|
||||
$this->deptModel->insertDept($data);
|
||||
|
||||
} else if ($type == "update") {
|
||||
|
||||
$data = [
|
||||
$this->request->getPost("pdept_sq"),
|
||||
$this->request->getPost("addDeptNm"), // 조직명칭
|
||||
$this->request->getPost("addDeptDesc"), // 부서설명
|
||||
$this->request->getPost("addDeptHead"), // 총괄팀장
|
||||
$this->request->getPost("addUseYn"), // 사용여부
|
||||
$this->request->getPost("addDepth"), // 조직구분
|
||||
session('usr_sq'),
|
||||
$this->request->getPost("dept_sq"),
|
||||
];
|
||||
|
||||
// UPDATE departments
|
||||
$this->deptModel->updateDept($data);
|
||||
}
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success'
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
56
app/Controllers/manage/LoginLog.php
Normal file
56
app/Controllers/manage/LoginLog.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
namespace App\Controllers\manage;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\manage\LoginLogModel;
|
||||
|
||||
|
||||
class LoginLog extends BaseController
|
||||
{
|
||||
private $logModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->logModel = new LoginLogModel();
|
||||
}
|
||||
|
||||
public function lists()
|
||||
{
|
||||
return view("pages/manage/log/lists");
|
||||
}
|
||||
|
||||
public function getLogList()
|
||||
{
|
||||
$start = (int) $this->request->getGet('start') ?: 0;
|
||||
$end = (int) $this->request->getGet('length') ?: 10;
|
||||
|
||||
$data = [
|
||||
'srchTxt' => $this->request->getGet('search[value]') ?: '',
|
||||
];
|
||||
|
||||
$totalCount = $this->logModel->getTotalCount($data);
|
||||
|
||||
|
||||
$datas = $this->logModel->getLoginLogList($start, $end, $data);
|
||||
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'recordsTotal' => $totalCount,
|
||||
'recordsFiltered' => $totalCount,
|
||||
'data' => $datas,
|
||||
]);
|
||||
}
|
||||
|
||||
public function excel()
|
||||
{
|
||||
$data = [
|
||||
'srchTxt' => $this->request->getGet('search[value]') ?: '',
|
||||
];
|
||||
|
||||
$datas = $this->logModel->getExcelDownList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $datas,
|
||||
]);
|
||||
}
|
||||
}
|
||||
225
app/Controllers/manage/Menu.php
Normal file
225
app/Controllers/manage/Menu.php
Normal file
@@ -0,0 +1,225 @@
|
||||
<?php
|
||||
namespace App\Controllers\manage;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\manage\MenuModel;
|
||||
|
||||
class Menu extends BaseController
|
||||
{
|
||||
private $menuModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->menuModel = new MenuModel();
|
||||
}
|
||||
|
||||
public function lists(): string
|
||||
{
|
||||
return view("pages/manage/menu/lists");
|
||||
}
|
||||
|
||||
|
||||
// 메뉴목록조회
|
||||
public function getMenuList()
|
||||
{
|
||||
$params = [];
|
||||
|
||||
|
||||
|
||||
$total = $this->menuModel->getTotalCount();
|
||||
$datas = $this->menuModel->getMenuList($params);
|
||||
|
||||
$lft = 1;
|
||||
|
||||
if (!empty($datas)) {
|
||||
foreach ($datas as $k => $v) {
|
||||
|
||||
$menuTp = $v['mnu_tp'];
|
||||
$menuCd = $v['mnu_id'];
|
||||
$menuPid = $v['mnu_pid'];
|
||||
|
||||
// lft
|
||||
$datas[$k]['lft'] = $lft;
|
||||
|
||||
// ROOT vs 나머지 level 계산 (지금처럼 코드 길이 쓰고 싶으면 기존 로직 유지 가능)
|
||||
if ($menuPid === 'ROOT') {
|
||||
$datas[$k]['level'] = "0";
|
||||
$datas[$k]['parentLv'] = "";
|
||||
$datas[$k]['expanded'] = true;
|
||||
} else {
|
||||
// 예: "M" 제거 후 길이 기반
|
||||
$levelStr = str_replace('M', '', $menuCd);
|
||||
$len = strlen($levelStr);
|
||||
if ($len === 1 || $len === 2)
|
||||
$datas[$k]['level'] = "1";
|
||||
else
|
||||
$datas[$k]['level'] = "2"; // 필요시 더 세분화
|
||||
}
|
||||
|
||||
// 아이콘
|
||||
switch ($menuTp) {
|
||||
case "A":
|
||||
$datas[$k]['iconCls'] = "ui-icon-play";
|
||||
break;
|
||||
case "P":
|
||||
$datas[$k]['iconCls'] = "ui-icon-document";
|
||||
break;
|
||||
case "D":
|
||||
$datas[$k]['iconCls'] = "ui-icon-folder-open";
|
||||
break;
|
||||
}
|
||||
|
||||
if ($menuTp === 'A') {
|
||||
// 액션
|
||||
$datas[$k]['isLeaf'] = true;
|
||||
$datas[$k]['rgt'] = $lft + 1;
|
||||
$lft++;
|
||||
|
||||
} elseif ($menuTp === 'P') {
|
||||
// 화면: 내 자식은 mnu_pid == 내 mnu_id
|
||||
$subCnt = 0;
|
||||
foreach ($datas as $v2) {
|
||||
if ($v2['mnu_pid'] === $menuCd) {
|
||||
$subCnt++;
|
||||
}
|
||||
}
|
||||
|
||||
$datas[$k]['rgt'] = $lft + ($subCnt * 2) + 1;
|
||||
|
||||
if ($subCnt === 0) {
|
||||
$datas[$k]['isLeaf'] = true;
|
||||
$lft++;
|
||||
} else {
|
||||
$datas[$k]['isLeaf'] = false;
|
||||
}
|
||||
|
||||
} elseif ($menuTp === 'D') {
|
||||
// 디렉토리: 코드 prefix 로 자식/후손 판단 (자바와 동일)
|
||||
$subCnt = 0;
|
||||
foreach ($datas as $v2) {
|
||||
$subMenuCd = $v2['mnu_id'];
|
||||
if (strpos($subMenuCd, $menuCd) === 0) {
|
||||
$subCnt++;
|
||||
}
|
||||
}
|
||||
|
||||
$datas[$k]['rgt'] = $lft + ($subCnt * 2) + 1;
|
||||
|
||||
if ($subCnt === 0) {
|
||||
$datas[$k]['isLeaf'] = true;
|
||||
$lft++;
|
||||
} else {
|
||||
$datas[$k]['isLeaf'] = false;
|
||||
}
|
||||
|
||||
} elseif ($menuTp === 'R') {
|
||||
// 루트
|
||||
$datas[$k]['isLeaf'] = false;
|
||||
$datas[$k]['rgt'] = 1 + ($total * 2) + 1;
|
||||
}
|
||||
|
||||
$lft++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// $datas = $this->buildTree($datas);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'total' => $total,
|
||||
'rows' => $datas,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// private function buildTree(array $items, $parentId = 'ROOT', int $level = 0): array
|
||||
// {
|
||||
// $branch = [];
|
||||
|
||||
// $lft = 1;
|
||||
// foreach ($items as $k => $item) {
|
||||
|
||||
// // 현재 parentId의 자식인지 확인
|
||||
// if ($item['mnu_pid'] === $parentId) {
|
||||
|
||||
// $item['lft'] = $lft;
|
||||
|
||||
// if ($item['mnu_tp'] === 'R') {
|
||||
// $item['isLeaf'] = false;
|
||||
// $item['rgt'] = 1 + (63 * 2 + 1);
|
||||
// } else if ($item['mnu_tp'] === 'D') {
|
||||
// $item['level'] = 1;
|
||||
// $item['menu_tp'] = 'D';
|
||||
// $item['menu_tp_nm'] = '디렉토리';
|
||||
// $item['iconCls'] = 'ui-icon-folder-open';
|
||||
|
||||
// $subCnt = 0;
|
||||
// foreach ($items as $item2):
|
||||
|
||||
// if (strpos($item2['mnu_id'], $item['mnu_id'] . '.') === 0) {
|
||||
// $subCnt++;
|
||||
// }
|
||||
|
||||
// endforeach;
|
||||
|
||||
// $item['rgt'] = $lft + ($subCnt * 2) + 1;
|
||||
|
||||
// if ($subCnt === 0) {
|
||||
// $item['isLeaf'] = true;
|
||||
// } else {
|
||||
// $item['isLeaf'] = false;
|
||||
// }
|
||||
|
||||
// } else if ($item['mnu_tp'] == 'P') {
|
||||
// $item['level'] = 2;
|
||||
// $item['menu_tp'] = 'R';
|
||||
// $item['menu_tp_nm'] = '화면';
|
||||
// $item['iconCls'] = 'ui-icon-document';
|
||||
// }
|
||||
// // else {
|
||||
// // // 예: 루트 R 같은 경우
|
||||
// // $item['menu_tp'] = $item['mnu_tp'];
|
||||
// // $item['menu_tp_nm'] = ($item['mnu_tp'] === 'R') ? '루트' : '메뉴';
|
||||
// // $item['iconCls'] = 'ui-icon-home';
|
||||
// // }
|
||||
|
||||
// // 자식 찾기 (⚠️ 여기 반드시 $this->buildTree)
|
||||
// // $children = $this->buildTree($items, $item['mnu_id'], $level + 1);
|
||||
|
||||
// // if (!empty($children)) {
|
||||
// // // 자식 정렬 (view_odr → mnu_id 순)
|
||||
// // usort($children, function ($a, $b) {
|
||||
// // $ao = $a['view_odr'] ?? 0;
|
||||
// // $bo = $b['view_odr'] ?? 0;
|
||||
|
||||
// // if ($ao == $bo) {
|
||||
// // return strcmp($a['mnu_id'], $b['mnu_id']);
|
||||
// // }
|
||||
// // return $ao <=> $bo;
|
||||
// // });
|
||||
|
||||
// // $item['children'] = $children;
|
||||
// // }
|
||||
|
||||
// $branch[] = $item;
|
||||
// }
|
||||
|
||||
// $lft++;
|
||||
// }
|
||||
|
||||
// // 현재 레벨도 정렬 (view_odr → mnu_id 순)
|
||||
// usort($branch, function ($a, $b) {
|
||||
// $ao = $a['view_odr'] ?? 0;
|
||||
// $bo = $b['view_odr'] ?? 0;
|
||||
|
||||
// if ($ao == $bo) {
|
||||
// return strcmp($a['mnu_id'], $b['mnu_id']);
|
||||
// }
|
||||
// return $ao <=> $bo;
|
||||
// });
|
||||
|
||||
// return $branch;
|
||||
// }
|
||||
|
||||
}
|
||||
115
app/Controllers/manage/Phone.php
Normal file
115
app/Controllers/manage/Phone.php
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
namespace App\Controllers\manage;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\manage\PhoneModel;
|
||||
|
||||
|
||||
|
||||
class Phone extends BaseController
|
||||
{
|
||||
private $phoneModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->phoneModel = new PhoneModel();
|
||||
}
|
||||
|
||||
public function lists(): string
|
||||
{
|
||||
$codes = $this->phoneModel->getCodes();
|
||||
|
||||
return view("pages/manage/phone/lists", ['code' => $codes]);
|
||||
}
|
||||
|
||||
// 전화확인 목록조회
|
||||
public function getDuplPhoneList()
|
||||
{
|
||||
$start = (int) $this->request->getGet('start') ?: 0;
|
||||
$end = (int) $this->request->getGet('length') ?: 10;
|
||||
|
||||
$data = [
|
||||
'srchTxt' => $this->request->getGet('search[value]') ?: '',
|
||||
];
|
||||
|
||||
$totalCount = $this->phoneModel->getTotalCount($data);
|
||||
$datas = $this->phoneModel->getDuplPhoneList($start, $end, $data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'recordsTotal' => $totalCount,
|
||||
'recordsFiltered' => $totalCount,
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 전화정보 저장
|
||||
public function savePhone()
|
||||
{
|
||||
try {
|
||||
|
||||
if ($this->validPhone($this->request->getPost('phone_number'))) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '1',
|
||||
'msg' => '유효하지 않은 연락처'
|
||||
]);
|
||||
}
|
||||
|
||||
$type = $this->request->getPost('type');
|
||||
$data = [
|
||||
$this->request->getPost('phone_number'), // 연락처
|
||||
$this->request->getPost('use_yn'),
|
||||
$this->request->getPost('s_date'),
|
||||
$this->request->getPost('e_date'),
|
||||
$this->request->getPost('address'),
|
||||
$this->request->getPost('owner'),
|
||||
$this->request->getPost('applicant'),
|
||||
$this->request->getPost('relation'),
|
||||
$this->request->getPost('cpid'),
|
||||
$this->request->getPost(index: 'memo'),
|
||||
session('usr_id'),
|
||||
];
|
||||
|
||||
if ($type === "create") {
|
||||
|
||||
// INSERT dupl_phone_list
|
||||
$this->phoneModel->insertDuplPhone($data);
|
||||
|
||||
} else if ($type === "update") {
|
||||
|
||||
array_push($data, $this->request->getPost("phone_number"));
|
||||
|
||||
// UPDATE dupl_phone_list
|
||||
$this->phoneModel->updateDuplPhone($data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success'
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 연락처 유효성검사
|
||||
private function validPhone($phone)
|
||||
{
|
||||
if (preg_match('/^01[0-9]-?\d{3,4}-?\d{4}$/', $phone)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
183
app/Controllers/manage/User.php
Normal file
183
app/Controllers/manage/User.php
Normal file
@@ -0,0 +1,183 @@
|
||||
<?php
|
||||
namespace App\Controllers\manage;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\manage\UserModel;
|
||||
|
||||
class User extends BaseController
|
||||
{
|
||||
private $userModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->userModel = new UserModel();
|
||||
}
|
||||
|
||||
public function user(): string
|
||||
{
|
||||
|
||||
$userLevel = $this->userModel->getUserLevel();
|
||||
$bonbuList = $this->userModel->getBonbuList();
|
||||
$teamList = $this->userModel->getTeamList();
|
||||
$deptCode = $this->userModel->getDeptCode();
|
||||
|
||||
return view("pages/manage/user/lists", [
|
||||
'userLevel' => $userLevel,
|
||||
'bonbuList' => $bonbuList,
|
||||
'teamList' => $teamList,
|
||||
'deptCode' => $deptCode,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function getUserList()
|
||||
{
|
||||
|
||||
$start = (int) $this->request->getGet('start') ?: 0;
|
||||
$end = (int) $this->request->getGet('length') ?: 10;
|
||||
|
||||
$data = [
|
||||
'srchLevel' => $this->request->getGet('srchLevel') ?: '',
|
||||
'srchBonbu' => $this->request->getGet('srchBonbu') ?: '',
|
||||
'srchTeam' => $this->request->getGet('srchTeam') ?: '',
|
||||
'useYn' => $this->request->getGet('useYn') ?: '',
|
||||
'srchType' => $this->request->getGet('srchType') ?: '',
|
||||
'srchTxt' => $this->request->getGet('srchTxt') ?: '',
|
||||
];
|
||||
|
||||
$totalCount = $this->userModel->getTotalCount($data);
|
||||
|
||||
|
||||
$datas = $this->userModel->getUserList($start, $end, $data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'recordsTotal' => $totalCount,
|
||||
'recordsFiltered' => $totalCount,
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 유저정보저장
|
||||
public function saveUser()
|
||||
{
|
||||
try {
|
||||
|
||||
$type = $this->request->getPost('type');
|
||||
|
||||
|
||||
|
||||
if ($type == 'create') {
|
||||
|
||||
$data = [
|
||||
$this->request->getPost('addUserId'), // 아이디
|
||||
$this->request->getPost('addUserPswd') ?: '', // 비밀번호
|
||||
$this->request->getPost('addUserDept'), // 소속조직
|
||||
$this->request->getPost('addUserNm'), // 이름
|
||||
$this->request->getPost('addUserLevel'), // 등급
|
||||
$this->request->getPost('addUserPosition'), // 직급
|
||||
$this->request->getPost('addUserTel1') ?: '', // 연락처
|
||||
$this->request->getPost('addUserTel2') ?: '', // 연락처2
|
||||
$this->request->getPost('addUserAddr1'), // 주소
|
||||
$this->request->getPost('addUserAddr2'), // 상세주소
|
||||
session('usr_sq'), // 저장유저
|
||||
$this->request->getPost('addUseYn'), // 사용여부
|
||||
$this->request->getPost('addSmsYn'), // SMS 인증여부
|
||||
|
||||
];
|
||||
|
||||
// INSERT users
|
||||
$this->userModel->insertUser($data);
|
||||
|
||||
|
||||
} else if ($type == 'update') {
|
||||
|
||||
$addUserPswd = trim($this->request->getPost('addUserPswd') ?? '');
|
||||
$usrSq = $this->request->getPost('usr_sq'); // hidden으로 넘어오는 PK라고 가정
|
||||
|
||||
$data = [
|
||||
$this->request->getPost('addUserNm'), // usr_nm
|
||||
$this->request->getPost('addUserDept'), // dept_sq
|
||||
$this->request->getPost('addUserLevel'), // usr_level
|
||||
$this->request->getPost('addUserPosition'), // usr_position
|
||||
$this->request->getPost('addUserTel1') ?: '', // usr_tel1
|
||||
$this->request->getPost('addUserTel2') ?: '', // usr_tel2
|
||||
$this->request->getPost('addUserAddr1'), // usr_addr1
|
||||
$this->request->getPost('addUserAddr2'), // usr_addr2
|
||||
session('usr_sq'), // update_usr
|
||||
$this->request->getPost('addUseYn'), // use_yn
|
||||
$this->request->getPost('addSmsYn'), // sms_auth_yn
|
||||
];
|
||||
|
||||
// 비번/PK 같이 넘김
|
||||
$this->userModel->updateUser($data, $addUserPswd, $usrSq);
|
||||
|
||||
}
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success'
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// 유저 삭제
|
||||
public function removeuser()
|
||||
{
|
||||
try {
|
||||
|
||||
$data = [
|
||||
session('usr_sq'),
|
||||
$this->request->getPost('usr_sq')
|
||||
];
|
||||
|
||||
|
||||
$this->userModel->removeUser($data);
|
||||
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success'
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// 엑셀다운로드
|
||||
public function excel()
|
||||
{
|
||||
try {
|
||||
|
||||
$data = [
|
||||
'srchLevel' => $this->request->getGet('srchLevl') ?: '',
|
||||
'srchBonbu' => $this->request->getGet('srchBonbu') ?: '',
|
||||
'srchTeam' => $this->request->getGet('srchTeam') ?: '',
|
||||
'useYn' => $this->request->getGet('useYn') ?: '',
|
||||
'srchType' => $this->request->getGet('srchType') ?: '',
|
||||
'srchTxt' => $this->request->getGet('srchTxt') ?: '',
|
||||
'addSmsYn' => $this->request->getPost('addSmsYn'),
|
||||
];
|
||||
|
||||
$datas = $this->userModel->getExcelUserList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$e->getPrevious()->getTraceAsString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,11 +12,11 @@ class AuthCheck implements FilterInterface
|
||||
{
|
||||
$session = session();
|
||||
log_message('debug', 'URI PATH: ' . service('uri')->getPath());
|
||||
|
||||
|
||||
// 로그인 체크
|
||||
if (!$session->get('logged_in')) {
|
||||
// 로그인 안 되어 있으면 로그인 페이지로
|
||||
// return redirect()->to('/login');
|
||||
return redirect()->to('/login');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
71
app/Helpers/array_helper.php
Normal file
71
app/Helpers/array_helper.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* Confirms
|
||||
*
|
||||
* 네이버 현장확인매물 관리 시스템 php 5.3
|
||||
*
|
||||
* @package admin.confirms.co.kr
|
||||
* @author OWRAinfo.inc Dev Team
|
||||
* @copyright Copyright (c) 2012 - 2013, OWRAinfo, Inc.
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* 배열을 HashTable 형태의 배열로 변환 한다.
|
||||
*/
|
||||
if (!function_exists('convertArrayToHashTable')) {
|
||||
function convertArrayToHashTable($array, $key, $value, $firstArray = array(), $lastArray = array())
|
||||
{
|
||||
|
||||
$returnArray = array();
|
||||
|
||||
if (!empty($firstArray) && is_array($firstArray)) {
|
||||
|
||||
foreach ($firstArray as $row) {
|
||||
$k = @$row[$key];
|
||||
if (empty($k))
|
||||
$k = '';
|
||||
|
||||
$v = @$row[$value];
|
||||
if (empty($v))
|
||||
$v = '';
|
||||
|
||||
$returnArray[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($array) && is_array($array)) {
|
||||
foreach ($array as $row) {
|
||||
$k = @$row[$key];
|
||||
if (empty($k))
|
||||
$k = '';
|
||||
|
||||
$v = @$row[$value];
|
||||
if (empty($v))
|
||||
$v = '';
|
||||
|
||||
$returnArray[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($lastArray) && is_array($lastArray)) {
|
||||
foreach ($lastArray as $row) {
|
||||
$k = $row[$key];
|
||||
if (empty($k))
|
||||
$k = '';
|
||||
|
||||
$v = $row[$value];
|
||||
if (empty($v))
|
||||
$v = '';
|
||||
|
||||
$returnArray[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
return $returnArray;
|
||||
}
|
||||
|
||||
}
|
||||
41
app/Helpers/string_helper.php
Normal file
41
app/Helpers/string_helper.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
if (!function_exists('sqlstr_quotes')) {
|
||||
function sqlstr_quotes($str)
|
||||
{
|
||||
return str_replace("'", "''", $str);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('phone_format')) {
|
||||
function phone_format($str)
|
||||
{
|
||||
|
||||
$phone = $str;
|
||||
if (substr($phone, 0, 2) == '02') {
|
||||
switch (strlen(($phone))) {
|
||||
case 9:
|
||||
$phone = substr($phone, 0, 2) . '-' . substr($phone, 2, 3) . '-' . substr($phone, 5, 4);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
$phone = substr($phone, 0, 2) . '-' . substr($phone, 2, 4) . '-' . substr($phone, 6, 4);
|
||||
break;
|
||||
|
||||
}
|
||||
} else {
|
||||
switch (strlen(($phone))) {
|
||||
case 10:
|
||||
$phone = substr($phone, 0, 3) . '-' . substr($phone, 3, 3) . '-' . substr($phone, 6, 4);
|
||||
break;
|
||||
case 11:
|
||||
$phone = substr($phone, 0, 3) . '-' . substr($phone, 3, 4) . '-' . substr($phone, 7, 4);
|
||||
break;
|
||||
case 12:
|
||||
$phone = substr($phone, 0, 4) . '-' . substr($phone, 4, 4) . '-' . substr($phone, 8, 4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $phone;
|
||||
}
|
||||
}
|
||||
43
app/Helpers/url_helper.php
Normal file
43
app/Helpers/url_helper.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
// CI4에서는 BASEPATH 체크 삭제
|
||||
|
||||
function make_query_string($array)
|
||||
{
|
||||
if (!isset($array) || !is_array($array))
|
||||
return '';
|
||||
|
||||
$qs = '';
|
||||
foreach ($array as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $value2) {
|
||||
if (empty($qs)) {
|
||||
$qs .= '?';
|
||||
} else {
|
||||
$qs .= '&';
|
||||
}
|
||||
$qs .= $key . '=' . urlencode($value2);
|
||||
}
|
||||
} else {
|
||||
if (empty($qs)) {
|
||||
$qs .= '?';
|
||||
} else {
|
||||
$qs .= '&';
|
||||
}
|
||||
$qs .= $key . '=' . urlencode($value);
|
||||
}
|
||||
}
|
||||
return $qs;
|
||||
}
|
||||
|
||||
// ... 기존 다른 함수들도 그대로 넣어도 됨
|
||||
|
||||
function siteURL()
|
||||
{
|
||||
$protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443)
|
||||
? "https://"
|
||||
: "http://";
|
||||
|
||||
$domainName = $_SERVER['HTTP_HOST'] . '/';
|
||||
return $protocol . $domainName;
|
||||
}
|
||||
36
app/Libraries/Common.php
Normal file
36
app/Libraries/Common.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace App\Libraries;
|
||||
|
||||
class Common
|
||||
{
|
||||
|
||||
public function make_pagenation($base_uri, $parameters, $total_rows = 0, $cur_page = 1, $per_page = 10, $num_links = 10)
|
||||
{
|
||||
if (!is_numeric($cur_page) || empty($cur_page))
|
||||
$cur_page = 1;
|
||||
if (!is_numeric($per_page) || empty($per_page))
|
||||
$per_page = 10;
|
||||
|
||||
$parameters['page'] = '[page]'; // 필수 --> 이게 모든 페이지의 파라메터를 동적으로 할당하는 것이다.
|
||||
$base_uri .= make_query_string($parameters);
|
||||
|
||||
|
||||
if (empty($num_links))
|
||||
$num_links = 10;
|
||||
|
||||
$config['base_url'] = $base_uri;
|
||||
$config['total_rows'] = $total_rows;
|
||||
$config['cur_page'] = $cur_page;
|
||||
$config['per_page'] = $per_page;
|
||||
$config['num_links'] = $num_links; // 페이지의 갯수가 일정하게 보이도록....
|
||||
$config['full_tag_open'] = '<div class="pagination">';
|
||||
$config['full_tag_close'] = '</div>';
|
||||
|
||||
$CI =& get_instance();
|
||||
$CI->load->library('pagination');
|
||||
$CI->pagination->initialize($config);
|
||||
$pagination = $CI->pagination->create_links();
|
||||
return $pagination;
|
||||
}
|
||||
|
||||
}
|
||||
151
app/Models/Home/HomeModel.php
Normal file
151
app/Models/Home/HomeModel.php
Normal file
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Home;
|
||||
|
||||
use App\Models\common\CodeModel;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class HomeModel extends Model
|
||||
{
|
||||
|
||||
public function getHomeStatistics($sdate, $edate)
|
||||
{
|
||||
$status = $status2 = $status3 = $reserve = $assign = $personal = [];
|
||||
$usr_sq = session('usr_sq');
|
||||
$usr_level = session('usr_level');
|
||||
|
||||
if (in_array($usr_level, ['1', '2', '3'], true)) {
|
||||
|
||||
$codeModel = new CodeModel();
|
||||
$codes = $codeModel->getCodeList('RECEIPT_STATUS1');
|
||||
helper('string');
|
||||
|
||||
$columns = '';
|
||||
foreach ($codes as $row) {
|
||||
$cd = sqlstr_quotes($row['cd']);
|
||||
$cdnm = sqlstr_quotes($row['cd_nm']);
|
||||
|
||||
$columns .= ", SUM(CASE WHEN SUBSTR(b.rcpt_stat, 1, 2) = '" . $cd . "' THEN 1 ELSE 0 END) \"" . $cdnm . "\"";
|
||||
}
|
||||
$columns = substr($columns, 1);
|
||||
|
||||
// 상태별 개수
|
||||
$sql = "SELECT " . $columns .
|
||||
" FROM receipt b" .
|
||||
" where b.rcpt_tm BETWEEN ? AND ? ";
|
||||
|
||||
$sdate .= ' 00:00:00';
|
||||
$edate .= ' 23:59:59';
|
||||
|
||||
$data = [$sdate, $edate];
|
||||
$query = $this->db->query($sql, $data);
|
||||
$status = $query->getResultArray();
|
||||
|
||||
// 녹취필요 5개
|
||||
$sql = "SELECT b.rcpt_key, b.rcpt_tm, a.photo_save_dt, IFNULL(DATEDIFF(NOW(), a.photo_save_dt),0) elapsed_dt" .
|
||||
" FROM result a" .
|
||||
" INNER JOIN receipt b ON b.rcpt_sq = a.rcpt_sq and b.rcpt_tm between ? and ?" .
|
||||
" WHERE a.req_rec_yn = 'Y'" .
|
||||
" AND a.rec_yn != 'Y'" .
|
||||
" AND a.result_cd1 != '90'" .
|
||||
" ORDER BY 3" .
|
||||
" LIMIT 5";
|
||||
$data = [$sdate, $edate];
|
||||
$query = $this->db->query($sql, $data);
|
||||
$status2 = $query->getResultArray();
|
||||
|
||||
// 동의서없음 5개
|
||||
$sql = "SELECT b.rcpt_key, b.rcpt_tm, a.photo_save_dt, IFNULL(DATEDIFF(NOW(), a.photo_save_dt),0) elapsed_dt" .
|
||||
" FROM result a" .
|
||||
" INNER JOIN receipt b ON b.rcpt_sq = a.rcpt_sq AND b.rcpt_stat = '701000' and b.rcpt_tm between ? and ?" .
|
||||
" AND a.result_cd1 != '90'" .
|
||||
" ORDER BY 3" .
|
||||
" LIMIT 5";
|
||||
$data = array($sdate, $edate);
|
||||
$query = $this->db->query($sql, $data);
|
||||
$status3 = $query->getResultArray();
|
||||
}
|
||||
|
||||
|
||||
if (in_array($usr_level, ['1', '2', '3'], true)) { // 시스템관리자, 관리자, 상담원
|
||||
$sql = "SELECT a.rcpt_key, a.rcpt_tm, IFNULL(b.rsrv_date, a.rsrv_date) rsrv_date, c.cd_nm rsrv_tm_ap" .
|
||||
" FROM receipt a" .
|
||||
" LEFT JOIN result b ON b.rcpt_sq = a.rcpt_sq AND b.use_yn = 'Y'" .
|
||||
" LEFT JOIN codes c ON c.category = 'RESERVED_APM' AND c.cd = IFNULL(b.rsrv_tm_ap, a.rsrv_tm_ap)" .
|
||||
" WHERE a.rcpt_stat <= '20'" .
|
||||
" and a.rcpt_tm between ? and ?" .
|
||||
" LIMIT 5";
|
||||
$data = array($sdate, $edate);
|
||||
$query = $this->db->query($sql, $data);
|
||||
$reserve = $query->getResultArray();
|
||||
|
||||
}
|
||||
|
||||
if (in_array($usr_level, ['4'], true)) { // 현장조사원
|
||||
$sql = "SELECT b.rcpt_key, b.rcpt_tm, IFNULL(a.rsrv_date, b.rsrv_date) rsrv_date, c.cd_nm rsrv_tm_ap" .
|
||||
" FROM result a" .
|
||||
" INNER JOIN receipt b ON b.rcpt_sq = a.rcpt_sq AND b.rcpt_stat = '30' AND b.rcpt_tm between ? and ?" .
|
||||
" INNER JOIN codes c ON c.category = 'RESERVED_APM' AND c.cd = IFNULL(a.rsrv_tm_ap, b.rsrv_tm_ap)" .
|
||||
" WHERE a.usr_sq = ?" .
|
||||
" AND a.use_yn = 'Y'" .
|
||||
" LIMIT 5";
|
||||
$data = array($sdate, $edate, $usr_sq);
|
||||
$query = $this->db->query($sql, $data);
|
||||
$assign = $query->getResultArray();
|
||||
|
||||
|
||||
|
||||
$sql = "SELECT COUNT(*) assign_count" .
|
||||
", IFNULL(SUM(CASE WHEN b.rcpt_stat IN ('39', '49') THEN 1 ELSE 0 END),0) cancel_count" .
|
||||
", IFNULL(SUM(CASE b.rcpt_stat WHEN '50' THEN 1 ELSE 0 END),0) complete_count" .
|
||||
" FROM result a" .
|
||||
" INNER JOIN receipt b ON b.rcpt_sq = a.rcpt_sq AND b.rcpt_tm between ? and ?" .
|
||||
" WHERE a.usr_sq = ?" .
|
||||
" AND a.assign_save_dt BETWEEN DATE_FORMAT(NOW(),'%Y-%m-01') AND DATE_FORMAT(NOW(),'%Y-%m-%d')" .
|
||||
" AND a.use_yn = 'Y'";
|
||||
|
||||
|
||||
$sql = "SELECT " .
|
||||
" SUM( case when a.result_cd2 = '2000' then 1 ELSE null END ) as assign_count" .
|
||||
", SUM( case when a.result_cd2 = '9030' then 1 ELSE null END ) as cancel_count" .
|
||||
", SUM( case when a.result_cd2 = '6000' then 1 ELSE null END ) as complete_count" .
|
||||
" FROM result a" .
|
||||
" INNER JOIN receipt b ON b.rcpt_sq = a.rcpt_sq AND b.rcpt_tm between ? and ?" .
|
||||
" WHERE a.usr_sq = ?" .
|
||||
" AND a.rsrv_date BETWEEN DATE_FORMAT(NOW(),'%Y-%m-01') AND DATE_FORMAT(NOW(),'%Y-%m-%d')" .
|
||||
" AND a.use_yn = 'Y'";
|
||||
$data = array($sdate, $edate, $usr_sq);
|
||||
$query = $this->db->query($sql, $data);
|
||||
$personal = $query->getRowArray();
|
||||
|
||||
}
|
||||
|
||||
return ['status' => $status, 'status2' => $status2, 'status3' => $status3, 'reserve' => $reserve, 'assign' => $assign, 'personal' => $personal];
|
||||
|
||||
}
|
||||
|
||||
// 메인 공지사항 조회
|
||||
public function getNoticeList()
|
||||
{
|
||||
$sql = "SELECT a.bbs_sq, a.subject, a.depth, a.hit, a.update_usr, a.update_nm, DATE_FORMAT(a.update_tm, '%Y-%m-%d') AS update_tm
|
||||
FROM bbs_main_notice AS a
|
||||
WHERE
|
||||
a.use_yn = 'Y'
|
||||
ORDER BY bbs_sq DESC
|
||||
LIMIT 5";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
$rows = $query->getResultArray();
|
||||
$total = $query->getNumRows();
|
||||
|
||||
/*
|
||||
$data = [
|
||||
'noticeList' => $rows,
|
||||
'total' => $total,
|
||||
];
|
||||
*/
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
}
|
||||
276
app/Models/board/NoticeModel.php
Normal file
276
app/Models/board/NoticeModel.php
Normal file
@@ -0,0 +1,276 @@
|
||||
<?php
|
||||
namespace App\Models\board;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
class NoticeModel extends Model
|
||||
{
|
||||
|
||||
public function getTotalCount($data)
|
||||
{
|
||||
$sql = "SELECT COUNT(*) AS cnt FROM bbs_main_notice WHERE use_yn = 'Y'";
|
||||
|
||||
$params = [];
|
||||
if (!empty($data['srchTxt'])) {
|
||||
|
||||
$keyword = '%' . $data['srchTxt'] . '%';
|
||||
|
||||
switch ($data['srchType']) {
|
||||
case '1': // 제목
|
||||
$sql .= " AND a.subject LIKE ? ";
|
||||
$params[] = $keyword;
|
||||
break;
|
||||
|
||||
case '2': // 작성자
|
||||
$sql .= " AND a.insert_nm LIKE ? ";
|
||||
$params[] = $keyword;
|
||||
break;
|
||||
|
||||
default: // 제목 + 작성자
|
||||
$sql .= " AND ( a.subject LIKE ? OR a.insert_nm LIKE ? ) ";
|
||||
$params[] = $keyword;
|
||||
$params[] = $keyword;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$query = $this->db->query($sql, $params ?: []);
|
||||
|
||||
return $query->getRow()->cnt;
|
||||
}
|
||||
|
||||
public function getNoticeList($start, $end, $data)
|
||||
{
|
||||
|
||||
|
||||
$sql = "SELECT
|
||||
SQL_CALC_FOUND_ROWS
|
||||
a.bbs_sq, a.`subject`, a.depth, a.hit, a.update_usr, a.insert_nm, a.insert_tm, a.update_nm, a.update_tm
|
||||
FROM bbs_main_notice AS a
|
||||
WHERE
|
||||
a.use_yn = 'Y' ";
|
||||
|
||||
if (!empty($data['srchTxt'])) {
|
||||
|
||||
$keyword = '%' . $data['srchTxt'] . '%';
|
||||
|
||||
switch ($data['srchType']) {
|
||||
case '1': // 제목
|
||||
$sql .= " AND a.subject LIKE ? ";
|
||||
$params[] = $keyword;
|
||||
break;
|
||||
|
||||
case '2': // 작성자
|
||||
$sql .= " AND a.insert_nm LIKE ? ";
|
||||
$params[] = $keyword;
|
||||
break;
|
||||
|
||||
default: // 제목 + 작성자
|
||||
$sql .= " AND ( a.subject LIKE ? OR a.insert_nm LIKE ? ) ";
|
||||
$params[] = $keyword;
|
||||
$params[] = $keyword;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$sql .= " ORDER BY a.rgt DESC
|
||||
LIMIT ?, ? ";
|
||||
|
||||
$params[] = (int) $start; // offset
|
||||
$params[] = (int) $end; // limit
|
||||
|
||||
$query = $this->db->query($sql, $params);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
public function getNoticeData($id)
|
||||
{
|
||||
|
||||
$sql = "UPDATE bbs_main_notice SET hit = hit +1 WHERE bbs_sq = ? AND use_yn = 'Y'";
|
||||
$res = $this->db->query($sql, [$id]);
|
||||
|
||||
$sql = "SELECT
|
||||
SQL_CALC_FOUND_ROWS
|
||||
a.bbs_sq, a.`subject`, a.content, a.depth, a.hit, a.update_usr, a.insert_nm, a.insert_tm, a.update_nm, a.update_tm
|
||||
FROM bbs_main_notice AS a
|
||||
WHERE
|
||||
a.use_yn = 'Y'
|
||||
AND a.bbs_sq = ?
|
||||
";
|
||||
|
||||
$query = $this->db->query($sql, [$id]);
|
||||
$notice = $query->getRowArray();
|
||||
|
||||
$sql = "SELECT bbs_sq, file_sq, file_name, file_path, file_ext, file_size, img_yn, img_height, img_width, orig_name FROM bbs_file_notice WHERE bbs_sq = ?" .
|
||||
" and use_yn = 'Y'";
|
||||
$query = $this->db->query($sql, [$id]);
|
||||
$files = $query->getRowArray();
|
||||
|
||||
$sql = "SELECT reply_sq, lft, rgt, content, update_nm, update_tm FROM bbs_reply_notice WHERE bbs_sq = ?" .
|
||||
" AND use_yn = 'Y' ORDER BY rgt DESC";
|
||||
$query = $this->db->query($sql, [$id]);
|
||||
$replys = $query->getResultArray();
|
||||
|
||||
return [
|
||||
'notice' => $notice,
|
||||
'files' => $files,
|
||||
'reply' => $replys,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function getFile($fileSq)
|
||||
{
|
||||
$sql = "SELECT file_sq, bbs_sq, file_path, file_name, orig_name FROM bbs_file_notice WHERE file_sq = ?";
|
||||
|
||||
$query = $this->db->query($sql, [$fileSq]);
|
||||
|
||||
return $query->getRowArray();
|
||||
}
|
||||
|
||||
public function write($data)
|
||||
{
|
||||
$this->db->transStart();
|
||||
|
||||
$sql = "SELECT lft+1 num FROM bbs_main_notice ORDER BY bbs_sq DESC LIMIT 1";
|
||||
$query = $this->db->query($sql);
|
||||
$row = $query->getRowArray();
|
||||
$num = $row['num'];
|
||||
|
||||
$sql = "INSERT INTO bbs_main_notice"
|
||||
. "(bbs_psq, lft, rgt, use_yn, hit, subject, content, insert_usr, insert_nm, insert_tm, depth)"
|
||||
. "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, NOW(), ?)";
|
||||
|
||||
$query = $this->db->query($sql, [0, $num, ($num + 1), 'Y', 0, $data['subject'], $data['content'], $data['insert_usr'], $data['insert_nm'], 0]);
|
||||
|
||||
// 방금 insert된 PK
|
||||
$bbs_sq = $this->db->insertID();
|
||||
|
||||
// 2) 첨부파일 정보가 있으면 파일 테이블 INSERT
|
||||
if (!empty($data['file'])) {
|
||||
|
||||
$f = $data['file'];
|
||||
|
||||
$sql = "INSERT INTO bbs_file_notice
|
||||
(bbs_sq, file_name, file_path, file_ext, file_size, img_yn, img_height, img_width, orig_name)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
||||
|
||||
$this->db->query($sql, [
|
||||
$bbs_sq,
|
||||
$f['new_name'] ?? '',
|
||||
$f['file_path'] ?? '',
|
||||
$f['ext'] ?? '',
|
||||
$f['size'] ?? 0,
|
||||
$f['img_yn'] ?? 'N',
|
||||
$f['img_height'] ?? null,
|
||||
$f['img_width'] ?? null,
|
||||
$f['orig_name'] ?? '',
|
||||
]);
|
||||
}
|
||||
|
||||
// 트랜잭션 끝
|
||||
$this->db->transComplete();
|
||||
|
||||
if ($this->db->transStatus() === false) {
|
||||
return [
|
||||
'success' => false,
|
||||
'msg' => '저장실패',
|
||||
];
|
||||
}
|
||||
|
||||
// 성공
|
||||
return [
|
||||
'success' => true,
|
||||
'bbs_sq' => $bbs_sq,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function modify($data)
|
||||
{
|
||||
|
||||
$sql = "UPDATE bbs_main_notice SET
|
||||
`subject` = ?, content = ?, update_usr = ?, update_nm = ?, update_tm = NOW()
|
||||
WHERE bbs_sq = ?";
|
||||
|
||||
$this->db->query($sql, [$data['subject'], $data['content'], $data['update_usr'], $data['update_nm'], $data['bbs_sq']]);
|
||||
|
||||
if (!empty($data['file'])) {
|
||||
|
||||
$f = $data['file'];
|
||||
|
||||
if (empty($f['file_sq'])) {
|
||||
$sql = "INSERT INTO bbs_file_notice
|
||||
(bbs_sq, file_name, file_path, file_ext, file_size, img_yn, img_height, img_width, orig_name)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
||||
|
||||
$this->db->query($sql, [
|
||||
$data['bbs_sq'],
|
||||
$f['new_name'] ?? '',
|
||||
$f['file_path'] ?? '',
|
||||
$f['ext'] ?? '',
|
||||
$f['size'] ?? 0,
|
||||
$f['img_yn'] ?? 'N',
|
||||
$f['img_height'] ?? null,
|
||||
$f['img_width'] ?? null,
|
||||
$f['orig_name'] ?? '',
|
||||
]);
|
||||
} else {
|
||||
$sql = "UPDATE bbs_file_notice SET
|
||||
file_name = ?, file_path = ?, file_ext = ?, file_size = ?, img_yn = ?, img_height = ?, img_width = ?, orig_name = ?
|
||||
WHERE file_sq = ?
|
||||
";
|
||||
|
||||
$this->db->query($sql, [
|
||||
$f['new_name'] ?? '',
|
||||
$f['file_path'] ?? '',
|
||||
$f['ext'] ?? '',
|
||||
$f['size'] ?? 0,
|
||||
$f['img_yn'] ?? 'N',
|
||||
$f['img_height'] ?? null,
|
||||
$f['img_width'] ?? null,
|
||||
$f['orig_name'] ?? '',
|
||||
$f['file_sq'],
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($this->db->transStatus() === false) {
|
||||
return [
|
||||
'success' => false,
|
||||
'msg' => '저장실패',
|
||||
];
|
||||
}
|
||||
|
||||
// 성공
|
||||
return [
|
||||
'success' => true,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function remove($data)
|
||||
{
|
||||
$sql = "UPDATE bbs_main_notice SET
|
||||
use_yn = 'N', update_usr = ?, update_nm = ?, update_tm = NOW()
|
||||
WHERE bbs_sq = ?";
|
||||
|
||||
$this->db->query($sql, [$data['update_usr'], $data['update_nm'], $data['bbs_sq']]);
|
||||
|
||||
if ($this->db->transStatus() === false) {
|
||||
return [
|
||||
'success' => false,
|
||||
'msg' => '저장실패',
|
||||
];
|
||||
}
|
||||
|
||||
// 성공
|
||||
return [
|
||||
'success' => true,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
22
app/Models/common/CodeModel.php
Normal file
22
app/Models/common/CodeModel.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace App\Models\common;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class CodeModel extends Model
|
||||
{
|
||||
/**
|
||||
* 코드목록 읽어오기(Y만)
|
||||
*/
|
||||
public function getCodeList($category)
|
||||
{
|
||||
$sql = "SELECT category, category_nm, cd, cd_nm FROM codes" .
|
||||
" WHERE category = ?" .
|
||||
" AND use_yn = 'Y'" .
|
||||
" ORDER BY view_odr";
|
||||
$data = array($category);
|
||||
$query = $this->db->query($sql, $data);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
}
|
||||
51
app/Models/common/LoginModel.php
Normal file
51
app/Models/common/LoginModel.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
namespace App\Models\common;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class LoginModel extends Model
|
||||
{
|
||||
|
||||
// 로그인 유저 체크
|
||||
public function getUserByIdPw($userId, $userPw)
|
||||
{
|
||||
$sql = "SELECT a.usr_sq, a.usr_id, a.usr_nm, a.usr_pw, b.dept_sq, b.dept_nm, SHA2(?,256) chk_pw, a.usr_level, b.depth, c.dept_sq bonbu_sq, c.dept_nm bonbu_nm, a.usr_tel1, a.usr_tel2" .
|
||||
" , CASE WHEN HOUR(TIMEDIFF(NOW(), a.last_login_tm)) < 4 THEN 'X' ELSE a.sms_auth_yn END sms_auth_yn" . //인증후 4시간 이내면 X
|
||||
" FROM users a" .
|
||||
" INNER JOIN departments b ON b.dept_sq = a.dept_sq AND b.use_yn = 'Y'" .
|
||||
" LEFT JOIN departments c ON c.lft <= b.lft AND c.rgt >= b.rgt AND c.depth = 1 AND c.use_yn = 'Y'" .
|
||||
" WHERE a.usr_id = ? ";
|
||||
|
||||
$data = array(
|
||||
$userPw,
|
||||
$userId
|
||||
);
|
||||
|
||||
$query = $this->db->query($sql, $data);
|
||||
$row = $query->getRowArray();
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
public function insertUserLog($data)
|
||||
{
|
||||
$sql = "INSERT INTO user_login_log
|
||||
( success , usr_sq , usr_id_in , ip , useragent, regdate, reason )
|
||||
VALUES
|
||||
(?, ?, ?, ?, ?, NOW(), ?)
|
||||
";
|
||||
|
||||
$params = [
|
||||
$data['results'],
|
||||
$data['usr_sq'],
|
||||
$data['usr_id'],
|
||||
$data['userIp'],
|
||||
$data['userAgent'],
|
||||
$data['reason'],
|
||||
];
|
||||
|
||||
$this->db->query($sql, $params);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
40
app/Models/common/MenuModel.php
Normal file
40
app/Models/common/MenuModel.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
namespace App\Models\common;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
class MenuModel extends Model
|
||||
{
|
||||
// 메뉴목록조회
|
||||
public function getMenuList()
|
||||
{
|
||||
$sql = "SELECT a.mnu_id, a.mnu_pid, a.mnu_nm, a.mnu_url
|
||||
FROM menu AS a
|
||||
JOIN menu_perms AS b ON b.mnu_id = a.mnu_id
|
||||
WHERE a.use_yn = 'Y'
|
||||
AND b.mgrp_sq = ?
|
||||
AND a.mnu_pid = '0'
|
||||
ORDER BY a.view_odr ASC
|
||||
";
|
||||
|
||||
$query = $this->db->query($sql, binds: [1]);
|
||||
$mainMenuList = $query->getResultArray();
|
||||
|
||||
$sql = "SELECT a.mnu_id, a.mnu_pid, a.mnu_nm, a.mnu_url
|
||||
FROM menu AS a
|
||||
JOIN menu_perms AS b ON b.mnu_id = a.mnu_id
|
||||
WHERE a.use_yn = 'Y'
|
||||
AND b.mgrp_sq = ?
|
||||
ORDER BY a.view_odr ASC
|
||||
";
|
||||
|
||||
$query = $this->db->query($sql, [1]);
|
||||
$subMenuList = $query->getResultArray();
|
||||
|
||||
$data = [
|
||||
'mainMenu' => $mainMenuList,
|
||||
'subMenu' => $subMenuList,
|
||||
];
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
10
app/Models/listfax/ListFaxModel.php
Normal file
10
app/Models/listfax/ListFaxModel.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace App\Models\listfax;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class ListFaxModel extends Model
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
199
app/Models/manage/DeptModel.php
Normal file
199
app/Models/manage/DeptModel.php
Normal file
@@ -0,0 +1,199 @@
|
||||
<?php
|
||||
namespace App\Models\manage;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class DeptModel extends Model
|
||||
{
|
||||
|
||||
public function getTotalCount($data)
|
||||
{
|
||||
$params = [];
|
||||
|
||||
$sql = "SELECT
|
||||
COUNT(*) AS cnt
|
||||
FROM
|
||||
departments AS a
|
||||
WHERE 1=1 ";
|
||||
|
||||
if (!empty($data["srchDepth"])) {
|
||||
$sql .= "AND a.depth = ?";
|
||||
array_push($params, $data["srchDepth"]);
|
||||
}
|
||||
|
||||
if (!empty($data["srcDeptNm"])) {
|
||||
$sql .= "AND a.dept_nm LIKE CONCAT('%', ?, '%')";
|
||||
array_push($params, $data["srcDeptNm"]);
|
||||
}
|
||||
|
||||
if (!empty($data["srcDeptHead"])) {
|
||||
$sql .= "AND a.dept_head IN (select usr_sq from users where usr_nm LIKE CONCAT('%', ?, '%'))";
|
||||
array_push($params, $data["srcDeptHead"]);
|
||||
}
|
||||
|
||||
if (!empty($data["useYn"])) {
|
||||
$sql .= "AND a.use_yn = ?";
|
||||
array_push($params, $data["useYn"]);
|
||||
}
|
||||
|
||||
$query = $this->db->query($sql, $params ?: []);
|
||||
|
||||
return $query->getRow()->cnt;
|
||||
}
|
||||
|
||||
public function getDeptList($start, $end, $data)
|
||||
{
|
||||
$params = [];
|
||||
|
||||
$sql = "SELECT
|
||||
dept_sq
|
||||
, (select dept_nm from departments where dept_sq = a.pdept_sq) as pdept_nm
|
||||
, pdept_sq
|
||||
, dept_nm
|
||||
, dept_desc
|
||||
, (select usr_nm from users where usr_sq = a.dept_head) as dept_head_nm
|
||||
, dept_head
|
||||
, case when a.use_yn = 'Y' then '예' when a.use_yn = 'N' then '아니요' end as use_yn_nm
|
||||
, use_yn
|
||||
, case when a.depth = 0 then '컨펌스' when a.depth = 1 then '본부' when a.depth = 2 then '팀' end as depth_nm
|
||||
, depth
|
||||
, insert_tm
|
||||
, (select usr_nm from users where usr_sq = a.insert_usr) insert_usr
|
||||
, update_tm
|
||||
, (select usr_nm from users where usr_sq = a.update_usr) update_usr
|
||||
, lft
|
||||
, rgt
|
||||
FROM
|
||||
departments AS a
|
||||
WHERE
|
||||
1=1 ";
|
||||
|
||||
if (!empty($data["srchDepth"])) {
|
||||
$sql .= "AND a.depth = ? ";
|
||||
array_push($params, $data["srchDepth"]);
|
||||
}
|
||||
|
||||
if (!empty($data["srcDeptNm"])) {
|
||||
$sql .= "AND a.dept_nm LIKE CONCAT('%', ?, '%') ";
|
||||
array_push($params, $data["srcDeptNm"]);
|
||||
}
|
||||
|
||||
if (!empty($data["srcDeptHead"])) {
|
||||
$sql .= "AND a.dept_head IN (select usr_sq from users where usr_nm LIKE CONCAT('%', ?, '%'))";
|
||||
array_push($params, $data["srcDeptHead"]);
|
||||
}
|
||||
|
||||
if (!empty($data["useYn"])) {
|
||||
$sql .= "AND a.use_yn = ? ";
|
||||
array_push($params, $data["useYn"]);
|
||||
}
|
||||
|
||||
$sql .= "ORDER BY a.insert_tm DESC
|
||||
LIMIT ?, ?
|
||||
";
|
||||
|
||||
|
||||
|
||||
$params[] = (int) $start;
|
||||
$params[] = (int) $end;
|
||||
|
||||
$query = $this->db->query($sql, $params);
|
||||
|
||||
return $query->getResultArray();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getUserCount()
|
||||
{
|
||||
$sql = "SELECT COUNT(*) AS cnt FROM users WHERE use_yn = 'Y' ";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->getRow()->cnt;
|
||||
}
|
||||
|
||||
public function getUserList($start, $end)
|
||||
{
|
||||
$sql = "SELECT usr_sq, usr_id, usr_nm FROM users WHERE use_yn = 'Y' ORDER BY usr_sq DESC LIMIT ?, ?";
|
||||
|
||||
|
||||
$params[] = (int) $start;
|
||||
$params[] = (int) $end;
|
||||
|
||||
$query = $this->db->query($sql, $params);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
// 상위조직 조회
|
||||
public function getPdept()
|
||||
{
|
||||
$sql = "SELECT dept_sq, dept_nm FROM departments" .
|
||||
" WHERE depth = 1" .
|
||||
" AND use_yn = 'Y'";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
// 조직관리 INSERT
|
||||
public function insertDept($data)
|
||||
{
|
||||
|
||||
$sql = "select ifnull(rgt,1) lft from departments where dept_sq = ?";
|
||||
$query = $this->db->query($sql, [$data[0]]);
|
||||
$lft = $query->getRowArray();
|
||||
|
||||
$data[] = $lft["lft"];
|
||||
$data[] = $lft["lft"];
|
||||
|
||||
$sql = "INSERT INTO departments
|
||||
(pdept_sq, dept_nm, dept_desc, dept_head ,use_yn, depth, insert_tm, insert_usr, update_tm, update_usr, lft, rgt)" .
|
||||
"VALUES (?, ?, ?, ?, ?, ?, now(), ?, now(), ?, ?, ?)";
|
||||
|
||||
$this->db->query($sql, $data);
|
||||
|
||||
if ($this->db->transStatus() === false) {
|
||||
return [
|
||||
'success' => false,
|
||||
'msg' => '저장실패',
|
||||
];
|
||||
}
|
||||
|
||||
// 성공
|
||||
return [
|
||||
'success' => true,
|
||||
];
|
||||
}
|
||||
|
||||
// 조직관리 UPDATE
|
||||
public function updateDept($data)
|
||||
{
|
||||
$sql = "UPDATE departments SET" .
|
||||
" pdept_sq = CASE depth WHEN '0' THEN pdept_sq ELSE ? END," .
|
||||
" dept_nm = ?," .
|
||||
" dept_desc = ?," .
|
||||
" dept_head = ?," .
|
||||
" use_yn = ?," .
|
||||
" depth = CASE depth WHEN '0' THEN depth ELSE ? END," .
|
||||
" update_tm = now()," .
|
||||
" update_usr = ?" .
|
||||
" WHERE dept_sq = ?";
|
||||
|
||||
$this->db->query($sql, $data);
|
||||
|
||||
if ($this->db->transStatus() === false) {
|
||||
return [
|
||||
'success' => false,
|
||||
'msg' => '저장실패',
|
||||
];
|
||||
}
|
||||
|
||||
// 성공
|
||||
return [
|
||||
'success' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
93
app/Models/manage/LoginLogModel.php
Normal file
93
app/Models/manage/LoginLogModel.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
namespace App\Models\manage;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class LoginLogModel extends Model
|
||||
{
|
||||
|
||||
public function getTotalCount($data)
|
||||
{
|
||||
$params = [];
|
||||
|
||||
$sql = "SELECT COUNT(*) AS cnt FROM user_login_log WHERE 1=1 ";
|
||||
if (!empty($data["srchTxt"])) {
|
||||
$sql .= "AND (
|
||||
usr_id_in LIKE CONCAT('%', ?, '%')
|
||||
OR usr_id_in IN (SELECT usr_id FROM users WHERE usr_nm LIKE CONCAT('%', ?, '%'))
|
||||
OR ip LIKE CONCAT('%', ?, '%')
|
||||
OR useragent LIKE CONCAT('%', ?, '%')
|
||||
) ";
|
||||
$params[] = $data["srchTxt"];
|
||||
$params[] = $data["srchTxt"];
|
||||
$params[] = $data["srchTxt"];
|
||||
$params[] = $data["srchTxt"];
|
||||
}
|
||||
|
||||
$query = $this->db->query($sql, $params ?: []);
|
||||
|
||||
return $query->getRow()->cnt;
|
||||
|
||||
}
|
||||
|
||||
public function getLoginLogList($start, $end, $data)
|
||||
{
|
||||
$sql = "SELECT id, success, usr_sq, usr_id_in, (SELECT usr_nm FROM users WHERE usr_id = usr_id_in) AS usr_nm, ip, useragent, reason, regdate FROM user_login_log ";
|
||||
$sql .= "WHERE 1=1 ";
|
||||
|
||||
if (!empty($data["srchTxt"])) {
|
||||
$sql .= "AND (
|
||||
usr_id_in LIKE CONCAT('%', ?, '%')
|
||||
OR usr_id_in IN (SELECT usr_id FROM users WHERE usr_nm LIKE CONCAT('%', ?, '%'))
|
||||
OR ip LIKE CONCAT('%', ?, '%')
|
||||
OR useragent LIKE CONCAT('%', ?, '%')
|
||||
) ";
|
||||
$params[] = $data["srchTxt"];
|
||||
$params[] = $data["srchTxt"];
|
||||
$params[] = $data["srchTxt"];
|
||||
$params[] = $data["srchTxt"];
|
||||
}
|
||||
|
||||
$sql .= "ORDER BY id DESC ";
|
||||
$sql .= "LIMIT ?, ?";
|
||||
|
||||
$params[] = (int) $start;
|
||||
$params[] = (int) $end;
|
||||
|
||||
$query = $this->db->query($sql, $params);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
// 엑셀 다운로드 조회
|
||||
public function getExcelDownList($data)
|
||||
{
|
||||
$params = [];
|
||||
|
||||
$sql = "SELECT
|
||||
usr_id_in AS '입력아이디',
|
||||
(SELECT usr_nm FROM users WHERE usr_id = usr_id_in) AS '사용자명',
|
||||
ip AS '아이피', useragent AS '사용자 에이전트',
|
||||
reason AS '사유',
|
||||
regdate AS '접속일시'
|
||||
FROM user_login_log ";
|
||||
$sql .= "WHERE 1=1 ";
|
||||
|
||||
if (!empty($data["srchTxt"])) {
|
||||
$sql .= "AND (
|
||||
usr_id_in LIKE CONCAT('%', ?, '%')
|
||||
OR usr_id_in IN (SELECT usr_id FROM users WHERE usr_nm LIKE CONCAT('%', ?, '%'))
|
||||
OR ip LIKE CONCAT('%', ?, '%')
|
||||
OR useragent LIKE CONCAT('%', ?, '%')
|
||||
) ";
|
||||
$params[] = $data["srchTxt"];
|
||||
$params[] = $data["srchTxt"];
|
||||
$params[] = $data["srchTxt"];
|
||||
$params[] = $data["srchTxt"];
|
||||
}
|
||||
|
||||
$query = $this->db->query($sql, $params ?: []);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
}
|
||||
50
app/Models/manage/MenuModel.php
Normal file
50
app/Models/manage/MenuModel.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
namespace App\Models\manage;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class MenuModel extends Model
|
||||
{
|
||||
|
||||
public function getTotalCount()
|
||||
{
|
||||
$sql = "SELECT COUNT(*) AS cnt FROM menu WHERE 1=1 ";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->getRow()->cnt;
|
||||
}
|
||||
|
||||
public function getMenuList($params)
|
||||
{
|
||||
|
||||
$sql = "SELECT mnu_id, " .
|
||||
" mnu_pid, " .
|
||||
" (SELECT mnu_nm FROM menu WHERE mnu_id = a.mnu_pid) mnu_pid_nm, " .
|
||||
" mnu_nm, " .
|
||||
" mnu_tp, " .
|
||||
" mnu_url, " .
|
||||
" use_yn, " .
|
||||
" insert_tm, " .
|
||||
" (select usr_nm from users where usr_sq = a.insert_usr) insert_usr, " .
|
||||
" (select usr_nm from users where usr_sq = a.update_usr) update_usr, " .
|
||||
" update_tm " .
|
||||
" FROM menu a ";
|
||||
|
||||
$sql .= "WHERE 1=1 ";
|
||||
|
||||
// if (!empty($params['pid'])) {
|
||||
// $sql .= " AND mnu_pid = {$params['pid']} ";
|
||||
// }
|
||||
|
||||
$sql .= " ORDER BY CASE WHEN mnu_pid = 'ROOT' THEN 0 ELSE 1 END, mnu_id";
|
||||
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
|
||||
return $query->getResultArray();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
79
app/Models/manage/PhoneModel.php
Normal file
79
app/Models/manage/PhoneModel.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
namespace App\Models\manage;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class PhoneModel extends Model
|
||||
{
|
||||
|
||||
public function getCodes()
|
||||
{
|
||||
$sql = "SELECT category, cd, cd_nm, use_yn FROM codes WHERE category = 'CP_ID' AND use_yn = 'Y' ORDER BY view_odr ASC";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
public function getTotalCount($data)
|
||||
{
|
||||
$sql = "SELECT
|
||||
COUNT(*) AS cnt
|
||||
FROM
|
||||
dupl_phone_list AS a
|
||||
LEFT JOIN codes AS b ON a.cpid = b.cd AND b.category = 'CP_ID' ";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->getRow()->cnt;
|
||||
}
|
||||
|
||||
public function getDuplPhoneList($start, $end, $data)
|
||||
{
|
||||
$params = [];
|
||||
|
||||
$sql = "SELECT
|
||||
a.*
|
||||
, (CASE a.use_yn WHEN 'Y' THEN '사용' WHEN 'N' THEN '미사용' END) use_yn_nm
|
||||
, b.cd_nm as cpid_nm
|
||||
FROM
|
||||
dupl_phone_list AS a
|
||||
LEFT JOIN codes AS b ON a.cpid = b.cd AND b.category = 'CP_ID' ";
|
||||
|
||||
$sql .= "ORDER BY a.use_yn ASC, a.s_date DESC ";
|
||||
|
||||
$sql .= " LIMIT ?, ?";
|
||||
|
||||
$params[] = (int) $start;
|
||||
$params[] = (int) $end;
|
||||
|
||||
$query = $this->db->query($sql, $params);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
public function insertDuplPhone($data)
|
||||
{
|
||||
$sql = "INSERT INTO dupl_phone_list " .
|
||||
" ( phone_number, use_yn, s_date, e_date, address" .
|
||||
" , owner, applicant, relation" .
|
||||
" , cpid, memo, insert_tm, insert_user_id)" .
|
||||
" VALUES ( ?, ?, ?, ?, ? " .
|
||||
" , ?, ?, ?" .
|
||||
" , ?, ?, SYSDATE(), ?)";
|
||||
|
||||
$this->db->query($sql, $data);
|
||||
|
||||
if ($this->db->transStatus() === false) {
|
||||
return [
|
||||
'success' => false,
|
||||
'msg' => '저장실패',
|
||||
];
|
||||
}
|
||||
|
||||
// 성공
|
||||
return [
|
||||
'success' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
443
app/Models/manage/UserModel.php
Normal file
443
app/Models/manage/UserModel.php
Normal file
@@ -0,0 +1,443 @@
|
||||
<?php
|
||||
namespace App\Models\manage;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class UserModel extends Model
|
||||
{
|
||||
|
||||
// 유저레벨
|
||||
public function getUserLevel()
|
||||
{
|
||||
$sql = "SELECT cd, cd_nm" .
|
||||
" FROM codes" .
|
||||
" WHERE category = 'USER_LEVEL'" .
|
||||
" AND use_yn = 'Y'" .
|
||||
" ORDER BY view_odr asc";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
// 본부리스트
|
||||
public function getBonbuList()
|
||||
{
|
||||
$sql = "SELECT dept_sq, pdept_sq, dept_nm, dept_desc, dept_head, use_yn, depth, insert_tm, insert_usr, update_tm, update_usr, lft, rgt" .
|
||||
" FROM departments" .
|
||||
" WHERE depth = 1" .
|
||||
" AND use_yn = 'Y'" .
|
||||
" ORDER BY lft";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
// 팀리스트
|
||||
public function getTeamList()
|
||||
{
|
||||
$sql = "SELECT dept_sq, pdept_sq, dept_nm" .
|
||||
" FROM departments" .
|
||||
" WHERE depth = 2" .
|
||||
" AND use_yn = 'Y'" .
|
||||
" ORDER BY dept_nm";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
// 조직리스트
|
||||
public function getDeptCode()
|
||||
{
|
||||
$sql = "SELECT dept_sq, pdept_sq, dept_nm, dept_desc, dept_head, use_yn, depth, insert_tm, insert_usr, update_tm, update_usr, lft, rgt" .
|
||||
" FROM departments" .
|
||||
" WHERE use_yn = 'Y' " .
|
||||
" ORDER BY lft";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
public function getTotalCount($data)
|
||||
{
|
||||
$params = [];
|
||||
|
||||
$sql = "SELECT COUNT(*) AS cnt FROM users AS a WHERE 1=1 ";
|
||||
|
||||
if (!empty($data['srchLevel'])) {
|
||||
$sql .= " AND a.usr_level = ?";
|
||||
array_push($params, $data['srchLevel']);
|
||||
}
|
||||
|
||||
if (!empty($data['srchTeam'])) {
|
||||
$sql .= " AND a.dept_sq = ? ";
|
||||
array_push($params, $data['srchTeam']);
|
||||
}
|
||||
|
||||
if (!empty($data['useYn'])) {
|
||||
$sql .= " AND a.use_yn = ? ";
|
||||
array_push($params, $data['useYn']);
|
||||
}
|
||||
|
||||
if (!empty($data['srchTxt'])) {
|
||||
switch ($data['srchType']):
|
||||
case "1":
|
||||
$sql .= " AND a.usr_nm LIKE CONCAT('%', ?, '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
case "2":
|
||||
$sql .= " AND a.usr_id LIKE CONCAT('%', ?, '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
case "3":
|
||||
$sql .= " AND a.usr_position LIKE CONCAT('%', ?, '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
case "4":
|
||||
$sql .= " AND REPLACE(a.usr_tel1, '-', '') LIKE CONCAT('%', REPLACE(?, '-', ''), '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
case "5":
|
||||
$sql .= " AND CONCAT(a.usr_addr1, ' ', a.usr_addr2) LIKE CONCAT('%', ?, '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
default:
|
||||
$sql .= "
|
||||
AND (
|
||||
a.usr_nm LIKE CONCAT('%', ?, '%')
|
||||
OR a.usr_id LIKE CONCAT('%', ?, '%')
|
||||
OR a.usr_position LIKE CONCAT('%', ?, '%')
|
||||
OR REPLACE(a.usr_tel1, '-', '') LIKE CONCAT('%', REPLACE(?, '-', ''), '%')
|
||||
OR CONCAT(a.usr_addr1, ' ', a.usr_addr2) LIKE CONCAT('%', ?, '%')
|
||||
)
|
||||
";
|
||||
array_push($params, $data['srchTxt']);
|
||||
array_push($params, $data['srchTxt']);
|
||||
array_push($params, $data['srchTxt']);
|
||||
array_push($params, $data['srchTxt']);
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
endswitch;
|
||||
|
||||
}
|
||||
|
||||
$query = $this->db->query($sql, $params ?: []);
|
||||
|
||||
return $query->getRow()->cnt;
|
||||
}
|
||||
|
||||
|
||||
public function getUserList($start, $end, $data)
|
||||
{
|
||||
$params = [];
|
||||
|
||||
$sql = "SELECT
|
||||
usr_sq
|
||||
, (select dept_sq from departments where dept_sq = (select pdept_sq from departments where a.dept_sq = dept_sq)) pdept_sq
|
||||
, (select dept_nm from departments where dept_sq = (select pdept_sq from departments where a.dept_sq = dept_sq)) pdept_nm
|
||||
, (select dept_nm from departments where a.dept_sq = dept_sq) as dept_nm
|
||||
, dept_sq
|
||||
, usr_id
|
||||
, usr_nm
|
||||
, (select cd_nm from codes where a.usr_level = cd and category = 'USER_LEVEL') level_nm
|
||||
, usr_level
|
||||
, usr_position
|
||||
, usr_tel1
|
||||
, usr_tel2
|
||||
, usr_addr1
|
||||
, usr_addr2
|
||||
, insert_tm
|
||||
, (select usr_nm from users where usr_sq = a.insert_usr) insert_usr
|
||||
, update_tm
|
||||
, (select usr_nm from users where usr_sq = a.update_usr) update_usr
|
||||
, use_yn
|
||||
, case when a.use_yn = 'Y' then '예' when a.use_yn = 'N' then '아니요' end as use_yn_nm
|
||||
, sms_auth_yn
|
||||
, case when a.sms_auth_yn = 'Y' then '예' when a.sms_auth_yn = 'N' then '아니요' end as sms_auth_yn_nm
|
||||
, last_usr_pw_tm
|
||||
FROM
|
||||
users AS a
|
||||
WHERE
|
||||
1=1 ";
|
||||
|
||||
if (!empty($data['srchLevel'])) {
|
||||
$sql .= " AND a.usr_level = ?";
|
||||
array_push($params, $data['srchLevel']);
|
||||
}
|
||||
|
||||
if (!empty($data['srchTeam'])) {
|
||||
$sql .= " AND a.dept_sq = ?";
|
||||
array_push($params, $data['srchTeam']);
|
||||
}
|
||||
|
||||
if (!empty($data['useYn'])) {
|
||||
$sql .= " AND a.use_yn = ?";
|
||||
array_push($params, $data['useYn']);
|
||||
}
|
||||
|
||||
if (!empty($data['srchTxt'])) {
|
||||
switch ($data['srchType']):
|
||||
case "1":
|
||||
$sql .= " AND a.usr_nm LIKE CONCAT('%', ?, '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
case "2":
|
||||
$sql .= " AND a.usr_id LIKE CONCAT('%', ?, '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
case "3":
|
||||
$sql .= " AND a.usr_position LIKE CONCAT('%', ?, '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
case "4":
|
||||
$sql .= " AND REPLACE(a.usr_tel1, '-', '') LIKE CONCAT('%', REPLACE(?, '-', ''), '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
case "5":
|
||||
$sql .= " AND CONCAT(a.usr_addr1, ' ', a.usr_addr2) LIKE CONCAT('%', ?, '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
default:
|
||||
$sql .= "
|
||||
AND (
|
||||
a.usr_nm LIKE CONCAT('%', ?, '%')
|
||||
OR a.usr_id LIKE CONCAT('%', ?, '%')
|
||||
OR a.usr_position LIKE CONCAT('%', ?, '%')
|
||||
OR REPLACE(a.usr_tel1, '-', '') LIKE CONCAT('%', REPLACE(?, '-', ''), '%')
|
||||
OR CONCAT(a.usr_addr1, ' ', a.usr_addr2) LIKE CONCAT('%', ?, '%')
|
||||
)
|
||||
";
|
||||
array_push($params, $data['srchTxt']);
|
||||
array_push($params, $data['srchTxt']);
|
||||
array_push($params, $data['srchTxt']);
|
||||
array_push($params, $data['srchTxt']);
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
endswitch;
|
||||
|
||||
}
|
||||
|
||||
$sql .= "ORDER BY a.insert_tm DESC ";
|
||||
$sql .= "LIMIT ?, ?";
|
||||
|
||||
$params[] = (int) $start; // offset
|
||||
$params[] = (int) $end; // limit
|
||||
|
||||
|
||||
$query = $this->db->query($sql, $params);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
|
||||
// 유저등록
|
||||
public function insertUser($data)
|
||||
{
|
||||
|
||||
|
||||
$sql = "INSERT INTO users
|
||||
(usr_id, usr_pw, dept_sq, usr_nm, usr_level, usr_position, usr_tel1, usr_tel2, usr_addr1, usr_addr2, insert_tm, insert_usr, use_yn, sms_auth_yn, last_usr_pw_tm)" .
|
||||
" VALUES (?, SHA2(?,256), ?, ?, ?, ?, ?, ?, ?, ?, now(), ?, ?, ?, now())";
|
||||
|
||||
|
||||
$this->db->query($sql, $data);
|
||||
|
||||
if ($this->db->transStatus() === false) {
|
||||
return [
|
||||
'success' => false,
|
||||
'msg' => '저장실패',
|
||||
];
|
||||
}
|
||||
|
||||
// 성공
|
||||
return [
|
||||
'success' => true,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
// 유저수정
|
||||
public function updateUser($data, $addUserPswd, $usrSq)
|
||||
{
|
||||
$sql = "UPDATE users SET
|
||||
usr_nm = ?,
|
||||
dept_sq = ?,
|
||||
usr_level = ?,
|
||||
usr_position = ?,
|
||||
usr_tel1 = ?,
|
||||
usr_tel2 = ?,
|
||||
usr_addr1 = ?,
|
||||
usr_addr2 = ?,
|
||||
update_tm = NOW(),
|
||||
update_usr = ?,
|
||||
use_yn = ?,
|
||||
sms_auth_yn = ?";
|
||||
|
||||
$params = [
|
||||
$data[0], // usr_nm
|
||||
$data[1], // dept_sq
|
||||
$data[2], // usr_level
|
||||
$data[3], // usr_position
|
||||
$data[4], // usr_tel1
|
||||
$data[5], // usr_tel2
|
||||
$data[6], // usr_addr1
|
||||
$data[7], // usr_addr2
|
||||
$data[8], // update_usr
|
||||
$data[9], // use_yn
|
||||
$data[10], // sms_auth_yn
|
||||
];
|
||||
|
||||
if (!empty($addUserPswd)) {
|
||||
$sql .= ", usr_pw = SHA2(?, 256),
|
||||
last_usr_pw_tm = NOW()";
|
||||
$params[] = $addUserPswd;
|
||||
}
|
||||
|
||||
$sql .= " WHERE usr_sq = ?";
|
||||
$params[] = $usrSq;
|
||||
|
||||
$this->db->query($sql, $params);
|
||||
|
||||
if ($this->db->transStatus() === false) {
|
||||
return [
|
||||
'success' => false,
|
||||
'msg' => '저장실패',
|
||||
];
|
||||
}
|
||||
|
||||
// 성공
|
||||
return [
|
||||
'success' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function removeUser($data)
|
||||
{
|
||||
|
||||
$sql = " UPDATE users " .
|
||||
" SET usr_nm = '***' " .
|
||||
" ,usr_pw = '1234' " .
|
||||
" ,usr_tel1 = '***' " .
|
||||
" ,usr_tel2 = '' " .
|
||||
" ,usr_addr1 = '' " .
|
||||
" ,usr_position = '' " .
|
||||
" ,dept_sq = '14' " . //소속조직 : 퇴사자 관리
|
||||
" ,sms_auth_yn = 'N' " .
|
||||
" ,use_yn = 'N' " .
|
||||
" ,usr_addr2 = '삭제' " .
|
||||
" ,update_tm = NOW() " .
|
||||
" ,update_usr = ? " .
|
||||
" WHERE usr_sq = ? ";
|
||||
|
||||
|
||||
$this->db->query($sql, $data);
|
||||
|
||||
|
||||
if ($this->db->transStatus() === false) {
|
||||
return [
|
||||
'success' => false,
|
||||
'msg' => '저장실패',
|
||||
];
|
||||
}
|
||||
|
||||
// 성공
|
||||
return [
|
||||
'success' => true,
|
||||
];
|
||||
}
|
||||
|
||||
// 엑셀 다운로드 조회
|
||||
public function getExcelUserList($data)
|
||||
{
|
||||
$params = [];
|
||||
|
||||
$sql = "SELECT
|
||||
(select dept_nm from departments where dept_sq = (select pdept_sq from departments where a.dept_sq = dept_sq)) AS '소속본부'
|
||||
, (select dept_nm from departments where a.dept_sq = dept_sq) AS '소속팀'
|
||||
, usr_id AS '사원번호'
|
||||
, usr_nm AS '사용자명'
|
||||
, (SELECT cd_nm FROM codes where a.usr_level = cd and category = 'USER_LEVEL') AS '등급'
|
||||
, usr_position AS '직급'
|
||||
, usr_tel1 AS '연락처'
|
||||
, CONCAT(usr_addr1, usr_addr2) AS '주소'
|
||||
, case when a.sms_auth_yn = 'Y' then '예' when a.sms_auth_yn = 'N' then '아니요' end AS 'SMS인증여부'
|
||||
, insert_tm AS '등록자'
|
||||
, (select usr_nm from users where usr_sq = a.insert_usr) AS '등록일시'
|
||||
, update_tm AS '수정자'
|
||||
, (select usr_nm from users where usr_sq = a.update_usr) AS '수정일시'
|
||||
, last_usr_pw_tm AS '비빌번호변경일시'
|
||||
FROM
|
||||
users AS a
|
||||
WHERE
|
||||
1=1 ";
|
||||
|
||||
if (!empty($data['srchLevel'])) {
|
||||
$sql .= " AND a.usr_level = ? ";
|
||||
array_push($params, $data['srchLevel']);
|
||||
}
|
||||
|
||||
if (!empty($data['srchTeam'])) {
|
||||
$sql .= " AND a.dept_sq = ? ";
|
||||
array_push($params, $data['srchTeam']);
|
||||
}
|
||||
|
||||
if (!empty($data['useYn'])) {
|
||||
$sql .= " AND a.use_yn = ? ";
|
||||
array_push($params, $data['useYn']);
|
||||
}
|
||||
|
||||
if (!empty($data['srchTxt'])) {
|
||||
switch ($data['srchType']):
|
||||
case "1":
|
||||
$sql .= " AND a.usr_nm LIKE CONCAT('%', ?, '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
case "2":
|
||||
$sql .= " AND a.usr_id LIKE CONCAT('%', ?, '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
case "3":
|
||||
$sql .= " AND a.usr_position LIKE CONCAT('%', ?, '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
case "4":
|
||||
$sql .= " AND REPLACE(a.usr_tel1, '-', '') LIKE CONCAT('%', REPLACE(?, '-', ''), '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
case "5":
|
||||
$sql .= " AND CONCAT(a.usr_addr1, ' ', a.usr_addr2) LIKE CONCAT('%', ?, '%') ";
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
default:
|
||||
$sql .= "
|
||||
AND (
|
||||
a.usr_nm LIKE CONCAT('%', ?, '%')
|
||||
OR a.usr_id LIKE CONCAT('%', ?, '%')
|
||||
OR a.usr_position LIKE CONCAT('%', ?, '%')
|
||||
OR REPLACE(a.usr_tel1, '-', '') LIKE CONCAT('%', REPLACE(?, '-', ''), '%')
|
||||
OR CONCAT(a.usr_addr1, ' ', a.usr_addr2) LIKE CONCAT('%', ?, '%')
|
||||
)
|
||||
";
|
||||
array_push($params, $data['srchTxt']);
|
||||
array_push($params, $data['srchTxt']);
|
||||
array_push($params, $data['srchTxt']);
|
||||
array_push($params, $data['srchTxt']);
|
||||
array_push($params, $data['srchTxt']);
|
||||
break;
|
||||
endswitch;
|
||||
|
||||
}
|
||||
|
||||
$sql .= "ORDER BY a.insert_tm DESC ";
|
||||
|
||||
|
||||
$query = $this->db->query($sql, $params ?: []);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,56 @@
|
||||
<meta charset="utf-8">
|
||||
<title><?= $title ?? 'Dashboard' ?></title>
|
||||
|
||||
<meta http-equiv="Content-Language" content="ko">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title><?= $title ?? '컨펌스' ?></title>
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no" />
|
||||
<link rel="icon" href="/architectui/assets/favicon.ico">
|
||||
<script defer src="/architectui/assets/scripts/main.js"></script>
|
||||
<!-- <script defer src="/architectui/assets/scripts/main.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/demo.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/toastr.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/scrollbar.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/fullcalendar.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/maps.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/chart_js.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/chart_js.js"></script> -->
|
||||
|
||||
|
||||
<script defer src="/architectui/assets/scripts/vendors.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/main.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/demo.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/ladda.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/blockui.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/circle_progress.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/count_up.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/toastr.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/sweet_alerts.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/scrollbar.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/sticky_elements.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/carousel_slider.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/fullcalendar.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/treeview.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/maps.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/rating.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/image_crop.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/guided_tours.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/tables.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/form_validation.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/form_wizard.98288b227c064e6a107f.js">
|
||||
|
||||
</script>
|
||||
<script defer src="/architectui/assets/scripts/clipboard.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/datepicker.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/input_mask.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/input_select.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/range_slider.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/textarea_autosize.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/toggle_switch.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/chart_js.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/apex_charts.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/sparklines.98288b227c064e6a107f.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/xlsx/dist/xlsx.full.min.js"></script>
|
||||
|
||||
<link href="/architectui/assets/styles/vendors.98288b227c064e6a107f.css" rel="stylesheet">
|
||||
<link href="/architectui/assets/styles/main.98288b227c064e6a107f.css" rel="stylesheet">
|
||||
15
app/Views/layouts/loading-indicator.php
Normal file
15
app/Views/layouts/loading-indicator.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<div class="my-loader-template d-none">
|
||||
<div class="loader bg-transparent no-shadow p-0">
|
||||
<div class="ball-grid-pulse">
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,5 +1,6 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<?= $this->include('layouts/header') ?>
|
||||
</head>
|
||||
@@ -10,16 +11,22 @@
|
||||
<?= $this->include('layouts/topbar') ?>
|
||||
|
||||
<div class="app-main">
|
||||
<?= $this->include('layouts/sidebar') ?>
|
||||
|
||||
<?= view_cell('\App\Cells\MenuCell::index') ?>
|
||||
|
||||
<div class="app-main__outer">
|
||||
<?= $this->include('layouts/loading-indicator') ?>
|
||||
<div class="app-main__inner">
|
||||
<?= $this->renderSection('content') ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?= $this->include('layouts/footer') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->renderSection('modals') ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
||||
@@ -100,140 +100,89 @@
|
||||
</ul>
|
||||
</li>
|
||||
-->
|
||||
<!--
|
||||
<li class="mm-active">
|
||||
<a href="#">
|
||||
<i class="metismenu-icon pe-7s-car"></i>
|
||||
Components
|
||||
<i class="metismenu-state-icon pe-7s-angle-down caret-left"></i>
|
||||
</a>
|
||||
<ul class="mm-show">
|
||||
<li>
|
||||
<a href="components-tabs.html" class="mm-active">
|
||||
<i class="metismenu-icon">
|
||||
</i>Tabs
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="components-accordions.html">
|
||||
<i class="metismenu-icon">
|
||||
</i>Accordions
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="components-notifications.html">
|
||||
<i class="metismenu-icon">
|
||||
</i>Notifications
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="components-modals.html">
|
||||
<i class="metismenu-icon">
|
||||
</i>Modals
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="components-progress-bar.html">
|
||||
<i class="metismenu-icon">
|
||||
</i>Progress Bar
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="components-tooltips-popovers.html">
|
||||
<i class="metismenu-icon">
|
||||
</i>Tooltips & Popovers
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="components-carousel.html">
|
||||
<i class="metismenu-icon">
|
||||
</i>Carousel
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="components-calendar.html">
|
||||
<i class="metismenu-icon">
|
||||
</i>Calendar
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="components-pagination.html">
|
||||
<i class="metismenu-icon">
|
||||
</i>Pagination
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="components-scrollable-elements.html">
|
||||
<i class="metismenu-icon">
|
||||
</i>Scrollable
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="components-maps.html">
|
||||
<i class="metismenu-icon">
|
||||
</i>Maps
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="tables-regular.html">
|
||||
<i class="metismenu-icon pe-7s-display2"></i>
|
||||
Tables
|
||||
</a>
|
||||
</li>
|
||||
<li class="app-sidebar__heading">Widgets</li>
|
||||
-->
|
||||
<li>
|
||||
<a href="dashboard-boxes.html">
|
||||
<i class="metismenu-icon pe-7s-display2"></i>
|
||||
Dashboard
|
||||
</a>
|
||||
</li>
|
||||
<li class="app-sidebar__heading">컨펌스</li>
|
||||
<li>
|
||||
<a href="forms-controls.html">
|
||||
<i class="metismenu-icon pe-7s-monitor">
|
||||
</i>
|
||||
현장확인매물 관리
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="forms-layouts.html">
|
||||
<i class="metismenu-icon pe-7s-monitor">
|
||||
</i>일반확인매물 관리
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="forms-validation.html">
|
||||
<i class="metismenu-icon pe-7s-server">
|
||||
</i>아파트단지DB구축
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="forms-validation.html">
|
||||
<i class="metismenu-icon pe-7s-mail">
|
||||
</i>SMS발송
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="forms-validation.html">
|
||||
<i class="metismenu-icon pe-7s-display2">
|
||||
</i>실적관리
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="forms-validation.html">
|
||||
<i class="metismenu-icon pe-7s-config">
|
||||
</i>시스템관리
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="forms-validation.html">
|
||||
<i class="metismenu-icon pe-7s-graph2">
|
||||
</i>금리비교
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<li class="app-sidebar__heading">컨펌스
|
||||
<?php
|
||||
$serverIp = $_SERVER['SERVER_ADDR'] ?? '';
|
||||
|
||||
// 개발 서버
|
||||
$devServers = ['192.168.200.8', '192.168.10.231'];
|
||||
|
||||
// 도커 테스트 서버
|
||||
$dockerServers = ['172.18.0.2'];
|
||||
|
||||
// 테스트 서버
|
||||
$testServers = ['192.168.200.9', '192.168.10.237', '175.126.191.182'];
|
||||
|
||||
// 운영 서버 IP 매핑
|
||||
$prodServers = [
|
||||
'172.16.100.2' => "WEB 1",
|
||||
'172.16.100.3' => "WEB 2",
|
||||
'172.16.100.4' => "WEB 3",
|
||||
'172.16.100.5' => "WEB 4",
|
||||
];
|
||||
|
||||
|
||||
if (in_array($serverIp, $devServers, true)) {
|
||||
// 개발
|
||||
echo "<img src='/img/gnb_dev_00.png' alt='' />";
|
||||
|
||||
} elseif (in_array($serverIp, $dockerServers, true)) {
|
||||
// 도커
|
||||
echo "
|
||||
<div style='width:180px; height:43px;text-align:center;
|
||||
font-size:12px;color:#ffffff;font-weight:bold;
|
||||
padding-top:2px;background-color:#0000ff'>
|
||||
DOCKER <br>{$serverIp}<br>{$this->load->db->hostname}
|
||||
</div>
|
||||
";
|
||||
|
||||
} elseif (in_array($serverIp, $testServers, true)) {
|
||||
// 테스트
|
||||
echo "테스트";
|
||||
|
||||
} else {
|
||||
// 운영
|
||||
$serverName = $prodServers[$serverIp] ?? 'UNKNOWN';
|
||||
|
||||
echo "{$serverName}";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</li>
|
||||
|
||||
<?php foreach ($mMenu as $menu): ?>
|
||||
<li>
|
||||
<?php if ($menu["mnu_pid"] == '0') { ?>
|
||||
<a href="#">
|
||||
<i class="metismenu-icon <?= $icons[$menu['mnu_id']] ?>"></i>
|
||||
|
||||
<?= $menu["mnu_nm"] ?>
|
||||
|
||||
<i class="metismenu-state-icon pe-7s-angle-down caret-left"></i>
|
||||
</a>
|
||||
<?php } ?>
|
||||
<ul>
|
||||
<?php foreach ($sMenu as $subMenu): ?>
|
||||
<?php if ($menu["mnu_id"] == $subMenu["mnu_pid"]): ?>
|
||||
<li>
|
||||
<a href="<?= $subMenu["mnu_url"] ?>">
|
||||
<i class="metismenu-icon"></i>
|
||||
<?= $subMenu["mnu_nm"] ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div> -->
|
||||
|
||||
<div class="app-header-right">
|
||||
<div class="header-btn-lg pe-0">
|
||||
<div class="widget-content p-0">
|
||||
@@ -78,23 +79,25 @@
|
||||
<h6 tabindex="-1" class="dropdown-header">Header</h6>
|
||||
<button type="button" tabindex="0" class="dropdown-item">Actions</button>
|
||||
<div tabindex="-1" class="dropdown-divider"></div>
|
||||
<button type="button" tabindex="0" class="dropdown-item">Dividers</button>
|
||||
<button type="button" tabindex="0" class="dropdown-item"
|
||||
onclick="location.href='/logout'">로그아웃</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="widget-content-left ms-3 header-user-info">
|
||||
<div class="widget-heading">
|
||||
관리자
|
||||
<?= session('usr_nm'); ?>
|
||||
</div>
|
||||
<div class="widget-subheading">
|
||||
[admin | confrims] 님
|
||||
[ <?= session('usr_id'); ?> | <?= session('dept_nm'); ?> ] 님
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-content-right header-user-info ms-3">
|
||||
<!-- <div class="widget-content-right header-user-info ms-3">
|
||||
<button type="button" class="btn-shadow p-1 btn btn-primary btn-sm show-toastr-example">
|
||||
<i class="fa text-white fa-calendar pe-1 ps-1"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
135
app/Views/pages/board/notice.php
Normal file
135
app/Views/pages/board/notice.php
Normal file
@@ -0,0 +1,135 @@
|
||||
<?= $this->extend('layouts/main') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<style>
|
||||
#noticeList tbody tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-xl-12">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<form class="row g-3 align-items-center" id="frm_srch_info" onsubmit="return false;">
|
||||
|
||||
<!-- 검색타입 -->
|
||||
<div class="col-md-2">
|
||||
<select class="form-control" name="srchType">
|
||||
<option value="">선택</option>
|
||||
<option value="1">제목</option>
|
||||
<option value="2">작성자</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- 검색어 -->
|
||||
<div class="col-md-2">
|
||||
<input name="srchTxt" type="text" class="form-control" placeholder="검색어 입력">
|
||||
</div>
|
||||
|
||||
<!-- 버튼 -->
|
||||
<div class="col-md-1">
|
||||
<button type="button" class="btn btn-success btn-transition w-100" id="btnSearch">
|
||||
검색
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-xl-12">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-header">공지사항</div>
|
||||
<div class="card-body">
|
||||
<table id="noticeList" class="table table-hover table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>번호</th>
|
||||
<th>제목</th>
|
||||
<th>글쓴이</th>
|
||||
<th>날짜</th>
|
||||
<th>조회</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- 여기는 비워둠: AJAX로 채움 -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button class="mb-2 me-2 btn-transition btn btn-outline-primary"
|
||||
onclick="location.href='/board/notice/write'">글쓰기</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css" />
|
||||
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
|
||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function () {
|
||||
|
||||
// 혹시 기존 데모가 자동으로 초기화했다면 파괴 후 다시 초기화
|
||||
// if ($.fn.DataTable.isDataTable('#noticeList')) {
|
||||
// $('#noticeList').DataTable().destroy();
|
||||
// }
|
||||
|
||||
let table = $('#noticeList').DataTable({
|
||||
language: lang_kor,
|
||||
processing: true,
|
||||
serverSide: false,
|
||||
ajax: {
|
||||
url: '/board/notice/getNoticeList',
|
||||
type: 'GET',
|
||||
data: function (d) {
|
||||
d.srchType = $("#frm_srch_info [name=srchType]").val()
|
||||
d.srchTxt = $("#frm_srch_info [name=srchTxt]").val()
|
||||
|
||||
d.start = d.start || 0
|
||||
d.length = d.length || 10
|
||||
}
|
||||
},
|
||||
"columnDefs": [
|
||||
{ 'targets': '_all', "defaultContent": "" },
|
||||
{ 'className': 'text-center', 'targets': [0, 2, 3, 4] },
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
"data": null,
|
||||
"width": "50px",
|
||||
"render": function (data, type, row, meta) {
|
||||
return meta.row + meta.settings._iDisplayStart + 1;
|
||||
}
|
||||
},
|
||||
{ data: 'subject' },
|
||||
{ data: 'insert_nm', "width": "100px" },
|
||||
{ data: 'insert_tm', "width": "150px" },
|
||||
{ data: 'hit', "width": "100px" }
|
||||
],
|
||||
// 옵션들 예시
|
||||
paging: true,
|
||||
searching: false,
|
||||
ordering: false,
|
||||
serverSide: true,
|
||||
order: [[3, 'desc']]
|
||||
});
|
||||
|
||||
|
||||
$('#noticeList tbody').on('click', 'tr', function () {
|
||||
const rowData = table.row(this).data();
|
||||
if (!rowData) return;
|
||||
|
||||
const id = rowData.bbs_sq;
|
||||
location.href = "<?= site_url('board/notice/detail') ?>/" + id;
|
||||
});
|
||||
|
||||
// [검색] 버튼 눌렀을 때 다시 조회
|
||||
$('#btnSearch').on('click', function () {
|
||||
table.ajax.reload();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
127
app/Views/pages/board/noticeDetail.php
Normal file
127
app/Views/pages/board/noticeDetail.php
Normal file
@@ -0,0 +1,127 @@
|
||||
<?= $this->extend('layouts/main') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
<h1>공지사항</h1>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12 col-xl-12">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th style="width:150px;">제목</th>
|
||||
<td colspan="5"><?= $notice['subject'] ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>작성자</th>
|
||||
<td><?= $notice['insert_nm'] ?></td>
|
||||
<th style="width:150px;">작성일</th>
|
||||
<td><?= $notice['insert_tm'] ?></td>
|
||||
<th>조회수</th>
|
||||
<td><?= $notice['hit'] ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>내용</th>
|
||||
<td colspan="5" style="min-height: 200px;">
|
||||
<?= $notice['content'] ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if (!empty($files)): ?>
|
||||
<tr>
|
||||
<th>첨부파일</th>
|
||||
<td colspan="5" style="min-height: 200px;">
|
||||
<div>
|
||||
<a href="<?= site_url('/board/notice/download/' . $files['file_sq']) ?>">
|
||||
<?= esc($files['orig_name']) ?>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button class="mb-2 me-2 btn-transition btn btn-outline-primary"
|
||||
onclick="location.href='/board/notice/lists'">목록</button>
|
||||
<button class="mb-2 me-2 btn-transition btn btn-outline-primary"
|
||||
onclick="location.href='/board/notice/modify/<?= $notice['bbs_sq'] ?>'">수정</button>
|
||||
<button class="mb-2 me-2 btn-transition btn btn-outline-primary" id="btn_remove">삭제</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
const tpl = document.querySelector('.my-loader-template');
|
||||
|
||||
$(function () {
|
||||
|
||||
$("#btn_remove").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: '/board/notice/remove',
|
||||
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
method: 'POST',
|
||||
data: { bbs_sq: <?= $notice['bbs_sq'] ?> },
|
||||
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",
|
||||
draggable: true
|
||||
})
|
||||
},
|
||||
success: function (result) {
|
||||
|
||||
if (result.code == '0') {
|
||||
location.replace('/board/notice/lists')
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: result.msg,
|
||||
icon: "error",
|
||||
draggable: true
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
134
app/Views/pages/board/noticeModify.php
Normal file
134
app/Views/pages/board/noticeModify.php
Normal file
@@ -0,0 +1,134 @@
|
||||
<?= $this->extend('layouts/main') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
<h1>공지사항</h1>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12 col-xl-12">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<form class="form-control" id="frm_board_info" enctype="multipart/form-data">
|
||||
<input type="hidden" name="bbs_sq" value="<?= $notice['bbs_sq'] ?>">
|
||||
<div class="position-relative mb-3">
|
||||
<label for="subject" class="form-label">제목</label>
|
||||
<input name="subject" id="subject" type="text" class="form-control"
|
||||
value="<?= $notice['subject'] ?>">
|
||||
</div>
|
||||
<div class="position-relative mb-3">
|
||||
<label for="subject" class="form-label">내용</label>
|
||||
<textarea class="form-control" name="content" id="content" rows="10"
|
||||
cols="100"><?= $notice['content'] ?></textarea>
|
||||
</div>
|
||||
<div class="position-relative mb-3">
|
||||
<label for="file" class="form-label">첨부파일</label>
|
||||
<input name="file" id="file" type="file" class="form-control">
|
||||
</div>
|
||||
<?php if (!empty($files)): ?>
|
||||
<input type="hidden" name="file_sq" value="<?= $files['file_sq'] ?>">
|
||||
<div class="position-relative mb-3">
|
||||
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button class="mb-2 me-2 btn btn-primary" id="btn_save">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet"
|
||||
type="text/css" />
|
||||
<script type="text/javascript"
|
||||
src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
const editorKey = '5OA4gF4D3I3G3B6C4D-13TMIBDIa2NTMNZFFPFZe2a1Id1f1I1fA8D6C4F4G3H3I2A18A15A6==';
|
||||
const tpl = document.querySelector('.my-loader-template');
|
||||
|
||||
$(function () {
|
||||
editor = new FroalaEditor("#content", {
|
||||
fileUpload: true
|
||||
, 'key': editorKey
|
||||
, 'height': 150
|
||||
, toolbarButtons: [
|
||||
'bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize',
|
||||
'color', 'paragraphFormat', 'align', 'formatOL', 'formatUL', 'outdent', 'indent', 'quote', 'insertHR',
|
||||
'undo', 'redo', 'clearFormatting', 'selectAll', 'html'
|
||||
]
|
||||
, toolbarButtonsXS: [
|
||||
'bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize',
|
||||
'color', 'paragraphFormat', 'align', 'formatOL', 'formatUL', 'outdent', 'indent', 'quote', 'insertHR',
|
||||
'undo', 'redo', 'clearFormatting', 'selectAll', 'html'
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
$("#btn_save").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: '/board/notice/actModify',
|
||||
method: 'POST',
|
||||
data: new FormData($("#frm_board_info")[0]),
|
||||
processData: false,
|
||||
contentType: false,
|
||||
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",
|
||||
draggable: true
|
||||
})
|
||||
},
|
||||
success: function (result) {
|
||||
|
||||
if (result.code == '0') {
|
||||
location.replace('/board/notice/lists')
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: result.msg,
|
||||
icon: "error",
|
||||
draggable: true
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
126
app/Views/pages/board/noticeWrite.php
Normal file
126
app/Views/pages/board/noticeWrite.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<?= $this->extend('layouts/main') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
<h1>공지사항</h1>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12 col-xl-12">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<form class="form-control" id="frm_board_info" enctype="multipart/form-data">
|
||||
<div class="position-relative mb-3">
|
||||
<label for="subject" class="form-label">제목</label>
|
||||
<input name="subject" id="subject" type="text" class="form-control">
|
||||
</div>
|
||||
<div class="position-relative mb-3">
|
||||
<label for="subject" class="form-label">내용</label>
|
||||
<textarea class="form-control" name="content" id="content" rows="10" cols="100"></textarea>
|
||||
</div>
|
||||
<div class="position-relative mb-3">
|
||||
<label for="file" class="form-label">첨부파일</label>
|
||||
<input name="file" id="file" type="file" class="form-control">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button class="mb-2 me-2 btn btn-primary" id="btn_save">저장</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- <script src="https://cdn.ckeditor.com/4.12.1/standard/ckeditor.js"></script> -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet"
|
||||
type="text/css" />
|
||||
<script type="text/javascript"
|
||||
src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
const editorKey = '5OA4gF4D3I3G3B6C4D-13TMIBDIa2NTMNZFFPFZe2a1Id1f1I1fA8D6C4F4G3H3I2A18A15A6==';
|
||||
const tpl = document.querySelector('.my-loader-template');
|
||||
|
||||
$(function () {
|
||||
editor = new FroalaEditor("#content", {
|
||||
fileUpload: true
|
||||
, 'key': editorKey
|
||||
, 'height': 150
|
||||
, toolbarButtons: [
|
||||
'bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize',
|
||||
'color', 'paragraphFormat', 'align', 'formatOL', 'formatUL', 'outdent', 'indent', 'quote', 'insertHR',
|
||||
'undo', 'redo', 'clearFormatting', 'selectAll', 'html'
|
||||
]
|
||||
, toolbarButtonsXS: [
|
||||
'bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize',
|
||||
'color', 'paragraphFormat', 'align', 'formatOL', 'formatUL', 'outdent', 'indent', 'quote', 'insertHR',
|
||||
'undo', 'redo', 'clearFormatting', 'selectAll', 'html'
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
$("#btn_save").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: '/board/notice/actWrite',
|
||||
method: 'POST',
|
||||
data: new FormData($("#frm_board_info")[0]),
|
||||
processData: false,
|
||||
contentType: false,
|
||||
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",
|
||||
draggable: true
|
||||
})
|
||||
},
|
||||
success: function (result) {
|
||||
|
||||
if (result.code == '0') {
|
||||
location.replace('/board/notice/lists')
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: result.msg,
|
||||
icon: "error",
|
||||
draggable: true
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
@@ -1,196 +0,0 @@
|
||||
<?= $this->extend('layouts/main') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<h1>Dashboard</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-xl-4">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">예약 미확정 매물 목록</h5>
|
||||
<div class="table-responsive">
|
||||
<table class="mb-0 table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>접수일자</th>
|
||||
<th>예약일자</th>
|
||||
<th>오전/오후</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-xl-4">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">공지사항</h5>
|
||||
<div class="table-responsive">
|
||||
<table class="mb-0 table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>순번</th>
|
||||
<th>제목</th>
|
||||
<th>등록일자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-xl-4">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">검수지연내역(녹취필요)</h5>
|
||||
<div class="table-responsive">
|
||||
<table class="mb-0 table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>접수일자</th>
|
||||
<th>촬영일자</th>
|
||||
<th>경과일</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-xl-4">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">검수지연내역(홍보확인서)</h5>
|
||||
<div class="table-responsive">
|
||||
<table class="mb-0 table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>접수일자</th>
|
||||
<th>촬영일자</th>
|
||||
<th>경과일</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
161
app/Views/pages/home/dashboard.php
Normal file
161
app/Views/pages/home/dashboard.php
Normal file
@@ -0,0 +1,161 @@
|
||||
<?= $this->extend('layouts/main') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<style>
|
||||
th {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table tbody tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h1>Dashboard</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-xl-4">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">예약 미확정 매물 목록</h5>
|
||||
<div class="table-responsive">
|
||||
<table class="mb-0 table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>접수일자</th>
|
||||
<th>예약일자</th>
|
||||
<th>오전/오후</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$nRow = 1;
|
||||
foreach ($statistics['reserve'] as $row):
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row"> <?= substr($row['rcpt_tm'], 0, 10) ?></th>
|
||||
<td class="text-center"><?= substr($row['rsrv_date'], 0, 10) ?></td>
|
||||
<td class="text-center"><?= $row['rsrv_tm_ap'] ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$nRow++;
|
||||
endforeach;
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-xl-4">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">공지사항</h5>
|
||||
<div class="table-responsive">
|
||||
<table class="mb-0 table">
|
||||
<colgroup>
|
||||
<col width="10%" />
|
||||
<col width="60%" />
|
||||
<col width="30%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>순번</th>
|
||||
<th>제목</th>
|
||||
<th>등록일자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($notice as $key => $n): ?>
|
||||
<tr onclick="location.href='board/notice/detail/<?= $n['bbs_sq'] ?>'">
|
||||
<th scope="row"><?= ($key + 1) ?></th>
|
||||
<td><?= $n["subject"] ?></td>
|
||||
<td class="text-center"><?= $n["update_tm"] ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-xl-4">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">검수지연내역(녹취필요)</h5>
|
||||
<div class="table-responsive">
|
||||
<table class="mb-0 table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>접수일자</th>
|
||||
<th>촬영일자</th>
|
||||
<th>경과일</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$nRow = 1;
|
||||
foreach ($statistics['status2'] as $row):
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row"> <?= substr($row['rcpt_tm'], 0, 10) ?></th>
|
||||
<td class="text-center"><?= substr($row['photo_save_dt'], 0, 10) ?></td>
|
||||
<td class="text-center"><?= $row['elapsed_dt'] ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$nRow++;
|
||||
endforeach;
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-xl-4">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">검수지연내역(홍보확인서)</h5>
|
||||
<div class="table-responsive">
|
||||
<table class="mb-0 table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>접수일자</th>
|
||||
<th>촬영일자</th>
|
||||
<th>경과일</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$nRow = 1;
|
||||
foreach ($statistics['status3'] as $row):
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row"> <?= substr($row['rcpt_tm'], 0, 10) ?></th>
|
||||
<td class="text-center"><?= substr($row['photo_save_dt'], 0, 10) ?></td>
|
||||
<td class="text-center"><?= $row['elapsed_dt'] ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$nRow++;
|
||||
endforeach;
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@@ -1,5 +1,203 @@
|
||||
<?php
|
||||
<!doctype html>
|
||||
<html lang="ko">
|
||||
|
||||
echo 'login';
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-Language" content="ko">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>컨펌스 로그인</title>
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no" />
|
||||
<meta name="description" content="ArchitectUI HTML Bootstrap 5 Dashboard Template">
|
||||
|
||||
<script defer src="/architectui/assets/scripts/vendors.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/main.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/demo.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/ladda.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/blockui.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/circle_progress.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/count_up.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/toastr.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/sweet_alerts.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/scrollbar.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/sticky_elements.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/carousel_slider.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/fullcalendar.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/treeview.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/maps.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/rating.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/image_crop.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/guided_tours.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/tables.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/form_validation.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/form_wizard.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/clipboard.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/datepicker.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/input_mask.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/input_select.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/range_slider.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/textarea_autosize.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/toggle_switch.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/chart_js.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/apex_charts.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/sparklines.98288b227c064e6a107f.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<link href="/architectui/assets/styles/vendors.98288b227c064e6a107f.css" rel="stylesheet">
|
||||
<link href="/architectui/assets/styles/main.98288b227c064e6a107f.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="my-loader-template d-none">
|
||||
<div class="loader bg-transparent no-shadow p-0">
|
||||
<div class="ball-grid-pulse">
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="app-container app-theme-white body-tabs-shadow">
|
||||
<div class="app-container">
|
||||
<div class="h-100 bg-plum-plate bg-animation">
|
||||
<div class="d-flex h-100 justify-content-center align-items-center py-4">
|
||||
<div class="mx-auto col-sm-10 col-md-8 col-lg-6 col-xl-5">
|
||||
<div class="card border-0"
|
||||
style="border-radius: 24px; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);">
|
||||
<div class="card-body p-5">
|
||||
<div class="text-center mb-5">
|
||||
<div class="app-logo mx-auto mb-4"></div>
|
||||
<h1 class="fw-bold text-dark mb-2" style="font-size: 2rem;">Welcome Back!</h1>
|
||||
<p class="text-muted fs-5 mb-0">Sign in to your account to continue</p>
|
||||
</div>
|
||||
|
||||
<form class="" id="frm_login_info">
|
||||
<div class="form-floating mb-4">
|
||||
<input name="user_id" id="user_id" placeholder="아이디 입력" type="text"
|
||||
class="form-control form-control-lg border-0 shadow-sm"
|
||||
style="border-radius: 16px; background: rgba(248, 250, 252, 0.8); height: 58px;">
|
||||
<label for="user_id" class="text-muted">
|
||||
<i class="fa fa-user me-2 text-primary"></i>
|
||||
아이디
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-floating mb-4">
|
||||
<input name="user_pw" id="user_pw" placeholder="비밀번호 입력" type="password"
|
||||
class="form-control form-control-lg border-0 shadow-sm"
|
||||
style="border-radius: 16px; background: rgba(248, 250, 252, 0.8); height: 58px;">
|
||||
<label for="user_pw" class="text-muted">
|
||||
<i class="fa fa-lock me-2 text-primary"></i>
|
||||
비밀번호
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div class="form-check">
|
||||
<input name="check" id="exampleCheck" type="checkbox"
|
||||
class="form-check-input" style="transform: scale(1.2);">
|
||||
<label for="exampleCheck"
|
||||
class="form-check-label text-muted fw-medium">아이디저장</label>
|
||||
</div>
|
||||
<a href="javascript:void(0);"
|
||||
class="text-primary text-decoration-none fw-semibold">
|
||||
팩스 수신 확인
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<button type="button"
|
||||
class="btn btn-gradient-primary btn-shadow btn-lg w-100 mb-4 fw-semibold text-white"
|
||||
id="btn_login" style="border-radius: 16px; height: 58px; font-size: 1.1rem;">
|
||||
<i class="fa fa-sign-in-alt me-2"></i>로그인
|
||||
</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center mt-4">
|
||||
<p class="text-white mb-0"
|
||||
style="font-size: 0.9rem; text-shadow: 0 1px 2px rgba(0,0,0,0.1);">
|
||||
Copyright © Confirms
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
const tpl = document.querySelector('.my-loader-template');
|
||||
|
||||
$(function () {
|
||||
|
||||
console.log('login page loaded')
|
||||
|
||||
|
||||
$("#btn_login").on("click", function () {
|
||||
|
||||
$.ajax({
|
||||
url: '/login/chkLogin',
|
||||
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
method: 'POST',
|
||||
data: $("#frm_login_info").serialize(),
|
||||
beforeSend: function () {
|
||||
|
||||
blockUI.blockPage({
|
||||
message: tpl
|
||||
})
|
||||
},
|
||||
complete: function () {
|
||||
blockUI.unblockPage()
|
||||
},
|
||||
error: function (xhr, error, thrown) {
|
||||
blockUI.unblockPage()
|
||||
console.log(xhr.responseText);
|
||||
},
|
||||
success: function (result) {
|
||||
if (result.code === "0") {
|
||||
location.href = '/'
|
||||
} else {
|
||||
var errors = result.errors
|
||||
|
||||
if (errors != null) {
|
||||
|
||||
var msg = ""
|
||||
msg += errors.user_id != null ? errors.user_id : ""
|
||||
msg += errors.user_pw != null ? "\n" + errors.user_pw : ""
|
||||
|
||||
Swal.fire({
|
||||
title: msg,
|
||||
icon: "error",
|
||||
draggable: true
|
||||
})
|
||||
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: result.msg,
|
||||
icon: "error",
|
||||
draggable: true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
559
app/Views/pages/manage/dept/lists.php
Normal file
559
app/Views/pages/manage/dept/lists.php
Normal file
@@ -0,0 +1,559 @@
|
||||
<?= $this->extend('layouts/main') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<style>
|
||||
th {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#deptList tbody tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.blockUI {
|
||||
z-index: 1500 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h1>조직 관리</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-xl-12">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<form class="row align-items-end" id="frm_srch_info" onsubmit="return false;">
|
||||
|
||||
<div class="col-md-1">
|
||||
<label class="form-label mb-1">조직구분</label>
|
||||
<select class="form-control" name="srchDepth">
|
||||
<option value="">선택</option>
|
||||
<option value="1">본부</option>
|
||||
<option value="2">팀</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label class="form-label mb-1">조직명칭</label>
|
||||
<input type="text" class="form-control" name="srcDeptNm">
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label class="form-label mb-1">총괄팀장</label>
|
||||
<input type="text" class="form-control" name="srcDeptHead">
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<label class="form-label mb-1">사용여부</label>
|
||||
<select class="form-control" name="useYn">
|
||||
<option value="">선택</option>
|
||||
<option value="Y">사용</option>
|
||||
<option value="N">미사용</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- 검색 버튼 -->
|
||||
<div class="col-md-1 d-grid">
|
||||
<button type="button" class="btn btn-primary" id="btnSearch">
|
||||
검색
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12 col-xl-12">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-header">조직 관리</div>
|
||||
<div class="card-body">
|
||||
<table id="deptList" class="table table-hover table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>순번</th>
|
||||
<th>상위조직</th>
|
||||
<th>조직명칭</th>
|
||||
<th>부서장</th>
|
||||
<th>사용여부</th>
|
||||
<th>조직유형</th>
|
||||
<th>등록일자</th>
|
||||
<th>등록자</th>
|
||||
<th>수정일자</th>
|
||||
<th>수정자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- 여기는 비워둠: AJAX로 채움 -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="button" class="btn btn-primary" id="addUser">
|
||||
등록
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->section('modals') ?>
|
||||
<div class="modal fade" id="deptModal" tabindex="-1" aria-labelledby="deptModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="deptModalLabel">조직정보</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="frm_dept_info" class="needs-validation" onsubmit="return false;" novalidate>
|
||||
<input type="hidden" name="dept_sq" />
|
||||
<input type="hidden" name="pdept_sq" />
|
||||
<input type="hidden" name="type" value="create" />
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">조직구분</label>
|
||||
<select class="form-control" name="addDepth" id="addDepth" required>
|
||||
<option value="">선택</option>
|
||||
<option value="1">본부</option>
|
||||
<option value="2">팀</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">상위조직</label>
|
||||
<select class="form-control" name="addPdept" id="addPdept" required>
|
||||
<option value="">선택</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">조직명칭</label>
|
||||
<input type="text" class="form-control" name="addDeptNm" id="addDeptNm" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label class="form-label">총괄팀장</label>
|
||||
|
||||
<div class="row g-2">
|
||||
<div class="col-md-5">
|
||||
<input type="text" class="form-control" name="addDeptHeadNm" id="addDeptHeadNm"
|
||||
readonly required>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<input type="text" class="form-control" name="addDeptHead" id="addDeptHead"
|
||||
readonly required>
|
||||
</div>
|
||||
<div class="col-md-2 d-grid">
|
||||
<button type="button" class="btn btn-info w-100"
|
||||
onclick="fUsrDupIdChk();">찾기</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">사용여부</label>
|
||||
<select class="form-control" name="addUseYn" id="addUseYn" required>
|
||||
<option value="">선택</option>
|
||||
<option value="Y" selected>사용</option>
|
||||
<option value="N">미사용</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label">부서설명</label>
|
||||
<input type="text" class="form-control" name="addDeptDesc" id="addDeptDesc">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
||||
<button type="button" class="btn btn-primary" id="deptSave">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css" />
|
||||
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
|
||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
const tpl = document.querySelector('.my-loader-template');
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
$("#srchBonbu").on("change", function (e) {
|
||||
|
||||
var dept_sq = e.target.value
|
||||
|
||||
$("#srchTeam").empty()
|
||||
|
||||
var str = "<option value=''>선택</option>"
|
||||
if (teamArr != null) {
|
||||
|
||||
for (var i = 0; i < teamArr.length; i++) {
|
||||
if (dept_sq === teamArr[i].pdept_sq) {
|
||||
str += "<option value='" + teamArr[i].dept_sq + "'>" + teamArr[i].dept_nm + "</option>"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$("#srchTeam").append(str)
|
||||
|
||||
});
|
||||
|
||||
|
||||
let table = $('#deptList').DataTable({
|
||||
language: lang_kor,
|
||||
processing: true,
|
||||
serverSide: false,
|
||||
ajax: {
|
||||
url: '/manage/dept/getDeptList',
|
||||
type: 'GET',
|
||||
data: function (d) {
|
||||
d.srchDepth = $("#frm_srch_info [name=srchDepth]").val()
|
||||
d.srcDeptNm = $("#frm_srch_info [name=srcDeptNm]").val()
|
||||
d.srcDeptHead = $("#frm_srch_info [name=srcDeptHead]").val()
|
||||
d.useYn = $("#frm_srch_info [name=useYn]").val()
|
||||
|
||||
d.srchType = $("#frm_srch_info [name=srchType]").val()
|
||||
d.srchTxt = $("#frm_srch_info [name=srchTxt]").val()
|
||||
|
||||
d.start = d.start || 0
|
||||
d.length = d.length || 10
|
||||
}
|
||||
},
|
||||
"columnDefs": [
|
||||
{ 'targets': '_all', "defaultContent": "" },
|
||||
// { 'className': 'text-center', 'targets': [0, 2, 3, 4] },
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
"data": null,
|
||||
"width": "50px",
|
||||
"render": function (data, type, row, meta) {
|
||||
return meta.row + meta.settings._iDisplayStart + 1;
|
||||
}
|
||||
},
|
||||
{ data: 'pdept_nm' },
|
||||
{ data: 'dept_nm' },
|
||||
{ data: 'dept_head_nm' },
|
||||
{ data: 'use_yn_nm' },
|
||||
{ data: 'depth_nm' },
|
||||
{ data: 'insert_tm' },
|
||||
{ data: 'insert_usr' },
|
||||
{ data: 'update_tm' },
|
||||
{ data: 'update_usr' },
|
||||
],
|
||||
// 옵션들 예시
|
||||
paging: true,
|
||||
searching: false,
|
||||
ordering: false,
|
||||
serverSide: true,
|
||||
});
|
||||
|
||||
|
||||
$('#deptList tbody').on('click', 'tr', function () {
|
||||
const row = table.row(this).data()
|
||||
if (!row) return
|
||||
|
||||
const modalEl = document.getElementById('deptModal');
|
||||
const myModal = new bootstrap.Modal(modalEl);
|
||||
|
||||
$("#frm_dept_info")[0].reset()
|
||||
|
||||
$("#frm_dept_info [name=dept_sq]").val(row.dept_sq)
|
||||
$("#frm_dept_info [name=pdept_sq]").val(row.pdept_sq)
|
||||
$("#frm_dept_info [name=type]").val("update")
|
||||
$("#frm_dept_info [name=addDeptNm]").val(row.dept_nm)
|
||||
$("#frm_dept_info [name=addDeptHeadNm]").val(row.dept_head_nm)
|
||||
$("#frm_dept_info [name=addDeptHead]").val(row.dept_head)
|
||||
$("#frm_dept_info [name=addUseYn]").val(row.use_yn)
|
||||
$("#frm_dept_info [name=addDeptDesc]").val(row.dept_desc)
|
||||
|
||||
|
||||
var pdept_sq = row.pdept_sq
|
||||
$("#frm_dept_info [name=addDepth]").val(pdept_sq)
|
||||
|
||||
|
||||
|
||||
var str = "";
|
||||
str += "<option value=''>선택</option>"
|
||||
|
||||
if (pdept_sq === "1") {
|
||||
str += "<option value='1' selected>컨펌스</option>"
|
||||
|
||||
$("#addPdept").empty()
|
||||
$("#addPdept").append(str)
|
||||
} else if (pdept_sq === "2") {
|
||||
|
||||
$.ajax({
|
||||
url: '/manage/dept/getPdept',
|
||||
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
method: 'GET',
|
||||
data: $("#frm_dept_info").serialize(),
|
||||
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) {
|
||||
const data = result.data;
|
||||
|
||||
if (data.length > 0) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (pdept_sq === data[i].dept_sq) {
|
||||
str += "<option value='" + data[i].dept_sq + "' selected>" + data[i].dept_nm + "</option>";
|
||||
} else {
|
||||
str += "<option value='" + data[i].dept_sq + "'>" + data[i].dept_nm + "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$("#addPdept").empty()
|
||||
$("#addPdept").append(str)
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
myModal.show();
|
||||
|
||||
});
|
||||
|
||||
// [검색] 버튼 눌렀을 때 다시 조회
|
||||
$('#btnSearch').on('click', function () {
|
||||
table.ajax.reload()
|
||||
});
|
||||
|
||||
|
||||
// 상위조직 검색 - onchange
|
||||
$("#addDepth").on("change", function (e) {
|
||||
|
||||
var val = e.target.value
|
||||
|
||||
var str = "";
|
||||
str += "<option value=''>선택</option>"
|
||||
|
||||
if (val === "1") {
|
||||
str += "<option value='1'>컨펌스</option>"
|
||||
|
||||
$("#addPdept").empty()
|
||||
$("#addPdept").append(str)
|
||||
} else {
|
||||
|
||||
$.ajax({
|
||||
url: '/manage/dept/getPdept',
|
||||
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
method: 'GET',
|
||||
data: $("#frm_dept_info").serialize(),
|
||||
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) {
|
||||
const data = result.data;
|
||||
|
||||
if (data.length > 0) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
str += "<option value='" + data[i].dept_sq + "'>" + data[i].dept_nm + "</option>";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$("#addPdept").empty()
|
||||
$("#addPdept").append(str)
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// 유저 등록 모달
|
||||
$("#addUser").on("click", function () {
|
||||
$("#frm_dept_info")[0].reset()
|
||||
|
||||
$("#frm_dept_info [name=dept_sq]").val("")
|
||||
$("#frm_dept_info [name=pdept_sq]").val("")
|
||||
$("#frm_dept_info [name=type]").val("create")
|
||||
$("#frm_dept_info [name=addUserId]").prop("readonly", false)
|
||||
|
||||
const modalEl = document.getElementById('deptModal');
|
||||
const myModal = new bootstrap.Modal(modalEl);
|
||||
myModal.show();
|
||||
});
|
||||
|
||||
|
||||
// 유저정보저장
|
||||
$("#deptSave").on("click", function () {
|
||||
|
||||
const form = document.getElementById('frm_dept_info');
|
||||
const type = $("#frm_dept_info [name=type]").val();
|
||||
|
||||
let isValid = true;
|
||||
|
||||
// Bootstrap5 기본 validation 적용
|
||||
if (!form.checkValidity()) {
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
if (!isValid) {
|
||||
form.classList.add('was-validated');
|
||||
return;
|
||||
}
|
||||
|
||||
if ($("#frm_dept_info [name=addDeptHeadNm]").val() == "" || $("#frm_dept_info [name=addDeptHead]").val() == "") {
|
||||
Swal.fire({
|
||||
title: "총괄팀장 정보 누락",
|
||||
icon: "error"
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
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/dept/saveDept',
|
||||
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
method: 'POST',
|
||||
data: $("#frm_dept_info").serialize(),
|
||||
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') {
|
||||
deptModalHide()
|
||||
$("#btnSearch").trigger('click')
|
||||
Swal.fire({
|
||||
title: '정상 처리되었습니다.',
|
||||
icon: "success"
|
||||
|
||||
})
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: result.msg,
|
||||
icon: "error"
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
// 총괄팀장 찾기
|
||||
function fUsrDupIdChk() {
|
||||
// var paramstr = $("#paramstr").val();
|
||||
window.open('/manage/dept/getchkuser', 'get', 'width=600,height=800');
|
||||
}
|
||||
|
||||
// 응답 유저 정보 입력
|
||||
function setSelectedUser(id, name, usrSq) {
|
||||
$("#frm_dept_info [name=addDeptHeadNm]").val(name);
|
||||
$("#frm_dept_info [name=addDeptHead]").val(usrSq);
|
||||
}
|
||||
|
||||
|
||||
function deptModalHide() {
|
||||
const modalEl = document.getElementById('deptModal');
|
||||
const modal = bootstrap.Modal.getInstance(modalEl); // 기존 인스턴스 가져오기
|
||||
|
||||
if (modal) {
|
||||
modal.hide();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
159
app/Views/pages/manage/dept/users.php
Normal file
159
app/Views/pages/manage/dept/users.php
Normal file
@@ -0,0 +1,159 @@
|
||||
<!doctype html>
|
||||
<html lang="ko">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-Language" content="ko">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>총괄팀장 찾기</title>
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no" />
|
||||
<meta name="description" content="ArchitectUI HTML Bootstrap 5 Dashboard Template">
|
||||
|
||||
<script defer src="/architectui/assets/scripts/vendors.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/main.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/demo.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/ladda.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/blockui.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/circle_progress.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/count_up.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/toastr.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/sweet_alerts.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/scrollbar.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/sticky_elements.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/carousel_slider.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/fullcalendar.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/treeview.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/maps.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/rating.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/image_crop.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/guided_tours.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/tables.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/form_validation.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/form_wizard.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/clipboard.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/datepicker.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/input_mask.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/input_select.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/range_slider.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/textarea_autosize.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/toggle_switch.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/chart_js.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/apex_charts.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/sparklines.98288b227c064e6a107f.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<link href="/architectui/assets/styles/vendors.98288b227c064e6a107f.css" rel="stylesheet">
|
||||
<link href="/architectui/assets/styles/main.98288b227c064e6a107f.css" rel="stylesheet">
|
||||
<style>
|
||||
#userList tbody tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="my-loader-template d-none">
|
||||
<div class="loader bg-transparent no-shadow p-0">
|
||||
<div class="ball-grid-pulse">
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="app-container app-theme-white body-tabs-shadow">
|
||||
<div class="app-container">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-header">사용자 목록</div>
|
||||
<div class="card-body">
|
||||
<table id="userList" class="table table-hover table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>순번</th>
|
||||
<th>아이디</th>
|
||||
<th>이름</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="button" class="btn btn-primary" id="addUser">
|
||||
등록
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css" />
|
||||
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
|
||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
const tpl = document.querySelector('.my-loader-template');
|
||||
|
||||
$(function () {
|
||||
let table = $('#userList').DataTable({
|
||||
language: lang_kor,
|
||||
processing: true,
|
||||
ajax: {
|
||||
url: '/manage/dept/getUserList',
|
||||
type: 'GET',
|
||||
data: function (d) {
|
||||
d.start = d.start || 0
|
||||
d.length = d.length || 10
|
||||
}
|
||||
},
|
||||
"columnDefs": [
|
||||
{ 'targets': '_all', "defaultContent": "" },
|
||||
{ 'className': 'text-center', 'targets': [0, 1, 2] },
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
"data": null,
|
||||
"width": "50px",
|
||||
"render": function (data, type, row, meta) {
|
||||
return meta.row + meta.settings._iDisplayStart + 1;
|
||||
}
|
||||
},
|
||||
{ data: 'usr_id' },
|
||||
{ data: 'usr_nm' },
|
||||
],
|
||||
// 옵션들 예시
|
||||
paging: true,
|
||||
searching: false,
|
||||
ordering: false,
|
||||
serverSide: true,
|
||||
});
|
||||
|
||||
|
||||
$('#userList tbody').on('click', 'tr', function () {
|
||||
const row = table.row(this).data()
|
||||
if (!row) return
|
||||
|
||||
if (window.opener && !window.opener.closed) {
|
||||
const id = row.usr_id
|
||||
const name = row.usr_nm
|
||||
const usrSq = row.usr_sq
|
||||
|
||||
window.opener.setSelectedUser(id, name, usrSq)
|
||||
}
|
||||
|
||||
window.close()
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
164
app/Views/pages/manage/log/lists.php
Normal file
164
app/Views/pages/manage/log/lists.php
Normal file
@@ -0,0 +1,164 @@
|
||||
<?= $this->extend('layouts/main') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<style>
|
||||
th {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#logList tbody tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.blockUI {
|
||||
z-index: 1500 !important;
|
||||
}
|
||||
|
||||
.ellipsis {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 180px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h1>조직 관리</h1>
|
||||
|
||||
<div class="col-md-12 col-xl-12">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-header">조직 관리</div>
|
||||
<div class="card-body">
|
||||
<table id="logList" class="table table-hover table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>순번</th>
|
||||
<th>아이디</th>
|
||||
<th>사용자명</th>
|
||||
<th>입력아이디</th>
|
||||
<th>사유</th>
|
||||
<th>아이피</th>
|
||||
<th>사용자 에이전트</th>
|
||||
<th>일시</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- 여기는 비워둠: AJAX로 채움 -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button class="mb-2 me-2 border-0 btn-transition btn btn-shadow btn-outline-success"
|
||||
id="excel-download">엑셀다운로드</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css" />
|
||||
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
|
||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
const tpl = document.querySelector('.my-loader-template')
|
||||
let date = new Date()
|
||||
|
||||
$(function () {
|
||||
|
||||
let table = $('#logList').DataTable({
|
||||
language: lang_kor,
|
||||
processing: true,
|
||||
serverSide: false,
|
||||
ajax: {
|
||||
url: '/manage/loginlog/getLogList',
|
||||
type: 'GET',
|
||||
data: function (d) {
|
||||
d.start = d.start || 0
|
||||
d.length = d.length || 10
|
||||
}
|
||||
},
|
||||
"columnDefs": [
|
||||
{ 'targets': '_all', "defaultContent": "" },
|
||||
{ 'className': 'text-center', 'targets': [0, 1, 2, 3, 4, 5, 7] },
|
||||
{ targets: 6, className: "ellipsis" }
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
"data": null,
|
||||
"width": "50px",
|
||||
"render": function (data, type, row, meta) {
|
||||
return meta.row + meta.settings._iDisplayStart + 1;
|
||||
}
|
||||
},
|
||||
{ data: 'usr_id_in' },
|
||||
{ data: 'usr_nm' },
|
||||
{ data: 'usr_id_in' },
|
||||
{ data: 'reason' },
|
||||
{ data: 'ip' },
|
||||
{ data: 'useragent' },
|
||||
{ data: 'regdate' },
|
||||
],
|
||||
// 옵션들 예시
|
||||
paging: true,
|
||||
searching: true,
|
||||
ordering: false,
|
||||
serverSide: true,
|
||||
});
|
||||
|
||||
|
||||
// 엑셀 다운로드 click
|
||||
$("#excel-download").on("click", function () {
|
||||
$.ajax({
|
||||
url: "/manage/loginlog/excel",
|
||||
method: "GET",
|
||||
dataType: "json",
|
||||
data: $("#frm_srch_info").serialize(),
|
||||
success: function (result) {
|
||||
downloadExcel(result.data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// 엑셀 다운로드
|
||||
function downloadExcel(data) {
|
||||
const ws = XLSX.utils.json_to_sheet(data);
|
||||
ws['!cols'] = [
|
||||
{ wpx: 80 },
|
||||
{ wpx: 80 },
|
||||
{ wpx: 100 },
|
||||
{ wpx: 100 },
|
||||
{ wpx: 120 },
|
||||
{ wpx: 120 }
|
||||
];
|
||||
|
||||
const wb = XLSX.utils.book_new();
|
||||
XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
|
||||
|
||||
const wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'array' });
|
||||
|
||||
const blob = new Blob([wbout], { type: 'application/octet-stream' });
|
||||
|
||||
const link = document.createElement("a");
|
||||
link.href = URL.createObjectURL(blob);
|
||||
link.download = "로그인이력조회" + getDateTimeString() + ".xlsx";
|
||||
link.click();
|
||||
URL.revokeObjectURL(link.href);
|
||||
}
|
||||
|
||||
|
||||
function getDateTimeString() {
|
||||
const d = new Date();
|
||||
const yyyy = d.getFullYear();
|
||||
const mm = String(d.getMonth() + 1).padStart(2, '0');
|
||||
const dd = String(d.getDate()).padStart(2, '0');
|
||||
const hh = String(d.getHours()).padStart(2, '0');
|
||||
const mi = String(d.getMinutes()).padStart(2, '0');
|
||||
const ss = String(d.getSeconds()).padStart(2, '0');
|
||||
return `${yyyy}${mm}${dd}${hh}${mi}${ss}`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
133
app/Views/pages/manage/menu/lists.php
Normal file
133
app/Views/pages/manage/menu/lists.php
Normal file
@@ -0,0 +1,133 @@
|
||||
<?= $this->extend('layouts/main') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<style>
|
||||
th {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#logList tbody tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.blockUI {
|
||||
z-index: 1500 !important;
|
||||
}
|
||||
|
||||
.ellipsis {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 180px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h1>메뉴 관리</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-xl-7">
|
||||
<div class="main-card mb-3 card">
|
||||
<!-- <div class="card-header">조직 관리</div> -->
|
||||
<div class="card-body">
|
||||
<table id="menuList" class="table table-hover table-striped table-bordered"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5 col-xl-5">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-header">메뉴 정보</div>
|
||||
<div class="card-body">
|
||||
<form action="frm_menu_info" onsubmit="return false;">
|
||||
<div class="form-group">
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- The jqGrid language file code-->
|
||||
<script type="text/javascript" src="//cdn.jsdelivr.net/jqgrid/4.6.0/i18n/grid.locale-kr.js">
|
||||
</script>
|
||||
<!-- The atual jqGrid code -->
|
||||
<script type="text/javascript" src="//cdn.jsdelivr.net/jqgrid/4.6.0/jquery.jqGrid.src.js">
|
||||
</script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/themes/redmond/jquery-ui.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/free-jqgrid/4.15.5/css/ui.jqgrid.min.css">
|
||||
<script type="text/javascript">
|
||||
|
||||
const tpl = document.querySelector('.my-loader-template')
|
||||
let date = new Date()
|
||||
|
||||
$(function () {
|
||||
|
||||
$("#menuList").jqGrid({
|
||||
url: "/manage/menu/getMenuList",
|
||||
datatype: "json",
|
||||
mtype: "POST",
|
||||
height: 480,
|
||||
rowNum: 10000,
|
||||
autowidth: true,
|
||||
width: "auto",
|
||||
shrinkToFit: true,
|
||||
treeGrid: true,
|
||||
treedatatype: "json",
|
||||
gridview: true,
|
||||
sortorder: "desc",
|
||||
ExpandColumn: 'mnu_nm',
|
||||
expanded: true,
|
||||
viewrecords: true,
|
||||
scrollrows: true,
|
||||
treeGridModel: 'adjacency',
|
||||
colNames: ['메뉴명', '메뉴ID', '메뉴유형코드', '메뉴유형', 'URL', '정렬순서'],
|
||||
colModel: [
|
||||
{ name: 'mnu_nm', index: 'mnu_nm', width: 150 },
|
||||
{ name: 'mnu_id', index: 'mnu_id', width: 80 },
|
||||
{ name: 'menu_tp', index: 'menu_tp', width: 50, hidden: true },
|
||||
{ name: 'menu_tp_nm', index: 'menu_tp_nm', width: 100, align: "center" },
|
||||
{ name: 'mnu_url', index: 'mnu_url', width: 200 },
|
||||
{ name: 'view_odr', index: 'view_odr', width: 50, align: "center" }
|
||||
],
|
||||
|
||||
jsonReader: {
|
||||
// root: "rows", // 🔹 지금 JSON 구조: { total: "...", rows: [ ... ] }
|
||||
repeatitems: false,
|
||||
id: "mnu_id"
|
||||
},
|
||||
|
||||
treeReader: {
|
||||
parent_id_field: "mnu_pid", // 🔴 부모 필드 지정 (중요)
|
||||
level_field: "level", // 이미 JSON에 들어있음
|
||||
left_field: "lft",
|
||||
right_field: "rgt",
|
||||
leaf_field: "isLeaf", // true / false (boolean 권장)
|
||||
expanded_field: "expanded", // ROOT(M) 에만 true 있으면 됨
|
||||
icon_field: "iconCls"
|
||||
},
|
||||
|
||||
|
||||
sortname: "mnu_id",
|
||||
sortorder: "asc",
|
||||
|
||||
loadComplete: function () {
|
||||
$("#menuList")
|
||||
.jqGrid('setGridParam', { datatype: 'local' })
|
||||
.trigger("reloadGrid");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
431
app/Views/pages/manage/phone/lists.php
Normal file
431
app/Views/pages/manage/phone/lists.php
Normal file
@@ -0,0 +1,431 @@
|
||||
<?= $this->extend('layouts/main') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<style>
|
||||
th {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#phoneList tbody tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.blockUI {
|
||||
z-index: 1500 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h1>전화확인 관리</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-xl-12">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<form class="row align-items-end" id="frm_srch_info" onsubmit="return false;">
|
||||
|
||||
<div class="col-md-1">
|
||||
<label class="form-label mb-1">매체사</label>
|
||||
<select class="form-control" name="cpid">
|
||||
<option value="">선택</option>
|
||||
<?php foreach ($code as $c): ?>
|
||||
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label class="form-label mb-1">등록기간</label>
|
||||
<div class="row g-2">
|
||||
<div class="col-5">
|
||||
<input type="date" class="form-control" name="s_date">
|
||||
</div>
|
||||
<div class="col-1" style="text-align: center;line-height: 35px;">
|
||||
-
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<input type="date" class="form-control" name="e_date">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label class="form-label mb-1">연락처</label>
|
||||
<input type="text" class="form-control" name="phone_number">
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<label class="form-label mb-1">사용여부</label>
|
||||
<select class="form-control" name="useYn">
|
||||
<option value="">선택</option>
|
||||
<option value="Y">사용</option>
|
||||
<option value="N">미사용</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- 검색 버튼 -->
|
||||
<div class="col-md-1 d-grid">
|
||||
<button type="button" class="btn btn-primary" id="btnSearch">
|
||||
검색
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12 col-xl-12">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-header">조직 관리</div>
|
||||
<div class="card-body">
|
||||
<table id="phoneList" class="table table-hover table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>연락처</th>
|
||||
<th>등록일자</th>
|
||||
<th>만료일자</th>
|
||||
<th>매체사</th>
|
||||
<th>주소</th>
|
||||
<th>소유자</th>
|
||||
<th>신청인</th>
|
||||
<th>관계</th>
|
||||
<th>사용유무</th>
|
||||
<th>메모</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- 여기는 비워둠: AJAX로 채움 -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="button" class="btn btn-primary" id="addPhone">
|
||||
등록
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->section('modals') ?>
|
||||
<div class="modal fade" id="deptModal" tabindex="-1" aria-labelledby="deptModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="deptModalLabel">연락처 정보</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="frm_phone_info" class="needs-validation" onsubmit="return false;" novalidate>
|
||||
<input type="hidden" name="type" value="create">
|
||||
<!-- 1 row -->
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">연락처</label>
|
||||
<input type="text" name="phone_number" id="phone_number" placeholder="(-)을 포함해 주세요"
|
||||
class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">매체사</label>
|
||||
<select name="cpid" id="cpid" class="form-select" required>
|
||||
<option value="">-전체-</option>
|
||||
<?php foreach ($code as $c): ?>
|
||||
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">사용유무</label>
|
||||
<select name="use_yn" id="use_yn" class="form-select">
|
||||
<option value="Y" selected>사용</option>
|
||||
<option value="N">미사용</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 2 row -->
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">소유주</label>
|
||||
<input type="text" name="owner" id="owner" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">신청인</label>
|
||||
<input type="text" name="applicant" id="applicant" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">관계</label>
|
||||
<input type="text" name="relation" id="relation" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 3 row -->
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">주소</label>
|
||||
<input type="text" name="address" id="address" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">등록기간</label>
|
||||
<div class="row g-2">
|
||||
<div class="col-5">
|
||||
<input type="date" class="form-control" name="s_date" required>
|
||||
</div>
|
||||
<div class="col-1" style="text-align: center;line-height: 35px;">
|
||||
-
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<input type="date" class="form-control" name="e_date" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 4 row -->
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
<label class="form-label">메모</label>
|
||||
<textarea name="memo" id="memo" class="form-control" rows="2"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
||||
<button type="button" class="btn btn-primary" id="phoneSave">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css" />
|
||||
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
|
||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
const tpl = document.querySelector('.my-loader-template');
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
$("#srchBonbu").on("change", function (e) {
|
||||
|
||||
var dept_sq = e.target.value
|
||||
|
||||
$("#srchTeam").empty()
|
||||
|
||||
var str = "<option value=''>선택</option>"
|
||||
if (teamArr != null) {
|
||||
|
||||
for (var i = 0; i < teamArr.length; i++) {
|
||||
if (dept_sq === teamArr[i].pdept_sq) {
|
||||
str += "<option value='" + teamArr[i].dept_sq + "'>" + teamArr[i].dept_nm + "</option>"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$("#srchTeam").append(str)
|
||||
|
||||
});
|
||||
|
||||
|
||||
let table = $('#phoneList').DataTable({
|
||||
language: lang_kor,
|
||||
processing: true,
|
||||
serverSide: false,
|
||||
ajax: {
|
||||
url: '/manage/dupl_phone/getDuplPhoneList',
|
||||
type: 'GET',
|
||||
data: function (d) {
|
||||
d.srchDepth = $("#frm_srch_info [name=srchDepth]").val()
|
||||
d.srcDeptNm = $("#frm_srch_info [name=srcDeptNm]").val()
|
||||
d.srcDeptHead = $("#frm_srch_info [name=srcDeptHead]").val()
|
||||
d.useYn = $("#frm_srch_info [name=useYn]").val()
|
||||
|
||||
d.srchType = $("#frm_srch_info [name=srchType]").val()
|
||||
d.srchTxt = $("#frm_srch_info [name=srchTxt]").val()
|
||||
|
||||
d.start = d.start || 0
|
||||
d.length = d.length || 10
|
||||
}
|
||||
},
|
||||
"columnDefs": [
|
||||
{ 'targets': '_all', "defaultContent": "" },
|
||||
// { 'className': 'text-center', 'targets': [0, 2, 3, 4] },
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
"data": null,
|
||||
"width": "50px",
|
||||
"render": function (data, type, row, meta) {
|
||||
return meta.row + meta.settings._iDisplayStart + 1;
|
||||
}
|
||||
},
|
||||
{ data: 'phone_number' },
|
||||
{ data: 's_date' },
|
||||
{ data: 'e_date' },
|
||||
{ data: 'cpid_nm' },
|
||||
{ data: 'address' },
|
||||
{ data: 'owner' },
|
||||
{ data: 'applicant' },
|
||||
{ data: 'relation' },
|
||||
{ data: 'use_yn_nm' },
|
||||
{ data: 'memo', "width": "200px" },
|
||||
],
|
||||
// 옵션들 예시
|
||||
paging: true,
|
||||
searching: false,
|
||||
ordering: false,
|
||||
serverSide: true,
|
||||
});
|
||||
|
||||
|
||||
$('#phoneList tbody').on('click', 'tr', function () {
|
||||
const row = table.row(this).data()
|
||||
if (!row) return
|
||||
|
||||
const modalEl = document.getElementById('deptModal');
|
||||
const myModal = new bootstrap.Modal(modalEl);
|
||||
|
||||
$("#frm_phone_info")[0].reset()
|
||||
$("#frm_phone_info [name=type]").val("update")
|
||||
|
||||
$("#frm_phone_info [name=phone_number]").val(row.phone_number)
|
||||
$("#frm_phone_info [name=phone_number]").prop("readonly", true)
|
||||
$("#frm_phone_info [name=cpid]").val(row.cpid)
|
||||
$("#frm_phone_info [name=use_yn]").val(row.use_yn)
|
||||
$("#frm_phone_info [name=owner]").val(row.owner)
|
||||
$("#frm_phone_info [name=applicant]").val(row.applicant)
|
||||
$("#frm_phone_info [name=relation]").val(row.relation)
|
||||
$("#frm_phone_info [name=address]").val(row.address)
|
||||
$("#frm_phone_info [name=s_date]").val(row.s_date)
|
||||
$("#frm_phone_info [name=e_date]").val(row.e_date)
|
||||
$("#frm_phone_info [name=memo]").val(row.memo)
|
||||
|
||||
|
||||
myModal.show();
|
||||
|
||||
});
|
||||
|
||||
// [검색] 버튼 눌렀을 때 다시 조회
|
||||
$('#btnSearch').on('click', function () {
|
||||
table.ajax.reload()
|
||||
});
|
||||
|
||||
// 유저 등록 모달
|
||||
$("#addPhone").on("click", function () {
|
||||
$("#frm_phone_info")[0].reset()
|
||||
|
||||
$("#frm_phone_info [name=type]").val("create")
|
||||
$("#frm_phone_info [name=phone_number]").prop("readonly", false)
|
||||
|
||||
const modalEl = document.getElementById('deptModal');
|
||||
const myModal = new bootstrap.Modal(modalEl);
|
||||
myModal.show();
|
||||
});
|
||||
|
||||
|
||||
// 유저정보저장
|
||||
$("#phoneSave").on("click", function () {
|
||||
|
||||
const form = document.getElementById('frm_phone_info');
|
||||
|
||||
let isValid = true;
|
||||
|
||||
// Bootstrap5 기본 validation 적용
|
||||
if (!form.checkValidity()) {
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
if (!isValid) {
|
||||
form.classList.add('was-validated');
|
||||
return;
|
||||
}
|
||||
|
||||
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/dupl_phone/savePhone',
|
||||
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
method: 'POST',
|
||||
data: $("#frm_phone_info").serialize(),
|
||||
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') {
|
||||
deptModalHide()
|
||||
$("#btnSearch").trigger('click')
|
||||
Swal.fire({
|
||||
title: '정상 처리되었습니다.',
|
||||
icon: "success"
|
||||
|
||||
})
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: result.msg,
|
||||
icon: "error"
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
function deptModalHide() {
|
||||
const modalEl = document.getElementById('deptModal');
|
||||
const modal = bootstrap.Modal.getInstance(modalEl); // 기존 인스턴스 가져오기
|
||||
|
||||
if (modal) {
|
||||
modal.hide();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
658
app/Views/pages/manage/user/lists.php
Normal file
658
app/Views/pages/manage/user/lists.php
Normal file
@@ -0,0 +1,658 @@
|
||||
<?= $this->extend('layouts/main') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<style>
|
||||
th {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#userList tbody tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.blockUI {
|
||||
z-index: 1500 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h1>사용자 관리</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-xl-12">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
<form class="row align-items-end" id="frm_srch_info" onsubmit="return false;">
|
||||
|
||||
<!-- 등급 -->
|
||||
<div class="col-md-1">
|
||||
<label class="form-label mb-1">등급</label>
|
||||
<select class="form-control" name="srchLevel">
|
||||
<option value="">선택</option>
|
||||
<?php foreach ($userLevel as $level): ?>
|
||||
<option value="<?= $level['cd'] ?>"><?= $level['cd_nm'] ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- 소속본부 / 소속팀 -->
|
||||
<div class="col-md-3">
|
||||
<label class="form-label mb-1">소속본부 / 소속팀</label>
|
||||
<div class="row g-2">
|
||||
<div class="col-6">
|
||||
<select class="form-control" name="srchBonbu" id="srchBonbu">
|
||||
<option value="">선택</option>
|
||||
<?php foreach ($bonbuList as $bonbu): ?>
|
||||
<option value="<?= $bonbu['dept_sq'] ?>"><?= $bonbu['dept_nm'] ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<select class="form-control" name="srchTeam" id="srchTeam">
|
||||
<option value="">선택</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<label class="form-label mb-1">사용여부</label>
|
||||
<select class="form-control" name="useYn">
|
||||
<option value="">선택</option>
|
||||
<option value="Y">사용</option>
|
||||
<option value="N">미사용</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- 검색유형 -->
|
||||
<div class="col-md-1">
|
||||
<label class="form-label mb-1">검색유형</label>
|
||||
<select class="form-control" name="srchType">
|
||||
<option value="">선택</option>
|
||||
<option value="1">사용자명</option>
|
||||
<option value="2">사원번호</option>
|
||||
<option value="3">직급</option>
|
||||
<option value="4">연락처</option>
|
||||
<option value="5">주소</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label class="form-label mb-1">검색어</label>
|
||||
<input type="text" class="form-control" name="srchTxt" placeholder="검색어 입력">
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 검색 버튼 -->
|
||||
<div class="col-md-1 d-grid">
|
||||
<button type="button" class="btn btn-primary" id="btnSearch">
|
||||
검색
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- 엑셀 버튼 -->
|
||||
<div class="col-md-2">
|
||||
<button type="button" class="btn btn-outline-success" id="btnExcel">
|
||||
<i class="fa fas fa-file-excel-o"></i> 엑셀 다운로드
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12 col-xl-12">
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-header">사용자 관리</div>
|
||||
<div class="card-body">
|
||||
<table id="userList" class="table table-hover table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>순번</th>
|
||||
<th>소속본부</th>
|
||||
<th>소속팀</th>
|
||||
<th>사원번호</th>
|
||||
<th>사용자명</th>
|
||||
<th>등급</th>
|
||||
<th>직급</th>
|
||||
<th>연락처</th>
|
||||
<th>SMS인증여부</th>
|
||||
<th>사용여부</th>
|
||||
<th>비밀번호변경일시</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- 여기는 비워둠: AJAX로 채움 -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="button" class="btn btn-primary" id="addUser">
|
||||
등록
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->section('modals') ?>
|
||||
<div class="modal fade" id="userModal" tabindex="-1" aria-labelledby="userModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="userModalLabel">사용자정보</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="frm_user_info" class="needs-validation" onsubmit="return false;" novalidate>
|
||||
<input type="hidden" name="usr_sq" />
|
||||
<input type="hidden" name="type" value="create" />
|
||||
<div class="row">
|
||||
|
||||
<!-- 이름 -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">이름</label>
|
||||
<input type="text" class="form-control" name="addUserNm" id="addUserNm" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 소속조직 -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">소속조직</label>
|
||||
<select class="form-control" name="addUserDept" id="addUserDept" required>
|
||||
<option value="">선택</option>
|
||||
<?php foreach ($deptCode as $dept): ?>
|
||||
<option value="<?= $dept['dept_sq'] ?>"><?= $dept['dept_nm'] ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 사원번호 -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">사원번호</label>
|
||||
<input type="text" class="form-control" name="addUserId" id="addUserId" readonly
|
||||
required>
|
||||
<small id="idDupText" class="text-danger"></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 비밀번호 -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">비밀번호</label>
|
||||
<input type="password" class="form-control" name="addUserPswd" id="addUserPswd">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 등급 -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">등급</label>
|
||||
<select class="form-control" name="addUserLevel" id="addUserLevel" required>
|
||||
<option value="">선택</option>
|
||||
<?php foreach ($userLevel as $level): ?>
|
||||
<option value="<?= $level['cd'] ?>"><?= $level['cd_nm'] ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 직급 -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">직급</label>
|
||||
<input type="text" class="form-control" name="addUserPosition" id="addUserPosition"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 연락처 -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">연락처</label>
|
||||
<input type="text" class="form-control" name="addUserTel1" id="addUserTel1" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 연락처2 -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">연락처2</label>
|
||||
<input type="text" class="form-control" name="addUserTel2" id="addUserTel2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SMS 여부 -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">SMS 인증여부</label>
|
||||
<select class="form-control" name="addSmsYn" id="addSmsYn">
|
||||
<option value="Y">예</option>
|
||||
<option value="N" selected>아니요</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 주소 -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">주소</label>
|
||||
<input type="text" class="form-control" name="addUserAddr1" id="addUserAddr1">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 상세주소 -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">상세주소</label>
|
||||
<input type="text" class="form-control" name="addUserAddr2" id="addUserAddr2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 사용여부 -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label">사용여부</label>
|
||||
<select class="form-control" name="addUseYn" id="addUseYn">
|
||||
<option value="Y" selected>예</option>
|
||||
<option value="N">아니요</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
||||
<button type="button" class="btn btn-danger" id="userRemove">삭제</button>
|
||||
<button type="button" class="btn btn-primary" id="userSave">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css" />
|
||||
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
|
||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
const tpl = document.querySelector('.my-loader-template');
|
||||
var teamArr = <?= json_encode($teamList, JSON_UNESCAPED_UNICODE); ?>;
|
||||
|
||||
let date = new Date();
|
||||
|
||||
$(function () {
|
||||
|
||||
$("#srchBonbu").on("change", function (e) {
|
||||
|
||||
var dept_sq = e.target.value
|
||||
|
||||
$("#srchTeam").empty()
|
||||
|
||||
var str = "<option value=''>선택</option>"
|
||||
if (teamArr != null) {
|
||||
|
||||
for (var i = 0; i < teamArr.length; i++) {
|
||||
if (dept_sq === teamArr[i].pdept_sq) {
|
||||
str += "<option value='" + teamArr[i].dept_sq + "'>" + teamArr[i].dept_nm + "</option>"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(str)
|
||||
|
||||
$("#srchTeam").append(str)
|
||||
|
||||
});
|
||||
|
||||
|
||||
let table = $('#userList').DataTable({
|
||||
language: lang_kor,
|
||||
processing: true,
|
||||
serverSide: false,
|
||||
ajax: {
|
||||
url: '/manage/user/getUserList',
|
||||
type: 'GET',
|
||||
data: function (d) {
|
||||
d.srchLevel = $("#frm_srch_info [name=srchLevel]").val()
|
||||
d.srchBonbu = $("#frm_srch_info [name=srchBonbu]").val()
|
||||
d.srchTeam = $("#frm_srch_info [name=srchTeam]").val()
|
||||
d.useYn = $("#frm_srch_info [name=useYn]").val()
|
||||
|
||||
d.srchType = $("#frm_srch_info [name=srchType]").val()
|
||||
d.srchTxt = $("#frm_srch_info [name=srchTxt]").val()
|
||||
|
||||
d.start = d.start || 0
|
||||
d.length = d.length || 10
|
||||
}
|
||||
},
|
||||
"columnDefs": [
|
||||
{ 'targets': '_all', "defaultContent": "" },
|
||||
// { 'className': 'text-center', 'targets': [0, 2, 3, 4] },
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
"data": null,
|
||||
"width": "50px",
|
||||
"render": function (data, type, row, meta) {
|
||||
return meta.row + meta.settings._iDisplayStart + 1;
|
||||
}
|
||||
},
|
||||
{ data: 'pdept_nm' },
|
||||
{ data: 'dept_nm' },
|
||||
{ data: 'usr_id' },
|
||||
{ data: 'usr_nm' },
|
||||
{ data: 'level_nm' },
|
||||
{ data: 'usr_position' },
|
||||
|
||||
{ data: 'usr_tel1' },
|
||||
{ data: 'sms_auth_yn_nm' },
|
||||
{ data: 'use_yn_nm' },
|
||||
{ data: 'last_usr_pw_tm' },
|
||||
],
|
||||
// 옵션들 예시
|
||||
paging: true,
|
||||
searching: false,
|
||||
ordering: false,
|
||||
serverSide: true,
|
||||
});
|
||||
|
||||
|
||||
$('#userList tbody').on('click', 'tr', function () {
|
||||
const row = table.row(this).data()
|
||||
if (!row) return
|
||||
|
||||
const modalEl = document.getElementById('userModal');
|
||||
const myModal = new bootstrap.Modal(modalEl);
|
||||
|
||||
$("#frm_user_info")[0].reset()
|
||||
|
||||
$("#frm_user_info [name=usr_sq]").val(row.usr_sq)
|
||||
$("#frm_user_info [name=type]").val("update")
|
||||
|
||||
$("#frm_user_info [name=addUserNm]").val(row.usr_nm)
|
||||
$("#frm_user_info [name=addUserDept]").val(row.dept_sq)
|
||||
$("#frm_user_info [name=addUserId]").val(row.usr_id)
|
||||
$("#frm_user_info [name=addUserId]").prop("readonly", true)
|
||||
|
||||
$("#frm_user_info [name=addUserLevel]").val(row.usr_level)
|
||||
$("#frm_user_info [name=addUserPosition]").val(row.usr_position)
|
||||
$("#frm_user_info [name=addUserTel1]").val(row.usr_tel1)
|
||||
$("#frm_user_info [name=addUserTel2]").val(row.usr_tel2)
|
||||
$("#frm_user_info [name=addSmsYn]").val(row.sms_auth_yn)
|
||||
$("#frm_user_info [name=addUserAddr1]").val(row.usr_addr1)
|
||||
$("#frm_user_info [name=addUserAddr2]").val(row.usr_addr2)
|
||||
$("#frm_user_info [name=addUseYn]").val(row.use_yn)
|
||||
|
||||
myModal.show();
|
||||
|
||||
});
|
||||
|
||||
// [검색] 버튼 눌렀을 때 다시 조회
|
||||
$('#btnSearch').on('click', function () {
|
||||
table.ajax.reload()
|
||||
});
|
||||
|
||||
|
||||
// 유저 등록 모달
|
||||
$("#addUser").on("click", function () {
|
||||
$("#frm_user_info")[0].reset()
|
||||
|
||||
$("#frm_user_info [name=usr_sq]").val("")
|
||||
$("#frm_user_info [name=type]").val("create")
|
||||
$("#frm_user_info [name=addUserId]").prop("readonly", false)
|
||||
|
||||
const modalEl = document.getElementById('userModal');
|
||||
const myModal = new bootstrap.Modal(modalEl);
|
||||
myModal.show();
|
||||
});
|
||||
|
||||
|
||||
// 유저정보저장
|
||||
$("#userSave").on("click", function () {
|
||||
|
||||
const form = document.getElementById('frm_user_info');
|
||||
const type = $("#frm_user_info [name=type]").val();
|
||||
|
||||
let isValid = true;
|
||||
|
||||
if (type === 'create') {
|
||||
if ($("#frm_user_info [name=addUserPswd]").val() == "") {
|
||||
Swal.fire({
|
||||
title: "비밀번호를 입력하세요",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
})
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Bootstrap5 기본 validation 적용
|
||||
if (!form.checkValidity()) {
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
if (!isValid) {
|
||||
form.classList.add('was-validated');
|
||||
return;
|
||||
}
|
||||
|
||||
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/save',
|
||||
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
method: 'POST',
|
||||
data: $("#frm_user_info").serialize(),
|
||||
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"
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
// 유저정보삭제
|
||||
$("#userRemove").on("click", function () {
|
||||
|
||||
if ($("#frm_user_info [name=usr_sq]").val() == "") {
|
||||
Swal.fire({
|
||||
title: "유저를 선택해 주세요.",
|
||||
icon: "warning"
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
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/remove',
|
||||
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
method: 'POST',
|
||||
data: $("#frm_user_info").serialize(),
|
||||
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"
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
// 엑셀다운 click
|
||||
$("#btnExcel").on("click", function () {
|
||||
|
||||
console.log('excel start')
|
||||
|
||||
$.ajax({
|
||||
url: "/manage/user/excel",
|
||||
method: "GET",
|
||||
dataType: "json",
|
||||
data: $("#frm_srch_info").serialize(),
|
||||
success: function (result) {
|
||||
downloadExcel(result.data);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
function userModalHide() {
|
||||
const modalEl = document.getElementById('userModal');
|
||||
const modal = bootstrap.Modal.getInstance(modalEl); // 기존 인스턴스 가져오기
|
||||
|
||||
if (modal) {
|
||||
modal.hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 엑셀 다운로드
|
||||
function downloadExcel(data) {
|
||||
const ws = XLSX.utils.json_to_sheet(data);
|
||||
ws['!cols'] = [
|
||||
{ wpx: 80 },
|
||||
{ wpx: 80 },
|
||||
{ wpx: 80 },
|
||||
{ wpx: 80 },
|
||||
{ wpx: 80 },
|
||||
{ wpx: 80 },
|
||||
{ wpx: 80 },
|
||||
{ wpx: 130 },
|
||||
{ wpx: 80 },
|
||||
];
|
||||
|
||||
const wb = XLSX.utils.book_new();
|
||||
XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
|
||||
|
||||
const wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'array' });
|
||||
|
||||
const blob = new Blob([wbout], { type: 'application/octet-stream' });
|
||||
|
||||
const link = document.createElement("a");
|
||||
link.href = URL.createObjectURL(blob);
|
||||
link.download = "사용자현황" + getDateTimeString() + ".xlsx";
|
||||
link.click();
|
||||
URL.revokeObjectURL(link.href);
|
||||
}
|
||||
|
||||
function getDateTimeString() {
|
||||
const d = new Date();
|
||||
const yyyy = d.getFullYear();
|
||||
const mm = String(d.getMonth() + 1).padStart(2, '0');
|
||||
const dd = String(d.getDate()).padStart(2, '0');
|
||||
const hh = String(d.getHours()).padStart(2, '0');
|
||||
const mi = String(d.getMinutes()).padStart(2, '0');
|
||||
const ss = String(d.getSeconds()).padStart(2, '0');
|
||||
return `${yyyy}${mm}${dd}${hh}${mi}${ss}`;
|
||||
}
|
||||
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
Reference in New Issue
Block a user