Files
sam-kd/output/common/guiderail_slat_confirm.php
hskwon aca1767eb9 초기 커밋: 5130 레거시 시스템
- URL 하드코딩 → .env APP_URL 기반 동적 URL로 변경
- DB 연결 하드코딩 → .env 기반으로 변경
- MySQL strict mode DATE 오류 수정
2025-12-10 20:14:31 +09:00

113 lines
4.8 KiB
PHP

<!-- 가이드 레일 -->
<?php
// 가이드레일 데이터 초기화
$row3_data = [
['length' => 2438, 'sum' => 0],
['length' => 3000, 'sum' => 0],
['length' => 3500, 'sum' => 0],
['length' => 4000, 'sum' => 0],
['length' => 4300, 'sum' => 0]
];
$wall_rows = [];
$side_rows = [];
// $eList 순회하여 데이터 추출
foreach ($eList as $item) {
$validLength = floatval($item['col24']); // 유효 길이
$railType = trim($item['col6']); // 레일 타입 (혼합형, 벽면형, 측면형)
foreach ($row3_data as &$row) {
if ($validLength <= $row['length']) {
if ($railType == '혼합형(130*75)(130*125)') {
$row['sum'] += 1;
$wall_rows[] = ['length' => $row['length'], 'sum' => 1];
$side_rows[] = ['length' => $row['length'], 'sum' => 1];
} elseif ($railType == '벽면형(130*75)') {
$row['sum'] += 2;
$wall_rows[] = ['length' => $row['length'], 'sum' => $row['sum']];
} elseif ($railType == '측면형(130*125)') {
$row['sum'] += 2;
$side_rows[] = ['length' => $row['length'], 'sum' => $row['sum']];
}
break;
}
}
}
unset($row); // 참조 제거
$wall_rowspan = count($wall_rows);
$side_rowspan = count($side_rows);
?>
<div class="row">
<div class="col-sm-12">
<div class="d-flex align-items-center justify-content-start">
<table class="table" style="border-collapse: collapse;">
<?php if (!empty($wall_rows) || !empty($side_rows)): ?>
<thead class="table-secondary">
<tr>
<?php if (!empty($wall_rows)): ?>
<th class="text-center">벽면형 (130*75)</th>
<?php endif; ?>
<?php if (!empty($side_rows)): ?>
<th class="text-center">측면형 (130*125)</th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php
$maxRows = max(count($wall_rows), count($side_rows));
for ($i = 0; $i < $maxRows; $i++) {
echo '<tr>';
// 벽면형 데이터 출력
if (!empty($wall_rows) && $i < count($wall_rows)) {
if ($i == 0) {
echo '<td rowspan="' . count($wall_rows) . '" class="text-center">
<img src="../img/guiderail/guiderail_' . $prodCode . '_wall_130x75.jpg" alt="벽면형" width="250">
</td>';
}
} elseif (!empty($wall_rows)) {
echo '<td></td>';
}
// 측면형 데이터 출력
if (!empty($side_rows) && $i < count($side_rows)) {
if ($i == 0) {
echo '<td rowspan="' . count($side_rows) . '" class="text-center">
<img src="../img/guiderail/guiderail_' . $prodCode . '_side_130x125.jpg" alt="측면형" width="250">
</td>';
}
} elseif (!empty($side_rows)) {
echo '<td></td>';
}
echo '</tr>';
}
?>
<!-- 하부 BASE 데이터 출력 -->
<tr>
<?php if (!empty($wall_rows)): ?>
<td colspan="2" class="text-center blueBold fw-bold">하부BASE (140*85)</td>
<?php endif; ?>
<?php if (!empty($side_rows)): ?>
<td colspan="2" class="text-center blueBold fw-bold">하부BASE (140*135)</td>
<?php endif; ?>
</tr>
</tbody>
<?php else: ?>
<tbody>
<tr>
<td colspan="6" class="text-center text-danger">데이터가 없습니다.</td>
</tr>
</tbody>
<?php endif; ?>
</table>
</div>
</div>
</div>