페이지 추가
Reviewed-on: http://192.168.10.243:3000/owrainfo/confirms/pulls/25
This commit was merged in pull request #25.
This commit is contained in:
@@ -59,13 +59,40 @@ $routes->group('', ['namespace' => 'App\Controllers\Article'], static function (
|
||||
/**
|
||||
* 현장확인매물 내역
|
||||
*/
|
||||
$routes->group('article', static function ($routes) {
|
||||
$routes->get('receipt/lists', 'Receipt::lists');
|
||||
$routes->get('receipt/detail/(:num)', 'Receipt::detail/$1');
|
||||
$routes->group('article/receipt', static function ($routes) {
|
||||
$routes->get('lists', 'Receipt::lists');
|
||||
$routes->get('detail/(:num)', 'Receipt::detail/$1');
|
||||
|
||||
$routes->get('receipt/getResultList', 'Receipt::getResultList');
|
||||
$routes->get('getResultList', 'Receipt::getResultList');
|
||||
$routes->get('excel', 'Receipt::excel');
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* 조직별 배정 현황
|
||||
*/
|
||||
$routes->group('article/dept', static function ($routes) {
|
||||
$routes->get('lists', 'Dept::lists');
|
||||
$routes->get('detail/(:num)', 'Dept::detail/$1');
|
||||
|
||||
$routes->get('getResultList', 'Dept::getResultList');
|
||||
$routes->get('excel', 'Dept::excel');
|
||||
$routes->get('print', 'Dept::print'); // 관할포인트
|
||||
$routes->get('updateAssign', 'Dept::updateAssign'); // 배정변경
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* 녹취매물 내역
|
||||
*/
|
||||
$routes->group('article/record', static function ($routes) {
|
||||
$routes->get('lists', 'Record::lists');
|
||||
$routes->get('detail/(:num)', 'Record::detail/$1');
|
||||
|
||||
$routes->get('getResultList', 'Record::getResultList');
|
||||
$routes->get('excel', 'Record::excel');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ class Apt extends BaseController
|
||||
try {
|
||||
|
||||
$team = $this->request->getPost('team');
|
||||
$damdang = $this->request->getPost(index: 'damdang');
|
||||
$damdang = $this->request->getPost(index: 'usr_id');
|
||||
|
||||
if (empty($team)) {
|
||||
return $this->response->setJSON([
|
||||
|
||||
254
app/Controllers/Article/Dept.php
Normal file
254
app/Controllers/Article/Dept.php
Normal file
@@ -0,0 +1,254 @@
|
||||
<?php
|
||||
namespace App\Controllers\Article;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\article\DeptModel;
|
||||
use App\Models\common\CodeModel;
|
||||
|
||||
class Dept extends BaseController
|
||||
{
|
||||
private $model, $codeModel;
|
||||
public function __construct()
|
||||
{
|
||||
$this->codeModel = new CodeModel();
|
||||
$this->model = new DeptModel();
|
||||
}
|
||||
|
||||
public function lists(): string
|
||||
{
|
||||
|
||||
$codes = $this->codeModel->getCodeLists(['NHN_PRODUCT_TYPE', 'RECEIPT_STATUS1', 'RESERVED_APM']); // 코드조회
|
||||
$sido = $this->model->getAreaList(); // 지역조회
|
||||
$bonbu = $this->model->getBonbuList();
|
||||
$team = $this->model->getTeamList();
|
||||
$user = $this->model->getUserList();
|
||||
|
||||
$this->data['sido'] = $sido;
|
||||
$this->data['bonbu'] = $bonbu;
|
||||
$this->data['team'] = $team;
|
||||
$this->data['user'] = $user;
|
||||
$this->data['codes'] = $codes;
|
||||
|
||||
|
||||
return view("pages/article/dept/lists", $this->data);
|
||||
}
|
||||
|
||||
public function getResultList()
|
||||
{
|
||||
$start = (int) $this->request->getGet('start') ?: 0;
|
||||
$end = (int) $this->request->getGet('length') ?: 10;
|
||||
|
||||
$data = [
|
||||
'rcpt_atclno' => $this->request->getGet('rcpt_atclno'), // 매물ID
|
||||
|
||||
'sdate' => $this->request->getGet('sdate'), // 시작일
|
||||
'edate' => $this->request->getGet('edate'), // 종료일
|
||||
|
||||
'rsrv_tm_ap' => $this->request->getGet('rsrv_tm_ap'), // 유형
|
||||
'rsrv_sdate' => $this->request->getGet('rsrv_sdate'), // 시작일
|
||||
'rsrv_edate' => $this->request->getGet('rsrv_edate'), // 종료일
|
||||
|
||||
'bonbu' => $this->request->getGet('bonbu'), // 본부
|
||||
'team' => $this->request->getGet('team'), // 팀
|
||||
'user' => $this->request->getGet('user'), // 담당자
|
||||
|
||||
'sido' => $this->request->getGet('sido'), // 시도
|
||||
'gugun' => $this->request->getGet('gugun'), // 시군구
|
||||
'dong' => $this->request->getGet('dong'), // 읍면동
|
||||
|
||||
'ground_plan_yn' => $this->request->getGet('ground_plan_yn'), // 평면도유무
|
||||
'ground_plan' => $this->request->getGet('ground_plan'), // 평면도요청
|
||||
'direct_trad_yn' => $this->request->getGet('direct_trad_yn'), // 직거래
|
||||
|
||||
'stat' => $this->request->getGet('stat'),
|
||||
|
||||
'srchType' => $this->request->getGet('srchType'), // 검색유형
|
||||
'srchTxt' => $this->request->getGet('srchTxt'), // 검색어
|
||||
];
|
||||
|
||||
$totalCount = $this->model->getTotalCount($data);
|
||||
|
||||
$datas = $this->model->getResultList($start, $end, $data);
|
||||
|
||||
$deptStatistics = $this->model->getDeptStatistics($data); // 조직별통계
|
||||
$areaStatistics = $this->model->getAreaStatistics($data); // 지역별통계
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'recordsTotal' => $totalCount,
|
||||
'recordsFiltered' => $totalCount,
|
||||
'data' => $datas,
|
||||
'widgets' => [
|
||||
'deptList' => $deptStatistics,
|
||||
'areaStats' => $areaStatistics,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
// 관할포인트 인쇄 - 화면
|
||||
public function print(): string
|
||||
{
|
||||
$deptSq = $this->request->getGet('depChk');
|
||||
$dept_cnt = count($deptSq);
|
||||
|
||||
|
||||
$listDept = $this->model->getDeptMapList($deptSq);
|
||||
|
||||
if (!empty($listDept)) {
|
||||
$lati = 0;
|
||||
$long = 0;
|
||||
foreach ($listDept as $dept) {
|
||||
$lati += $dept['rcpt_y'];
|
||||
$long += $dept['rcpt_x'];
|
||||
}
|
||||
|
||||
$lati = $lati / $dept_cnt;
|
||||
$long = $long / $dept_cnt;
|
||||
}
|
||||
|
||||
return view("pages/article/dept/printMap", [
|
||||
// 'lati' => $lati,
|
||||
// 'long' => $long,
|
||||
'listDept' => $listDept,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
// 엑셀 다운로드
|
||||
public function excel()
|
||||
{
|
||||
try {
|
||||
|
||||
$data = [
|
||||
'rcpt_atclno' => $this->request->getGet('rcpt_atclno'), // 매물ID
|
||||
|
||||
'sdate' => $this->request->getGet('sdate'), // 시작일
|
||||
'edate' => $this->request->getGet('edate'), // 종료일
|
||||
|
||||
'rsrv_tm_ap' => $this->request->getGet('rsrv_tm_ap'), // 유형
|
||||
'rsrv_sdate' => $this->request->getGet('rsrv_sdate'), // 시작일
|
||||
'rsrv_edate' => $this->request->getGet('rsrv_edate'), // 종료일
|
||||
|
||||
'bonbu' => $this->request->getGet('bonbu'), // 본부
|
||||
'team' => $this->request->getGet('team'), // 팀
|
||||
'user' => $this->request->getGet('user'), // 담당자
|
||||
|
||||
'sido' => $this->request->getGet('sido'), // 시도
|
||||
'gugun' => $this->request->getGet('gugun'), // 시군구
|
||||
'dong' => $this->request->getGet('dong'), // 읍면동
|
||||
|
||||
'ground_plan_yn' => $this->request->getGet('ground_plan_yn'), // 평면도유무
|
||||
'ground_plan' => $this->request->getGet('ground_plan'), // 평면도요청
|
||||
'direct_trad_yn' => $this->request->getGet('direct_trad_yn'), // 직거래
|
||||
|
||||
'stat' => $this->request->getGet('stat'),
|
||||
|
||||
'srchType' => $this->request->getGet('srchType'), // 검색유형
|
||||
'srchTxt' => $this->request->getGet('srchTxt'), // 검색어
|
||||
];
|
||||
|
||||
$datas = $this->model->getExcelList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$e->getPrevious()->getTraceAsString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 배정변경
|
||||
public function updateAssign()
|
||||
{
|
||||
try {
|
||||
|
||||
$team = $this->request->getPost('team');
|
||||
$damdang = $this->request->getPost(index: 'usr_id');
|
||||
|
||||
if (empty($team)) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => '팀정보 누락',
|
||||
]);
|
||||
}
|
||||
|
||||
if (empty($damdang)) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => '담당자정보 누락',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
$rows = $this->request->getPost('rows');
|
||||
|
||||
$rows = json_decode($rows, true);
|
||||
|
||||
if (count($rows) > 0) {
|
||||
foreach ($rows as $row) {
|
||||
$params = [
|
||||
'dept_sq' => $team,
|
||||
'damdang' => $damdang,
|
||||
'rcpt_sq' => $row['rcpt_sq'],
|
||||
];
|
||||
|
||||
$this->model->updateAssign($params);
|
||||
|
||||
}
|
||||
} else {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => '저장데이터 누락',
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success'
|
||||
]);
|
||||
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// 상세화면
|
||||
public function detail($id): string
|
||||
{
|
||||
|
||||
$id = (int) $id;
|
||||
|
||||
if ($id <= 0) {
|
||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
$codes = $this->codeModel->getCodeLists(['TRADE_TYPE', 'RECEIPT_STATUS2', 'RECEIPT_STATUS3', 'SMS_MSG_TYPE']); // 코드조회
|
||||
$bonbu = $this->model->getBonbuList();
|
||||
$team = $this->model->getTeamList();
|
||||
|
||||
$data = $this->model->getDetail($id);
|
||||
$history = $this->model->getHistory($id);
|
||||
|
||||
// $aptGround = $this->model->getAptGround($data['rcpt_dong']);
|
||||
|
||||
// 시간대별통계
|
||||
$tmCount = $this->model->getUsrRsrvDateTmCount($id);
|
||||
|
||||
$this->data['codes'] = $codes;
|
||||
$this->data['bonbu'] = $bonbu;
|
||||
$this->data['team'] = $team;
|
||||
|
||||
$this->data['data'] = $data;
|
||||
$this->data['history'] = $history;
|
||||
|
||||
$this->data['tmCount'] = $tmCount;
|
||||
|
||||
return view("pages/article/dept/detail", $this->data);
|
||||
}
|
||||
}
|
||||
152
app/Controllers/Article/Record.php
Normal file
152
app/Controllers/Article/Record.php
Normal file
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
namespace App\Controllers\Article;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\article\RecordModel;
|
||||
use App\Models\common\CodeModel;
|
||||
|
||||
class Record extends BaseController
|
||||
{
|
||||
|
||||
private $model, $codeModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new RecordModel();
|
||||
$this->codeModel = new CodeModel();
|
||||
}
|
||||
|
||||
public function lists(): string
|
||||
{
|
||||
|
||||
$sido = $this->model->getAreaList(); // 지역조회
|
||||
$bonbu = $this->model->getBonbuList();
|
||||
$team = $this->model->getTeamList();
|
||||
$user = $this->model->getUserList();
|
||||
|
||||
$this->data['sido'] = $sido;
|
||||
$this->data['bonbu'] = $bonbu;
|
||||
$this->data['team'] = $team;
|
||||
$this->data['user'] = $user;
|
||||
|
||||
return view("pages/article/record/lists", $this->data);
|
||||
}
|
||||
|
||||
public function getResultList()
|
||||
{
|
||||
$start = (int) $this->request->getGet('start') ?: 0;
|
||||
$end = (int) $this->request->getGet('length') ?: 10;
|
||||
|
||||
$data = [
|
||||
'rcpt_atclno' => $this->request->getGet('rcpt_atclno'), // 매물ID
|
||||
|
||||
'sdate' => $this->request->getGet('sdate'), // 시작일
|
||||
'edate' => $this->request->getGet('edate'), // 종료일
|
||||
|
||||
'photo_sdate' => $this->request->getGet('photo_sdate'), // 촬영완료일자 시작일
|
||||
'photo_edate' => $this->request->getGet('photo_edate'), // 촬영완료일자 종료일
|
||||
|
||||
'record_sdate' => $this->request->getGet('record_sdate'), // 녹취완료일자 시작일
|
||||
'record_edate' => $this->request->getGet('record_edate'), // 녹취완료일자 종료일
|
||||
'rec_yn' => $this->request->getGet('rec_yn'), // 녹취완료여부
|
||||
|
||||
'bonbu' => $this->request->getGet('bonbu'), // 본부
|
||||
'team' => $this->request->getGet('team'), // 팀
|
||||
'user' => $this->request->getGet('user'), // 담당자
|
||||
|
||||
'sido' => $this->request->getGet('sido'), // 시도
|
||||
'gugun' => $this->request->getGet('gugun'), // 시군구
|
||||
'dong' => $this->request->getGet('dong'), // 읍면동
|
||||
|
||||
'srchType' => $this->request->getGet('srchType'), // 검색유형
|
||||
'srchTxt' => $this->request->getGet('srchTxt'), // 검색어
|
||||
];
|
||||
|
||||
$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 = [
|
||||
'rcpt_atclno' => $this->request->getGet('rcpt_atclno'), // 매물ID
|
||||
|
||||
'sdate' => $this->request->getGet('sdate'), // 시작일
|
||||
'edate' => $this->request->getGet('edate'), // 종료일
|
||||
|
||||
'photo_sdate' => $this->request->getGet('photo_sdate'), // 촬영완료일자 시작일
|
||||
'photo_edate' => $this->request->getGet('photo_edate'), // 촬영완료일자 종료일
|
||||
|
||||
'record_sdate' => $this->request->getGet('record_sdate'), // 녹취완료일자 시작일
|
||||
'record_edate' => $this->request->getGet('record_edate'), // 녹취완료일자 종료일
|
||||
'rec_yn' => $this->request->getGet('rec_yn'), // 녹취완료여부
|
||||
|
||||
'bonbu' => $this->request->getGet('bonbu'), // 본부
|
||||
'team' => $this->request->getGet('team'), // 팀
|
||||
'user' => $this->request->getGet('user'), // 담당자
|
||||
|
||||
'sido' => $this->request->getGet('sido'), // 시도
|
||||
'gugun' => $this->request->getGet('gugun'), // 시군구
|
||||
'dong' => $this->request->getGet('dong'), // 읍면동
|
||||
|
||||
'srchType' => $this->request->getGet('srchType'), // 검색유형
|
||||
'srchTxt' => $this->request->getGet('srchTxt'), // 검색어
|
||||
];
|
||||
|
||||
$datas = $this->model->getExcelList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$e->getPrevious()->getTraceAsString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 상세화면
|
||||
public function detail($id): string
|
||||
{
|
||||
|
||||
$id = (int) $id;
|
||||
|
||||
if ($id <= 0) {
|
||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
$codes = $this->codeModel->getCodeLists(['TRADE_TYPE', 'RECEIPT_STATUS2', 'RECEIPT_STATUS3', 'SMS_MSG_TYPE']); // 코드조회
|
||||
$bonbu = $this->model->getBonbuList();
|
||||
$team = $this->model->getTeamList();
|
||||
|
||||
$data = $this->model->getDetail($id);
|
||||
$history = $this->model->getHistory($id);
|
||||
|
||||
$aptGround = $this->model->getAptGround($data['rcpt_dong']);
|
||||
|
||||
// 시간대별통계
|
||||
$tmCount = $this->model->getUsrRsrvDateTmCount($id);
|
||||
|
||||
$this->data['codes'] = $codes;
|
||||
$this->data['bonbu'] = $bonbu;
|
||||
$this->data['team'] = $team;
|
||||
|
||||
$this->data['data'] = $data;
|
||||
$this->data['history'] = $history;
|
||||
|
||||
$this->data['tmCount'] = $tmCount;
|
||||
|
||||
return view("pages/article/record/detail", $this->data);
|
||||
}
|
||||
}
|
||||
1336
app/Models/article/DeptModel.php
Normal file
1336
app/Models/article/DeptModel.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -187,8 +187,8 @@ class ReceiptModel extends Model
|
||||
|
||||
$builder->where('a.rcpt_tm >= DATE_ADD(CURDATE(), INTERVAL -3 MONTH)', null, false);
|
||||
|
||||
if (!empty($data['atcl_no'])) {
|
||||
$builder->where('a.rcpt_atclno', $data['atcl_no']);
|
||||
if (!empty($data['rcpt_atclno'])) {
|
||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||
} else {
|
||||
if ($data['schDateGb'] == '1') {
|
||||
$builder->where('a.rcpt_tm >=', $data['sdate'] . ' 00:00:00');
|
||||
@@ -515,8 +515,8 @@ class ReceiptModel extends Model
|
||||
|
||||
$builder->where('a.rcpt_tm >= DATE_ADD(CURDATE(), INTERVAL -3 MONTH)', null, false);
|
||||
|
||||
if (!empty($data['atcl_no'])) {
|
||||
$builder->where('a.rcpt_atclno', $data['atcl_no']);
|
||||
if (!empty($data['rcpt_atclno'])) {
|
||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||
} else {
|
||||
if ($data['schDateGb'] == '1') {
|
||||
$builder->where('a.rcpt_tm >=', $data['sdate'] . ' 00:00:00');
|
||||
@@ -791,8 +791,8 @@ class ReceiptModel extends Model
|
||||
|
||||
$builder->where('a.rcpt_tm >= DATE_ADD(CURDATE(), INTERVAL -3 MONTH)', null, false);
|
||||
|
||||
if (!empty($data['atcl_no'])) {
|
||||
$builder->where('a.rcpt_atclno', $data['atcl_no']);
|
||||
if (!empty($data['rcpt_atclno'])) {
|
||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||
} else {
|
||||
if ($data['schDateGb'] == '1') {
|
||||
$builder->where('a.rcpt_tm >=', $data['sdate'] . ' 00:00:00');
|
||||
|
||||
962
app/Models/article/RecordModel.php
Normal file
962
app/Models/article/RecordModel.php
Normal file
@@ -0,0 +1,962 @@
|
||||
<?php
|
||||
namespace App\Models\article;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class RecordModel 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)
|
||||
{
|
||||
$usr_sq = session('usr_sq');
|
||||
$usr_level = session('usr_level');
|
||||
$dept_sq = session('dept_sq');
|
||||
|
||||
$builder = $this->db->table('receipt a');
|
||||
|
||||
$builder->select("COUNT(*) AS cnt", false);
|
||||
|
||||
$builder->join('result b', 'b.rcpt_sq = a.rcpt_sq', 'inner');
|
||||
$builder->join('region_codes c', 'a.rcpt_dong = c.region_cd', 'inner');
|
||||
$builder->join('departments d', 'b.dept_sq = d.dept_sq', 'left');
|
||||
$builder->join('users u', 'b.usr_sq = u.usr_sq', 'left');
|
||||
|
||||
$builder->where('a.rcpt_tm >= DATE_ADD(CURDATE(), INTERVAL -3 MONTH)', null, false);
|
||||
if (in_array($usr_level, ['4', '40'])) {
|
||||
if (!empty($child_dept)) {
|
||||
$builder->whereIn('b.dept_sq', $child_dept);
|
||||
} else {
|
||||
$builder->where('b.usr_sq', $usr_sq);
|
||||
}
|
||||
}
|
||||
|
||||
$builder->where('b.req_rec_yn', 'Y');
|
||||
|
||||
if (!empty($data['rcpt_atclno'])) {
|
||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||
} else {
|
||||
|
||||
// 접수기간
|
||||
if (!empty($data['sdate'])) {
|
||||
$builder->where('a.insert_tm >=', $data['sdate'] . ' 00:00:00');
|
||||
}
|
||||
|
||||
if (!empty($data['edate'])) {
|
||||
$builder->where('a.insert_tm <=', $data['edate'] . ' 23:59:59');
|
||||
}
|
||||
|
||||
//
|
||||
if (!empty($data['photo_sdate'])) {
|
||||
$builder->where('b.photo_save_dt >=', $data['photo_sdate'] . ' 00:00:00');
|
||||
}
|
||||
|
||||
if (!empty($data['photo_edate'])) {
|
||||
$builder->where('b.photo_save_dt <=', $data['photo_edate'] . ' 23:59:59');
|
||||
}
|
||||
|
||||
if (!empty($data['record_sdate'])) {
|
||||
$builder->where('b.record_cplt_dt >=', $data['record_sdate'] . ' 00:00:00');
|
||||
}
|
||||
|
||||
if (!empty($data['record_edate'])) {
|
||||
$builder->where('b.record_cplt_dt <=', $data['record_edate'] . ' 23:59:59');
|
||||
}
|
||||
|
||||
// 녹취완료여부
|
||||
if (!empty($data['rec_yn'])) {
|
||||
if ($data['rec_yn'] == "Y") {
|
||||
$builder->where('b.rec_yn', $data['rec_yn']);
|
||||
$builder->whereNotIn('b.result_cd1', [40, 70]);
|
||||
} else {
|
||||
$builder->where('b.rec_yn', $data['rec_yn']);
|
||||
$builder->whereIn('b.result_cd1', [40, 70]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 지역
|
||||
if (!empty($data['dong'])) {
|
||||
$builder->where('a.rcpt_dong', $data['dong']);
|
||||
} else {
|
||||
if (!empty($data['gugun'])) {
|
||||
$builder->like('a.rcpt_gugun', substr($data['gugun'], 0, 5), 'after');
|
||||
} else {
|
||||
if (!empty($data['sido'])) {
|
||||
$builder->like('a.rcpt_gugun', substr($data['sido'], 0, 2), 'after');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 관할조직
|
||||
if (!empty($data['bonbu'])) {
|
||||
$builder->where('d.pdept_sq', $data['bonbu']);
|
||||
}
|
||||
|
||||
if (!empty($data['team'])) {
|
||||
$builder->where('d.dept_sq', $data['team']);
|
||||
}
|
||||
|
||||
if (!empty($data['user'])) {
|
||||
$builder->where('d.usr_sq', $data['user']);
|
||||
}
|
||||
|
||||
// 검색어
|
||||
if (!empty($data['srchTxt'])) {
|
||||
if ($data['srchType'] == "1") {
|
||||
$builder->groupStart()
|
||||
->like('a.agent_nm', $data['srchTxt'])
|
||||
->orLike('a.sellr_nm', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
} else if ($data['srchType'] == "2") {
|
||||
$builder->groupStart()
|
||||
->like('b.rec_nm', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
} else if ($data['srchType'] == "3") {
|
||||
$builder->groupStart()
|
||||
->like('b.rec_tel', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
} else {
|
||||
$builder->groupStart()
|
||||
->like('a.agent_nm', $data['srchTxt'])
|
||||
->orLike('a.sellr_nm', $data['srchTxt'])
|
||||
->orLike('b.rec_nm', $data['srchTxt'])
|
||||
->orLike('b.rec_tel', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$row = $builder->get()->getRowArray();
|
||||
return (int) ($row['cnt'] ?? 0);
|
||||
|
||||
}
|
||||
|
||||
public function getResultList($start, $end, $data)
|
||||
{
|
||||
$usr_sq = session('usr_sq');
|
||||
$usr_level = session('usr_level');
|
||||
$dept_sq = session('dept_sq');
|
||||
|
||||
|
||||
$builder = $this->db->table('receipt a');
|
||||
|
||||
$builder->select("a.rcpt_sq
|
||||
,a.comp_sq
|
||||
,a.rcpt_rating
|
||||
,a.rcpt_key
|
||||
,a.rcpt_atclno
|
||||
,a.rcpt_type
|
||||
,a.rcpt_product
|
||||
,a.rcpt_product_nm
|
||||
,a.rcpt_product_area
|
||||
,a.rcpt_product_price
|
||||
,a.rcpt_product_info1
|
||||
,a.rcpt_product_info2
|
||||
,a.rcpt_product_info3
|
||||
,a.rcpt_product_info4
|
||||
,a.rcpt_product_info5
|
||||
,a.rcpt_office
|
||||
,(CASE WHEN a.rcpt_agent IS NULL THEN 'N' ELSE 'Y' END) as rcpt_agent
|
||||
,a.rcpt_sido
|
||||
,a.rcpt_gugun
|
||||
,a.rcpt_dong
|
||||
,a.rcpt_hscp_nm
|
||||
,a.rcpt_floor
|
||||
,a.rcpt_tm
|
||||
,a.rcpt_stat
|
||||
,a.rcpt_x
|
||||
,a.rcpt_y
|
||||
,a.cust_nm
|
||||
,a.cust_tel1
|
||||
,a.cust_tel2
|
||||
,a.cust_zip
|
||||
,a.cust_addr1
|
||||
,a.cust_addr2
|
||||
,a.remark
|
||||
,a.agent_id
|
||||
,a.agent_nm
|
||||
,a.agent_head
|
||||
,a.agent_head_tel
|
||||
,a.agent_contact
|
||||
,a.agent_contact_tel
|
||||
,a.agent_fax
|
||||
,DATE_FORMAT(COALESCE(b.rsrv_date, a.rsrv_date), '%Y-%m-%d') AS rsrv_date
|
||||
,COALESCE(b.rsrv_tm_ap, a.rsrv_tm_ap) as rsrv_tm_ap
|
||||
,a.insert_usr
|
||||
,a.insert_tm
|
||||
,a.update_usr
|
||||
,a.update_tm
|
||||
,a.svc_type1
|
||||
,a.svc_type2
|
||||
,a.reconf_yn
|
||||
,b.rsrv_sq
|
||||
,b.dept_sq
|
||||
,b.usr_sq
|
||||
,b.req_rec_yn
|
||||
,b.rec_yn
|
||||
,b.rsrv_tm_hour
|
||||
,b.result_cd1
|
||||
,b.result_cd2
|
||||
,b.result_cd3
|
||||
,b.rec_nm
|
||||
,b.rec_tel
|
||||
,b.result_msg
|
||||
,b.photo_save_dt
|
||||
,b.rsrv_delay_dt
|
||||
,b.rsrv_cplt_dt
|
||||
,b.check_dt
|
||||
,b.check_cplt_dt
|
||||
,b.record_cplt_dt
|
||||
,get_code_name('RECEIPT_STATUS1', substring(a.rcpt_stat, 1, 2)) AS rcpt_stat_nm
|
||||
,c.region_nm as addr
|
||||
,b.result_save_dt
|
||||
,u.usr_nm
|
||||
,d.dept_nm", false);
|
||||
|
||||
$builder->join('result b', 'b.rcpt_sq = a.rcpt_sq', 'inner');
|
||||
$builder->join('region_codes c', 'a.rcpt_dong = c.region_cd', 'inner');
|
||||
$builder->join('departments d', 'b.dept_sq = d.dept_sq', 'left');
|
||||
$builder->join('users u', 'b.usr_sq = u.usr_sq', 'left');
|
||||
|
||||
$builder->where('a.rcpt_tm >= DATE_ADD(CURDATE(), INTERVAL -3 MONTH)', null, false);
|
||||
if (in_array($usr_level, ['4', '40'])) {
|
||||
if (!empty($child_dept)) {
|
||||
$builder->whereIn('b.dept_sq', $child_dept);
|
||||
} else {
|
||||
$builder->where('b.usr_sq', $usr_sq);
|
||||
}
|
||||
}
|
||||
|
||||
$builder->where('b.req_rec_yn', 'Y');
|
||||
|
||||
if (!empty($data['rcpt_atclno'])) {
|
||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||
} else {
|
||||
|
||||
// 접수기간
|
||||
if (!empty($data['sdate'])) {
|
||||
$builder->where('a.insert_tm >=', $data['sdate'] . ' 00:00:00');
|
||||
}
|
||||
|
||||
if (!empty($data['edate'])) {
|
||||
$builder->where('a.insert_tm <=', $data['edate'] . ' 23:59:59');
|
||||
}
|
||||
|
||||
//
|
||||
if (!empty($data['photo_sdate'])) {
|
||||
$builder->where('b.photo_save_dt >=', $data['photo_sdate'] . ' 00:00:00');
|
||||
}
|
||||
|
||||
if (!empty($data['photo_edate'])) {
|
||||
$builder->where('b.photo_save_dt <=', $data['photo_edate'] . ' 23:59:59');
|
||||
}
|
||||
|
||||
if (!empty($data['record_sdate'])) {
|
||||
$builder->where('b.record_cplt_dt >=', $data['record_sdate'] . ' 00:00:00');
|
||||
}
|
||||
|
||||
if (!empty($data['record_edate'])) {
|
||||
$builder->where('b.record_cplt_dt <=', $data['record_edate'] . ' 23:59:59');
|
||||
}
|
||||
|
||||
// 녹취완료여부
|
||||
if (!empty($data['rec_yn'])) {
|
||||
if ($data['rec_yn'] == "Y") {
|
||||
$builder->where('b.rec_yn', $data['rec_yn']);
|
||||
$builder->whereNotIn('b.result_cd1', [40, 70]);
|
||||
} else {
|
||||
$builder->where('b.rec_yn', $data['rec_yn']);
|
||||
$builder->whereIn('b.result_cd1', [40, 70]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 지역
|
||||
if (!empty($data['dong'])) {
|
||||
$builder->where('a.rcpt_dong', $data['dong']);
|
||||
} else {
|
||||
if (!empty($data['gugun'])) {
|
||||
$builder->like('a.rcpt_gugun', substr($data['gugun'], 0, 5), 'after');
|
||||
} else {
|
||||
if (!empty($data['sido'])) {
|
||||
$builder->like('a.rcpt_gugun', substr($data['sido'], 0, 2), 'after');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 관할조직
|
||||
if (!empty($data['bonbu'])) {
|
||||
$builder->where('d.pdept_sq', $data['bonbu']);
|
||||
}
|
||||
|
||||
if (!empty($data['team'])) {
|
||||
$builder->where('d.dept_sq', $data['team']);
|
||||
}
|
||||
|
||||
if (!empty($data['user'])) {
|
||||
$builder->where('d.usr_sq', $data['user']);
|
||||
}
|
||||
|
||||
// 검색어
|
||||
if (!empty($data['srchTxt'])) {
|
||||
if ($data['srchType'] == "1") {
|
||||
$builder->groupStart()
|
||||
->like('a.agent_nm', $data['srchTxt'])
|
||||
->orLike('a.sellr_nm', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
} else if ($data['srchType'] == "2") {
|
||||
$builder->groupStart()
|
||||
->like('b.rec_nm', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
} else if ($data['srchType'] == "3") {
|
||||
$builder->groupStart()
|
||||
->like('b.rec_tel', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
} else {
|
||||
$builder->groupStart()
|
||||
->like('a.agent_nm', $data['srchTxt'])
|
||||
->orLike('a.sellr_nm', $data['srchTxt'])
|
||||
->orLike('b.rec_nm', $data['srchTxt'])
|
||||
->orLike('b.rec_tel', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$builder->orderBy('a.rcpt_atclno DESC');
|
||||
|
||||
$builder->limit($end, $start);
|
||||
|
||||
$rows = $builder->get()->getResultArray();
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
|
||||
// 엑셀다운로드
|
||||
public function getExcelList($data)
|
||||
{
|
||||
$usr_sq = session('usr_sq');
|
||||
$usr_level = session('usr_level');
|
||||
$dept_sq = session('dept_sq');
|
||||
|
||||
$builder = $this->db->table('receipt a');
|
||||
|
||||
$builder->select("
|
||||
get_code_name('RECEIPT_STATUS1', b.result_cd1) AS '현재상태',
|
||||
CASE WHEN b.result_cd1 = '90' THEN get_code_name('RECEIPT_STATUS2', b.result_cd2) ELSE '' END AS '매물ID',
|
||||
CASE WHEN b.result_cd1 = '90' THEN get_code_name('RECEIPT_STATUS3', b.result_cd3) ELSE '' END AS '접수(등록)일자',
|
||||
a.rcpt_atclno AS '예약일자',
|
||||
a.insert_tm '방문희망시간',
|
||||
CONCAT(b.rsrv_date, ' ', b.rsrv_tm_ap) AS '촬영완료일자',
|
||||
b.rsrv_tm_hour AS '중개사명',
|
||||
b.photo_save_dt AS '대표전화',
|
||||
'' AS '담당자전화',
|
||||
a.agent_head_tel AS '연락가능전화',
|
||||
'' AS '중개사ID',
|
||||
a.rcpt_cpid 'CP ID',
|
||||
CASE
|
||||
WHEN IFNULL(a.rcpt_jibun_addr, '') = '' THEN
|
||||
CASE
|
||||
WHEN IFNULL(a.rcpt_hscp_nm, '') = '' THEN
|
||||
CONCAT(c.region_nm, ' ', a.rcpt_dtl_addr, ' ', a.rcpt_ho)
|
||||
ELSE
|
||||
CONCAT(c.region_nm, ' ', a.rcpt_hscp_nm, ' ', a.rcpt_dtl_addr, ' ', a.rcpt_ho)
|
||||
END
|
||||
ELSE
|
||||
CASE
|
||||
WHEN IFNULL(a.rcpt_li_addr, '') != '' THEN
|
||||
CONCAT(c.region_nm, ' ', a.rcpt_li_addr, ' ', a.rcpt_jibun_addr, ' ', a.rcpt_etc_addr)
|
||||
ELSE
|
||||
CONCAT(c.region_nm, ' ', a.rcpt_jibun_addr, ' ', a.rcpt_etc_addr)
|
||||
END
|
||||
END AS '주소',
|
||||
CONCAT(a.rcpt_floor, '/', a.rcpt_floor2) AS '층',
|
||||
a.rcpt_product_nm AS '매물종류',
|
||||
a.rcpt_product_info1 AS '거래구분',
|
||||
d.dept_nm AS '관할조직(팀)',
|
||||
u.usr_nm AS '방문담당',
|
||||
a.rcpt_exps_type AS '노출옵션',
|
||||
CASE (SELECT COUNT(1) FROM result_imgs WHERE rsrv_sq = b.rsrv_sq AND img_type = 'I1' AND use_yn = 'Y')
|
||||
WHEN 0 THEN 'N' ELSE 'Y' END AS '홍보확인서',
|
||||
a.exp_movie_yn AS '동영상촬영',
|
||||
a.exp_spc_yn AS '면적확인',
|
||||
b.resYn AS '거주여부',
|
||||
(CASE (SELECT 'x' FROM result_record WHERE rsrv_sq = b.rsrv_sq AND use_yn = 'Y')
|
||||
WHEN 'x' THEN 'Y' ELSE 'N' END) AS '녹취여부',
|
||||
a.excls_spc AS '전용면적',
|
||||
a.sply_spc AS '공급면적',
|
||||
a.cupnNo AS '쿠폰번호',
|
||||
a.image_360_yn AS '360촬영여부',
|
||||
a.rcpt_y AS '경도',
|
||||
a.rcpt_y AS '위도',
|
||||
a.check_list_img_yn AS '체크리스트',
|
||||
", false);
|
||||
|
||||
$builder->join('result b', 'b.rcpt_sq = a.rcpt_sq', 'inner');
|
||||
$builder->join('region_codes c', 'a.rcpt_dong = c.region_cd', 'inner');
|
||||
$builder->join('departments d', 'b.dept_sq = d.dept_sq', 'left');
|
||||
$builder->join('users u', 'b.usr_sq = u.usr_sq', 'left');
|
||||
|
||||
|
||||
$login_dept_info = $this->getDeptDetail($dept_sq); // 로그인 사용자 소속부서정보
|
||||
$child_dept = []; // 하위조직 목록
|
||||
if (strcmp($usr_level, '40') == 0) {
|
||||
$child = $this->getChildDept($login_dept_info);
|
||||
if (!empty($child)) {
|
||||
foreach ($child as $child) {
|
||||
$child_dept[] = $child['dept_sq'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((int) $usr_level >= 4 && $usr_level != '45') {
|
||||
if (!empty($child_dept)) {
|
||||
$builder->whereIn('b.dept_sq', $child_dept);
|
||||
} else {
|
||||
$builder->where('b.usr_sq', $usr_sq);
|
||||
}
|
||||
}
|
||||
|
||||
$builder->where('a.rcpt_tm >= DATE_ADD(CURDATE(), INTERVAL -3 MONTH)', null, false);
|
||||
|
||||
if (!empty($data['rcpt_atclno'])) {
|
||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||
} else {
|
||||
if ($data['schDateGb'] == '1') {
|
||||
$builder->where('a.rcpt_tm >=', $data['sdate'] . ' 00:00:00');
|
||||
$builder->where('a.rcpt_tm <=', $data['edate'] . ' 23:59:59');
|
||||
} else if ($data['schDateGb'] == '2') {
|
||||
$builder->where('b.rsrv_date >=', $data['sdate'] . ' 00:00:00');
|
||||
$builder->where('b.rsrv_date <=', $data['edate'] . ' 23:59:59');
|
||||
}
|
||||
|
||||
// 지역
|
||||
if (!empty($data['dong'])) {
|
||||
$builder->where('a.rcpt_dong', $data['dong']);
|
||||
} else {
|
||||
if (!empty($data['gugun'])) {
|
||||
$builder->like('a.rcpt_gugun', substr($data['gugun'], 0, 5), 'after');
|
||||
} else {
|
||||
if (!empty($data['sido'])) {
|
||||
$builder->like('a.rcpt_gugun', substr($data['sido'], 0, 2), 'after');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 관할조직
|
||||
if (!empty($data['bonbu'])) {
|
||||
$builder->where('d.pdept_sq', $data['bonbu']);
|
||||
}
|
||||
|
||||
if (!empty($data['team'])) {
|
||||
$builder->where('d.dept_sq', $data['team']);
|
||||
}
|
||||
|
||||
if (!empty($data['user'])) {
|
||||
$builder->where('d.usr_sq', $data['user']);
|
||||
}
|
||||
|
||||
// 거래구분
|
||||
if (!empty($data['rcpt_product_info1'])) {
|
||||
$builder->where('a.rcpt_product_info1', $data['rcpt_product_info1']);
|
||||
}
|
||||
|
||||
// 현재상태
|
||||
if (!empty($data['rcpt_stat1'])) {
|
||||
$builder->like('a.rcpt_stat', $data['rcpt_stat1'], 'after');
|
||||
}
|
||||
|
||||
if (!empty($data['rcpt_stat2'])) {
|
||||
$builder->like('a.rcpt_stat', $data['rcpt_stat2'], 'after');
|
||||
}
|
||||
|
||||
if (!empty($data['rcpt_stat3'])) {
|
||||
$builder->where('a.rcpt_stat', $data['rcpt_stat3']);
|
||||
}
|
||||
|
||||
// 중개사명
|
||||
if (!empty($data['agent_nm'])) {
|
||||
$builder->like('a.agent_nm', $data['agent_nm'], 'both');
|
||||
}
|
||||
|
||||
// 동영상촬영여부
|
||||
if (!empty($data['exp_movie_yn'])) {
|
||||
$builder->where('a.exp_movie_yn', $data['exp_movie_yn']);
|
||||
}
|
||||
|
||||
// 홍보확인서여부
|
||||
if ($data['conf_img_yn'] == 'Y') {
|
||||
$builder->where('e.rsrv_sq IS NOT NULL', null, false);
|
||||
} else if ($data['conf_img_yn'] == 'N') {
|
||||
$builder->where('e.rsrv_sq IS NULL', null, false);
|
||||
}
|
||||
|
||||
// 분양권
|
||||
if ($data['parcel_out_yn'] == 'Y') {
|
||||
$builder->where('a.parcel_out_yn', 'Y');
|
||||
} else if ($data['parcel_out_yn'] == 'N') {
|
||||
$builder->where('a.parcel_out_yn', 'N');
|
||||
}
|
||||
|
||||
// CP ID
|
||||
if (!empty($data['rcpt_cpid'])) {
|
||||
if (strcmp($data['rcpt_cpid'], 'naver') == 0) {
|
||||
$builder->where('a.rcpt_cpid =', '');
|
||||
} else if (strcmp($data['rcpt_cpid'], 'cleancente') == 0) {
|
||||
$builder->where("a.rcpt_cpid !=", "");
|
||||
} else {
|
||||
$builder->where('a.rcpt_cpid', $data['rcpt_cpid']);
|
||||
}
|
||||
}
|
||||
|
||||
// 매물종류
|
||||
if (!empty($data['rcpt_product'])) {
|
||||
$builder->where('a.parcel_out_yn', $data['rcpt_product']);
|
||||
}
|
||||
|
||||
// 면적확인
|
||||
if ($data['exp_spc_yn'] == 'Y') {
|
||||
$builder->where('a.parcel_out_yn', 'Y');
|
||||
} else if ($data['exp_spc_yn'] == 'N') {
|
||||
$builder->where('a.parcel_out_yn', 'N');
|
||||
}
|
||||
|
||||
// 체크리스트
|
||||
if ($data['check_list_img_yn'] == 'Y') {
|
||||
$builder->where('a.check_list_img_yn', 'Y');
|
||||
} else if ($data['check_list_img_yn'] == 'N') {
|
||||
$builder->where('a.check_list_img_yn', 'N');
|
||||
}
|
||||
|
||||
// 평면도유무
|
||||
if ($data['ground_plan_yn'] == 'Y') {
|
||||
$builder->where('exists (select \'x\' from result_imgs imgs where imgs.rsrv_sq = b.rsrv_sq and imgs.img_type = \'I5\' and imgs.use_yn=\'Y\')', NULL, FALSE);
|
||||
} else if ($data['ground_plan_yn'] == 'N') {
|
||||
$builder->where('not exists (select \'x\' from result_imgs imgs where imgs.rsrv_sq = b.rsrv_sq and imgs.img_type = \'I5\' and imgs.use_yn=\'Y\')', NULL, FALSE);
|
||||
}
|
||||
|
||||
// 평면도요청
|
||||
if (!empty($data['ground_plan'])) {
|
||||
$builder->where('a.ground_plan', $data['ground_plan']);
|
||||
}
|
||||
|
||||
// 직거래
|
||||
if ($data['direct_trad_yn'] == "Y") {
|
||||
$builder->where('a.direct_trad_yn', 'Y');
|
||||
} else if ($data['direct_trad_yn'] == "N") {
|
||||
$builder->where('a.direct_trad_yn', 'N');
|
||||
}
|
||||
|
||||
// 360촬영여부
|
||||
if ($data['image_360_yn'] == "Y") {
|
||||
$builder->where('a.image_360_yn', 'Y');
|
||||
} else if ($data['image_360_yn'] == "N") {
|
||||
$builder->where('a.image_360_yn', 'N');
|
||||
}
|
||||
|
||||
if (!empty($data['srchTxt'])) {
|
||||
// 중개사
|
||||
if ($data['srchType'] == '1') {
|
||||
$builder->groupStart()
|
||||
->like('a.agent_nm', $data['srchTxt'])
|
||||
->orLike('a.sellr_nm', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
|
||||
// 주소
|
||||
} else if ($data['srchType'] == '2') {
|
||||
$builder->groupStart()
|
||||
->like('a.rcpt_dtl_addr', $data['srchTxt'])
|
||||
->orLike('a.rcpt_hscp_nm', $data['srchTxt'])
|
||||
->orLike('a.rcpt_jibun_addr', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
|
||||
// 사업자번호
|
||||
} else if ($data['srchType'] == '3') {
|
||||
$builder->like('a.image_360_yn', $data['srchTxt'], 'both');
|
||||
} else {
|
||||
$builder->groupStart()
|
||||
->like('a.agent_nm', $data['srchTxt'])
|
||||
->orLike('a.sellr_nm', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
|
||||
$builder->groupStart()
|
||||
->like('a.rcpt_dtl_addr', $data['srchTxt'])
|
||||
->orLike('a.rcpt_hscp_nm', $data['srchTxt'])
|
||||
->orLike('a.rcpt_jibun_addr', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
|
||||
$builder->like('a.image_360_yn', $data['srchTxt'], 'both');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$builder->orderBy('a.rcpt_atclno', 'DESC');
|
||||
|
||||
return $builder->get()->getResultArray();
|
||||
}
|
||||
|
||||
// 상세
|
||||
public function getDetail($id)
|
||||
{
|
||||
|
||||
$builder = $this->db->table('receipt a');
|
||||
|
||||
$builder->select("
|
||||
a.rcpt_sq
|
||||
,a.comp_sq
|
||||
,a.excls_spc
|
||||
,a.rcpt_rating
|
||||
,a.rcpt_key
|
||||
,a.rcpt_atclno
|
||||
,a.rcpt_type
|
||||
,a.rcpt_product
|
||||
,a.rcpt_product_nm
|
||||
,a.rcpt_product_area
|
||||
,a.rcpt_product_price
|
||||
, a.rcpt_deal_type
|
||||
,a.rcpt_product_info1
|
||||
,a.rcpt_product_info2
|
||||
,a.rcpt_product_info3
|
||||
,a.rcpt_product_info4
|
||||
,a.rcpt_product_info5
|
||||
,a.rcpt_office
|
||||
,(CASE WHEN a.rcpt_agent IS NULL THEN 'N' ELSE 'Y' END) as rcpt_agent
|
||||
,a.rcpt_sido
|
||||
,a.rcpt_gugun
|
||||
,a.rcpt_dong
|
||||
,a.rcpt_dtl_addr
|
||||
,a.rcpt_li_addr
|
||||
,a.rcpt_jibun_addr
|
||||
,a.rcpt_etc_addr
|
||||
,a.rcpt_ref_addr
|
||||
,a.rcpt_ho
|
||||
,a.rcpt_hscp_nm
|
||||
,a.rcpt_floor
|
||||
,a.rcpt_floor2
|
||||
,a.chg_floor_yn
|
||||
,a.rcpt_tm
|
||||
,a.rcpt_stat
|
||||
,a.rcpt_x
|
||||
,a.rcpt_y
|
||||
,a.rcpt_living_yn
|
||||
,a.cust_nm
|
||||
,a.cust_tel1
|
||||
,a.cust_tel2
|
||||
,a.cust_zip
|
||||
,a.cust_addr1
|
||||
,a.cust_addr2
|
||||
,a.remark rcpt_remark
|
||||
, a.rcpt_cpid
|
||||
,a.agent_id
|
||||
,a.agent_nm
|
||||
,a.agent_head
|
||||
,a.agent_head_tel
|
||||
,a.agent_contact
|
||||
,a.agent_contact_tel
|
||||
,a.agent_fax
|
||||
,a.agent_tel
|
||||
,a.excls_spc
|
||||
,a.excls_spc1
|
||||
,a.excls_spc2
|
||||
,a.sply_spc
|
||||
,a.share_spc
|
||||
,a.share_spc1
|
||||
,a.share_spc2
|
||||
,a.share_spc3
|
||||
,a.share_spc4
|
||||
,a.share_spc5
|
||||
,a.room_cnt
|
||||
,a.tot_spc
|
||||
,a.tot_spc1
|
||||
,a.tot_spc2
|
||||
,a.grnd_spc
|
||||
,a.grnd_spc1
|
||||
,a.grnd_spc2
|
||||
,a.grnd_spc3
|
||||
,a.grnd_spc4
|
||||
,a.grnd_spc5
|
||||
,a.spc_stat
|
||||
,a.exp_spc_yn
|
||||
,DATE_FORMAT(COALESCE(b.rsrv_date, a.rsrv_date), '%Y-%m-%d') AS rsrv_date
|
||||
,COALESCE(b.rsrv_tm_ap, a.rsrv_tm_ap) as rsrv_tm_ap
|
||||
,a.insert_usr
|
||||
,a.insert_tm
|
||||
,a.update_usr
|
||||
,a.update_tm
|
||||
,a.svc_type1
|
||||
,a.svc_type2
|
||||
,a.reconf_yn
|
||||
,a.cupnNo
|
||||
,b.rsrv_sq
|
||||
,b.dept_sq
|
||||
,b.usr_sq
|
||||
,b.req_rec_yn
|
||||
,b.rec_yn
|
||||
,b.rec_tel
|
||||
,b.rec_nm
|
||||
,b.remark
|
||||
,b.rsrv_tm_hour
|
||||
,b.result_cd1
|
||||
,get_code_name('RECEIPT_STATUS1', b.result_cd1) AS result_cd1_nm
|
||||
,b.result_cd2
|
||||
,get_code_name('RECEIPT_STATUS2', b.result_cd2) AS result_cd2_nm
|
||||
,b.result_cd3
|
||||
,get_code_name('RECEIPT_STATUS3', b.result_cd3) AS result_cd3_nm
|
||||
,b.result_msg
|
||||
,b.rsrv_save_dt
|
||||
,b.photo_save_dt
|
||||
,DATE_FORMAT(b.photo_save_dt, '%Y-%m-%d') as photo_save_dt_dt
|
||||
,DATE_FORMAT(b.photo_save_dt, '%H:%i:%s') as photo_save_dt_tm
|
||||
,b.assign_save_dt
|
||||
,b.result_save_dt
|
||||
,b.request_msg
|
||||
,b.rsrv_delay_dt
|
||||
,DATE_FORMAT(b.rsrv_delay_dt, '%Y-%m-%d') as rsrv_delay_dt_dt
|
||||
,DATE_FORMAT(b.rsrv_delay_dt, '%H:%i:%s') as rsrv_delay_dt_tm
|
||||
,b.rsrv_cplt_dt
|
||||
,DATE_FORMAT(b.rsrv_cplt_dt, '%Y-%m-%d') as rsrv_cplt_dt_dt
|
||||
,DATE_FORMAT(b.rsrv_cplt_dt, '%H:%i:%s') as rsrv_cplt_dt_tm
|
||||
,b.check_dt
|
||||
,DATE_FORMAT(b.check_dt, '%Y-%m-%d') as check_dt_dt
|
||||
,DATE_FORMAT(b.check_dt, '%H:%i:%s') as check_dt_tm
|
||||
,b.check_cplt_dt
|
||||
,DATE_FORMAT(b.check_cplt_dt, '%Y-%m-%d') as check_cplt_dt_dt
|
||||
,DATE_FORMAT(b.check_cplt_dt, '%H:%i:%s') as check_cplt_dt_tm
|
||||
,b.cancel_dt
|
||||
,DATE_FORMAT(b.cancel_dt, '%Y-%m-%d') as cancel_dt_dt
|
||||
,DATE_FORMAT(b.cancel_dt, '%H:%i:%s') as cancel_dt_tm
|
||||
,b.check_delay_dt
|
||||
,DATE_FORMAT(b.check_delay_dt, '%Y-%m-%d') as check_delay_dt_dt
|
||||
,DATE_FORMAT(b.check_delay_dt, '%H:%i:%s') as check_delay_dt_tm
|
||||
,b.check_fail_dt
|
||||
,DATE_FORMAT(b.check_fail_dt, '%Y-%m-%d') as check_fail_dt_dt
|
||||
,DATE_FORMAT(b.check_fail_dt, '%H:%i:%s') as check_fail_dt_tm
|
||||
,get_code_name('RECEIPT_STATUS3', a.rcpt_stat) AS rcpt_stat_nm
|
||||
,DATE_FORMAT(a.insert_tm, '%Y년 %m월 %d일') as insert_tm2
|
||||
,DATE_FORMAT(a.rsrv_date, '%Y-%m-%d') as rsrv_date2
|
||||
,c.region_nm as addr
|
||||
,c.dept_sq as region_dept_sq
|
||||
,c.usr_sq as region_usr_sq
|
||||
,d.pdept_sq
|
||||
,d.dept_nm
|
||||
,a.rcpt_exps_type
|
||||
,a.exp_photo_yn
|
||||
,a.exp_movie_yn
|
||||
,b.resYn
|
||||
,DATE_ADD(a.insert_tm, INTERVAL +3 MONTH) as months
|
||||
,b.dbUsageAgrYn
|
||||
,a.trade_type
|
||||
, a.rcpt_hscp_no
|
||||
, a.rcpt_ptp_nm
|
||||
, a.rcpt_ptp_no
|
||||
, a.modify_yn
|
||||
, a.ground_plan
|
||||
,a.direct_trad_yn
|
||||
,a.sellr_nm
|
||||
,a.sellr_tel_no
|
||||
,a.virAddr_yn
|
||||
,a.isSiteVRVerification
|
||||
,a.isPromotionApply
|
||||
,DATE_FORMAT(b.vr_check_cplt_dt, '%Y-%m-%d') as vr_check_cplt_dt_dt
|
||||
,DATE_FORMAT(b.vr_check_cplt_dt, '%H:%i:%s') as vr_check_cplt_dt_dm
|
||||
", false);
|
||||
|
||||
$builder->join('result b', 'b.rcpt_sq = a.rcpt_sq', 'inner');
|
||||
$builder->join('region_codes c', 'a.rcpt_dong = c.region_cd', 'inner');
|
||||
$builder->join('departments d', 'b.dept_sq = d.dept_sq', 'left');
|
||||
|
||||
$builder->where('a.rcpt_key', $id);
|
||||
$builder->where('a.insert_tm >= DATE_ADD(CURDATE(), INTERVAL -3 MONTH)', NULL, FALSE);
|
||||
|
||||
|
||||
return $builder->get()->getRowArray();
|
||||
}
|
||||
|
||||
// 정보변경이력
|
||||
public function getHistory($id)
|
||||
{
|
||||
$sql = "SELECT seq" .
|
||||
" ,rcpt_sq" .
|
||||
" ,rcpt_stat" .
|
||||
" ,get_code_name('RECEIPT_STATUS3', rcpt_stat) AS rcpt_stat_nm" .
|
||||
" ,rcpt_stat" .
|
||||
" ,get_code_name('CHANGED_TYPE', changed_type) AS changed_type_nm" .
|
||||
" ,changed_type" .
|
||||
" ,changed_id" .
|
||||
" ,remark" .
|
||||
" ,DATE_FORMAT(changed_tm, '%Y.%m.%d %H:%i:%s') as changed_tm" .
|
||||
" FROM changed_history" .
|
||||
" WHERE rcpt_sq = ?" .
|
||||
" ORDER BY changed_tm DESC";
|
||||
|
||||
$data = [$id];
|
||||
$query = $this->db->query($sql, $data);
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
// 시간대별통계
|
||||
public function getUsrRsrvDateTmCount($id)
|
||||
{
|
||||
$sql = "SELECT b.usr_sq, b.rsrv_date FROM receipt a INNER JOIN result b ON a.rcpt_sq = b.rcpt_sq WHERE a.rcpt_key = ?";
|
||||
$data = [$id];
|
||||
$query = $this->db->query($sql, $data);
|
||||
$row = $query->getRowArray();
|
||||
|
||||
if (!empty($row['usr_sq'])) {
|
||||
$sql2 = "SELECT usr_sq, rsrv_tm_ap, rsrv_tm_hour, COUNT(rsrv_tm_hour) as cnt" .
|
||||
" FROM result" .
|
||||
" WHERE rsrv_date = ?" .
|
||||
" AND usr_sq = ?" .
|
||||
" GROUP BY usr_sq, rsrv_tm_ap, rsrv_tm_hour" .
|
||||
" ORDER BY rsrv_tm_ap, rsrv_tm_hour";
|
||||
|
||||
$data2 = [$row['rsrv_date'], $row['usr_sq']];
|
||||
} else {
|
||||
$sql2 = "SELECT usr_sq, rsrv_tm_ap, rsrv_tm_hour, COUNT(rsrv_tm_hour) as cnt" .
|
||||
" FROM result" .
|
||||
" WHERE rsrv_date = ?" .
|
||||
" AND usr_sq = (SELECT b.usr_sq FROM receipt a, region_codes b WHERE a.rcpt_dong = b.region_cd AND a.rcpt_key = ?)" .
|
||||
" GROUP BY usr_sq, rsrv_tm_ap, rsrv_tm_hour" .
|
||||
" ORDER BY rsrv_tm_ap, rsrv_tm_hour";
|
||||
|
||||
$data2 = [$row['rsrv_date'], $id];
|
||||
}
|
||||
|
||||
$query2 = $this->db->query($sql2, $data2);
|
||||
|
||||
return $query2->getResultArray();
|
||||
}
|
||||
|
||||
public function getAptGround($rcpt_dong)
|
||||
{
|
||||
|
||||
$sql = "SELECT ";
|
||||
$sql .= "* ";
|
||||
$sql .= "FROM apt_ground ";
|
||||
$sql .= "WHERE region_cd = ? ";
|
||||
|
||||
$data = [$rcpt_dong];
|
||||
|
||||
$query = $this->db->query($sql, $data);
|
||||
|
||||
return $query->getResultArray();
|
||||
|
||||
}
|
||||
}
|
||||
1331
app/Views/pages/article/dept/detail.php
Normal file
1331
app/Views/pages/article/dept/detail.php
Normal file
File diff suppressed because it is too large
Load Diff
1048
app/Views/pages/article/dept/lists.php
Normal file
1048
app/Views/pages/article/dept/lists.php
Normal file
File diff suppressed because it is too large
Load Diff
237
app/Views/pages/article/dept/printMap.php
Normal file
237
app/Views/pages/article/dept/printMap.php
Normal file
@@ -0,0 +1,237 @@
|
||||
<?php
|
||||
$cnt = count($listDept);
|
||||
$lati = 0;
|
||||
$long = 0;
|
||||
foreach ($listDept as $dept) {
|
||||
$lati += $dept['rcpt_y'];
|
||||
$long += $dept['rcpt_x'];
|
||||
}
|
||||
$lati = $lati / $cnt;
|
||||
$long = $long / $cnt;
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="ko">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-Language" content="ko">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>지도보기</title>
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no" />
|
||||
<meta name="description" content="ArchitectUI HTML Bootstrap 5 Dashboard Template">
|
||||
|
||||
<script defer src="/architectui/assets/scripts/vendors.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/main.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/demo.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/ladda.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/blockui.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/circle_progress.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/count_up.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/toastr.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/sweet_alerts.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/scrollbar.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/sticky_elements.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/carousel_slider.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/fullcalendar.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/treeview.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/maps.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/rating.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/image_crop.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/guided_tours.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/tables.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/form_validation.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/form_wizard.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/clipboard.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/datepicker.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/input_mask.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/input_select.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/range_slider.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/textarea_autosize.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/toggle_switch.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/chart_js.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/apex_charts.98288b227c064e6a107f.js"></script>
|
||||
<script defer src="/architectui/assets/scripts/sparklines.98288b227c064e6a107f.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<link href="/architectui/assets/styles/vendors.98288b227c064e6a107f.css" rel="stylesheet">
|
||||
<link href="/architectui/assets/styles/main.98288b227c064e6a107f.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
.marker-label {
|
||||
position: absolute;
|
||||
transform: translate(-50%, -100%);
|
||||
background: #fff;
|
||||
border: 1px solid #333;
|
||||
border-radius: 6px;
|
||||
padding: 3px 6px;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
|
||||
pointer-events: none;
|
||||
/* 지도 드래그 방해 안 하게 */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="my-loader-template d-none">
|
||||
<div class="loader bg-transparent no-shadow p-0">
|
||||
<div class="ball-grid-pulse">
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
<div class="bg-white"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="app-container app-theme-white body-tabs-shadow">
|
||||
<div class="app-container">
|
||||
<div class="app-main__outer">
|
||||
<div class="app-main__inner px-4 py-3">
|
||||
<div class="app-page-title">
|
||||
<div class="page-title-wrapper d-flex align-items-center">
|
||||
<div class="page-title-heading">
|
||||
<div class="page-title-icon">
|
||||
<i class="pe-7s-map icon-gradient bg-premium-dark"></i>
|
||||
</div>
|
||||
<div>
|
||||
관할 배정 지도
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ms-auto">
|
||||
<button type="button" class="btn btn-primary" onclick="fn_print();">
|
||||
인쇄하기
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="main-card mb-3 card" id="mapArea">
|
||||
<div class="card-body" style="height: 400px;">
|
||||
<div id="map_view" style="width:100%;height:700px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <script type="text/javascript" src="https://oapi.map.naver.com/openapi/v3/maps.js?ncpClientId=kvyjyj00fp"></script> -->
|
||||
<!-- <script type="text/javascript" src="https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=dtounkwjc5"></script> -->
|
||||
<!-- <script type="text/javascript" src="https://oapi.map.naver.com/openapi/v3/maps.js?ncpClientId=dtounkwjc5"></script> -->
|
||||
<script type="text/javascript" src="https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=dtounkwjc5"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
const tpl = document.querySelector('.my-loader-template');
|
||||
var map;
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
map = new naver.maps.Map('map_view', {
|
||||
center: new naver.maps.LatLng(<?= $lati ?>, <?= $long ?>), //지도의 초기 중심 좌표
|
||||
useStyleMap: true,
|
||||
zoom: 15, //지도의 초기 줌 레벨
|
||||
minZoom: 1, //지도의 최소 줌 레벨
|
||||
mapTypeControl: true, //지도 유형 컨트롤의 표시 여부
|
||||
mapTypeControlOptions: { //지도 유형 컨트롤의 옵션
|
||||
style: naver.maps.MapTypeControlStyle.BUTTON,
|
||||
position: naver.maps.Position.TOP_LEFT
|
||||
},
|
||||
zoomControl: true, //줌 컨트롤의 표시 여부
|
||||
zoomControlOptions: { //줌 컨트롤의 옵션
|
||||
position: naver.maps.Position.TOP_RIGHT
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
<?php reset($listDept);
|
||||
foreach ($listDept as $dept): ?>
|
||||
const pos_<?= $dept['dept_sq'] ?> = new naver.maps.LatLng(<?= $dept['rcpt_y'] ?>, <?= $dept['rcpt_x'] ?>);
|
||||
|
||||
// 기본 마커
|
||||
new naver.maps.Marker({
|
||||
position: pos_<?= $dept['dept_sq'] ?>,
|
||||
map: map,
|
||||
// icon: {
|
||||
// url: HOME_PATH + '/plugin/img/pin.png',
|
||||
// size: new naver.maps.Size(50, 52),
|
||||
// origin: new naver.maps.Point(0, 0),
|
||||
// anchor: new naver.maps.Point(25, 26)
|
||||
// }
|
||||
});
|
||||
|
||||
// 라벨 오버레이(텍스트만)
|
||||
new LabelOverlay({
|
||||
position: pos_<?= $dept['dept_sq'] ?>,
|
||||
text: '<?= $dept['rcpt_atclno'] ?> <?= $dept['rsrv_date'] ?> <?= $dept['rsrv_tm_ap'] ?> <?= $dept['rsrv_tm_hour'] ?>시',
|
||||
map: map
|
||||
});
|
||||
|
||||
<?php endforeach; ?>
|
||||
});
|
||||
|
||||
|
||||
function LabelOverlay(options) {
|
||||
this._position = options.position;
|
||||
this._text = options.text;
|
||||
this._map = options.map;
|
||||
this.setMap(this._map);
|
||||
}
|
||||
LabelOverlay.prototype = new naver.maps.OverlayView();
|
||||
|
||||
LabelOverlay.prototype.onAdd = function () {
|
||||
const el = document.createElement('div');
|
||||
el.className = 'marker-label';
|
||||
el.textContent = this._text;
|
||||
this._el = el;
|
||||
|
||||
const overlayLayer = this.getPanes().overlayLayer;
|
||||
overlayLayer.appendChild(el);
|
||||
};
|
||||
|
||||
LabelOverlay.prototype.draw = function () {
|
||||
const projection = this.getProjection();
|
||||
const point = projection.fromCoordToOffset(this._position);
|
||||
|
||||
// 라벨을 마커 위로 올리기
|
||||
this._el.style.left = point.x + 'px';
|
||||
this._el.style.top = (point.y - 30) + 'px';
|
||||
};
|
||||
|
||||
LabelOverlay.prototype.onRemove = function () {
|
||||
if (this._el && this._el.parentNode) this._el.parentNode.removeChild(this._el);
|
||||
this._el = null;
|
||||
};
|
||||
|
||||
|
||||
// 인쇄하기
|
||||
function fn_print() {
|
||||
var initBody;
|
||||
window.onbeforeprint = function () {
|
||||
initBody = document.body.innerHTML;
|
||||
document.body.innerHTML = document.getElementById('mapArea').innerHTML;
|
||||
};
|
||||
window.onafterprint = function () {
|
||||
document.body.innerHTML = initBody;
|
||||
};
|
||||
window.print();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -16,7 +16,7 @@ $long = $long / $cnt;
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-Language" content="ko">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>컨펌스 로그인</title>
|
||||
<title>지도보기</title>
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no" />
|
||||
<meta name="description" content="ArchitectUI HTML Bootstrap 5 Dashboard Template">
|
||||
|
||||
@@ -401,6 +401,10 @@ $usr_nm = session('usr_nm');
|
||||
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
const bonbuArr = <?= json_encode($bonbu, JSON_UNESCAPED_UNICODE); ?>;
|
||||
const teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>;
|
||||
const userArr = <?= json_encode($user, JSON_UNESCAPED_UNICODE); ?>;
|
||||
|
||||
const date = new Date();
|
||||
var table;
|
||||
|
||||
@@ -636,7 +640,7 @@ $usr_nm = session('usr_nm');
|
||||
{ data: null, render: fn_prd_render },
|
||||
{ data: 'rcpt_product_info1' },
|
||||
<?php if ($usr_level != "45"): ?>
|
||||
{ data: 'dept_nm' },
|
||||
{ data: 'dept_nm' },
|
||||
{ data: 'usr_nm' },
|
||||
<?php endif; ?>
|
||||
{ data: 'parcel_out_yn' },
|
||||
@@ -665,7 +669,7 @@ $usr_nm = session('usr_nm');
|
||||
if (!rowData) return;
|
||||
|
||||
const rcpt_atclno = rowData.rcpt_atclno;
|
||||
location.href = "<?= site_url('article/receipt/detail') ?>/" + rcpt_atclno;
|
||||
location.href = "<?= site_url('article/dept/detail') ?>/" + rcpt_atclno;
|
||||
});
|
||||
|
||||
|
||||
|
||||
1331
app/Views/pages/article/record/detail.php
Normal file
1331
app/Views/pages/article/record/detail.php
Normal file
File diff suppressed because it is too large
Load Diff
613
app/Views/pages/article/record/lists.php
Normal file
613
app/Views/pages/article/record/lists.php
Normal file
@@ -0,0 +1,613 @@
|
||||
<?php
|
||||
$usr_level = session('usr_level');
|
||||
$usr_sq = session('usr_sq');
|
||||
$usr_nm = session('usr_nm');
|
||||
|
||||
?>
|
||||
<?= $this->extend('layouts/main') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
<style>
|
||||
th {
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
td {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#resultList tbody tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
#resultList.dataTable {
|
||||
width: max-content !important;
|
||||
}
|
||||
|
||||
table.dataTable td,
|
||||
table.dataTable th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* 테이블이 내용만큼 커지고, wrapper가 스크롤 담당 */
|
||||
.table-responsive {
|
||||
overflow-x: auto !important;
|
||||
}
|
||||
|
||||
/* 테이블 폭: 내용 기준으로 커지되, 최소는 100% */
|
||||
.table-responsive #resultList {
|
||||
width: max-content !important;
|
||||
min-width: 100% !important;
|
||||
table-layout: auto !important;
|
||||
}
|
||||
|
||||
/* 줄바꿈 금지 */
|
||||
#resultList th,
|
||||
#resultList td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* PC에서 가로 스크롤이 잘리는 대표 구간들 강제 해제 */
|
||||
.main-card,
|
||||
.card,
|
||||
.card-body {
|
||||
overflow-x: visible !important;
|
||||
}
|
||||
|
||||
/* 만약 레이아웃 wrapper가 숨기고 있으면 이것도 */
|
||||
.app-main__outer,
|
||||
.app-main__inner,
|
||||
.app-main {
|
||||
overflow-x: visible !important;
|
||||
}
|
||||
|
||||
/* flex 환경에서 필수 */
|
||||
.app-main,
|
||||
.app-main__outer,
|
||||
.app-main__inner,
|
||||
.card,
|
||||
.card-body {
|
||||
min-width: 0;
|
||||
}
|
||||
</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;">
|
||||
|
||||
<!-- 검색 폼 -->
|
||||
<div class="row g-3">
|
||||
<div class="col-md-1">
|
||||
<label class="form-label mb-1">매물ID</label>
|
||||
<input type="text" class="form-control" name="rcpt_atclno" id="rcpt_atclno"
|
||||
onkeypress="atcl_no_enter(event)">
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label class="form-label mb-1">관할조직</label>
|
||||
<div class="d-flex gap-1">
|
||||
<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-3">
|
||||
<label class="form-label mb-1">지역별조회</label>
|
||||
<div class="d-flex gap-1">
|
||||
<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">
|
||||
<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="sdate" id="sdate" placeholder="시작일">
|
||||
<span class="input-group-text">~</span>
|
||||
<input type="date" class="form-control" name="edate" id="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="date" class="form-control" name="photo_sdate" id="photo_sdate" placeholder="시작일">
|
||||
<span class="input-group-text">~</span>
|
||||
<input type="date" class="form-control" name="photo_edate" id="photo_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="date" class="form-control" name="record_sdate" id="record_sdate" placeholder="시작일">
|
||||
<span class="input-group-text">~</span>
|
||||
<input type="date" class="form-control" name="record_edate" id="record_edate" placeholder="종료일">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<label class="form-label mb-1">녹취완료여부</label>
|
||||
<select class="form-select" name="rec_yn">
|
||||
<option value="">선택</option>
|
||||
<option value="Y">완료</option>
|
||||
<option value="N">미완료</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-1">
|
||||
<label class="form-label mb-1">검색유형</label>
|
||||
<select class="form-select" name="srchType">
|
||||
<option value="">선택</option>
|
||||
<option value="1">중개사명</option>
|
||||
<option value="2">거주인명</option>
|
||||
<option value="3">거주인연락처</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">
|
||||
<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 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">
|
||||
<div class="table-responsive">
|
||||
<table id="resultList" class="table table-hover table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>진행상태</th>
|
||||
<th>매물ID</th>
|
||||
<th>접수(등록)일자</th>
|
||||
<th>촬영일자</th>
|
||||
<th>녹취완료일자</th>
|
||||
<th>중개사</th>
|
||||
<th>주소</th>
|
||||
<th>거주인명</th>
|
||||
<th>거주인연락처</th>
|
||||
<th>관할조직</th>
|
||||
<th>방문담당</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- 여기는 비워둠: AJAX로 채움 -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</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">
|
||||
|
||||
const bonbuArr = <?= json_encode($bonbu, JSON_UNESCAPED_UNICODE); ?>;
|
||||
const teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>;
|
||||
const userArr = <?= json_encode($user, JSON_UNESCAPED_UNICODE); ?>;
|
||||
|
||||
const date = new Date();
|
||||
var table;
|
||||
|
||||
$(function () {
|
||||
|
||||
// initReceiptDate();
|
||||
|
||||
$("#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);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
$("#btnSearch").on("click", function () {
|
||||
table.ajax.reload();
|
||||
});
|
||||
|
||||
|
||||
table = $('#resultList').DataTable({
|
||||
language: lang_kor,
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
ajax: {
|
||||
url: '/article/record/getResultList',
|
||||
type: 'GET',
|
||||
beforeSend: function () {
|
||||
blockUI.blockPage({
|
||||
message: tpl
|
||||
})
|
||||
},
|
||||
complete: function () {
|
||||
blockUI.unblockPage()
|
||||
},
|
||||
data: function (d) {
|
||||
|
||||
d.rcpt_atclno = $("#frm_srch_info [name=rcpt_atclno]").val(); // 매물ID
|
||||
|
||||
d.sdate = $("#frm_srch_info [name=sdate]").val(); // 접수기간 시작
|
||||
d.edate = $("#frm_srch_info [name=edate]").val(); // 접수기간 종료
|
||||
|
||||
d.photo_sdate = $("#frm_srch_info [name=photo_sdate]").val(); // 촬영완료일자 시작
|
||||
d.photo_edate = $("#frm_srch_info [name=photo_edate]").val(); // 촬영완료일자 종료
|
||||
|
||||
d.record_sdate = $("#frm_srch_info [name=record_sdate]").val(); // 녹취완료일자 시작
|
||||
d.record_edate = $("#frm_srch_info [name=record_edate]").val(); // 녹취완료일자 종료
|
||||
|
||||
d.rec_yn = $("#frm_srch_info [name=rec_yn]").val(); // 녹취완료여부
|
||||
|
||||
d.bonbu = $("#frm_srch_info [name=bonbu]").val(); // 본부
|
||||
d.team = $("#frm_srch_info [name=team]").val(); // 팀
|
||||
d.user = $("#frm_srch_info [name=user]").val(); // 담당자
|
||||
|
||||
d.sido = $("#frm_srch_info [name=srcSido]").val(); // 시도
|
||||
d.gugun = $("#frm_srch_info [name=srcGugun]").val(); // 시군구
|
||||
d.dong = $("#frm_srch_info [name=srcDong]").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": [
|
||||
{ className: 'text-center', targets: '_all' },
|
||||
{ 'targets': '_all', "defaultContent": "" },
|
||||
],
|
||||
columns: [
|
||||
{ data: 'rcpt_stat_nm' },
|
||||
{ data: 'rcpt_atclno' },
|
||||
{ data: 'insert_tm' },
|
||||
{ data: 'photo_save_dt' },
|
||||
{ data: 'record_cplt_dt' },
|
||||
{ data: 'agent_nm' },
|
||||
{ data: null, render: fn_addr_render },
|
||||
{ data: 'rec_nm' },
|
||||
{ data: 'rec_tel' },
|
||||
{ data: 'dept_nm' },
|
||||
{ data: 'usr_nm' },
|
||||
],
|
||||
// 옵션들 예시
|
||||
destroy: true,
|
||||
deferRender: true,
|
||||
scrollX: false,
|
||||
autoWidth: false,
|
||||
paging: true,
|
||||
searching: false,
|
||||
ordering: false,
|
||||
});
|
||||
|
||||
// 테이블 row click
|
||||
$('#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;
|
||||
|
||||
const rcpt_key = rowData.rcpt_key;
|
||||
location.href = "<?= site_url('article/record/detail') ?>/" + rcpt_key;
|
||||
});
|
||||
|
||||
|
||||
// 엑셀 다운로드 click
|
||||
$("#excel-download").on("click", function () {
|
||||
$.ajax({
|
||||
url: "/article/record/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);
|
||||
|
||||
$('#sdate').val(fmt(before3));
|
||||
$('#edate').val(fmt(date));
|
||||
|
||||
}
|
||||
|
||||
function atcl_no_enter(event) {
|
||||
if (event.keyCode == 13) {
|
||||
table.ajax.reload()
|
||||
}
|
||||
}
|
||||
|
||||
/** datatable render */
|
||||
function fn_addr_render(data, type, row) {
|
||||
var str = "";
|
||||
|
||||
str = row.addr + " " + row.rcpt_hscp_nm;
|
||||
|
||||
return str;
|
||||
}
|
||||
/** datatable render */
|
||||
|
||||
// 엑셀 다운로드
|
||||
function downloadExcel(data) {
|
||||
const ws = XLSX.utils.json_to_sheet(data);
|
||||
// ws['!cols'] = [
|
||||
// { wpx: 100 },
|
||||
// { wpx: 100 },
|
||||
// { wpx: 100 },
|
||||
// { wpx: 100 },
|
||||
// { wpx: 150 },
|
||||
// { wpx: 120 },
|
||||
// { 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);
|
||||
}
|
||||
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
Reference in New Issue
Block a user