prepare($sql); $stmt->execute($params); $results = $stmt->fetchAll(PDO::FETCH_ASSOC); // shutterbox.json 읽기 $jsonFile = $_SERVER['DOCUMENT_ROOT'].'/shutterbox/shutterbox.json'; $shutterboxData = []; if (file_exists($jsonFile)) { $jsonContent = file_get_contents($jsonFile); $shutterboxData = json_decode($jsonContent, true); if (!is_array($shutterboxData)) $shutterboxData = []; } // 결과 출력 if (empty($results)) { echo '검색 결과가 없습니다.'; } else { foreach ($results as $row) { $num = $row['num']; $itemName = $row['itemName'] ?? ''; $material = $row['material'] ?? ''; $item_sep = $row['item_sep'] ?? ''; $item_bending = $row['item_bending'] ?? ''; $model_UA = $row['model_UA'] ?? ''; $imgdata = $row['imgdata'] ?? ''; $widthsum = $row['widthsum'] ?? ''; $exit_direction = $row['exit_direction'] ?? ''; $front_bottom_width = $row['front_bottom_width'] ?? ''; $rail_width = $row['rail_width'] ?? ''; $box_width = $row['box_width'] ?? ''; $box_height = $row['box_height'] ?? ''; $search_keyword = $row['search_keyword'] ?? ''; // guiderail.json에서 상세 데이터 찾기 (모델명+형태+마감+대분류+UA) $summary = ''; // bending/write_form.php와 동일한 구조로 데이터 구성 $inputList = $row['inputList'] ?? []; $bendingrateList = $row['bendingrateList'] ?? []; $sumList = $row['sumList'] ?? []; $colorList = $row['colorList'] ?? []; $AList = $row['AList'] ?? []; // 등록일 추가 $registration_date = $row['registration_date'] ?? ''; $summary = htmlspecialchars(json_encode([ 'inputList' => $inputList, 'bendingrateList' => $bendingrateList, 'calcAfterList' => $calcAfterList, 'sumList' => $sumList, 'colorList' => $colorList, 'AList' => $AList ], JSON_UNESCAPED_UNICODE), ENT_QUOTES, 'UTF-8'); $box_size = htmlspecialchars($box_width . 'x' . $box_height, ENT_QUOTES, 'UTF-8'); echo ''; echo ''; echo ''; echo ''; echo '-'; echo '' . htmlspecialchars($registration_date, ENT_QUOTES, 'UTF-8') . ''; echo '' . htmlspecialchars($item_sep, ENT_QUOTES, 'UTF-8') . ''; echo '' . htmlspecialchars($model_UA, ENT_QUOTES, 'UTF-8') . ''; echo '' . htmlspecialchars($item_bending, ENT_QUOTES, 'UTF-8') . ''; echo '' . htmlspecialchars($exit_direction, ENT_QUOTES, 'UTF-8') . ''; echo '' . htmlspecialchars($box_size, ENT_QUOTES, 'UTF-8') . ''; echo '' . htmlspecialchars($front_bottom_width, ENT_QUOTES, 'UTF-8') . ''; echo '' . htmlspecialchars($rail_width, ENT_QUOTES, 'UTF-8') . ''; echo '' . htmlspecialchars($itemName, ENT_QUOTES, 'UTF-8') . ''; echo '' . htmlspecialchars($search_keyword, ENT_QUOTES, 'UTF-8') . ''; echo '' . htmlspecialchars($material, ENT_QUOTES, 'UTF-8') . ''; echo ''; if ($imgdata) { echo ''; } echo ''; // 합계 셀: data-summary 속성 추가 echo '' . htmlspecialchars($widthsum, ENT_QUOTES, 'UTF-8') . ''; echo ''; } } ?>