현장명 : = $outworkplace ?>
가이드레일 모델 :
= $prodCode ?>
형태 : =$selected_check_type ?>
$inputVal) {
$bendingRateVal = $product['bendingRates'][$index];
$result = $inputVal - $bendingRateVal;
$accumulatedSum += $result;
$sums[] = $accumulatedSum;
}
return $sums;
}
// 혼합형일 경우는 2개를 순회한다.
foreach ($typesToProcess as $currentType) {
if($isMixedType) { // 혼합형일때는 분류해준다.
if ($currentType === '벽면형') {
$rail_length = $rail_length1;
$rail_width = $rail_width1;
} elseif ($currentType === '측면형') {
$rail_length = $rail_length2;
$rail_width = $rail_width2;
}
}
include $_SERVER['DOCUMENT_ROOT'] . "/guiderail/fun_guiderail.php" ;
$productData = getProductData($model_name, $finishing_type, $rail_length, $rail_width, $check_type);
?>
| 번호 |
재질 |
절곡치수 |
길이 수량 면적 |
$product)
{
$length_data = [
['length' => 2438, 'sum' => 0],
['length' => 3000, 'sum' => 0],
['length' => 3500, 'sum' => 0],
['length' => 4000, 'sum' => 0],
['length' => 4300, 'sum' => 0]
];
foreach ($eList as $item) {
$railvalidLength = floatval($item['col23']); // 셔터의 유효 길이
$railType = trim($item['col6']); // 벽부형, 측면형, 혼합형 여부 판단
// 혼합형일 경우 1개씩 계산, 나머지는 2개씩 계산
for ($i = 0; $i < count($length_data); $i++) {
$length = $length_data[$i]['length'];
if ($railvalidLength <= $length) {
$length_data[$i]['sum'] += ($railType == '혼합형(120*70)(120*120)') ? 1 : 2;
break;
}
}
}
// 벽면형과 측면형을 혼합형일 때는 두 개씩, 나머지는 하나씩 출력
$wall_rows = [];
$side_rows = [];
if($screenorslat == 'screen') {
foreach ($length_data as $row) {
if ($row['sum'] > 0) {
if ($railType == '혼합형(120*70)(120*120)') {
$wall_rows[] = [
'length' => $row['length'],
'sum' => $row['sum']
];
$side_rows[] = [
'length' => $row['length'],
'sum' => $row['sum']
];
} elseif ($railType == '벽면형(120*70)') {
$wall_rows[] = [
'length' => $row['length'],
'sum' => $row['sum']
];
} elseif ($railType == '측면형(120*120)') {
$side_rows[] = [
'length' => $row['length'],
'sum' => $row['sum']
];
}
}
}
}
else { // slat인 경우
foreach ($length_data as $row) {
if ($row['sum'] > 0) {
if ($railType == '혼합형(130*75)(130*125)') {
$wall_rows[] = [
'length' => $row['length'],
'sum' => $row['sum']
];
$side_rows[] = [
'length' => $row['length'],
'sum' => $row['sum']
];
} elseif ($railType == '벽면형(130*75)') {
$wall_rows[] = [
'length' => $row['length'],
'sum' => $row['sum']
];
} elseif ($railType == '측면형(135*125)') {
$side_rows[] = [
'length' => $row['length'],
'sum' => $row['sum']
];
}
}
}
}
// 합계 행
echo '';
echo '| ' . $product['label'] . ' | ';
echo '' . $product['material'] . ' | ';
echo '';
$lastSum = 0;
// sums와 colors를 함께 사용하여 배경색을 설정
foreach ($product['sums'] as $index => $sum) {
$backgroundColor = $product['colors'][$index] ? 'background-color: gray;' : '';
$foreColor = $product['colors'][$index] ? 'text-white ' : '';
echo '' . $sum . '';
$lastSum = $sum;
}
echo ' | ';
echo '' ;
echo '';
echo '';
foreach ($length_data as $row) {
if($row['sum']>0) {
$length = $row['length'];
echo '';
$surang = $row['sum'];
echo '| ' . $length . ' | ';
$area = intval($length) * $surang * $lastSum / 1000000 ;
echo '' . $surang . ' | ';
echo ' '. number_format($area,2) . ' | ';
echo ' ';
}
}
echo '';
echo ' ';
echo ' | ';
echo '
';
// A각 표시 행
echo '';
echo '| ';
foreach ($product['aAngles'] as $angle) {
echo '' . ($angle ? 'A"' : ' ') . '';
}
echo ' | ';
echo '
';
}
?>
'1219', 'quantity' => intval($item['col38'])],
['length' => '2438', 'quantity' => intval($item['col39'])],
['length' => '3000', 'quantity' => intval($item['col40'])],
['length' => '3500', 'quantity' => intval($item['col41'])],
['length' => '4000', 'quantity' => intval($item['col42'])],
['length' => '4150', 'quantity' => intval($item['col43'])],
];
} elseif ($screenorslat === 'slat') {
// 철재스라트 데이터
$finMaterial = $item['col7']; // SUS마감/EGI마감
$boxSize = $item['col37'] === 'custom' ? $item['col37_custom'] : $item['col37'];
$frontBottom = $item['col37_frontbottom'];
$railWidth = $item['col37_railwidth'];
$exitDirection = $item['col37_boxdirection'];
$boxtopcover_sum = $item['col45'];
$sideFinSu = $item['col47'];
$screenorslat = 'slat';
$boxLengths = [
['length' => '1219', 'quantity' => intval($item['col39'])],
['length' => '2438', 'quantity' => intval($item['col40'])],
['length' => '3000', 'quantity' => intval($item['col41'])],
['length' => '3500', 'quantity' => intval($item['col42'])],
['length' => '4000', 'quantity' => intval($item['col43'])],
['length' => '4150', 'quantity' => intval($item['col44'])],
];
}
// 동일한 형태의 셔터박스를 그룹화
$key = "{$boxSize}|{$frontBottom}|{$railWidth}|{$exitDirection}";
if (!isset($shutterData[$key])) {
$shutterData[$key] = [
'boxSize' => $boxSize,
'frontBottom' => $frontBottom,
'railWidth' => $railWidth,
'exitDirection' => $exitDirection,
'boxtopcover_sum' => $boxtopcover_sum,
'sideFinSu' => $sideFinSu,
'count' => 0,
'type' => $screenorslat,
'screenorslat' => $screenorslat,
// 'boxLengths' => array_fill(0, count($boxLengths), 0), // 길이별 누적 수량
'boxsum' => array_fill(0, count($boxLengths), 0), // 길이별 누적 수량
'boxLengths' => $boxLengths ,
];
}
// 그룹화된 셔터박스 정보 업데이트
$shutterData[$key]['count']++;
foreach ($boxLengths as $index => $lengthData) {
$shutterData[$key]['boxsum'][$index] += $lengthData['quantity'];
}
}
// echo '
';
// print_r($shutterData);
// echo '
';
// 셔터박스 데이터를 화면에 표시
?>
$shutter): ?>
|
셔터박스 (점검구방향: = $exitDirection; ?>)
전면 밑: = $frontBottom; ?> 레일폭: = $railWidth; ?>
가로(폭) x 세로(높이)
= $boxSize; ?>
|
';
// print_r($productData);
// echo '';
// 참조 해제 (필수는 아님, 안전하게 하기 위해)
// unset($product);
?>
| 번호 |
재질 |
절곡치수 |
길이 수량 면적 |
$product): ?>
';
echo '' . $product['label'] . ' | ';
echo ' EGI 1.55T | ';
echo '';
$lastSum = 0;
// sums와 colors를 함께 사용하여 배경색을 설정
foreach ($product['sums'] as $index => $sum) {
$backgroundColor = $product['colors'][$index] ? 'background-color: gray;' : '';
$foreColor = $product['colors'][$index] ? 'text-white ' : '';
echo '' . $sum . '';
$lastSum =$sum; // 마지막 합을 저장
}
echo ' | ';
$box_data = [];
$length_data = [
['length' => '1219', 'sum' => 0],
['length' => '2438', 'sum' => 0],
['length' => '3000', 'sum' => 0],
['length' => '3500', 'sum' => 0],
['length' => '4000', 'sum' => 0],
['length' => '4150', 'sum' => 0],
];
$found = false;
foreach ($box_data as &$box_row) {
if ($box_row['size'] === $boxSize) {
$box_row['sum'] += $shutter['count'];
$found = true;
break;
}
}
if (!$found) {
$box_data[] = [
'size' => $boxSize,
'sum' => $shutter['count'],
];
}
// 길이와 수량 데이터 반영
foreach ($shutter['boxsum'] as $index => $quantity) {
if ($quantity > 0) {
$length_data[$index]['sum'] += $quantity;
}
}
$box_rowspan = array_filter($box_data, function ($row) {
return $row['sum'] > 0;
});
$length_rowspan = count(array_filter($length_data, function($length) {
return $length['sum'] > 0;
}));
echo '' ;
echo '';
echo ' ';
echo '';
if (!strpos($product['label'], '마구리(가로)') && !strpos($product['label'], '마구리(세로)') && !strpos($product['label'], '상부덮개' )) {
foreach ($length_data as $row) {
if($row['sum']>0) {
$length = $row['length'];
echo '';
if (strpos($product['label'], '마구리(가로)') ) {
$surang = $sideFinSu;
$length = $boxHeight + 104;
}
else if (strpos($product['label'], '마구리(세로)') ) {
$surang = $sideFinSu;
$length = $boxWidth + 104;
}
else if (strpos($product['label'], '상부덮개') !== false) {
$surang = $boxtopcover_sum;
}
else if( $selected_check_typeFlat === '양쪽 점검구' and strpos($product['label'], '후면 코너부') !== false ) {
$surang = $row['sum']*2;
}
else {
$surang = $row['sum'];
}
echo '| ' . $length . ' | ';
$area = intval($length) * $lastSum / 1000000 ;
echo '' . $surang . ' | ';
echo ' '. number_format($area,2) . ' | ';
echo ' ';
}
}
}
else if ( strpos($product['label'], '마구리(가로)') || strpos($product['label'], '마구리(세로)') ) {
echo '';
if (strpos($product['label'], '마구리(가로)') ) {
$surang = $sideFinSu;
$length = $boxHeight + 104;
}
else if (strpos($product['label'], '마구리(세로)') ) {
$surang = $sideFinSu;
$length = $boxWidth + 104;
}
echo '| ' . $length . ' | ';
$area = intval($length) * $lastSum / 1000000 * $surang;
echo '' . $surang . ' | ';
echo ' '. number_format($area,2) . ' | ';
echo ' ';
}
else if (strpos($product['label'], '상부덮개') ) {
echo '';
$surang =$boxtopcover_sum;
echo '| 1219 | ';
$area = 1219 * $lastSum / 1000000 * $surang;
echo '' . $surang . ' | ';
echo ' '. number_format($area,2) . ' | ';
echo ' ';
}
echo '';
echo ' ';
echo ' ';
echo ' | '; ;
echo '';
// A각 표시 행
echo '';
echo '| ';
foreach ($product['aAngles'] as $angle) {
echo '' . ($angle ? 'A"' : ' ') . '';
}
echo ' | ';
echo '
';
?>
prepare($sql);
$stmh->bindValue(1, $prodCode, PDO::PARAM_STR); // prodCode와 일치하는 값
$stmh->execute();
$row = $stmh->fetch(PDO::FETCH_ASSOC);
include '../bottombar/_row.php';
} catch (PDOException $Exception) {
echo "오류: ".$Exception->getMessage();
exit;
}
?>
|
하장바세트
폭:
=$rail_length?>
x
높이:
=$railWidth?>
|
[
'size' => '(60*40)',
'length_3000' => 0,
'length_4000' => 0
],
'하단보강엘바' => [
'size' => '(60*17)',
'length_3000' => 0,
'length_4000' => 0
],
'하단보강평철' => [
'size' => '',
'length_3000' => 0,
'length_4000' => 0
]
];
// 데이터를 누적하여 합산
foreach ($eList as $item) {
}
foreach ($eList as $item) {
if ($screenorslat === 'screen') {
// 스크린 데이터
$item_data['하단마감재']['length_3000'] += intval($item['col49']);
$item_data['하단마감재']['length_4000'] += intval($item['col50']);
$item_data['하단보강엘바']['length_3000'] += intval($item['col52']);
$item_data['하단보강엘바']['length_4000'] += intval($item['col53']);
$item_data['하단보강평철']['length_3000'] += intval($item['col55']);
$item_data['하단보강평철']['length_4000'] += intval($item['col56']);
} elseif ($screenorslat === 'slat') {
// 철재스라트 데이터
$item_data['하단마감재']['length_3000'] += intval($item['col50']);
$item_data['하단마감재']['length_4000'] += intval($item['col51']);
}
}
?>
| 번호 |
재질 |
절곡치수 |
길이 수량 면적 |
$product):
// 합계 행
echo '';
echo '| ' . $product['label'] . ' | ';
echo '' . $product['material'] . ' | ';
echo '';
// sums와 colors를 함께 사용하여 배경색을 설정
$lastSum = 0;
foreach ($product['sums'] as $index => $sum) {
$backgroundColor = $product['colors'][$index] ? 'background-color: gray;' : '';
$foreColor = $product['colors'][$index] ? 'text-white ' : '';
echo '' . $sum . '';
$lastSum = $sum;
}
echo ' | ';
echo '';
echo '';
echo ' ';
echo '';
// 현재 제품에 해당하는 길이와 수량을 출력 (예: 하장바는 하단 마감재 데이터만 출력)
$current_item_data = [];
switch ($product['label']) {
case '1번(하장바)':
$current_item_data = $item_data['하단마감재'];
break;
case '2번(L-바)':
$current_item_data = $item_data['하단보강엘바'];
break;
case '3번(평철)':
$current_item_data = $item_data['하단보강평철'];
break;
// 추가적인 품목이 있다면 여기에 케이스를 추가
}
// 해당 제품의 길이별 데이터 출력
if (!empty($current_item_data)) {
if ($current_item_data['length_4000'] > 0) {
echo '';
echo '| 4000 | ';
echo '' . $current_item_data['length_4000'] . ' | ';
$area_4000 = $current_item_data['length_4000'] * 4000 * $lastSum / 1000000;
echo '' . number_format($area_4000, 2) . ' | ';
echo ' ';
}
if ($current_item_data['length_3000'] > 0) {
echo '';
echo '| 3000 | ';
echo '' . $current_item_data['length_3000'] . ' | ';
$area_3000 = $current_item_data['length_3000'] * 4000 * $lastSum / 1000000;
echo '' . number_format($area_3000, 2) . ' | ';
echo ' ';
}
}
echo '';
echo ' ';
echo ' ';
echo ' | ';
echo '
';
// A각 표시 행
echo '';
echo '| ';
foreach ($product['aAngles'] as $angle) {
echo '' . ($angle ? 'A"' : ' ') . '';
}
echo ' | ';
echo ' | ';
echo ' | ';
echo ' | ';
echo '
';
?>
2438, 'sum' => 0],
['length' => 3000, 'sum' => 0],
['length' => 3500, 'sum' => 0],
['length' => 4000, 'sum' => 0],
['length' => 4300, 'sum' => 0]
];
foreach ($eList as $item) {
if ($screenorslat === 'screen') {
// 스크린 데이터
$quantities = [
floatval($item['col31']), // 2438 크기 수량
floatval($item['col32']), // 3000 크기 수량
floatval($item['col33']), // 3500 크기 수량
floatval($item['col34']), // 4000 크기 수량
floatval($item['col35']) // 4300 크기 수량
];
// 각 크기에 맞는 수량을 smoke_data에 추가
for ($i = 0; $i < count($smoke_data); $i++) {
$smoke_data[$i]['sum'] += $quantities[$i];
}
} elseif ($screenorslat === 'slat') {
// 철재스라트 데이터
$quantities = [
floatval($item['col32']),
floatval($item['col33']),
floatval($item['col34']),
floatval($item['col35']),
floatval($item['col36'])
];
// 각 크기에 맞는 수량을 smoke_data에 추가
for ($i = 0; $i < count($smoke_data); $i++) {
$smoke_data[$i]['sum'] += $quantities[$i];
}
}
}
// 연기차단재 데이터가 있는 경우만 출력
$smoke_rows = [];
foreach ($smoke_data as $row) {
if ($row['sum'] > 0) {
$smoke_rows[] = [
'length' => $row['length'],
'sum' => $row['sum']
];
}
}
$smoke_rowspan = count($smoke_rows);
// W80 기준 숫자 찾기
$smokeban80 = 0;
foreach ($eList as $item) {
if ($screenorslat === 'screen') {
// 스크린 데이터
$smokeban80 += floatval($item['col47']);
} elseif ($screenorslat === 'slat') {
// 철재스라트 데이터
$smokeban80 += floatval($item['col48']);
}
}
echo '
';
echo '
';
echo '
';
echo '';
echo '';
echo '| 세부품명 | ';
echo '재질 | ';
echo ' 길이 수량 | ';
echo '
';
echo '';
echo '| 레일용 [W50] | ';
echo 'EGI 0.8T 화이바 글라스 코팅직물 | ';
echo '';
echo '';
echo '';
$side_sum = 0;
foreach ($smoke_data as $row) {
if($row['sum']>0) {
echo '';
echo '| ' . $row['length'] . ' | ';
echo '' . $row['sum'] . ' | ';
echo ' ';
$side_sum += $row['sum'];
} }
echo '';
echo ' ';
echo '';
echo ' | ';
echo '
';
echo '';
echo '| 케이스용 [W80] | ';
echo 'EGI 0.8T 화이바 글라스 코팅직물 | ';
echo '';
echo '';
echo ' ';
echo '';
echo '';
echo '| 3000 | ';
echo '' . $smokeban80 . ' | ';
echo ' ';
echo '';
echo ' ';
echo ' | ';
echo '
';
echo '';
echo '
';
echo '
';
echo '
';
?>