feature/template #6

Merged
owrainfo merged 4 commits from feature/template into master 2025-12-31 11:09:11 +09:00
25 changed files with 1702 additions and 12 deletions

View File

@@ -19,7 +19,13 @@ $routes->get('/home', 'Home\Home::dashboard');
$routes->get('/home/viewStatData', to: 'Home\Home::viewStatData'); // 실적조회 $routes->get('/home/viewStatData', to: 'Home\Home::viewStatData'); // 실적조회
$routes->get('/home/getHomeFaxCount', to: 'Home\Home::getHomeFaxCount'); // 팩스조회 $routes->get('/home/getHomeFaxCount', to: 'Home\Home::getHomeFaxCount'); // 팩스조회
/**
* 공통 API
*/
$routes->group('common', ['namespace' => 'App\Controllers\Common'], function ($routes) {
$routes->get('common/getVrfcCode', 'Common::getVrfcCode');
});
/** /**
* 게시판 (board) 그룹 * 게시판 (board) 그룹
@@ -43,6 +49,27 @@ $routes->group('board', ['namespace' => 'App\Controllers\Board'], function ($rou
}); });
/**
* 실적관리
*/
$routes->group('', ['namespace' => 'App\Controllers\V2'], static function ($routes) {
/**
* 일반확인매물관리
*/
$routes->group('m701', static function ($routes) {
$routes->get('m701a/lists', 'M701::lists');
/**
* 확인매물현황 - API
*/
$routes->get('m701a/getResultList', 'M701::getResultList');
$routes->get('m701a/excel', 'M701::excel');
});
});
/** /**
* 아파트단지 DB구축 그룹 * 아파트단지 DB구축 그룹
*/ */
@@ -142,6 +169,10 @@ $routes->group('results', ['namespace' => 'App\Controllers\Results'], function (
/** API - 확인매물일별실적 */ /** API - 확인매물일별실적 */
}); });
/**
* 실적관리 그룹
*/
$routes->group('', ['namespace' => 'App\Controllers\Results'], static function ($routes) { $routes->group('', ['namespace' => 'App\Controllers\Results'], static function ($routes) {
// 확인매물일별실적 // 확인매물일별실적

View File

@@ -2,6 +2,7 @@
namespace App\Controllers\board; namespace App\Controllers\board;
use App\Controllers\BaseController; use App\Controllers\BaseController;
use App\Libraries\MyUpload;
use App\Models\board\NoticeModel; use App\Models\board\NoticeModel;
class Notice extends BaseController class Notice extends BaseController
@@ -108,7 +109,7 @@ class Notice extends BaseController
// 공지사항 작성 // 공지사항 작성
public function actWrite() public function actWrite()
{ {
$lib = new MyUpload();
try { try {
@@ -125,6 +126,37 @@ class Notice extends BaseController
$file = $this->request->getFile('file'); $file = $this->request->getFile('file');
if ($file && $file->isValid() && !$file->hasMoved()) { if ($file && $file->isValid() && !$file->hasMoved()) {
$uploadPath = "/upload/notice/" . date('Ymd') . "/";
$arrUploadfile = [];
if ($file->isValid() && !$file->hasMoved()) {
$uploadData = $lib->do_upload2($file, $uploadPath);
if ($uploadData !== false) {
$arrUploadfile[] = $uploadData;
}
}
if (!empty($arrUploadfile)) {
foreach ($arrUploadfile as $key => $uploadFile) {
$data['file'] = [
'file_sq' => $this->request->getPost('file_sq'),
'orig_name' => $uploadFile['origin_name'],
'new_name' => $uploadFile['file_name'],
'file_path' => $uploadPath, // 필요에 따라 상대경로로만 저장
'ext' => '.' . $uploadFile['ext'],
'size' => $file->getSize(),
'img_yn' => null,
// 높이/폭은 나중에 getimagesize 등으로 구해도 됨
'img_height' => null,
'img_width' => null,
];
}
}
/*
$origName = $file->getClientName(); $origName = $file->getClientName();
$ext = $file->getClientExtension(); $ext = $file->getClientExtension();
$size = $file->getSize(); $size = $file->getSize();
@@ -154,6 +186,8 @@ class Notice extends BaseController
'img_height' => null, 'img_height' => null,
'img_width' => null, 'img_width' => null,
]; ];
*/
} }
@@ -201,6 +235,8 @@ class Notice extends BaseController
// 공지사항 수정요청 // 공지사항 수정요청
public function actModify() public function actModify()
{ {
$lib = new MyUpload();
try { try {
$data = [ $data = [
@@ -216,6 +252,36 @@ class Notice extends BaseController
$file = $this->request->getFile('file'); $file = $this->request->getFile('file');
if ($file && $file->isValid() && !$file->hasMoved()) { if ($file && $file->isValid() && !$file->hasMoved()) {
$uploadPath = "/upload/notice/" . date('Ymd') . "/";
$arrUploadfile = [];
if ($file->isValid() && !$file->hasMoved()) {
$uploadData = $lib->do_upload2($file, $uploadPath);
if ($uploadData !== false) {
$arrUploadfile[] = $uploadData;
}
}
if (!empty($arrUploadfile)) {
foreach ($arrUploadfile as $key => $uploadFile) {
$data['file'] = [
'file_sq' => $this->request->getPost('file_sq'),
'orig_name' => $uploadFile['origin_name'],
'new_name' => $uploadFile['file_name'],
'file_path' => $uploadPath, // 필요에 따라 상대경로로만 저장
'ext' => '.' . $uploadFile['ext'],
'size' => $file->getSize(),
'img_yn' => null,
// 높이/폭은 나중에 getimagesize 등으로 구해도 됨
'img_height' => null,
'img_width' => null,
];
}
}
/*
$origName = $file->getClientName(); $origName = $file->getClientName();
$ext = $file->getClientExtension(); $ext = $file->getClientExtension();
$size = $file->getSize(); $size = $file->getSize();
@@ -247,6 +313,8 @@ class Notice extends BaseController
'img_height' => null, 'img_height' => null,
'img_width' => null, 'img_width' => null,
]; ];
*/
} }

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Controllers\Common;
use App\Controllers\BaseController;
use App\Models\common\CommonModel;
class Common extends BaseController
{
private $model;
public function __construct()
{
$this->model = new CommonModel();
}
public function getVrfcCode()
{
$type = $this->request->getGet("type");
$type = "VRFC_TYPE_SUB_" . $type;
$data = $this->model->getVrfcCode($type);
return $this->response->setJSON($data);
}
}

119
app/Controllers/V2/M701.php Normal file
View File

@@ -0,0 +1,119 @@
<?php
namespace App\Controllers\V2;
use App\Controllers\BaseController;
use App\Models\common\CodeModel;
use App\Models\v2\M701Model;
class M701 extends BaseController
{
private $model, $codeModel;
public function __construct()
{
$this->model = new M701Model();
$this->codeModel = new CodeModel();
}
public function lists(): string
{
$codes = $this->codeModel->getCodeLists(['STEP_VERIFICATION', 'VRFCREQ_WAY', 'CP_ID', 'ARTICLE_TYPE']); // 코드조회
$sido = $this->model->getAreaList(); // 지역조회
$bonbu = $this->model->getBonbuList();
$team = $this->model->getTeamList();
$user = $this->model->getUserList();
return view("pages/v2/m701/lists", [
"sido" => $sido,
"bonbu" => $bonbu,
"team" => $team,
"user" => $user,
"codes" => $codes,
]);
}
public function getResultList()
{
$start = (int) $this->request->getGet('start') ?: 0;
$end = (int) $this->request->getGet('length') ?: 10;
$data = [
'atcl_no' => $this->request->getGet('atcl_no'), // 매물번호
'stat_cd' => $this->request->getGet('stat_cd'), // 현재상태
'realtor_nm' => $this->request->getGet('realtor_nm'), // 중개소
'charger_gbn' => $this->request->getGet('charger_gbn'), // 배정여부
'assign_yn' => $this->request->getGet('assign_yn'), // 배정여부2
'receipt_sdate' => $this->request->getGet('receipt_sdate'), // 접수기간1
'receipt_edate' => $this->request->getGet('receipt_edate'), // 접수기간2
'complete_sdate' => $this->request->getGet('complete_sdate'), // 완료기간1
'complete_edate' => $this->request->getGet('complete_edate'), // 완료기간2
'srcSido' => $this->request->getGet('srcSido'), // 시도
'srcGugun' => $this->request->getGet('srcGugun'), // 시군구
'srcDong' => $this->request->getGet('srcDong'), // 읍면동
'bonbu' => $this->request->getGet('bonbu'), // 본부
'team' => $this->request->getGet('team'), // 팀
'damdang' => $this->request->getGet('damdang'), // 담당
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'), // 검증방식1
'vrfc_type_sub' => $this->request->getGet('vrfc_type_sub'), // 검증방식2
'rcpt_cpid' => $this->request->getGet('rcpt_cpid'), // 매체사
'rlet_type_cd' => $this->request->getGet('rlet_type_cd'), // 매물종류
'reference_file_url_yn' => $this->request->getGet('reference_file_url_yn'), // 참고용
'corp_own' => $this->request->getGet('corp_own'), // 법인
];
$totalCount = $this->model->getTotalCount($data);
$datas = $this->model->getResultList($start, $end, $data);
return $this->response->setJSON(body: [
'recordsTotal' => $totalCount,
'recordsFiltered' => $totalCount,
'data' => $datas,
]);
}
// 엑셀 다운로드
public function excel()
{
try {
$data = [
'atcl_no' => $this->request->getGet('atcl_no'), // 매물번호
'stat_cd' => $this->request->getGet('stat_cd'), // 현재상태
'realtor_nm' => $this->request->getGet('realtor_nm'), // 중개소
'charger_gbn' => $this->request->getGet('charger_gbn'), // 배정여부
'assign_yn' => $this->request->getGet('assign_yn'), // 배정여부2
'receipt_sdate' => $this->request->getGet('receipt_sdate'), // 접수기간1
'receipt_edate' => $this->request->getGet('receipt_edate'), // 접수기간2
'complete_sdate' => $this->request->getGet('complete_sdate'), // 완료기간1
'complete_edate' => $this->request->getGet('complete_edate'), // 완료기간2
'srcSido' => $this->request->getGet('srcSido'), // 시도
'srcGugun' => $this->request->getGet('srcGugun'), // 시군구
'srcDong' => $this->request->getGet('srcDong'), // 읍면동
'bonbu' => $this->request->getGet('bonbu'), // 본부
'team' => $this->request->getGet('team'), // 팀
'damdang' => $this->request->getGet('damdang'), // 담당
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'), // 검증방식1
'vrfc_type_sub' => $this->request->getGet('vrfc_type_sub'), // 검증방식2
'rcpt_cpid' => $this->request->getGet('rcpt_cpid'), // 매체사
'rlet_type_cd' => $this->request->getGet('rlet_type_cd'), // 매물종류
'reference_file_url_yn' => $this->request->getGet('reference_file_url_yn'), // 참고용
'corp_own' => $this->request->getGet('corp_own'), // 법인
];
$datas = $this->model->getExcelList($data);
return $this->response->setJSON(body: [
'data' => $datas,
]);
} catch (\Exception $e) {
$e->getPrevious()->getTraceAsString();
}
}
}

View File

@@ -101,7 +101,7 @@ class NoticeModel extends Model
$query = $this->db->query($sql, [$id]); $query = $this->db->query($sql, [$id]);
$notice = $query->getRowArray(); $notice = $query->getRowArray();
$sql = "SELECT bbs_sq, file_sq, file_name, file_path, file_ext, file_size, img_yn, img_height, img_width, orig_name FROM bbs_file_notice WHERE bbs_sq = ?" . $sql = "SELECT bbs_sq, file_sq, file_name, file_path, file_ext, file_size, img_yn, img_height, img_width, orig_name, cloud_upload_yn FROM bbs_file_notice WHERE bbs_sq = ?" .
" and use_yn = 'Y'"; " and use_yn = 'Y'";
$query = $this->db->query($sql, [$id]); $query = $this->db->query($sql, [$id]);
$files = $query->getRowArray(); $files = $query->getRowArray();
@@ -152,7 +152,7 @@ class NoticeModel extends Model
$f = $data['file']; $f = $data['file'];
$sql = "INSERT INTO bbs_file_notice $sql = "INSERT INTO bbs_file_notice
(bbs_sq, file_name, file_path, file_ext, file_size, img_yn, img_height, img_width, orig_name) (bbs_sq, file_name, file_path, file_ext, file_size, img_yn, img_height, img_width, orig_name, cloud_upload_yn)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"; VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
$this->db->query($sql, [ $this->db->query($sql, [
@@ -165,6 +165,7 @@ class NoticeModel extends Model
$f['img_height'] ?? null, $f['img_height'] ?? null,
$f['img_width'] ?? null, $f['img_width'] ?? null,
$f['orig_name'] ?? '', $f['orig_name'] ?? '',
'Y'
]); ]);
} }
@@ -201,7 +202,7 @@ class NoticeModel extends Model
if (empty($f['file_sq'])) { if (empty($f['file_sq'])) {
$sql = "INSERT INTO bbs_file_notice $sql = "INSERT INTO bbs_file_notice
(bbs_sq, file_name, file_path, file_ext, file_size, img_yn, img_height, img_width, orig_name) (bbs_sq, file_name, file_path, file_ext, file_size, img_yn, img_height, img_width, orig_name, cloud_upload_yn)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"; VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
$this->db->query($sql, [ $this->db->query($sql, [
@@ -214,6 +215,7 @@ class NoticeModel extends Model
$f['img_height'] ?? null, $f['img_height'] ?? null,
$f['img_width'] ?? null, $f['img_width'] ?? null,
$f['orig_name'] ?? '', $f['orig_name'] ?? '',
'Y'
]); ]);
} else { } else {
$sql = "UPDATE bbs_file_notice SET $sql = "UPDATE bbs_file_notice SET

View File

@@ -0,0 +1,20 @@
<?php
namespace App\Models\common;
use CodeIgniter\Model;
class CommonModel extends Model
{
public function getVrfcCode($type)
{
$sql = "SELECT category, category_nm, cd, cd_nm FROM codes" .
" WHERE category = ?" .
" AND use_yn = 'Y'" .
" ORDER BY view_odr";
$query = $this->db->query($sql, [$type]);
return $query->getResultArray();
}
}

684
app/Models/v2/M701Model.php Normal file
View File

@@ -0,0 +1,684 @@
<?php
namespace App\Models\v2;
use CodeIgniter\Model;
class M701Model extends Model
{
// 지역 목록 조회
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 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 getUserList()
{
$sql = "SELECT
a.usr_sq, a.usr_id, a.usr_nm, a.dept_sq
FROM users a
WHERE
a.usr_level IN ('3','4','40','5','50','6','60','61','62','7','8','70')
AND a.use_yn = 'Y'
AND EXISTS (
SELECT 'x' FROM departments a1 INNER JOIN departments a2 ON a2.lft BETWEEN a1.lft AND a1.rgt AND a2.use_yn = 'Y'
WHERE 1=1 AND a2.dept_sq = a.dept_sq AND a1.use_yn = 'Y'
)
ORDER BY a.usr_level DESC, a.usr_nm ASC ";
$query = $this->db->query($sql);
return $query->getResultArray();
}
public function getTotalCount($data)
{
$sql = "SELECT
COUNT(*) AS cnt
FROM
v2_article_info a
LEFT JOIN v2_vrfc_req b ON a.vr_sq = b.vr_sq
LEFT 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['atcl_no'])) {
$sql .= "AND a.atcl = '{$data['atcl_no']}' ";
} else {
// 현재상태
if (!empty($data['stat_cd'])) {
$sql .= "AND b.stat_cd = '{$data['stat_cd']}' ";
}
// 중개소
if (!empty($data['realtor_nm'])) {
$sql .= "AND a.realtor_nm = '{$data['realtor_nm']}' ";
}
// 매물구분
if (!empty($data['rlet_type_cd'])) {
$sql .= "AND a.rlet_type_cd = '{$data['rlet_type_cd']}' ";
}
// 접수기간
if (!empty($data['receipt_sdate'])) {
$sql .= "AND b.insert_tm >= '{$data['receipt_sdate']} 00:00:00' ";
}
if (!empty($data['receipt_edate'])) {
$sql .= "AND b.insert_tm <= '{$data['receipt_edate']} 23:59:59' ";
}
// 완료기간
if (!empty($data['complete_sdate'])) {
$sql .= "AND b.insert_tm >= '{$data['complete_sdate']} 00:00:00' ";
}
if (!empty($data['complete_edate'])) {
$sql .= "AND b.insert_tm <= '{$data['complete_edate']} 23:59:59' ";
}
// 검증방식
if (!empty($data['vrfc_type_sub'])) {
$sql .= "AND a.vrfc_type_sub = '{$data['vrfc_type_sub']}' ";
} else {
if (!empty($data['vrfcreq_way'])) {
$sql .= "AND b.vrfc_type = '{$data['vrfcreq_way']}' ";
}
}
// 매체사
if (!empty($data['rcpt_cpid'])) {
$sql .= "AND a.cpid = '{$data['rcpt_cpid']}' ";
}
// 지역구분
if (!empty($data['srcDong'])) {
$sql .= "AND a.address_code = '{$data['srcDong']}' ";
} else {
if (!empty($data['srcGugun'])) {
$str_gugun = substr($data['srcGugun'], '0', '2');
if ($str_gugun == '36') { //세종시는 군구가 없고 바로 동이라서 예외
$sql .= "AND a.address_code = '{$data['srcGugun']}' ";
} else {
$gugunPrefix = substr($data['srcGugun'], '0', '5');
$sql .= "AND a.address_code LIKE '{$gugunPrefix}%' ";
}
} else {
if (!empty($data['srcSido'])) {
$sidoPrefix = substr($data['srcSido'], '0', '2');
$sql .= "AND a.address_code LIKE '{$sidoPrefix}%' ";
}
}
}
// 담당자
if (!empty($data['damdang'])) {
switch ($data['charger_gbn']) {
case "1":
$sql .= "a.charger = '{$data['damdang']}' ";
break;
case "2":
$sql .= "a.reg_charger = '{$data['damdang']}' ";
break;
}
} else {
// 배정여부
if ($data['assign_yn'] !== "A") {
switch ($data['charger_gbn'] . $data['assign_yn']) {
case "1Y": // 전화/서류 담당자
$sql .= "a.charger != '' ";
break;
case "1N": // 전화/서류 담당자
$sql .= "a.charger = '' ";
break;
case "2Y": // 등기부등본 담당자
$sql .= "a.reg_charger != '' ";
break;
case "2N": // 등기부등본 담당자
$sql .= "a.reg_charger IS NULL ";
break;
}
}
}
// 본부
if (!empty($data['bonbu'])) {
if ($data['charger_gbn'] === "1") {
$sql .= "AND a.dept1_sq = '{$data['bonbu']}' ";
} else {
$sql .= "AND a.reg_dept1_sq = '{$data['bonbu']}' ";
}
}
// 팀
if (!empty($data['team'])) {
if ($data['charger_gbn'] === "1") {
$sql .= "AND a.dept2_sq = '{$data['team']}' ";
} else {
$sql .= "AND a.reg_dept2_sq = '{$data['team']}' ";
}
}
// 참고파일
if (!empty($data['reference_file_url_yn'])) {
$sql .= "AND a.reference_file_url_yn = '{$data['a.reference_file_url_yn']}' ";
}
// 법인
if (!empty($data['corp_own'])) {
$sql .= "AND m.corp_own = '{$data['a.corp_own']}' ";
}
}
$query = $this->db->query($sql);
return $query->getRow()->cnt;
}
public function getResultList($start, $end, $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
LEFT JOIN v2_vrfc_req b ON a.vr_sq = b.vr_sq
LEFT 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['atcl_no'])) {
$sql .= "AND a.atcl = '{$data['atcl_no']}' ";
} else {
// 현재상태
if (!empty($data['stat_cd'])) {
$sql .= "AND b.stat_cd = '{$data['stat_cd']}' ";
}
// 중개소
if (!empty($data['realtor_nm'])) {
$sql .= "AND a.realtor_nm = '{$data['realtor_nm']}' ";
}
// 매물구분
if (!empty($data['rlet_type_cd'])) {
$sql .= "AND a.rlet_type_cd = '{$data['rlet_type_cd']}' ";
}
// 접수기간
if (!empty($data['receipt_sdate'])) {
$sql .= "AND b.insert_tm >= '{$data['receipt_sdate']} 00:00:00' ";
}
if (!empty($data['receipt_edate'])) {
$sql .= "AND b.insert_tm <= '{$data['receipt_edate']} 23:59:59' ";
}
// 완료기간
if (!empty($data['complete_sdate'])) {
$sql .= "AND b.insert_tm >= '{$data['complete_sdate']} 00:00:00' ";
}
if (!empty($data['complete_edate'])) {
$sql .= "AND b.insert_tm <= '{$data['complete_edate']} 23:59:59' ";
}
// 검증방식
if (!empty($data['vrfc_type_sub'])) {
$sql .= "AND a.vrfc_type_sub = '{$data['vrfc_type_sub']}' ";
} else {
if (!empty($data['vrfcreq_way'])) {
$sql .= "AND b.vrfc_type = '{$data['vrfcreq_way']}' ";
}
}
// 매체사
if (!empty($data['rcpt_cpid'])) {
$sql .= "AND a.cpid = '{$data['rcpt_cpid']}' ";
}
// 지역구분
if (!empty($data['srcDong'])) {
$sql .= "AND a.address_code = '{$data['srcDong']}' ";
} else {
if (!empty($data['srcGugun'])) {
$str_gugun = substr($data['srcGugun'], '0', '2');
if ($str_gugun == '36') { //세종시는 군구가 없고 바로 동이라서 예외
$sql .= "AND a.address_code = '{$data['srcGugun']}' ";
} else {
$gugunPrefix = substr($data['srcGugun'], '0', '5');
$sql .= "AND a.address_code LIKE '{$gugunPrefix}%' ";
}
} else {
if (!empty($data['srcSido'])) {
$sidoPrefix = substr($data['srcSido'], '0', '2');
$sql .= "AND a.address_code LIKE '{$sidoPrefix}%' ";
}
}
}
// 담당자
if (!empty($data['damdang'])) {
switch ($data['charger_gbn']) {
case "1":
$sql .= "a.charger = '{$data['damdang']}' ";
break;
case "2":
$sql .= "a.reg_charger = '{$data['damdang']}' ";
break;
}
} else {
// 배정여부
if ($data['assign_yn'] !== "A") {
switch ($data['charger_gbn'] . $data['assign_yn']) {
case "1Y": // 전화/서류 담당자
$sql .= "a.charger != '' ";
break;
case "1N": // 전화/서류 담당자
$sql .= "a.charger = '' ";
break;
case "2Y": // 등기부등본 담당자
$sql .= "a.reg_charger != '' ";
break;
case "2N": // 등기부등본 담당자
$sql .= "a.reg_charger IS NULL ";
break;
}
}
}
// 본부
if (!empty($data['bonbu'])) {
if ($data['charger_gbn'] === "1") {
$sql .= "AND a.dept1_sq = '{$data['bonbu']}' ";
} else {
$sql .= "AND a.reg_dept1_sq = '{$data['bonbu']}' ";
}
}
// 팀
if (!empty($data['team'])) {
if ($data['charger_gbn'] === "1") {
$sql .= "AND a.dept2_sq = '{$data['team']}' ";
} else {
$sql .= "AND a.reg_dept2_sq = '{$data['team']}' ";
}
}
// 참고파일
if (!empty($data['reference_file_url_yn'])) {
$sql .= "AND a.reference_file_url_yn = '{$data['a.reference_file_url_yn']}' ";
}
// 법인
if (!empty($data['corp_own'])) {
$sql .= "AND m.corp_own = '{$data['a.corp_own']}' ";
}
}
$sql .= "ORDER BY b.vr_sq DESC , b.insert_tm DESC
LIMIT {$start}, {$end} ";
$query = $this->db->query($sql);
return $query->getResultArray();
}
// 엑셀 다운로드
public function getExcelList($data)
{
$sql = "SELECT
a.atcl_no AS '매물번호',
g.cd_nm AS '진행상태',
b.insert_tm AS '접수시간',
h.cd_nm AS '검증방식',
CONCAT(f.region_nm, ' ', c.rm_no) AS '주소',
CONCAT(c.address2, ' ', c.address3) AS '상세주소',
a.cpid AS '매체사',
a.realtor_nm AS '중개소',
i.usr_nm AS '서류/전화 담당자',
IFNULL(d.insert_tm, d2.insert_tm) AS '서류/전화 확인완료시간',
a.reg_charger AS '등기부등본 담당자',
greatest(ifnull(d45.insert_tm, ''), ifnull(d49.insert_tm, '')) AS '등기부등본 확인시간',
e.insert_tm AS '검증완료 일시',
k.comment AS '주소 불일치 사유',
l.comment AS '의뢰인 불일치 사유'
FROM
v2_article_info a
LEFT JOIN v2_vrfc_req b ON a.vr_sq = b.vr_sq
LEFT 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['atcl_no'])) {
$sql .= "AND a.atcl = '{$data['atcl_no']}' ";
} else {
// 현재상태
if (!empty($data['stat_cd'])) {
$sql .= "AND b.stat_cd = '{$data['stat_cd']}' ";
}
// 중개소
if (!empty($data['realtor_nm'])) {
$sql .= "AND a.realtor_nm = '{$data['realtor_nm']}' ";
}
// 매물구분
if (!empty($data['rlet_type_cd'])) {
$sql .= "AND a.rlet_type_cd = '{$data['rlet_type_cd']}' ";
}
// 접수기간
if (!empty($data['receipt_sdate'])) {
$sql .= "AND b.insert_tm >= '{$data['receipt_sdate']} 00:00:00' ";
}
if (!empty($data['receipt_edate'])) {
$sql .= "AND b.insert_tm <= '{$data['receipt_edate']} 23:59:59' ";
}
// 완료기간
if (!empty($data['complete_sdate'])) {
$sql .= "AND b.insert_tm >= '{$data['complete_sdate']} 00:00:00' ";
}
if (!empty($data['complete_edate'])) {
$sql .= "AND b.insert_tm <= '{$data['complete_edate']} 23:59:59' ";
}
// 검증방식
if (!empty($data['vrfc_type_sub'])) {
$sql .= "AND a.vrfc_type_sub = '{$data['vrfc_type_sub']}' ";
} else {
if (!empty($data['vrfcreq_way'])) {
$sql .= "AND b.vrfc_type = '{$data['vrfcreq_way']}' ";
}
}
// 매체사
if (!empty($data['rcpt_cpid'])) {
$sql .= "AND a.cpid = '{$data['rcpt_cpid']}' ";
}
// 지역구분
if (!empty($data['srcDong'])) {
$sql .= "AND a.address_code = '{$data['srcDong']}' ";
} else {
if (!empty($data['srcGugun'])) {
$str_gugun = substr($data['srcGugun'], '0', '2');
if ($str_gugun == '36') { //세종시는 군구가 없고 바로 동이라서 예외
$sql .= "AND a.address_code = '{$data['srcGugun']}' ";
} else {
$gugunPrefix = substr($data['srcGugun'], '0', '5');
$sql .= "AND a.address_code LIKE '{$gugunPrefix}%' ";
}
} else {
if (!empty($data['srcSido'])) {
$sidoPrefix = substr($data['srcSido'], '0', '2');
$sql .= "AND a.address_code LIKE '{$sidoPrefix}%' ";
}
}
}
// 담당자
if (!empty($data['damdang'])) {
switch ($data['charger_gbn']) {
case "1":
$sql .= "a.charger = '{$data['damdang']}' ";
break;
case "2":
$sql .= "a.reg_charger = '{$data['damdang']}' ";
break;
}
} else {
// 배정여부
if ($data['assign_yn'] !== "A") {
switch ($data['charger_gbn'] . $data['assign_yn']) {
case "1Y": // 전화/서류 담당자
$sql .= "a.charger != '' ";
break;
case "1N": // 전화/서류 담당자
$sql .= "a.charger = '' ";
break;
case "2Y": // 등기부등본 담당자
$sql .= "a.reg_charger != '' ";
break;
case "2N": // 등기부등본 담당자
$sql .= "a.reg_charger IS NULL ";
break;
}
}
}
// 본부
if (!empty($data['bonbu'])) {
if ($data['charger_gbn'] === "1") {
$sql .= "AND a.dept1_sq = '{$data['bonbu']}' ";
} else {
$sql .= "AND a.reg_dept1_sq = '{$data['bonbu']}' ";
}
}
// 팀
if (!empty($data['team'])) {
if ($data['charger_gbn'] === "1") {
$sql .= "AND a.dept2_sq = '{$data['team']}' ";
} else {
$sql .= "AND a.reg_dept2_sq = '{$data['team']}' ";
}
}
// 참고파일
if (!empty($data['reference_file_url_yn'])) {
$sql .= "AND a.reference_file_url_yn = '{$data['a.reference_file_url_yn']}' ";
}
// 법인
if (!empty($data['corp_own'])) {
$sql .= "AND m.corp_own = '{$data['a.corp_own']}' ";
}
}
$sql .= "ORDER BY b.vr_sq DESC , b.insert_tm DESC ";
$query = $this->db->query($sql);
return $query->getResultArray();
}
}

View File

@@ -101,6 +101,11 @@
// 3. 끝 슬래시 정리 // 3. 끝 슬래시 정리
$path = rtrim($path, '/'); $path = rtrim($path, '/');
switch ($path) { switch ($path) {
case "/board/notice/write":
case "/board/notice/modify":
case "/board/notice/detail":
$path = "/board/notice/lists";
break;
case "/article/apt/detail": case "/article/apt/detail":
$path = "/article/apt/lists"; $path = "/article/apt/lists";
break; break;

View File

@@ -138,11 +138,11 @@
</a> </a>
<div tabindex="-1" role="menu" aria-hidden="true" <div tabindex="-1" role="menu" aria-hidden="true"
class="dropdown-menu dropdown-menu-right"> class="dropdown-menu dropdown-menu-right">
<button type="button" tabindex="0" class="dropdown-item">User Account</button> <!-- <button type="button" tabindex="0" class="dropdown-item">User Account</button>
<button type="button" tabindex="0" class="dropdown-item">Settings</button> <button type="button" tabindex="0" class="dropdown-item">Settings</button>
<h6 tabindex="-1" class="dropdown-header">Header</h6> <h6 tabindex="-1" class="dropdown-header">Header</h6>
<button type="button" tabindex="0" class="dropdown-item">Actions</button> <button type="button" tabindex="0" class="dropdown-item">Actions</button>
<div tabindex="-1" class="dropdown-divider"></div> <div tabindex="-1" class="dropdown-divider"></div> -->
<button type="button" tabindex="0" class="dropdown-item" <button type="button" tabindex="0" class="dropdown-item"
onclick="location.href='/logout'">로그아웃</button> onclick="location.href='/logout'">로그아웃</button>
</div> </div>

View File

@@ -440,7 +440,6 @@
<th>사용여부</th> <th>사용여부</th>
<th>경도</th> <th>경도</th>
<th>위도</th> <th>위도</th>
<th>사진촬영제외</th>
</tr> </tr>
</thead> </thead>
<tbody></tbody> <tbody></tbody>
@@ -796,7 +795,7 @@
"줄번호", "단지코드", "통합단지코드", "법정동코드", "주소" "줄번호", "단지코드", "통합단지코드", "법정동코드", "주소"
, "상세주소", "단지유형", "단지명" , "상세주소", "단지유형", "단지명"
, "입주년월", "총세대수", "총동수", "평형수", "동호수" , "입주년월", "총세대수", "총동수", "평형수", "동호수"
, "사용여부", "경도", "위도", "사진촬영제외" , "사용여부", "경도", "위도"
]; ];
const errors = []; const errors = [];

View File

@@ -415,7 +415,7 @@
<input type="file" id="excel" class="form-control" accept=".xlsx,.xls,.csv" <input type="file" id="excel" class="form-control" accept=".xlsx,.xls,.csv"
style="max-width: 320px;"> style="max-width: 320px;">
<a href="/plugin/sample/sample_apt.xlsx" download="아파트단지_샘플양식" <a href="/plugin/sample/sample_ground_apt.xlsx" download="아파트평면도_샘플양식"
class="btn btn-outline-secondary btn-sm"> class="btn btn-outline-secondary btn-sm">
샘플양식 다운로드 샘플양식 다운로드
</a> </a>

View File

@@ -33,9 +33,16 @@
<th>첨부파일</th> <th>첨부파일</th>
<td colspan="5" style="min-height: 200px;"> <td colspan="5" style="min-height: 200px;">
<div> <div>
<a href="<?= site_url('/board/notice/download/' . $files['file_sq']) ?>"> <?php if ($files['cloud_upload_yn'] === "Y"): ?>
<?= esc($files['orig_name']) ?> <?php $link = NCLOUD_OBJECT_STORAGE_URL . $files['file_path'] . $files['file_name']; ?>
</a> <a href="<?= $link ?>" download="<?= $files['orig_name'] ?>">
<?= esc($files['orig_name']) ?>
</a>
<?php else: ?>
<a href="<?= site_url('/board/notice/download/' . $files['file_sq']) ?>">
<?= esc($files['orig_name']) ?>
</a>
<?php endif; ?>
</div> </div>
</td> </td>
</tr> </tr>

View File

@@ -0,0 +1,728 @@
<?= $this->extend('layouts/main') ?>
<?= $this->section('content') ?>
<style>
th {
font-size: 11px;
text-align: center;
}
td {
text-align: center;
}
#resultList tbody tr {
cursor: pointer;
font-size: 12px;
}
.blockUI {
z-index: 1500 !important;
}
.ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 180px;
}
.card-header {
display: flex !important;
align-items: center;
}
.card-header-tab {
justify-content: flex-start !important;
}
.table-scroll {
max-height: 300px;
overflow-y: scroll;
}
.swal2-cancel {
background-color: #ff0000 !important;
color: #fff !important;
}
</style>
<h1>확인매물 현황</h1>
<div class="col-md-12 col-xl-12">
<div class="main-card mb-3 card">
<div class="card-body">
<form id="frm_srch_info" method="get" onsubmit="return false;">
<input type="hidden" name="m" id="m" value="M801" />
<input type="hidden" name="todo" id="todo" value="inq" />
<input type="hidden" name="usr_id" value="" />
<!-- 안내 -->
<div class="alert alert-warning py-2 mb-3">
<small class="mb-0">
매물번호를 입력하면 <b>다른 조건은 무시</b>됩니다.
</small>
</div>
<!-- 검색 폼 -->
<div class="row g-3">
<!-- 매물번호 -->
<div class="col-md-1">
<label class="form-label mb-1">매물번호</label>
<input type="text" name="atcl_no" class="form-control form-control-sm" placeholder="매물번호" maxlength="10"
onkeypress="atcl_no_enter(event)">
</div>
<!-- 현재상태 -->
<div class="col-md-2">
<label class="form-label mb-1">현재상태</label>
<select name="stat_cd" class="form-select form-select-sm">
<option value="">-선택-</option>
<?php foreach ($codes as $c): ?>
<?php if ($c['category'] === "STEP_VERIFICATION"): ?>
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
</div>
<!-- 중개소 -->
<div class="col-md-1">
<label class="form-label mb-1">중개소</label>
<input type="text" name="realtor_nm" class="form-control form-control-sm" placeholder="중개소">
</div>
<!-- 배정여부 (2개 셀렉트) -->
<div class="col-md-3">
<label class="form-label mb-1">배정여부</label>
<div class="d-flex gap-2">
<select name="charger_gbn" id="code_charger_gbn" class="form-select form-select-sm">
<option value="1">전화/서류담당자</option>
<option value="2">등기부등본담당자</option>
</select>
<select name="assign_yn" id="assign_yn" class="form-select form-select-sm">
<option value="A">-전체-</option>
<option value="Y">배정</option>
<option value="N">미배정</option>
</select>
</div>
</div>
</div>
<div class="row g-3">
<!-- 접수기간 -->
<div class="col-md-3">
<label class="form-label mb-1">접수기간</label>
<div class="input-group input-group-sm">
<input type="date" class="form-control" name="receipt_sdate" id="receipt_sdate" placeholder="시작일">
<span class="input-group-text">~</span>
<input type="date" class="form-control" name="receipt_edate" id="receipt_edate" placeholder="종료일">
</div>
</div>
<!-- 완료기간 -->
<div class="col-md-3">
<label class="form-label mb-1">완료기간</label>
<div class="input-group input-group-sm">
<input type="text" class="form-control" name="complete_sdate" id="complete_sdate" placeholder="시작일">
<span class="input-group-text">~</span>
<input type="text" class="form-control" name="complete_edate" id="complete_edate" placeholder="종료일">
</div>
</div>
<!-- 지역구분 -->
<div class="col-md-4">
<label class="form-label mb-1">지역구분</label>
<div class="d-flex gap-2">
<select name="srcSido" id="srcSido" class="form-select form-select-sm">
<option value="">-시/도-</option>
<?php foreach ($sido as $s): ?>
<option value="<?= $s['region_cd'] ?>"><?= $s['region_nm'] ?></option>
<?php endforeach; ?>
</select>
<select name="srcGugun" id="srcGugun" class="form-select form-select-sm">
<option value="">-시/군/구-</option>
</select>
<select name="srcDong" id="srcDong" class="form-select form-select-sm">
<option value="">-읍/면/동-</option>
</select>
</div>
</div>
</div>
<div class="row g-3">
<!-- 담당자 (본부/팀/담당 3셀렉트) -->
<div class="col-md-3">
<label class="form-label mb-1">담당자</label>
<div class="d-flex gap-2">
<select name="bonbu" id="bonbu" class="form-select form-select-sm">
<option value="">-본부-</option>
<?php foreach ($bonbu as $d): ?>
<option value="<?= $d['dept_sq'] ?>"><?= $d['dept_nm'] ?></option>
<?php endforeach; ?>
</select>
<select name="team" id="team" class="form-select form-select-sm">
<option value="">-팀-</option>
</select>
<select name="damdang" id="damdang" class="form-select form-select-sm">
<option value="">-담당자-</option>
</select>
</div>
</div>
<!-- 검증방식 -->
<div class="col-md-2">
<label class="form-label mb-1">검증방식</label>
<div class="d-flex gap-2">
<select name="vrfcreq_way" id="vrfcreq_way" class="form-select form-select-sm">
<option value="">-검증방식-</option>
<?php foreach ($codes as $c): ?>
<?php if ($c['category'] === "VRFCREQ_WAY"): ?>
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
<select name="vrfc_type_sub" id="vrfc_type_sub" class="form-select form-select-sm">
<option value="">-선택-</option>
</select>
</div>
</div>
<!-- 매체사 -->
<div class="col-md-1">
<label class="form-label mb-1">매체사</label>
<select name="rcpt_cpid" class="form-select form-select-sm">
<option value="">-전체-</option>
<?php foreach ($codes as $c): ?>
<?php if ($c['category'] === "CP_ID"): ?>
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
</div>
<!-- 매물종류 -->
<div class="col-md-1">
<label class="form-label mb-1">매물종류</label>
<select name="rlet_type_cd" class="form-select form-select-sm">
<option value="">-매물종류-</option>
<?php foreach ($codes as $c): ?>
<?php if ($c['category'] === "ARTICLE_TYPE"): ?>
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
</div>
<!-- 참고용 파일 -->
<div class="col-md-1">
<label class="form-label mb-1">참고용 파일</label>
<select name="reference_file_url_yn" class="form-select form-select-sm">
<option value="">-전체-</option>
<option value="Y">Y</option>
<option value="N">N</option>
</select>
</div>
<!-- 법인소유 -->
<div class="col-md-1">
<label class="form-label mb-1">법인소유</label>
<select name="corp_own" class="form-select form-select-sm">
<option value="">-전체-</option>
<option value="Y">Y</option>
<option value="N">N</option>
</select>
</div>
<div class="col-md-1 d-grid">
<label class="form-label mb-1 invisible">검색</label>
<button type="button" class="btn btn-primary" id="btnSearch">
<i class="pe-7s-search me-1"></i>검색
</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">
<div class="d-flex align-items-center flex-wrap" style="gap: 8px; flex: 1">
</div>
<div class="ml-auto">
<button class="btn btn-sm btn-outline-success" id="excel-download">
<i class="fa fa-fw" aria-hidden="true" title="file-excel-o"></i>
엑셀다운로드
</button>
</div>
</div>
<div class="card-body">
<table id="resultList" 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>서류/전화<br />담당자</th>
<th>서류/전화<br />확인완료시간</th>
<th>등기부등본<br />담당자</th>
<th>등기부등본<br />확인시간</th>
<th>검증완료<br />일시</th>
</tr>
</thead>
<tbody>
<!-- 여기는 비워둠: AJAX로 채움 -->
</tbody>
</table>
</div>
</div>
</div>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css" />
<link href="https://unpkg.com/dropzone@6.0.0-beta.1/dist/dropzone.css" rel="stylesheet" type="text/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" src="https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=dtounkwjc5"></script>
<script type="text/javascript">
const date = new Date();
const bonbuArr = <?= json_encode($bonbu, JSON_UNESCAPED_UNICODE); ?>;
const teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>;
const userArr = <?= json_encode($user, JSON_UNESCAPED_UNICODE); ?>;
var table;
$(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)
});
$("#srcSido, #srcGugun, #srcSido2, #srcGugun2").on("change", function (e) {
const targetId = this.id;
const isSecond = this.id.endsWith("2");
const params = {
srcSido: isSecond
? $("#srcSido2").val()
: $("#frm_srch_info [name=srcSido]").val(),
srcGugun: isSecond
? $("#srcGugun2").val()
: $("#frm_srch_info [name=srcGugun]").val(),
};
$.ajax({
url: "/manage/areas/getAreaList",
method: "POST",
dataType: "json",
data: params,
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 ($("#srcSido").val() !== "") {
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;
}
}
});
});
$("#bonbu, #team, #bonbu2, #team2").on("change", function (e) {
const targetId = this.id;
var str = "";
if (targetId === "bonbu" || targetId === "bonbu2") {
const dept_sq = $("#" + targetId).val();
str += `<option value="">-팀-</option>`;
if (teamArr.length > 0) {
for (var i = 0; i < teamArr.length; i++) {
// 이 팀이 현재 본부에 속한 팀인지 체크
if (String(teamArr[i].pdept_sq) === String(dept_sq)) {
str += `
<option value="${teamArr[i].dept_sq}">${teamArr[i].dept_nm}</option>
`;
}
}
}
if (targetId === "bonbu") {
$("#team").html(str);
} else if (targetId === "bonbu2") {
$("#team2").html(str);
}
} else if (targetId === "team" || targetId === "team2") {
const dept_sq = $("#" + targetId).val();
str += `<option value="">-담당자-</option>`;
if (userArr.length > 0) {
for (var i = 0; i < userArr.length; i++) {
// 이 팀이 현재 본부에 속한 팀인지 체크
if (String(userArr[i].dept_sq) === String(dept_sq)) {
str += `
<option value="${userArr[i].usr_id}">${userArr[i].usr_nm}</option>
`;
}
}
}
if (targetId === "team") {
$("#damdang").html(str);
} else if (targetId === "team2") {
$("#damdang2").html(str);
}
}
});
// 검증방식 onchange
$("#vrfcreq_way").on("change", function (e) {
const val = e.target.value;
var str = "";
str += `<option value="">-선택-</option>`;
if (e.val !== "") {
$.getJSON("/common/common/getVrfcCode?type=" + val, function (result) {
var total = result.length;
for (var i = 0; i < total; i++) {
var cateNm = result[i].cd_nm;
if (total == 1) {
str += "<option value=\"" + result[i].cd + "\" selected>" + cateNm + "</option>";
} else {
str += "<option value=\"" + result[i].cd + "\">" + cateNm + "</option>";
}
}
$("#vrfc_type_sub").html(str);
});
} else {
$("#vrfc_type_sub").html(str);
}
});
table = $('#resultList').DataTable({
language: lang_kor,
serverSide: true,
processing: true,
ajax: {
url: '/m701/m701a/getResultList',
type: 'GET',
beforeSend: function () {
blockUI.blockPage({
message: tpl
})
},
complete: function () {
blockUI.unblockPage()
},
data: function (d) {
initReceiptDate();
d.atcl_no = $("#frm_srch_info [name=atcl_no]").val(); // 매물번호
d.stat_cd = $("#frm_srch_info [name=stat_cd]").val(); // 현재상태
d.realtor_nm = $("#frm_srch_info [name=realtor_nm]").val(); // 중개소
d.charger_gbn = $("#frm_srch_info [name=charger_gbn]").val(); // 배정여부
d.assign_yn = $("#frm_srch_info [name=assign_yn]").val(); // 배정여부2
d.receipt_sdate = $("#frm_srch_info [name=receipt_sdate]").val(); // 접수기간1
d.receipt_edate = $("#frm_srch_info [name=receipt_edate]").val(); // 접수기간2
d.complete_sdate = $("#frm_srch_info [name=complete_sdate]").val(); // 완료기간1
d.complete_edate = $("#frm_srch_info [name=complete_edate]").val(); // 완료기간2
d.srcSido = $("#frm_srch_info [name=srcSido]").val(); // 시도
d.srcGugun = $("#frm_srch_info [name=srcGugun]").val(); // 시군구
d.srcDong = $("#frm_srch_info [name=srcDong]").val(); // 읍면동
d.bonbu = $("#frm_srch_info [name=bonbu]").val(); // 본부
d.team = $("#frm_srch_info [name=team]").val(); // 팀
d.damdang = $("#frm_srch_info [name=damdang]").val(); // 담당
d.vrfcreq_way = $("#frm_srch_info [name=vrfcreq_way]").val(); // 검증방식1
d.vrfc_type_sub = $("#frm_srch_info [name=vrfc_type_sub]").val(); // 검증방식2
d.rcpt_cpid = $("#frm_srch_info [name=rcpt_cpid]").val(); // 매체사
d.rlet_type_cd = $("#frm_srch_info [name=rlet_type_cd]").val(); // 매물종류
d.reference_file_url_yn = $("#frm_srch_info [name=reference_file_url_yn]").val(); // 참고용
d.corp_own = $("#frm_srch_info [name=corp_own]").val(); // 법인
d.start = d.start || 0
d.length = d.length || 10
},
},
"columnDefs": [
{ className: 'text-center', targets: '_all' },
{ 'targets': '_all', "defaultContent": "" },
],
columns: [
{ data: 'atcl_no' },
{ data: 'pre_stat' },
{ data: 'insert_tm' },
{ data: 'vrfc_type' },
{ data: null, render: fn_region_render },
{ data: null, render: fn_addr_render },
{ data: 'cpid' },
{ data: 'realtor_nm' },
{ data: 'usr_nm', width: "80px" },
{ data: null, render: fn_tm_render },
{ data: 'reg_charger' },
{ data: 'rgbk_check_tm' },
{ data: 'result_tm' },
],
// 옵션들 예시
paging: true,
searching: false,
ordering: false,
});
$('#resultList tbody').on('click', 'tr', function (e) {
if ($(e.target).closest('td.dt-no-rowclick').length) return;
const rowData = table.row(this).data();
if (!rowData) return;
return;
// const rcpt_no = rowData.rcpt_no;
// const hscp_no = rowData.hscp_no;
// location.href = "<?= site_url('article/apt/ground/detail') ?>/" + rcpt_no + "/" + hscp_no;
});
$('#btnSearch').on('click', function () {
table.ajax.reload()
});
// 엑셀 다운로드 click
$("#excel-download").on("click", function () {
$.ajax({
url: "/m701/m701a/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 initReceiptDate() {
const before3 = new Date();
before3.setDate(date.getDate() - 2);
const fmt = d => d.toISOString().slice(0, 10);
$('#receipt_sdate').val(fmt(before3));
$('#receipt_edate').val(fmt(date));
}
function atcl_no_enter(event) {
if (event.keyCode == 13) {
table.ajax.reload()
}
}
function fn_region_render(data, type, row) {
var str = "";
str = row.region_nm + " " + row.rm_no;
return str;
}
// 주소 render
function fn_addr_render(data, type, row) {
var str = "";
if (row.address2b == null) {
str = row.address2 + " " + row.address3;
} else {
str = row.address2b + " " + row.address3;
}
return str;
}
function fn_tm_render(data, type, row) {
var str = "";
if (row.update_res_tm == null) {
str = row.stat_39_tm;
} else {
str = row.update_res_tm;
}
return str;
}
// 엑셀 다운로드
function downloadExcel(data) {
const ws = XLSX.utils.json_to_sheet(data);
ws['!cols'] = [
{ wpx: 80 },
{ wpx: 80 },
{ wpx: 80 },
{ wpx: 80 },
{ wpx: 150 },
{ wpx: 120 },
{ wpx: 100 },
{ wpx: 100 },
{ wpx: 100 },
{ wpx: 100 },
{ wpx: 100 },
{ wpx: 100 },
{ wpx: 100 },
{ wpx: 100 },
{ wpx: 100 },
];
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}`;
}
function extractCode(code) {
var codeArr = new Array();
if (codes.length) {
for (var i = 0; i < codes.length; i++) {
if (code === codes[i].category) {
codeArr.push(codes[i]);
}
}
}
return codeArr;
}
// 이미지 프리뷰
function fn_preview(src) {
const $img = $('#imgPreview');
// 이미지 표시
$img.attr('src', src).show();
$('#previewTitle').text('이미지 미리보기');
const modal = new bootstrap.Modal(document.getElementById('previewModal'));
modal.show();
}
</script>
<?= $this->endSection() ?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB