5) { sleep(1); header("Location:" . $WebSite . "login/login_form.php"); exit; } include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php'; $mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : ''; $num = isset($_REQUEST["num"]) ? $_REQUEST["num"] : ""; $tablename = isset($_REQUEST["tablename"]) ? $_REQUEST["tablename"] : ""; if($mode === 'copy') $title_message = "(데이터복사) 공사 수주"; else $title_message = "공사 수주 " ; ?> <?=$title_message?> prepare($sql); $stmh->bindValue(1,$num,PDO::PARAM_STR); $stmh->execute(); $count = $stmh->rowCount(); if($count<1){ print "검색결과가 없습니다.
"; }else{ $row = $stmh->fetch(PDO::FETCH_ASSOC); include "_row.php"; // handover 테이블에서 현재 work num에 해당하는 데이터 존재 여부 확인 $handover_exists = false; $last_estimate_amount = 0; // 마지막 차수의 견적 금액 if (!empty($num) && is_numeric($num)) { try { $handover_sql = "SELECT COUNT(*) as count, num FROM {$DB}.work_handover WHERE parentnum = ? AND is_deleted = 'N'"; $handover_stmt = $pdo->prepare($handover_sql); $handover_stmt->execute([$num]); $handover_result = $handover_stmt->fetch(PDO::FETCH_ASSOC); $handover_exists = ($handover_result['count'] > 0); $handover_num = $handover_result['num']; // 인수인계번호 } catch (PDOException $e) { error_log("Handover 존재 확인 오류: " . $e->getMessage()); } // estimateList JSON에서 마지막 견적 금액(col4) 추출 if (!empty($estimateList)) { try { $estimates = is_string($estimateList) ? json_decode($estimateList, true) : $estimateList; if (is_array($estimates) && !empty($estimates)) { // 마지막 견적의 금액(col4) 가져오기 $lastEstimate = end($estimates); if (isset($lastEstimate['col4']) && !empty($lastEstimate['col4'])) { $last_estimate_amount = $lastEstimate['col4']; } } } catch (Exception $e) { error_log("estimateList JSON 파싱 오류: " . $e->getMessage()); // JSON 파싱 실패 시 기존 방식으로 폴백 if (!empty($row['estimate4_supply'])) { $last_estimate_amount = $row['estimate4_supply']; } elseif (!empty($row['estimate3_supply'])) { $last_estimate_amount = $row['estimate3_supply']; } elseif (!empty($row['estimate2_supply'])) { $last_estimate_amount = $row['estimate2_supply']; } elseif (!empty($row['estimate1_supply'])) { $last_estimate_amount = $row['estimate1_supply']; } } } else { // estimateList가 비어있을 때 기존 방식으로 폴백 if (!empty($row['estimate4_supply'])) { $last_estimate_amount = $row['estimate4_supply']; } elseif (!empty($row['estimate3_supply'])) { $last_estimate_amount = $row['estimate3_supply']; } elseif (!empty($row['estimate2_supply'])) { $last_estimate_amount = $row['estimate2_supply']; } elseif (!empty($row['estimate1_supply'])) { $last_estimate_amount = $row['estimate1_supply']; } } } function formatDate($date) { return ($date != "0000-00-00" && !empty($date)) ? date("Y-m-d", strtotime($date)) : ""; } $workday = formatDate($row["workday"]); $cableday = formatDate($row["cableday"]); $asday = formatDate($row["asday"]); $endworkday = formatDate($row["endworkday"]); $endcableday = formatDate($row["endcableday"]); $asproday = formatDate($row["asproday"]); $asendday = formatDate($row["asendday"]); $promiseday = formatDate($row["promiseday"]); $setdate = formatDate($row["setdate"]); // 3자리마다 콤마를 추가하는 함수 function formatNumberWithCommas($number) { if (is_numeric($number)) { return number_format($number); } return $number; } // 변수를 선언하고 3자리마다 콤마를 추가 $estimate1_supply = isset($row['estimate1_supply']) ? formatNumberWithCommas($row['estimate1_supply']) : ''; $estimate1_vat = isset($row['estimate1_vat']) ? formatNumberWithCommas($row['estimate1_vat']) : ''; $estimate2_supply = isset($row['estimate2_supply']) ? formatNumberWithCommas($row['estimate2_supply']) : ''; $estimate2_vat = isset($row['estimate2_vat']) ? formatNumberWithCommas($row['estimate2_vat']) : ''; $estimate3_supply = isset($row['estimate3_supply']) ? formatNumberWithCommas($row['estimate3_supply']) : ''; $estimate3_vat = isset($row['estimate3_vat']) ? formatNumberWithCommas($row['estimate3_vat']) : ''; $estimate4_supply = isset($row['estimate4_supply']) ? formatNumberWithCommas($row['estimate4_supply']) : ''; $estimate4_vat = isset($row['estimate4_vat']) ? formatNumberWithCommas($row['estimate4_vat']) : ''; $bill1_supply = isset($row['bill1_supply']) ? formatNumberWithCommas($row['bill1_supply']) : ''; $bill1_vat = isset($row['bill1_vat']) ? formatNumberWithCommas($row['bill1_vat']) : ''; $bill2_supply = isset($row['bill2_supply']) ? formatNumberWithCommas($row['bill2_supply']) : ''; $bill2_vat = isset($row['bill2_vat']) ? formatNumberWithCommas($row['bill2_vat']) : ''; $bill3_supply = isset($row['bill3_supply']) ? formatNumberWithCommas($row['bill3_supply']) : ''; $bill3_vat = isset($row['bill3_vat']) ? formatNumberWithCommas($row['bill3_vat']) : ''; $bill4_supply = isset($row['bill4_supply']) ? formatNumberWithCommas($row['bill4_supply']) : ''; $bill4_vat = isset($row['bill4_vat']) ? formatNumberWithCommas($row['bill4_vat']) : ''; $bill5_supply = isset($row['bill5_supply']) ? formatNumberWithCommas($row['bill5_supply']) : ''; $bill5_vat = isset($row['bill5_vat']) ? formatNumberWithCommas($row['bill5_vat']) : ''; $bill6_supply = isset($row['bill6_supply']) ? formatNumberWithCommas($row['bill6_supply']) : ''; $bill6_vat = isset($row['bill6_vat']) ? formatNumberWithCommas($row['bill6_vat']) : ''; } }catch (PDOException $Exception) { print "오류: ".$Exception->getMessage(); } } if ($mode !== "modify" and $mode !== "copy" and $mode !== "view" ) { include '_request.php'; $regist_day =$today; } if ($mode=="copy" ){ try{ $sql = "select * from " . $DB . "." . $tablename . " where num = ? "; $stmh = $pdo->prepare($sql); $stmh->bindValue(1,$num,PDO::PARAM_STR); $stmh->execute(); $count = $stmh->rowCount(); if($count<1){ print "검색결과가 없습니다.
"; }else{ $row = $stmh->fetch(PDO::FETCH_ASSOC); } include '_row.php'; $regist_day =$today; }catch (PDOException $Exception) { print "오류: ".$Exception->getMessage(); } // 자료번호 초기화 $num = 0; } ?>
 
장비사용
No 장비명 투입일 회수일 수량 업체명 담당자 연락처 비고
견적
차수 계약일 공급가액 부가세 합계 첨부
계산서/입금 ' . $option . '   '; } ?> ' . $option . '   '; } ?>
차수 세금계산서발행 공급가액 부가세 발행합계 입금일자 입금액
합계
발행 미수금 총 미수금 입금약속일
하자보증기간
시작일 종료일 기간 메모
경리부 수금관련 기록
공사진행 '; } ?>
인정검사
인정검사자 인정라벨부착일
공사 진행 상태
시공 결선
현장 대리인
인수인계서 자료있음 자료없음
0) { ?>
현장명 공사담당
현장주소 등록일
건설사 담당 연락처
발주처 담당 연락처
발주처 결재 공무담당 연락처
시공투입일 시공팀 시공완료일
결선작업일 결선팀 결선완료일
모터회사/용량 M 전원 M 유선/무선
시공내역 및 수량
설계변경 내역
경동기업 출고List query($sqloutput); $temp = $stmh->rowCount(); ?>
fetch(PDO::FETCH_ASSOC)) { $item_num = $rowtmp["num"]; $con_num = $rowtmp["con_num"]; $outdate = $rowtmp["outdate"]; $item_indate = $rowtmp["indate"]; $item_comment = $rowtmp["comment"]; if ($outdate != "") { $week = array("(일)", "(월)", "(화)", "(수)", "(목)", "(금)", "(토)"); $outdate = $outdate . $week[date('w', strtotime($outdate))]; } ?>
공사번호 출고일자 접수일 내역/코멘트
getMessage(); } ?>
공사메모
자재출고 내역 정리
기성청구
AS