실적관리 추가
This commit is contained in:
@@ -26,7 +26,7 @@ class Database extends Config
|
|||||||
*/
|
*/
|
||||||
public array $default = [
|
public array $default = [
|
||||||
'DSN' => '',
|
'DSN' => '',
|
||||||
'hostname' => '192.168.10.246',
|
'hostname' => '192.168.10.243',
|
||||||
'username' => 'confirms',
|
'username' => 'confirms',
|
||||||
'password' => 'zjsvjatm',
|
'password' => 'zjsvjatm',
|
||||||
'database' => 'db_confirms',
|
'database' => 'db_confirms',
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ $routes->get('/logout', 'Login::out');
|
|||||||
$routes->get('/', 'Home\Home::dashboard');
|
$routes->get('/', 'Home\Home::dashboard');
|
||||||
$routes->get('/home', 'Home\Home::dashboard');
|
$routes->get('/home', 'Home\Home::dashboard');
|
||||||
|
|
||||||
|
$routes->get('/home/viewStatData', to: 'Home\Home::viewStatData'); // 실적조회
|
||||||
|
$routes->get('/home/getHomeFaxCount', to: 'Home\Home::getHomeFaxCount'); // 팩스조회
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 게시판 (board) 그룹
|
* 게시판 (board) 그룹
|
||||||
@@ -39,6 +43,101 @@ $routes->group('board', ['namespace' => 'App\Controllers\Board'], function ($rou
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 실적관리 (results) 그룹
|
||||||
|
*/
|
||||||
|
$routes->group('results', ['namespace' => 'App\Controllers\Results'], function ($routes) {
|
||||||
|
/** 화면 */
|
||||||
|
$routes->match(['get', 'post'], 'summary/stats_s01', 'Summary::lists'); // 현장확인요약실적
|
||||||
|
$routes->match(['get', 'post'], 'dept/stats_d01', 'Dept::lists'); // 현장확인요약실적
|
||||||
|
$routes->match(['get', 'post'], 'person/stats_p01', 'Person::lists'); // 현장확인개인별실적
|
||||||
|
$routes->match(['get', 'post'], 'assign/stats_a01', 'Assign::lists'); // 현장확인인원별배정현황
|
||||||
|
$routes->match(['get', 'post'], 'm409/m409a/stats', 'M409::stats'); // 확인매물일별실적
|
||||||
|
|
||||||
|
|
||||||
|
/** API - 현장확인조직별실적 */
|
||||||
|
$routes->get('dept/excel', 'Sms::excel');
|
||||||
|
|
||||||
|
/** API - 현장확인개인별실적 */
|
||||||
|
$routes->get('person/getUserList', 'Person::getUserList');
|
||||||
|
$routes->get('person/excel', 'Person::excel');
|
||||||
|
|
||||||
|
/** API - 현장확인인원별배정현황 */
|
||||||
|
$routes->get('assign/getUserList', 'Assign::getUserList');
|
||||||
|
$routes->get('assign/excel', 'Assign::excel');
|
||||||
|
|
||||||
|
/** API - 확인매물일별실적 */
|
||||||
|
});
|
||||||
|
|
||||||
|
$routes->group('', ['namespace' => 'App\Controllers\Results'], static function ($routes) {
|
||||||
|
|
||||||
|
// 확인매물일별실적
|
||||||
|
$routes->group('m409', static function ($routes) {
|
||||||
|
$routes->match(['get', 'post'], 'm409a/stats', 'M409::stats');
|
||||||
|
|
||||||
|
// API
|
||||||
|
$routes->get('m409a/getResultList', 'M409::getResultList');
|
||||||
|
$routes->get('m409a/excel', 'M409::excel');
|
||||||
|
});
|
||||||
|
|
||||||
|
// 확인매물개인별실적
|
||||||
|
$routes->group('m410', static function ($routes) {
|
||||||
|
$routes->match(['get', 'post'], 'm410a/stats', 'M410::stats');
|
||||||
|
|
||||||
|
// API
|
||||||
|
$routes->get('m410a/getResultList', 'M410::getResultList');
|
||||||
|
$routes->get('m410a/excel', 'M410::excel');
|
||||||
|
});
|
||||||
|
|
||||||
|
// 확인매물매체사실적
|
||||||
|
$routes->group('m411', static function ($routes) {
|
||||||
|
$routes->match(['get', 'post'], 'm411a/stats', 'M411::stats');
|
||||||
|
|
||||||
|
// API
|
||||||
|
$routes->get('m411a/getResultList', 'M411::getResultList');
|
||||||
|
$routes->get('m411a/excel', 'M411::excel');
|
||||||
|
});
|
||||||
|
|
||||||
|
// 확인매물일자별실적
|
||||||
|
$routes->group('m412', static function ($routes) {
|
||||||
|
$routes->match(['get', 'post'], 'm412a/stats', 'M412::stats');
|
||||||
|
|
||||||
|
// API
|
||||||
|
$routes->get('m412a/getResultList', 'M412::getResultList');
|
||||||
|
$routes->get('m412a/excel', 'M412::excel');
|
||||||
|
$routes->post('m412a/saveSendType', 'M412::saveSendType');
|
||||||
|
});
|
||||||
|
|
||||||
|
// 검증소요시간
|
||||||
|
$routes->group('m415', static function ($routes) {
|
||||||
|
$routes->match(['get', 'post'], 'm415a/stats', 'M415::stats');
|
||||||
|
|
||||||
|
// API
|
||||||
|
$routes->get('m415a/getResultList', 'M415::getResultList');
|
||||||
|
$routes->get('m415a/excel', 'M415::excel');
|
||||||
|
});
|
||||||
|
|
||||||
|
// 개인별이동거리
|
||||||
|
$routes->group('m416', static function ($routes) {
|
||||||
|
$routes->match(['get', 'post'], 'm416a/stats', 'M416::stats');
|
||||||
|
|
||||||
|
// API
|
||||||
|
$routes->get('m416a/getResultList', 'M416::getResultList');
|
||||||
|
$routes->get('m416a/excel', 'M416::excel');
|
||||||
|
});
|
||||||
|
|
||||||
|
// 신규매물실적관리
|
||||||
|
$routes->group('m417', static function ($routes) {
|
||||||
|
$routes->match(['get', 'post'], 'm417a/stats', 'M417::stats');
|
||||||
|
|
||||||
|
// API
|
||||||
|
$routes->get('m417a/getResultList', 'M417::getResultList');
|
||||||
|
$routes->get('m417a/excel', 'M417::excel');
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 시스템관리 (manage) 그룹
|
* 시스템관리 (manage) 그룹
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -7,10 +7,12 @@ use CodeIgniter\Controller;
|
|||||||
|
|
||||||
abstract class BaseController extends Controller
|
abstract class BaseController extends Controller
|
||||||
{
|
{
|
||||||
|
protected $helpers = ['array', 'function'];
|
||||||
|
|
||||||
protected $session;
|
protected $session;
|
||||||
protected $data = [];
|
protected $data = [];
|
||||||
|
|
||||||
|
|
||||||
public function initController($request, $response, $logger)
|
public function initController($request, $response, $logger)
|
||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
|
|||||||
@@ -39,4 +39,25 @@ class Home extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 실적조회
|
||||||
|
public function viewStatData()
|
||||||
|
{
|
||||||
|
$params = [
|
||||||
|
's_date' => $this->request->getGet('s_date'),
|
||||||
|
'usr_sq' => session('usr_sq'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$data = $this->homeModel->viewStatData($params);
|
||||||
|
|
||||||
|
return $this->response->setJSON($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 팩스건수 조회
|
||||||
|
public function getHomeFaxCount()
|
||||||
|
{
|
||||||
|
|
||||||
|
$data = $this->homeModel->getHomeFaxCount();
|
||||||
|
|
||||||
|
return $this->response->setJSON($data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
82
app/Controllers/results/Assign.php
Normal file
82
app/Controllers/results/Assign.php
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers\results;
|
||||||
|
|
||||||
|
use App\Controllers\BaseController;
|
||||||
|
use App\Models\results\AssignModel;
|
||||||
|
|
||||||
|
class Assign extends BaseController
|
||||||
|
{
|
||||||
|
private $assignModel;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->assignModel = new AssignModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function lists(): string
|
||||||
|
{
|
||||||
|
$bonbu = $this->assignModel->getBonbuList();
|
||||||
|
$team = $this->assignModel->getTeamList();
|
||||||
|
$sido = $this->assignModel->getAreaList();
|
||||||
|
|
||||||
|
|
||||||
|
return view("pages/results/assign/stats_a01", [
|
||||||
|
'bonbu' => $bonbu,
|
||||||
|
'team' => $team,
|
||||||
|
'sido' => $sido,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUserList()
|
||||||
|
{
|
||||||
|
$start = (int) $this->request->getGet('start') ?: 0;
|
||||||
|
$end = (int) $this->request->getGet('length') ?: 10;
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'bonbu' => $this->request->getGet('bonbu'),
|
||||||
|
'team' => $this->request->getGet('team'),
|
||||||
|
'schDateGb' => $this->request->getGet('schDateGb'),
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
'srchType' => $this->request->getGet('srchType'),
|
||||||
|
'srchTxt' => $this->request->getGet('srchTxt'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$totalCount = $this->assignModel->getTotalCount($data);
|
||||||
|
|
||||||
|
|
||||||
|
$datas = $this->assignModel->getUserList($start, $end, $data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'recordsTotal' => $totalCount,
|
||||||
|
'recordsFiltered' => $totalCount,
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function excel()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'bonbu' => $this->request->getGet('bonbu'),
|
||||||
|
'team' => $this->request->getGet('team'),
|
||||||
|
'schDateGb' => $this->request->getGet('schDateGb'),
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
'srchType' => $this->request->getGet('srchType'),
|
||||||
|
'srchTxt' => $this->request->getGet('srchTxt'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$datas = $this->assignModel->getExcelUserList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$e->getPrevious()->getTraceAsString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
98
app/Controllers/results/Dept.php
Normal file
98
app/Controllers/results/Dept.php
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers\results;
|
||||||
|
|
||||||
|
use App\Controllers\BaseController;
|
||||||
|
use App\Models\results\DeptModel;
|
||||||
|
|
||||||
|
class Dept extends BaseController
|
||||||
|
{
|
||||||
|
private $deptModel;
|
||||||
|
private $schDateGb = ''; // 일자구분
|
||||||
|
private $sdate = ''; // 시작일자
|
||||||
|
private $edate = ''; // 종료일자
|
||||||
|
|
||||||
|
private $bonbu = ''; // 본부
|
||||||
|
private $dept_sq = ''; // 팀
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->deptModel = new DeptModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function lists(): string
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
$this->schDateGb = $this->request->getPost('schDateGb') ?? '1';
|
||||||
|
|
||||||
|
$this->sdate = $this->request->getPost('sdate');
|
||||||
|
if (empty($this->sdate)) {
|
||||||
|
$this->sdate = date('Y-m-01'); // 이번달 1일
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->edate = $this->request->getPost('edate');
|
||||||
|
if (empty($this->edate)) {
|
||||||
|
$this->edate = date('Y-m-t'); // 이번달 말일
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->bonbu = $this->request->getPost('bonbu');
|
||||||
|
if (empty($this->bonbu)) {
|
||||||
|
$this->bonbu = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->dept_sq = $this->request->getPost('dept_sq');
|
||||||
|
if (empty($this->dept_sq)) {
|
||||||
|
$this->dept_sq = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'schDateGb' => $this->schDateGb,
|
||||||
|
'sdate' => $this->sdate,
|
||||||
|
'edate' => $this->edate,
|
||||||
|
'bonbu' => $this->bonbu,
|
||||||
|
'dept_sq' => $this->dept_sq,
|
||||||
|
];
|
||||||
|
|
||||||
|
$bonbu = $this->deptModel->getBonbuList();
|
||||||
|
$team = $this->deptModel->getTeamList();
|
||||||
|
|
||||||
|
$res = $this->deptModel->st_d01($data);
|
||||||
|
|
||||||
|
return view("pages/results/dept/stats_d01", [
|
||||||
|
'pBonbu' => $this->bonbu,
|
||||||
|
'pDeptSq' => $this->dept_sq,
|
||||||
|
'schDateGb' => $this->schDateGb,
|
||||||
|
'sdate' => $this->sdate,
|
||||||
|
'edate' => $this->edate,
|
||||||
|
'bonbu' => $bonbu,
|
||||||
|
'team' => $team,
|
||||||
|
'st_list' => $res,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function excel()
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'schDateGb' => $this->request->getGet('schDateGb'),
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
'bonbu' => $this->request->getGet('bonbu'),
|
||||||
|
'dept_sq' => $this->request->getGet('dept_sq'),
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
$res = $this->deptModel->getExcelList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'data' => $res,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
75
app/Controllers/results/M409.php
Normal file
75
app/Controllers/results/M409.php
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers\results;
|
||||||
|
|
||||||
|
use App\Controllers\BaseController;
|
||||||
|
use App\Models\results\M409Model;
|
||||||
|
|
||||||
|
class M409 extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
private $model;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->model = new M409Model();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stats(): string
|
||||||
|
{
|
||||||
|
$codes = $this->model->getCodeList(['VRFCREQ_WAY', 'CP_ID']);
|
||||||
|
|
||||||
|
$CODE_VRFCREQ_WAY = convertArrayToHashTable($codes['VRFCREQ_WAY'], 'cd', 'cd_nm', []);
|
||||||
|
$CODE_CP_ID = convertArrayToHashTable($codes['CP_ID'], 'cd', 'cd_nm', []);
|
||||||
|
|
||||||
|
return view("pages/results/m409/stats", [
|
||||||
|
'code_vrfcreq_way' => $CODE_VRFCREQ_WAY,
|
||||||
|
'code_cp_id' => $CODE_CP_ID,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResultList()
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'),
|
||||||
|
'cp_id' => $this->request->getGet('cp_id'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$totalCount = $this->model->getTotalCount($data);
|
||||||
|
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'recordsTotal' => $totalCount,
|
||||||
|
'recordsFiltered' => $totalCount,
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function excel()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'),
|
||||||
|
'cp_id' => $this->request->getGet('cp_id'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$datas = $this->model->getExcelList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$e->getPrevious()->getTraceAsString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
74
app/Controllers/results/M410.php
Normal file
74
app/Controllers/results/M410.php
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers\results;
|
||||||
|
|
||||||
|
use App\Controllers\BaseController;
|
||||||
|
use App\Models\results\M410Model;
|
||||||
|
|
||||||
|
class M410 extends BaseController
|
||||||
|
{
|
||||||
|
private $model;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->model = new M410Model();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stats(): string
|
||||||
|
{
|
||||||
|
$codes = $this->model->getCodeList(['VRFCREQ_WAY', 'CP_ID']);
|
||||||
|
|
||||||
|
$CODE_VRFCREQ_WAY = convertArrayToHashTable($codes['VRFCREQ_WAY'], 'cd', 'cd_nm', []);
|
||||||
|
$CODE_CP_ID = convertArrayToHashTable($codes['CP_ID'], 'cd', 'cd_nm', []);
|
||||||
|
$department = $this->model->getDepart();
|
||||||
|
|
||||||
|
return view("pages/results/m410/stats", [
|
||||||
|
'code_vrfcreq_way' => $CODE_VRFCREQ_WAY,
|
||||||
|
'code_cp_id' => $CODE_CP_ID,
|
||||||
|
'department' => $department,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResultList()
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
'dept_sq' => $this->request->getGet('dept_sq'),
|
||||||
|
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$totalCount = $this->model->getTotalCount($data);
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'recordsTotal' => $totalCount,
|
||||||
|
'recordsFiltered' => $totalCount,
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function excel()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
'dept_sq' => $this->request->getGet('dept_sq'),
|
||||||
|
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$e->getPrevious()->getTraceAsString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
62
app/Controllers/results/M411.php
Normal file
62
app/Controllers/results/M411.php
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers\results;
|
||||||
|
|
||||||
|
use App\Controllers\BaseController;
|
||||||
|
use App\Models\results\M411Model;
|
||||||
|
|
||||||
|
class M411 extends BaseController
|
||||||
|
{
|
||||||
|
private $model;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->model = new M411Model();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stats(): string
|
||||||
|
{
|
||||||
|
return view("pages/results/m411/stats", [
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResultList()
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$totalCount = $this->model->getTotalCount($data);
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'recordsTotal' => $totalCount,
|
||||||
|
'recordsFiltered' => $totalCount,
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function excel()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$e->getPrevious()->getTraceAsString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
233
app/Controllers/results/M412.php
Normal file
233
app/Controllers/results/M412.php
Normal file
@@ -0,0 +1,233 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers\results;
|
||||||
|
|
||||||
|
use App\Controllers\BaseController;
|
||||||
|
use App\Models\common\SmsModel;
|
||||||
|
use App\Models\results\M412Model;
|
||||||
|
|
||||||
|
|
||||||
|
class M412 extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
private $model;
|
||||||
|
private $smsModel;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->model = new M412Model();
|
||||||
|
$this->smsModel = new SmsModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function stats(): string
|
||||||
|
{
|
||||||
|
$sendH = $this->model->get_send_yn('H');
|
||||||
|
$sendD = $this->model->get_send_yn('D');
|
||||||
|
$sendT = $this->model->get_send_yn('T');
|
||||||
|
$sendN = $this->model->get_send_yn('N');
|
||||||
|
$sendJ = $this->model->get_send_yn('J');
|
||||||
|
$sendO = $this->model->get_send_yn('O');
|
||||||
|
|
||||||
|
return view("pages/results/m412/stats", [
|
||||||
|
'sendH' => $sendH,
|
||||||
|
'sendD' => $sendD,
|
||||||
|
'sendT' => $sendT,
|
||||||
|
'sendN' => $sendN,
|
||||||
|
'sendJ' => $sendJ,
|
||||||
|
'sendO' => $sendO,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResultList()
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$totalCount = $this->model->getTotalCount($data);
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'recordsTotal' => $totalCount,
|
||||||
|
'recordsFiltered' => $totalCount,
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 타입별 전송 on/off 저장
|
||||||
|
public function saveSendType()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$usr_nm = session('usr_nm');
|
||||||
|
$client_ip = getRealClientIp();
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'type' => $this->request->getPost('type'),
|
||||||
|
'yn' => $this->request->getPost('yn'),
|
||||||
|
'usr_sq' => session('usr_sq'),
|
||||||
|
];
|
||||||
|
|
||||||
|
// INSERT v2_stop_api_chg_stat
|
||||||
|
$this->model->saveSendType($data);
|
||||||
|
|
||||||
|
$send_sms_member = [
|
||||||
|
["name" => '김인', "tel" => '010-4010-8318'],
|
||||||
|
["name" => "이민호", "tel" => '010-6743-3112'],
|
||||||
|
["name" => "이권희", "tel" => '010-4706-3638'],
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
$send_h_yn = $this->model->get_send_yn('H');//가장 마지막의 홍보확인서 전송여부
|
||||||
|
$send_t_yn = $this->model->get_send_yn('T'); //가장 마지막의 전화확인 전송여부
|
||||||
|
$send_d_yn = $this->model->get_send_yn('D');//가장 마지막의 등기부등본 전송여부
|
||||||
|
$send_n_yn = $this->model->get_send_yn('N'); //가장 마지막의 전화확인 전송여부
|
||||||
|
$send_j_yn = $this->model->get_send_yn('J');//가장 마지막의 전화확인 전송여부
|
||||||
|
$send_o_yn = $this->model->get_send_yn('O'); //가장 마지막의 모바일확인 V2 전송여부
|
||||||
|
|
||||||
|
|
||||||
|
foreach ($send_sms_member as $member):
|
||||||
|
|
||||||
|
$dest_phone = $member['tel'];
|
||||||
|
$dest_name = $member['name'];
|
||||||
|
$send_phone = '1600-5749';
|
||||||
|
$send_name = 'SYSTEM';
|
||||||
|
$subject = '매물 전송 확인 -' . date("Y-m-d H:i:s");
|
||||||
|
|
||||||
|
$msg_body = '[' . date("Y-m-d H:i:s") . ']' . $usr_nm . "(" . $client_ip . ")" . '매물 전송 확인' . PHP_EOL
|
||||||
|
. '홍보확인서:' . $send_h_yn . PHP_EOL
|
||||||
|
. '전화확인:' . $send_t_yn . PHP_EOL
|
||||||
|
. '등기부등본:' . $send_d_yn . PHP_EOL
|
||||||
|
. '신홍보확인서:' . $send_n_yn . PHP_EOL
|
||||||
|
. '공동중개매물:' . $send_j_yn . PHP_EOL
|
||||||
|
. '모바일확인 V2:' . $send_o_yn;
|
||||||
|
|
||||||
|
|
||||||
|
$msg_length = strlen(iconv('UTF-8', 'EUCKR', $msg_body));
|
||||||
|
$msg_type = 0;
|
||||||
|
if ($msg_length > 80 && $msg_type == 0) {
|
||||||
|
$msg_type = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
$memo = $msg_body;
|
||||||
|
|
||||||
|
// 문자 발송
|
||||||
|
// $this->smsModel->sendSms($dest_phone, $dest_name, $send_phone, $send_name, $subject, $msg_body, $msg_type, $memo);
|
||||||
|
|
||||||
|
endforeach;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 전화확인완료 처리
|
||||||
|
public function saveSendComplete()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$data = [
|
||||||
|
'sdate' => $this->request->getPost('sdate'),
|
||||||
|
'edate' => $this->request->getPost('edate'),
|
||||||
|
'stat_cd' => 35,
|
||||||
|
];
|
||||||
|
|
||||||
|
$lists = $this->model->getLists($data);
|
||||||
|
|
||||||
|
if (empty($lists)) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'status' => 'error',
|
||||||
|
'msg' => '데이터 누락'
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
foreach ($lists as $row):
|
||||||
|
$usr_sq = session('usr_sq');
|
||||||
|
$stat_cd = 60;
|
||||||
|
$vr_sq = $row['vr_sq'];
|
||||||
|
$fax_sq = $row['fax_sq'];
|
||||||
|
$toDay = date('Y-m-d H:i:s');
|
||||||
|
$atcl_no = $row['atcl_no'];
|
||||||
|
$vrfc_type = $row['vrfc_type'];
|
||||||
|
$cpid = $row['cpid'];
|
||||||
|
|
||||||
|
// INSERT INTO v2_chg_stat
|
||||||
|
$result_query8 = $this->model->chgStat($vr_sq, '60', $usr_sq, $toDay);
|
||||||
|
|
||||||
|
// UPDATE v2_vrfc_req
|
||||||
|
$chgVrfc60 = $this->model->chgStatVrfc($vr_sq, '60'); //v2_vrfc_req INSERT
|
||||||
|
|
||||||
|
// UPDATE fax_imgs
|
||||||
|
$statFaxUp60 = $this->model->chgStatFax($vr_sq, '60'); //fax_imgs
|
||||||
|
|
||||||
|
//★검증완료일때
|
||||||
|
//0.불일치 이력이 있는지 확인
|
||||||
|
$cnt = $this->model->getFaxFailTimeForHistory($vr_sq);
|
||||||
|
if (empty($cnt)) {
|
||||||
|
//1.서류전화 들어온시간
|
||||||
|
$insert_tm = $this->model->getSaveTimeForHistory($vr_sq);
|
||||||
|
//2.서류/전화 확인일자
|
||||||
|
$tel_doc_conf_dt = $this->model->getConfTimeForHistory($vr_sq);
|
||||||
|
//3.검증시간
|
||||||
|
$finishTime = $this->model->get_60_ForHistory($vr_sq);
|
||||||
|
//4.해당 정보를 테이블에 넣는다
|
||||||
|
$this->model->insert_v2_time_required_Conf_Done($atcl_no, $cpid, $vrfc_type, $insert_tm['recv_time'], $tel_doc_conf_dt['insert_tm'], $finishTime['insert_tm']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 홍보확인서완료 등기부등본확인 안함 저장
|
||||||
|
$this->model->set_v2_st_daily(NULL, $cpid, 'D0205', '1', 'add');
|
||||||
|
|
||||||
|
endforeach;
|
||||||
|
|
||||||
|
echo json_encode(['error' => ['code' => '0', 'message' => $cnt . '건 - 처리되었습니다.']]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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 = [
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$e->getPrevious()->getTraceAsString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
60
app/Controllers/results/M415.php
Normal file
60
app/Controllers/results/M415.php
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers\results;
|
||||||
|
|
||||||
|
use App\Controllers\BaseController;
|
||||||
|
use App\Models\results\M415Model;
|
||||||
|
|
||||||
|
class M415 extends BaseController
|
||||||
|
{
|
||||||
|
private $model;
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->model = new M415Model();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stats(): string
|
||||||
|
{
|
||||||
|
return view("pages/results/m415/stats", [
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getResultList()
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$totalCount = $this->model->getTotalCount($data);
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'recordsTotal' => $totalCount,
|
||||||
|
'recordsFiltered' => $totalCount,
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function excel()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$e->getPrevious()->getTraceAsString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
76
app/Controllers/results/M416.php
Normal file
76
app/Controllers/results/M416.php
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers\results;
|
||||||
|
|
||||||
|
use App\Controllers\BaseController;
|
||||||
|
use App\Models\results\M416Model;
|
||||||
|
|
||||||
|
class M416 extends BaseController
|
||||||
|
{
|
||||||
|
private $model;
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->model = new M416Model();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stats(): string
|
||||||
|
{
|
||||||
|
|
||||||
|
$bonbu = $this->model->getBonbuList();
|
||||||
|
$team = $this->model->getTeamList();
|
||||||
|
$sido = $this->model->getAreaList();
|
||||||
|
|
||||||
|
return view("pages/results/m416/stats", [
|
||||||
|
'bonbu' => $bonbu,
|
||||||
|
'team' => $team,
|
||||||
|
'sido' => $sido,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getResultList()
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
'bonbu' => $this->request->getGet('bonbu'),
|
||||||
|
'dept_sq' => $this->request->getGet('dept_sq'),
|
||||||
|
'srchType' => $this->request->getGet('srchType'),
|
||||||
|
'srchTxt' => $this->request->getGet('srchTxt'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$totalCount = $this->model->getTotalCount($data);
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'recordsTotal' => $totalCount,
|
||||||
|
'recordsFiltered' => $totalCount,
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function excel()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
'bonbu' => $this->request->getGet('bonbu'),
|
||||||
|
'dept_sq' => $this->request->getGet('dept_sq'),
|
||||||
|
'srchType' => $this->request->getGet('srchType'),
|
||||||
|
'srchTxt' => $this->request->getGet('srchTxt'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$e->getPrevious()->getTraceAsString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
69
app/Controllers/results/M417.php
Normal file
69
app/Controllers/results/M417.php
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers\results;
|
||||||
|
|
||||||
|
use App\Controllers\BaseController;
|
||||||
|
use App\Models\results\M417Model;
|
||||||
|
|
||||||
|
|
||||||
|
class M417 extends BaseController
|
||||||
|
{
|
||||||
|
private $model;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->model = new M417Model();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stats(): string
|
||||||
|
{
|
||||||
|
$department = $this->model->getDepart();
|
||||||
|
|
||||||
|
return view("pages/results/m417/stats", [
|
||||||
|
'department' => $department,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getResultList()
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
'dept_sq' => $this->request->getGet(index: 'dept_sq'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$totalCount = $this->model->getTotalCount($data);
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'recordsTotal' => $totalCount,
|
||||||
|
'recordsFiltered' => $totalCount,
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function excel()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
'dept_sq' => $this->request->getGet(index: 'dept_sq'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$e->getPrevious()->getTraceAsString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
87
app/Controllers/results/Person.php
Normal file
87
app/Controllers/results/Person.php
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers\results;
|
||||||
|
|
||||||
|
use App\Controllers\BaseController;
|
||||||
|
use App\Models\results\PersonModel;
|
||||||
|
|
||||||
|
class Person extends BaseController
|
||||||
|
{
|
||||||
|
private $personModel;
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->personModel = new PersonModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function lists(): string
|
||||||
|
{
|
||||||
|
$bonbu = $this->personModel->getBonbuList();
|
||||||
|
$team = $this->personModel->getTeamList();
|
||||||
|
$sido = $this->personModel->getAreaList();
|
||||||
|
|
||||||
|
return view("pages/results/person/stats_p01", [
|
||||||
|
'bonbu' => $bonbu,
|
||||||
|
'team' => $team,
|
||||||
|
'sido' => $sido,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUserList()
|
||||||
|
{
|
||||||
|
$start = (int) $this->request->getGet('start') ?: 0;
|
||||||
|
$end = (int) $this->request->getGet('length') ?: 10;
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'bonbu' => $this->request->getGet('bonbu'),
|
||||||
|
'team' => $this->request->getGet('team'),
|
||||||
|
'schDateGb' => $this->request->getGet('schDateGb'),
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
'srchType' => $this->request->getGet('srchType'),
|
||||||
|
'srchTxt' => $this->request->getGet('srchTxt'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$totalCount = $this->personModel->getTotalCount($data);
|
||||||
|
|
||||||
|
|
||||||
|
$datas = $this->personModel->getUserList($start, $end, $data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'recordsTotal' => $totalCount,
|
||||||
|
'recordsFiltered' => $totalCount,
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function excel()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'bonbu' => $this->request->getGet('bonbu'),
|
||||||
|
'team' => $this->request->getGet('team'),
|
||||||
|
'schDateGb' => $this->request->getGet('schDateGb'),
|
||||||
|
'sdate' => $this->request->getGet('sdate'),
|
||||||
|
'edate' => $this->request->getGet('edate'),
|
||||||
|
'srchType' => $this->request->getGet('srchType'),
|
||||||
|
'srchTxt' => $this->request->getGet('srchTxt'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$datas = $this->personModel->getExcelUserList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$e->getPrevious()->getTraceAsString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
99
app/Controllers/results/Summary.php
Normal file
99
app/Controllers/results/Summary.php
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers\results;
|
||||||
|
|
||||||
|
use App\Controllers\BaseController;
|
||||||
|
use App\Models\results\SummaryModel;
|
||||||
|
|
||||||
|
class Summary extends BaseController
|
||||||
|
{
|
||||||
|
private $summaryModel;
|
||||||
|
|
||||||
|
private $schDateGb = ''; // 일자구분
|
||||||
|
private $sdate = ''; // 시작일자
|
||||||
|
private $edate = ''; // 종료일자
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->summaryModel = new SummaryModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$this->schDateGb = $this->request->getPost('schDateGb') ?? '1';
|
||||||
|
$this->sdate = $this->request->getPost('sdate') ?? date('Y-m-d', strtotime('first day of this month'));
|
||||||
|
$this->edate = $this->request->getPost('edate') ?? date('Y-m-d', strtotime('last day of this month'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function lists(): string
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->schDateGb = $this->request->getPost('schDateGb') ?? '1';
|
||||||
|
|
||||||
|
$this->sdate = $this->request->getPost('sdate');
|
||||||
|
if (empty($this->sdate)) {
|
||||||
|
$this->sdate = date('Y-m-01'); // 이번달 1일
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->edate = $this->request->getPost('edate');
|
||||||
|
if (empty($this->edate)) {
|
||||||
|
$this->edate = date('Y-m-t'); // 이번달 말일
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'schDateGb' => $this->schDateGb,
|
||||||
|
'sdate' => $this->sdate,
|
||||||
|
'edate' => $this->edate
|
||||||
|
];
|
||||||
|
|
||||||
|
$res = $this->summaryModel->st_s01($data);
|
||||||
|
$res2 = $this->summaryModel->st_s01_2($data);
|
||||||
|
$totalAmount = 0;
|
||||||
|
|
||||||
|
if (!empty($res)) {
|
||||||
|
foreach ($res as $row) {
|
||||||
|
foreach ($row as $key => $value) {
|
||||||
|
if (empty($value))
|
||||||
|
$value = 0;
|
||||||
|
|
||||||
|
switch ($key) {
|
||||||
|
case 'next_visit_cnt':
|
||||||
|
$res['cost'][$key] = 8000;
|
||||||
|
$res['amt'][$key] = $res['cost'][$key] * intval($value);
|
||||||
|
$totalAmount += $res['amt'][$key];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'next_shoot_cnt':
|
||||||
|
$res['cost'][$key] = 10000;
|
||||||
|
$res['amt'][$key] = $res['cost'][$key] * intval($value);
|
||||||
|
$totalAmount += $res['amt'][$key];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'delay_confirm_cnt':
|
||||||
|
case 'fail_confirm_cnt':
|
||||||
|
case 'confirm_cnt':
|
||||||
|
$res['cost'][$key] = 13000;
|
||||||
|
$res['amt'][$key] = $res['cost'][$key] * intval($value);
|
||||||
|
$totalAmount += $res['amt'][$key];
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
$res['cost'][$key] = 0;
|
||||||
|
$res['amt'][$key] = $res['cost'][$key] * intval($value);
|
||||||
|
$totalAmount += $res['amt'][$key];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return view("pages/results/summary/stats_s01", [
|
||||||
|
'schDateGb' => $this->schDateGb,
|
||||||
|
'sdate' => $this->sdate,
|
||||||
|
'edate' => $this->edate,
|
||||||
|
'st_list' => $res,
|
||||||
|
'st_agent' => $res2,
|
||||||
|
'totalAmount' => $totalAmount,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
239
app/Helpers/function_helper.php
Normal file
239
app/Helpers/function_helper.php
Normal file
@@ -0,0 +1,239 @@
|
|||||||
|
<?php
|
||||||
|
if (!function_exists('limitHscpMarketPriceInfo')) {
|
||||||
|
/**
|
||||||
|
* 해당 매물의 시세를 확인후 상한가의 200% ~ 하한가의 70% 이내의 범위에 값이 설정되어 있는지 확인
|
||||||
|
* @param string $trade_type 거래종류
|
||||||
|
* @param string $hscp_no 단지코드
|
||||||
|
* @param string $ptp_no 평형코드
|
||||||
|
* @param string $atcl_amt 가격
|
||||||
|
*/
|
||||||
|
function limitHscpMarketPriceInfo($CI, $trade_type, $hscp_no, $ptp_no, $atcl_amt)
|
||||||
|
{
|
||||||
|
$return = array();
|
||||||
|
|
||||||
|
if (!empty($hscp_no) && !empty($ptp_no)) {
|
||||||
|
|
||||||
|
$hscpMarketPriceInfo = $CI->call_kiso_api->hscpMarketPriceInfo($hscp_no, $ptp_no);
|
||||||
|
|
||||||
|
if (isset($hscpMarketPriceInfo['error'])) { //결과값 확인
|
||||||
|
if ($hscpMarketPriceInfo['error']['code'] == 'VC027') {
|
||||||
|
$return = array();
|
||||||
|
} else {
|
||||||
|
$return = $hscpMarketPriceInfo['error'];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$limitH = 0;
|
||||||
|
$limitL = 0;
|
||||||
|
// 상한가, 하한가 체크 ( 상한가 * 2, 하한가 * 0.7) 이내의 범위에 가격이 있어야 함.
|
||||||
|
if ($trade_type == 'A1') {
|
||||||
|
// 매매
|
||||||
|
if (isset($hscpMarketPriceInfo['result']['deal_uplmt_prc'])) {
|
||||||
|
$limitH = $hscpMarketPriceInfo['result']['deal_uplmt_prc'];
|
||||||
|
}
|
||||||
|
if (isset($hscpMarketPriceInfo['result']['deal_lwlmt_prc'])) {
|
||||||
|
$limitL = $hscpMarketPriceInfo['result']['deal_lwlmt_prc'];
|
||||||
|
}
|
||||||
|
} elseif ($trade_type == 'B1') {
|
||||||
|
// 전세
|
||||||
|
if (isset($hscpMarketPriceInfo['result']['lease_uplmt_prc'])) {
|
||||||
|
$limitH = $hscpMarketPriceInfo['result']['lease_uplmt_prc'];
|
||||||
|
}
|
||||||
|
if (isset($hscpMarketPriceInfo['result']['lease_lwlmt_prc'])) {
|
||||||
|
$limitL = $hscpMarketPriceInfo['result']['lease_lwlmt_prc'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($limitH)) {
|
||||||
|
$limitH = $limitH * 2;
|
||||||
|
|
||||||
|
if ($limitH < $atcl_amt) {
|
||||||
|
$return = array('code' => 'ERC_02', 'message' => '최근 시세 하한가 70% ~ 상한가 200% 혹은 네이버 분양 서비스 내 평균 분양가격 하한가 60%(시세가 없는 분양권)를 벗어나는 가격입니다.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($limitL)) {
|
||||||
|
$limitL = $limitL * 0.7;
|
||||||
|
|
||||||
|
if ($limitL > $atcl_amt) {
|
||||||
|
$return = array('code' => 'ERC_03', 'message' => '최근 시세 하한가 70% ~ 상한가 200% 혹은 네이버 분양 서비스 내 평균 분양가격 하한가 60%(시세가 없는 분양권)를 벗어나는 가격입니다.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 공동중개 매물 stat_cd 이름 변경
|
||||||
|
*/
|
||||||
|
function getCdChangeNm($stat_cd)
|
||||||
|
{
|
||||||
|
switch ($stat_cd) {
|
||||||
|
case "30":
|
||||||
|
return "공동중개 확인중";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 클라이언트 아이피 체크
|
||||||
|
*/
|
||||||
|
function getRealClientIp()
|
||||||
|
{
|
||||||
|
$ipaddress = '';
|
||||||
|
|
||||||
|
// HTTP_CLIENT_IP 확인 (일부 프록시에서 사용)
|
||||||
|
if (isset($_SERVER['HTTP_CLIENT_IP'])) {
|
||||||
|
$ipaddress = $_SERVER['HTTP_CLIENT_IP'];
|
||||||
|
}
|
||||||
|
// HTTP_X_FORWARDED_FOR 확인 (프록시/로드 밸런서에서 가장 흔하게 사용)
|
||||||
|
else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||||
|
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||||
|
// HTTP_X_FORWARDED_FOR는 쉼표로 구분된 여러 IP를 포함할 수 있음
|
||||||
|
// 보통 첫 번째 IP가 실제 클라이언트 IP
|
||||||
|
if (strpos($ipaddress, ',') !== false) {
|
||||||
|
$ips = explode(',', $ipaddress);
|
||||||
|
$ipaddress = trim($ips[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 다른 X-Forwarded 헤더들 확인 (덜 흔하지만 확인 필요)
|
||||||
|
else if (isset($_SERVER['HTTP_X_FORWARDED'])) {
|
||||||
|
$ipaddress = $_SERVER['HTTP_X_FORWARDED'];
|
||||||
|
} else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {
|
||||||
|
$ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
|
||||||
|
} else if (isset($_SERVER['HTTP_FORWARDED'])) {
|
||||||
|
$ipaddress = $_SERVER['HTTP_FORWARDED'];
|
||||||
|
}
|
||||||
|
// X-Real-IP 확인 (Nginx와 같은 리버스 프록시에서 주로 사용)
|
||||||
|
else if (isset($_SERVER['X-Real-IP'])) {
|
||||||
|
$ipaddress = $_SERVER['X-Real-IP'];
|
||||||
|
}
|
||||||
|
// REMOTE_ADDR 확인 (가장 직접적인 연결에서 신뢰할 수 있음)
|
||||||
|
else if (isset($_SERVER['REMOTE_ADDR'])) {
|
||||||
|
$ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||||
|
} else {
|
||||||
|
$ipaddress = '알수없음';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ipaddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
function specailCharChange($str)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!$str)
|
||||||
|
return '';
|
||||||
|
|
||||||
|
$str = str_replace(">", "〉", $str);
|
||||||
|
$str = str_replace("<", "〈", $str);
|
||||||
|
|
||||||
|
return $str;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* csv 용
|
||||||
|
* @param mixed $str
|
||||||
|
* @return array|string
|
||||||
|
*/
|
||||||
|
function csvDataReplace($str)
|
||||||
|
{
|
||||||
|
$str = str_replace("\r\n", "", $str);
|
||||||
|
$str = str_replace(",", " ", $str);
|
||||||
|
return $str;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!function_exists('str_contains')) {
|
||||||
|
function str_contains($haystack, $needle)
|
||||||
|
{
|
||||||
|
return '' === $needle || false !== strpos($haystack, $needle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if a file exists at a given URL by attempting to retrieve its HTTP headers.
|
||||||
|
* This function is specifically designed to work with NCLOUD Object Storage URLs.
|
||||||
|
* It includes a timeout to prevent indefinite blocking due to unresponsive external resources.
|
||||||
|
*
|
||||||
|
* @param string $url The relative URL of the file within NCLOUD Object Storage.
|
||||||
|
* @return bool True if the file exists (HTTP 2xx status), false otherwise or on error/timeout.
|
||||||
|
*/
|
||||||
|
function url_fileExist($url)
|
||||||
|
{
|
||||||
|
// 134: 입력 URL이 비어있는지 확인. 비어있으면 즉시 false 반환.
|
||||||
|
if (empty($url)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 135: NCLOUD_OBJECT_STORAGE_URL 상수를 사용하여 완전한 URL을 구성.
|
||||||
|
// 이 상수는 NCLOUD Object Storage의 기본 URL (예: 'https://kr.object.ncloudstorage.com/')을 포함해야 합니다.
|
||||||
|
$fullUrl = NCLOUD_OBJECT_STORAGE_URL . $url;
|
||||||
|
|
||||||
|
// 136: (빈 라인)
|
||||||
|
|
||||||
|
// 137: get_headers() 호출에 타임아웃을 적용하기 위한 스트림 컨텍스트 생성.
|
||||||
|
// 'http' 옵션에 'timeout'을 설정하여 PHP가 응답을 기다리는 최대 시간을 지정합니다.
|
||||||
|
// 'method'를 'HEAD'로 설정하여 파일 내용을 다운로드하지 않고 헤더만 요청하므로 효율적입니다.
|
||||||
|
// 'ssl' 옵션은 HTTPS 연결 시 SSL/TLS 인증서 검증 오류를 방지합니다.
|
||||||
|
// 운영 환경에서는 'verify_peer'와 'verify_peer_name'을 'true'로 설정하여 보안을 강화하는 것을 권장하며,
|
||||||
|
// 적절한 CA 인증서 번들 경로를 'cafile' 또는 'capath'로 지정해야 합니다.
|
||||||
|
$context = stream_context_create(array(
|
||||||
|
'http' => array(
|
||||||
|
'timeout' => 5, // 응답을 5초 동안 기다림 (이 값은 네트워크 환경과 외부 서비스 응답 시간에 따라 조정 가능)
|
||||||
|
'method' => 'HEAD' // HEAD 요청은 파일 존재 여부 확인에 충분하며 대역폭을 절약합니다.
|
||||||
|
),
|
||||||
|
'ssl' => array(
|
||||||
|
'verify_peer' => false, // 경고: 프로덕션 환경에서는 'true'로 설정하고 CA 인증서를 구성하여 보안을 강화해야 합니다.
|
||||||
|
'verify_peer_name' => false, // 경고: 프로덕션 환경에서는 'true'로 설정하고 CA 인증서를 구성하여 보안을 강화해야 합니다.
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
// get_headers() 함수를 호출하여 HTTP 헤더를 가져옵니다.
|
||||||
|
// @ suppression operator를 사용하여 네트워크 오류 등으로 인한 PHP 경고를 억제합니다.
|
||||||
|
// $context를 세 번째 인자로 전달하여 위에서 정의한 타임아웃 및 기타 옵션을 적용합니다.
|
||||||
|
$array = @get_headers($fullUrl, 0, $context);
|
||||||
|
|
||||||
|
// 헤더를 가져오지 못했거나 (예: 타임아웃, 네트워크 오류) false가 반환된 경우 처리.
|
||||||
|
// 이 경우 파일이 존재하지 않거나 접근할 수 없는 것으로 간주합니다.
|
||||||
|
if ($array === false) {
|
||||||
|
// 이 곳에 오류 로깅 또는 추가적인 오류 처리 로직을 추가할 수 있습니다.
|
||||||
|
// 예: error_log("Failed to get headers for URL: " . $fullUrl . " at " . __FILE__ . ":" . __LINE__);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// HTTP 응답의 첫 번째 줄(상태 코드)에서 숫자로 된 상태 코드를 추출합니다.
|
||||||
|
// 정규식을 사용하여 "HTTP/1.1 200 OK"와 같은 문자열에서 "200" 부분을 추출합니다.
|
||||||
|
if (preg_match('/^HTTP\/\d\.\d\s(\d{3})/', $array[0], $matches)) {
|
||||||
|
$statusCode = (int) $matches[1];
|
||||||
|
// HTTP 상태 코드가 2xx (성공) 범위인지 확인합니다.
|
||||||
|
// 200 OK, 201 Created, 202 Accepted 등 성공적인 응답을 모두 포함합니다.
|
||||||
|
return ($statusCode >= 200 && $statusCode < 300);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 만약 위 preg_match가 실패하거나, 응답 형식이 예상과 다르면,
|
||||||
|
// 원래 로직대로 "200 OK" 문자열 포함 여부로 한 번 더 확인합니다.
|
||||||
|
// 이는 후방 호환성을 위한 것이며, 위의 상태 코드 확인 로직이 더 견고합니다.
|
||||||
|
return str_contains($array[0], "200 OK");
|
||||||
|
}
|
||||||
|
|
||||||
|
function realFilePath($url)
|
||||||
|
{
|
||||||
|
if (empty($url))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (url_fileExist($url)) {
|
||||||
|
$return_url = NCLOUD_OBJECT_STORAGE_URL . $url;
|
||||||
|
} else {
|
||||||
|
$return_url = $url;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $return_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
function han($s)
|
||||||
|
{
|
||||||
|
return reset(json_decode('{"s":"' . $s . '"}'));
|
||||||
|
}
|
||||||
|
// function to_han ($str) { return preg_replace('/(\\\u[a-f0-9]+)+/e','han("$0")',$str); }
|
||||||
|
|
||||||
@@ -148,4 +148,51 @@ class HomeModel extends Model
|
|||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 실적 조회
|
||||||
|
public function viewStatData($param)
|
||||||
|
{
|
||||||
|
$sql = "select a1.*
|
||||||
|
from(
|
||||||
|
SELECT
|
||||||
|
CASE a.insert_user WHEN 0 THEN 1 ELSE a.insert_user END insert_user,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '38' THEN a.vr_sq ELSE NULL END ) phone_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'D' AND (a.stat_cd = '35' or a.stat_cd = '39') THEN a.vr_sq ELSE NULL END ) paper_cnt ,
|
||||||
|
COUNT( CASE WHEN (a.stat_cd = '77') THEN a.vr_sq ELSE NULL END ) + COUNT( DISTINCT CASE WHEN b.stat_cd = '60' AND a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) AS reg_open_cnt,
|
||||||
|
COUNT( CASE WHEN (a.stat_cd = '85') THEN a.vr_sq ELSE NULL END ) + COUNT( DISTINCT CASE WHEN b.stat_cd = '60' AND a.stat_cd = '80' THEN a.vr_sq ELSE NULL END ) AS reg_tempOpen_cnt,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '86' or a.stat_cd = '88' THEN a.vr_sq ELSE NULL END ) AS real_top_R,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '87' or a.stat_cd = '89' THEN a.vr_sq ELSE NULL END ) AS real_top_G,
|
||||||
|
IFNULL((select count(distinct f1.vr_sq)
|
||||||
|
from v2_files f1
|
||||||
|
INNER JOIN v2_vrfc_req b ON b.vr_sq = f1.vr_sq and b.vrfc_type = 'M'
|
||||||
|
where f1.insert_tm between concat(DATE_FORMAT({$param['s_date']}, '%Y-%m-%d'),' 00:00:00') AND concat(DATE_FORMAT({$param['s_date']}, '%Y-%m-%d'),' 23:59:59')
|
||||||
|
and f1.file_type = '2'
|
||||||
|
and f1.use_yn = 'Y'
|
||||||
|
AND f1.insert_user = a.insert_user) ,0) AS mobile_cnt
|
||||||
|
FROM v2_chg_stat_stats a
|
||||||
|
INNER JOIN v2_vrfc_req b ON b.vr_sq = a.vr_sq
|
||||||
|
INNER JOIN v2_article_info c ON c.vr_sq = a.vr_sq
|
||||||
|
WHERE 1=1
|
||||||
|
and a.insert_user = {$param['usr_sq']}
|
||||||
|
and a.insert_tm between concat(DATE_FORMAT({$param['s_date']}, '%Y-%m-%d'),' 00:00:00') AND concat(DATE_FORMAT({$param['s_date']}, '%Y-%m-%d'),' 23:59:59')
|
||||||
|
) a1 ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 팩스 건수 조회
|
||||||
|
public function getHomeFaxCount()
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
date_format(now(), '%H') as base_time
|
||||||
|
,(SELECT count(*) FROM uds_tiff where save_time >= concat(date_format(now(), '%Y-%m-%d %H'), ':00:00')) as enfax_count
|
||||||
|
,(SELECT COUNT(*) FROM FC_RECV_TRAN where TR_RECVTIME >= concat(date_format(now(), '%Y%m%d%H'), '0000')) as lgfax_count ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
|
||||||
|
return $query->getRowArray();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
52
app/Models/common/SmsModel.php
Normal file
52
app/Models/common/SmsModel.php
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\common;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class SmsModel extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
// 문자발송
|
||||||
|
public function sendSms($dest_phone, $dest_name, $send_phone, $send_name, $subject, $msg_body, $msg_type, $memo)
|
||||||
|
{
|
||||||
|
// 1) DB에서 NOW() 가져오고 싶으면 (기존 로직 유지)
|
||||||
|
$sql = "SELECT DATE_FORMAT(NOW(), '%Y%m%d-%H%i%s') AS cmid, NOW() AS currDttm";
|
||||||
|
$query = $$this->db->query($sql);
|
||||||
|
$row = $query->getRowArray();
|
||||||
|
|
||||||
|
$cmid = $row['cmid'] ?? null;
|
||||||
|
$currDate = $row['currDttm'] ?? Time::now()->toDateTimeString(); // fallback
|
||||||
|
|
||||||
|
// 2) 메시지 길이(EUC-KR) 체크
|
||||||
|
$msg_length = strlen(iconv('UTF-8', 'EUC-KR//IGNORE', $msg_body));
|
||||||
|
if ($msg_length > 80 && (int) $msg_type === 0) {
|
||||||
|
$msg_type = 5; // LMS
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3) etc2 분기
|
||||||
|
$etc2 = ($memo === '로그인 인증') ? 'S13' : 'S12';
|
||||||
|
|
||||||
|
// 4) insert 데이터
|
||||||
|
$data = [
|
||||||
|
// 'cmid' => $cmid, // 필요하면 활성화
|
||||||
|
'dest_phone' => $dest_phone,
|
||||||
|
'dest_name' => $dest_name,
|
||||||
|
'send_phone' => $send_phone,
|
||||||
|
'send_name' => $send_name,
|
||||||
|
'subject' => $subject,
|
||||||
|
'msg_body' => $msg_body,
|
||||||
|
'msg_type' => $msg_type,
|
||||||
|
'request_time' => $currDate,
|
||||||
|
'send_time' => $currDate,
|
||||||
|
'etc2' => $etc2,
|
||||||
|
'etc3' => $memo,
|
||||||
|
];
|
||||||
|
|
||||||
|
// 5) Query Builder insert
|
||||||
|
$builder = $this->db->table('ums_data');
|
||||||
|
$res = $builder->insert($data);
|
||||||
|
|
||||||
|
// 6) 실행 쿼리 로그 (CI4)
|
||||||
|
log_message('debug', '161616 ' . $this->db->getLastQuery());
|
||||||
|
}
|
||||||
|
}
|
||||||
312
app/Models/results/AssignModel.php
Normal file
312
app/Models/results/AssignModel.php
Normal file
@@ -0,0 +1,312 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\results;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class AssignModel extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
// 소속본부조회
|
||||||
|
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 getAreaList($sido = '', $gugun = '')
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!empty($gugun)) {
|
||||||
|
$gugun = substr($gugun, '0', '5');
|
||||||
|
|
||||||
|
$sql = "SELECT a.region_cd, TRIM(REPLACE(a.region_nm, b.region_nm, '')) region_nm" .
|
||||||
|
" FROM region_codes a" .
|
||||||
|
" LEFT JOIN region_codes b ON b.region_cd = CONCAT(SUBSTR(a.region_cd,1,5),'00000')" .
|
||||||
|
" WHERE a.region_cd LIKE concat(?, '%')" .
|
||||||
|
" AND a.region_cd NOT LIKE '%00000'" .
|
||||||
|
" AND a.region_cd LIKE '%00'" .
|
||||||
|
" AND a.use_yn = 'Y'" .
|
||||||
|
" ORDER BY a.region_nm ASC";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$gugun]);
|
||||||
|
|
||||||
|
} else if (!empty($sido)) {
|
||||||
|
$chk_sido = substr($sido, '0', '2');
|
||||||
|
|
||||||
|
if ($chk_sido === '36') {
|
||||||
|
$sido = substr($sido, '0', '4');
|
||||||
|
$sql = "SELECT a.region_cd, TRIM(REPLACE(a.region_nm, b.region_nm, '')) region_nm " .
|
||||||
|
"FROM region_codes a " .
|
||||||
|
"LEFT JOIN region_codes b ON b.region_cd = CONCAT(SUBSTR(a.region_cd,1,4),'000000') " .
|
||||||
|
"WHERE a.region_cd LIKE concat(?, '%') " .
|
||||||
|
"AND a.region_cd NOT LIKE '%000000' " .
|
||||||
|
"AND a.region_cd LIKE '%00' " .
|
||||||
|
"AND a.use_yn = 'Y' " .
|
||||||
|
"AND EXISTS (SELECT 'x' FROM region_codes c WHERE c.region_cd LIKE CONCAT(SUBSTR(a.region_cd,1,5),'%') AND c.region_cd > CONCAT(SUBSTR(a.region_cd,1,5),'00000')) " .
|
||||||
|
"ORDER BY a.region_nm ASC";
|
||||||
|
} else {
|
||||||
|
$sido = substr($sido, '0', '2');
|
||||||
|
$sql = "SELECT a.region_cd, TRIM(REPLACE(a.region_nm, b.region_nm, '')) region_nm" .
|
||||||
|
" FROM region_codes a" .
|
||||||
|
" LEFT JOIN region_codes b ON b.region_cd = CONCAT(SUBSTR(a.region_cd,1,2),'00000000')" .
|
||||||
|
" WHERE a.region_cd LIKE concat(?, '%')" .
|
||||||
|
" AND a.region_cd NOT LIKE '%00000000'" .
|
||||||
|
" AND a.region_cd LIKE '%00000'" .
|
||||||
|
" AND a.use_yn = 'Y'" .
|
||||||
|
" AND EXISTS (SELECT 'x' FROM region_codes c WHERE c.region_cd LIKE CONCAT(SUBSTR(a.region_cd,1,5),'%') AND c.region_cd > CONCAT(SUBSTR(a.region_cd,1,5),'00000'))" .
|
||||||
|
" ORDER BY a.region_nm ASC";
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$sido]);
|
||||||
|
} else {
|
||||||
|
$sql = "SELECT a.region_cd, a.region_nm " .
|
||||||
|
"FROM region_codes a " .
|
||||||
|
"WHERE (a.region_cd LIKE '%00000000' " .
|
||||||
|
"AND a.use_yn = 'Y') " .
|
||||||
|
"OR region_cd = 3611000000;";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTotalCount($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
COUNT(*) AS cnt
|
||||||
|
FROM result a
|
||||||
|
INNER JOIN users b ON b.usr_sq = a.usr_sq
|
||||||
|
INNER JOIN receipt d ON d.rcpt_sq = a.rcpt_sq
|
||||||
|
INNER JOIN departments c ON c.dept_sq = a.dept_sq
|
||||||
|
|
||||||
|
WHERE 1=1 ";
|
||||||
|
|
||||||
|
if (!empty($data['bonbu'])) {
|
||||||
|
$sql .= "AND c.pdept_sq = {$data['bonbu']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['team'])) {
|
||||||
|
$sql .= "AND c.dept_sq = {$data['team']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['schDateGb'])) {
|
||||||
|
if ($data['schDateGb'] === "1") {
|
||||||
|
|
||||||
|
if (!empty($data['sdate'])) {
|
||||||
|
$sql .= "AND a.rsrv_date >= CONCAT('{$data['sdate']} 00:00:00') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['edate'])) {
|
||||||
|
$sql .= "AND a.rsrv_date <= CONCAT('{$data['edate']} 23:59:59') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if ($data['schDateGb'] === "2") {
|
||||||
|
if (!empty($data['sdate'])) {
|
||||||
|
$sql .= "AND d.rcpt_tm >= CONCAT('{$data['sdate']} 00:00:00') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['edate'])) {
|
||||||
|
$sql .= "AND d.rcpt_tm <= CONCAT('{$data['edate']} 23:59:59') ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['srchTxt'])) {
|
||||||
|
if ($data['srchType'] === "1") {
|
||||||
|
$sql .= "AND usr_id like CONCAT('%', '{$data['srchTxt']}', '%' ) ";
|
||||||
|
} else if ($data['srchType'] === "2") {
|
||||||
|
$sql .= "AND usr_nm like CONCAT('%', '{$data['srchTxt']}', '%' ) ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND (
|
||||||
|
usr_id like CONCAT('%', '{$data['srchTxt']}', '%' )
|
||||||
|
OR usr_nm like CONCAT('%', '{$data['srchTxt']}', '%' )
|
||||||
|
) ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getRow()->cnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUserList($start, $end, $data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
b.usr_nm, b.usr_id, b.usr_sq, c.dept_sq, c.pdept_sq, c.depth
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_hour IN ('00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24') THEN 1 ELSE 0 END) TODAY
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'AM' AND a.rsrv_tm_hour = '09' THEN 1 ELSE 0 END) AM09
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'AM' AND a.rsrv_tm_hour = '10' THEN 1 ELSE 0 END) AM10
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'AM' AND a.rsrv_tm_hour = '11' THEN 1 ELSE 0 END) AM11
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'AM' AND a.rsrv_tm_hour = '12' THEN 1 ELSE 0 END) AM12
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'AM' AND a.rsrv_tm_hour IN ('00','01','02','03','04','05','06','07','08') THEN 1 ELSE 0 END) AMETC
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('01', '13') THEN 1 ELSE 0 END) PM01
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('02', '14') THEN 1 ELSE 0 END) PM02
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('03', '15') THEN 1 ELSE 0 END) PM03
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('04', '16') THEN 1 ELSE 0 END) PM04
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('05', '17') THEN 1 ELSE 0 END) PM05
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('06', '18') THEN 1 ELSE 0 END) PM06
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('07', '19') THEN 1 ELSE 0 END) PM07
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('00','08','09','10','11','12','20','21','22','23','24') THEN 1 ELSE 0 END) PMETC
|
||||||
|
FROM result a
|
||||||
|
INNER JOIN users b ON b.usr_sq = a.usr_sq
|
||||||
|
INNER JOIN receipt d ON d.rcpt_sq = a.rcpt_sq
|
||||||
|
INNER JOIN departments c ON c.dept_sq = a.dept_sq
|
||||||
|
|
||||||
|
WHERE 1=1 ";
|
||||||
|
|
||||||
|
if (!empty($data['bonbu'])) {
|
||||||
|
$sql .= "AND c.pdept_sq = {$data['bonbu']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['team'])) {
|
||||||
|
$sql .= "AND c.dept_sq = {$data['team']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['schDateGb'])) {
|
||||||
|
if ($data['schDateGb'] === "1") {
|
||||||
|
|
||||||
|
if (!empty($data['sdate'])) {
|
||||||
|
$sql .= "AND a.rsrv_date >= CONCAT('{$data['sdate']} 00:00:00') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['edate'])) {
|
||||||
|
$sql .= "AND a.rsrv_date <= CONCAT('{$data['edate']} 23:59:59') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if ($data['schDateGb'] === "2") {
|
||||||
|
if (!empty($data['sdate'])) {
|
||||||
|
$sql .= "AND d.rcpt_tm >= CONCAT('{$data['sdate']} 00:00:00') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['edate'])) {
|
||||||
|
$sql .= "AND d.rcpt_tm <= CONCAT('{$data['edate']} 23:59:59') ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['srchTxt'])) {
|
||||||
|
if ($data['srchType'] === "1") {
|
||||||
|
$sql .= "AND usr_id like CONCAT('%', '{$data['srchTxt']}', '%' ) ";
|
||||||
|
} else if ($data['srchType'] === "2") {
|
||||||
|
$sql .= "AND usr_nm like CONCAT('%', '{$data['srchTxt']}', '%' ) ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND (
|
||||||
|
usr_id like CONCAT('%', '{$data['srchTxt']}', '%' )
|
||||||
|
OR usr_nm like CONCAT('%', '{$data['srchTxt']}', '%' )
|
||||||
|
) ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= "GROUP BY b.usr_id, b.usr_nm ";
|
||||||
|
|
||||||
|
$sql .= "LIMIT {$start}, {$end}";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function getExcelUserList($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
b.usr_id
|
||||||
|
, b.usr_nm
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_hour IN ('00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24') THEN 1 ELSE 0 END) TODAY
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'AM' AND a.rsrv_tm_hour = '09' THEN 1 ELSE 0 END) AM09
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'AM' AND a.rsrv_tm_hour = '10' THEN 1 ELSE 0 END) AM10
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'AM' AND a.rsrv_tm_hour = '11' THEN 1 ELSE 0 END) AM11
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'AM' AND a.rsrv_tm_hour = '12' THEN 1 ELSE 0 END) AM12
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'AM' AND a.rsrv_tm_hour IN ('00','01','02','03','04','05','06','07','08') THEN 1 ELSE 0 END) AMETC
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('01', '13') THEN 1 ELSE 0 END) PM01
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('02', '14') THEN 1 ELSE 0 END) PM02
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('03', '15') THEN 1 ELSE 0 END) PM03
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('04', '16') THEN 1 ELSE 0 END) PM04
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('05', '17') THEN 1 ELSE 0 END) PM05
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('06', '18') THEN 1 ELSE 0 END) PM06
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('07', '19') THEN 1 ELSE 0 END) PM07
|
||||||
|
, SUM(CASE WHEN a.rsrv_tm_ap = 'PM' AND a.rsrv_tm_hour IN ('00','08','09','10','11','12','20','21','22','23','24') THEN 1 ELSE 0 END) PMETC
|
||||||
|
FROM result a
|
||||||
|
INNER JOIN users b ON b.usr_sq = a.usr_sq
|
||||||
|
INNER JOIN receipt d ON d.rcpt_sq = a.rcpt_sq
|
||||||
|
INNER JOIN departments c ON c.dept_sq = a.dept_sq
|
||||||
|
|
||||||
|
WHERE 1=1 ";
|
||||||
|
|
||||||
|
if (!empty($data['bonbu'])) {
|
||||||
|
$sql .= "AND c.pdept_sq = {$data['bonbu']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['team'])) {
|
||||||
|
$sql .= "AND c.dept_sq = {$data['team']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['schDateGb'])) {
|
||||||
|
if ($data['schDateGb'] === "1") {
|
||||||
|
|
||||||
|
if (!empty($data['sdate'])) {
|
||||||
|
$sql .= "AND a.rsrv_date >= CONCAT('{$data['sdate']} 00:00:00') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['edate'])) {
|
||||||
|
$sql .= "AND a.rsrv_date <= CONCAT('{$data['edate']} 23:59:59') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if ($data['schDateGb'] === "2") {
|
||||||
|
if (!empty($data['sdate'])) {
|
||||||
|
$sql .= "AND d.rcpt_tm >= CONCAT('{$data['sdate']} 00:00:00') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['edate'])) {
|
||||||
|
$sql .= "AND d.rcpt_tm <= CONCAT('{$data['edate']} 23:59:59') ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['srchTxt'])) {
|
||||||
|
if ($data['srchType'] === "1") {
|
||||||
|
$sql .= "AND usr_id like CONCAT('%', '{$data['srchTxt']}', '%' ) ";
|
||||||
|
} else if ($data['srchType'] === "2") {
|
||||||
|
$sql .= "AND usr_nm like CONCAT('%', '{$data['srchTxt']}', '%' ) ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND (
|
||||||
|
usr_id like CONCAT('%', '{$data['srchTxt']}', '%' )
|
||||||
|
OR usr_nm like CONCAT('%', '{$data['srchTxt']}', '%' )
|
||||||
|
) ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= "GROUP BY b.usr_id, b.usr_nm ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
128
app/Models/results/DeptModel.php
Normal file
128
app/Models/results/DeptModel.php
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\results;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class DeptModel extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
// 소속본부조회
|
||||||
|
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 st_d01($data)
|
||||||
|
{
|
||||||
|
$sql_where2 = '';
|
||||||
|
if ($data['schDateGb'] == '2') {
|
||||||
|
$sql_where = " AND c.insert_tm between DATE('{$data['sdate']} 00:00:00') and DATE('{$data['edate']} 23:59:59')";
|
||||||
|
} else {
|
||||||
|
$sql_where = " AND c.rsrv_date between DATE('{$data['sdate']} 00:00:00') and DATE('{$data['edate']} 23:59:59') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "SELECT
|
||||||
|
a.dept_sq, CONCAT(SPACE(4*(a.depth-1)), a.dept_nm) dept_nm, a.depth, a.pdept_sq
|
||||||
|
, (SELECT COUNT(*) FROM region_codes d WHERE CONCAT(',',GROUP_CONCAT(DISTINCT b.dept_sq), ',') LIKE CONCAT('%,',d.dept_sq,',%') AND d.region_cd NOT LIKE '%00000') AS region_cnt
|
||||||
|
, COUNT(DISTINCT e.rcpt_sq) rcpt_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.cancel_dt IS NOT NULL THEN CASE WHEN c.result_cd2 IN ('9010','9020') THEN c.rcpt_sq END END) resv_cancel_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.assign_save_dt IS NOT NULL THEN c.rcpt_sq END) resv_assign_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.cancel_dt IS NOT NULL THEN CASE WHEN c.result_cd2 = '9030' THEN c.rcpt_sq END END) prev_visit_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.cancel_dt IS NOT NULL THEN CASE WHEN c.result_cd2 = '9040' THEN c.rcpt_sq END END) next_visit_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.cancel_dt IS NOT NULL THEN CASE WHEN c.result_cd2 = '9045' THEN c.rcpt_sq END END) next_shoot_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.photo_save_dt IS NOT NULL THEN c.rcpt_sq END) shoot_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.result_cd1 = '70' THEN c.rcpt_sq END) delay_confirm_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.result_cd2 = '9050' THEN c.rcpt_sq END) fail_confirm_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.result_cd1 = '60' THEN c.rcpt_sq END) confirm_cnt
|
||||||
|
FROM departments a
|
||||||
|
LEFT JOIN departments b ON b.lft BETWEEN a.lft AND a.rgt
|
||||||
|
LEFT JOIN result c ON c.dept_sq = b.dept_sq {$sql_where}
|
||||||
|
LEFT JOIN receipt e ON e.rcpt_sq = c.rcpt_sq
|
||||||
|
WHERE a.pdept_sq != 0 AND a.use_yn = 'Y' ";
|
||||||
|
|
||||||
|
if (!empty($data['bonbu'])) {
|
||||||
|
$sql .= "AND b.pdept_sq = {$data['bonbu']} ";
|
||||||
|
|
||||||
|
if (!empty($data['dept_sq'])) {
|
||||||
|
$sql .= "AND a.dept_sq = {$data['dept_sq']} ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= "GROUP BY a.dept_sq ORDER BY a.lft";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getExcelList($data)
|
||||||
|
{
|
||||||
|
$sql_where2 = '';
|
||||||
|
if ($data['schDateGb'] == '2') {
|
||||||
|
$sql_where = " AND c.insert_tm between DATE('{$data['sdate']} 00:00:00') and DATE('{$data['edate']} 23:59:59')";
|
||||||
|
} else {
|
||||||
|
$sql_where = " AND c.rsrv_date between DATE('{$data['sdate']} 00:00:00') and DATE('{$data['edate']} 23:59:59') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "SELECT
|
||||||
|
CONCAT(SPACE(4*(a.depth-1)), a.dept_nm) AS '조직명'
|
||||||
|
, (SELECT COUNT(*) FROM region_codes d WHERE CONCAT(',',GROUP_CONCAT(DISTINCT b.dept_sq), ',') LIKE CONCAT('%,',d.dept_sq,',%') AND d.region_cd NOT LIKE '%00000') AS '관할지역'
|
||||||
|
, COUNT(DISTINCT e.rcpt_sq) '접수'
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.cancel_dt IS NOT NULL THEN CASE WHEN c.result_cd2 IN ('9010','9020') THEN c.rcpt_sq END END) AS '예약취소'
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.assign_save_dt IS NOT NULL THEN c.rcpt_sq END) AS '예약확인'
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.cancel_dt IS NOT NULL THEN CASE WHEN c.result_cd2 = '9030' THEN c.rcpt_sq END END) AS '방문전취소'
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.cancel_dt IS NOT NULL THEN CASE WHEN c.result_cd2 = '9040' THEN c.rcpt_sq END END) AS '방문후취소'
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.cancel_dt IS NOT NULL THEN CASE WHEN c.result_cd2 = '9045' THEN c.rcpt_sq END END) AS '촬영후취소'
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.photo_save_dt IS NOT NULL THEN c.rcpt_sq END) AS '촬영'
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.result_cd1 = '70' THEN c.rcpt_sq END) AS '검수지연'
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.result_cd2 = '9050' THEN c.rcpt_sq END) AS '검수실패'
|
||||||
|
, COUNT(DISTINCT CASE WHEN c.result_cd1 = '60' THEN c.rcpt_sq END) AS '검수완료'
|
||||||
|
FROM departments a
|
||||||
|
LEFT JOIN departments b ON b.lft BETWEEN a.lft AND a.rgt
|
||||||
|
LEFT JOIN result c ON c.dept_sq = b.dept_sq {$sql_where}
|
||||||
|
LEFT JOIN receipt e ON e.rcpt_sq = c.rcpt_sq
|
||||||
|
WHERE a.pdept_sq != 0 AND a.use_yn = 'Y' ";
|
||||||
|
|
||||||
|
if (!empty($data['bonbu'])) {
|
||||||
|
$sql .= "AND b.pdept_sq = {$data['bonbu']} ";
|
||||||
|
|
||||||
|
if (!empty($data['dept_sq'])) {
|
||||||
|
$sql .= "AND a.dept_sq = {$data['dept_sq']} ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= "GROUP BY a.dept_sq ORDER BY a.lft";
|
||||||
|
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
173
app/Models/results/M409Model.php
Normal file
173
app/Models/results/M409Model.php
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\results;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class M409Model extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
public function getCodeList($data)
|
||||||
|
{
|
||||||
|
$builder = $this->db->table('codes')
|
||||||
|
->select('category, cd, cd_nm, use_yn')
|
||||||
|
->whereIn('category', $data)
|
||||||
|
->where('use_yn', 'Y')
|
||||||
|
->orderBy('category', 'ASC')
|
||||||
|
->orderBy('view_odr', 'ASC');
|
||||||
|
|
||||||
|
// if ($useYn !== null && $useYn !== '') {
|
||||||
|
// $builder->where('use_yn', $useYn);
|
||||||
|
// }
|
||||||
|
|
||||||
|
$rows = $builder->get()->getResultArray();
|
||||||
|
|
||||||
|
$codes = [];
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
$codes[$row['category']][] = [
|
||||||
|
'cd' => $row['cd'],
|
||||||
|
'cd_nm' => $row['cd_nm'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $codes;
|
||||||
|
}
|
||||||
|
public function getTotalCount($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT COUNT(*) AS cnt
|
||||||
|
FROM (
|
||||||
|
SELECT DATE_FORMAT(b.insert_tm, '%Y-%m-%d') AS ref_date
|
||||||
|
FROM v2_vrfc_req a
|
||||||
|
INNER JOIN v2_chg_stat b
|
||||||
|
ON b.vr_sq = a.vr_sq
|
||||||
|
AND b.insert_tm >= '{$data['sdate']} 00:00:00'
|
||||||
|
AND b.insert_tm <= '{$data['edate']} 23:59:59'
|
||||||
|
LEFT JOIN v2_confirm c
|
||||||
|
ON c.vr_sq = a.vr_sq AND c.vrfc_type = a.vrfc_type
|
||||||
|
LEFT JOIN v2_check_list d1
|
||||||
|
ON d1.vr_sq = a.vr_sq AND d1.vrfc_type = a.vrfc_type AND d1.type = CONCAT(d1.vrfc_type,'11')
|
||||||
|
LEFT JOIN v2_check_list d2
|
||||||
|
ON d2.vr_sq = a.vr_sq AND d2.vrfc_type = a.vrfc_type AND d2.type = CONCAT(d2.vrfc_type,'12')
|
||||||
|
LEFT JOIN v2_check_list d3
|
||||||
|
ON d3.vr_sq = a.vr_sq AND d3.vrfc_type = a.vrfc_type AND d3.type = CONCAT(d3.vrfc_type,'13')
|
||||||
|
LEFT JOIN v2_check_list d4
|
||||||
|
ON d4.vr_sq = a.vr_sq AND d4.vrfc_type = a.vrfc_type AND d4.type = CONCAT(d4.vrfc_type,'14')
|
||||||
|
LEFT JOIN v2_check_list e1
|
||||||
|
ON e1.vr_sq = a.vr_sq AND e1.vrfc_type = a.vrfc_type AND e1.type = '21'
|
||||||
|
LEFT JOIN v2_check_list e2
|
||||||
|
ON e2.vr_sq = a.vr_sq AND e2.vrfc_type = a.vrfc_type AND e2.type = '22'
|
||||||
|
WHERE 1=1 ";
|
||||||
|
|
||||||
|
if (!empty($data['vrfcreq_way'])) {
|
||||||
|
$sql .= "AND a.vrfc_type = '{$data['vrfcreq_way']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['cp_id'])) {
|
||||||
|
$sql .= "AND a.cp_id = '{$data['cp_id']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= "GROUP BY DATE_FORMAT(b.insert_tm, '%Y-%m-%d')
|
||||||
|
) AS t ";
|
||||||
|
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getRow()->cnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResultList($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
DATE_FORMAT(b.insert_tm, '%Y-%m-%d') ref_date
|
||||||
|
, COUNT( DISTINCT CASE b.stat_cd WHEN '10' THEN a.vr_sq ELSE NULL END ) rcpt_cnt
|
||||||
|
, COUNT( DISTINCT CASE a.stat_cd WHEN '10' THEN a.vr_sq ELSE NULL END ) notassign_cnt
|
||||||
|
, COUNT( DISTINCT CASE a.stat_cd WHEN '10' THEN NULL ELSE a.vr_sq END ) assign_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.vrfc_type = 'D' AND b.stat_cd = '35' THEN a.vr_sq ELSE NULL END) paper_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.vrfc_type = 'T' AND b.stat_cd = '35' THEN a.vr_sq ELSE NULL END) phone_cnt
|
||||||
|
, COUNT( DISTINCT CASE b.stat_cd WHEN '19' THEN a.vr_sq ELSE NULL END) cancel_cnt
|
||||||
|
, COUNT( DISTINCT CASE ifnull(d1.code, '10000') WHEN '10000' THEN NULL ELSE a.vr_sq END) priv_cnt
|
||||||
|
, COUNT( DISTINCT CASE ifnull(d2.code, '10000') WHEN '10000' THEN NULL ELSE a.vr_sq END) info_cnt
|
||||||
|
, COUNT( DISTINCT CASE ifnull(d3.code, '10000') WHEN '10000' THEN NULL ELSE a.vr_sq END) price_cnt
|
||||||
|
, COUNT( DISTINCT CASE ifnull(d4.code, '10000') WHEN '10000' THEN NULL ELSE a.vr_sq END) owner_cnt
|
||||||
|
, COUNT( DISTINCT CASE b.stat_cd WHEN '39' THEN a.vr_sq ELSE NULL END) fail_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.try_cnt > 0 THEN a.vr_sq ELSE NULL END) retry_cnt
|
||||||
|
, COUNT( DISTINCT CASE ifnull(e1.code, '10000') WHEN '10000' THEN NULL ELSE a.vr_sq END) reg_info_cnt
|
||||||
|
, COUNT( DISTINCT CASE ifnull(e2.code, '10000') WHEN '10000' THEN NULL ELSE a.vr_sq END) reg_owner_cnt
|
||||||
|
, COUNT( DISTINCT CASE b.stat_cd WHEN '60' THEN a.vr_sq ELSE NULL END) complete_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.rgbk_confirm = '1' AND b.stat_cd = '60' THEN a.vr_sq ELSE NULL END) rgbk_cnt
|
||||||
|
FROM v2_vrfc_req a
|
||||||
|
INNER JOIN v2_chg_stat b ON b.vr_sq = a.vr_sq AND b.insert_tm BETWEEN CONCAT('{$data['sdate']} 00:00:00') AND CONCAT('{$data['edate']} 23:59:59')
|
||||||
|
LEFT JOIN v2_confirm c ON c.vr_sq = a.vr_sq AND c.vrfc_type = a.vrfc_type
|
||||||
|
LEFT JOIN v2_check_list d1 ON d1.vr_sq = a.vr_sq AND d1.vrfc_type = a.vrfc_type AND d1.type=CONCAT(d1.vrfc_type,'11')
|
||||||
|
LEFT JOIN v2_check_list d2 ON d2.vr_sq = a.vr_sq AND d2.vrfc_type = a.vrfc_type AND d2.type=CONCAT(d2.vrfc_type,'12')
|
||||||
|
LEFT JOIN v2_check_list d3 ON d3.vr_sq = a.vr_sq AND d3.vrfc_type = a.vrfc_type AND d3.type=CONCAT(d3.vrfc_type,'13')
|
||||||
|
LEFT JOIN v2_check_list d4 ON d4.vr_sq = a.vr_sq AND d4.vrfc_type = a.vrfc_type AND d4.type=CONCAT(d4.vrfc_type,'14')
|
||||||
|
LEFT JOIN v2_check_list e1 ON e1.vr_sq = a.vr_sq AND e1.vrfc_type = a.vrfc_type AND e1.type='21'
|
||||||
|
LEFT JOIN v2_check_list e2 ON e2.vr_sq = a.vr_sq AND e2.vrfc_type = a.vrfc_type AND e2.type='22'
|
||||||
|
WHERE 1=1 ";
|
||||||
|
|
||||||
|
if (!empty($data['vrfcreq_way'])) {
|
||||||
|
$sql .= "AND a.vrfc_type = '{$data['vrfcreq_way']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['cp_id'])) {
|
||||||
|
$sql .= "AND a.cp_id = '{$data['cp_id']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= "GROUP BY DATE_FORMAT(b.insert_tm, '%Y-%m-%d') ";
|
||||||
|
|
||||||
|
// $sql .= "LIMIT {$start}, {$end} ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function getExcelList($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
DATE_FORMAT(b.insert_tm, '%Y-%m-%d') ref_date
|
||||||
|
, COUNT( DISTINCT CASE b.stat_cd WHEN '10' THEN a.vr_sq ELSE NULL END ) rcpt_cnt
|
||||||
|
, COUNT( DISTINCT CASE a.stat_cd WHEN '10' THEN a.vr_sq ELSE NULL END ) notassign_cnt
|
||||||
|
, COUNT( DISTINCT CASE a.stat_cd WHEN '10' THEN NULL ELSE a.vr_sq END ) assign_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.vrfc_type = 'D' AND b.stat_cd = '35' THEN a.vr_sq ELSE NULL END) paper_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.vrfc_type = 'T' AND b.stat_cd = '35' THEN a.vr_sq ELSE NULL END) phone_cnt
|
||||||
|
, COUNT( DISTINCT CASE b.stat_cd WHEN '19' THEN a.vr_sq ELSE NULL END) cancel_cnt
|
||||||
|
, COUNT( DISTINCT CASE ifnull(d1.code, '10000') WHEN '10000' THEN NULL ELSE a.vr_sq END) priv_cnt
|
||||||
|
, COUNT( DISTINCT CASE ifnull(d2.code, '10000') WHEN '10000' THEN NULL ELSE a.vr_sq END) info_cnt
|
||||||
|
, COUNT( DISTINCT CASE ifnull(d3.code, '10000') WHEN '10000' THEN NULL ELSE a.vr_sq END) price_cnt
|
||||||
|
, COUNT( DISTINCT CASE ifnull(d4.code, '10000') WHEN '10000' THEN NULL ELSE a.vr_sq END) owner_cnt
|
||||||
|
, COUNT( DISTINCT CASE b.stat_cd WHEN '39' THEN a.vr_sq ELSE NULL END) fail_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.try_cnt > 0 THEN a.vr_sq ELSE NULL END) retry_cnt
|
||||||
|
, COUNT( DISTINCT CASE ifnull(e1.code, '10000') WHEN '10000' THEN NULL ELSE a.vr_sq END) reg_info_cnt
|
||||||
|
, COUNT( DISTINCT CASE ifnull(e2.code, '10000') WHEN '10000' THEN NULL ELSE a.vr_sq END) reg_owner_cnt
|
||||||
|
, COUNT( DISTINCT CASE b.stat_cd WHEN '60' THEN a.vr_sq ELSE NULL END) complete_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.rgbk_confirm = '1' AND b.stat_cd = '60' THEN a.vr_sq ELSE NULL END) rgbk_cnt
|
||||||
|
FROM v2_vrfc_req a
|
||||||
|
INNER JOIN v2_chg_stat b ON b.vr_sq = a.vr_sq AND b.insert_tm BETWEEN CONCAT('{$data['sdate']} 00:00:00') AND CONCAT('{$data['edate']} 23:59:59')
|
||||||
|
LEFT JOIN v2_confirm c ON c.vr_sq = a.vr_sq AND c.vrfc_type = a.vrfc_type
|
||||||
|
LEFT JOIN v2_check_list d1 ON d1.vr_sq = a.vr_sq AND d1.vrfc_type = a.vrfc_type AND d1.type=CONCAT(d1.vrfc_type,'11')
|
||||||
|
LEFT JOIN v2_check_list d2 ON d2.vr_sq = a.vr_sq AND d2.vrfc_type = a.vrfc_type AND d2.type=CONCAT(d2.vrfc_type,'12')
|
||||||
|
LEFT JOIN v2_check_list d3 ON d3.vr_sq = a.vr_sq AND d3.vrfc_type = a.vrfc_type AND d3.type=CONCAT(d3.vrfc_type,'13')
|
||||||
|
LEFT JOIN v2_check_list d4 ON d4.vr_sq = a.vr_sq AND d4.vrfc_type = a.vrfc_type AND d4.type=CONCAT(d4.vrfc_type,'14')
|
||||||
|
LEFT JOIN v2_check_list e1 ON e1.vr_sq = a.vr_sq AND e1.vrfc_type = a.vrfc_type AND e1.type='21'
|
||||||
|
LEFT JOIN v2_check_list e2 ON e2.vr_sq = a.vr_sq AND e2.vrfc_type = a.vrfc_type AND e2.type='22'
|
||||||
|
WHERE 1=1 ";
|
||||||
|
|
||||||
|
if (!empty($data['vrfcreq_way'])) {
|
||||||
|
$sql .= "AND a.vrfc_type = '{$data['vrfcreq_way']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['cp_id'])) {
|
||||||
|
$sql .= "AND a.cp_id = '{$data['cp_id']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= "GROUP BY DATE_FORMAT(b.insert_tm, '%Y-%m-%d') ";
|
||||||
|
|
||||||
|
// $sql .= "LIMIT {$start}, {$end} ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
191
app/Models/results/M410Model.php
Normal file
191
app/Models/results/M410Model.php
Normal file
@@ -0,0 +1,191 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\results;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class M410Model extends Model
|
||||||
|
{
|
||||||
|
public function getCodeList($data)
|
||||||
|
{
|
||||||
|
$builder = $this->db->table('codes')
|
||||||
|
->select('category, cd, cd_nm, use_yn')
|
||||||
|
->whereIn('category', $data)
|
||||||
|
->where('use_yn', 'Y')
|
||||||
|
->orderBy('category', 'ASC')
|
||||||
|
->orderBy('view_odr', 'ASC');
|
||||||
|
|
||||||
|
// if ($useYn !== null && $useYn !== '') {
|
||||||
|
// $builder->where('use_yn', $useYn);
|
||||||
|
// }
|
||||||
|
|
||||||
|
$rows = $builder->get()->getResultArray();
|
||||||
|
|
||||||
|
$codes = [];
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
$codes[$row['category']][] = [
|
||||||
|
'cd' => $row['cd'],
|
||||||
|
'cd_nm' => $row['cd_nm'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $codes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDepart()
|
||||||
|
{
|
||||||
|
$sql = "SELECT * from departments " .
|
||||||
|
"WHERE pdept_sq = 3 " .
|
||||||
|
"ORDER BY dept_nm";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTotalCount($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT COUNT(*) AS cnt FROM ( ";
|
||||||
|
$sql .= "SELECT
|
||||||
|
a.usr_sq, a.usr_id, a.usr_nm, IFNULL(c.mobile_upload, 0)mobile_upload , b.*
|
||||||
|
FROM users AS a
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT CASE a.insert_user WHEN 0 THEN 1 ELSE a.insert_user END insert_user,
|
||||||
|
COUNT(*) total_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '10' THEN a.vr_sq ELSE NULL END ) receipt_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.stat_cd = '10' THEN a.vr_sq ELSE NULL END ) notassign_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.stat_cd = '10' THEN NULL ELSE a.vr_sq END ) assign_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.stat_cd = '19' THEN a.vr_sq ELSE NULL END ) cancel_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '30' THEN a.vr_sq ELSE NULL END ) phone_checking_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.vrfc_type = 'D' AND a.stat_cd = '30' THEN a.vr_sq ELSE NULL END ) paper_checking_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '35' THEN a.vr_sq ELSE NULL END ) phone_complete_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.vrfc_type = 'D' AND a.stat_cd = '35' THEN a.vr_sq ELSE NULL END ) paper_complete_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '38' THEN a.vr_sq ELSE NULL END ) phone_all_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '39' THEN a.vr_sq ELSE NULL END ) phone_fail_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.vrfc_type = 'D' AND a.stat_cd = '39' THEN a.vr_sq ELSE NULL END ) paper_fail_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '40' THEN a.vr_sq ELSE NULL END ) reg_checking_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '45' THEN a.vr_sq ELSE NULL END ) reg_complete_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '70' THEN a.vr_sq ELSE NULL END ) reg_none
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '86' THEN a.vr_sq ELSE NULL END ) real_top_RS
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '88' THEN a.vr_sq ELSE NULL END ) real_top_RF
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '87' THEN a.vr_sq ELSE NULL END ) real_top_GS
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '89' THEN a.vr_sq ELSE NULL END ) real_top_GF
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '49' THEN a.vr_sq ELSE NULL END ) reg_fail_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '60' THEN a.vr_sq ELSE NULL END ) complete_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '69' THEN a.vr_sq ELSE NULL END ) fail_cnt
|
||||||
|
, COUNT( CASE WHEN (a.stat_cd = '85') THEN a.vr_sq ELSE NULL END ) reg_fail_tempOpen
|
||||||
|
, COUNT( CASE WHEN (a.stat_cd = '77') THEN a.vr_sq ELSE NULL END ) reg_fail_Open
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.stat_cd = '60' AND a.stat_cd = '80' THEN a.vr_sq ELSE NULL END ) same_reg_tempOpen
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.stat_cd = '60' AND a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) same_reg_open
|
||||||
|
, COUNT( distinct c.vr_sq ) AS final_fail_cnt
|
||||||
|
FROM v2_chg_stat_stats a
|
||||||
|
INNER JOIN v2_vrfc_req b ON b.vr_sq = a.vr_sq ";
|
||||||
|
|
||||||
|
if (!empty($data['vrfcreq_way'])) {
|
||||||
|
$sql .= "AND b.vrfc_type = '{$data['vrfcreq_way']}' ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND b.vrfc_type <> 'N' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$sql .= " LEFT OUTER JOIN v2_article_fail c ON c.vr_sq = a.vr_sq
|
||||||
|
|
||||||
|
WHERE 1=1
|
||||||
|
|
||||||
|
AND a.insert_tm BETWEEN concat('{$data['sdate']} 00:00:00') AND concat('{$data['edate']} 23:59:59')
|
||||||
|
|
||||||
|
GROUP BY CASE a.insert_user WHEN 0 THEN 1 ELSE a.insert_user END
|
||||||
|
) AS b on b.insert_user = a.usr_sq
|
||||||
|
|
||||||
|
LEFT JOIN (
|
||||||
|
select f1.insert_user, count(distinct f1.vr_sq) mobile_upload
|
||||||
|
from v2_files f1
|
||||||
|
INNER JOIN v2_vrfc_req b ON b.vr_sq = f1.vr_sq and b.vrfc_type = 'M'
|
||||||
|
where f1.insert_tm between concat('2025-12-16 00:00:00') AND concat('2025-12-16 23:59:59')
|
||||||
|
and f1.file_type = '2'
|
||||||
|
and f1.use_yn = 'Y' group by f1.insert_user
|
||||||
|
) AS c on c.insert_user = a.usr_sq
|
||||||
|
WHERE (b.insert_user is not null or c.insert_user is not null) ";
|
||||||
|
|
||||||
|
if (!empty($data['dept_sq'])) {
|
||||||
|
$sql .= "AND a.dept_sq = {$data['dept_sq']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= ") AS t ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getRow()->cnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResultList($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
a.usr_sq, a.usr_id, a.usr_nm, IFNULL(c.mobile_upload, 0) mobile_upload, b.*
|
||||||
|
FROM users AS a
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT CASE a.insert_user WHEN 0 THEN 1 ELSE a.insert_user END insert_user,
|
||||||
|
COUNT(*) total_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '10' THEN a.vr_sq ELSE NULL END ) receipt_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.stat_cd = '10' THEN a.vr_sq ELSE NULL END ) notassign_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.stat_cd = '10' THEN NULL ELSE a.vr_sq END ) assign_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.stat_cd = '19' THEN a.vr_sq ELSE NULL END ) cancel_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '30' THEN a.vr_sq ELSE NULL END ) phone_checking_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.vrfc_type = 'D' AND a.stat_cd = '30' THEN a.vr_sq ELSE NULL END ) paper_checking_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '35' THEN a.vr_sq ELSE NULL END ) phone_complete_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.vrfc_type = 'D' AND a.stat_cd = '35' THEN a.vr_sq ELSE NULL END ) paper_complete_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '38' THEN a.vr_sq ELSE NULL END ) phone_all_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '39' THEN a.vr_sq ELSE NULL END ) phone_fail_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.vrfc_type = 'D' AND a.stat_cd = '39' THEN a.vr_sq ELSE NULL END ) paper_fail_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '40' THEN a.vr_sq ELSE NULL END ) reg_checking_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '45' THEN a.vr_sq ELSE NULL END ) reg_complete_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '70' THEN a.vr_sq ELSE NULL END ) reg_none
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '86' THEN a.vr_sq ELSE NULL END ) real_top_RS
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '88' THEN a.vr_sq ELSE NULL END ) real_top_RF
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '87' THEN a.vr_sq ELSE NULL END ) real_top_GS
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '89' THEN a.vr_sq ELSE NULL END ) real_top_GF
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '49' THEN a.vr_sq ELSE NULL END ) reg_fail_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '60' THEN a.vr_sq ELSE NULL END ) complete_cnt
|
||||||
|
, COUNT( DISTINCT CASE WHEN a.stat_cd = '69' THEN a.vr_sq ELSE NULL END ) fail_cnt
|
||||||
|
, COUNT( CASE WHEN (a.stat_cd = '85') THEN a.vr_sq ELSE NULL END ) reg_fail_tempOpen
|
||||||
|
, COUNT( CASE WHEN (a.stat_cd = '77') THEN a.vr_sq ELSE NULL END ) reg_fail_Open
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.stat_cd = '60' AND a.stat_cd = '80' THEN a.vr_sq ELSE NULL END ) same_reg_tempOpen
|
||||||
|
, COUNT( DISTINCT CASE WHEN b.stat_cd = '60' AND a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) same_reg_open
|
||||||
|
, COUNT( distinct c.vr_sq ) AS final_fail_cnt
|
||||||
|
FROM v2_chg_stat_stats a
|
||||||
|
INNER JOIN v2_vrfc_req b ON b.vr_sq = a.vr_sq ";
|
||||||
|
|
||||||
|
if (!empty($data['vrfcreq_way'])) {
|
||||||
|
$sql .= "AND b.vrfc_type = '{$data['vrfcreq_way']}' ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND b.vrfc_type <> 'N' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$sql .= " LEFT OUTER JOIN v2_article_fail c ON c.vr_sq = a.vr_sq
|
||||||
|
|
||||||
|
WHERE 1=1
|
||||||
|
|
||||||
|
AND a.insert_tm BETWEEN concat('{$data['sdate']} 00:00:00') AND concat('{$data['edate']} 23:59:59')
|
||||||
|
|
||||||
|
GROUP BY CASE a.insert_user WHEN 0 THEN 1 ELSE a.insert_user END
|
||||||
|
) AS b on b.insert_user = a.usr_sq
|
||||||
|
|
||||||
|
LEFT JOIN (
|
||||||
|
select f1.insert_user, count(distinct f1.vr_sq) mobile_upload
|
||||||
|
from v2_files f1
|
||||||
|
INNER JOIN v2_vrfc_req b ON b.vr_sq = f1.vr_sq and b.vrfc_type = 'M'
|
||||||
|
where f1.insert_tm between concat('2025-12-16 00:00:00') AND concat('2025-12-16 23:59:59')
|
||||||
|
and f1.file_type = '2'
|
||||||
|
and f1.use_yn = 'Y' group by f1.insert_user
|
||||||
|
) AS c on c.insert_user = a.usr_sq
|
||||||
|
WHERE (b.insert_user is not null or c.insert_user is not null) ";
|
||||||
|
|
||||||
|
if (!empty($data['dept_sq'])) {
|
||||||
|
$sql .= "AND a.dept_sq = {$data['dept_sq']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
182
app/Models/results/M411Model.php
Normal file
182
app/Models/results/M411Model.php
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\results;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class M411Model extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
public function getTotalCount($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT COUNT(*) AS cnt FROM ( ";
|
||||||
|
$sql .= "SELECT
|
||||||
|
cpid,
|
||||||
|
SUM(t_cnt) t_cnt,
|
||||||
|
SUM(hong1_cnt) hong1_cnt,
|
||||||
|
SUM(hong2_cnt) hong2_cnt,
|
||||||
|
SUM(m_cnt) m_cnt,
|
||||||
|
SUM(v2_cnt) v2_cnt,
|
||||||
|
sum(total) total,
|
||||||
|
|
||||||
|
SUM(a) t_o,
|
||||||
|
SUM(b) t_x,
|
||||||
|
SUM(c) t_n,
|
||||||
|
SUM(d) t_e,
|
||||||
|
|
||||||
|
SUM(e) d_o,
|
||||||
|
SUM(f) d_x,
|
||||||
|
|
||||||
|
(SUM(a)+SUM(e)) dt_o,
|
||||||
|
(SUM(b)+SUM(f)) dt_x,
|
||||||
|
|
||||||
|
SUM(e)+SUM(f) d_tot,
|
||||||
|
SUM(a)+SUM(b)+SUM(c)+SUM(d) t_tot,
|
||||||
|
|
||||||
|
SUM(g) dt_tot,
|
||||||
|
|
||||||
|
SUM(h) r_o,
|
||||||
|
SUM(i) r_x,
|
||||||
|
SUM(h) r_e,
|
||||||
|
SUM(k) done,
|
||||||
|
SUM(l) r_tot,
|
||||||
|
|
||||||
|
SUM(m) s_1,
|
||||||
|
round((SUM(m) / total),2) s_2
|
||||||
|
FROM (
|
||||||
|
SELECT a.cpid,
|
||||||
|
COUNT(*) total
|
||||||
|
,SUM(CASE vrfc_type_sub WHEN 'D1' THEN 1 ELSE 0 END) hong1_cnt
|
||||||
|
,SUM(CASE vrfc_type_sub WHEN 'D2' THEN 1 ELSE 0 END) hong2_cnt
|
||||||
|
,SUM(CASE vrfc_type_sub WHEN 'M1' THEN 1 ELSE 0 END) m_cnt
|
||||||
|
,SUM(CASE vrfc_type_sub WHEN 'O1' THEN 1 ELSE 0 END) v2_cnt
|
||||||
|
,SUM(CASE vrfc_type_sub WHEN 'T1' THEN 1 ELSE 0 END) t_cnt
|
||||||
|
, 0 a,0 b,0 c,0 d,0 e,0 f,0 g,0 h,0 i,0 j,0 k, 0 l, 0 m
|
||||||
|
FROM v2_article_info a
|
||||||
|
INNER JOIN v2_vrfc_req b ON a.vr_sq = b.vr_sq
|
||||||
|
WHERE b.insert_tm BETWEEN CONCAT('{$data['sdate']} 00:00:00') AND CONCAT('{$data['edate']} 23:59:59')
|
||||||
|
GROUP BY a.cpid
|
||||||
|
|
||||||
|
UNION ALL
|
||||||
|
|
||||||
|
SELECT cpid
|
||||||
|
,0 ,0 ,0 ,0 ,0 ,0
|
||||||
|
,t_o,t_x,t_n,t_e
|
||||||
|
,d_o,d_x
|
||||||
|
,(t_o+t_x+t_n+t_e+d_o+d_x) AS dt_tot
|
||||||
|
,r_o,r_x,r_e
|
||||||
|
,(d_d+d_t) AS done
|
||||||
|
,(r_o+r_x+r_e) AS r_tot
|
||||||
|
,(r_o+r_e+d_d+d_t) AS s_1
|
||||||
|
FROM (
|
||||||
|
SELECT cpid,
|
||||||
|
SUM(CASE gbn_cd WHEN 'T0201' THEN cnt ELSE 0 END) t_o,
|
||||||
|
SUM(CASE gbn_cd WHEN 'T0202' THEN cnt ELSE 0 END) t_x,
|
||||||
|
SUM(CASE gbn_cd WHEN 'T0203' THEN cnt ELSE 0 END) t_n,
|
||||||
|
SUM(CASE gbn_cd WHEN 'T0204' THEN cnt ELSE 0 END) t_e,
|
||||||
|
SUM(CASE gbn_cd WHEN 'D0201' THEN cnt ELSE 0 END) d_o,
|
||||||
|
SUM(CASE gbn_cd WHEN 'D0202' THEN cnt ELSE 0 END) d_x,
|
||||||
|
SUM(CASE gbn_cd WHEN 'R0101' THEN cnt ELSE 0 END) r_o,
|
||||||
|
SUM(CASE gbn_cd WHEN 'R0102' THEN cnt ELSE 0 END) r_x,
|
||||||
|
SUM(CASE gbn_cd WHEN 'R0103' THEN cnt ELSE 0 END) r_e,
|
||||||
|
SUM(CASE gbn_cd WHEN 'D0205' THEN cnt ELSE 0 END) d_d,
|
||||||
|
SUM(CASE gbn_cd WHEN 'T0206' THEN cnt ELSE 0 END) d_t
|
||||||
|
FROM v2_st_daily
|
||||||
|
WHERE st_date BETWEEN CONCAT('{$data['sdate']} 00:00:00') AND CONCAT('{$data['edate']} 23:59:59')
|
||||||
|
GROUP BY cpid
|
||||||
|
)A
|
||||||
|
) table1
|
||||||
|
GROUP BY cpid ";
|
||||||
|
|
||||||
|
$sql .= ") AS t";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getRow()->cnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResultList($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
cpid,
|
||||||
|
SUM(t_cnt) t_cnt,
|
||||||
|
SUM(hong1_cnt) hong1_cnt,
|
||||||
|
SUM(hong2_cnt) hong2_cnt,
|
||||||
|
SUM(m_cnt) m_cnt,
|
||||||
|
SUM(v2_cnt) v2_cnt,
|
||||||
|
sum(total) total,
|
||||||
|
|
||||||
|
SUM(a) t_o,
|
||||||
|
SUM(b) t_x,
|
||||||
|
SUM(c) t_n,
|
||||||
|
SUM(d) t_e,
|
||||||
|
|
||||||
|
SUM(e) d_o,
|
||||||
|
SUM(f) d_x,
|
||||||
|
|
||||||
|
(SUM(a)+SUM(e)) dt_o,
|
||||||
|
(SUM(b)+SUM(f)) dt_x,
|
||||||
|
|
||||||
|
SUM(e)+SUM(f) d_tot,
|
||||||
|
SUM(a)+SUM(b)+SUM(c)+SUM(d) t_tot,
|
||||||
|
|
||||||
|
SUM(g) dt_tot,
|
||||||
|
|
||||||
|
SUM(h) r_o,
|
||||||
|
SUM(i) r_x,
|
||||||
|
SUM(h) r_e,
|
||||||
|
SUM(k) done,
|
||||||
|
SUM(l) r_tot,
|
||||||
|
|
||||||
|
SUM(m) s_1,
|
||||||
|
round((SUM(m) / total),2) s_2
|
||||||
|
FROM (
|
||||||
|
SELECT a.cpid,
|
||||||
|
COUNT(*) total
|
||||||
|
,SUM(CASE vrfc_type_sub WHEN 'D1' THEN 1 ELSE 0 END) hong1_cnt
|
||||||
|
,SUM(CASE vrfc_type_sub WHEN 'D2' THEN 1 ELSE 0 END) hong2_cnt
|
||||||
|
,SUM(CASE vrfc_type_sub WHEN 'M1' THEN 1 ELSE 0 END) m_cnt
|
||||||
|
,SUM(CASE vrfc_type_sub WHEN 'O1' THEN 1 ELSE 0 END) v2_cnt
|
||||||
|
,SUM(CASE vrfc_type_sub WHEN 'T1' THEN 1 ELSE 0 END) t_cnt
|
||||||
|
, 0 a,0 b,0 c,0 d,0 e,0 f,0 g,0 h,0 i,0 j,0 k, 0 l, 0 m
|
||||||
|
FROM v2_article_info a
|
||||||
|
INNER JOIN v2_vrfc_req b ON a.vr_sq = b.vr_sq
|
||||||
|
WHERE b.insert_tm BETWEEN CONCAT('{$data['sdate']} 00:00:00') AND CONCAT('{$data['edate']} 23:59:59')
|
||||||
|
GROUP BY a.cpid
|
||||||
|
|
||||||
|
UNION ALL
|
||||||
|
|
||||||
|
SELECT cpid
|
||||||
|
,0 ,0 ,0 ,0 ,0 ,0
|
||||||
|
,t_o,t_x,t_n,t_e
|
||||||
|
,d_o,d_x
|
||||||
|
,(t_o+t_x+t_n+t_e+d_o+d_x) AS dt_tot
|
||||||
|
,r_o,r_x,r_e
|
||||||
|
,(d_d+d_t) AS done
|
||||||
|
,(r_o+r_x+r_e) AS r_tot
|
||||||
|
,(r_o+r_e+d_d+d_t) AS s_1
|
||||||
|
FROM (
|
||||||
|
SELECT cpid,
|
||||||
|
SUM(CASE gbn_cd WHEN 'T0201' THEN cnt ELSE 0 END) t_o,
|
||||||
|
SUM(CASE gbn_cd WHEN 'T0202' THEN cnt ELSE 0 END) t_x,
|
||||||
|
SUM(CASE gbn_cd WHEN 'T0203' THEN cnt ELSE 0 END) t_n,
|
||||||
|
SUM(CASE gbn_cd WHEN 'T0204' THEN cnt ELSE 0 END) t_e,
|
||||||
|
SUM(CASE gbn_cd WHEN 'D0201' THEN cnt ELSE 0 END) d_o,
|
||||||
|
SUM(CASE gbn_cd WHEN 'D0202' THEN cnt ELSE 0 END) d_x,
|
||||||
|
SUM(CASE gbn_cd WHEN 'R0101' THEN cnt ELSE 0 END) r_o,
|
||||||
|
SUM(CASE gbn_cd WHEN 'R0102' THEN cnt ELSE 0 END) r_x,
|
||||||
|
SUM(CASE gbn_cd WHEN 'R0103' THEN cnt ELSE 0 END) r_e,
|
||||||
|
SUM(CASE gbn_cd WHEN 'D0205' THEN cnt ELSE 0 END) d_d,
|
||||||
|
SUM(CASE gbn_cd WHEN 'T0206' THEN cnt ELSE 0 END) d_t
|
||||||
|
FROM v2_st_daily
|
||||||
|
WHERE st_date BETWEEN CONCAT('{$data['sdate']} 00:00:00') AND CONCAT('{$data['edate']} 23:59:59')
|
||||||
|
GROUP BY cpid
|
||||||
|
)A
|
||||||
|
) table1
|
||||||
|
GROUP BY cpid ";
|
||||||
|
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
473
app/Models/results/M412Model.php
Normal file
473
app/Models/results/M412Model.php
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\results;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class M412Model extends Model
|
||||||
|
{
|
||||||
|
public function get_send_yn($data)
|
||||||
|
{
|
||||||
|
$sql = "
|
||||||
|
SELECT stop_yn
|
||||||
|
FROM v2_stop_api_chg_stat
|
||||||
|
WHERE `TYPE` = ?
|
||||||
|
ORDER BY pk DESC
|
||||||
|
LIMIT 1
|
||||||
|
";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$data]);
|
||||||
|
$row = $query->getRow();
|
||||||
|
|
||||||
|
return $row ? $row->stop_yn : 'N';
|
||||||
|
}
|
||||||
|
public function getTotalCount($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT COUNT(*) AS cnt FROM (
|
||||||
|
SELECT * FROM v2_st_daily a
|
||||||
|
WHERE a.st_date BETWEEN DATE('{$data['sdate']}') AND DATE('{$data['edate']}')
|
||||||
|
GROUP BY a.st_date, a.cpid
|
||||||
|
) AS t ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getRow()->cnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResultList($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
st_date,
|
||||||
|
cpid,
|
||||||
|
T0101, T0102, T0103,
|
||||||
|
T0201, T0202, T0203, T0204,
|
||||||
|
(T0201 + T0202 + T0203 + T0204) AS T0205,
|
||||||
|
T0301, T0302,
|
||||||
|
(T0101 + T0102 + T0103 - (T0201 + T0202 + T0203 + T0204)) AS T0303,
|
||||||
|
D0101, D0102, D0103,
|
||||||
|
D0201, D0202, D0203,
|
||||||
|
(D0201 + D0202 + D0203) AS D0204,
|
||||||
|
D0301, D0302,
|
||||||
|
(D0101 + D0102 + D0103 - (D0201 + D0202 + D0203)) AS D0303,
|
||||||
|
R0101, R0102, R0103,
|
||||||
|
(R0101 + R0102 + R0103) AS R0104,
|
||||||
|
R0105,
|
||||||
|
(T0101 + T0102 + T0103 + D0101 + D0102 + D0103) AS Z0101,
|
||||||
|
(T0201 + T0202 + T0203 + T0204 + D0201 + D0202 + D0203) AS Z0102,
|
||||||
|
(T0206 + D0205 + R0101 + R0103) AS Z0103,
|
||||||
|
(T0101 + T0102 + T0103 + D0101 + D0102 + D0103 - T0206 - D0205 - R0101 - R0103) AS Z0104,
|
||||||
|
A0101
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
a.st_date,
|
||||||
|
a.cpid,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'T0101' THEN COALESCE(a.cnt,0) ELSE 0 END) AS T0101,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'T0102' THEN COALESCE(a.cnt,0) ELSE 0 END) AS T0102,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'T0103' THEN COALESCE(a.cnt,0) ELSE 0 END) AS T0103,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'T0201' THEN COALESCE(a.cnt,0) ELSE 0 END) AS T0201,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'T0202' THEN COALESCE(a.cnt,0) ELSE 0 END) AS T0202,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'T0203' THEN COALESCE(a.cnt,0) ELSE 0 END) AS T0203,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'T0204' THEN COALESCE(a.cnt,0) ELSE 0 END) AS T0204,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'T0206' THEN COALESCE(a.cnt,0) ELSE 0 END) AS T0206,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'T0301' THEN COALESCE(a.cnt,0) ELSE 0 END) AS T0301,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'T0302' THEN COALESCE(a.cnt,0) ELSE 0 END) AS T0302,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'D0101' THEN COALESCE(a.cnt,0) ELSE 0 END) AS D0101,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'D0102' THEN COALESCE(a.cnt,0) ELSE 0 END) AS D0102,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'D0103' THEN COALESCE(a.cnt,0) ELSE 0 END) AS D0103,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'D0201' THEN COALESCE(a.cnt,0) ELSE 0 END) AS D0201,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'D0202' THEN COALESCE(a.cnt,0) ELSE 0 END) AS D0202,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'D0203' THEN COALESCE(a.cnt,0) ELSE 0 END) AS D0203,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'D0205' THEN COALESCE(a.cnt,0) ELSE 0 END) AS D0205,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'D0301' THEN COALESCE(a.cnt,0) ELSE 0 END) AS D0301,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'D0302' THEN COALESCE(a.cnt,0) ELSE 0 END) AS D0302,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'R0101' THEN COALESCE(a.cnt,0) ELSE 0 END) AS R0101,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'R0102' THEN COALESCE(a.cnt,0) ELSE 0 END) AS R0102,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'R0103' THEN COALESCE(a.cnt,0) ELSE 0 END) AS R0103,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'R0105' THEN COALESCE(a.cnt,0) ELSE 0 END) AS R0105,
|
||||||
|
SUM(CASE a.gbn_cd WHEN 'A0101' THEN COALESCE(a.cnt,0) ELSE 0 END) AS A0101
|
||||||
|
FROM v2_st_daily a
|
||||||
|
WHERE a.st_date BETWEEN DATE('{$data['sdate']}') AND DATE('{$data['edate']}')
|
||||||
|
GROUP BY a.st_date, a.cpid
|
||||||
|
) AS V_T ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 전송 타입 저장
|
||||||
|
public function saveSendType($data)
|
||||||
|
{
|
||||||
|
$sql = "INSERT INTO v2_stop_api_chg_stat(`type`, insert_date, stop_yn, usr_sq) ";
|
||||||
|
$sql .= "VALUES (?, NOW(), ?, ?) ";
|
||||||
|
|
||||||
|
$this->db->query($sql, [
|
||||||
|
$data['type'],
|
||||||
|
$data['yn'],
|
||||||
|
$data['usr_sq'],
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
if ($this->db->transStatus() === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => '저장실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 성공
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getLists($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
a.vr_sq,
|
||||||
|
j.usr_nm as reg_charger,
|
||||||
|
a.atcl_no,
|
||||||
|
a.cpid,
|
||||||
|
a.cp_atcl_id,
|
||||||
|
a.rlet_type_cd,
|
||||||
|
a.address1,
|
||||||
|
a.sise,
|
||||||
|
a.rdate,
|
||||||
|
a.seller_tel_no,
|
||||||
|
a.seller_nm,
|
||||||
|
a.realtor_nm,
|
||||||
|
a.realtor_tel_no,
|
||||||
|
a.rlet_type_cd,
|
||||||
|
a.charger,
|
||||||
|
b.insert_tm,
|
||||||
|
b.stat_cd,
|
||||||
|
c.bild_nm,
|
||||||
|
b.vrfc_type,
|
||||||
|
c.rm_no,
|
||||||
|
c.`floor`,
|
||||||
|
c.address_code,
|
||||||
|
c.address2,
|
||||||
|
m.address2a,
|
||||||
|
m.address2b,
|
||||||
|
c.address3,
|
||||||
|
c.trade_type,
|
||||||
|
c.deal_amt,
|
||||||
|
c.wrrnt_amt,
|
||||||
|
c.lease_amt,
|
||||||
|
c.isale_amt,
|
||||||
|
c.prem_amt,
|
||||||
|
c.sply_spc,
|
||||||
|
c.excls_spc,
|
||||||
|
c.tot_spc,
|
||||||
|
c.grnd_spc,
|
||||||
|
c.bldg_spc,
|
||||||
|
c.hscp_no,
|
||||||
|
c.ptp_no,
|
||||||
|
d.insert_tm as update_res_tm,
|
||||||
|
greatest(ifnull(d45.insert_tm, ''), ifnull(d49.insert_tm, '')) as rgbk_check_tm,
|
||||||
|
e.insert_tm as result_tm,
|
||||||
|
f.region_nm,
|
||||||
|
g.cd_nm as pre_stat,
|
||||||
|
h.cd_nm as vrfc_type,
|
||||||
|
i.usr_nm,
|
||||||
|
d2.insert_tm as stat_39_tm,
|
||||||
|
a.vrfc_type_sub,
|
||||||
|
a.reference_file_url_yn,
|
||||||
|
k.`comment` AS reg_conf_yn_info_2,
|
||||||
|
l.`comment` AS reg_conf_yn_info_3,
|
||||||
|
m.corp_own
|
||||||
|
FROM
|
||||||
|
v2_article_info a
|
||||||
|
JOIN v2_vrfc_req b ON a.vr_sq = b.vr_sq
|
||||||
|
JOIN v2_modify_info c ON a.vr_sq = c.vr_sq
|
||||||
|
LEFT JOIN v2_article_info_etc m ON a.vr_sq = m.vr_sq
|
||||||
|
LEFT JOIN region_codes f ON a.address_code = f.region_cd
|
||||||
|
LEFT JOIN v2_chg_stat d ON a.vr_sq = d.vr_sq AND d.stat_cd = '35'
|
||||||
|
LEFT JOIN v2_chg_stat d45 ON d45.vr_sq = a.vr_sq AND d45.stat_cd = '45'
|
||||||
|
LEFT JOIN v2_chg_stat d49 ON d49.vr_sq = a.vr_sq AND d49.stat_cd = '49'
|
||||||
|
LEFT JOIN v2_chg_stat e ON a.vr_sq = e.vr_sq AND e.stat_cd = '60'
|
||||||
|
LEFT JOIN codes g ON b.stat_cd = g.cd AND g.category = 'STEP_VERIFICATION'
|
||||||
|
LEFT JOIN codes h ON b.vrfc_type = h.cd AND h.category = 'VRFCREQ_WAY'
|
||||||
|
LEFT JOIN users i ON a.charger = i.usr_id
|
||||||
|
LEFT JOIN users j ON a.reg_charger = j.usr_id
|
||||||
|
LEFT JOIN v2_check_list k ON a.vr_sq = k.vr_sq AND k.`type` = '21'
|
||||||
|
LEFT JOIN v2_check_list l ON a.vr_sq = l.vr_sq AND l.type = '22'
|
||||||
|
LEFT JOIN v2_chg_stat d2 ON d2.vr_sq = a.vr_sq AND d2.stat_cd = '39'
|
||||||
|
|
||||||
|
WHERE
|
||||||
|
1=1 ";
|
||||||
|
|
||||||
|
if (!empty($data['stat_cd'])) {
|
||||||
|
$sql .= "AND b.stat_cd = {$data['stat_cd']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['sdate'])) {
|
||||||
|
$sql .= "AND b.insert_tm >= '{$data['sdate']} 00:00:00' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['edate'])) {
|
||||||
|
$sql .= "AND b.insert_tm <= '{$data['edate']} 00:00:00' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$sql .= "ORDER BY b.vr_sq desc , b.insert_tm desc ";
|
||||||
|
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function chgStat($vr_sq, $stat_cd, $usr_sq, $insert_tm)
|
||||||
|
{
|
||||||
|
$sql = "INSERT INTO v2_chg_stat (vr_sq, stat_cd, insert_user, insert_tm) ";
|
||||||
|
$sql .= "VALUES (?, ?, ?, ?) ";
|
||||||
|
$sql .= "ON DUPLICATE KEY UPDATE ";
|
||||||
|
$sql .= "UPDATE vr_sq=VALUES(vr_sq), stat_cd=VALUES(stat_cd), insert_user=VALUES(insert_user), insert_tm=VALUES(insert_tm) ";
|
||||||
|
|
||||||
|
$this->db->query($sql, [$vr_sq, $stat_cd, $usr_sq, $insert_tm]);
|
||||||
|
|
||||||
|
if ($this->db->transStatus() === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => 'v2_chg_stat 저장실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 성공
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function chgStatVrfc($vr_sq, $stat_cd)
|
||||||
|
{
|
||||||
|
$sql = "UPDATE v2_vrfc_req SET ";
|
||||||
|
$sql .= "stat_cd = ? ";
|
||||||
|
$sql .= "WHERE vr_sq = ? ";
|
||||||
|
|
||||||
|
$this->db->query($sql, [$stat_cd, $vr_sq]);
|
||||||
|
|
||||||
|
if ($this->db->transStatus() === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => 'v2_vrfc_req 저장실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 성공
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function chgStatFax($vr_sq, $stat_cd)
|
||||||
|
{
|
||||||
|
$sql = "UPDATE fax_imgs SET ";
|
||||||
|
$sql .= "stat_cd = ? ";
|
||||||
|
$sql .= "WHERE vr_sq = ? ";
|
||||||
|
|
||||||
|
$this->db->query($sql, [$stat_cd, $vr_sq]);
|
||||||
|
|
||||||
|
if ($this->db->transStatus() === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => 'fax_imgs 저장실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 성공
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 서류/전화 불일치 시간
|
||||||
|
public function getFaxFailTimeForHistory($vr_sq)
|
||||||
|
{
|
||||||
|
$sql = "select insert_tm from v2_chg_history" .
|
||||||
|
" where vr_sq = ?" .
|
||||||
|
" and stat_cd = '39'" .
|
||||||
|
" and chg_type= 'C9'" .
|
||||||
|
" order by seq desc" .
|
||||||
|
" limit 1 ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$vr_sq]);
|
||||||
|
|
||||||
|
return $query->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 서류/전화 인입시간
|
||||||
|
public function getSaveTimeForHistory($vr_sq)
|
||||||
|
{
|
||||||
|
$sql = "select insert_tm from v2_chg_history" .
|
||||||
|
" where vr_sq = ?" .
|
||||||
|
" and stat_cd = '30'" .
|
||||||
|
" and chg_type= 'C9'" .
|
||||||
|
" order by seq desc" .
|
||||||
|
" limit 1 ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$vr_sq]);
|
||||||
|
|
||||||
|
return $query->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 서류/전화 확인완료 시간 = 등기부등본 확인중 시간
|
||||||
|
public function getConfTimeForHistory($vr_sq)
|
||||||
|
{
|
||||||
|
$sql = "select insert_tm from v2_chg_history" .
|
||||||
|
" where vr_sq = ?" .
|
||||||
|
" and stat_cd = '35'" .
|
||||||
|
" and chg_type= 'C9'" .
|
||||||
|
" order by seq desc" .
|
||||||
|
" limit 1 ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$vr_sq]);
|
||||||
|
|
||||||
|
return $query->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 검증완료 시간
|
||||||
|
public function get_60_ForHistory($vr_sq)
|
||||||
|
{
|
||||||
|
$sql = "select insert_tm from v2_chg_history" .
|
||||||
|
" where vr_sq = ?" .
|
||||||
|
" and stat_cd = '60'" .
|
||||||
|
" and chg_type= 'C9'" .
|
||||||
|
" order by seq desc" .
|
||||||
|
" limit 1 ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$vr_sq]);
|
||||||
|
|
||||||
|
return $query->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function insert_v2_time_required_Conf_Done($atcl_no, $cpid, $vrfc_type, $insert_tm, $tel_doc_conf_dt, $finishTime)
|
||||||
|
{
|
||||||
|
if (substr($insert_tm, 0, 10) == substr($tel_doc_conf_dt, 0, 10)) {
|
||||||
|
switch ($vrfc_type) {
|
||||||
|
case 'D':
|
||||||
|
if (('12:00:00' < substr($insert_tm, -8)) && (substr($insert_tm, -8) < '13:00:00')) {//접수시간이 12~13시 사이면 13시로 해준다
|
||||||
|
if (substr($tel_doc_conf_dt, -8) > '13:00:00') { //검증완료가 13시 '이후'에 끝나면 접수시간을 13시로 변경해준다
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 13:00:00";
|
||||||
|
}
|
||||||
|
} else if (
|
||||||
|
(substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') && //접수와 확인완료시간이 모두 17:30:00 ~ 09:00:00 사이가 아니면
|
||||||
|
(substr($tel_doc_conf_dt, -8) < '17:30:00' || substr($tel_doc_conf_dt, -8) < '08:59:59')
|
||||||
|
) {
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 09:00:00";
|
||||||
|
}
|
||||||
|
;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'T':
|
||||||
|
if (('13:00:00' < substr($insert_tm, -8)) && (substr($insert_tm, -8) < '14:00:00')) {//접수시간이 13~14시 사이면 14시로 해준다
|
||||||
|
if (substr($tel_doc_conf_dt, -8) > '14:00:00') { //검증완료가 14시 '이후'에 끝나면 접수시간을 14시로 변경해준다
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 14:00:00";
|
||||||
|
}
|
||||||
|
} else if (
|
||||||
|
(substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') &&
|
||||||
|
(substr($tel_doc_conf_dt, -8) < '17:30:00' || substr($tel_doc_conf_dt, -8) < '08:59:59')
|
||||||
|
) { //접수와 확인완료시간이 모두 17:30:00 ~ 09:00:00 사이면
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 09:30:00";
|
||||||
|
}
|
||||||
|
;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($vrfc_type == 'D') { //홍보
|
||||||
|
if (substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') {
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 09:00:00";
|
||||||
|
}
|
||||||
|
} else { //전화
|
||||||
|
if (substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') {
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 09:30:00";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$stan_date = substr($insert_tm, 0, 10);
|
||||||
|
|
||||||
|
|
||||||
|
$sql = "INSERT INTO v2_time_required(stan_date, atcl_no, cpid, vrfc_type, insert_tm, tel_doc_conf_dt,conf_required_tm,tot_required_tm)" .
|
||||||
|
" VALUES(?, ?, ?, ?, ?, ?, TIMEDIFF(?,?), TIMEDIFF(?,?)) " .
|
||||||
|
" ON DUPLICATE KEY UPDATE insert_tm = VALUES(insert_tm), tel_doc_conf_dt=VALUES(tel_doc_conf_dt),conf_required_tm = VALUES(conf_required_tm),tot_required_tm = VALUES(tot_required_tm) ";
|
||||||
|
|
||||||
|
$this->db->query($sql, [
|
||||||
|
$stan_date,
|
||||||
|
$atcl_no,
|
||||||
|
$cpid,
|
||||||
|
$vrfc_type,
|
||||||
|
$insert_tm,
|
||||||
|
$tel_doc_conf_dt,
|
||||||
|
$tel_doc_conf_dt,
|
||||||
|
$insert_tm,
|
||||||
|
$tel_doc_conf_dt,
|
||||||
|
$insert_tm,
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($this->db->transStatus() === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => 'v2_time_required 저장실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 성공
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일자별 통계데이터에 값 집어 넣기...
|
||||||
|
* 반환값 없음.
|
||||||
|
* @param date $sd_date 날짜 값이 없을경우 현재날짜로 입력됨.
|
||||||
|
* @param string $cpid CPID
|
||||||
|
* @param string $gbn_cd 코드값 (category='STATISTICS_DAILY3')
|
||||||
|
* @param int $cnt 더할 숫자..
|
||||||
|
* @param string $cnt_type 숫자를 더할것인지.. 아니변 변경할것인지.
|
||||||
|
*/
|
||||||
|
public function set_v2_st_daily($st_date, $cpid, $gbn_cd, $cnt, $cnt_type = 'add')
|
||||||
|
{
|
||||||
|
if (empty($cnt))
|
||||||
|
$cnt = '0';
|
||||||
|
|
||||||
|
$sql_dup = "";
|
||||||
|
switch (strtolower($cnt_type)) {
|
||||||
|
case 'add':
|
||||||
|
$sql_dup = "on duplicate key update cnt = cnt + " . $cnt;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'change':
|
||||||
|
$sql_dup = "on duplicate key update cnt = values(cnt)";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (empty($st_date)) {
|
||||||
|
$sql = "insert into v2_st_daily (st_date, cpid, gbn_cd, cnt) values (now(), ?, ?, ?)" . $sql_dup;
|
||||||
|
$data =
|
||||||
|
[
|
||||||
|
$cpid,
|
||||||
|
$gbn_cd,
|
||||||
|
$cnt
|
||||||
|
]
|
||||||
|
;
|
||||||
|
} else {
|
||||||
|
$sql = "insert into v2_st_daily (st_date, cpid, gbn_cd, cnt) values (?, ?, ?, ?)" . $sql_dup;
|
||||||
|
$data = [
|
||||||
|
$st_date,
|
||||||
|
$cpid,
|
||||||
|
$gbn_cd,
|
||||||
|
$cnt
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->query($sql, $data);
|
||||||
|
|
||||||
|
$return['error_number'] = $this->db->_error_number();
|
||||||
|
$return['error_message'] = $this->db->_error_message();
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
}
|
||||||
158
app/Models/results/M415Model.php
Normal file
158
app/Models/results/M415Model.php
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\results;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class M415Model extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
public function getTotalCount($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT COUNT(*) AS cnt FROM ( ";
|
||||||
|
$sql .= "SELECT
|
||||||
|
*
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
stan_date,
|
||||||
|
'M' vrfc_type,
|
||||||
|
AVG((TIME_TO_SEC(conf_required_tm))) AS doc,
|
||||||
|
AVG((TIME_TO_SEC(cert_required_tm))) AS cert,
|
||||||
|
AVG((TIME_TO_SEC(tot_required_tm))) AS tot
|
||||||
|
FROM v2_time_required
|
||||||
|
WHERE stan_date BETWEEN '{$data['sdate']}' AND '{$data['edate']}'
|
||||||
|
AND vrfc_type IN ('M','O')
|
||||||
|
AND tot_required_tm IS NOT NULL
|
||||||
|
GROUP BY stan_date
|
||||||
|
|
||||||
|
UNION ALL
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
stan_date,
|
||||||
|
'T' vrfc_type,
|
||||||
|
AVG((TIME_TO_SEC(conf_required_tm))) AS doc,
|
||||||
|
AVG((TIME_TO_SEC(cert_required_tm))) AS cert,
|
||||||
|
AVG((TIME_TO_SEC(tot_required_tm))) AS tot
|
||||||
|
FROM v2_time_required
|
||||||
|
WHERE stan_date BETWEEN '{$data['sdate']}' AND '{$data['edate']}'
|
||||||
|
AND vrfc_type = 'T'
|
||||||
|
AND tot_required_tm IS NOT NULL
|
||||||
|
GROUP BY stan_date
|
||||||
|
|
||||||
|
UNION ALL
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
stan_date,
|
||||||
|
'D' vrfc_type,
|
||||||
|
AVG((TIME_TO_SEC(conf_required_tm))) AS doc,
|
||||||
|
AVG((TIME_TO_SEC(cert_required_tm))) AS cert,
|
||||||
|
AVG((TIME_TO_SEC(tot_required_tm))) AS tot
|
||||||
|
FROM v2_time_required
|
||||||
|
WHERE stan_date BETWEEN '{$data['sdate']}' AND '{$data['edate']}'
|
||||||
|
AND vrfc_type = 'D'
|
||||||
|
AND tot_required_tm IS NOT NULL
|
||||||
|
GROUP BY stan_date
|
||||||
|
|
||||||
|
UNION ALL
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
stan_date,
|
||||||
|
'N' vrfc_type,
|
||||||
|
AVG((TIME_TO_SEC(conf_required_tm))) AS doc,
|
||||||
|
AVG((TIME_TO_SEC(cert_required_tm))) AS cert,
|
||||||
|
AVG((TIME_TO_SEC(tot_required_tm))) AS tot
|
||||||
|
FROM v2_time_required
|
||||||
|
WHERE stan_date BETWEEN '{$data['sdate']}' AND '{$data['edate']}'
|
||||||
|
AND vrfc_type = 'N'
|
||||||
|
AND tot_required_tm IS NOT NULL
|
||||||
|
GROUP BY stan_date
|
||||||
|
|
||||||
|
|
||||||
|
) summary
|
||||||
|
GROUP BY stan_date ) AS t ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getRow()->cnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResultList($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
stan_date,
|
||||||
|
SUBSTR(SEC_TO_TIME(AVG(CASE vrfc_type WHEN 'M' THEN doc ELSE NULL END)),1,8) m_doc,
|
||||||
|
SUBSTR(SEC_TO_TIME(AVG(CASE vrfc_type WHEN 'M' THEN cert ELSE NULL END)),1,8) m_cert,
|
||||||
|
SUBSTR(SEC_TO_TIME(AVG(CASE vrfc_type WHEN 'M' THEN tot ELSE NULL END)),1,8) m_tot,
|
||||||
|
SUBSTR(SEC_TO_TIME(AVG(CASE vrfc_type WHEN 'T' THEN doc ELSE NULL END)),1,8) t_doc,
|
||||||
|
SUBSTR(SEC_TO_TIME(AVG(CASE vrfc_type WHEN 'T' THEN cert ELSE NULL END)),1,8) t_cert,
|
||||||
|
SUBSTR(SEC_TO_TIME(AVG(CASE vrfc_type WHEN 'T' THEN tot ELSE NULL END)),1,8) t_tot,
|
||||||
|
SUBSTR(SEC_TO_TIME(AVG(CASE vrfc_type WHEN 'D' THEN doc ELSE NULL END)),1,8) d_doc,
|
||||||
|
SUBSTR(SEC_TO_TIME(AVG(CASE vrfc_type WHEN 'D' THEN cert ELSE NULL END)),1,8) d_cert,
|
||||||
|
SUBSTR(SEC_TO_TIME(AVG(CASE vrfc_type WHEN 'D' THEN tot ELSE NULL END)),1,8) d_tot,
|
||||||
|
SUBSTR(SEC_TO_TIME(AVG(CASE vrfc_type WHEN 'N' THEN doc ELSE NULL END)),1,8) n_doc,
|
||||||
|
SUBSTR(SEC_TO_TIME(AVG(CASE vrfc_type WHEN 'N' THEN cert ELSE NULL END)),1,8) n_cert,
|
||||||
|
SUBSTR(SEC_TO_TIME(AVG(CASE vrfc_type WHEN 'N' THEN tot ELSE NULL END)),1,8) n_tot
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
stan_date,
|
||||||
|
'M' vrfc_type,
|
||||||
|
AVG((TIME_TO_SEC(conf_required_tm))) AS doc,
|
||||||
|
AVG((TIME_TO_SEC(cert_required_tm))) AS cert,
|
||||||
|
AVG((TIME_TO_SEC(tot_required_tm))) AS tot
|
||||||
|
FROM v2_time_required
|
||||||
|
WHERE stan_date BETWEEN '{$data['sdate']}' AND '{$data['edate']}'
|
||||||
|
AND vrfc_type IN ('M','O')
|
||||||
|
AND tot_required_tm IS NOT NULL
|
||||||
|
GROUP BY stan_date
|
||||||
|
|
||||||
|
UNION ALL
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
stan_date,
|
||||||
|
'T' vrfc_type,
|
||||||
|
AVG((TIME_TO_SEC(conf_required_tm))) AS doc,
|
||||||
|
AVG((TIME_TO_SEC(cert_required_tm))) AS cert,
|
||||||
|
AVG((TIME_TO_SEC(tot_required_tm))) AS tot
|
||||||
|
FROM v2_time_required
|
||||||
|
WHERE stan_date BETWEEN '{$data['sdate']}' AND '{$data['edate']}'
|
||||||
|
AND vrfc_type = 'T'
|
||||||
|
AND tot_required_tm IS NOT NULL
|
||||||
|
GROUP BY stan_date
|
||||||
|
|
||||||
|
UNION ALL
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
stan_date,
|
||||||
|
'D' vrfc_type,
|
||||||
|
AVG((TIME_TO_SEC(conf_required_tm))) AS doc,
|
||||||
|
AVG((TIME_TO_SEC(cert_required_tm))) AS cert,
|
||||||
|
AVG((TIME_TO_SEC(tot_required_tm))) AS tot
|
||||||
|
FROM v2_time_required
|
||||||
|
WHERE stan_date BETWEEN '{$data['sdate']}' AND '{$data['edate']}'
|
||||||
|
AND vrfc_type = 'D'
|
||||||
|
AND tot_required_tm IS NOT NULL
|
||||||
|
GROUP BY stan_date
|
||||||
|
|
||||||
|
UNION ALL
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
stan_date,
|
||||||
|
'N' vrfc_type,
|
||||||
|
AVG((TIME_TO_SEC(conf_required_tm))) AS doc,
|
||||||
|
AVG((TIME_TO_SEC(cert_required_tm))) AS cert,
|
||||||
|
AVG((TIME_TO_SEC(tot_required_tm))) AS tot
|
||||||
|
FROM v2_time_required
|
||||||
|
WHERE stan_date BETWEEN '{$data['sdate']}' AND '{$data['edate']}'
|
||||||
|
AND vrfc_type = 'N'
|
||||||
|
AND tot_required_tm IS NOT NULL
|
||||||
|
GROUP BY stan_date
|
||||||
|
|
||||||
|
|
||||||
|
) summary
|
||||||
|
GROUP BY stan_date ";
|
||||||
|
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
190
app/Models/results/M416Model.php
Normal file
190
app/Models/results/M416Model.php
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\results;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class M416Model extends Model
|
||||||
|
{
|
||||||
|
// 소속본부조회
|
||||||
|
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 getAreaList($sido = '', $gugun = '')
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!empty($gugun)) {
|
||||||
|
$gugun = substr($gugun, '0', '5');
|
||||||
|
|
||||||
|
$sql = "SELECT a.region_cd, TRIM(REPLACE(a.region_nm, b.region_nm, '')) region_nm" .
|
||||||
|
" FROM region_codes a" .
|
||||||
|
" LEFT JOIN region_codes b ON b.region_cd = CONCAT(SUBSTR(a.region_cd,1,5),'00000')" .
|
||||||
|
" WHERE a.region_cd LIKE concat(?, '%')" .
|
||||||
|
" AND a.region_cd NOT LIKE '%00000'" .
|
||||||
|
" AND a.region_cd LIKE '%00'" .
|
||||||
|
" AND a.use_yn = 'Y'" .
|
||||||
|
" ORDER BY a.region_nm ASC";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$gugun]);
|
||||||
|
|
||||||
|
} else if (!empty($sido)) {
|
||||||
|
$chk_sido = substr($sido, '0', '2');
|
||||||
|
|
||||||
|
if ($chk_sido === '36') {
|
||||||
|
$sido = substr($sido, '0', '4');
|
||||||
|
$sql = "SELECT a.region_cd, TRIM(REPLACE(a.region_nm, b.region_nm, '')) region_nm " .
|
||||||
|
"FROM region_codes a " .
|
||||||
|
"LEFT JOIN region_codes b ON b.region_cd = CONCAT(SUBSTR(a.region_cd,1,4),'000000') " .
|
||||||
|
"WHERE a.region_cd LIKE concat(?, '%') " .
|
||||||
|
"AND a.region_cd NOT LIKE '%000000' " .
|
||||||
|
"AND a.region_cd LIKE '%00' " .
|
||||||
|
"AND a.use_yn = 'Y' " .
|
||||||
|
"AND EXISTS (SELECT 'x' FROM region_codes c WHERE c.region_cd LIKE CONCAT(SUBSTR(a.region_cd,1,5),'%') AND c.region_cd > CONCAT(SUBSTR(a.region_cd,1,5),'00000')) " .
|
||||||
|
"ORDER BY a.region_nm ASC";
|
||||||
|
} else {
|
||||||
|
$sido = substr($sido, '0', '2');
|
||||||
|
$sql = "SELECT a.region_cd, TRIM(REPLACE(a.region_nm, b.region_nm, '')) region_nm" .
|
||||||
|
" FROM region_codes a" .
|
||||||
|
" LEFT JOIN region_codes b ON b.region_cd = CONCAT(SUBSTR(a.region_cd,1,2),'00000000')" .
|
||||||
|
" WHERE a.region_cd LIKE concat(?, '%')" .
|
||||||
|
" AND a.region_cd NOT LIKE '%00000000'" .
|
||||||
|
" AND a.region_cd LIKE '%00000'" .
|
||||||
|
" AND a.use_yn = 'Y'" .
|
||||||
|
" AND EXISTS (SELECT 'x' FROM region_codes c WHERE c.region_cd LIKE CONCAT(SUBSTR(a.region_cd,1,5),'%') AND c.region_cd > CONCAT(SUBSTR(a.region_cd,1,5),'00000'))" .
|
||||||
|
" ORDER BY a.region_nm ASC";
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$sido]);
|
||||||
|
} else {
|
||||||
|
$sql = "SELECT a.region_cd, a.region_nm " .
|
||||||
|
"FROM region_codes a " .
|
||||||
|
"WHERE (a.region_cd LIKE '%00000000' " .
|
||||||
|
"AND a.use_yn = 'Y') " .
|
||||||
|
"OR region_cd = 3611000000;";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getTotalCount($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT COUNT(*) AS cnt FROM (
|
||||||
|
SELECT
|
||||||
|
a.usr_id
|
||||||
|
FROM indi_distance_daily a
|
||||||
|
INNER JOIN users b ON a.usr_id = b.usr_id INNER JOIN departments c ON b.dept_sq = c.dept_sq
|
||||||
|
WHERE a.`date` BETWEEN '{$data['sdate']}' AND '{$data['edate']}' ";
|
||||||
|
|
||||||
|
if (!empty($data['bonbu'])) {
|
||||||
|
$sql .= "AND c.pdept_sq = {$data['bonbu']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['dept_sq'])) {
|
||||||
|
$sql .= "AND b.dept_sq = {$data['bonbu']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['srchTxt'])) {
|
||||||
|
if ($data['srchType'] == "1") {
|
||||||
|
$sql .= "AND a.usr_id LIKE CONCAT('%', '{$data['srchTxt']}', '%') ";
|
||||||
|
} else if ($data['srchType'] == "1") {
|
||||||
|
$sql .= "AND a.usr_nm LIKE CONCAT('%', '{$data['srchTxt']}', '%') ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND (
|
||||||
|
a.usr_id LIKE CONCAT('%', '{$data['srchTxt']}', '%')
|
||||||
|
OR a.usr_nm LIKE CONCAT('%', '{$data['srchTxt']}', '%')
|
||||||
|
) ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$sql .= "GROUP BY a.usr_id, a.usr_nm ) AS t";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getRow()->cnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getResultList($data)
|
||||||
|
{
|
||||||
|
$lastDay = (int) date('t', strtotime($data['edate']));
|
||||||
|
|
||||||
|
$sql = "SELECT
|
||||||
|
a.usr_id, a.usr_nm
|
||||||
|
, SUM(a.shoot_cnt) shoot_cnt ";
|
||||||
|
|
||||||
|
if ($lastDay > 0) {
|
||||||
|
for ($i = 1; $i <= $lastDay; $i++) {
|
||||||
|
$day2 = sprintf('%02d', $i);
|
||||||
|
$sql .= ", SUM(CASE WHEN DAY(a.date) = {$i} THEN distance ELSE 0 END) AS d{$day2}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= ", ROUND(SUM(a.distance),1) tot_distance ";
|
||||||
|
|
||||||
|
$sql .= "
|
||||||
|
FROM indi_distance_daily a
|
||||||
|
INNER JOIN users b ON a.usr_id = b.usr_id INNER JOIN departments c ON b.dept_sq = c.dept_sq
|
||||||
|
WHERE
|
||||||
|
a.`date` BETWEEN '{$data['sdate']}' AND '{$data['edate']}' ";
|
||||||
|
|
||||||
|
if (!empty($data['bonbu'])) {
|
||||||
|
$sql .= "AND c.pdept_sq = {$data['bonbu']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['dept_sq'])) {
|
||||||
|
$sql .= "AND b.dept_sq = {$data['bonbu']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['srchTxt'])) {
|
||||||
|
if ($data['srchType'] == "1") {
|
||||||
|
$sql .= "AND a.usr_id LIKE CONCAT('%', '{$data['srchTxt']}', '%') ";
|
||||||
|
} else if ($data['srchType'] == "1") {
|
||||||
|
$sql .= "AND a.usr_nm LIKE CONCAT('%', '{$data['srchTxt']}', '%') ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND (
|
||||||
|
a.usr_id LIKE CONCAT('%', '{$data['srchTxt']}', '%')
|
||||||
|
OR a.usr_nm LIKE CONCAT('%', '{$data['srchTxt']}', '%')
|
||||||
|
) ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= "GROUP BY a.usr_id, a.usr_nm ";
|
||||||
|
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
189
app/Models/results/M417Model.php
Normal file
189
app/Models/results/M417Model.php
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\results;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class M417Model extends Model
|
||||||
|
{
|
||||||
|
public function getDepart()
|
||||||
|
{
|
||||||
|
$sql = "SELECT * from departments " .
|
||||||
|
"WHERE pdept_sq = 3 " .
|
||||||
|
"ORDER BY dept_nm";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTotalCount($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
COUNT(*) AS cnt
|
||||||
|
FROM
|
||||||
|
users a
|
||||||
|
left join (
|
||||||
|
SELECT
|
||||||
|
CASE
|
||||||
|
a.insert_user WHEN 0 THEN 1
|
||||||
|
ELSE a.insert_user
|
||||||
|
END insert_user,
|
||||||
|
COUNT(*) total_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '10' THEN a.vr_sq ELSE NULL END ) receipt_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.stat_cd = '10' THEN a.vr_sq ELSE NULL END ) notassign_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.stat_cd = '10' THEN NULL ELSE a.vr_sq END ) assign_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.stat_cd = '19' THEN a.vr_sq ELSE NULL END ) cancel_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '30' THEN a.vr_sq ELSE NULL END ) phone_checking_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'D' AND a.stat_cd = '30' THEN a.vr_sq ELSE NULL END ) paper_checking_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '35' THEN a.vr_sq ELSE NULL END ) phone_complete_cnt , -- 전화확인 완료
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'D' AND a.stat_cd = '35' THEN a.vr_sq ELSE NULL END ) paper_complete_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '38' THEN a.vr_sq ELSE NULL END ) phone_all_cnt , -- 전화확인 전체
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '39' THEN a.vr_sq ELSE NULL END ) phone_fail_cnt , -- 전화확인 실패
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'D' AND a.stat_cd = '39' THEN a.vr_sq ELSE NULL END ) paper_fail_cnt ,
|
||||||
|
COUNT( DISTINCT case when (b.certRegister IS NOT NULL AND b.stat_cd = '60' AND a.stat_cd = '76') then a.vr_sq ELSE NULL END ) cert_same_reg_open ,
|
||||||
|
COUNT( DISTINCT case when (b.certRegister IS NOT NULL AND a.stat_cd = '77') then a.vr_sq ELSE NULL END ) cert_reg_fail_open,
|
||||||
|
COUNT( DISTINCT case when (b.referenceFileUrl IS NOT NULL AND b.stat_cd = '60' AND a.stat_cd = '76') then a.vr_sq ELSE NULL END ) reference_same_reg_open ,
|
||||||
|
COUNT( DISTINCT case when (b.referenceFileUrl IS NOT NULL AND a.stat_cd = '77') then a.vr_sq ELSE NULL END ) reference_reg_fail_open ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '40' THEN a.vr_sq ELSE NULL END ) reg_checking_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '45' THEN a.vr_sq ELSE NULL END ) reg_complete_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '70' THEN a.vr_sq ELSE NULL END ) reg_none , -- 등기부 등본 없음
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '86' THEN a.vr_sq ELSE NULL END ) real_top_RS ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '88' THEN a.vr_sq ELSE NULL END ) real_top_RF ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '87' THEN a.vr_sq ELSE NULL END ) real_top_GS ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '89' THEN a.vr_sq ELSE NULL END ) real_top_GF ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '49' THEN a.vr_sq ELSE NULL END ) reg_fail_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '60' THEN a.vr_sq ELSE NULL END ) complete_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.stat_cd = '60' THEN a.vr_sq ELSE NULL END ) complete_cnt1,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '69' THEN a.vr_sq ELSE NULL END ) fail_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.stat_cd = '69' THEN a.vr_sq ELSE NULL END ) fail_cnt1 ,
|
||||||
|
COUNT( CASE WHEN (a.stat_cd = '85') THEN a.vr_sq ELSE NULL END ) reg_fail_tempOpen ,
|
||||||
|
COUNT( CASE WHEN (a.stat_cd = '77') THEN a.vr_sq ELSE NULL END ) reg_fail_Open ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.stat_cd = '60' AND a.stat_cd = '80' THEN a.vr_sq ELSE NULL END ) same_reg_tempOpen ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.stat_cd = '60' AND a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) same_reg_open,
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '0' and a.stat_cd = '77' THEN a.vr_sq ELSE NULL END ) as referin_s0, -- 첨부파일 불일치 개인
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '1' and a.stat_cd = '77' THEN a.vr_sq ELSE NULL END ) as referin_s1, -- 첨부파일 불일치 위임장
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '2' and a.stat_cd = '77' THEN a.vr_sq ELSE NULL END ) as referin_s2, -- 첨부파일 불일치 법인
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '3' and a.stat_cd = '77' THEN a.vr_sq ELSE NULL END ) as referin_s3, -- 첨부파일 불일치 외국인
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '0' and b.stat_cd = '60' AND a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_n0, -- 첨부파일 일치 개인
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '1' and b.stat_cd = '60' AND a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_n1, -- 첨부파일 일치 위임장
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '2' and b.stat_cd = '60' AND a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_n2, -- 첨부파일 일치 법인
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '3' and b.stat_cd = '60' AND a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_n3, -- 첨부파일 일치 외국인
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '0' and a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_nn0,
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '1' and a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_nn1,
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '2' and a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_nn2,
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '3' and a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_nn3
|
||||||
|
FROM
|
||||||
|
v2_chg_stat_stats a
|
||||||
|
INNER JOIN v2_vrfc_req b ON b.vr_sq = a.vr_sq and b.vrfc_type = 'N'
|
||||||
|
LEFT JOIN v2_article_info_etc c1 on a.vr_sq = c1.vr_sq
|
||||||
|
|
||||||
|
WHERE 1 = 1 and a.insert_tm between CONCAT('{$data['sdate']}' , ':00') AND CONCAT('{$data['edate']}' , ':59') GROUP BY CASE a.insert_user WHEN 0 THEN 1 ELSE a.insert_user END ) b on b.insert_user = a.usr_sq
|
||||||
|
LEFT JOIN (
|
||||||
|
select
|
||||||
|
f1.insert_user,
|
||||||
|
count(distinct f1.vr_sq) mobile_upload
|
||||||
|
from v2_files f1
|
||||||
|
INNER JOIN v2_vrfc_req b ON b.vr_sq = f1.vr_sq and b.vrfc_type = 'N'
|
||||||
|
where
|
||||||
|
f1.insert_tm BETWEEN CONCAT('{$data['sdate']}' , ':00') AND CONCAT('{$data['edate']}' , ':59')
|
||||||
|
and f1.file_type = '2' and f1.use_yn = 'Y' group by f1.insert_user
|
||||||
|
) c on c.insert_user = a.usr_sq
|
||||||
|
WHERE (b.insert_user is not null or c.insert_user is not null) ";
|
||||||
|
|
||||||
|
if (!empty($data['dept_sq'])) {
|
||||||
|
$sql .= "AND a.dept_sq = {$data['dept_sq']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getRow()->cnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResultList($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
a.usr_sq,
|
||||||
|
a.usr_id,
|
||||||
|
a.usr_nm,
|
||||||
|
IFNULL(c.mobile_upload, 0)mobile_upload ,
|
||||||
|
b.*
|
||||||
|
FROM
|
||||||
|
users a
|
||||||
|
left join (
|
||||||
|
SELECT
|
||||||
|
CASE
|
||||||
|
a.insert_user WHEN 0 THEN 1
|
||||||
|
ELSE a.insert_user
|
||||||
|
END insert_user,
|
||||||
|
COUNT(*) total_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '10' THEN a.vr_sq ELSE NULL END ) receipt_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.stat_cd = '10' THEN a.vr_sq ELSE NULL END ) notassign_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.stat_cd = '10' THEN NULL ELSE a.vr_sq END ) assign_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.stat_cd = '19' THEN a.vr_sq ELSE NULL END ) cancel_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '30' THEN a.vr_sq ELSE NULL END ) phone_checking_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'D' AND a.stat_cd = '30' THEN a.vr_sq ELSE NULL END ) paper_checking_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '35' THEN a.vr_sq ELSE NULL END ) phone_complete_cnt , -- 전화확인 완료
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'D' AND a.stat_cd = '35' THEN a.vr_sq ELSE NULL END ) paper_complete_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '38' THEN a.vr_sq ELSE NULL END ) phone_all_cnt , -- 전화확인 전체
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'T' AND a.stat_cd = '39' THEN a.vr_sq ELSE NULL END ) phone_fail_cnt , -- 전화확인 실패
|
||||||
|
COUNT( DISTINCT CASE WHEN b.vrfc_type = 'D' AND a.stat_cd = '39' THEN a.vr_sq ELSE NULL END ) paper_fail_cnt ,
|
||||||
|
COUNT( DISTINCT case when (b.certRegister IS NOT NULL AND b.stat_cd = '60' AND a.stat_cd = '76') then a.vr_sq ELSE NULL END ) cert_same_reg_open ,
|
||||||
|
COUNT( DISTINCT case when (b.certRegister IS NOT NULL AND a.stat_cd = '77') then a.vr_sq ELSE NULL END ) cert_reg_fail_open,
|
||||||
|
COUNT( DISTINCT case when (b.referenceFileUrl IS NOT NULL AND b.stat_cd = '60' AND a.stat_cd = '76') then a.vr_sq ELSE NULL END ) reference_same_reg_open ,
|
||||||
|
COUNT( DISTINCT case when (b.referenceFileUrl IS NOT NULL AND a.stat_cd = '77') then a.vr_sq ELSE NULL END ) reference_reg_fail_open ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '40' THEN a.vr_sq ELSE NULL END ) reg_checking_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '45' THEN a.vr_sq ELSE NULL END ) reg_complete_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '70' THEN a.vr_sq ELSE NULL END ) reg_none , -- 등기부 등본 없음
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '86' THEN a.vr_sq ELSE NULL END ) real_top_RS ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '88' THEN a.vr_sq ELSE NULL END ) real_top_RF ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '87' THEN a.vr_sq ELSE NULL END ) real_top_GS ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '89' THEN a.vr_sq ELSE NULL END ) real_top_GF ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '49' THEN a.vr_sq ELSE NULL END ) reg_fail_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '60' THEN a.vr_sq ELSE NULL END ) complete_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.stat_cd = '60' THEN a.vr_sq ELSE NULL END ) complete_cnt1,
|
||||||
|
COUNT( DISTINCT CASE WHEN a.stat_cd = '69' THEN a.vr_sq ELSE NULL END ) fail_cnt ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.stat_cd = '69' THEN a.vr_sq ELSE NULL END ) fail_cnt1 ,
|
||||||
|
COUNT( CASE WHEN (a.stat_cd = '85') THEN a.vr_sq ELSE NULL END ) reg_fail_tempOpen ,
|
||||||
|
COUNT( CASE WHEN (a.stat_cd = '77') THEN a.vr_sq ELSE NULL END ) reg_fail_Open ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.stat_cd = '60' AND a.stat_cd = '80' THEN a.vr_sq ELSE NULL END ) same_reg_tempOpen ,
|
||||||
|
COUNT( DISTINCT CASE WHEN b.stat_cd = '60' AND a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) same_reg_open,
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '0' and a.stat_cd = '77' THEN a.vr_sq ELSE NULL END ) as referin_s0, -- 첨부파일 불일치 개인
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '1' and a.stat_cd = '77' THEN a.vr_sq ELSE NULL END ) as referin_s1, -- 첨부파일 불일치 위임장
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '2' and a.stat_cd = '77' THEN a.vr_sq ELSE NULL END ) as referin_s2, -- 첨부파일 불일치 법인
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '3' and a.stat_cd = '77' THEN a.vr_sq ELSE NULL END ) as referin_s3, -- 첨부파일 불일치 외국인
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '0' and b.stat_cd = '60' AND a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_n0, -- 첨부파일 일치 개인
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '1' and b.stat_cd = '60' AND a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_n1, -- 첨부파일 일치 위임장
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '2' and b.stat_cd = '60' AND a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_n2, -- 첨부파일 일치 법인
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '3' and b.stat_cd = '60' AND a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_n3, -- 첨부파일 일치 외국인
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '0' and a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_nn0,
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '1' and a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_nn1,
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '2' and a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_nn2,
|
||||||
|
COUNT( DISTINCT CASE WHEN ( ( if ( b.referenceFileUrl = '[]' , NULL , b.referenceFileUrl) ) IS NOT NULL ) and c1.ownerTypeCode = '3' and a.stat_cd = '76' THEN a.vr_sq ELSE NULL END ) as referin_nn3
|
||||||
|
FROM
|
||||||
|
v2_chg_stat_stats a
|
||||||
|
INNER JOIN v2_vrfc_req b ON b.vr_sq = a.vr_sq and b.vrfc_type = 'N'
|
||||||
|
LEFT JOIN v2_article_info_etc c1 on a.vr_sq = c1.vr_sq
|
||||||
|
|
||||||
|
WHERE 1 = 1 and a.insert_tm between CONCAT('{$data['sdate']}' , ':00') AND CONCAT('{$data['edate']}' , ':59') GROUP BY CASE a.insert_user WHEN 0 THEN 1 ELSE a.insert_user END ) b on b.insert_user = a.usr_sq
|
||||||
|
LEFT JOIN (
|
||||||
|
select
|
||||||
|
f1.insert_user,
|
||||||
|
count(distinct f1.vr_sq) mobile_upload
|
||||||
|
from v2_files f1
|
||||||
|
INNER JOIN v2_vrfc_req b ON b.vr_sq = f1.vr_sq and b.vrfc_type = 'N'
|
||||||
|
where
|
||||||
|
f1.insert_tm BETWEEN CONCAT('{$data['sdate']}' , ':00') AND CONCAT('{$data['edate']}' , ':59')
|
||||||
|
and f1.file_type = '2' and f1.use_yn = 'Y' group by f1.insert_user
|
||||||
|
) c on c.insert_user = a.usr_sq
|
||||||
|
WHERE (b.insert_user is not null or c.insert_user is not null) ";
|
||||||
|
|
||||||
|
if (!empty($data['dept_sq'])) {
|
||||||
|
$sql .= "AND a.dept_sq = {$data['dept_sq']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
304
app/Models/results/PersonModel.php
Normal file
304
app/Models/results/PersonModel.php
Normal file
@@ -0,0 +1,304 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\results;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class PersonModel extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
// 소속본부조회
|
||||||
|
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 getAreaList($sido = '', $gugun = '')
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!empty($gugun)) {
|
||||||
|
$gugun = substr($gugun, '0', '5');
|
||||||
|
|
||||||
|
$sql = "SELECT a.region_cd, TRIM(REPLACE(a.region_nm, b.region_nm, '')) region_nm" .
|
||||||
|
" FROM region_codes a" .
|
||||||
|
" LEFT JOIN region_codes b ON b.region_cd = CONCAT(SUBSTR(a.region_cd,1,5),'00000')" .
|
||||||
|
" WHERE a.region_cd LIKE concat(?, '%')" .
|
||||||
|
" AND a.region_cd NOT LIKE '%00000'" .
|
||||||
|
" AND a.region_cd LIKE '%00'" .
|
||||||
|
" AND a.use_yn = 'Y'" .
|
||||||
|
" ORDER BY a.region_nm ASC";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$gugun]);
|
||||||
|
|
||||||
|
} else if (!empty($sido)) {
|
||||||
|
$chk_sido = substr($sido, '0', '2');
|
||||||
|
|
||||||
|
if ($chk_sido === '36') {
|
||||||
|
$sido = substr($sido, '0', '4');
|
||||||
|
$sql = "SELECT a.region_cd, TRIM(REPLACE(a.region_nm, b.region_nm, '')) region_nm " .
|
||||||
|
"FROM region_codes a " .
|
||||||
|
"LEFT JOIN region_codes b ON b.region_cd = CONCAT(SUBSTR(a.region_cd,1,4),'000000') " .
|
||||||
|
"WHERE a.region_cd LIKE concat(?, '%') " .
|
||||||
|
"AND a.region_cd NOT LIKE '%000000' " .
|
||||||
|
"AND a.region_cd LIKE '%00' " .
|
||||||
|
"AND a.use_yn = 'Y' " .
|
||||||
|
"AND EXISTS (SELECT 'x' FROM region_codes c WHERE c.region_cd LIKE CONCAT(SUBSTR(a.region_cd,1,5),'%') AND c.region_cd > CONCAT(SUBSTR(a.region_cd,1,5),'00000')) " .
|
||||||
|
"ORDER BY a.region_nm ASC";
|
||||||
|
} else {
|
||||||
|
$sido = substr($sido, '0', '2');
|
||||||
|
$sql = "SELECT a.region_cd, TRIM(REPLACE(a.region_nm, b.region_nm, '')) region_nm" .
|
||||||
|
" FROM region_codes a" .
|
||||||
|
" LEFT JOIN region_codes b ON b.region_cd = CONCAT(SUBSTR(a.region_cd,1,2),'00000000')" .
|
||||||
|
" WHERE a.region_cd LIKE concat(?, '%')" .
|
||||||
|
" AND a.region_cd NOT LIKE '%00000000'" .
|
||||||
|
" AND a.region_cd LIKE '%00000'" .
|
||||||
|
" AND a.use_yn = 'Y'" .
|
||||||
|
" AND EXISTS (SELECT 'x' FROM region_codes c WHERE c.region_cd LIKE CONCAT(SUBSTR(a.region_cd,1,5),'%') AND c.region_cd > CONCAT(SUBSTR(a.region_cd,1,5),'00000'))" .
|
||||||
|
" ORDER BY a.region_nm ASC";
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$sido]);
|
||||||
|
} else {
|
||||||
|
$sql = "SELECT a.region_cd, a.region_nm " .
|
||||||
|
"FROM region_codes a " .
|
||||||
|
"WHERE (a.region_cd LIKE '%00000000' " .
|
||||||
|
"AND a.use_yn = 'Y') " .
|
||||||
|
"OR region_cd = 3611000000;";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTotalCount($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
COUNT(*) AS cnt
|
||||||
|
FROM result a
|
||||||
|
INNER JOIN users b ON b.usr_sq = a.usr_sq
|
||||||
|
INNER JOIN departments c ON c.dept_sq = a.dept_sq
|
||||||
|
INNER JOIN receipt d ON d.rcpt_sq = a.rcpt_sq
|
||||||
|
WHERE 1=1 ";
|
||||||
|
|
||||||
|
if (!empty($data['bonbu'])) {
|
||||||
|
$sql .= "AND c.pdept_sq = {$data['bonbu']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['team'])) {
|
||||||
|
$sql .= "AND c.dept_sq = {$data['team']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['schDateGb'])) {
|
||||||
|
if ($data['schDateGb'] === "1") {
|
||||||
|
|
||||||
|
if (!empty($data['sdate'])) {
|
||||||
|
$sql .= "AND a.rsrv_date >= CONCAT('{$data['sdate']} 00:00:00') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['edate'])) {
|
||||||
|
$sql .= "AND a.rsrv_date <= CONCAT('{$data['edate']} 23:59:59') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if ($data['schDateGb'] === "2") {
|
||||||
|
if (!empty($data['sdate'])) {
|
||||||
|
$sql .= "AND d.rcpt_tm >= CONCAT('{$data['sdate']} 00:00:00') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['edate'])) {
|
||||||
|
$sql .= "AND d.rcpt_tm <= CONCAT('{$data['edate']} 23:59:59') ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['srchTxt'])) {
|
||||||
|
if ($data['srchType'] === "1") {
|
||||||
|
$sql .= "AND usr_id like CONCAT('%', '{$data['srchTxt']}', '%' ) ";
|
||||||
|
} else if ($data['srchType'] === "2") {
|
||||||
|
$sql .= "AND usr_nm like CONCAT('%', '{$data['srchTxt']}', '%' ) ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND (
|
||||||
|
usr_id like CONCAT('%', '{$data['srchTxt']}', '%' )
|
||||||
|
OR usr_nm like CONCAT('%', '{$data['srchTxt']}', '%' )
|
||||||
|
) ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getRow()->cnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUserList($start, $end, $data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
b.usr_nm, b.usr_id, b.usr_sq, c.dept_sq, c.pdept_sq, c.depth
|
||||||
|
, count(distinct a.rcpt_sq) rcpt_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.cancel_dt IS NOT NULL THEN CASE WHEN a.result_cd2 IN ('9010','9020') THEN a.rcpt_sq END END) resv_cancel_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.assign_save_dt IS NOT NULL THEN a.rcpt_sq END) resv_assign_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.cancel_dt IS NOT NULL THEN CASE WHEN a.result_cd2 = '9030' THEN a.rcpt_sq END END) prev_visit_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.cancel_dt IS NOT NULL THEN CASE WHEN a.result_cd2 = '9040' THEN a.rcpt_sq END END) next_visit_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.cancel_dt IS NOT NULL THEN CASE WHEN a.result_cd2 = '9045' THEN a.rcpt_sq END END) next_shoot_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.photo_save_dt IS NOT NULL THEN a.rcpt_sq END) shoot_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.result_cd1 = '70' THEN a.rcpt_sq END) delay_confirm_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.result_cd2 = '9050' THEN a.rcpt_sq END) fail_confirm_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.result_cd1 = '60' THEN a.rcpt_sq END) confirm_cnt
|
||||||
|
FROM result a
|
||||||
|
INNER JOIN users b ON b.usr_sq = a.usr_sq
|
||||||
|
INNER JOIN departments c ON c.dept_sq = a.dept_sq
|
||||||
|
INNER JOIN receipt d ON d.rcpt_sq = a.rcpt_sq
|
||||||
|
WHERE 1=1 ";
|
||||||
|
|
||||||
|
if (!empty($data['bonbu'])) {
|
||||||
|
$sql .= "AND c.pdept_sq = {$data['bonbu']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['team'])) {
|
||||||
|
$sql .= "AND c.dept_sq = {$data['team']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['schDateGb'])) {
|
||||||
|
if ($data['schDateGb'] === "1") {
|
||||||
|
|
||||||
|
if (!empty($data['sdate'])) {
|
||||||
|
$sql .= "AND a.rsrv_date >= CONCAT('{$data['sdate']} 00:00:00') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['edate'])) {
|
||||||
|
$sql .= "AND a.rsrv_date <= CONCAT('{$data['edate']} 23:59:59') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if ($data['schDateGb'] === "2") {
|
||||||
|
if (!empty($data['sdate'])) {
|
||||||
|
$sql .= "AND d.rcpt_tm >= CONCAT('{$data['sdate']} 00:00:00') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['edate'])) {
|
||||||
|
$sql .= "AND d.rcpt_tm <= CONCAT('{$data['edate']} 23:59:59') ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['srchTxt'])) {
|
||||||
|
if ($data['srchType'] === "1") {
|
||||||
|
$sql .= "AND usr_id like CONCAT('%', '{$data['srchTxt']}', '%' ) ";
|
||||||
|
} else if ($data['srchType'] === "2") {
|
||||||
|
$sql .= "AND usr_nm like CONCAT('%', '{$data['srchTxt']}', '%' ) ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND (
|
||||||
|
usr_id like CONCAT('%', '{$data['srchTxt']}', '%' )
|
||||||
|
OR usr_nm like CONCAT('%', '{$data['srchTxt']}', '%' )
|
||||||
|
) ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$sql .= "GROUP BY b.usr_id, b.usr_nm ";
|
||||||
|
|
||||||
|
$sql .= "LIMIT {$start}, {$end}";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function getExcelUserList($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
b.usr_id AS '아이디'
|
||||||
|
, b.usr_nm AS '이름'
|
||||||
|
, count(distinct a.rcpt_sq) AS '접수'
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.cancel_dt IS NOT NULL THEN CASE WHEN a.result_cd2 IN ('9010','9020') THEN a.rcpt_sq END END) AS '예약취소'
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.assign_save_dt IS NOT NULL THEN a.rcpt_sq END) AS '예약확인'
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.cancel_dt IS NOT NULL THEN CASE WHEN a.result_cd2 = '9030' THEN a.rcpt_sq END END) AS '방문전취소'
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.cancel_dt IS NOT NULL THEN CASE WHEN a.result_cd2 = '9040' THEN a.rcpt_sq END END) AS '방문후취소'
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.cancel_dt IS NOT NULL THEN CASE WHEN a.result_cd2 = '9045' THEN a.rcpt_sq END END) AS '촬영후취소'
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.photo_save_dt IS NOT NULL THEN a.rcpt_sq END) AS '촬영'
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.result_cd1 = '70' THEN a.rcpt_sq END) AS '검수지연'
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.result_cd2 = '9050' THEN a.rcpt_sq END) AS '검수실패'
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.result_cd1 = '60' THEN a.rcpt_sq END) AS '검수완료'
|
||||||
|
FROM result a
|
||||||
|
INNER JOIN users b ON b.usr_sq = a.usr_sq
|
||||||
|
INNER JOIN departments c ON c.dept_sq = a.dept_sq
|
||||||
|
INNER JOIN receipt d ON d.rcpt_sq = a.rcpt_sq
|
||||||
|
WHERE 1=1 ";
|
||||||
|
|
||||||
|
if (!empty($data['bonbu'])) {
|
||||||
|
$sql .= "AND c.pdept_sq = {$data['bonbu']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['team'])) {
|
||||||
|
$sql .= "AND c.dept_sq = {$data['team']} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['schDateGb'])) {
|
||||||
|
if ($data['schDateGb'] === "1") {
|
||||||
|
|
||||||
|
if (!empty($data['sdate'])) {
|
||||||
|
$sql .= "AND a.rsrv_date >= CONCAT('{$data['sdate']} 00:00:00') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['edate'])) {
|
||||||
|
$sql .= "AND a.rsrv_date <= CONCAT('{$data['edate']} 23:59:59') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if ($data['schDateGb'] === "2") {
|
||||||
|
if (!empty($data['sdate'])) {
|
||||||
|
$sql .= "AND d.rcpt_tm >= CONCAT('{$data['sdate']} 00:00:00') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['edate'])) {
|
||||||
|
$sql .= "AND d.rcpt_tm <= CONCAT('{$data['edate']} 23:59:59') ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['srchTxt'])) {
|
||||||
|
if ($data['srchType'] === "1") {
|
||||||
|
$sql .= "AND usr_id like CONCAT('%', '{$data['srchTxt']}', '%' ) ";
|
||||||
|
} else if ($data['srchType'] === "2") {
|
||||||
|
$sql .= "AND usr_nm like CONCAT('%', '{$data['srchTxt']}', '%' ) ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND (
|
||||||
|
usr_id like CONCAT('%', '{$data['srchTxt']}', '%' )
|
||||||
|
OR usr_nm like CONCAT('%', '{$data['srchTxt']}', '%' )
|
||||||
|
) ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$sql .= "GROUP BY b.usr_id, b.usr_nm ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
57
app/Models/results/SummaryModel.php
Normal file
57
app/Models/results/SummaryModel.php
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\results;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class SummaryModel extends Model
|
||||||
|
{
|
||||||
|
public function st_s01($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
count(distinct a.rcpt_sq) rcpt_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.cancel_dt IS NOT NULL THEN CASE WHEN a.result_cd2 IN ('9010','9020') THEN a.rcpt_sq END END) resv_cancel_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.assign_save_dt IS NOT NULL THEN a.rcpt_sq END) resv_assign_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.cancel_dt IS NOT NULL THEN CASE WHEN a.result_cd2 = '9030' THEN a.rcpt_sq END END) prev_visit_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.cancel_dt IS NOT NULL THEN CASE WHEN a.result_cd2 = '9040' THEN a.rcpt_sq END END) next_visit_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.cancel_dt IS NOT NULL THEN CASE WHEN a.result_cd2 = '9045' THEN a.rcpt_sq END END) next_shoot_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.photo_save_dt IS NOT NULL THEN a.rcpt_sq END) shoot_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.result_cd1 = '70' THEN a.rcpt_sq END) delay_confirm_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.result_cd2 = '9050' THEN a.rcpt_sq END) fail_confirm_cnt
|
||||||
|
, COUNT(DISTINCT CASE WHEN a.result_cd1 = '60' THEN a.rcpt_sq END) confirm_cnt
|
||||||
|
FROM result a
|
||||||
|
INNER JOIN receipt b ON b.rcpt_sq = a.rcpt_sq
|
||||||
|
WHERE 1=1 ";
|
||||||
|
|
||||||
|
if ($data['schDateGb'] === "1") {
|
||||||
|
$sql .= " AND a.rsrv_date BETWEEN {$data['sdate']} AND {$data['edate']}";
|
||||||
|
} else {
|
||||||
|
$sql .= " AND b.rcpt_tm BETWEEN CONCAT({$data['sdate']}, ' 00:00:00') AND CONCAT({$data['edate']}, ' 23:59:59')";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function st_s01_2($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
a.agent_id, a.agent_nm, count(a.agent_id) rcpt_count, sum(case when b.photo_save_dt is null then 0 else 1 end) shoot_count
|
||||||
|
FROM
|
||||||
|
receipt AS a
|
||||||
|
INNER JOIN result AS b ON b.rcpt_sq = a.rcpt_sq
|
||||||
|
WHERE
|
||||||
|
a.rcpt_tm >= DATE('{$data['sdate']} 00:00:00')
|
||||||
|
AND a.rcpt_tm <= DATE('{$data['edate']} 23:59:59')
|
||||||
|
GROUP BY a.agent_id, a.agent_nm
|
||||||
|
HAVING count(a.agent_id) > 80
|
||||||
|
|
||||||
|
ORDER BY rcpt_count DESC ";
|
||||||
|
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -51,6 +51,7 @@
|
|||||||
<script src="https://code.jquery.com/jquery-3.6.0.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/sweetalert2@11"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/xlsx/dist/xlsx.full.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/xlsx/dist/xlsx.full.min.js"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/xlsx-js-style@1.2.0/dist/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
<link href="/architectui/assets/styles/vendors.98288b227c064e6a107f.css" rel="stylesheet">
|
<link href="/architectui/assets/styles/vendors.98288b227c064e6a107f.css" rel="stylesheet">
|
||||||
<link href="/architectui/assets/styles/main.98288b227c064e6a107f.css" rel="stylesheet">
|
<link href="/architectui/assets/styles/main.98288b227c064e6a107f.css" rel="stylesheet">
|
||||||
@@ -27,6 +27,123 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?= $this->renderSection('modals') ?>
|
<?= $this->renderSection('modals') ?>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
const tpl = document.querySelector('.my-loader-template')
|
||||||
|
const usrLevel = <?= session('usr_level') != null ? session('usr_level') : '' ?>
|
||||||
|
|
||||||
|
|
||||||
|
// 실적 조회
|
||||||
|
function goStats() {
|
||||||
|
|
||||||
|
if ($("#statDate").val() === "") {
|
||||||
|
Swal.fire({
|
||||||
|
title: "일자를 선택해 주세요.",
|
||||||
|
icon: "warning",
|
||||||
|
draggable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/home/viewStatData',
|
||||||
|
type: 'GET',
|
||||||
|
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||||
|
data: { s_date: $("#statDate").val() },
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
});
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage();
|
||||||
|
},
|
||||||
|
error: function (xhr) {
|
||||||
|
console.error("에러", xhr);
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
if (String(usrLevel) === "62") {
|
||||||
|
str = '실적 - 홍보확인서 : ' + data.paper_cnt + ' 건';
|
||||||
|
} else if (String(usrLevel) === "61") {
|
||||||
|
str = '실적 - 전화확인 : ' + data.phone_cnt + ' 건';
|
||||||
|
} else if (String(usrLevel) === "8") {
|
||||||
|
var sum = Number(data.reg_open_cnt) + Number(data.reg_tempOpen_cnt) + Number(data.real_top_R) + Number(data.real_top_G);
|
||||||
|
|
||||||
|
var deung = (Number(data.reg_open_cnt) / sum * 100).toFixed(0);
|
||||||
|
var ga = (Number(data.reg_tempOpen_cnt) / sum * 100).toFixed(0);
|
||||||
|
var real = (Number(data.real_top_R) / sum * 100).toFixed(0);
|
||||||
|
var real_ga = (Number(data.real_top_G) / sum * 100).toFixed(0);
|
||||||
|
|
||||||
|
str = '실적 - 등기부등본 : ' + data.reg_open_cnt + ' 건' + ' (' + (deung = + deung || 0) + '%)'
|
||||||
|
+ ' | 가열람 : ' + data.reg_tempOpen_cnt + ' 건' + ' (' + (ga = + ga || 0) + '%)'
|
||||||
|
+ ' | 리얼탑 열람 : ' + data.real_top_R + ' 건' + ' (' + (real = + real || 0) + '%)'
|
||||||
|
+ ' | 리얼탑 기열람 : ' + data.real_top_G + ' 건' + ' (' + (real_ga = + real_ga || 0) + '%)'
|
||||||
|
} else if (String(usrLevel) === "1" || String(usrLevel) === "60") {
|
||||||
|
str = '실적 - 홍보확인서 : ' + data.paper_cnt + ' 건 | 전화확인 : ' + data.phone_cnt + ' 건 | 등기부등본 : ' + data.reg_open_cnt + ' 건 | 가열람 : ' + data.reg_tempOpen_cnt + ' 건 ';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#statView').text(str);
|
||||||
|
playSlideIn('#statView');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 팩스조회
|
||||||
|
function clickFax() {
|
||||||
|
$.ajax({
|
||||||
|
url: '/home/getHomeFaxCount',
|
||||||
|
type: 'GET',
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
});
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage();
|
||||||
|
},
|
||||||
|
error: function (xhr) {
|
||||||
|
console.error("에러", xhr);
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
var total = parseInt(data.enfax_count) + parseInt(data.lgfax_count);
|
||||||
|
|
||||||
|
$('#fax1').text(data.base_time + '시 부터 : 엔팩스 ' + data.enfax_count + ' 건 | LG ' + data.lgfax_count + ' 건 | 총 ' + total + ' 건');
|
||||||
|
playSlideIn('#fax1');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function playSlideIn(selector) {
|
||||||
|
const $el = $(selector);
|
||||||
|
|
||||||
|
// 이전 애니메이션 클래스 제거
|
||||||
|
$el.removeClass('slide-in-left');
|
||||||
|
|
||||||
|
// 강제 리플로우(브라우저가 다시 계산하게 해서 애니메이션 재시작되도록)
|
||||||
|
// DOM 객체가 있는 경우에만
|
||||||
|
if ($el.length > 0 && $el[0]) {
|
||||||
|
void $el[0].offsetWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 새로 클래스 추가해서 애니메이션 시작
|
||||||
|
$el.addClass('slide-in-left');
|
||||||
|
|
||||||
|
// 애니메이션 끝나면 클래스 제거 (다음번에도 다시 재생되도록)
|
||||||
|
$el.one('animationend', function () {
|
||||||
|
$(this).removeClass('slide-in-left');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const today = new Date().toISOString().slice(0, 10);
|
||||||
|
document.getElementById("statDate").value = today;
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -1,3 +1,48 @@
|
|||||||
|
<style>
|
||||||
|
.no-wrap {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-divider {
|
||||||
|
width: 1px;
|
||||||
|
height: 22px;
|
||||||
|
background-color: rgba(0, 0, 0, 0);
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gap-2 {
|
||||||
|
gap: 1.5rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-stat-text,
|
||||||
|
.top-fax-text {
|
||||||
|
color: #000;
|
||||||
|
max-width: 520px;
|
||||||
|
/* white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
max-width: 400px; */
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 애니메이션 클래스 */
|
||||||
|
.slide-in-left {
|
||||||
|
animation: slideInLeft 0.5s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes slideInLeft {
|
||||||
|
from {
|
||||||
|
transform: translateX(-40px);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
transform: translateX(0);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<div class="app-header header-shadow">
|
<div class="app-header header-shadow">
|
||||||
<div class="app-header__logo">
|
<div class="app-header__logo">
|
||||||
<div class="logo-src"></div>
|
<div class="logo-src"></div>
|
||||||
@@ -31,6 +76,25 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="app-header__content">
|
<div class="app-header__content">
|
||||||
|
<div class="app-header-left d-flex flex-column flex-lg-row align-items-start align-items-lg-center gap-2">
|
||||||
|
<!-- 통계 -->
|
||||||
|
<div class="d-flex align-items-center gap-2 flex-nowrap">
|
||||||
|
<input type="date" class="form-control form-control-sm iText hasDatepicker" name="statDate"
|
||||||
|
id="statDate" style="width: 120px;">
|
||||||
|
<span onclick="goStats()" class="text-muted" style="cursor:pointer;">조회</span>
|
||||||
|
<span id="statView" class="top-stat-text">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header-divider d-none d-lg-block"></div>
|
||||||
|
|
||||||
|
<!-- 팩스 -->
|
||||||
|
<div class="d-flex align-items-center gap-2">
|
||||||
|
<span onclick="clickFax()" class="text-muted" style="cursor:pointer;">팩 스</span>
|
||||||
|
<span id="fax1" class="top-fax-text">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<!-- <div class="app-header-left">
|
<!-- <div class="app-header-left">
|
||||||
<div class="search-wrapper">
|
<div class="search-wrapper">
|
||||||
<div class="input-holder">
|
<div class="input-holder">
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const tpl = document.querySelector('.my-loader-template');
|
// const tpl = document.querySelector('.my-loader-template');
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
|
src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const editorKey = '5OA4gF4D3I3G3B6C4D-13TMIBDIa2NTMNZFFPFZe2a1Id1f1I1fA8D6C4F4G3H3I2A18A15A6==';
|
const editorKey = '5OA4gF4D3I3G3B6C4D-13TMIBDIa2NTMNZFFPFZe2a1Id1f1I1fA8D6C4F4G3H3I2A18A15A6==';
|
||||||
const tpl = document.querySelector('.my-loader-template');
|
// const tpl = document.querySelector('.my-loader-template');
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
editor = new FroalaEditor("#content", {
|
editor = new FroalaEditor("#content", {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
|
src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const editorKey = '5OA4gF4D3I3G3B6C4D-13TMIBDIa2NTMNZFFPFZe2a1Id1f1I1fA8D6C4F4G3H3I2A18A15A6==';
|
const editorKey = '5OA4gF4D3I3G3B6C4D-13TMIBDIa2NTMNZFFPFZe2a1Id1f1I1fA8D6C4F4G3H3I2A18A15A6==';
|
||||||
const tpl = document.querySelector('.my-loader-template');
|
// const tpl = document.querySelector('.my-loader-template');
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
editor = new FroalaEditor("#content", {
|
editor = new FroalaEditor("#content", {
|
||||||
|
|||||||
@@ -20,8 +20,15 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4 col-xl-4">
|
<div class="col-md-4 col-xl-4">
|
||||||
<div class="main-card mb-3 card">
|
<div class="main-card mb-3 card">
|
||||||
<div class="card-body">
|
<div class="card-header">
|
||||||
<h5 class="card-title">예약 미확정 매물 목록</h5>
|
<h5 class="card-title">예약 미확정 매물 목록</h5>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<a href="">
|
||||||
|
더보기 <small>></small>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="mb-0 table">
|
<table class="mb-0 table">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -60,8 +67,15 @@
|
|||||||
|
|
||||||
<div class="col-md-4 col-xl-4">
|
<div class="col-md-4 col-xl-4">
|
||||||
<div class="main-card mb-3 card">
|
<div class="main-card mb-3 card">
|
||||||
<div class="card-body">
|
<div class="card-header">
|
||||||
<h5 class="card-title">공지사항</h5>
|
<h5 class="card-title">공지사항</h5>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<a href="/board/notice/lists">
|
||||||
|
더보기 <small>></small>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="mb-0 table">
|
<table class="mb-0 table">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
@@ -99,8 +113,15 @@
|
|||||||
|
|
||||||
<div class="col-md-4 col-xl-4">
|
<div class="col-md-4 col-xl-4">
|
||||||
<div class="main-card mb-3 card">
|
<div class="main-card mb-3 card">
|
||||||
<div class="card-body">
|
<div class="card-header">
|
||||||
<h5 class="card-title">검수지연내역(녹취필요)</h5>
|
<h5 class="card-title">검수지연내역(녹취필요)</h5>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<a href="">
|
||||||
|
더보기 <small>></small>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="mb-0 table">
|
<table class="mb-0 table">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -140,8 +161,15 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4 col-xl-4">
|
<div class="col-md-4 col-xl-4">
|
||||||
<div class="main-card mb-3 card">
|
<div class="main-card mb-3 card">
|
||||||
<div class="card-body">
|
<div class="card-header">
|
||||||
<h5 class="card-title">검수지연내역(홍보확인서)</h5>
|
<h5 class="card-title">검수지연내역(홍보확인서)</h5>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<a href="">
|
||||||
|
더보기 <small>></small>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="mb-0 table">
|
<table class="mb-0 table">
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@@ -73,8 +73,8 @@
|
|||||||
<div class="card-body p-5">
|
<div class="card-body p-5">
|
||||||
<div class="text-center mb-5">
|
<div class="text-center mb-5">
|
||||||
<div class="app-logo mx-auto mb-4"></div>
|
<div class="app-logo mx-auto mb-4"></div>
|
||||||
<h1 class="fw-bold text-dark mb-2" style="font-size: 2rem;">Welcome Back!</h1>
|
<!-- <h1 class="fw-bold text-dark mb-2" style="font-size: 2rem;">환영합니다</h1> -->
|
||||||
<p class="text-muted fs-5 mb-0">Sign in to your account to continue</p>
|
<p class="text-muted fs-5 mb-0">아이디와 비밀번호를 적어 주세요.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form class="" id="frm_login_info">
|
<form class="" id="frm_login_info">
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button"
|
<button type="submit"
|
||||||
class="btn btn-gradient-primary btn-shadow btn-lg w-100 mb-4 fw-semibold text-white"
|
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;">
|
id="btn_login" style="border-radius: 16px; height: 58px; font-size: 1.1rem;">
|
||||||
<i class="fa fa-sign-in-alt me-2"></i>로그인
|
<i class="fa fa-sign-in-alt me-2"></i>로그인
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
<div class="text-center mt-4">
|
<div class="text-center mt-4">
|
||||||
<p class="text-white mb-0"
|
<p class="text-white mb-0"
|
||||||
style="font-size: 0.9rem; text-shadow: 0 1px 2px rgba(0,0,0,0.1);">
|
style="font-size: 0.9rem; text-shadow: 0 1px 2px rgba(0,0,0,0.1);">
|
||||||
Copyright © Confirms
|
Copyright © Confirms All Rights Reserved.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -138,10 +138,8 @@
|
|||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
console.log('login page loaded')
|
$("#frm_login_info").on("submit", function (e) {
|
||||||
|
e.preventDefault(); // 기본 submit 막기
|
||||||
|
|
||||||
$("#btn_login").on("click", function () {
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/login/chkLogin',
|
url: '/login/chkLogin',
|
||||||
|
|||||||
@@ -180,7 +180,7 @@
|
|||||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
const tpl = document.querySelector('.my-loader-template');
|
// const tpl = document.querySelector('.my-loader-template');
|
||||||
|
|
||||||
const bonbuArr = <?= json_encode($bonbu, JSON_UNESCAPED_UNICODE); ?>;
|
const bonbuArr = <?= json_encode($bonbu, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
const teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>;
|
const teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
|
|||||||
@@ -202,7 +202,7 @@
|
|||||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
const tpl = document.querySelector('.my-loader-template');
|
// const tpl = document.querySelector('.my-loader-template');
|
||||||
|
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
const tpl = document.querySelector('.my-loader-template');
|
// const tpl = document.querySelector('.my-loader-template');
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
let table = $('#userList').DataTable({
|
let table = $('#userList').DataTable({
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
const tpl = document.querySelector('.my-loader-template')
|
// const tpl = document.querySelector('.my-loader-template')
|
||||||
let date = new Date()
|
let date = new Date()
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|||||||
@@ -138,7 +138,7 @@
|
|||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/free-jqgrid/4.15.5/css/ui.jqgrid.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">
|
<script type="text/javascript">
|
||||||
|
|
||||||
const tpl = document.querySelector('.my-loader-template')
|
// const tpl = document.querySelector('.my-loader-template')
|
||||||
let date = new Date()
|
let date = new Date()
|
||||||
|
|
||||||
var tbl;
|
var tbl;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
<script src="/plugin/js/jqgrid/jstree.min.js"></script>
|
<script src="/plugin/js/jqgrid/jstree.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
const tpl = document.querySelector('.my-loader-template')
|
// const tpl = document.querySelector('.my-loader-template')
|
||||||
let date = new Date()
|
let date = new Date()
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
@@ -194,14 +194,14 @@
|
|||||||
},
|
},
|
||||||
beforeSend: function () {
|
beforeSend: function () {
|
||||||
// 호출 직전에 실행
|
// 호출 직전에 실행
|
||||||
console.log("로딩 시작");
|
|
||||||
blockUI.blockPage({
|
blockUI.blockPage({
|
||||||
message: tpl
|
message: tpl
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
complete: function () {
|
complete: function () {
|
||||||
// 완료 시(성공/실패 모두)
|
// 완료 시(성공/실패 모두)
|
||||||
console.log("로딩 종료");
|
|
||||||
blockUI.unblockPage();
|
blockUI.unblockPage();
|
||||||
},
|
},
|
||||||
error: function (xhr) {
|
error: function (xhr) {
|
||||||
|
|||||||
@@ -224,7 +224,7 @@
|
|||||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
const tpl = document.querySelector('.my-loader-template');
|
// const tpl = document.querySelector('.my-loader-template');
|
||||||
|
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|||||||
@@ -196,7 +196,7 @@
|
|||||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
const tpl = document.querySelector('.my-loader-template');
|
// const tpl = document.querySelector('.my-loader-template');
|
||||||
|
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
const tpl = document.querySelector('.my-loader-template')
|
// const tpl = document.querySelector('.my-loader-template')
|
||||||
let date = new Date()
|
let date = new Date()
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|||||||
@@ -307,7 +307,7 @@
|
|||||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
const tpl = document.querySelector('.my-loader-template');
|
// const tpl = document.querySelector('.my-loader-template');
|
||||||
var teamArr = <?= json_encode($teamList, JSON_UNESCAPED_UNICODE); ?>;
|
var teamArr = <?= json_encode($teamList, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
|
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
|
|||||||
553
app/Views/pages/results/assign/stats_a01.php
Normal file
553
app/Views/pages/results/assign/stats_a01.php
Normal file
@@ -0,0 +1,553 @@
|
|||||||
|
<?= $this->extend('layouts/main') ?>
|
||||||
|
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<style>
|
||||||
|
th {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#userList tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blockUI {
|
||||||
|
z-index: 1500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swal2-cancel {
|
||||||
|
background-color: #ff0000 !important;
|
||||||
|
color: #fff !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;">
|
||||||
|
|
||||||
|
<!-- 1줄 -->
|
||||||
|
<div class="row mb-3">
|
||||||
|
<!-- 관할조직 -->
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label class="form-label mb-1">관할조직</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-6">
|
||||||
|
<select class="form-control" name="bonbu" id="bonbu">
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($bonbu as $d): ?>
|
||||||
|
<option value="<?= $d['dept_sq'] ?>"><?= $d['dept_nm'] ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<select class="form-control" name="dept_sq" id="dept_sq">
|
||||||
|
<option value="">선택</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 유형 -->
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">유형</label>
|
||||||
|
<select class="form-control" name="schDateGb">
|
||||||
|
<option value="1">예약일자</option>
|
||||||
|
<option value="2">등록일자</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 기준일자 -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">기준일자</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="sdate" name="sdate">
|
||||||
|
</div>
|
||||||
|
<div class="col-2 d-flex align-items-center justify-content-center">~</div>
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="edate" name="edate">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 지역검색 -->
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label class="form-label mb-1">지역검색</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-4">
|
||||||
|
<select class="form-control" name="srcSido" id="srcSido">
|
||||||
|
<option value="">시/도</option>
|
||||||
|
<?php foreach ($sido as $s): ?>
|
||||||
|
<option value="<?= $s['region_cd'] ?>"><?= $s['region_nm'] ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<select class="form-control" name="srcGugun" id="srcGugun">
|
||||||
|
<option value="">시/군/구</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<select class="form-control" name="srcDong" id="srcDong">
|
||||||
|
<option value="">읍/면/동</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 2줄 -->
|
||||||
|
<div class="row mb-3">
|
||||||
|
<!-- 검색유형 -->
|
||||||
|
<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>
|
||||||
|
</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 align-items-end">
|
||||||
|
<button type="button" class="btn btn-primary" id="btnSearch">검색</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12 col-xl-12">
|
||||||
|
<div class="main-card mb-3 card">
|
||||||
|
<div class="card-header d-flex align-items-center">
|
||||||
|
<h3 class="card-title mb-0">사용자 목록</h3>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<button class="mb-2 me-2 border-0 btn-transition btn btn-shadow btn-outline-success"
|
||||||
|
id="excel-download">엑셀다운로드</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table id="userList" class="table table-hover table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th rowspan="2">순번</th>
|
||||||
|
<th rowspan="2">아이디</th>
|
||||||
|
<th rowspan="2">이름</th>
|
||||||
|
<th colspan="5" style="text-align: center;">오전</th>
|
||||||
|
<th colspan="8" style="text-align: center;">오후</th>
|
||||||
|
<th rowspan="2">합계</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th width="50">무관</th>
|
||||||
|
<th width="50">9</th>
|
||||||
|
<th width="50">10</th>
|
||||||
|
<th width="50">11</th>
|
||||||
|
<th width="50">12</th>
|
||||||
|
|
||||||
|
<th width="50">무관</th>
|
||||||
|
<th width="50">1</th>
|
||||||
|
<th width="50">2</th>
|
||||||
|
<th width="50">3</th>
|
||||||
|
<th width="50">4</th>
|
||||||
|
<th width="50">5</th>
|
||||||
|
<th width="50">6</th>
|
||||||
|
<th width="50">7</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</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');
|
||||||
|
var teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
|
|
||||||
|
let date = new Date();
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
$("#bonbu").on("change", function (e) {
|
||||||
|
|
||||||
|
var dept_sq = e.target.value
|
||||||
|
|
||||||
|
$("#dept_sq").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>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#dept_sq").append(str)
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#srcSido, #srcGugun").on("change", function (e) {
|
||||||
|
|
||||||
|
const targetId = this.id;
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/manage/areas/getAreaList",
|
||||||
|
method: "POST",
|
||||||
|
dataType: "json",
|
||||||
|
data: {
|
||||||
|
'srcSido': $("#frm_srch_info [name=srcSido]").val(),
|
||||||
|
'srcGugun': $("#frm_srch_info [name=srcGugun]").val(),
|
||||||
|
},
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
|
||||||
|
switch (targetId) {
|
||||||
|
case "srcSido":
|
||||||
|
$("#srcGugun").empty()
|
||||||
|
var str = "";
|
||||||
|
str += "<option value=''>시/군/구</option>";
|
||||||
|
|
||||||
|
if (result.length > 0) {
|
||||||
|
for (var i = 0; i < result.length; i++) {
|
||||||
|
str += "<option value='" + result[i]['region_cd'] + "'>" + result[i].region_nm + "</option>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#srcGugun").append(str);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "srcGugun":
|
||||||
|
$("#srcDong").empty()
|
||||||
|
var str = "";
|
||||||
|
str += "<option value=''>읍/면/동</option>";
|
||||||
|
|
||||||
|
if (result.length > 0) {
|
||||||
|
for (var i = 0; i < result.length; i++) {
|
||||||
|
str += "<option value='" + result[i]['region_cd'] + "'>" + result[i].region_nm + "</option>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#srcDong").append(str);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
let table = $('#userList').DataTable({
|
||||||
|
language: lang_kor,
|
||||||
|
processing: true,
|
||||||
|
serverSide: false,
|
||||||
|
ajax: {
|
||||||
|
url: '/results/assign/getUserList',
|
||||||
|
type: 'GET',
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
data: function (d) {
|
||||||
|
d.schDateGb = $("#frm_srch_info [name=schDateGb]").val()
|
||||||
|
d.sdate = $("#frm_srch_info [name=sdate]").val()
|
||||||
|
d.edate = $("#frm_srch_info [name=edate]").val()
|
||||||
|
|
||||||
|
d.bonbu = $("#frm_srch_info [name=bonbu]").val()
|
||||||
|
d.team = $("#frm_srch_info [name=dept_sq]").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, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] },
|
||||||
|
],
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
"data": null,
|
||||||
|
"width": "50px",
|
||||||
|
"render": function (data, type, row, meta) {
|
||||||
|
return meta.row + meta.settings._iDisplayStart + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ data: 'usr_id' },
|
||||||
|
{ data: 'usr_nm' },
|
||||||
|
{ data: 'AMETC' },
|
||||||
|
{ data: 'AM09' },
|
||||||
|
{ data: 'AM10' },
|
||||||
|
{ data: 'AM11' },
|
||||||
|
{ data: 'AM12' },
|
||||||
|
{ data: 'PMETC' },
|
||||||
|
{ data: 'PM01' },
|
||||||
|
{ data: 'PM02' },
|
||||||
|
{ data: 'PM03' },
|
||||||
|
{ data: 'PM04' },
|
||||||
|
{ data: 'PM05' },
|
||||||
|
{ data: 'PM06' },
|
||||||
|
{ data: 'PM07' },
|
||||||
|
{ data: 'TODAY' },
|
||||||
|
],
|
||||||
|
// 옵션들 예시
|
||||||
|
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();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀다운 click
|
||||||
|
$("#excel-download").on("click", function () {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/results/assign/excel",
|
||||||
|
method: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
data: $("#frm_srch_info").serialize(),
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
// downloadExcel(result.data);
|
||||||
|
downloadExcelWithHeader(result.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
function downloadExcelWithHeader(dataRows) {
|
||||||
|
// 1) 헤더 (16컬럼)
|
||||||
|
const header1 = [
|
||||||
|
"아이디", "이름",
|
||||||
|
"오전", "", "", "", "",
|
||||||
|
"오후", "", "", "", "", "", "", "",
|
||||||
|
"합계"
|
||||||
|
];
|
||||||
|
|
||||||
|
const header2 = [
|
||||||
|
"", "",
|
||||||
|
"무관", "9", "10", "11", "12",
|
||||||
|
"무관", "1", "2", "3", "4", "5", "6", "7",
|
||||||
|
""
|
||||||
|
];
|
||||||
|
|
||||||
|
// 2) 바디 (16컬럼 정확히 맞춤)
|
||||||
|
const body = dataRows.map(r => ([
|
||||||
|
r.usr_id,
|
||||||
|
r.usr_nm,
|
||||||
|
r.AMETC, r.AM09, r.AM10, r.AM11, r.AM12,
|
||||||
|
r.PMETC, r.PM01, r.PM02, r.PM03, r.PM04, r.PM05, r.PM06, r.PM07,
|
||||||
|
r.TODAY
|
||||||
|
]));
|
||||||
|
|
||||||
|
const aoa = [header1, header2, ...body];
|
||||||
|
|
||||||
|
// 3) 시트 생성
|
||||||
|
const ws = XLSX.utils.aoa_to_sheet(aoa);
|
||||||
|
|
||||||
|
// 4) 병합(colspan / rowspan)
|
||||||
|
ws["!merges"] = [
|
||||||
|
// 아이디, 이름 (rowspan 2)
|
||||||
|
{ s: { r: 0, c: 0 }, e: { r: 1, c: 0 } }, // A1:A2
|
||||||
|
{ s: { r: 0, c: 1 }, e: { r: 1, c: 1 } }, // B1:B2
|
||||||
|
|
||||||
|
// 오전 (colspan 5)
|
||||||
|
{ s: { r: 0, c: 2 }, e: { r: 0, c: 6 } }, // C1:G1
|
||||||
|
|
||||||
|
// 오후 (colspan 8)
|
||||||
|
{ s: { r: 0, c: 7 }, e: { r: 0, c: 14 } }, // H1:O1
|
||||||
|
|
||||||
|
// 합계 (rowspan 2)
|
||||||
|
{ s: { r: 0, c: 15 }, e: { r: 1, c: 15 } }, // P1:P2
|
||||||
|
];
|
||||||
|
|
||||||
|
ws['!cols'] = [
|
||||||
|
{ wpx: 80 }, // A: 아이디
|
||||||
|
{ wpx: 100 }, // B: 이름
|
||||||
|
{ wpx: 50 }, // C: 오전-무관
|
||||||
|
{ wpx: 50 }, // D: 오전-9
|
||||||
|
{ wpx: 50 }, // E: 오전-10
|
||||||
|
{ wpx: 50 }, // F: 오전-11
|
||||||
|
{ wpx: 50 }, // G: 오전-12
|
||||||
|
{ wpx: 50 }, // H: 오후-무관
|
||||||
|
{ wpx: 50 }, // I: 오후-1
|
||||||
|
{ wpx: 50 }, // J: 오후-2
|
||||||
|
{ wpx: 50 }, // K: 오후-3
|
||||||
|
{ wpx: 50 }, // L: 오후-4
|
||||||
|
{ wpx: 50 }, // M: 오후-5
|
||||||
|
{ wpx: 50 }, // N: 오후-6
|
||||||
|
{ wpx: 50 }, // O: 오후-7
|
||||||
|
{ wpx: 60 }, // P: 합계
|
||||||
|
];
|
||||||
|
|
||||||
|
// 6) 저장
|
||||||
|
const wb = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
|
||||||
|
|
||||||
|
XLSX.writeFile(
|
||||||
|
wb,
|
||||||
|
"현장확인인원별배정현황" + getDateTimeString() + ".xlsx"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
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: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ 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}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("DOMContentLoaded", function () {
|
||||||
|
// 오늘 날짜
|
||||||
|
const today = new Date();
|
||||||
|
|
||||||
|
// 이번 달 1일
|
||||||
|
const firstDay = new Date(today.getFullYear(), today.getMonth(), 1);
|
||||||
|
|
||||||
|
// 이번 달 말일 (다음달 0일 = 이번달 말일)
|
||||||
|
const lastDay = new Date(today.getFullYear(), today.getMonth() + 1, 0);
|
||||||
|
|
||||||
|
// yyyy-mm-dd 형태로 변환
|
||||||
|
const toDate = (d) => d.toISOString().split("T")[0];
|
||||||
|
|
||||||
|
document.getElementById("sdate").value = toDate(firstDay);
|
||||||
|
document.getElementById("edate").value = toDate(lastDay);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
298
app/Views/pages/results/dept/stats_d01.php
Normal file
298
app/Views/pages/results/dept/stats_d01.php
Normal file
@@ -0,0 +1,298 @@
|
|||||||
|
<?= $this->extend('layouts/main') ?>
|
||||||
|
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<style>
|
||||||
|
th {
|
||||||
|
font-size: 11px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#smsList 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-body">
|
||||||
|
<form class="row align-items-end" method="post" id="frm_srch_info">
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label class="form-label mb-1">관할조직</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-6">
|
||||||
|
<select class="form-control" name="bonbu" id="bonbu">
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php
|
||||||
|
$selected = "";
|
||||||
|
foreach ($bonbu as $d): ?>
|
||||||
|
<?php if ($pBonbu === $d['dept_sq']):
|
||||||
|
$selected = "selected";
|
||||||
|
else:
|
||||||
|
$selected = "";
|
||||||
|
endif; ?>
|
||||||
|
<option value="<?= $d['dept_sq'] ?>" <?= $selected; ?>><?= $d['dept_nm'] ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<select class="form-control" name="dept_sq" id="dept_sq">
|
||||||
|
<?php if (!empty($pBonbu)): ?>
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($team as $t): ?>
|
||||||
|
<?php
|
||||||
|
$selected2 = "";
|
||||||
|
if ($t['pdept_sq'] === $pBonbu): ?>
|
||||||
|
<?php if ($pDeptSq === $t['dept_sq']):
|
||||||
|
$selected2 = "selected";
|
||||||
|
else:
|
||||||
|
$selected2 = "";
|
||||||
|
endif; ?>
|
||||||
|
<option value="<?= $t['dept_sq'] ?>" <?= $selected2 ?>><?= $t['dept_nm'] ?></option>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php endif; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">유형</label>
|
||||||
|
<select class="form-control" name="schDateGb">
|
||||||
|
<option value="1" <?= $schDateGb == '1' ? 'selected' : '' ?>>예약일자</option>
|
||||||
|
<option value="2" <?= $schDateGb == '2' ? 'selected' : '' ?>>등록일자</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">기준일자</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="sdate" name="sdate" value="<?= $sdate ?>" />
|
||||||
|
</div>
|
||||||
|
<div class="col-2 d-flex align-items-center justify-content-center">~</div>
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="edate" name="edate" value="<?= $edate ?>" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1 d-grid">
|
||||||
|
<button type="submit" 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 d-flex align-items-center">
|
||||||
|
<h3 class="card-title mb-0">요약 실적</h3>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<button class="mb-2 me-2 border-0 btn-transition btn btn-shadow btn-outline-success"
|
||||||
|
id="excel-download">엑셀다운로드</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<table class="table table-hover table-striped table-bordered">
|
||||||
|
<!-- <caption>조직별 실적</caption> -->
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>순번</th>
|
||||||
|
<th>조직명</th>
|
||||||
|
<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>
|
||||||
|
<?php
|
||||||
|
if (!empty($st_list)) {
|
||||||
|
$nRow = 1;
|
||||||
|
foreach ($st_list as $row) {
|
||||||
|
|
||||||
|
// if ($row['depth'] == '1') {
|
||||||
|
// $rowPars = array_merge($pars, array('bonbu' => $row['dept_sq']));
|
||||||
|
// } else {
|
||||||
|
// $rowPars = array_merge($pars, array('bonbu' => $row['pdept_sq'], 'dept_sq' => $row['dept_sq']));
|
||||||
|
// }
|
||||||
|
|
||||||
|
echo '<tr onmouseover="this.className=\'highlight\'" onmouseout="this.className=\'normal\'" style="cursor:pointer">';
|
||||||
|
echo '<td>' . $nRow . '</td>';
|
||||||
|
echo '<td style="text-align:left">' . str_replace(' ', ' ', $row['dept_nm']) . '</td>';
|
||||||
|
echo '<td>' . $row['region_cnt'] . '</td>';
|
||||||
|
echo '<td>' . (empty($row['rcpt_cnt']) ? '-' : $row['rcpt_cnt']) . '</td>';
|
||||||
|
echo '<td>' . (empty($row['resv_cancel_cnt']) ? '-' : $row['resv_cancel_cnt']) . '</td>';
|
||||||
|
echo '<td>' . (empty($row['resv_assign_cnt']) ? '-' : $row['resv_assign_cnt']) . '</td>';
|
||||||
|
echo '<td>' . (empty($row['prev_visit_cnt']) ? '-' : $row['prev_visit_cnt']) . '</td>';
|
||||||
|
echo '<td>' . (empty($row['next_visit_cnt']) ? '-' : $row['next_visit_cnt']) . '</td>';
|
||||||
|
echo '<td>' . (empty($row['next_shoot_cnt']) ? '-' : $row['next_shoot_cnt']) . '</td>';
|
||||||
|
echo '<td>' . (empty($row['shoot_cnt']) ? '-' : $row['shoot_cnt']) . '</td>';
|
||||||
|
echo '<td>' . (empty($row['delay_confirm_cnt']) ? '-' : $row['delay_confirm_cnt']) . '</td>';
|
||||||
|
echo '<td>' . (empty($row['fail_confirm_cnt']) ? '-' : $row['fail_confirm_cnt']) . '</td>';
|
||||||
|
echo '<td>' . (empty($row['confirm_cnt']) ? '-' : $row['confirm_cnt']) . '</td>';
|
||||||
|
echo '</tr>';
|
||||||
|
$nRow++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "<tr><td colspan='13'>조회된 결과가 없습니다.</td></tr>";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
// const tpl = document.querySelector('.my-loader-template')
|
||||||
|
let date = new Date()
|
||||||
|
const teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
$("#bonbu").on("change", function (e) {
|
||||||
|
|
||||||
|
const value = e.target.value
|
||||||
|
|
||||||
|
$("#dept_sq").empty()
|
||||||
|
|
||||||
|
var str = "<option value=''>선택</option>"
|
||||||
|
if (teamArr != null) {
|
||||||
|
|
||||||
|
for (var i = 0; i < teamArr.length; i++) {
|
||||||
|
if (value === teamArr[i].pdept_sq) {
|
||||||
|
str += "<option value='" + teamArr[i].dept_sq + "'>" + teamArr[i].dept_nm + "</option>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#dept_sq").append(str)
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀 다운로드 click
|
||||||
|
$("#excel-download").on("click", function () {
|
||||||
|
$.ajax({
|
||||||
|
url: "/results/dept/excel",
|
||||||
|
method: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
data: $("#frm_srch_info").serialize(),
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
downloadExcel(result.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
function tr_onclick(pars) {
|
||||||
|
location.href = '/article/receipt/lists' + pars + '&m=M201';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
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: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ 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}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// window.addEventListener("DOMContentLoaded", function () {
|
||||||
|
// // 오늘 날짜
|
||||||
|
// const today = new Date();
|
||||||
|
|
||||||
|
// // 이번 달 1일
|
||||||
|
// const firstDay = new Date(today.getFullYear(), today.getMonth(), 1);
|
||||||
|
|
||||||
|
// // 이번 달 말일 (다음달 0일 = 이번달 말일)
|
||||||
|
// const lastDay = new Date(today.getFullYear(), today.getMonth() + 1, 0);
|
||||||
|
|
||||||
|
// // yyyy-mm-dd 형태로 변환
|
||||||
|
// const toDate = (d) => d.toISOString().split("T")[0];
|
||||||
|
|
||||||
|
// document.getElementById("sdate").value = toDate(firstDay);
|
||||||
|
// document.getElementById("edate").value = toDate(lastDay);
|
||||||
|
// });
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
499
app/Views/pages/results/m409/stats.php
Normal file
499
app/Views/pages/results/m409/stats.php
Normal file
@@ -0,0 +1,499 @@
|
|||||||
|
<?= $this->extend('layouts/main') ?>
|
||||||
|
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<style>
|
||||||
|
th {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#resultList tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blockUI {
|
||||||
|
z-index: 1500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swal2-cancel {
|
||||||
|
background-color: #ff0000 !important;
|
||||||
|
color: #fff !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;">
|
||||||
|
|
||||||
|
<!-- 1줄 -->
|
||||||
|
<div class="row mb-3">
|
||||||
|
<!-- 기준일자 -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">기준일자</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="sdate" name="sdate">
|
||||||
|
</div>
|
||||||
|
<div class="col-2 d-flex align-items-center justify-content-center">~</div>
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="edate" name="edate">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">검증방식</label>
|
||||||
|
<select class="form-control" name="vrfcreq_way">
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($code_vrfcreq_way as $cd => $cd_nm): ?>
|
||||||
|
<option value="<?= esc($cd) ?>"><?= esc($cd_nm) ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">매체사(CP)</label>
|
||||||
|
<select class="form-control" name="cp_id">
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($code_cp_id as $cd => $cd_nm): ?>
|
||||||
|
<option value="<?= esc($cd) ?>"><?= esc($cd_nm) ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1 d-grid align-items-end">
|
||||||
|
<button type="button" class="btn btn-primary" id="btnSearch">검색</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12 col-xl-12">
|
||||||
|
<div class="main-card mb-3 card">
|
||||||
|
<div class="card-header d-flex align-items-center">
|
||||||
|
<h3 class="card-title mb-0">사용자 목록</h3>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<button class="mb-2 me-2 border-0 btn-transition btn btn-shadow btn-outline-success"
|
||||||
|
id="excel-download">엑셀다운로드</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table id="resultList" class="table table-hover table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th rowspan="2">일자</th>
|
||||||
|
<th rowspan="2">접수</th>
|
||||||
|
<th rowspan="2">미배정</th>
|
||||||
|
<th rowspan="2">일반확인배정</th>
|
||||||
|
<th rowspan="2">서류확인<br />완료</th>
|
||||||
|
<th rowspan="2">전화확인<br />완료</th>
|
||||||
|
<th rowspan="2">접수취소<br />(홍보확인서<br />미수신)</th>
|
||||||
|
<th colspan="5" style="text-align: center;">전화/서류 확인실패</th>
|
||||||
|
<th rowspan="2">1차 재검증</th>
|
||||||
|
<th rowspan="2">등기부등본<br />확인완료</th>
|
||||||
|
<th colspan="2" style="text-align: center;">등기부등본<br />확인실패</th>
|
||||||
|
<th rowspan="2">검증완료</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>개인정보<br />제공동의</th>
|
||||||
|
<th>매물정보</th>
|
||||||
|
<th>가격정보</th>
|
||||||
|
<th>권리자</th>
|
||||||
|
<th>합계</th>
|
||||||
|
<th>매물정보</th>
|
||||||
|
<th>권리자</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
<tfoot class="table-light">
|
||||||
|
<tr class="fw-bold">
|
||||||
|
<td>합계</td>
|
||||||
|
<td class="sum-rcpt_cnt"></td>
|
||||||
|
<td class="sum-notassign_cnt"></td>
|
||||||
|
<td class="sum-assign_cnt"></td>
|
||||||
|
<td class="sum-paper_cnt"></td>
|
||||||
|
<td class="sum-phone_cnt"></td>
|
||||||
|
<td class="sum-cancel_cnt"></td>
|
||||||
|
<td class="sum-priv_cnt"></td>
|
||||||
|
<td class="sum-info_cnt"></td>
|
||||||
|
<td class="sum-price_cnt"></td>
|
||||||
|
<td class="sum-owner_cnt"></td>
|
||||||
|
<td class="sum-fail_cnt"></td>
|
||||||
|
<td class="sum-retry_cnt"></td>
|
||||||
|
<td class="sum-rgbk_cnt"></td>
|
||||||
|
<td class="sum-reg_info_cnt"></td>
|
||||||
|
<td class="sum-reg_owner_cnt"></td>
|
||||||
|
<td class="sum-complete_cnt"></td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
</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');
|
||||||
|
|
||||||
|
let date = new Date();
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
|
||||||
|
let table = $('#resultList').DataTable({
|
||||||
|
language: lang_kor,
|
||||||
|
processing: true,
|
||||||
|
ajax: {
|
||||||
|
url: '/m409/m409a/getResultList',
|
||||||
|
type: 'GET',
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
data: function (d) {
|
||||||
|
d.sdate = $("#frm_srch_info [name=sdate]").val()
|
||||||
|
d.edate = $("#frm_srch_info [name=edate]").val()
|
||||||
|
d.vrfcreq_way = $("#frm_srch_info [name=vrfcreq_way]").val()
|
||||||
|
d.cp_id = $("#frm_srch_info [name=cp_id]").val()
|
||||||
|
|
||||||
|
d.start = d.start || 0
|
||||||
|
d.length = d.length || 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"columnDefs": [
|
||||||
|
{ 'targets': '_all', "defaultContent": "" },
|
||||||
|
{ className: 'text-center', targets: '_all' },
|
||||||
|
],
|
||||||
|
columns: [
|
||||||
|
{ data: 'ref_date', "width": "100px" },
|
||||||
|
{ data: 'rcpt_cnt' },
|
||||||
|
{ data: 'notassign_cnt' },
|
||||||
|
{ data: 'assign_cnt' },
|
||||||
|
{ data: 'paper_cnt' },
|
||||||
|
{ data: 'phone_cnt' },
|
||||||
|
{ data: 'cancel_cnt' },
|
||||||
|
{ data: 'priv_cnt' },
|
||||||
|
{ data: 'info_cnt' },
|
||||||
|
{ data: 'price_cnt' },
|
||||||
|
{ data: 'owner_cnt' },
|
||||||
|
{ data: 'fail_cnt' },
|
||||||
|
{ data: 'retry_cnt' },
|
||||||
|
{ data: 'rgbk_cnt' },
|
||||||
|
{ data: 'reg_info_cnt' },
|
||||||
|
{ data: 'reg_owner_cnt' },
|
||||||
|
{ data: 'complete_cnt' },
|
||||||
|
],
|
||||||
|
// 옵션들 예시
|
||||||
|
paging: false,
|
||||||
|
searching: false,
|
||||||
|
ordering: false,
|
||||||
|
serverSide: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#resultList').on('xhr.dt', function (e, settings, json) {
|
||||||
|
const rows = json?.data || [];
|
||||||
|
|
||||||
|
const fields = [
|
||||||
|
'rcpt_cnt', 'notassign_cnt', 'assign_cnt', 'paper_cnt', 'phone_cnt',
|
||||||
|
'cancel_cnt', 'priv_cnt', 'info_cnt', 'price_cnt', 'owner_cnt',
|
||||||
|
'fail_cnt', 'retry_cnt', 'rgbk_cnt', 'reg_info_cnt', 'reg_owner_cnt',
|
||||||
|
'complete_cnt'
|
||||||
|
];
|
||||||
|
|
||||||
|
const toNum = (v) => {
|
||||||
|
if (v == null || v === '') return 0;
|
||||||
|
return Number(String(v).replace(/,/g, '')) || 0; // "18" 같은 문자열 대응
|
||||||
|
};
|
||||||
|
|
||||||
|
// 합계 객체 생성
|
||||||
|
const sum = {};
|
||||||
|
fields.forEach(f => sum[f] = 0);
|
||||||
|
|
||||||
|
// rows 합산
|
||||||
|
rows.forEach(r => {
|
||||||
|
fields.forEach(f => sum[f] += toNum(r[f]));
|
||||||
|
});
|
||||||
|
|
||||||
|
// footer에 주입
|
||||||
|
fields.forEach(f => {
|
||||||
|
$('#resultList tfoot .sum-' + f).text(sum[f].toLocaleString());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#resultList 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();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀다운 click
|
||||||
|
$("#excel-download").on("click", function () {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/m409/m409a/excel",
|
||||||
|
method: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
data: $("#frm_srch_info").serialize(),
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
// downloadExcel(result.data);
|
||||||
|
downloadExcelWithHeader(result.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
function downloadExcelWithHeader(dataRows) {
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 1) 헤더
|
||||||
|
* ======================= */
|
||||||
|
const header1 = [
|
||||||
|
"일자",
|
||||||
|
"접수",
|
||||||
|
"미배정",
|
||||||
|
"일반확인배정",
|
||||||
|
"서류확인완료",
|
||||||
|
"전화확인완료",
|
||||||
|
"접수취소(홍보확인서 미수신)",
|
||||||
|
"전화/서류 확인실패", "", "", "", "",
|
||||||
|
"1차 재검증",
|
||||||
|
"등기부등본 확인완료",
|
||||||
|
"등기부등본 확인실패", "",
|
||||||
|
"검증완료"
|
||||||
|
];
|
||||||
|
|
||||||
|
const header2 = [
|
||||||
|
"", "", "", "", "", "", "",
|
||||||
|
"개인정보 제공동의",
|
||||||
|
"매물정보",
|
||||||
|
"가격정보",
|
||||||
|
"권리자",
|
||||||
|
"합계",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"매물정보",
|
||||||
|
"권리자",
|
||||||
|
""
|
||||||
|
];
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 2) 바디 (컬럼 순서 정확히)
|
||||||
|
* ======================= */
|
||||||
|
const body = dataRows.map(r => ([
|
||||||
|
r.ref_date,
|
||||||
|
r.rcpt_cnt,
|
||||||
|
r.notassign_cnt,
|
||||||
|
r.assign_cnt,
|
||||||
|
r.paper_cnt,
|
||||||
|
r.phone_cnt,
|
||||||
|
r.cancel_cnt,
|
||||||
|
r.priv_cnt,
|
||||||
|
r.info_cnt,
|
||||||
|
r.price_cnt,
|
||||||
|
r.owner_cnt,
|
||||||
|
r.fail_cnt,
|
||||||
|
r.retry_cnt,
|
||||||
|
r.rgbk_cnt,
|
||||||
|
r.reg_info_cnt,
|
||||||
|
r.reg_owner_cnt,
|
||||||
|
r.complete_cnt
|
||||||
|
]));
|
||||||
|
|
||||||
|
const aoa = [header1, header2, ...body];
|
||||||
|
|
||||||
|
const ws = XLSX.utils.aoa_to_sheet(aoa);
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 3) 병합 설정
|
||||||
|
* ======================= */
|
||||||
|
ws["!merges"] = [
|
||||||
|
// rowspan 2
|
||||||
|
{ s: { r: 0, c: 0 }, e: { r: 1, c: 0 } }, // 일자
|
||||||
|
{ s: { r: 0, c: 1 }, e: { r: 1, c: 1 } }, // 접수
|
||||||
|
{ s: { r: 0, c: 2 }, e: { r: 1, c: 2 } }, // 미배정
|
||||||
|
{ s: { r: 0, c: 3 }, e: { r: 1, c: 3 } },
|
||||||
|
{ s: { r: 0, c: 4 }, e: { r: 1, c: 4 } },
|
||||||
|
{ s: { r: 0, c: 5 }, e: { r: 1, c: 5 } },
|
||||||
|
{ s: { r: 0, c: 6 }, e: { r: 1, c: 6 } },
|
||||||
|
{ s: { r: 0, c: 12 }, e: { r: 1, c: 12 } }, // 1차 재검증
|
||||||
|
{ s: { r: 0, c: 13 }, e: { r: 1, c: 13 } }, // 등기부 완료
|
||||||
|
{ s: { r: 0, c: 16 }, e: { r: 1, c: 16 } }, // 검증완료
|
||||||
|
|
||||||
|
// 전화/서류 확인실패 (colspan 5)
|
||||||
|
{ s: { r: 0, c: 7 }, e: { r: 0, c: 11 } },
|
||||||
|
|
||||||
|
// 등기부등본 확인실패 (colspan 2)
|
||||||
|
{ s: { r: 0, c: 14 }, e: { r: 0, c: 15 } }
|
||||||
|
];
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 4) 컬럼 너비
|
||||||
|
* ======================= */
|
||||||
|
ws["!cols"] = [
|
||||||
|
{ wpx: 100 }, // 일자
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 },
|
||||||
|
{ wpx: 50 }
|
||||||
|
];
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 5) 저장
|
||||||
|
* ======================= */
|
||||||
|
const wb = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(wb, ws, "sheet1");
|
||||||
|
|
||||||
|
XLSX.writeFile(
|
||||||
|
wb,
|
||||||
|
"확인매물_일자별실적_" + getDateTimeString() + ".xlsx"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
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: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ 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}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const today = new Date().toISOString().slice(0, 10);
|
||||||
|
document.getElementById("sdate").value = today;
|
||||||
|
document.getElementById("edate").value = today;
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
479
app/Views/pages/results/m410/stats.php
Normal file
479
app/Views/pages/results/m410/stats.php
Normal file
@@ -0,0 +1,479 @@
|
|||||||
|
<?= $this->extend('layouts/main') ?>
|
||||||
|
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<style>
|
||||||
|
th {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#resultList tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blockUI {
|
||||||
|
z-index: 1500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swal2-cancel {
|
||||||
|
background-color: #ff0000 !important;
|
||||||
|
color: #fff !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;">
|
||||||
|
|
||||||
|
<!-- 1줄 -->
|
||||||
|
<div class="row mb-3">
|
||||||
|
<!-- 기준일자 -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">기준일자</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="sdate" name="sdate">
|
||||||
|
</div>
|
||||||
|
<div class="col-2 d-flex align-items-center justify-content-center">~</div>
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="edate" name="edate">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label class="form-label mb-1">팀별실적</label>
|
||||||
|
<select class="form-control" name="dept_sq">
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($department as $key => $d): ?>
|
||||||
|
<option value="<?= $d['dept_sq'] ?>"><?= $d['dept_nm'] ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">검증방식</label>
|
||||||
|
<select class="form-control" name="vrfcreq_way">
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($code_vrfcreq_way as $cd => $cd_nm): ?>
|
||||||
|
<option value="<?= esc($cd) ?>"><?= esc($cd_nm) ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1 d-grid align-items-end">
|
||||||
|
<button type="button" class="btn btn-primary" id="btnSearch">검색</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12 col-xl-12">
|
||||||
|
<div class="main-card mb-3 card">
|
||||||
|
<div class="card-header d-flex align-items-center">
|
||||||
|
<h3 class="card-title mb-0">상담원 목록</h3>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<button class="mb-2 me-2 border-0 btn-transition btn btn-shadow btn-outline-success"
|
||||||
|
id="excel-download">엑셀다운로드</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table id="resultList" class="table table-hover table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th rowspan="2">상담원</th>
|
||||||
|
<th colspan="2" style="text-align: center;">서류확인</th>
|
||||||
|
<th colspan="3" style="text-align: center;">전화확인</th>
|
||||||
|
<th colspan="5" style="text-align: center;">등기부등본</th>
|
||||||
|
<th colspan="2" style="text-align: center;">리얼탑 열람</th>
|
||||||
|
<th colspan="2" style="text-align: center;">리얼탑 기열람</th>
|
||||||
|
<th rowspan="2">모바일 확인</th>
|
||||||
|
<th rowspan="2">등기부등본<br />없음</th>
|
||||||
|
<th colspan="2" style="text-align: center;">검증</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>완료</th>
|
||||||
|
<th>실패</th>
|
||||||
|
<th>건수</th>
|
||||||
|
<th>완료</th>
|
||||||
|
<th>실패</th>
|
||||||
|
<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>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
<tfoot class="table-light">
|
||||||
|
<tr class="fw-bold">
|
||||||
|
<td>합계</td>
|
||||||
|
<td class="sum-paper_complete_cnt"></td>
|
||||||
|
<td class="sum-paper_fail_cnt"></td>
|
||||||
|
<td class="sum-phone_all_cnt"></td>
|
||||||
|
<td class="sum-phone_complete_cnt"></td>
|
||||||
|
<td class="sum-phone_fail_cnt"></td>
|
||||||
|
<td class="sum-reg_complete_cnt"></td>
|
||||||
|
<td class="sum-same_reg_open"></td>
|
||||||
|
<td class="sum-reg_fail_Open"></td>
|
||||||
|
<td class="sum-same_reg_tempOpen"></td>
|
||||||
|
<td class="sum-reg_fail_tempOpen"></td>
|
||||||
|
<td class="sum-real_top_RS"></td>
|
||||||
|
<td class="sum-real_top_RF"></td>
|
||||||
|
<td class="sum-real_top_GS"></td>
|
||||||
|
<td class="sum-real_top_GF"></td>
|
||||||
|
<td class="sum-mobile_upload"></td>
|
||||||
|
<td class="sum-reg_none"></td>
|
||||||
|
<td class="sum-complete_cnt"></td>
|
||||||
|
<td class="sum-fail_cnt"></td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
</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');
|
||||||
|
|
||||||
|
let date = new Date();
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
|
||||||
|
let table = $('#resultList').DataTable({
|
||||||
|
language: lang_kor,
|
||||||
|
processing: true,
|
||||||
|
ajax: {
|
||||||
|
url: '/m410/m410a/getResultList',
|
||||||
|
type: 'GET',
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
data: function (d) {
|
||||||
|
d.sdate = $("#frm_srch_info [name=sdate]").val()
|
||||||
|
d.edate = $("#frm_srch_info [name=edate]").val()
|
||||||
|
d.vrfcreq_way = $("#frm_srch_info [name=vrfcreq_way]").val()
|
||||||
|
d.dept_sq = $("#frm_srch_info [name=dept_sq]").val()
|
||||||
|
|
||||||
|
d.start = d.start || 0
|
||||||
|
d.length = d.length || 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"columnDefs": [
|
||||||
|
{ 'targets': '_all', "defaultContent": "" },
|
||||||
|
{ className: 'text-center', targets: '_all' },
|
||||||
|
],
|
||||||
|
columns: [
|
||||||
|
{ data: 'usr_nm', "width": "100px" },
|
||||||
|
{ data: 'paper_complete_cnt' },
|
||||||
|
{ data: 'paper_fail_cnt' },
|
||||||
|
{ data: 'phone_all_cnt' },
|
||||||
|
{ data: 'phone_complete_cnt' },
|
||||||
|
{ data: 'phone_fail_cnt' },
|
||||||
|
{ data: 'reg_complete_cnt' },
|
||||||
|
{ data: 'same_reg_open' },
|
||||||
|
{ data: 'reg_fail_Open' },
|
||||||
|
{ data: 'same_reg_tempOpen' },
|
||||||
|
{ data: 'reg_fail_tempOpen' },
|
||||||
|
{ data: 'real_top_RS' },
|
||||||
|
{ data: 'real_top_RF' },
|
||||||
|
{ data: 'real_top_GS' },
|
||||||
|
{ data: 'real_top_GF' },
|
||||||
|
{ data: 'mobile_upload' },
|
||||||
|
{ data: 'reg_none' },
|
||||||
|
{ data: 'complete_cnt' },
|
||||||
|
{ data: 'fail_cnt' },
|
||||||
|
],
|
||||||
|
// 옵션들 예시
|
||||||
|
paging: false,
|
||||||
|
searching: false,
|
||||||
|
ordering: false,
|
||||||
|
serverSide: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#resultList').on('xhr.dt', function (e, settings, json) {
|
||||||
|
const rows = json?.data || [];
|
||||||
|
|
||||||
|
|
||||||
|
const fields = [
|
||||||
|
'paper_complete_cnt', 'paper_fail_cnt', 'phone_all_cnt', 'phone_complete_cnt', 'phone_fail_cnt'
|
||||||
|
, 'reg_complete_cnt', 'same_reg_open', 'reg_fail_Open', 'same_reg_tempOpen', 'reg_fail_tempOpen'
|
||||||
|
, 'real_top_RS', 'real_top_RF', 'real_top_GS', 'real_top_GF'
|
||||||
|
, 'mobile_upload', 'reg_none', 'complete_cnt', 'fail_cnt'
|
||||||
|
];
|
||||||
|
|
||||||
|
const toNum = (v) => {
|
||||||
|
if (v == null || v === '') return 0;
|
||||||
|
return Number(String(v).replace(/,/g, '')) || 0; // "18" 같은 문자열 대응
|
||||||
|
};
|
||||||
|
|
||||||
|
// 합계 객체 생성
|
||||||
|
const sum = {};
|
||||||
|
fields.forEach(f => sum[f] = 0);
|
||||||
|
|
||||||
|
// rows 합산
|
||||||
|
rows.forEach(r => {
|
||||||
|
fields.forEach(f => sum[f] += toNum(r[f]));
|
||||||
|
});
|
||||||
|
|
||||||
|
// footer에 주입
|
||||||
|
fields.forEach(f => {
|
||||||
|
$('#resultList tfoot .sum-' + f).text(sum[f].toLocaleString());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#resultList 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();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀다운 click
|
||||||
|
$("#excel-download").on("click", function () {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/m410/m410a/excel",
|
||||||
|
method: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
data: $("#frm_srch_info").serialize(),
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
// downloadExcel(result.data);
|
||||||
|
downloadExcelWithHeader(result.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
function downloadExcelWithHeader(dataRows) {
|
||||||
|
|
||||||
|
const header1 = [
|
||||||
|
"상담원",
|
||||||
|
"서류확인", "",
|
||||||
|
"전화확인", "", "",
|
||||||
|
"등기부등본", "", "", "", "",
|
||||||
|
"리얼탑 열람", "",
|
||||||
|
"리얼탑 기열람", "",
|
||||||
|
"모바일 확인",
|
||||||
|
"등기부등본 없음",
|
||||||
|
"검증", ""
|
||||||
|
];
|
||||||
|
|
||||||
|
const header2 = [
|
||||||
|
"",
|
||||||
|
"완료", "실패",
|
||||||
|
"건수", "완료", "실패",
|
||||||
|
"확인완료", "일치열람", "열람 불일치", "일치 가열람", "가열람 불일치",
|
||||||
|
"일치", "불일치",
|
||||||
|
"일치", "불일치",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"완료", "실패"
|
||||||
|
];
|
||||||
|
|
||||||
|
// ✅ 컬럼 개수 고정 (19)
|
||||||
|
const COLS = 19;
|
||||||
|
const fitCols = (arr) => {
|
||||||
|
const a = arr.slice(0, COLS);
|
||||||
|
while (a.length < COLS) a.push("");
|
||||||
|
return a;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ✅ 숫자/빈값 안전 처리
|
||||||
|
const val = (v) => (v === undefined || v === null || v === "") ? 0 : v;
|
||||||
|
|
||||||
|
const body = (dataRows || []).map(r => fitCols([
|
||||||
|
r.usr_nm ?? r.usr_id ?? "",
|
||||||
|
val(r.paper_complete_cnt),
|
||||||
|
val(r.paper_fail_cnt),
|
||||||
|
val(r.phone_all_cnt),
|
||||||
|
val(r.phone_complete_cnt),
|
||||||
|
val(r.phone_fail_cnt),
|
||||||
|
val(r.reg_complete_cnt),
|
||||||
|
val(r.same_reg_open),
|
||||||
|
val(r.reg_fail_Open),
|
||||||
|
val(r.same_reg_tempOpen),
|
||||||
|
val(r.reg_fail_tempOpen),
|
||||||
|
val(r.real_top_RS),
|
||||||
|
val(r.real_top_RF),
|
||||||
|
val(r.real_top_GS),
|
||||||
|
val(r.real_top_GF),
|
||||||
|
val(r.mobile_upload),
|
||||||
|
val(r.reg_none),
|
||||||
|
val(r.complete_cnt), // ✅ 검증 완료
|
||||||
|
val(r.fail_cnt), // ✅ 검증 실패
|
||||||
|
]));
|
||||||
|
|
||||||
|
const aoa = [fitCols(header1), fitCols(header2), ...body];
|
||||||
|
const ws = XLSX.utils.aoa_to_sheet(aoa);
|
||||||
|
|
||||||
|
ws["!merges"] = [
|
||||||
|
{ s: { r: 0, c: 0 }, e: { r: 1, c: 0 } }, // 상담원 rowspan 2
|
||||||
|
{ s: { r: 0, c: 1 }, e: { r: 0, c: 2 } }, // 서류확인 colspan 2
|
||||||
|
{ s: { r: 0, c: 3 }, e: { r: 0, c: 5 } }, // 전화확인 colspan 3
|
||||||
|
{ s: { r: 0, c: 6 }, e: { r: 0, c: 10 } }, // 등기부등본 colspan 5
|
||||||
|
{ s: { r: 0, c: 11 }, e: { r: 0, c: 12 } }, // 리얼탑 열람 colspan 2
|
||||||
|
{ s: { r: 0, c: 13 }, e: { r: 0, c: 14 } }, // 리얼탑 기열람 colspan 2
|
||||||
|
{ s: { r: 0, c: 15 }, e: { r: 1, c: 15 } }, // 모바일 rowspan 2
|
||||||
|
{ s: { r: 0, c: 16 }, e: { r: 1, c: 16 } }, // 등기부없음 rowspan 2
|
||||||
|
{ s: { r: 0, c: 17 }, e: { r: 0, c: 18 } }, // ✅ 검증 colspan 2
|
||||||
|
];
|
||||||
|
|
||||||
|
ws["!cols"] = [
|
||||||
|
{ wpx: 90 },
|
||||||
|
{ wpx: 60 }, { wpx: 60 },
|
||||||
|
{ wpx: 60 }, { wpx: 60 }, { wpx: 60 },
|
||||||
|
{ wpx: 70 }, { wpx: 70 }, { wpx: 80 }, { wpx: 80 }, { wpx: 90 },
|
||||||
|
{ wpx: 60 }, { wpx: 60 },
|
||||||
|
{ wpx: 70 }, { wpx: 70 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 90 },
|
||||||
|
{ wpx: 60 }, { wpx: 60 },
|
||||||
|
];
|
||||||
|
|
||||||
|
const wb = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(wb, ws, "sheet1");
|
||||||
|
XLSX.writeFile(wb, "확인매물_개인별실적_" + getDateTimeString() + ".xlsx");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
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: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ 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}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const today = new Date().toISOString().slice(0, 10);
|
||||||
|
document.getElementById("sdate").value = today;
|
||||||
|
document.getElementById("edate").value = today;
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
447
app/Views/pages/results/m411/stats.php
Normal file
447
app/Views/pages/results/m411/stats.php
Normal file
@@ -0,0 +1,447 @@
|
|||||||
|
<?= $this->extend('layouts/main') ?>
|
||||||
|
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<style>
|
||||||
|
th {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#resultList tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blockUI {
|
||||||
|
z-index: 1500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swal2-cancel {
|
||||||
|
background-color: #ff0000 !important;
|
||||||
|
color: #fff !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;">
|
||||||
|
|
||||||
|
<!-- 1줄 -->
|
||||||
|
<div class="row mb-3">
|
||||||
|
<!-- 기준일자 -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">기준일자</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="sdate" name="sdate">
|
||||||
|
</div>
|
||||||
|
<div class="col-2 d-flex align-items-center justify-content-center">~</div>
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="edate" name="edate">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div class="col-md-2">
|
||||||
|
<label class="form-label mb-1">팀별실적</label>
|
||||||
|
<select class="form-control" name="dept_sq">
|
||||||
|
<option value="">선택</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">검증방식</label>
|
||||||
|
<select class="form-control" name="vrfcreq_way">
|
||||||
|
<option value="">선택</option>
|
||||||
|
</select>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<div class="col-md-1 d-grid align-items-end">
|
||||||
|
<button type="button" class="btn btn-primary" id="btnSearch">검색</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12 col-xl-12">
|
||||||
|
<div class="main-card mb-3 card">
|
||||||
|
<div class="card-header d-flex align-items-center">
|
||||||
|
<h3 class="card-title mb-0">매체사 목록</h3>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<button class="mb-2 me-2 border-0 btn-transition btn btn-shadow btn-outline-success"
|
||||||
|
id="excel-download">엑셀다운로드</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table id="resultList" class="table table-hover table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th rowspan="2">매체사</th>
|
||||||
|
<th colspan="6" style="text-align: center;">접수</th>
|
||||||
|
<th colspan="3" style="text-align: center;">서류확인</th>
|
||||||
|
<th colspan="5" style="text-align: center;">전화확인</th>
|
||||||
|
<th colspan="5" style="text-align: center;">등기부확인</th>
|
||||||
|
<th colspan="2" style="text-align: center;">서비스</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>전화</th>
|
||||||
|
<th>확인서</th>
|
||||||
|
<th>확인서v2</th>
|
||||||
|
<th>모바일</th>
|
||||||
|
<th>모바일v2</th>
|
||||||
|
<th>합계</th>
|
||||||
|
<th>일치</th>
|
||||||
|
<th>불일치</th>
|
||||||
|
<th>합계</th>
|
||||||
|
<th>일치</th>
|
||||||
|
<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>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
<tfoot class="table-light">
|
||||||
|
<tr class="fw-bold">
|
||||||
|
<td>합계</td>
|
||||||
|
<td class="sum-t_cnt"></td>
|
||||||
|
<td class="sum-hong1_cnt"></td>
|
||||||
|
<td class="sum-hong2_cnt"></td>
|
||||||
|
<td class="sum-m_cnt"></td>
|
||||||
|
<td class="sum-v2_cnt"></td>
|
||||||
|
<td class="sum-total"></td>
|
||||||
|
<td class="sum-d_o"></td>
|
||||||
|
<td class="sum-d_x"></td>
|
||||||
|
<td class="sum-d_tot"></td>
|
||||||
|
<td class="sum-t_o"></td>
|
||||||
|
<td class="sum-t_x"></td>
|
||||||
|
<td class="sum-t_n"></td>
|
||||||
|
<td class="sum-t_e"></td>
|
||||||
|
<td class="sum-t_tot"></td>
|
||||||
|
<td class="sum-r_o"></td>
|
||||||
|
<td class="sum-r_x"></td>
|
||||||
|
<td class="sum-r_e"></td>
|
||||||
|
<td class="sum-done"></td>
|
||||||
|
<td class="sum-r_tot"></td>
|
||||||
|
<td class="sum-s_1"></td>
|
||||||
|
<td class="sum-s_2"></td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
</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');
|
||||||
|
|
||||||
|
let date = new Date();
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
|
||||||
|
let table = $('#resultList').DataTable({
|
||||||
|
language: lang_kor,
|
||||||
|
processing: true,
|
||||||
|
ajax: {
|
||||||
|
url: '/m411/m411a/getResultList',
|
||||||
|
type: 'GET',
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
data: function (d) {
|
||||||
|
d.sdate = $("#frm_srch_info [name=sdate]").val()
|
||||||
|
d.edate = $("#frm_srch_info [name=edate]").val()
|
||||||
|
|
||||||
|
d.start = d.start || 0
|
||||||
|
d.length = d.length || 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"columnDefs": [
|
||||||
|
{ 'targets': '_all', "defaultContent": "" },
|
||||||
|
{ className: 'text-center', targets: '_all' },
|
||||||
|
],
|
||||||
|
columns: [
|
||||||
|
{ data: 'cpid', "width": "100px" },
|
||||||
|
{ data: 't_cnt' },
|
||||||
|
{ data: 'hong1_cnt' },
|
||||||
|
{ data: 'hong2_cnt' },
|
||||||
|
{ data: 'm_cnt' },
|
||||||
|
{ data: 'v2_cnt' },
|
||||||
|
{ data: 'total' },
|
||||||
|
|
||||||
|
{ data: 'd_o' },
|
||||||
|
{ data: 'd_x' },
|
||||||
|
{ data: 'd_tot' },
|
||||||
|
|
||||||
|
{ data: 't_o' },
|
||||||
|
{ data: 't_x' },
|
||||||
|
{ data: 't_n' },
|
||||||
|
{ data: 't_e' },
|
||||||
|
{ data: 't_tot' },
|
||||||
|
|
||||||
|
{ data: 'r_o' },
|
||||||
|
{ data: 'r_x' },
|
||||||
|
{ data: 'r_e' },
|
||||||
|
{ data: 'done' },
|
||||||
|
{ data: 'r_tot' },
|
||||||
|
|
||||||
|
{ data: 's_1' },
|
||||||
|
{ data: 's_2' },
|
||||||
|
],
|
||||||
|
// 옵션들 예시
|
||||||
|
paging: false,
|
||||||
|
searching: false,
|
||||||
|
ordering: false,
|
||||||
|
serverSide: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#resultList').on('xhr.dt', function (e, settings, json) {
|
||||||
|
const rows = json?.data || [];
|
||||||
|
|
||||||
|
|
||||||
|
const fields = [
|
||||||
|
't_cnt', 'hong1_cnt', 'hong2_cnt', 'm_cnt', 'v2_cnt', 'total'
|
||||||
|
, 'd_o', 'd_x', 'd_tot'
|
||||||
|
, 't_o', 't_x', 't_n', 't_e', 't_tot'
|
||||||
|
, 'r_o', 'r_x', 'r_e', 'done', 'r_tot'
|
||||||
|
, 's_1', 's_2'
|
||||||
|
];
|
||||||
|
|
||||||
|
const toNum = (v) => {
|
||||||
|
if (v == null || v === '') return 0;
|
||||||
|
return Number(String(v).replace(/,/g, '')) || 0; // "18" 같은 문자열 대응
|
||||||
|
};
|
||||||
|
|
||||||
|
// 합계 객체 생성
|
||||||
|
const sum = {};
|
||||||
|
fields.forEach(f => sum[f] = 0);
|
||||||
|
|
||||||
|
// rows 합산
|
||||||
|
rows.forEach(r => {
|
||||||
|
fields.forEach(f => sum[f] += toNum(r[f]));
|
||||||
|
});
|
||||||
|
|
||||||
|
// footer에 주입
|
||||||
|
fields.forEach(f => {
|
||||||
|
$('#resultList tfoot .sum-' + f).text(sum[f].toLocaleString());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#resultList tbody').on('click', 'tr', function () {
|
||||||
|
const row = table.row(this).data()
|
||||||
|
if (!row) return
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// [검색] 버튼 눌렀을 때 다시 조회
|
||||||
|
$('#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();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀다운 click
|
||||||
|
$("#excel-download").on("click", function () {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/m411/m411a/excel",
|
||||||
|
method: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
data: $("#frm_srch_info").serialize(),
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
// downloadExcel(result.data);
|
||||||
|
downloadExcelWithHeader(result.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
function downloadExcelWithHeader(dataRows) {
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 1) 헤더 (총 22컬럼)
|
||||||
|
* ======================= */
|
||||||
|
const header1 = [
|
||||||
|
"매체사",
|
||||||
|
"접수", "", "", "", "", "",
|
||||||
|
"서류확인", "", "",
|
||||||
|
"전화확인", "", "", "", "",
|
||||||
|
"등기부확인", "", "", "", "",
|
||||||
|
"서비스", ""
|
||||||
|
];
|
||||||
|
|
||||||
|
const header2 = [
|
||||||
|
"",
|
||||||
|
"전화", "확인서", "확인서v2", "모바일", "모바일v2", "합계",
|
||||||
|
"일치", "불일치", "합계",
|
||||||
|
"일치", "불일치", "거부", "무응답외", "합계",
|
||||||
|
"일치", "불일치", "등기부없음", "검증완료", "합계",
|
||||||
|
"건수", "접수 대비"
|
||||||
|
];
|
||||||
|
|
||||||
|
// ✅ 컬럼 개수 고정(22)
|
||||||
|
const COLS = 22;
|
||||||
|
const fitCols = (arr) => {
|
||||||
|
const a = arr.slice(0, COLS);
|
||||||
|
while (a.length < COLS) a.push("");
|
||||||
|
return a;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ✅ 숫자/빈값 안전 처리
|
||||||
|
const val = (v) => (v === undefined || v === null || v === "") ? 0 : v;
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 2) 바디 (DataTables columns 순서 그대로)
|
||||||
|
* ======================= */
|
||||||
|
const body = (dataRows || []).map(r => fitCols([
|
||||||
|
r.cpid ?? "", // 매체사
|
||||||
|
val(r.t_cnt),
|
||||||
|
val(r.hong1_cnt),
|
||||||
|
val(r.hong2_cnt),
|
||||||
|
val(r.m_cnt),
|
||||||
|
val(r.v2_cnt),
|
||||||
|
val(r.total),
|
||||||
|
|
||||||
|
val(r.d_o),
|
||||||
|
val(r.d_x),
|
||||||
|
val(r.d_tot),
|
||||||
|
|
||||||
|
val(r.t_o),
|
||||||
|
val(r.t_x),
|
||||||
|
val(r.t_n),
|
||||||
|
val(r.t_e),
|
||||||
|
val(r.t_tot),
|
||||||
|
|
||||||
|
val(r.r_o),
|
||||||
|
val(r.r_x),
|
||||||
|
val(r.r_e),
|
||||||
|
val(r.done),
|
||||||
|
val(r.r_tot),
|
||||||
|
|
||||||
|
val(r.s_1),
|
||||||
|
val(r.s_2),
|
||||||
|
]));
|
||||||
|
|
||||||
|
const aoa = [fitCols(header1), fitCols(header2), ...body];
|
||||||
|
const ws = XLSX.utils.aoa_to_sheet(aoa);
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 3) 병합(merge) 설정 (thead와 동일)
|
||||||
|
* ======================= */
|
||||||
|
ws["!merges"] = [
|
||||||
|
// 매체사 rowspan 2
|
||||||
|
{ s: { r: 0, c: 0 }, e: { r: 1, c: 0 } },
|
||||||
|
|
||||||
|
// 접수 colspan 6 (1~6)
|
||||||
|
{ s: { r: 0, c: 1 }, e: { r: 0, c: 6 } },
|
||||||
|
|
||||||
|
// 서류확인 colspan 3 (7~9)
|
||||||
|
{ s: { r: 0, c: 7 }, e: { r: 0, c: 9 } },
|
||||||
|
|
||||||
|
// 전화확인 colspan 5 (10~14)
|
||||||
|
{ s: { r: 0, c: 10 }, e: { r: 0, c: 14 } },
|
||||||
|
|
||||||
|
// 등기부확인 colspan 5 (15~19)
|
||||||
|
{ s: { r: 0, c: 15 }, e: { r: 0, c: 19 } },
|
||||||
|
|
||||||
|
// 서비스 colspan 2 (20~21)
|
||||||
|
{ s: { r: 0, c: 20 }, e: { r: 0, c: 21 } },
|
||||||
|
];
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 4) 컬럼 너비(가독성)
|
||||||
|
* ======================= */
|
||||||
|
ws["!cols"] = [
|
||||||
|
{ wpx: 110 }, // 매체사
|
||||||
|
{ wpx: 60 }, { wpx: 70 }, { wpx: 80 }, { wpx: 70 }, { wpx: 80 }, { wpx: 60 }, // 접수 6
|
||||||
|
{ wpx: 60 }, { wpx: 60 }, { wpx: 60 }, // 서류 3
|
||||||
|
{ wpx: 60 }, { wpx: 60 }, { wpx: 60 }, { wpx: 70 }, { wpx: 60 }, // 전화 5
|
||||||
|
{ wpx: 60 }, { wpx: 60 }, { wpx: 80 }, { wpx: 80 }, { wpx: 60 }, // 등기부 5
|
||||||
|
{ wpx: 70 }, { wpx: 80 }, // 서비스 2
|
||||||
|
];
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 5) 저장
|
||||||
|
* ======================= */
|
||||||
|
const wb = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(wb, ws, "sheet1");
|
||||||
|
|
||||||
|
XLSX.writeFile(wb, "확인매물_매체사_실적_" + getDateTimeString() + ".xlsx");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const today = new Date().toISOString().slice(0, 10);
|
||||||
|
document.getElementById("sdate").value = today;
|
||||||
|
document.getElementById("edate").value = today;
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
955
app/Views/pages/results/m412/stats.php
Normal file
955
app/Views/pages/results/m412/stats.php
Normal file
@@ -0,0 +1,955 @@
|
|||||||
|
<?= $this->extend('layouts/main') ?>
|
||||||
|
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<style>
|
||||||
|
th {
|
||||||
|
font-size: 11px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
table td {
|
||||||
|
font-size: 11px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#resultList tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blockUI {
|
||||||
|
z-index: 1500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swal2-cancel {
|
||||||
|
background-color: #ff0000 !important;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<h1>확인매물 일자별실적</h1>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="main-card mb-3 card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h5 class="card-title mb-0">검색 / 전송 설정</h5>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
<!-- 기준일자 + 검색 -->
|
||||||
|
<form id="frm_srch_info" onsubmit="return false;">
|
||||||
|
<div class="row g-3 align-items-end">
|
||||||
|
|
||||||
|
<div class="col-3">
|
||||||
|
<label class="form-label mb-1">기준일자</label>
|
||||||
|
<div class="row g-2 align-items-center">
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="sdate" name="sdate" value="">
|
||||||
|
</div>
|
||||||
|
<div class="col-2 d-flex justify-content-center">
|
||||||
|
<span class="text-muted">~</span>
|
||||||
|
</div>
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="edate" name="edate" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1 d-grid">
|
||||||
|
<button type="submit" class="btn btn-primary" id="btnSearch">
|
||||||
|
검색
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<hr class=" my-4">
|
||||||
|
|
||||||
|
<!-- 전송 On/Off 설정 목록 -->
|
||||||
|
<div class="row g-3">
|
||||||
|
|
||||||
|
<!-- 아이템 1 -->
|
||||||
|
<div class="col-12 col-xl-6">
|
||||||
|
<div class="border rounded p-3">
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="fw-semibold">홍보확인서 전송</div>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-2">
|
||||||
|
<select class="form-select form-select-sm" name="select_H" id="select_H"
|
||||||
|
style="width: 140px;">
|
||||||
|
<option value="">-On/Off-</option>
|
||||||
|
<option value="Y">On</option>
|
||||||
|
<option value="N">Off</option>
|
||||||
|
</select>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-primary" style="width:60px;"
|
||||||
|
onclick="send_yn('H');">저장</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 아이템 2 -->
|
||||||
|
<div class="col-12 col-xl-6">
|
||||||
|
<div class="border rounded p-3">
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="fw-semibold">전화확인 전송</div>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-2">
|
||||||
|
<select class="form-select form-select-sm" name="select_T" id="select_T"
|
||||||
|
style="width: 140px;">
|
||||||
|
<option value="">-On/Off-</option>
|
||||||
|
<option value="Y">On</option>
|
||||||
|
<option value="N">Off</option>
|
||||||
|
</select>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-primary" style="width:60px;"
|
||||||
|
onclick="send_yn('T');">저장</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 아이템 3 -->
|
||||||
|
<div class="col-12 col-xl-6">
|
||||||
|
<div class="border rounded p-3">
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="fw-semibold">등기부등본 전송</div>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-2">
|
||||||
|
<select class="form-select form-select-sm" name="select_D" id="select_D"
|
||||||
|
style="width: 140px;">
|
||||||
|
<option value="">-On/Off-</option>
|
||||||
|
<option value="Y">On</option>
|
||||||
|
<option value="N">Off</option>
|
||||||
|
</select>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-primary" style="width:60px;"
|
||||||
|
onclick="send_yn('D');">저장</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 아이템 4 -->
|
||||||
|
<div class="col-12 col-xl-6">
|
||||||
|
<div class="border rounded p-3">
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="fw-semibold">신홍보확인서 전송</div>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-2">
|
||||||
|
<select class="form-select form-select-sm" name="select_N" id="select_N"
|
||||||
|
style="width: 140px;">
|
||||||
|
<option value="">-On/Off-</option>
|
||||||
|
<option value="Y">On</option>
|
||||||
|
<option value="N">Off</option>
|
||||||
|
</select>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-primary" style="width:60px;"
|
||||||
|
onclick="send_yn('N');">저장</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 아이템 5 -->
|
||||||
|
<div class="col-12 col-xl-6">
|
||||||
|
<div class="border rounded p-3">
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="fw-semibold">공동중개매물 전송</div>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-2">
|
||||||
|
<select class="form-select form-select-sm" name="select_J" id="select_J"
|
||||||
|
style="width: 140px;">
|
||||||
|
<option value="">-On/Off-</option>
|
||||||
|
<option value="Y">On</option>
|
||||||
|
<option value="N">Off</option>
|
||||||
|
</select>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-primary" style="width:60px;"
|
||||||
|
onclick="send_yn('J');">저장</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 아이템 6 -->
|
||||||
|
<div class="col-12 col-xl-6">
|
||||||
|
<div class="border rounded p-3">
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="fw-semibold">모바일확인 V2 전송</div>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-2">
|
||||||
|
<select class="form-select form-select-sm" name="select_O" id="select_O"
|
||||||
|
style="width: 140px;">
|
||||||
|
<option value="">-On/Off-</option>
|
||||||
|
<option value="Y">On</option>
|
||||||
|
<option value="N">Off</option>
|
||||||
|
</select>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-primary" style="width:60px;"
|
||||||
|
onclick="send_yn('O');">저장</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr class="my-4">
|
||||||
|
|
||||||
|
<!-- 하단 액션 버튼 -->
|
||||||
|
<div class="d-flex justify-content-end">
|
||||||
|
<button type="button" class="btn btn-shadow btn-outline-secondary" style="min-width: 320px;"
|
||||||
|
id="btnSilver_send_35">
|
||||||
|
전화(서류) 확인 완료 총([0건]) 처리
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12 col-xl-12">
|
||||||
|
<div class="main-card mb-3 card">
|
||||||
|
<div class="card-header d-flex align-items-center">
|
||||||
|
<h3 class="card-title mb-0">매체사 목록</h3>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<button class="mb-2 me-2 border-0 btn-transition btn btn-shadow btn-outline-success"
|
||||||
|
id="excel-download">엑셀다운로드</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table id="resultList" class="table table-hover table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th rowspan="3">날짜</th>
|
||||||
|
<th rowspan="3">매체사</th>
|
||||||
|
<th colspan="11">전화확인</th>
|
||||||
|
<th colspan="10">홍보확인서</th>
|
||||||
|
<th rowspan="2" colspan="4">등기부확인</th>
|
||||||
|
<th rowspan="2" colspan="7">Report</th>
|
||||||
|
<th rowspan="3">미수신삭제</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="3">확인대상</th>
|
||||||
|
<th colspan="5">확인결과</th>
|
||||||
|
<th colspan="3">확인내역</th>
|
||||||
|
|
||||||
|
<th colspan="3">확인대상</th>
|
||||||
|
<th colspan="4">확인결과</th>
|
||||||
|
<th colspan="3">확인내역</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>전일<br />미확인</th>
|
||||||
|
<th>1차<br />재시도</th>
|
||||||
|
<th>접수</th>
|
||||||
|
|
||||||
|
<th>일치</th>
|
||||||
|
<th>불일치</th>
|
||||||
|
<th>거부</th>
|
||||||
|
<th>무응답<br />외</th>
|
||||||
|
<th>총확인</th>
|
||||||
|
|
||||||
|
<th>1차<br />실패</th>
|
||||||
|
<th>최종<br />실패</th>
|
||||||
|
<th>미확인</th>
|
||||||
|
|
||||||
|
<th>전일<br />미확인</th>
|
||||||
|
<th>1차<br />재시도</th>
|
||||||
|
<th>접수</th>
|
||||||
|
|
||||||
|
<th>일치</th>
|
||||||
|
<th>불일치</th>
|
||||||
|
<th>기타</th>
|
||||||
|
<th>총확인</th>
|
||||||
|
|
||||||
|
<th>1차<br />실패</th>
|
||||||
|
<th>최종<br />실패</th>
|
||||||
|
<th>미확인</th>
|
||||||
|
|
||||||
|
<th>일치</th>
|
||||||
|
<th>불일치</th>
|
||||||
|
<th>등기부<br />없음</th>
|
||||||
|
<th>총확인</th>
|
||||||
|
|
||||||
|
<th>총검증<br />대상</th>
|
||||||
|
<th>검증<br />시도</th>
|
||||||
|
<th>검증<br />완료</th>
|
||||||
|
<th>검증미<br />완료</th>
|
||||||
|
<th>간소화<br />확인율</th>
|
||||||
|
<th>검증<br />시도율</th>
|
||||||
|
<th>시도대비<br />완료율</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</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>
|
||||||
|
<style>
|
||||||
|
table.dataTable thead th {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
const sendH = '<?= $sendH ?>';
|
||||||
|
const sendD = '<?= $sendD ?>';
|
||||||
|
const sendT = '<?= $sendT ?>';
|
||||||
|
const sendN = '<?= $sendN ?>';
|
||||||
|
const sendJ = '<?= $sendJ ?>';
|
||||||
|
const sendO = '<?= $sendO ?>';
|
||||||
|
|
||||||
|
let date = new Date();
|
||||||
|
|
||||||
|
const SUM_KEYS = [
|
||||||
|
'T0101', 'T0102', 'T0103',
|
||||||
|
'T0201', 'T0202', 'T0203', 'T0204', 'T0205',
|
||||||
|
'T0301', 'T0302', 'T0303',
|
||||||
|
'D0101', 'D0102', 'D0103',
|
||||||
|
'D0201', 'D0202', 'D0203', 'D0204',
|
||||||
|
'D0301', 'D0302', 'D0303',
|
||||||
|
'R0101', 'R0102', 'R0103', 'R0104', // 등기부 컬럼도 테이블에 있으면 포함
|
||||||
|
'Z0101', 'Z0102', 'Z0103', 'Z0104',
|
||||||
|
'R0105',
|
||||||
|
'A0101'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
initSelect();
|
||||||
|
|
||||||
|
let table = $('#resultList').DataTable({
|
||||||
|
language: lang_kor,
|
||||||
|
processing: true,
|
||||||
|
ajax: {
|
||||||
|
url: '/m412/m412a/getResultList',
|
||||||
|
type: 'GET',
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
data: function (d) {
|
||||||
|
d.sdate = $("#frm_srch_info [name=sdate]").val()
|
||||||
|
d.edate = $("#frm_srch_info [name=edate]").val()
|
||||||
|
|
||||||
|
d.start = d.start || 0
|
||||||
|
d.length = d.length || 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"columnDefs": [
|
||||||
|
{ 'targets': '_all', "defaultContent": "" },
|
||||||
|
{ className: 'text-center', targets: '_all' },
|
||||||
|
],
|
||||||
|
columns: [
|
||||||
|
{ data: 'st_date', "width": "80px" },
|
||||||
|
{ data: 'cpid', "width": "80px" },
|
||||||
|
|
||||||
|
{ data: 'T0101' },
|
||||||
|
{ data: 'T0102' },
|
||||||
|
{ data: 'T0103' },
|
||||||
|
|
||||||
|
{ data: 'T0201' },
|
||||||
|
{ data: 'T0202' },
|
||||||
|
{ data: 'T0203' },
|
||||||
|
{ data: 'T0204' },
|
||||||
|
{ data: 'T0205' },
|
||||||
|
|
||||||
|
{ data: 'T0301' },
|
||||||
|
{ data: 'T0302' },
|
||||||
|
{ data: 'T0303' },
|
||||||
|
|
||||||
|
{ data: 'R0101' },
|
||||||
|
{ data: 'R0102' },
|
||||||
|
{ data: 'R0103' },
|
||||||
|
{ data: 'R0104' },
|
||||||
|
|
||||||
|
{ data: 'D0101' },
|
||||||
|
{ data: 'D0102' },
|
||||||
|
{ data: 'D0103' },
|
||||||
|
|
||||||
|
{ data: 'D0201' },
|
||||||
|
{ data: 'D0202' },
|
||||||
|
{ data: 'D0203' },
|
||||||
|
{ data: 'D0204' },
|
||||||
|
|
||||||
|
{ data: 'D0301' },
|
||||||
|
{ data: 'D0302' },
|
||||||
|
{ data: 'D0303' },
|
||||||
|
|
||||||
|
{ data: 'Z0101' }, { data: 'Z0102' }, { data: 'Z0103' }, { data: 'Z0104' },
|
||||||
|
{ data: 'Z0107', render: d => d ? `${d} %` : '-' },
|
||||||
|
{ data: 'Z0105', render: d => d ? `${d} %` : '-' },
|
||||||
|
{ data: 'Z0106', render: d => d ? `${d} %` : '-' },
|
||||||
|
|
||||||
|
{ data: 'A0101' },
|
||||||
|
],
|
||||||
|
// 옵션들 예시
|
||||||
|
paging: false,
|
||||||
|
searching: false,
|
||||||
|
ordering: false,
|
||||||
|
serverSide: true,
|
||||||
|
drawCallback: function () {
|
||||||
|
const api = this.api();
|
||||||
|
const rows = api.rows({ page: 'current' }).nodes();
|
||||||
|
const data = api.rows({ page: 'current' }).data();
|
||||||
|
|
||||||
|
// 기존 소계 제거(재그릴 때 중복 방지)
|
||||||
|
$(api.table().body()).find('tr.tr-day-sum').remove();
|
||||||
|
|
||||||
|
let curDate = null;
|
||||||
|
let sum = null;
|
||||||
|
|
||||||
|
function resetSum() {
|
||||||
|
const o = {};
|
||||||
|
SUM_KEYS.forEach(k => o[k] = 0);
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
function appendSumRow(afterRowNode, st_date, sum) {
|
||||||
|
// 퍼센트는 “소계 기준” 재계산
|
||||||
|
const Z0105 = pct(sum.Z0102, sum.Z0101); // Z0102 / Z0101
|
||||||
|
const Z0106 = pct(sum.Z0103, sum.Z0102); // Z0103 / Z0102
|
||||||
|
const Z0107 = pct(sum.R0105, (sum.R0101 + sum.R0102)); // R0105 / (R0101+R0102)
|
||||||
|
|
||||||
|
// 컬럼 개수만큼 TD를 정확히 만들어야 함
|
||||||
|
// 아래는 "st_date, cpid, ... 나머지" 구조를 가정 (너의 columns 순서에 맞춰서 채워줘야 함)
|
||||||
|
const tds = [];
|
||||||
|
tds.push(`<td></td>`); // 날짜 칸 비움
|
||||||
|
tds.push(`<td>일 계</td>`); // 매체사 칸에 "일계"
|
||||||
|
|
||||||
|
// 예: 이후 컬럼들을 네 columns 순서대로 push
|
||||||
|
const colKeysInOrder = [
|
||||||
|
'T0101', 'T0102', 'T0103',
|
||||||
|
'T0201', 'T0202', 'T0203', 'T0204', 'T0205',
|
||||||
|
'T0301', 'T0302', 'T0303',
|
||||||
|
'D0101', 'D0102', 'D0103',
|
||||||
|
'D0201', 'D0202', 'D0203', 'D0204',
|
||||||
|
'D0301', 'D0302', 'D0303',
|
||||||
|
'R0101', 'R0102', 'R0103', 'R0104',
|
||||||
|
'Z0101', 'Z0102', 'Z0103', 'Z0104',
|
||||||
|
'Z0107', 'Z0105', 'Z0106',
|
||||||
|
'A0101'
|
||||||
|
];
|
||||||
|
|
||||||
|
colKeysInOrder.forEach(k => {
|
||||||
|
if (k === 'Z0105') tds.push(`<td>${Z0105}</td>`);
|
||||||
|
else if (k === 'Z0106') tds.push(`<td>${Z0106}</td>`);
|
||||||
|
else if (k === 'Z0107') tds.push(`<td>${Z0107}</td>`);
|
||||||
|
else tds.push(`<td>${n(sum[k]).toLocaleString()}</td>`);
|
||||||
|
});
|
||||||
|
|
||||||
|
const tr = $(`<tr class="bolder tr-day-sum">${tds.join('')}</tr>`);
|
||||||
|
$(afterRowNode).after(tr);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
const row = data[i];
|
||||||
|
const st = row.st_date;
|
||||||
|
|
||||||
|
if (curDate === null) {
|
||||||
|
curDate = st;
|
||||||
|
sum = resetSum();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 날짜가 바뀌면 이전 날짜 소계 출력 후 리셋
|
||||||
|
if (st !== curDate) {
|
||||||
|
appendSumRow(rows[i - 1], curDate, sum);
|
||||||
|
curDate = st;
|
||||||
|
sum = resetSum();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 합산
|
||||||
|
SUM_KEYS.forEach(k => sum[k] += n(row[k]));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 마지막 날짜 소계 출력
|
||||||
|
if (data.length > 0) {
|
||||||
|
appendSumRow(rows[data.length - 1], curDate, sum);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// $('#resultList').on('xhr.dt', function (e, settings, json) {
|
||||||
|
// const rows = json?.data || [];
|
||||||
|
|
||||||
|
|
||||||
|
// const fields = [
|
||||||
|
// 't_cnt', 'hong1_cnt', 'hong2_cnt', 'm_cnt', 'v2_cnt', 'total'
|
||||||
|
// , 'd_o', 'd_x', 'd_tot'
|
||||||
|
// , 't_o', 't_x', 't_n', 't_e', 't_tot'
|
||||||
|
// , 'r_o', 'r_x', 'r_e', 'done', 'r_tot'
|
||||||
|
// , 's_1', 's_2'
|
||||||
|
// ];
|
||||||
|
|
||||||
|
// const toNum = (v) => {
|
||||||
|
// if (v == null || v === '') return 0;
|
||||||
|
// return Number(String(v).replace(/,/g, '')) || 0; // "18" 같은 문자열 대응
|
||||||
|
// };
|
||||||
|
|
||||||
|
// // 합계 객체 생성
|
||||||
|
// const sum = {};
|
||||||
|
// fields.forEach(f => sum[f] = 0);
|
||||||
|
|
||||||
|
// // rows 합산
|
||||||
|
// rows.forEach(r => {
|
||||||
|
// fields.forEach(f => sum[f] += toNum(r[f]));
|
||||||
|
// });
|
||||||
|
|
||||||
|
// // footer에 주입
|
||||||
|
// fields.forEach(f => {
|
||||||
|
// $('#resultList tfoot .sum-' + f).text(sum[f].toLocaleString());
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#resultList tbody').on('click', 'tr', function () {
|
||||||
|
const row = table.row(this).data()
|
||||||
|
if (!row) return
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// [검색] 버튼 눌렀을 때 다시 조회
|
||||||
|
$('#btnSearch').on('click', function () {
|
||||||
|
table.ajax.reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 전화확인 완료처리
|
||||||
|
$("#btnSilver_send_35").on("function", function () {
|
||||||
|
var sdate = $("#frm_srch_info [name=sdate]").val();
|
||||||
|
var edate = $("#frm_srch_info [name=edate]").val();
|
||||||
|
|
||||||
|
if (sdate == "") {
|
||||||
|
Swal.fire({
|
||||||
|
title: "시작일자를 선택해 주세요.",
|
||||||
|
icon: "warning"
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (edate == "") {
|
||||||
|
Swal.fire({
|
||||||
|
title: "종료일자를 선택해 주세요.",
|
||||||
|
icon: "warning"
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
swal.fire({
|
||||||
|
text: message,
|
||||||
|
type: "warning",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: "예",
|
||||||
|
cancelButtonText: "아니오",
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
cancelButtonColor: "#ff0000",
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
$.ajax({
|
||||||
|
url: '/m412/m412a/saveSendComplete',
|
||||||
|
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
'sdate': sdate,
|
||||||
|
'edate': edate,
|
||||||
|
},
|
||||||
|
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') {
|
||||||
|
Swal.fire({
|
||||||
|
title: '정상 처리되었습니다.',
|
||||||
|
icon: "success"
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
location.reload()
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Swal.fire({
|
||||||
|
title: result.msg,
|
||||||
|
icon: "error"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 엑셀다운 click
|
||||||
|
$("#excel-download").on("click", function () {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/m412/m412a/excel",
|
||||||
|
method: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
data: $("#frm_srch_info").serialize(),
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
downloadExcel_M412_Daily(result.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
function downloadExcel_M412_Daily(dataRows, filenamePrefix = "확인매물_일자별실적") {
|
||||||
|
// ===== 유틸 =====
|
||||||
|
const n = (v) => {
|
||||||
|
const x = parseFloat(v);
|
||||||
|
return Number.isFinite(x) ? x : 0;
|
||||||
|
};
|
||||||
|
const pct = (num, den) => {
|
||||||
|
if (!den) return "-";
|
||||||
|
return Math.round((num / den) * 100) + " %";
|
||||||
|
};
|
||||||
|
|
||||||
|
// ===== DataTables 컬럼 순서(35개) =====
|
||||||
|
// ※ HTML 헤더(전화확인 -> 홍보확인서 -> 등기부 -> Report -> 미수신삭제)와 동일 순서로 맞춤
|
||||||
|
const COL_KEYS = [
|
||||||
|
"st_date", "cpid",
|
||||||
|
// 전화확인(11)
|
||||||
|
"T0101", "T0102", "T0103",
|
||||||
|
"T0201", "T0202", "T0203", "T0204", "T0205",
|
||||||
|
"T0301", "T0302", "T0303",
|
||||||
|
// 홍보확인서(10)
|
||||||
|
"D0101", "D0102", "D0103",
|
||||||
|
"D0201", "D0202", "D0203", "D0204",
|
||||||
|
"D0301", "D0302", "D0303",
|
||||||
|
// 등기부확인(4)
|
||||||
|
"R0101", "R0102", "R0103", "R0104",
|
||||||
|
// Report(7)
|
||||||
|
"Z0101", "Z0102", "Z0103", "Z0104", "Z0107", "Z0105", "Z0106",
|
||||||
|
// 미수신삭제(1)
|
||||||
|
"A0101"
|
||||||
|
];
|
||||||
|
const COLS = COL_KEYS.length; // 35
|
||||||
|
|
||||||
|
// ===== 헤더 3줄 =====
|
||||||
|
const header1 = Array(COLS).fill("");
|
||||||
|
header1[0] = "날짜";
|
||||||
|
header1[1] = "매체사";
|
||||||
|
header1[2] = "전화확인";
|
||||||
|
header1[13] = "홍보확인서";
|
||||||
|
header1[23] = "등기부확인";
|
||||||
|
header1[27] = "Report";
|
||||||
|
header1[34] = "미수신삭제";
|
||||||
|
|
||||||
|
const header2 = Array(COLS).fill("");
|
||||||
|
// 전화확인(2~12)
|
||||||
|
header2[2] = "확인대상";
|
||||||
|
header2[5] = "확인결과";
|
||||||
|
header2[10] = "확인내역";
|
||||||
|
// 홍보확인서(13~22)
|
||||||
|
header2[13] = "확인대상";
|
||||||
|
header2[16] = "확인결과";
|
||||||
|
header2[20] = "확인내역";
|
||||||
|
// 등기부확인(23~26) rowspan2라 비움
|
||||||
|
// Report(27~33) rowspan2라 비움
|
||||||
|
|
||||||
|
const header3 = [
|
||||||
|
"날짜", "매체사",
|
||||||
|
// 전화확인(11)
|
||||||
|
"전일미확인", "1차재시도", "접수",
|
||||||
|
"일치", "불일치", "거부", "무응답외", "총확인",
|
||||||
|
"1차실패", "최종실패", "미확인",
|
||||||
|
// 홍보확인서(10)
|
||||||
|
"전일미확인", "1차재시도", "접수",
|
||||||
|
"일치", "불일치", "기타", "총확인",
|
||||||
|
"1차실패", "최종실패", "미확인",
|
||||||
|
// 등기부확인(4)
|
||||||
|
"일치", "불일치", "등기부없음", "총확인",
|
||||||
|
// Report(7)
|
||||||
|
"총검증대상", "검증시도", "검증완료", "검증미완료", "간소화확인율", "검증시도율", "시도대비완료율",
|
||||||
|
// 미수신삭제(1)
|
||||||
|
"미수신삭제"
|
||||||
|
];
|
||||||
|
|
||||||
|
// ===== 일자별 소계(일계) 포함해서 바디 만들기 =====
|
||||||
|
// dataRows는 st_date 기준으로 정렬되어 있다고 가정(서버에서 ORDER BY st_date, cpid 권장)
|
||||||
|
const body = [];
|
||||||
|
let cur = null;
|
||||||
|
|
||||||
|
const SUM_KEYS = [
|
||||||
|
"T0101", "T0102", "T0103",
|
||||||
|
"T0201", "T0202", "T0203", "T0204", "T0205",
|
||||||
|
"T0301", "T0302", "T0303",
|
||||||
|
"D0101", "D0102", "D0103",
|
||||||
|
"D0201", "D0202", "D0203", "D0204",
|
||||||
|
"D0301", "D0302", "D0303",
|
||||||
|
"R0101", "R0102", "R0103", "R0104",
|
||||||
|
"Z0101", "Z0102", "Z0103", "Z0104",
|
||||||
|
"R0105",
|
||||||
|
"A0101"
|
||||||
|
];
|
||||||
|
|
||||||
|
const resetSum = () => {
|
||||||
|
const s = {};
|
||||||
|
SUM_KEYS.forEach(k => s[k] = 0);
|
||||||
|
return s;
|
||||||
|
};
|
||||||
|
|
||||||
|
const appendDaySum = (st_date, sum) => {
|
||||||
|
// 퍼센트 3개는 소계 기준 재계산
|
||||||
|
const z0105 = pct(sum.Z0102, sum.Z0101);
|
||||||
|
const z0106 = pct(sum.Z0103, sum.Z0102);
|
||||||
|
const z0107 = pct(sum.R0105, (sum.R0101 + sum.R0102));
|
||||||
|
|
||||||
|
// “일계” 행은 날짜칸 비우고 매체사에 '일 계'
|
||||||
|
const row = Array(COLS).fill("");
|
||||||
|
row[0] = "";
|
||||||
|
row[1] = "일 계";
|
||||||
|
|
||||||
|
// 숫자/지표 채우기 (COL_KEYS 기준)
|
||||||
|
COL_KEYS.forEach((k, idx) => {
|
||||||
|
if (idx < 2) return; // st_date, cpid 제외
|
||||||
|
if (k === "Z0105") row[idx] = z0105;
|
||||||
|
else if (k === "Z0106") row[idx] = z0106;
|
||||||
|
else if (k === "Z0107") row[idx] = z0107;
|
||||||
|
else row[idx] = n(sum[k]).toLocaleString();
|
||||||
|
});
|
||||||
|
|
||||||
|
body.push(row);
|
||||||
|
};
|
||||||
|
|
||||||
|
let sum = resetSum();
|
||||||
|
|
||||||
|
for (let i = 0; i < (dataRows || []).length; i++) {
|
||||||
|
const r = dataRows[i];
|
||||||
|
const st = r.st_date;
|
||||||
|
|
||||||
|
if (cur === null) cur = st;
|
||||||
|
|
||||||
|
// 날짜 변경 시 일계 추가
|
||||||
|
if (st !== cur) {
|
||||||
|
appendDaySum(cur, sum);
|
||||||
|
cur = st;
|
||||||
|
sum = resetSum();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 원본 row 추가
|
||||||
|
const row = COL_KEYS.map((k) => {
|
||||||
|
if (k === "Z0105" || k === "Z0106" || k === "Z0107") {
|
||||||
|
return (r[k] === undefined || r[k] === null || r[k] === "") ? "-" : (String(r[k]).includes("%") ? r[k] : `${r[k]} %`);
|
||||||
|
}
|
||||||
|
if (k === "st_date" || k === "cpid") return r[k] ?? "";
|
||||||
|
return (r[k] === undefined || r[k] === null || r[k] === "") ? "0" : String(r[k]);
|
||||||
|
});
|
||||||
|
body.push(row);
|
||||||
|
|
||||||
|
// 합산 누적
|
||||||
|
SUM_KEYS.forEach(k => sum[k] += n(r[k]));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 마지막 날짜 일계
|
||||||
|
if ((dataRows || []).length > 0) {
|
||||||
|
appendDaySum(cur, sum);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===== Sheet 생성 =====
|
||||||
|
const aoa = [header1, header2, header3, ...body];
|
||||||
|
const ws = XLSX.utils.aoa_to_sheet(aoa);
|
||||||
|
|
||||||
|
// ===== Merge 설정 (정확히 35컬럼 기준) =====
|
||||||
|
ws["!merges"] = [
|
||||||
|
// Row1(0): 날짜/매체/미수신삭제 rowspan 3
|
||||||
|
{ s: { r: 0, c: 0 }, e: { r: 2, c: 0 } }, // 날짜
|
||||||
|
{ s: { r: 0, c: 1 }, e: { r: 2, c: 1 } }, // 매체사
|
||||||
|
{ s: { r: 0, c: 34 }, e: { r: 2, c: 34 } }, // 미수신삭제
|
||||||
|
|
||||||
|
// Row1: 상단 그룹
|
||||||
|
{ s: { r: 0, c: 2 }, e: { r: 0, c: 12 } }, // 전화확인(11)
|
||||||
|
{ s: { r: 0, c: 13 }, e: { r: 0, c: 22 } }, // 홍보확인서(10)
|
||||||
|
{ s: { r: 0, c: 23 }, e: { r: 1, c: 26 } }, // 등기부확인 rowspan2 (4)
|
||||||
|
{ s: { r: 0, c: 27 }, e: { r: 1, c: 33 } }, // Report rowspan2 (7)
|
||||||
|
|
||||||
|
// Row2(1): 전화확인 하위
|
||||||
|
{ s: { r: 1, c: 2 }, e: { r: 1, c: 4 } }, // 확인대상(3)
|
||||||
|
{ s: { r: 1, c: 5 }, e: { r: 1, c: 9 } }, // 확인결과(5)
|
||||||
|
{ s: { r: 1, c: 10 }, e: { r: 1, c: 12 } }, // 확인내역(3)
|
||||||
|
|
||||||
|
// Row2: 홍보확인서 하위
|
||||||
|
{ s: { r: 1, c: 13 }, e: { r: 1, c: 15 } }, // 확인대상(3)
|
||||||
|
{ s: { r: 1, c: 16 }, e: { r: 1, c: 19 } }, // 확인결과(4)
|
||||||
|
{ s: { r: 1, c: 20 }, e: { r: 1, c: 22 } } // 확인내역(3)
|
||||||
|
];
|
||||||
|
|
||||||
|
// ===== 가독성: 컬럼 너비 =====
|
||||||
|
ws["!cols"] = [
|
||||||
|
{ wpx: 90 }, // 날짜
|
||||||
|
{ wpx: 90 }, // 매체사
|
||||||
|
...Array(COLS - 2).fill({ wpx: 70 })
|
||||||
|
];
|
||||||
|
|
||||||
|
// ===== 저장 =====
|
||||||
|
const wb = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(wb, ws, "sheet1");
|
||||||
|
XLSX.writeFile(wb, `${filenamePrefix}_${getDateTimeString()}.xlsx`);
|
||||||
|
}
|
||||||
|
|
||||||
|
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}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const today = new Date().toISOString().slice(0, 10);
|
||||||
|
document.getElementById("sdate").value = today;
|
||||||
|
document.getElementById("edate").value = today;
|
||||||
|
});
|
||||||
|
|
||||||
|
function n(v) { // 문자열 "0" 같은 것도 숫자로
|
||||||
|
const x = parseFloat(v);
|
||||||
|
return Number.isFinite(x) ? x : 0;
|
||||||
|
}
|
||||||
|
function pct(num, den) {
|
||||||
|
if (!den) return '-';
|
||||||
|
return Math.round((num / den) * 100) + ' %';
|
||||||
|
}
|
||||||
|
|
||||||
|
function initSelect() {
|
||||||
|
|
||||||
|
$("#select_H").val(sendH);
|
||||||
|
$("#select_D").val(sendD);
|
||||||
|
$("#select_T").val(sendT);
|
||||||
|
$("#select_N").val(sendN);
|
||||||
|
$("#select_J").val(sendJ);
|
||||||
|
$("#select_O").val(sendO);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function send_yn(type) {
|
||||||
|
var val = $("#select_" + type).val();
|
||||||
|
|
||||||
|
var nm = "";
|
||||||
|
if (type == 'H') {
|
||||||
|
nm = '홍보확인서';
|
||||||
|
} else if (type == 'T') {
|
||||||
|
nm = '전화확인';
|
||||||
|
} else if (type == 'N') {
|
||||||
|
nm = '신홍보확인서';
|
||||||
|
} else if (type == 'J') {
|
||||||
|
nm = '공동중개매물';
|
||||||
|
} else if (type == 'O') {
|
||||||
|
nm = '모바일확인 V2';
|
||||||
|
} else {
|
||||||
|
nm = '등기부등본';
|
||||||
|
}
|
||||||
|
|
||||||
|
var onOff = "";
|
||||||
|
val == "Y" ? onOff = "ON" : onOff = "OFF";
|
||||||
|
|
||||||
|
|
||||||
|
var message = nm + '의 전송을 ' + onOff + '(으)로\n변경하시겠습니까?';
|
||||||
|
|
||||||
|
swal.fire({
|
||||||
|
text: message,
|
||||||
|
type: "warning",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: "예",
|
||||||
|
cancelButtonText: "아니오",
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
cancelButtonColor: "#ff0000",
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
$.ajax({
|
||||||
|
url: '/m412/m412a/saveSendType',
|
||||||
|
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
'type': type,
|
||||||
|
'yn': val
|
||||||
|
},
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
error: function (xhr, error, thrown) {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
var msg = "";
|
||||||
|
if (xhr.responseText != null) {
|
||||||
|
msg = xhr.responseText
|
||||||
|
} else {
|
||||||
|
msg = "잠시후 다시 시도해 주세요."
|
||||||
|
}
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: msg,
|
||||||
|
icon: "error"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
|
||||||
|
if (result.code == '0') {
|
||||||
|
Swal.fire({
|
||||||
|
title: '정상 처리되었습니다.',
|
||||||
|
icon: "success"
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
location.reload()
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Swal.fire({
|
||||||
|
title: result.msg,
|
||||||
|
icon: "error"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
420
app/Views/pages/results/m415/stats.php
Normal file
420
app/Views/pages/results/m415/stats.php
Normal file
@@ -0,0 +1,420 @@
|
|||||||
|
<?= $this->extend('layouts/main') ?>
|
||||||
|
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<style>
|
||||||
|
th {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#resultList tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blockUI {
|
||||||
|
z-index: 1500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swal2-cancel {
|
||||||
|
background-color: #ff0000 !important;
|
||||||
|
color: #fff !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;">
|
||||||
|
|
||||||
|
<!-- 1줄 -->
|
||||||
|
<div class="row mb-3">
|
||||||
|
<!-- 기준일자 -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">기준일자</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="sdate" name="sdate">
|
||||||
|
</div>
|
||||||
|
<div class="col-2 d-flex align-items-center justify-content-center">~</div>
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="edate" name="edate">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div class="col-md-2">
|
||||||
|
<label class="form-label mb-1">팀별실적</label>
|
||||||
|
<select class="form-control" name="dept_sq">
|
||||||
|
<option value="">선택</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">검증방식</label>
|
||||||
|
<select class="form-control" name="vrfcreq_way">
|
||||||
|
<option value="">선택</option>
|
||||||
|
</select>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<div class="col-md-1 d-grid align-items-end">
|
||||||
|
<button type="button" class="btn btn-primary" id="btnSearch">검색</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12 col-xl-12">
|
||||||
|
<div class="main-card mb-3 card">
|
||||||
|
<div class="card-header d-flex align-items-center">
|
||||||
|
<h3 class="card-title mb-0">매체사 목록</h3>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<button class="mb-2 me-2 border-0 btn-transition btn btn-shadow btn-outline-success"
|
||||||
|
id="excel-download">엑셀다운로드</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table id="resultList" class="table table-hover table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th rowspan="2">일자</th>
|
||||||
|
<th rowspan="2">모바일검증</th>
|
||||||
|
<th colspan="3">전화확인</th>
|
||||||
|
<th colspan="3">홍보확인서 확인</th>
|
||||||
|
<th colspan="3">신홍보확인서 확인</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>전화 검증</th>
|
||||||
|
<th>등기부등본 검증</th>
|
||||||
|
<th>총소요</th>
|
||||||
|
<th>FAX검증</th>
|
||||||
|
<th>등기부등본 검증</th>
|
||||||
|
<th>총소요</th>
|
||||||
|
<th>FAX검증</th>
|
||||||
|
<th>등기부등본 검증</th>
|
||||||
|
<th>총소요</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</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>
|
||||||
|
<style>
|
||||||
|
table.dataTable thead th {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
// const tpl = document.querySelector('.my-loader-template');
|
||||||
|
|
||||||
|
let date = new Date();
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
|
||||||
|
let table = $('#resultList').DataTable({
|
||||||
|
language: lang_kor,
|
||||||
|
processing: true,
|
||||||
|
ajax: {
|
||||||
|
url: '/m415/m415a/getResultList',
|
||||||
|
type: 'GET',
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
data: function (d) {
|
||||||
|
d.sdate = $("#frm_srch_info [name=sdate]").val()
|
||||||
|
d.edate = $("#frm_srch_info [name=edate]").val()
|
||||||
|
|
||||||
|
d.start = d.start || 0
|
||||||
|
d.length = d.length || 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"columnDefs": [
|
||||||
|
{ 'targets': '_all', "defaultContent": "" },
|
||||||
|
{ className: 'text-center', targets: '_all' },
|
||||||
|
],
|
||||||
|
columns: [
|
||||||
|
{ data: 'stan_date' },
|
||||||
|
{ data: 'm_tot' },
|
||||||
|
{ data: 't_doc' },
|
||||||
|
{ data: 't_cert' },
|
||||||
|
{ data: 't_tot' },
|
||||||
|
{ data: 'd_doc' },
|
||||||
|
{ data: 'd_cert' },
|
||||||
|
{ data: 'd_tot' },
|
||||||
|
{ data: 'n_doc' },
|
||||||
|
{ data: 'n_cert' },
|
||||||
|
{ data: 'n_tot' },
|
||||||
|
|
||||||
|
],
|
||||||
|
// 옵션들 예시
|
||||||
|
paging: false,
|
||||||
|
searching: false,
|
||||||
|
ordering: false,
|
||||||
|
serverSide: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#resultList tbody').on('click', 'tr', function () {
|
||||||
|
const row = table.row(this).data()
|
||||||
|
if (!row) return
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// [검색] 버튼 눌렀을 때 다시 조회
|
||||||
|
$('#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();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀다운 click
|
||||||
|
$("#excel-download").on("click", function () {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/m415/m415a/excel",
|
||||||
|
method: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
data: $("#frm_srch_info").serialize(),
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
// downloadExcel(result.data);
|
||||||
|
downloadExcelWithHeader(result.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
function downloadExcelWithHeader(dataRows) {
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 0) 유틸
|
||||||
|
* ======================= */
|
||||||
|
const COLS = 11;
|
||||||
|
|
||||||
|
const fitCols = (arr) => {
|
||||||
|
const a = (arr || []).slice(0, COLS);
|
||||||
|
while (a.length < COLS) a.push("");
|
||||||
|
return a;
|
||||||
|
};
|
||||||
|
|
||||||
|
const safe = (v) => (v === undefined || v === null) ? "" : v;
|
||||||
|
|
||||||
|
// 숫자/빈값 안전 처리 (소요시간이 숫자라면 여기로)
|
||||||
|
const num = (v) => (v === undefined || v === null || v === "") ? 0 : Number(v);
|
||||||
|
|
||||||
|
// (선택) 초(seconds) → hh:mm:ss 로 보여주고 싶으면 사용
|
||||||
|
// const secToHms = (sec) => {
|
||||||
|
// const s = Number(sec || 0);
|
||||||
|
// const h = String(Math.floor(s / 3600)).padStart(2, "0");
|
||||||
|
// const m = String(Math.floor((s % 3600) / 60)).padStart(2, "0");
|
||||||
|
// const ss = String(Math.floor(s % 60)).padStart(2, "0");
|
||||||
|
// return `${h}:${m}:${ss}`;
|
||||||
|
// };
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 1) 헤더 (thead와 동일)
|
||||||
|
* ======================= */
|
||||||
|
const header1 = fitCols([
|
||||||
|
"일자",
|
||||||
|
"모바일검증",
|
||||||
|
"전화확인", "", "",
|
||||||
|
"홍보확인서 확인", "", "",
|
||||||
|
"신홍보확인서 확인", "", ""
|
||||||
|
]);
|
||||||
|
|
||||||
|
const header2 = fitCols([
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"전화 검증",
|
||||||
|
"등기부등본 검증",
|
||||||
|
"총소요",
|
||||||
|
"FAX검증",
|
||||||
|
"등기부등본 검증",
|
||||||
|
"총소요",
|
||||||
|
"FAX검증",
|
||||||
|
"등기부등본 검증",
|
||||||
|
"총소요",
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 2) 바디 (DataTables columns 순서 그대로)
|
||||||
|
* columns:
|
||||||
|
* stan_date, m_tot,
|
||||||
|
* t_doc, t_cert, t_tot,
|
||||||
|
* d_doc, d_cert, d_tot,
|
||||||
|
* n_doc, n_cert, n_tot
|
||||||
|
* ======================= */
|
||||||
|
const body = (dataRows || []).map(r => fitCols([
|
||||||
|
safe(r.stan_date),
|
||||||
|
safe(r.m_tot),
|
||||||
|
|
||||||
|
safe(r.t_doc),
|
||||||
|
safe(r.t_cert),
|
||||||
|
safe(r.t_tot), // 숫자면 num(r.t_tot)
|
||||||
|
|
||||||
|
safe(r.d_doc),
|
||||||
|
safe(r.d_cert),
|
||||||
|
safe(r.d_tot),
|
||||||
|
|
||||||
|
safe(r.n_doc),
|
||||||
|
safe(r.n_cert),
|
||||||
|
safe(r.n_tot),
|
||||||
|
]));
|
||||||
|
|
||||||
|
const aoa = [header1, header2, ...body];
|
||||||
|
const ws = XLSX.utils.aoa_to_sheet(aoa);
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 3) 병합(merge) - thead와 동일
|
||||||
|
* ======================= */
|
||||||
|
ws["!merges"] = [
|
||||||
|
// "일자" rowspan 2
|
||||||
|
{ s: { r: 0, c: 0 }, e: { r: 1, c: 0 } },
|
||||||
|
// "모바일검증" rowspan 2
|
||||||
|
{ s: { r: 0, c: 1 }, e: { r: 1, c: 1 } },
|
||||||
|
|
||||||
|
// "전화확인" colspan 3 (2~4)
|
||||||
|
{ s: { r: 0, c: 2 }, e: { r: 0, c: 4 } },
|
||||||
|
// "홍보확인서 확인" colspan 3 (5~7)
|
||||||
|
{ s: { r: 0, c: 5 }, e: { r: 0, c: 7 } },
|
||||||
|
// "신홍보확인서 확인" colspan 3 (8~10)
|
||||||
|
{ s: { r: 0, c: 8 }, e: { r: 0, c: 10 } },
|
||||||
|
];
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 4) 컬럼 너비
|
||||||
|
* ======================= */
|
||||||
|
ws["!cols"] = [
|
||||||
|
{ wpx: 100 }, // 일자
|
||||||
|
{ wpx: 100 }, // 모바일검증
|
||||||
|
{ wpx: 100 }, // 전화 검증
|
||||||
|
{ wpx: 100 }, // 전화-등기부등본
|
||||||
|
{ wpx: 100 }, // 전화-총소요
|
||||||
|
{ wpx: 100 }, // 홍보 FAX
|
||||||
|
{ wpx: 100 }, // 홍보-등기부등본
|
||||||
|
{ wpx: 100 }, // 홍보-총소요
|
||||||
|
{ wpx: 100 }, // 신홍보 FAX
|
||||||
|
{ wpx: 100 }, // 신홍보-등기부등본
|
||||||
|
{ wpx: 100 }, // 신홍보-총소요
|
||||||
|
];
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 5) (선택) 헤더 스타일 + 테두리 (xlsx-js-style 사용 시)
|
||||||
|
* ======================= */
|
||||||
|
const lastRow = aoa.length - 1;
|
||||||
|
const lastCol = COLS - 1;
|
||||||
|
|
||||||
|
const headerStyle = {
|
||||||
|
font: { bold: true },
|
||||||
|
alignment: { horizontal: "center", vertical: "center" },
|
||||||
|
fill: { patternType: "solid", fgColor: { rgb: "F2F2F2" } },
|
||||||
|
border: {
|
||||||
|
top: { style: "thin", color: { rgb: "D9D9D9" } },
|
||||||
|
bottom: { style: "thin", color: { rgb: "D9D9D9" } },
|
||||||
|
left: { style: "thin", color: { rgb: "D9D9D9" } },
|
||||||
|
right: { style: "thin", color: { rgb: "D9D9D9" } },
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const cellBorder = {
|
||||||
|
border: {
|
||||||
|
top: { style: "thin", color: { rgb: "E0E0E0" } },
|
||||||
|
bottom: { style: "thin", color: { rgb: "E0E0E0" } },
|
||||||
|
left: { style: "thin", color: { rgb: "E0E0E0" } },
|
||||||
|
right: { style: "thin", color: { rgb: "E0E0E0" } },
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 모든 셀 테두리 + 헤더 스타일
|
||||||
|
for (let r = 0; r <= lastRow; r++) {
|
||||||
|
for (let c = 0; c <= lastCol; c++) {
|
||||||
|
const addr = XLSX.utils.encode_cell({ r, c });
|
||||||
|
if (!ws[addr]) ws[addr] = { t: "s", v: "" };
|
||||||
|
|
||||||
|
// 기본 테두리
|
||||||
|
ws[addr].s = Object.assign({}, ws[addr].s || {}, cellBorder);
|
||||||
|
|
||||||
|
// 헤더(0~1행)는 헤더 스타일 덮어쓰기
|
||||||
|
if (r <= 1) ws[addr].s = Object.assign({}, ws[addr].s, headerStyle);
|
||||||
|
// 바디 가운데 정렬 원하면:
|
||||||
|
// else ws[addr].s = Object.assign({}, ws[addr].s, { alignment:{horizontal:"center",vertical:"center"}});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 헤더 높이(보기 좋게)
|
||||||
|
ws["!rows"] = [{ hpx: 24 }, { hpx: 24 }];
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 6) 저장
|
||||||
|
* ======================= */
|
||||||
|
const wb = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(wb, ws, "sheet1");
|
||||||
|
XLSX.writeFile(wb, "검증_소요시간_" + getDateTimeString() + ".xlsx");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const today = new Date().toISOString().slice(0, 10);
|
||||||
|
document.getElementById("sdate").value = today;
|
||||||
|
document.getElementById("edate").value = today;
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
534
app/Views/pages/results/m416/stats.php
Normal file
534
app/Views/pages/results/m416/stats.php
Normal file
@@ -0,0 +1,534 @@
|
|||||||
|
<?= $this->extend('layouts/main') ?>
|
||||||
|
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<style>
|
||||||
|
th {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#resultList tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blockUI {
|
||||||
|
z-index: 1500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swal2-cancel {
|
||||||
|
background-color: #ff0000 !important;
|
||||||
|
color: #fff !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="row mb-3">
|
||||||
|
<!-- 관할조직 -->
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label class="form-label mb-1">관할조직</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-6">
|
||||||
|
<select class="form-control" name="bonbu" id="bonbu">
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($bonbu as $d): ?>
|
||||||
|
<option value="<?= $d['dept_sq'] ?>"><?= $d['dept_nm'] ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<select class="form-control" name="dept_sq" id="dept_sq">
|
||||||
|
<option value="">선택</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 기준일자 -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">기준일자</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="sdate" name="sdate">
|
||||||
|
</div>
|
||||||
|
<div class="col-2 d-flex align-items-center justify-content-center">~</div>
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="edate" name="edate">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</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>
|
||||||
|
</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 align-items-end">
|
||||||
|
<button type="button" class="btn btn-primary" id="btnSearch">검색</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12 col-xl-12">
|
||||||
|
<div class="main-card mb-3 card">
|
||||||
|
<div class="card-header d-flex align-items-center">
|
||||||
|
<h3 class="card-title mb-0">사용자 목록</h3>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<button class="mb-2 me-2 border-0 btn-transition btn btn-shadow btn-outline-success"
|
||||||
|
id="excel-download">엑셀다운로드</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table id="resultList" class="table table-hover table-striped table-bordered">
|
||||||
|
<thead></thead>
|
||||||
|
<tbody></tbody>
|
||||||
|
</table>
|
||||||
|
</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>
|
||||||
|
<style>
|
||||||
|
table.dataTable thead th {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
// const tpl = document.querySelector('.my-loader-template');
|
||||||
|
var teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
|
|
||||||
|
let date = new Date();
|
||||||
|
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
const edate = $('#edate').val();
|
||||||
|
const days = getDaysByEndDate(edate);
|
||||||
|
initTable(days);
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
|
||||||
|
$("#bonbu").on("change", function (e) {
|
||||||
|
|
||||||
|
var dept_sq = e.target.value
|
||||||
|
|
||||||
|
$("#dept_sq").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>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#dept_sq").append(str)
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#srcSido, #srcGugun").on("change", function (e) {
|
||||||
|
|
||||||
|
const targetId = this.id;
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/manage/areas/getAreaList",
|
||||||
|
method: "POST",
|
||||||
|
dataType: "json",
|
||||||
|
data: {
|
||||||
|
'srcSido': $("#frm_srch_info [name=srcSido]").val(),
|
||||||
|
'srcGugun': $("#frm_srch_info [name=srcGugun]").val(),
|
||||||
|
},
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
|
||||||
|
switch (targetId) {
|
||||||
|
case "srcSido":
|
||||||
|
$("#srcGugun").empty()
|
||||||
|
var str = "";
|
||||||
|
str += "<option value=''>시/군/구</option>";
|
||||||
|
|
||||||
|
if (result.length > 0) {
|
||||||
|
for (var i = 0; i < result.length; i++) {
|
||||||
|
str += "<option value='" + result[i]['region_cd'] + "'>" + result[i].region_nm + "</option>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#srcGugun").append(str);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "srcGugun":
|
||||||
|
$("#srcDong").empty()
|
||||||
|
var str = "";
|
||||||
|
str += "<option value=''>읍/면/동</option>";
|
||||||
|
|
||||||
|
if (result.length > 0) {
|
||||||
|
for (var i = 0; i < result.length; i++) {
|
||||||
|
str += "<option value='" + result[i]['region_cd'] + "'>" + result[i].region_nm + "</option>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#srcDong").append(str);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// [검색] 버튼 눌렀을 때 다시 조회
|
||||||
|
$('#btnSearch').on('click', function () {
|
||||||
|
const srchDate = $('#edate').val();
|
||||||
|
const srchDay = getDaysByEndDate(srchDate);
|
||||||
|
initTable(srchDay)
|
||||||
|
// table.ajax.reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀다운 click
|
||||||
|
$("#excel-download").on("click", function () {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/m416/m416a/excel",
|
||||||
|
method: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
data: $("#frm_srch_info").serialize(),
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
const days = getDaysByEndDate($("#edate").val());
|
||||||
|
downloadExcelWithHeader(result.data, days);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// datatable render
|
||||||
|
function initTable(days) {
|
||||||
|
// 1) thead 생성
|
||||||
|
renderThead(days, days.length);
|
||||||
|
|
||||||
|
// 2) 기존 테이블 제거
|
||||||
|
if ($.fn.DataTable.isDataTable('#resultList')) {
|
||||||
|
table.destroy();
|
||||||
|
$('#resultList tbody').empty(); // 잔여 DOM 정리
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3) columns 생성 후 초기화
|
||||||
|
const columns = buildColumns(days);
|
||||||
|
|
||||||
|
table = $('#resultList').DataTable({
|
||||||
|
language: lang_kor,
|
||||||
|
processing: true,
|
||||||
|
serverSide: true, // 필요 시
|
||||||
|
searching: false,
|
||||||
|
ordering: false,
|
||||||
|
paging: false,
|
||||||
|
ajax: {
|
||||||
|
url: '/m416/m416a/getResultList',
|
||||||
|
type: 'GET',
|
||||||
|
data: function (d) {
|
||||||
|
|
||||||
|
d.sdate = $('#sdate').val();
|
||||||
|
d.edate = $('#edate').val();
|
||||||
|
|
||||||
|
d.bonbu = $("#frm_srch_info [name=bonbu]").val();
|
||||||
|
d.dep_sq = $("#frm_srch_info [name=dep_sq]").val();
|
||||||
|
d.srchType = $("#frm_srch_info [name=srchType]").val();
|
||||||
|
d.srchTxt = $("#frm_srch_info [name=srchTxt]").val();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns,
|
||||||
|
columnDefs: [
|
||||||
|
{ targets: '_all', defaultContent: '', className: 'text-center' }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// table head render
|
||||||
|
function renderThead(days, cnt) {
|
||||||
|
// cnt는 days.length 라고 보면 됨
|
||||||
|
const $thead = $('#resultList thead');
|
||||||
|
const tr1 = `
|
||||||
|
<tr>
|
||||||
|
<th rowspan="2">순번</th>
|
||||||
|
<th rowspan="2">아이디</th>
|
||||||
|
<th rowspan="2">이름</th>
|
||||||
|
<th rowspan="2">촬영</th>
|
||||||
|
<th colspan="${cnt}">일자별 이동거리(km)</th>
|
||||||
|
<th rowspan="2">합계</th>
|
||||||
|
</tr>`;
|
||||||
|
const tr2 = `
|
||||||
|
<tr>
|
||||||
|
${days.map(d => `<th>${parseInt(d, 10)}</th>`).join('')}
|
||||||
|
</tr>`;
|
||||||
|
|
||||||
|
$thead.html(tr1 + tr2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// data column render
|
||||||
|
function buildColumns(days) {
|
||||||
|
const fixed = [
|
||||||
|
{
|
||||||
|
"data": null,
|
||||||
|
"width": "30px",
|
||||||
|
"render": function (data, type, row, meta) {
|
||||||
|
return meta.row + meta.settings._iDisplayStart + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ data: 'usr_id', "width": "80px" },
|
||||||
|
{ data: 'usr_nm', "width": "80px" },
|
||||||
|
{ data: 'shoot_cnt' },
|
||||||
|
];
|
||||||
|
|
||||||
|
const dynamic = days.map(day => ({
|
||||||
|
data: `d${day}`,
|
||||||
|
name: `d${day}`,
|
||||||
|
defaultContent: ''
|
||||||
|
}));
|
||||||
|
|
||||||
|
const total = [
|
||||||
|
{ data: 'tot_distance' },
|
||||||
|
];
|
||||||
|
|
||||||
|
return [...fixed, ...dynamic, ...total];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
function downloadExcelWithHeader(dataRows, days) {
|
||||||
|
// days: ["01","02",...]
|
||||||
|
const fixedCols = ["순번", "아이디", "이름", "촬영"];
|
||||||
|
const totalCol = "합계(km)";
|
||||||
|
|
||||||
|
const COLS = fixedCols.length + (days?.length || 0) + 1; // +1 = 합계
|
||||||
|
|
||||||
|
const fitCols = (arr) => {
|
||||||
|
const a = (arr || []).slice(0, COLS);
|
||||||
|
while (a.length < COLS) a.push("");
|
||||||
|
return a;
|
||||||
|
};
|
||||||
|
|
||||||
|
const safe = (v) => (v === undefined || v === null) ? "" : v;
|
||||||
|
|
||||||
|
// 숫자형 안전 처리 (거리)
|
||||||
|
const num = (v) => (v === undefined || v === null || v === "") ? 0 : Number(v);
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 1) 헤더(2줄)
|
||||||
|
* - 1줄: 고정 + 그룹(일자별) + 합계(rowspan)
|
||||||
|
* - 2줄: 일자(1..말일)
|
||||||
|
* ======================= */
|
||||||
|
const header1 = fitCols([
|
||||||
|
...fixedCols,
|
||||||
|
"일자별 이동거리(km)",
|
||||||
|
...Array(Math.max((days?.length || 0) - 1, 0)).fill(""),
|
||||||
|
totalCol
|
||||||
|
]);
|
||||||
|
|
||||||
|
const header2 = fitCols([
|
||||||
|
...Array(fixedCols.length).fill(""),
|
||||||
|
...(days || []).map(d => String(parseInt(d, 10))), // "01" -> "1"
|
||||||
|
""
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 2) 바디
|
||||||
|
* - 서버가 d01,d02... 형태로 내려준다는 전제
|
||||||
|
* - 합계는 tot_distance (없으면 일자 합으로 계산)
|
||||||
|
* ======================= */
|
||||||
|
const body = (dataRows || []).map((r, idx) => {
|
||||||
|
const distByDay = (days || []).map(d => num(r[`d${d}`]));
|
||||||
|
|
||||||
|
// 서버 합계 컬럼이 있으면 그걸 우선 사용, 없으면 일자합
|
||||||
|
const total = (r.tot_distance !== undefined && r.tot_distance !== null)
|
||||||
|
? num(r.tot_distance)
|
||||||
|
: distByDay.reduce((a, b) => a + b, 0);
|
||||||
|
|
||||||
|
return fitCols([
|
||||||
|
idx + 1, // 순번(엑셀은 재계산)
|
||||||
|
safe(r.usr_id),
|
||||||
|
safe(r.usr_nm),
|
||||||
|
safe(r.shoot_cnt),
|
||||||
|
...distByDay,
|
||||||
|
total
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
const aoa = [header1, header2, ...body];
|
||||||
|
const ws = XLSX.utils.aoa_to_sheet(aoa);
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 3) 병합(merge)
|
||||||
|
* ======================= */
|
||||||
|
const dayStart = fixedCols.length; // 일자 시작 컬럼 index
|
||||||
|
const dayEnd = dayStart + (days.length - 1); // 일자 끝 컬럼 index
|
||||||
|
const totalColIdx = fixedCols.length + days.length; // 합계 컬럼 index
|
||||||
|
|
||||||
|
const merges = [
|
||||||
|
// 고정 4개 rowspan 2
|
||||||
|
{ s: { r: 0, c: 0 }, e: { r: 1, c: 0 } }, // 순번
|
||||||
|
{ s: { r: 0, c: 1 }, e: { r: 1, c: 1 } }, // 아이디
|
||||||
|
{ s: { r: 0, c: 2 }, e: { r: 1, c: 2 } }, // 이름
|
||||||
|
{ s: { r: 0, c: 3 }, e: { r: 1, c: 3 } }, // 촬영
|
||||||
|
// 합계 rowspan 2
|
||||||
|
{ s: { r: 0, c: totalColIdx }, e: { r: 1, c: totalColIdx } },
|
||||||
|
];
|
||||||
|
|
||||||
|
// 일자별 그룹 colspan (days가 1개 이상일 때만)
|
||||||
|
if (days.length > 0) {
|
||||||
|
merges.push({ s: { r: 0, c: dayStart }, e: { r: 0, c: dayEnd } });
|
||||||
|
}
|
||||||
|
|
||||||
|
ws["!merges"] = merges;
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 4) 컬럼 너비
|
||||||
|
* ======================= */
|
||||||
|
const cols = [];
|
||||||
|
cols.push({ wpx: 50 }); // 순번
|
||||||
|
cols.push({ wpx: 90 }); // 아이디
|
||||||
|
cols.push({ wpx: 90 }); // 이름
|
||||||
|
cols.push({ wpx: 60 }); // 촬영
|
||||||
|
|
||||||
|
// 일자 컬럼들
|
||||||
|
for (let i = 0; i < days.length; i++) cols.push({ wpx: 55 });
|
||||||
|
|
||||||
|
cols.push({ wpx: 80 }); // 합계
|
||||||
|
ws["!cols"] = cols;
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 5) (선택) 헤더 스타일/테두리 (xlsx-js-style 사용 시)
|
||||||
|
* ======================= */
|
||||||
|
const lastRow = aoa.length - 1;
|
||||||
|
const lastCol = COLS - 1;
|
||||||
|
|
||||||
|
const headerStyle = {
|
||||||
|
font: { bold: true },
|
||||||
|
alignment: { horizontal: "center", vertical: "center" },
|
||||||
|
fill: { patternType: "solid", fgColor: { rgb: "F2F2F2" } },
|
||||||
|
border: {
|
||||||
|
top: { style: "thin", color: { rgb: "D9D9D9" } },
|
||||||
|
bottom: { style: "thin", color: { rgb: "D9D9D9" } },
|
||||||
|
left: { style: "thin", color: { rgb: "D9D9D9" } },
|
||||||
|
right: { style: "thin", color: { rgb: "D9D9D9" } },
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const cellBorder = {
|
||||||
|
border: {
|
||||||
|
top: { style: "thin", color: { rgb: "E0E0E0" } },
|
||||||
|
bottom: { style: "thin", color: { rgb: "E0E0E0" } },
|
||||||
|
left: { style: "thin", color: { rgb: "E0E0E0" } },
|
||||||
|
right: { style: "thin", color: { rgb: "E0E0E0" } },
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
for (let r = 0; r <= lastRow; r++) {
|
||||||
|
for (let c = 0; c <= lastCol; c++) {
|
||||||
|
const addr = XLSX.utils.encode_cell({ r, c });
|
||||||
|
if (!ws[addr]) ws[addr] = { t: "s", v: "" };
|
||||||
|
ws[addr].s = Object.assign({}, ws[addr].s || {}, cellBorder);
|
||||||
|
if (r <= 1) ws[addr].s = Object.assign({}, ws[addr].s, headerStyle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ws["!rows"] = [{ hpx: 24 }, { hpx: 24 }];
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 6) 저장
|
||||||
|
* ======================= */
|
||||||
|
const wb = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(wb, ws, "sheet1");
|
||||||
|
XLSX.writeFile(wb, "개인별_이동거리_" + getDateTimeString() + ".xlsx");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 말일 계산
|
||||||
|
function getDaysByEndDate(edate) {
|
||||||
|
if (!edate) return [];
|
||||||
|
|
||||||
|
const endDay = Number(edate.substr(8, 2)); // 말일 (ex: 31)
|
||||||
|
const days = [];
|
||||||
|
|
||||||
|
for (let d = 1; d <= endDay; d++) {
|
||||||
|
days.push(String(d).padStart(2, '0')); // "01" ~ "31"
|
||||||
|
}
|
||||||
|
return days;
|
||||||
|
}
|
||||||
|
|
||||||
|
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}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("DOMContentLoaded", function () {
|
||||||
|
// 오늘 날짜
|
||||||
|
const today = new Date();
|
||||||
|
|
||||||
|
// 이번 달 1일
|
||||||
|
const firstDay = new Date(today.getFullYear(), today.getMonth(), 1);
|
||||||
|
|
||||||
|
// 이번 달 말일 (다음달 0일 = 이번달 말일)
|
||||||
|
const lastDay = new Date(today.getFullYear(), today.getMonth() + 1, 0);
|
||||||
|
|
||||||
|
// yyyy-mm-dd 형태로 변환
|
||||||
|
const toDate = (d) => d.toISOString().split("T")[0];
|
||||||
|
|
||||||
|
document.getElementById("sdate").value = toDate(firstDay);
|
||||||
|
document.getElementById("edate").value = toDate(lastDay);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
554
app/Views/pages/results/m417/stats.php
Normal file
554
app/Views/pages/results/m417/stats.php
Normal file
@@ -0,0 +1,554 @@
|
|||||||
|
<?= $this->extend('layouts/main') ?>
|
||||||
|
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<style>
|
||||||
|
th {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#resultList tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blockUI {
|
||||||
|
z-index: 1500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swal2-cancel {
|
||||||
|
background-color: #ff0000 !important;
|
||||||
|
color: #fff !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;">
|
||||||
|
|
||||||
|
<!-- 1줄 -->
|
||||||
|
<div class="row mb-3">
|
||||||
|
<!-- 기준일자 -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">기준일자</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="sdate" name="sdate">
|
||||||
|
</div>
|
||||||
|
<div class="col-2 d-flex align-items-center justify-content-center">~</div>
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="edate" name="edate">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label class="form-label mb-1">팀별실적</label>
|
||||||
|
<select class="form-control" name="dept_sq">
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($department as $key => $d): ?>
|
||||||
|
<option value="<?= $d['dept_sq'] ?>"><?= $d['dept_nm'] ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1 d-grid align-items-end">
|
||||||
|
<button type="button" class="btn btn-primary" id="btnSearch">검색</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12 col-xl-12">
|
||||||
|
<div class="main-card mb-3 card">
|
||||||
|
<div class="card-header d-flex align-items-center">
|
||||||
|
<h3 class="card-title mb-0">매체사 목록</h3>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<button class="mb-2 me-2 border-0 btn-transition btn btn-shadow btn-outline-success"
|
||||||
|
id="excel-download">엑셀다운로드</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table id="resultList" class="table table-hover table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th rowspan="2">상담원</th>
|
||||||
|
<th colspan="3">공동중개망</th>
|
||||||
|
<th colspan="2">등기부 첨부</th>
|
||||||
|
<th colspan="6">등기부 미첨부</th>
|
||||||
|
<th colspan="4">첨부파일</th>
|
||||||
|
<th rowspan="2">등기부등본없음</th>
|
||||||
|
<th colspan="2">검증</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>건수</th>
|
||||||
|
<th>완료</th>
|
||||||
|
<th>실패</th>
|
||||||
|
<th>일치</th>
|
||||||
|
<th>불일치</th>
|
||||||
|
<th>리얼탑 열람</th>
|
||||||
|
<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>
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<th>합계</th>
|
||||||
|
<th>-</th>
|
||||||
|
<th>-</th>
|
||||||
|
<th>-</th>
|
||||||
|
|
||||||
|
<th class="sum-cert_same_reg_open"></th>
|
||||||
|
<th class="sum-cert_reg_fail_open"></th>
|
||||||
|
|
||||||
|
<th class="sum-real_top_RS"></th>
|
||||||
|
<th class="sum-real_top_GS"></th>
|
||||||
|
<th class="sum-same_reg_open"></th>
|
||||||
|
<th class="sum-reg_fail_Open"></th>
|
||||||
|
<th class="sum-same_reg_tempOpen"></th>
|
||||||
|
<th class="sum-reg_fail_tempOpen"></th>
|
||||||
|
|
||||||
|
<th class="sum-referin_0"></th>
|
||||||
|
<th class="sum-referin_1"></th>
|
||||||
|
<th class="sum-referin_2"></th>
|
||||||
|
<th class="sum-referin_3"></th>
|
||||||
|
|
||||||
|
<th class="sum-reg_none"></th>
|
||||||
|
<th class="sum-complete_cnt1"></th>
|
||||||
|
<th class="sum-fail_cnt1"></th>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
|
||||||
|
<script src="https://npmcdn.com/flatpickr/dist/l10n/ko.js"></script>
|
||||||
|
<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>
|
||||||
|
<style>
|
||||||
|
table.dataTable thead th {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
// const tpl = document.querySelector('.my-loader-template');
|
||||||
|
|
||||||
|
let date = new Date();
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
const toNum = (v) => {
|
||||||
|
if (v == null || v === '') return 0;
|
||||||
|
return Number(String(v).replace(/,/g, '')) || 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
flatpickr("#sdate, #edate", {
|
||||||
|
locale: "ko",
|
||||||
|
enableTime: true,
|
||||||
|
noCalendar: false,
|
||||||
|
dateFormat: "Y-m-d H:i",
|
||||||
|
time_24hr: true
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
let table = $('#resultList').DataTable({
|
||||||
|
language: lang_kor,
|
||||||
|
processing: true,
|
||||||
|
ajax: {
|
||||||
|
url: '/m417/m417a/getResultList',
|
||||||
|
type: 'GET',
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
data: function (d) {
|
||||||
|
d.sdate = $("#frm_srch_info [name=sdate]").val()
|
||||||
|
d.edate = $("#frm_srch_info [name=edate]").val()
|
||||||
|
d.dept_sq = $("#frm_srch_info [name=dept_sq]").val()
|
||||||
|
|
||||||
|
d.start = d.start || 0
|
||||||
|
d.length = d.length || 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"columnDefs": [
|
||||||
|
{ 'targets': '_all', "defaultContent": "" },
|
||||||
|
{ className: 'text-center', targets: '_all' },
|
||||||
|
],
|
||||||
|
columns: [
|
||||||
|
{ data: 'usr_nm', render: fn_name_render },
|
||||||
|
|
||||||
|
{ data: 'joint_cnt', render: (d) => d ?? '-' },
|
||||||
|
{ data: 'joint_done', render: (d) => d ?? '-' },
|
||||||
|
{ data: 'joint_fail', render: (d) => d ?? '-' },
|
||||||
|
|
||||||
|
{ data: 'cert_same_reg_open' },
|
||||||
|
{ data: 'cert_reg_fail_open' },
|
||||||
|
|
||||||
|
{ data: 'real_top_RS', render: fn_rs_render },
|
||||||
|
{ data: 'real_top_GS', render: fn_gs_render },
|
||||||
|
{ data: 'same_reg_open' },
|
||||||
|
{ data: 'reg_fail_Open' },
|
||||||
|
{ data: 'same_reg_tempOpen' },
|
||||||
|
{ data: 'reg_fail_tempOpen' },
|
||||||
|
|
||||||
|
{ data: 'referin_0', name: 'referin_0', render: fn_referin_render0 },
|
||||||
|
{ data: 'referin_1', name: 'referin_1', render: fn_referin_render1 },
|
||||||
|
{ data: 'referin_2', name: 'referin_2', render: fn_referin_render2 },
|
||||||
|
{ data: 'referin_3', name: 'referin_3', render: fn_referin_render3 },
|
||||||
|
|
||||||
|
{ data: 'reg_none' },
|
||||||
|
|
||||||
|
{ data: 'complete_cnt1' },
|
||||||
|
{ data: 'fail_cnt1' },
|
||||||
|
|
||||||
|
],
|
||||||
|
// 옵션들 예시
|
||||||
|
paging: false,
|
||||||
|
searching: false,
|
||||||
|
ordering: false,
|
||||||
|
serverSide: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#resultList tbody').on('click', 'tr', function () {
|
||||||
|
const row = table.row(this).data()
|
||||||
|
if (!row) return
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#resultList').on('xhr.dt', function (e, settings, json) {
|
||||||
|
const rows = json?.data || [];
|
||||||
|
|
||||||
|
const SUM_FIELDS = [
|
||||||
|
'cert_same_reg_open', 'cert_reg_fail_open',
|
||||||
|
'real_top_RS', 'real_top_GS',
|
||||||
|
'same_reg_open', 'reg_fail_Open',
|
||||||
|
'same_reg_tempOpen', 'reg_fail_tempOpen',
|
||||||
|
'referin_0', 'referin_1', 'referin_2', 'referin_3',
|
||||||
|
'reg_none',
|
||||||
|
'complete_cnt1', 'fail_cnt1'
|
||||||
|
];
|
||||||
|
|
||||||
|
// 합계 객체 초기화
|
||||||
|
const sum = {};
|
||||||
|
SUM_FIELDS.forEach(f => sum[f] = 0);
|
||||||
|
|
||||||
|
|
||||||
|
// 합산
|
||||||
|
rows.forEach(row => {
|
||||||
|
SUM_FIELDS.forEach(f => {
|
||||||
|
sum[f] += toNum(row[f]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// tfoot 반영
|
||||||
|
SUM_FIELDS.forEach(f => {
|
||||||
|
$('#resultList tfoot .sum-' + f)
|
||||||
|
.text(sum[f].toLocaleString());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// [검색] 버튼 눌렀을 때 다시 조회
|
||||||
|
$('#btnSearch').on('click', function () {
|
||||||
|
table.ajax.reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀다운 click
|
||||||
|
$("#excel-download").on("click", function () {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/m417/m417a/excel",
|
||||||
|
method: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
data: $("#frm_srch_info").serialize(),
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
// downloadExcel(result.data);
|
||||||
|
downloadExcelWithHeader(result.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 이름 render
|
||||||
|
function fn_name_render(data, type, row) {
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
str = row.usr_nm + "(" + row.usr_id + ")";
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_rs_render(data, type, row) {
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
str = parseInt(row.real_top_RS) + parseInt(row.real_top_RF);
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_gs_render(data, type, row) {
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
str = parseInt(row.real_top_GS) + parseInt(row.real_top_GF);
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 첨부파일
|
||||||
|
*/
|
||||||
|
function fn_referin_render0(data, type, row) {
|
||||||
|
var sum = parseInt(row.referin_s0) + parseInt(row.referin_n0);
|
||||||
|
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_referin_render1(data, type, row) {
|
||||||
|
var sum = parseInt(row.referin_s1) + parseInt(row.referin_n1);
|
||||||
|
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_referin_render2(data, type, row) {
|
||||||
|
var sum = parseInt(row.referin_s2) + parseInt(row.referin_n2);
|
||||||
|
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_referin_render3(data, type, row) {
|
||||||
|
var sum = parseInt(row.referin_s3) + parseInt(row.referin_n3);
|
||||||
|
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
function downloadExcelWithHeader(dataRows) {
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 0) 유틸
|
||||||
|
* ======================= */
|
||||||
|
const COLS = 11;
|
||||||
|
|
||||||
|
const fitCols = (arr) => {
|
||||||
|
const a = (arr || []).slice(0, COLS);
|
||||||
|
while (a.length < COLS) a.push("");
|
||||||
|
return a;
|
||||||
|
};
|
||||||
|
|
||||||
|
const safe = (v) => (v === undefined || v === null) ? "" : v;
|
||||||
|
|
||||||
|
// 숫자/빈값 안전 처리 (소요시간이 숫자라면 여기로)
|
||||||
|
const num = (v) => (v === undefined || v === null || v === "") ? 0 : Number(v);
|
||||||
|
|
||||||
|
// (선택) 초(seconds) → hh:mm:ss 로 보여주고 싶으면 사용
|
||||||
|
// const secToHms = (sec) => {
|
||||||
|
// const s = Number(sec || 0);
|
||||||
|
// const h = String(Math.floor(s / 3600)).padStart(2, "0");
|
||||||
|
// const m = String(Math.floor((s % 3600) / 60)).padStart(2, "0");
|
||||||
|
// const ss = String(Math.floor(s % 60)).padStart(2, "0");
|
||||||
|
// return `${h}:${m}:${ss}`;
|
||||||
|
// };
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 1) 헤더 (thead와 동일)
|
||||||
|
* ======================= */
|
||||||
|
const header1 = fitCols([
|
||||||
|
"일자",
|
||||||
|
"모바일검증",
|
||||||
|
"전화확인", "", "",
|
||||||
|
"홍보확인서 확인", "", "",
|
||||||
|
"신홍보확인서 확인", "", ""
|
||||||
|
]);
|
||||||
|
|
||||||
|
const header2 = fitCols([
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"전화 검증",
|
||||||
|
"등기부등본 검증",
|
||||||
|
"총소요",
|
||||||
|
"FAX검증",
|
||||||
|
"등기부등본 검증",
|
||||||
|
"총소요",
|
||||||
|
"FAX검증",
|
||||||
|
"등기부등본 검증",
|
||||||
|
"총소요",
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 2) 바디 (DataTables columns 순서 그대로)
|
||||||
|
* columns:
|
||||||
|
* stan_date, m_tot,
|
||||||
|
* t_doc, t_cert, t_tot,
|
||||||
|
* d_doc, d_cert, d_tot,
|
||||||
|
* n_doc, n_cert, n_tot
|
||||||
|
* ======================= */
|
||||||
|
const body = (dataRows || []).map(r => fitCols([
|
||||||
|
safe(r.stan_date),
|
||||||
|
safe(r.m_tot),
|
||||||
|
|
||||||
|
safe(r.t_doc),
|
||||||
|
safe(r.t_cert),
|
||||||
|
safe(r.t_tot), // 숫자면 num(r.t_tot)
|
||||||
|
|
||||||
|
safe(r.d_doc),
|
||||||
|
safe(r.d_cert),
|
||||||
|
safe(r.d_tot),
|
||||||
|
|
||||||
|
safe(r.n_doc),
|
||||||
|
safe(r.n_cert),
|
||||||
|
safe(r.n_tot),
|
||||||
|
]));
|
||||||
|
|
||||||
|
const aoa = [header1, header2, ...body];
|
||||||
|
const ws = XLSX.utils.aoa_to_sheet(aoa);
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 3) 병합(merge) - thead와 동일
|
||||||
|
* ======================= */
|
||||||
|
ws["!merges"] = [
|
||||||
|
// "일자" rowspan 2
|
||||||
|
{ s: { r: 0, c: 0 }, e: { r: 1, c: 0 } },
|
||||||
|
// "모바일검증" rowspan 2
|
||||||
|
{ s: { r: 0, c: 1 }, e: { r: 1, c: 1 } },
|
||||||
|
|
||||||
|
// "전화확인" colspan 3 (2~4)
|
||||||
|
{ s: { r: 0, c: 2 }, e: { r: 0, c: 4 } },
|
||||||
|
// "홍보확인서 확인" colspan 3 (5~7)
|
||||||
|
{ s: { r: 0, c: 5 }, e: { r: 0, c: 7 } },
|
||||||
|
// "신홍보확인서 확인" colspan 3 (8~10)
|
||||||
|
{ s: { r: 0, c: 8 }, e: { r: 0, c: 10 } },
|
||||||
|
];
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 4) 컬럼 너비
|
||||||
|
* ======================= */
|
||||||
|
ws["!cols"] = [
|
||||||
|
{ wpx: 100 }, // 일자
|
||||||
|
{ wpx: 100 }, // 모바일검증
|
||||||
|
{ wpx: 100 }, // 전화 검증
|
||||||
|
{ wpx: 100 }, // 전화-등기부등본
|
||||||
|
{ wpx: 100 }, // 전화-총소요
|
||||||
|
{ wpx: 100 }, // 홍보 FAX
|
||||||
|
{ wpx: 100 }, // 홍보-등기부등본
|
||||||
|
{ wpx: 100 }, // 홍보-총소요
|
||||||
|
{ wpx: 100 }, // 신홍보 FAX
|
||||||
|
{ wpx: 100 }, // 신홍보-등기부등본
|
||||||
|
{ wpx: 100 }, // 신홍보-총소요
|
||||||
|
];
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 5) (선택) 헤더 스타일 + 테두리 (xlsx-js-style 사용 시)
|
||||||
|
* ======================= */
|
||||||
|
const lastRow = aoa.length - 1;
|
||||||
|
const lastCol = COLS - 1;
|
||||||
|
|
||||||
|
const headerStyle = {
|
||||||
|
font: { bold: true },
|
||||||
|
alignment: { horizontal: "center", vertical: "center" },
|
||||||
|
fill: { patternType: "solid", fgColor: { rgb: "F2F2F2" } },
|
||||||
|
border: {
|
||||||
|
top: { style: "thin", color: { rgb: "D9D9D9" } },
|
||||||
|
bottom: { style: "thin", color: { rgb: "D9D9D9" } },
|
||||||
|
left: { style: "thin", color: { rgb: "D9D9D9" } },
|
||||||
|
right: { style: "thin", color: { rgb: "D9D9D9" } },
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const cellBorder = {
|
||||||
|
border: {
|
||||||
|
top: { style: "thin", color: { rgb: "E0E0E0" } },
|
||||||
|
bottom: { style: "thin", color: { rgb: "E0E0E0" } },
|
||||||
|
left: { style: "thin", color: { rgb: "E0E0E0" } },
|
||||||
|
right: { style: "thin", color: { rgb: "E0E0E0" } },
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 모든 셀 테두리 + 헤더 스타일
|
||||||
|
for (let r = 0; r <= lastRow; r++) {
|
||||||
|
for (let c = 0; c <= lastCol; c++) {
|
||||||
|
const addr = XLSX.utils.encode_cell({ r, c });
|
||||||
|
if (!ws[addr]) ws[addr] = { t: "s", v: "" };
|
||||||
|
|
||||||
|
// 기본 테두리
|
||||||
|
ws[addr].s = Object.assign({}, ws[addr].s || {}, cellBorder);
|
||||||
|
|
||||||
|
// 헤더(0~1행)는 헤더 스타일 덮어쓰기
|
||||||
|
if (r <= 1) ws[addr].s = Object.assign({}, ws[addr].s, headerStyle);
|
||||||
|
// 바디 가운데 정렬 원하면:
|
||||||
|
// else ws[addr].s = Object.assign({}, ws[addr].s, { alignment:{horizontal:"center",vertical:"center"}});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 헤더 높이(보기 좋게)
|
||||||
|
ws["!rows"] = [{ hpx: 24 }, { hpx: 24 }];
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
* 6) 저장
|
||||||
|
* ======================= */
|
||||||
|
const wb = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(wb, ws, "sheet1");
|
||||||
|
XLSX.writeFile(wb, "검증_소요시간_" + getDateTimeString() + ".xlsx");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const today = new Date().toISOString().slice(0, 10);
|
||||||
|
document.getElementById("sdate").value = today;
|
||||||
|
document.getElementById("edate").value = today;
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
458
app/Views/pages/results/person/stats_p01.php
Normal file
458
app/Views/pages/results/person/stats_p01.php
Normal file
@@ -0,0 +1,458 @@
|
|||||||
|
<?= $this->extend('layouts/main') ?>
|
||||||
|
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<style>
|
||||||
|
th {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#userList tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blockUI {
|
||||||
|
z-index: 1500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swal2-cancel {
|
||||||
|
background-color: #ff0000 !important;
|
||||||
|
color: #fff !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;">
|
||||||
|
|
||||||
|
<!-- 1줄 -->
|
||||||
|
<div class="row mb-3">
|
||||||
|
<!-- 관할조직 -->
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label class="form-label mb-1">관할조직</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-6">
|
||||||
|
<select class="form-control" name="bonbu" id="bonbu">
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($bonbu as $d): ?>
|
||||||
|
<option value="<?= $d['dept_sq'] ?>"><?= $d['dept_nm'] ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<select class="form-control" name="dept_sq" id="dept_sq">
|
||||||
|
<option value="">선택</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 유형 -->
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">유형</label>
|
||||||
|
<select class="form-control" name="schDateGb">
|
||||||
|
<option value="1">예약일자</option>
|
||||||
|
<option value="2">등록일자</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 기준일자 -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">기준일자</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="sdate" name="sdate">
|
||||||
|
</div>
|
||||||
|
<div class="col-2 d-flex align-items-center justify-content-center">~</div>
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="edate" name="edate">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 지역검색 -->
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label class="form-label mb-1">지역검색</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-4">
|
||||||
|
<select class="form-control" name="srcSido" id="srcSido">
|
||||||
|
<option value="">시/도</option>
|
||||||
|
<?php foreach ($sido as $s): ?>
|
||||||
|
<option value="<?= $s['region_cd'] ?>"><?= $s['region_nm'] ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<select class="form-control" name="srcGugun" id="srcGugun">
|
||||||
|
<option value="">시/군/구</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<select class="form-control" name="srcDong" id="srcDong">
|
||||||
|
<option value="">읍/면/동</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 2줄 -->
|
||||||
|
<div class="row mb-3">
|
||||||
|
<!-- 검색유형 -->
|
||||||
|
<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>
|
||||||
|
</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 align-items-end">
|
||||||
|
<button type="button" class="btn btn-primary" id="btnSearch">검색</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12 col-xl-12">
|
||||||
|
<div class="main-card mb-3 card">
|
||||||
|
<div class="card-header d-flex align-items-center">
|
||||||
|
<h3 class="card-title mb-0">사용자 목록</h3>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<button class="mb-2 me-2 border-0 btn-transition btn btn-shadow btn-outline-success"
|
||||||
|
id="excel-download">엑셀다운로드</button>
|
||||||
|
</div>
|
||||||
|
</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>촬영후취소</th>
|
||||||
|
<th>촬영</th>
|
||||||
|
<th>검수지연</th>
|
||||||
|
<th>검수실패</th>
|
||||||
|
<th>검수완료</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</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');
|
||||||
|
var teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
|
|
||||||
|
let date = new Date();
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
$("#bonbu").on("change", function (e) {
|
||||||
|
|
||||||
|
var dept_sq = e.target.value
|
||||||
|
|
||||||
|
$("#dept_sq").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>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#dept_sq").append(str)
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#srcSido, #srcGugun").on("change", function (e) {
|
||||||
|
|
||||||
|
const targetId = this.id;
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/manage/areas/getAreaList",
|
||||||
|
method: "POST",
|
||||||
|
dataType: "json",
|
||||||
|
data: {
|
||||||
|
'srcSido': $("#frm_srch_info [name=srcSido]").val(),
|
||||||
|
'srcGugun': $("#frm_srch_info [name=srcGugun]").val(),
|
||||||
|
},
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
|
||||||
|
switch (targetId) {
|
||||||
|
case "srcSido":
|
||||||
|
$("#srcGugun").empty()
|
||||||
|
var str = "";
|
||||||
|
str += "<option value=''>시/군/구</option>";
|
||||||
|
|
||||||
|
if (result.length > 0) {
|
||||||
|
for (var i = 0; i < result.length; i++) {
|
||||||
|
str += "<option value='" + result[i]['region_cd'] + "'>" + result[i].region_nm + "</option>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#srcGugun").append(str);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "srcGugun":
|
||||||
|
$("#srcDong").empty()
|
||||||
|
var str = "";
|
||||||
|
str += "<option value=''>읍/면/동</option>";
|
||||||
|
|
||||||
|
if (result.length > 0) {
|
||||||
|
for (var i = 0; i < result.length; i++) {
|
||||||
|
str += "<option value='" + result[i]['region_cd'] + "'>" + result[i].region_nm + "</option>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#srcDong").append(str);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
let table = $('#userList').DataTable({
|
||||||
|
language: lang_kor,
|
||||||
|
processing: true,
|
||||||
|
serverSide: false,
|
||||||
|
ajax: {
|
||||||
|
url: '/results/person/getUserList',
|
||||||
|
type: 'GET',
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
data: function (d) {
|
||||||
|
d.schDateGb = $("#frm_srch_info [name=schDateGb]").val()
|
||||||
|
d.sdate = $("#frm_srch_info [name=sdate]").val()
|
||||||
|
d.edate = $("#frm_srch_info [name=edate]").val()
|
||||||
|
|
||||||
|
d.bonbu = $("#frm_srch_info [name=bonbu]").val()
|
||||||
|
d.team = $("#frm_srch_info [name=dept_sq]").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, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] },
|
||||||
|
],
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
"data": null,
|
||||||
|
"width": "50px",
|
||||||
|
"render": function (data, type, row, meta) {
|
||||||
|
return meta.row + meta.settings._iDisplayStart + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ data: 'usr_id' },
|
||||||
|
{ data: 'usr_nm' },
|
||||||
|
{ data: 'rcpt_cnt' },
|
||||||
|
{ data: 'resv_cancel_cnt' },
|
||||||
|
{ data: 'resv_assign_cnt' },
|
||||||
|
{ data: 'prev_visit_cnt' },
|
||||||
|
{ data: 'next_visit_cnt' },
|
||||||
|
{ data: 'next_shoot_cnt' },
|
||||||
|
{ data: 'shoot_cnt' },
|
||||||
|
{ data: 'delay_confirm_cnt' },
|
||||||
|
{ data: 'fail_confirm_cnt' },
|
||||||
|
{ data: 'confirm_cnt' },
|
||||||
|
],
|
||||||
|
// 옵션들 예시
|
||||||
|
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();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀다운 click
|
||||||
|
$("#excel-download").on("click", function () {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/results/person/excel",
|
||||||
|
method: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
data: $("#frm_srch_info").serialize(),
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
downloadExcel(result.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
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: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ wpx: 80 },
|
||||||
|
{ 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}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("DOMContentLoaded", function () {
|
||||||
|
// 오늘 날짜
|
||||||
|
const today = new Date();
|
||||||
|
|
||||||
|
// 이번 달 1일
|
||||||
|
const firstDay = new Date(today.getFullYear(), today.getMonth(), 1);
|
||||||
|
|
||||||
|
// 이번 달 말일 (다음달 0일 = 이번달 말일)
|
||||||
|
const lastDay = new Date(today.getFullYear(), today.getMonth() + 1, 0);
|
||||||
|
|
||||||
|
// yyyy-mm-dd 형태로 변환
|
||||||
|
const toDate = (d) => d.toISOString().split("T")[0];
|
||||||
|
|
||||||
|
document.getElementById("sdate").value = toDate(firstDay);
|
||||||
|
document.getElementById("edate").value = toDate(lastDay);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
322
app/Views/pages/results/summary/stats_s01.php
Normal file
322
app/Views/pages/results/summary/stats_s01.php
Normal file
@@ -0,0 +1,322 @@
|
|||||||
|
<?= $this->extend('layouts/main') ?>
|
||||||
|
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<style>
|
||||||
|
th {
|
||||||
|
font-size: 11px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#smsList 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-body">
|
||||||
|
<form class="row align-items-end" method="post" id="frm_srch_info">
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">유형</label>
|
||||||
|
<select class="form-control" name="schDateGb">
|
||||||
|
<option value="1" <?= $schDateGb == '1' ? 'selected' : '' ?>>예약일자</option>
|
||||||
|
<option value="2" <?= $schDateGb == '2' ? 'selected' : '' ?>>등록일자</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">기준일자</label>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="sdate" name="sdate" value="<?= $sdate ?>" />
|
||||||
|
</div>
|
||||||
|
<div class="col-2 d-flex align-items-center justify-content-center">~</div>
|
||||||
|
<div class="col-5">
|
||||||
|
<input type="date" class="form-control" id="edate" name="edate" value="<?= $edate ?>" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1 d-grid">
|
||||||
|
<button type="submit" 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 d-flex align-items-center">
|
||||||
|
<h3 class="card-title mb-0">요약 실적</h3>
|
||||||
|
<div class="ms-auto d-flex align-items-center gap-3">
|
||||||
|
<!-- <button class="mb-2 me-2 border-0 btn-transition btn btn-shadow btn-outline-success"
|
||||||
|
id="excel-download">엑셀다운로드</button> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<table class="table table-hover table-striped table-bordered">
|
||||||
|
<!-- <caption>조직별 실적</caption> -->
|
||||||
|
<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>
|
||||||
|
<?php foreach ($st_list as $rkey => $row) {
|
||||||
|
$nCol = 0;
|
||||||
|
if (empty($rkey))
|
||||||
|
$rkey = 'cnt';
|
||||||
|
switch ($rkey) {
|
||||||
|
case 'cost':
|
||||||
|
echo '<tr>
|
||||||
|
<td>단가</td>';
|
||||||
|
echo '<td><input type="text" name="stat_cost' . $nCol . '" id="stat_cost' . $nCol . '"
|
||||||
|
value="' . $row['rcpt_cnt'] . '" maxlength="6" size="6"
|
||||||
|
onchange="stat_cost_onchange(' . $nCol . ')" /></td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td><input type="text" name="stat_cost' . $nCol . '" id="stat_cost' . $nCol . '"
|
||||||
|
value="' . $row['resv_cancel_cnt'] . '" maxlength="6" size="6"
|
||||||
|
onchange="stat_cost_onchange(' . $nCol . ')" /></td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td><input type="text" name="stat_cost' . $nCol . '" id="stat_cost' . $nCol . '"
|
||||||
|
value="' . $row['resv_assign_cnt'] . '" maxlength="6" size="6"
|
||||||
|
onchange="stat_cost_onchange(' . $nCol . ')" /></td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td><input type="text" name="stat_cost' . $nCol . '" id="stat_cost' . $nCol . '"
|
||||||
|
value="' . $row['prev_visit_cnt'] . '" maxlength="6" size="6"
|
||||||
|
onchange="stat_cost_onchange(' . $nCol . ')" /></td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td><input type="text" name="stat_cost' . $nCol . '" id="stat_cost' . $nCol . '"
|
||||||
|
value="' . $row['next_visit_cnt'] . '" maxlength="6" size="6"
|
||||||
|
onchange="stat_cost_onchange(' . $nCol . ')" /></td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td><input type="text" name="stat_cost' . $nCol . '" id="stat_cost' . $nCol . '"
|
||||||
|
value="' . $row['next_shoot_cnt'] . '" maxlength="6" size="6"
|
||||||
|
onchange="stat_cost_onchange(' . $nCol . ')" /></td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td><input type="text" name="stat_cost' . $nCol . '" id="stat_cost' . $nCol . '"
|
||||||
|
value="' . $row['shoot_cnt'] . '" maxlength="6" size="6"
|
||||||
|
onchange="stat_cost_onchange(' . $nCol . ')" /></td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td><input type="text" name="stat_cost' . $nCol . '" id="stat_cost' . $nCol . '"
|
||||||
|
value="' . $row['delay_confirm_cnt'] . '" maxlength="6" size="6"
|
||||||
|
onchange="stat_cost_onchange(' . $nCol . ')" /></td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td><input type="text" name="stat_cost' . $nCol . '" id="stat_cost' . $nCol . '"
|
||||||
|
value="' . $row['fail_confirm_cnt'] . '" maxlength="6" size="6"
|
||||||
|
onchange="stat_cost_onchange(' . $nCol . ')" /></td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td><input type="text" name="stat_cost' . $nCol . '" id="stat_cost' . $nCol . '"
|
||||||
|
value="' . $row['confirm_cnt'] . '" maxlength="6" size="6"
|
||||||
|
onchange="stat_cost_onchange(' . $nCol . ')" /></td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '
|
||||||
|
</tr>';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'amt':
|
||||||
|
echo '<tr>
|
||||||
|
<td>금액</td>';
|
||||||
|
echo '<td>
|
||||||
|
<div id="stat_amt' . $nCol . '">' . $row['rcpt_cnt'] . '</div>
|
||||||
|
</td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>
|
||||||
|
<div id="stat_amt' . $nCol . '">' . $row['resv_cancel_cnt'] . '</div>
|
||||||
|
</td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>
|
||||||
|
<div id="stat_amt' . $nCol . '">' . $row['resv_assign_cnt'] . '</div>
|
||||||
|
</td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>
|
||||||
|
<div id="stat_amt' . $nCol . '">' . $row['prev_visit_cnt'] . '</div>
|
||||||
|
</td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>
|
||||||
|
<div id="stat_amt' . $nCol . '">' . $row['next_visit_cnt'] . '</div>
|
||||||
|
</td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>
|
||||||
|
<div id="stat_amt' . $nCol . '">' . $row['next_shoot_cnt'] . '</div>
|
||||||
|
</td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>
|
||||||
|
<div id="stat_amt' . $nCol . '">' . $row['shoot_cnt'] . '</div>
|
||||||
|
</td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>
|
||||||
|
<div id="stat_amt' . $nCol . '">' . $row['delay_confirm_cnt'] . '</div>
|
||||||
|
</td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>
|
||||||
|
<div id="stat_amt' . $nCol . '">' . $row['fail_confirm_cnt'] . '</div>
|
||||||
|
</td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>
|
||||||
|
<div id="stat_amt' . $nCol . '">' . $row['confirm_cnt'] . '</div>
|
||||||
|
</td>';
|
||||||
|
$nCol++;
|
||||||
|
echo '
|
||||||
|
</tr>';
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
echo '<tr onmouseover="this.className=\'highlight\'" onmouseout="this.className=\'normal\'">';
|
||||||
|
echo '<td>건수</td>';
|
||||||
|
|
||||||
|
echo '<td>' . (empty($row['rcpt_cnt']) ? '-' : $row['rcpt_cnt']) . '</td>';
|
||||||
|
echo '<input type="hidden" name="stat_cnt' . $nCol . '" id="stat_cnt' . $nCol . '"
|
||||||
|
value="' . (empty($row['rcpt_cnt']) ? '0' : $row['rcpt_cnt']) . '" />';
|
||||||
|
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>' . (empty($row['resv_cancel_cnt']) ? '-' : $row['resv_cancel_cnt']) . '</td>';
|
||||||
|
echo '<input type="hidden" name="stat_cnt' . $nCol . '" id="stat_cnt' . $nCol . '"
|
||||||
|
value="' . (empty($row['resv_cancel_cnt']) ? '0' : $row['resv_cancel_cnt']) . '" />';
|
||||||
|
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>' . (empty($row['resv_assign_cnt']) ? '-' : $row['resv_assign_cnt']) . '</td>';
|
||||||
|
echo '<input type="hidden" name="stat_cnt' . $nCol . '" id="stat_cnt' . $nCol . '"
|
||||||
|
value="' . (empty($row['resv_assign_cnt']) ? '0' : $row['resv_assign_cnt']) . '" />';
|
||||||
|
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>' . (empty($row['prev_visit_cnt']) ? '-' : $row['prev_visit_cnt']) . '</td>';
|
||||||
|
echo '<input type="hidden" name="stat_cnt' . $nCol . '" id="stat_cnt' . $nCol . '"
|
||||||
|
value="' . (empty($row['prev_visit_cnt']) ? '0' : $row['prev_visit_cnt']) . '" />';
|
||||||
|
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>' . (empty($row['next_visit_cnt']) ? '-' : $row['next_visit_cnt']) . '</td>';
|
||||||
|
echo '<input type="hidden" name="stat_cnt' . $nCol . '" id="stat_cnt' . $nCol . '"
|
||||||
|
value="' . (empty($row['next_visit_cnt']) ? '0' : $row['next_visit_cnt']) . '" />';
|
||||||
|
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>' . (empty($row['next_shoot_cnt']) ? '-' : $row['next_shoot_cnt']) . '</td>';
|
||||||
|
echo '<input type="hidden" name="stat_cnt' . $nCol . '" id="stat_cnt' . $nCol . '"
|
||||||
|
value="' . (empty($row['next_shoot_cnt']) ? '0' : $row['next_shoot_cnt']) . '" />';
|
||||||
|
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>' . (empty($row['shoot_cnt']) ? '-' : $row['shoot_cnt']) . '</td>';
|
||||||
|
echo '<input type="hidden" name="stat_cnt' . $nCol . '" id="stat_cnt' . $nCol . '"
|
||||||
|
value="' . (empty($row['shoot_cnt']) ? '0' : $row['shoot_cnt']) . '" />';
|
||||||
|
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>' . (empty($row['delay_confirm_cnt']) ? '-' : $row['delay_confirm_cnt']) . '</td>';
|
||||||
|
echo '<input type="hidden" name="stat_cnt' . $nCol . '" id="stat_cnt' . $nCol . '"
|
||||||
|
value="' . (empty($row['delay_confirm_cnt']) ? '0' : $row['delay_confirm_cnt']) . '" />';
|
||||||
|
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>' . (empty($row['fail_confirm_cnt']) ? '-' : $row['fail_confirm_cnt']) . '</td>';
|
||||||
|
echo '<input type="hidden" name="stat_cnt' . $nCol . '" id="stat_cnt' . $nCol . '"
|
||||||
|
value="' . (empty($row['fail_confirm_cnt']) ? '0' : $row['fail_confirm_cnt']) . '" />';
|
||||||
|
|
||||||
|
$nCol++;
|
||||||
|
echo '<td>' . (empty($row['confirm_cnt']) ? '-' : $row['confirm_cnt']) . '</td>';
|
||||||
|
echo '<input type="hidden" name="stat_cnt' . $nCol . '" id="stat_cnt' . $nCol . '"
|
||||||
|
value="' . (empty($row['confirm_cnt']) ? '0' : $row['confirm_cnt']) . '" />';
|
||||||
|
|
||||||
|
echo '</tr>';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="<?php echo $nCol + 2 ?>">
|
||||||
|
<input type="hidden" name="col_cnt" id="col_cnt" value="<?php echo $nCol; ?>" />
|
||||||
|
<div id="stat_total">합계금액: <?= $totalAmount; ?> 원</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<h3>중개업소 현황</h3>
|
||||||
|
<table class="table table-hover table-striped table-bordered" style="margin-bottom:10px">
|
||||||
|
<caption></caption>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>중개업소명</th>
|
||||||
|
<th>사업자번호</th>
|
||||||
|
<th>현장 접수건</th>
|
||||||
|
<th>현장 촬영건</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
if (empty($st_agent)) {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4" style="text-align: center;">데이터가 없습니다.</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
foreach ($st_agent as $row) {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><?= $row['agent_nm'] ?></td>
|
||||||
|
<td><?= $row['agent_id'] ?></td>
|
||||||
|
<td><?= number_format($row['rcpt_count']) ?></td>
|
||||||
|
<td><?= number_format($row['shoot_count']) ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
// const tpl = document.querySelector('.my-loader-template')
|
||||||
|
let date = new Date()
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
|
||||||
|
// [검색] 버튼 눌렀을 때 다시 조회
|
||||||
|
// $('#btnSearch').on('click', function () {
|
||||||
|
// table.ajax.reload()
|
||||||
|
// });
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
Reference in New Issue
Block a user