<?php
// guiderail_search.php (예시 파일명)
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");

// DB 연결
require_once($_SERVER['DOCUMENT_ROOT'].'/lib/mydb.php');
$pdo = db_connect();

// GET 파라미터 받기 (예: openBendingSearchModal 함수에서 전달한 값)
$seconditem       = $_GET['seconditem'] ?? '';
$model_name       = $_GET['model_name'] ?? '';
$finishing_type   = $_GET['finishing_type'] ?? '';
$spec             = $_GET['spec'] ?? '';
$check_type       = $_GET['check_type'] ?? ''; // 케이스는 점검구(양면,밑면,후면) 가이드레일은 벽면형,측면형
$box_width       = $_GET['box_width'] ?? ''; // case 폭
$box_height      = $_GET['box_height'] ?? ''; // case 높이

if($seconditem  == '가이드레일')
{
	// SQL: 테이블명을 guiderail 로 변경
	$sql = "SELECT * FROM {$DB}.guiderail WHERE is_deleted IS NULL";
	$params = [];

	if ($model_name !== '') {
		$sql .= " AND model_name = :model_name";
		$params[':model_name'] = $model_name;
	}

	if ($finishing_type !== '') {
		// guiderail 테이블에서는 마감타입 컬럼은 finishing_type 입니다.
		$sql .= " AND finishing_type = :finishing_type";
		$params[':finishing_type'] = $finishing_type;
	}

	if ($check_type !== '') {
		// guiderail 테이블에서는 마감타입 컬럼은 finishing_type 입니다.
		$sql .= " AND check_type = :check_type";
		$params[':check_type'] = $check_type;
	}

	$sql .= " ORDER BY num DESC";	

	$stmt = $pdo->prepare($sql);
	$stmt->execute($params);
	$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
	
// print $sql;
?>
<div class="alert alert-primary" role="alert">
<!-- 결과 테이블 출력 (헤더 및 데이터는 guiderail _row.php 의 컬럼 구성에 맞춤) -->
찾는 아이템 : <?=$seconditem ?> &nbsp;&nbsp;&nbsp; 찾는 모델 : <?=$model_name ?> &nbsp;&nbsp;&nbsp;  찾는 규격(형상) : <?=$check_type ?> &nbsp;&nbsp;&nbsp;  마감 : <?=$finishing_type ?>
</div>
<table class="table table-bordered table-hover">
  <thead class="table-secondary">
    <tr>
      <th>번호</th>
      <th>중분류</th>
      <th>모델</th>
      <th>형상</th>
      <th>레일 너비</th>
      <th>레일 폭</th>
      <th>마감타입</th>
      <th>등록일</th>
      <th>작성자</th>
      <th>비고</th>
    </tr>
  </thead>
   <tbody>
    <?php foreach($results as $row): ?>	
      <tr 
          onclick="selectGuidrail(this, <?= htmlspecialchars($row['num']) ?>)" 
          data-model_name="<?= htmlspecialchars($row['model_name']) ?>" 
          data-rail_length="<?= htmlspecialchars($row['rail_length']) ?>" 
          data-rail_width="<?= htmlspecialchars($row['rail_width']) ?>" 
          data-seconditem="<?= htmlspecialchars($seconditem) ?>"
          data-check_type="<?=  htmlspecialchars($row['check_type']) ?>"
          data-finishing_type="<?= htmlspecialchars($row['finishing_type']) ?>">
         <td><?= htmlspecialchars($row['num']) ?></td>
         <td><?= htmlspecialchars($seconditem) ?></td>
         <td><?= htmlspecialchars($row['model_name']) ?></td>
         <td><?= htmlspecialchars($row['check_type']) ?></td>
         <td><?= htmlspecialchars($row['rail_length']) ?></td>
         <td><?= htmlspecialchars($row['rail_width']) ?></td>
         <td><?= htmlspecialchars($row['finishing_type']) ?></td>
         <td><?= htmlspecialchars($row['registration_date']) ?></td>
         <td><?= htmlspecialchars($row['author']) ?></td>
         <td><?= htmlspecialchars($row['remark']) ?></td>         
      </tr>
    <?php endforeach; ?>
  </tbody>
</table>
<?php } // end of 가이드레일  

// shutterbox 검색 처리 예시
 elseif ($seconditem == '케이스') 
 {
    $tablename = 'shutterbox';
    $order = " ORDER BY num DESC ";
	// SQL: 테이블명을 guiderail 로 변경
	$sql = "SELECT * FROM {$DB}.{$tablename} WHERE is_deleted IS NULL";
	$params = [];

	if ($box_width !== '') {
		$sql .= " AND box_width = :box_width";
		$params[':box_width'] = $box_width;
	}

	if ($box_height !== '') {
		$sql .= " AND box_height = :box_height";
		$params[':box_height'] = $box_height;
	} 

	if ($check_type !== '') {
		// guiderail 테이블에서는 마감타입 컬럼은 finishing_type 입니다.
		$sql .= " AND exit_direction = :check_type";
		$params[':check_type'] = $check_type;
	}

	$sql .= " ORDER BY num DESC";
	
	$stmt = $pdo->prepare($sql);
	$stmt->execute($params);
	$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<div class="alert alert-danger" role="alert">
	마구리는 M당 단가에서 제외함, 케이스 4번 후면 코너부 수량 2개로 세팅 :::: <?=$seconditem?>, <?=$check_type?>
</div>
    <table class="table table-hover table-bordered" id="myTable">
        <thead class="table-primary">
            <tr>
                <th class="text-center" style="width:70px;">번호</th>
                <th class="text-center" style="width:120px;">등록일</th>
                <th class="text-center" style="width:150px;">박스(가로X세로)</th>
                <th class="text-center" style="width:100px;">점검구 형태</th>
                <th class="text-center" style="width:100px;">전면부 밑면</th>
                <th class="text-center" style="width:100px;">레일(폭)</th>                
                <th class="text-center" style="width:100px;">작성</th>
                <th class="text-center" style="width:100px;">비고</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($results as $row): 
                // shutterbox의 각 컬럼 변수 설정
                $num = isset($row['num']) ? $row['num'] : '';
                $registration_date = isset($row['registration_date']) ? $row['registration_date'] : '';
                $exit_direction = isset($row['exit_direction']) ? $row['exit_direction'] : '';
                $check_type = isset($row['exit_direction']) ? $row['exit_direction'] : '';
                $author = isset($row['author']) ? $row['author'] : '';
                $remark = isset($row['remark']) ? $row['remark'] : '';
                $front_bottom_width = isset($row['front_bottom_width']) ? $row['front_bottom_width'] : '';
                $rail_width = isset($row['rail_width']) ? $row['rail_width'] : '';
                $box_width = isset($row['box_width']) ? $row['box_width'] : '';
                $box_height = isset($row['box_height']) ? $row['box_height'] : '';  
                $bending_components = isset($row['bending_components']) ? $row['bending_components'] : '';
                // 박스(가로X세로) 문자열 구성
                $boxDimension = $box_width . " x " . $box_height;
            ?>
            <tr 
				onclick="selectCase(this, <?= htmlspecialchars($row['num']) ?>)" 
                data-registration_date="<?= htmlspecialchars($registration_date) ?>" 
                data-box="<?= htmlspecialchars($boxDimension, ENT_QUOTES, 'UTF-8') ?>" 
                data-check_type="<?= htmlspecialchars($check_type, ENT_QUOTES, 'UTF-8') ?>" 
                data-box_width="<?= htmlspecialchars($box_width, ENT_QUOTES, 'UTF-8') ?>" 
                data-box_height="<?= htmlspecialchars($box_height, ENT_QUOTES, 'UTF-8') ?>" 
                data-seconditem="<?= htmlspecialchars($seconditem, ENT_QUOTES, 'UTF-8') ?>" 
                data-front_bottom_width="<?= htmlspecialchars($front_bottom_width, ENT_QUOTES, 'UTF-8') ?>" 
                data-rail_width="<?= htmlspecialchars($rail_width, ENT_QUOTES, 'UTF-8') ?>"  
                data-exit_direction="<?= htmlspecialchars($exit_direction, ENT_QUOTES, 'UTF-8') ?>" 
                data-check_type="<?= htmlspecialchars($exit_direction, ENT_QUOTES, 'UTF-8') ?>" 
                data-author="<?= htmlspecialchars($author, ENT_QUOTES, 'UTF-8') ?>" 
                data-bending_components="<?= htmlspecialchars($bending_components, ENT_QUOTES, 'UTF-8') ?>" 
				>
                <td><?= htmlspecialchars($num) ?></td>
                <td><?= htmlspecialchars($registration_date) ?></td>
                <td><?= htmlspecialchars($boxDimension) ?></td>
                <td><?= htmlspecialchars($exit_direction) ?></td>
                <td><?= htmlspecialchars($front_bottom_width) ?></td>
                <td><?= htmlspecialchars($rail_width) ?></td>                
                <td><?= htmlspecialchars($author) ?></td>
                <td><?= htmlspecialchars($remark) ?></td>
            </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
	
<?php } // end of 가이드레일  
// shutterbox 검색 처리 예시
 elseif ($seconditem == '마구리') 
 {
    $tablename = 'bending';
    $order = " ORDER BY num DESC ";
	// SQL: 테이블명을 guiderail 로 변경
	$sql = "SELECT * FROM {$DB}.{$tablename} WHERE is_deleted IS NULL";
	$params = [];

	// LIKE 검색 조건 수정 (와일드카드를 바인딩 값에 포함해야 함)
	$sql .= " AND itemName LIKE :search";
	$params = [':search' => "%{$seconditem}%"]; // 와일드카드 포함
	
	$sql .= " ORDER BY num DESC";
	
	$stmt = $pdo->prepare($sql);
	$stmt->execute($params);
	$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<div class="alert alert-success" role="alert">
	찾는 아이템 : <?=$seconditem ?> , 케이스 폭 + 5, 케이스 높이 + 5 적용
</div>
    <table class="table table-hover table-bordered" id="myTable">
        <thead class="table-primary">
            <tr>
				<th class="text-center">NO</th>
				<th class="text-center">대분류</th>
				<th class="text-center">절곡물 분류</th>
				<th class="text-center">품명</th>
				<th class="text-center">규격(가로*세로)</th>
				<th class="text-center">이미지(형상)</th>
				<th class="text-center">재질</th>
				<th class="text-center">폭 합계</th>
            </tr>
        </thead>
        <tbody>
            <?php 
			$start_num = 1;
			foreach ($results as $row): 
				 include $_SERVER['DOCUMENT_ROOT'] . '/bending/_row.php'; 
				 $upload_dir = '../bending/img/';
            ?>
			<tr 
				onclick="selectMarguri(this, <?= htmlspecialchars($row['num']) ?>)" 
				data-start_num="<?= htmlspecialchars($start_num, ENT_QUOTES, 'UTF-8') ?>"
				data-item_sep="<?= htmlspecialchars($item_sep, ENT_QUOTES, 'UTF-8') ?>"
				data-item_bending="<?= htmlspecialchars($item_bending, ENT_QUOTES, 'UTF-8') ?>"
				data-item_name="<?= htmlspecialchars($itemName, ENT_QUOTES, 'UTF-8') ?>"
				data-item_spec="<?= htmlspecialchars($item_spec, ENT_QUOTES, 'UTF-8') ?>"
				data-imgdata="<?= !empty($imgdata) ? htmlspecialchars($upload_dir . $imgdata, ENT_QUOTES, 'UTF-8') : '' ?>"
				data-material="<?= htmlspecialchars($material, ENT_QUOTES, 'UTF-8') ?>"
				data-sumList="<?= htmlspecialchars(end($sumList), ENT_QUOTES, 'UTF-8') ?>"
			>
				<td class="text-center text-secondary"><?= htmlspecialchars($start_num) ?></td>
				<td class="text-center text-secondary"><?= htmlspecialchars($item_sep) ?></td>
				<td class="text-center text-dark fw-bold"><?= htmlspecialchars($item_bending) ?></td>
				<td class="text-center text-primary"><?= htmlspecialchars($itemName) ?></td>
				<td class="text-center text-danger"><?= htmlspecialchars($item_spec) ?></td>
				<!-- 이미지(형상) -->
				<td class="text-center">
				<?php if (!empty($imgdata)): ?>
					<img src="<?= $upload_dir . htmlspecialchars($imgdata) ?>"
						 alt="형상 이미지"
						 style="max-width:100px; max-height:50px; height:auto; width:auto;">
				<?php else: ?>
					<span class="text-secondary">이미지 없음</span>
				<?php endif; ?>
				</td>
				<!-- 재질 -->
				<td class="text-center fw-bold">
					<?= htmlspecialchars($material) ?>
				</td>
				<!-- 폭의 합 -->
				<td class="text-center text-dark">
					<?= end($sumList) ?>
				</td>
            </tr>
            <?php 
			$start_num ++ ;
			endforeach; ?>
        </tbody>
    </table>
	
<?php 
  } // end of 마구리
 elseif ($seconditem == '하단마감재') 
 {   
	$sql = "SELECT * FROM {$DB}.bottombar WHERE is_deleted IS NULL";
	$params = [];

	if ($model_name !== '') {
		$sql .= " AND model_name = :model_name";
		$params[':model_name'] = $model_name;
	}

	if ($finishing_type !== '') {
		// guiderail 테이블에서는 마감타입 컬럼은 finishing_type 입니다.
		$sql .= " AND finishing_type = :finishing_type";
		$params[':finishing_type'] = $finishing_type;
	}

	$sql .= " ORDER BY num DESC";	

	$stmt = $pdo->prepare($sql);
	$stmt->execute($params);
	$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
	
?>
<div class="alert alert-success" role="alert">
	찾는 아이템 : <?=$seconditem ?> &nbsp;&nbsp;&nbsp; 찾는 모델 : <?=$model_name ?> &nbsp;&nbsp;&nbsp;  마감 : <?=$finishing_type ?>
</div>
   <table class="table table-hover table-bordered" id="myTable">
    <thead class="table-primary">
        <tr>
            <th class="text-center"> 번호 </th>
            <th class="text-center"> 등록일 </th>
            <th class="text-center"> 대분류 </th>
            <th class="text-center"> 인정/비인정 </th>
            <th class="text-center"> 제품코드 </th>
            <th class="text-center"> 규격 </th>                                  
            <th class="text-center"> 마감형태 </th>                                                   
            <th class="text-center"> 품목검색어 </th>                                                   
            <th class="text-center"> 비고 </th>    
        </tr>
    </thead>
    <tbody>
        <?php 
        $start_num = 1;
        foreach ($results as $row): 
            include $_SERVER['DOCUMENT_ROOT'] . '/bottombar/_row.php';    		
        ?>
        <tr 
            onclick="selectBottombar(this, <?= htmlspecialchars($num) ?>)" 
            data-num="<?= htmlspecialchars($num, ENT_QUOTES, 'UTF-8') ?>"
            data-registration_date="<?= htmlspecialchars($registration_date, ENT_QUOTES, 'UTF-8') ?>"
            data-model_name="<?= htmlspecialchars($model_name, ENT_QUOTES, 'UTF-8') ?>"            
            data-material_summary="<?= htmlspecialchars($material_summary, ENT_QUOTES, 'UTF-8') ?>"
            data-bar_width="<?= htmlspecialchars($bar_width, ENT_QUOTES, 'UTF-8') ?>"
            data-bar_height="<?= htmlspecialchars($bar_height, ENT_QUOTES, 'UTF-8') ?>"
            data-finishing_type="<?= htmlspecialchars($finishing_type, ENT_QUOTES, 'UTF-8') ?>"
            data-remark="<?= htmlspecialchars($remark, ENT_QUOTES, 'UTF-8') ?>"            
            data-search_keyword="<?= htmlspecialchars($search_keyword, ENT_QUOTES, 'UTF-8') ?>"       
            data-firstitem="<?= htmlspecialchars($firstitem, ENT_QUOTES, 'UTF-8') ?>"     
            data-model_UA="<?= htmlspecialchars($model_UA, ENT_QUOTES, 'UTF-8') ?>"     
            data-bending_components="<?= htmlspecialchars($bending_components, ENT_QUOTES, 'UTF-8') ?>"
        >
            <td class="text-center text-secondary"><?= htmlspecialchars($num) ?></td>
            <td class="text-center text-secondary"><?= htmlspecialchars($registration_date) ?></td>
            <td class="text-center text-dark fw-bold"><?= htmlspecialchars($firstitem) ?></td>
            <td class="text-center text-dark fw-bold"><?= htmlspecialchars($model_UA) ?></td>
            <td class="text-center text-dark fw-bold"><?= htmlspecialchars($model_name) ?></td>
            <td class="text-center text-primary"><?= htmlspecialchars($bar_width)?>*<?= htmlspecialchars($bar_height) ?></td>            
            <td class="text-center text-danger"><?= htmlspecialchars($finishing_type) ?></td>
            <td class="text-center"><?= htmlspecialchars($search_keyword) ?></td>
            <td class="text-center"><?= htmlspecialchars($remark) ?></td>
        </tr>
        <?php 
        $start_num++;
        endforeach; ?>
    </tbody>
</table>

<?php 
  } // end of 하단마감재
 elseif ($seconditem == 'L-BAR') 
 {   
	$sql = "SELECT * FROM {$DB}.bending WHERE is_deleted IS NULL";
	$params = [];

	if ($seconditem !== '') {
		$sql .= " AND itemName = :seconditem";
		$params[':seconditem'] = $seconditem;
	}

	$sql .= " ORDER BY num DESC";	

	$stmt = $pdo->prepare($sql);
	$stmt->execute($params);
	$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
	
$upload_dir = '../bending/img/';
	
?>
<div class="alert alert-success" role="alert">
	찾는 아이템 : <?=$seconditem ?> &nbsp;&nbsp;&nbsp; 
</div>
 <table class="table table-hover table-bordered" id="myTable">
    <thead class="table-primary">
        <tr>
            <th class="text-center">NO</th>
            <th class="text-center">대분류</th>
            <th class="text-center">절곡물 분류</th>
            <th class="text-center">품명</th>
            <th class="text-center">규격(가로*세로)</th>
            <th class="text-center">이미지(형상)</th>
            <th class="text-center">재질</th>
            <th class="text-center">폭 합계</th>    
        </tr>
    </thead>
    <tbody>
        <?php 
        $start_num = 1;
        foreach ($results as $row): 
            include $_SERVER['DOCUMENT_ROOT'] . '/bending/_row.php';   
			// 5개 배열을 하나의 JSON 문자열로 변환
			// JSON_UNESCAPED_UNICODE → 한글 및 특수문자가 깨지지 않도록 설정
			//JSON_HEX_APOS | JSON_HEX_QUOT → 작은따옴표('), 큰따옴표(")를 안전하게 변환

			$responseData = json_encode([
				'inputList' => $inputList,
				'bendingrateList' => $bendingrateList,
				'colorList' => $colorList,
				'AList' => $AList,
				'sumList' => $sumList
			], JSON_UNESCAPED_UNICODE | JSON_HEX_APOS | JSON_HEX_QUOT);

        ?>
        <tr 
            onclick="selectLbar(this, <?= htmlspecialchars($num) ?>)" 
            data-num="<?= htmlspecialchars($num, ENT_QUOTES, 'UTF-8') ?>"            
            data-itemname="<?= htmlspecialchars($itemName, ENT_QUOTES, 'UTF-8') ?>"            
            data-item_spec="<?= htmlspecialchars($item_spec, ENT_QUOTES, 'UTF-8') ?>"            
            data-material="<?= htmlspecialchars($material, ENT_QUOTES, 'UTF-8') ?>"            
			data-response="<?= htmlspecialchars($responseData, ENT_QUOTES, 'UTF-8') ?>"          
        >
            <td class="text-center text-secondary"><?= htmlspecialchars($start_num) ?></td>
            <td class="text-center text-secondary"><?= htmlspecialchars($item_sep) ?></td>
            <td class="text-center text-dark fw-bold"><?= htmlspecialchars($item_bending) ?></td>
            <td class="text-center text-primary"><?= htmlspecialchars($itemName) ?></td>
            <td class="text-center text-danger"><?= htmlspecialchars($item_spec) ?></td>
            <td class="text-center">
                <?php if (!empty($imgdata)): ?>
                    <img src="<?= $upload_dir . htmlspecialchars($imgdata) ?>"
                         alt="형상 이미지"
                         style="max-width:100px; max-height:50px; height:auto; width:auto;">
                <?php else: ?>
                    <span class="text-secondary">이미지 없음</span>
                <?php endif; ?>
            </td>
            <td class="text-center fw-bold"><?= htmlspecialchars($material) ?></td>
            <td class="text-center text-dark"><?= end($sumList) ?></td>            
        </tr>
        <?php 
        $start_num++;
        endforeach; ?>
    </tbody>
</table>

<?php 
  } // end of L-BAR
 elseif ($seconditem == '보강평철') 
 {   
	$sql = "SELECT * FROM {$DB}.bending WHERE is_deleted IS NULL";
	$params = [];

	if ($seconditem !== '') {
		$sql .= " AND itemName = :seconditem";
		$params[':seconditem'] = $seconditem;
	}

	$sql .= " ORDER BY num DESC";	

	$stmt = $pdo->prepare($sql);
	$stmt->execute($params);
	$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
	
$upload_dir = '../bending/img/';
	
?>
<div class="alert alert-success" role="alert">
	찾는 아이템 : <?=$seconditem ?> &nbsp;&nbsp;&nbsp; 
</div>
 <table class="table table-hover table-bordered" id="myTable">
    <thead class="table-primary">
        <tr>
            <th class="text-center">NO</th>
            <th class="text-center">대분류</th>
            <th class="text-center">절곡물 분류</th>
            <th class="text-center">품명</th>
            <th class="text-center">규격(가로*세로)</th>
            <th class="text-center">이미지(형상)</th>
            <th class="text-center">재질</th>
            <th class="text-center">폭 합계</th>    
        </tr>
    </thead>
    <tbody>
        <?php 
        $start_num = 1;
        foreach ($results as $row): 
            include $_SERVER['DOCUMENT_ROOT'] . '/bending/_row.php';   
			// 5개 배열을 하나의 JSON 문자열로 변환
			// JSON_UNESCAPED_UNICODE → 한글 및 특수문자가 깨지지 않도록 설정
			//JSON_HEX_APOS | JSON_HEX_QUOT → 작은따옴표('), 큰따옴표(")를 안전하게 변환

			$responseData = json_encode([
				'inputList' => $inputList,
				'bendingrateList' => $bendingrateList,
				'surang' => $surang,
				'colorList' => $colorList,
				'AList' => $AList,
				'sumList' => $sumList
			], JSON_UNESCAPED_UNICODE | JSON_HEX_APOS | JSON_HEX_QUOT);

        ?>
        <tr 
            onclick="selectLbar(this, <?= htmlspecialchars($num) ?>)" 
            data-num="<?= htmlspecialchars($num, ENT_QUOTES, 'UTF-8') ?>"            
            data-itemname="<?= htmlspecialchars($itemName, ENT_QUOTES, 'UTF-8') ?>"            
            data-item_spec="<?= htmlspecialchars($item_spec, ENT_QUOTES, 'UTF-8') ?>"            
            data-material="<?= htmlspecialchars($material, ENT_QUOTES, 'UTF-8') ?>"            
			data-response="<?= htmlspecialchars($responseData, ENT_QUOTES, 'UTF-8') ?>"          
        >
            <td class="text-center text-secondary"><?= htmlspecialchars($start_num) ?></td>
            <td class="text-center text-secondary"><?= htmlspecialchars($item_sep) ?></td>
            <td class="text-center text-dark fw-bold"><?= htmlspecialchars($item_bending) ?></td>
            <td class="text-center text-primary"><?= htmlspecialchars($itemName) ?></td>
            <td class="text-center text-danger"><?= htmlspecialchars($item_spec) ?></td>
            <td class="text-center">
                <?php if (!empty($imgdata)): ?>
                    <img src="<?= $upload_dir . htmlspecialchars($imgdata) ?>"
                         alt="형상 이미지"
                         style="max-width:100px; max-height:50px; height:auto; width:auto;">
                <?php else: ?>
                    <span class="text-secondary">이미지 없음</span>
                <?php endif; ?>
            </td>
            <td class="text-center fw-bold"><?= htmlspecialchars($material) ?></td>
            <td class="text-center text-dark"><?= end($sumList) ?></td>            
        </tr>
        <?php 
        $start_num++;
        endforeach; ?>
    </tbody>
</table>


<?php
} // end of 케이스 조건

else
{	
	echo '찾는 아이템의 내용을 다시 선택해 주세요.';	
}
?>
