From 207023c7439eac93b11fffdcc26d15d24ece8868 Mon Sep 17 00:00:00 2001 From: "Jaeeun.Cho" Date: Mon, 8 Dec 2025 14:54:25 -0500 Subject: [PATCH] Customer, Order, Map: add image upload feature --- public_html/assets/internal_api.php | 23 +- public_html/doc/customer_detail.php | 456 +++++++++++++++++- public_html/doc/map.php | 36 +- .../lib/customer_image_upload_popup.php | 211 ++++++++ public_html/lib/shortInfo_lib.php | 52 +- public_html/lib/user_process.php | 311 ++++++++++++ 6 files changed, 1053 insertions(+), 36 deletions(-) create mode 100644 public_html/lib/customer_image_upload_popup.php diff --git a/public_html/assets/internal_api.php b/public_html/assets/internal_api.php index c8a32de..3bc5776 100644 --- a/public_html/assets/internal_api.php +++ b/public_html/assets/internal_api.php @@ -955,6 +955,7 @@ class API extends CONF { try { $sqShortInfo = qry("SELECT + c_uid, c_name, c_paymenttype, c_comment_ri, @@ -965,6 +966,23 @@ class API extends CONF { c_uid = ".(int)$_POST['id']); $rstShortInfo = fetch_array($sqShortInfo); + // 설치 이미지 조회 추가 + $query_img = " + SELECT i_filepath, i_filename + FROM tbl_customer_image + WHERE i_customeruid = '".(int)$_POST['id']."' + AND i_type = 'install' + AND i_status = 'A' + ORDER BY i_createddate DESC + LIMIT 1 + "; + $imgRow = qry($query_img); + $installImgUrl = ""; + + if ($row = fetch_array($imgRow)) { + $installImgUrl = $row['i_filepath'] . $row['i_filename']; + } + if ($rstShortInfo['c_paymenttype'] == "CA") { $sqShortDaily = qry("SELECT @@ -1001,7 +1019,8 @@ class API extends CONF { "payment_type" => $rstShortInfo['c_paymenttype'], "paymentstring" => $d_paystatusSTR, "comment" => $rstShortInfo['c_comment_ri'], - "location" => $rstShortInfo['c_location'] + "location" => $rstShortInfo['c_location'], + "install_img" => $installImgUrl ); $this->response($this->json(array("result"=>$result)), 200); @@ -1470,7 +1489,7 @@ class API extends CONF { } } - + } $api = new API; diff --git a/public_html/doc/customer_detail.php b/public_html/doc/customer_detail.php index 260ceef..a3171af 100644 --- a/public_html/doc/customer_detail.php +++ b/public_html/doc/customer_detail.php @@ -1533,25 +1533,18 @@ if( $total_count < 1 ) { }); -
- -
- - -
-
-

Note

+
+

Note

+ +
+ +
+
- -
- -
- -

@@ -1589,7 +1582,7 @@ if( $total_count < 1 ) { --> - +
@@ -1620,13 +1613,6 @@ if( $total_count < 1 ) {
- -
-
- LIST -
-
- -
+
+
+
+
+

Image

+
+ +
+
+ +

+ nQuery($qry_img, "image list error"); + + // 분류 배열 + $install = []; + $container = []; + + while ($img = mysqli_fetch_array($rt_img, MYSQLI_ASSOC)) { + if ($img['i_type'] == "install") $install[] = $img; + else $container[] = $img; + } + + if (count($install) + count($container) == 0) { + echo "

No images found.

"; + } else { + + // =========================== + // INSTALL + // =========================== + if (count($install) > 0) { + echo "

Install

"; + + foreach ($install as $img) { + + echo '
'; + + echo '
'; + + $files = explode(",", $img['i_filename']); + foreach ($files as $f) { + $imgPath = $img['i_filepath'] . trim($f); + echo ' +
+ +
+ '; + } + + echo '
'; + + echo '
+ Note: '.nl2br($img['i_note']).'
'; + echo "Created: " . date("Y-m-d H:i:s", strtotime($img['i_createddate'])).'
'; + echo "Created by: " . $img['m_firstname']. ' ' . $img['m_lastname']. ' (' . $img['m_initial']. ')'; + echo '
'; + } + } + + // =========================== + // CONTAINER + // =========================== + // if (count($container) > 0) { + // echo "

Container

"; + + // foreach ($container as $img) { + + // echo '
'; + + // echo '
'; + + // $files = explode(",", $img['i_filename']); + // foreach ($files as $f) { + // $imgPath = $img['i_filepath'] . trim($f); + // echo ' + //
+ // + //
+ // '; + // } + + // echo '
'; + + // echo '
+ // Note: '.nl2br($img['i_note']).'
'; + // echo "Created: " . date("Y-m-d H:i:s", strtotime($img['i_createddate'])).'
'; + // echo ' + //
+ // '; + + // echo '
'; + // } + // } + } + ?> + +
+
+ +
+ +
+
+ LIST +
+
+ + + + + + + + + +
diff --git a/public_html/doc/map.php b/public_html/doc/map.php index f4d32b0..14b8b9f 100644 --- a/public_html/doc/map.php +++ b/public_html/doc/map.php @@ -341,7 +341,7 @@
- + diff --git a/public_html/lib/customer_image_upload_popup.php b/public_html/lib/customer_image_upload_popup.php new file mode 100644 index 0000000..cbf7a20 --- /dev/null +++ b/public_html/lib/customer_image_upload_popup.php @@ -0,0 +1,211 @@ + $rstDriver['m_uid'], + "name" => $rstDriver['m_initial'] + ); +} + +?> + + + + + +Upload Image + + + +
+ +
+ UPLOAD IMAGE +
+ +
+ + + + + + + +
+ + + + + + + + + +

※ 기존 이미지가 있을 경우 삭제됩니다.

+

※ Install 이미지는 1개만 업로드 가능합니다.

+ + + + + + + +
+ + + +
+ +
+ + + + + + + + diff --git a/public_html/lib/shortInfo_lib.php b/public_html/lib/shortInfo_lib.php index a478a2b..a8e8aa8 100644 --- a/public_html/lib/shortInfo_lib.php +++ b/public_html/lib/shortInfo_lib.php @@ -65,11 +65,27 @@ if ($c_paymenttype =="CA") { else $d_paystatusSTR = "-"; } + $query_img = " + SELECT i_filepath, i_filename + FROM tbl_customer_image + WHERE i_customeruid = '$c_uid' + AND i_type = 'install' + AND i_status = 'A' + ORDER BY i_createddate DESC + LIMIT 1 + "; + $imgResult = $jdb->fQuery($query_img, "fetch image error"); + + $installImgUrl = ""; + if (!empty($imgResult)) { + $installImgUrl = $imgResult['i_filepath'] . $imgResult['i_filename']; + } + ?>