5) { sleep(1); header("Location:" . $WebSite . "login/login_form.php"); exit; } include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php'; $title_message = '셔터박스 생성 관리'; ?> <?=$title_message?> query($columnSql); $columns = $columnQuery->fetchAll(PDO::FETCH_COLUMN); // 검색어 필터 if (!empty($search)) { // 공백 제거(원한다면 제거하지 않아도 됨) $searchTrimmed = str_replace(' ', '', $search); $searchConditions = []; foreach ($columns as $i => $col) { // 컬럼마다 고유 파라미터 이름(:search0, :search1 등)을 생성 $paramName = ":search{$i}"; $searchConditions[] = "$col LIKE $paramName"; $bindParams[$paramName] = "%{$searchTrimmed}%"; } if (!empty($searchConditions)) { // 여러 컬럼 중 하나라도 일치하면 OR로 연결 $conditions[] = "(" . implode(" OR ", $searchConditions) . ")"; } } // 최종 SQL 구성 $sql = "SELECT * FROM {$DB}.{$tablename}"; if (!empty($conditions)) { $sql .= " WHERE " . implode(" AND ", $conditions); } $sql .= $orderby; try { $stmt = $pdo->prepare($sql); $stmt->execute($bindParams); $total_row = $stmt->rowCount(); ?>
 
'; echo ''; foreach ($exit_direction_list as $item) { $checked = ($selected_exit_direction === $item) ? 'checked' : ''; echo ''; echo ''; } ?>
       
$value) { if (empty($item[$key]) || $item[$key] !== $value) { $matched = false; break; } } if ($matched && !empty($item['image'])) { return "이미지"; } } return ''; } $start_num = $total_row; while($row = $stmt->fetch(PDO::FETCH_ASSOC)) { include '_row.php'; // 점검구 형태에 따른 이미지 URL 생성 (셔터박스) $jsonFile = $_SERVER['DOCUMENT_ROOT'].'/shutterbox/shutterbox.json'; $imgUrl = ''; if (file_exists($jsonFile)) { $jsonData = file_get_contents($jsonFile); $shutterboxImages = json_decode($jsonData, true); // echo "
";
                        // print_r($shutterboxImages);
                        // echo "
"; if (is_array($shutterboxImages)) { // 검색 조건 우선순위대로 정렬 $searchCases = []; // 1순위: 검색 키워드 (가장 우선) if (!empty($row['search_keyword'])) { $searchCases[] = ['search_keyword' => $row['search_keyword']]; } // 2순위: 모든 조건 일치 $searchCases[] = [ 'box_width' => $row['box_width'], 'box_height' => $row['box_height'], 'front_bottom_width' => $row['front_bottom_width'], 'rail_width' => $row['rail_width'], 'exit_direction' => $row['exit_direction'] ]; // 순차 검색 - 첫번째 매칭되는 이미지 사용 foreach ($searchCases as $case) { $imgUrl = findImageByConditions($shutterboxImages, $case); if ($imgUrl) break; } } } ?> getMessage(); } ?>
번호 등록일 박스(가로X세로) 점검구 형태 전면부 밑면치수 레일(폭) 소요자재량 품목 검색어 형태 작업지시서 작성 비고
X $total) { $summary_items[] = $material . '(' . number_format($total) . ')'; } $material_summary_display = implode('
', $summary_items); } } catch (Exception $e) { $material_summary_display = '데이터 오류'; } } echo $material_summary_display ?: '-'; ?>
보기
이미지 편집기
20px