diff --git a/app/Config/Routes.php b/app/Config/Routes.php
index ece01fe..e47dbc7 100644
--- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -95,6 +95,7 @@ $routes->group('article', ['namespace' => 'App\Controllers\Article'], function (
// 아파트 평면도
$routes->get('apt/lists2', 'Ground::lists');
+ $routes->get('apt/ground/detail/(:num)/(:num)', 'Ground::detail/$1/$2');
/**
* 아파트 평면도 - API
diff --git a/app/Controllers/Article/Ground.php b/app/Controllers/Article/Ground.php
index db20cd4..79a820e 100644
--- a/app/Controllers/Article/Ground.php
+++ b/app/Controllers/Article/Ground.php
@@ -209,6 +209,25 @@ class Ground extends BaseController
}
+ // 상세화면
+ public function detail($rcpt_no, $hscp_no): string
+ {
+
+ if ($rcpt_no == null || $hscp_no == null) {
+ throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
+ }
+
+ // 상세정보
+ $apt = $this->model->getDetail($rcpt_no, $hscp_no);
+
+
+ return view("pages/article/detail2", [
+ 'apt' => $apt,
+ ]);
+ }
+
+
+
// 파일업로드(평면도)
public function uploadFile()
{
diff --git a/app/Models/article/GroundModel.php b/app/Models/article/GroundModel.php
index b7f8955..cd51011 100644
--- a/app/Models/article/GroundModel.php
+++ b/app/Models/article/GroundModel.php
@@ -625,6 +625,35 @@ class GroundModel extends Model
];
}
+ // 상세정보
+ public function getDetail($rcpt_no, $hscp_no)
+ {
+ $sql = "SELECT
+ a.rcpt_no, a.hscp_no, a.part_no, a.addr, a.addr2, a.rcpt_hscp_nm, a.move_ym, a.households_cnt, a.dong_cnt, a.pyeong_cnt, a.apt_cate_nm, a.region_cd, a.rcpt_x, a.rcpt_y
+ ,a.vdo_up_tm, DATE_FORMAT(a.vdo_up_tm, '%Y-%m-%d') as rdate_dt_vdo ,DATE_FORMAT(a.vdo_up_tm, '%H:%i:%s') as rdate_tm_vdo
+ ,a.check_tm, DATE_FORMAT(a.check_tm, '%Y-%m-%d') as rdate_dt_chk ,DATE_FORMAT(a.check_tm, '%H:%i:%s') as rdate_tm_chk
+ ,a.memo, a.note, a.video_target, a.vdo_up_ynx, a.not_vdo_reson, a.apt_step, a.check_yn, a.resend_yn, a.write_complete_yn, a.all_no_pho
+ ,a.write_complete_tm, DATE_FORMAT(a.write_complete_tm, '%Y-%m-%d') as rdate_dt_cmpl ,DATE_FORMAT(a.write_complete_tm, '%H:%i:%s') as rdate_tm_cmpl
+ ,a.charger, a.dept_sq ,(SELECT pdept_sq FROM departments WHERE dept_sq = a.dept_sq) bonbu
+ ,a.send_end_tm, a.supply_no_tm
+ ,d.pho_cate2, d.pho_explain, d.pho_up_nu
+ ,gp.filenm_up, gp.file_path, gp.insert_tm
+ FROM
+ apt_ground a
+ LEFT JOIN apt_category d ON a.rcpt_no = d.rcpt_no
+ LEFT JOIN apt_ground_photo gp ON gp.pho_no = (SELECT p.pho_no
+ FROM apt_ground_photo p
+ WHERE p.rcpt_no = a.rcpt_no
+ ORDER BY p.pho_no DESC
+ LIMIT 1)
+
+ WHERE a.rcpt_no = {$rcpt_no} AND a.hscp_no = {$hscp_no} ";
+
+ $query = $this->db->query($sql, [$rcpt_no]);
+
+ return $query->getRowArray();
+ }
+
// 평면도 정보 저장
public function saveImg($data)
@@ -648,4 +677,5 @@ class GroundModel extends Model
'success' => true,
];
}
+
}
\ No newline at end of file
diff --git a/app/Views/pages/article/detail2.php b/app/Views/pages/article/detail2.php
new file mode 100644
index 0000000..e34c064
--- /dev/null
+++ b/app/Views/pages/article/detail2.php
@@ -0,0 +1,128 @@
+= $this->extend('layouts/main') ?>
+
+= $this->section('content') ?>
+
+
+
+
+
+
+
+
단지 정보
+
+
+
+
+
+
+
+
+
+ | 단지코드 |
+ = esc($apt['hscp_no'] ?? '') ?> |
+ 주소 |
+ = esc($apt['addr'] ?? '') ?> |
+
+
+ | 단지명 |
+ = esc($apt['rcpt_hscp_nm'] ?? '') ?> |
+ 상세주소 |
+ = esc($apt['addr2'] ?? '') ?> |
+
+
+ | 입주년월 |
+ |
+ 총세대수 |
+ |
+
+
+ | 총동수 |
+ |
+ 메모 |
+
+
+ |
+
+
+
+
+
+
+
+
+= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/pages/article/lists2.php b/app/Views/pages/article/lists2.php
index e198b2f..cb5d36c 100644
--- a/app/Views/pages/article/lists2.php
+++ b/app/Views/pages/article/lists2.php
@@ -673,8 +673,9 @@
const rowData = table.row(this).data();
if (!rowData) return;
- // const id = rowData.rcpt_no;
- // location.href = "= site_url('article/apt/detail') ?>/" + id;
+ 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 () {