…)을 렌더링합니다.
// JSON으로 저장된 리스트 필드를 배열로 디코딩
$sumArr = json_decode($sumList, true);
if (!is_array($sumArr)) {
$sumArr = [];
}
$colorArr = json_decode($colorList, true);
if (!is_array($colorArr)) {
$colorArr = [];
}
$aArr = json_decode($AList, true);
if (!is_array($aArr)) {
$aArr = [];
}
// 절곡 회수 계산: sumArr 중 false 아닌 요소 개수 – 1
$countSum = 0;
foreach ($sumArr as $v) {
if ($v !== false) {
$countSum++;
}
}
$bendingCount = ($countSum > 0) ? $countSum - 1 : '';
// 역방향(음영) 개수 계산
$shadeCount = 0;
foreach ($colorArr as $v) {
if ($v) {
$shadeCount++;
}
}
// A각 표시 개수 계산
$aCount = 0;
foreach ($aArr as $v) {
if ($v) {
$aCount++;
}
}
$upload_dir = '../bending/img/';
// bendingfee/list.php의 테이블 구조에 맞게 변수 설정
$num = $row['num'] ?? '';
$major_category = $row['major_category'] ?? '';
$seconditem = $row['seconditem'] ?? '';
$model_name = $row['model_name'] ?? '';
$check_type = $row['check_type'] ?? '';
$finishing_type = $row['finishing_type'] ?? '';
$spec = $row['spec'] ?? '';
$box_width = $row['box_width'] ?? '';
$box_height = $row['box_height'] ?? '';
$front_bottom_width = $row['front_bottom_width'] ?? '';
$rail_width = $row['rail_width'] ?? '';
$unitprice = $row['unitprice'] ?? '';
$description = $row['description'] ?? '';
$priceDate = $row['priceDate'] ?? '';
$created_at = $row['created_at'] ?? '';
$updated_at = $row['updated_at'] ?? '';
// 이미지 URL 설정 (list.php와 동일한 로직)
$imgUrl = '';
if ($seconditem === '가이드레일') {
$jsonFile = $_SERVER['DOCUMENT_ROOT'].'/guiderail/guiderail.json';
if (file_exists($jsonFile)) {
$jsonData = file_get_contents($jsonFile);
$data = json_decode($jsonData, true);
if (is_array($data)) {
foreach ($data as $item) {
if (
$item['model_name'] === $model_name &&
$item['check_type'] === $check_type &&
$item['finishing_type'] === $finishing_type
) {
$imgUrl = "";
break;
}
}
}
}
} elseif ($seconditem === '케이스') {
switch ($check_type) {
case '양면 점검구':
$imgUrl = "
";
break;
case '밑면 점검구':
$imgUrl = "
";
break;
case '후면 점검구':
$imgUrl = "
";
break;
default:
$imgUrl = "
";
break;
}
} elseif ($seconditem === '하단마감재') {
$jsonFile = $_SERVER['DOCUMENT_ROOT'].'/bottombar/bottombar.json';
if (file_exists($jsonFile)) {
$jsonData = file_get_contents($jsonFile);
$data = json_decode($jsonData, true);
if (is_array($data)) {
foreach ($data as $item) {
if (
$item['model_name'] === $model_name &&
$item['finishing_type'] === $finishing_type
) {
$imgUrl = "";
break;
}
}
}
}
} elseif ($seconditem === 'L-BAR') {
$imgUrl = "
";
} elseif ($seconditem === '보강평철') {
$imgUrl = "
";
} elseif ($seconditem === '마구리') {
$imgUrl = "
";
} elseif ($seconditem === '가이드레일용 연기차단재' || $seconditem === '케이스용 연기차단재') {
$imgUrl = "
";
} else {
$imgUrl = "
";
}
?>