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

220 lines
10 KiB
PHP

<?php
function generateTableSection($id, $title, $badgeClass = 'bg-primary', $user_idtem= '', $process=null, $mode ) {
$sumColumns = range(0, 71);
// echo $user_idtem . '</br>';
echo "
<div class='table-responsive mb-5'>
<div class='d-flex align-items-center p-1 mt-1 mb-2'>
<button type='button' id='estimateScreen_view' class='btn btn-primary btn-sm ms-2 me-3 mt-1'> <i class='bi bi-chevron-down'></i> </button>
<span class='badge $badgeClass fs-6 me-3'>$title</span>
<span class='text-primary fs-4 viewNoBtn add-row me-4' data-table='{$id}Table' style='margin-right: 5px;'>+</span>";
if($process =='견적서')
{
echo "
<button type='button' id='viewEstimateUnit' class='btn btn-secondary btn-sm me-2' data-table='{$id}Table' > <i class='bi bi-grid-3x3'></i> 단가표 </button> ";
if($mode === 'view') {
echo " <button type='button' id='viewEstimate' class='btn btn-dark btn-sm ' data-table='{$id}Table' > <i class='bi bi-card-heading'></i> 견적서 </button>
<button type='button' id='viewEstimateDetail' class='btn btn-danger btn-sm ms-2' data-table='{$id}Table' > <i class='bi bi-card-heading'></i> 산출내역서 </button>
";
}
}
echo "
</div>
<div id='estimate_screenDiv' >
<div class='d-flex row'> &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
<table class='table table-bordered' id='{$id}Table'>
<thead id='thead_{$id}'>
<tr>
<th rowspan='6'>행추가<br>삭제</th>
<th rowspan='6'>일련<br>번호</th>
<th rowspan='6'>층수</th>
<th rowspan='6'>부호</th>
<th rowspan='6'>제품명</th>
<th rowspan='6'>종류</th>
<th rowspan='4' colspan='2'>가이드레일</th>
<th rowspan='4' colspan='2'>①오픈사이즈</th>
<th rowspan='4' colspan='2'>②-1제작사이즈 <br> <span class='text-primary'> (스크린)</span></th>
<th rowspan='4' colspan='2'>②-2제작사이즈 <br> <span class='text-danger'> (부자재)</span></th>
<th rowspan='6'>③면적</th>
<th rowspan='6'>④중량</th>
<th rowspan='6'>셔터<br>수량</th>
<th rowspan='4' colspan='3'> 연동제어기</th>
<th rowspan='2' colspan='7'> ⑤모터</th>
<th rowspan='1' colspan='36'> 절곡</th>
<th rowspan='1' colspan='14'> 부자재</th>
</tr>
<tr>
<th rowspan='2' colspan='13'>⑥가이드레일(한쌍)</th>
<th rowspan='2' colspan='13'>⑦케이스(셔터박스)</th>
<th rowspan='2' colspan='10'>⑧하단마감재</th>
<th rowspan='2' colspan='8'>⑨감기샤프트</th>
<th rowspan='2' colspan='4'>⑩각파이프</th>
<th rowspan='4'>⑪환봉</th>
<th rowspan='4'>⑫앵글</th>
</tr>
<tr>
<th rowspan='4'> <span class='text-primary'> 모터 견적가 포함</span> </th>
<th rowspan='4'> 전원 </th>
<th rowspan='4'> 유/무선 </th>
<th rowspan='4'> 용량 </th>
<th rowspan='2' colspan='3'> 브라케트 </th>
</tr>
<tr>
<th rowspan='1' colspan='6'>가이드레일 마감/보강재</th>
<th rowspan='3'>하부base1</th>
<th rowspan='3'>하부base2</th>
<th colspan='5'> 레일용 연기차단재</th>
<th colspan='12'> 케이스 </th>
<th> 케이스용<br>연기차단재</th>
<th colspan='3'>하장바</th>
<th colspan='3'>엘바</th>
<th colspan='3'>보강평철</th>
<th colspan='1'>무게평철</th>
<th rowspan='3'>인치</th>
<th colspan='7'>원형파이프</th>
<th rowspan='2' colspan='4'> 50*30*1.4T </th>
</tr>
<tr>
<th rowspan='2'> 설치유형 </th>
<th rowspan='2'> 마감유형 </th>
<th rowspan='2'> 가로 </th>
<th rowspan='2'> 높이 </th>
<th rowspan='2'> 가로 </th>
<th rowspan='2'> 높이 </th>
<th rowspan='2'> 가로 </th>
<th rowspan='2'> 높이 </th>
<th rowspan='2'> 매립 </th>
<th rowspan='2'> 노출 </th>
<th rowspan='2'> 매립형 <br> 뒷박스 </th>
<th rowspan='2'>가로*세로</th>
<th rowspan='2'>사이즈<br>(인치)</th>
<th rowspan='2'>받침용<br>앵글</th>
<th rowspan='2'>size</th>
<th rowspan='2'>2438</th>
<th rowspan='2'>3000</th>
<th rowspan='2'>3500</th>
<th rowspan='2'>4000</th>
<th rowspan='2'>4300</th>
<th colspan='5'>W50</th>
<th colspan='8'>셔터박스</th>
<th rowspan='1'>상부덮개</th>
<th colspan='3'>마구리</th>
<th rowspan='2' colspan='1'>W80</th>
<th colspan='3'>60*40</th>
<th colspan='3'>60*17</th>
<th colspan='3'>50</th>
<th colspan='1'>12T</th>
<th colspan='1'>연결 샤프트</th>
<th colspan='3'>4</th>
<th colspan='3'>5</th>
</tr>
<tr>
<th rowspan='1'>2438</th>
<th rowspan='1'>3000</th>
<th rowspan='1'>3500</th>
<th rowspan='1'>4000</th>
<th rowspan='1'>4300</th>
<th>규격 <br> (사이즈,전면밑,레일폭,점검구방향) </th>
<th>size</th>
<th>1219</th>
<th>2438</th>
<th>3000</th>
<th>3500</th>
<th>4000</th>
<th>4150</th>
<th>1219*389</th>
<th>size</th>
<th>날개</th>
<th>수량</th>
<th>size</th>
<th>3000</th>
<th>4000</th>
<th>size</th>
<th>3000</th>
<th>4000</th>
<th>size</th>
<th>3000</th>
<th>4000</th>
<th>2000</th>
<th>인치 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/&nbsp; &nbsp; 길이&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/ &nbsp; &nbsp;수량</th>
<th>3000</th>
<th>4500</th>
<th>6000</th>
<th>6000</th>
<th>7000</th>
<th>8200</th>
<th>보강개수환산</th>
<th>size</th>
<th>3000</th>
<th>6000</th>
<th>3000</th>
<th>2500</th>
</tr> " ;
// $user_id가 'pro'일 경우 열 번호를 표시하는 th 행 추가 개발자 모드
if ($user_idtem === 'pro') {
echo "<tr> <th> </th> ";
$j = 0;
// 71에서 스크린제작사이즈 열 추가로 73
for ($i = 1; $i <= 71; $i++) {
if($i==10)
{
$j = 'col10_SW'; // 스크린제작치수 가로
echo "<th class='text-primary'>$j</th>";
$j = 'col11_SH'; // 스크린제작치수 높이
echo "<th class='text-primary'>$j</th>";
$j = 'col' . $i ;
}
else if($i==18)
{
$j = 'col18_brand'; // 계산서 발행 주체
echo "<th class='text-primary'>$j</th>";
$j = 'col' . $i ;
echo "<th class='text-primary'>$j</th>";
$j = 'col18_wireless';
}
else if($i>20) {
$j = 'col' . ($i) ; // 18번 유/무선 모터 이후 숫자 맞춤
if($i==47) {
echo "<th class='text-primary'>$j</th>";
$j = 'col45_wing' ; // 45번 마구리 날개여부)
}
}
else
$j = 'col' . $i ;
echo "<th class='text-primary'>$j</th>";
}
echo "</tr>";
echo "<tr> <th> </th> ";
// 75에서 스크린제작사이즈 열 추가로 77
for ($i = 2; $i <= 77; $i++) {
echo "<th class='text-success'>$i</th>";
}
echo "</tr>";
}
echo "</thead>
<tbody id='{$id}Group'>
<!-- 자동생성 -->
</tbody>
<tfoot class='table-secondary'>
<tr>
<th class='text-end' colspan='14'> 합계 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </th>";
for ($i = 15; $i <= 77; $i++) {
echo "<th class='text-center' id='totalCol{$i}'></th>";
}
echo " </tr> ";
echo " </tfoot>
</table>
<div class='d-flex row mt-3 mb-5'> &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
</div>
</div>
</div>
</div>
";
}
?>