5) { sleep(1); header("Location:" . $WebSite . "login/login_form.php"); exit; } ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); 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"] : ""; require_once $_SERVER['DOCUMENT_ROOT'] . '/load_GoogleDriveSecond.php'; // attached, image에 대한 정보 불러오기 require_once $_SERVER['DOCUMENT_ROOT'].'/estimate/fetch_unitprice.php'; // 견적에 필요한 함수포함 slatPrice 함수 포함 // 절곡단가 가져오는 임시테이블 $tablename_tmp = 'price_bend'; try { // 최신 데이터를 가져오기 위해 ORDER BY와 LIMIT을 추가 $sql = "SELECT * FROM {$DB}.$tablename_tmp where (is_deleted IS NULL or is_deleted = '0') ORDER BY num DESC LIMIT 1"; $stmh = $pdo->prepare($sql); $stmh->execute(); $row = $stmh->fetch(PDO::FETCH_ASSOC); // $row 배열로 DB 정보를 불러온다. $itemList_bend = isset($row['itemList']) ? $row['itemList'] : []; $load_priceDate = $row['registedate'] ?? ''; // itemList 문자열일 때만 json_decode 실행 if (is_string($itemList_bend)) { $itemList_bend = json_decode($itemList_bend, true); } // itemList 유효한 배열이 아닐 경우 빈 배열로 초기화 if (!is_array($itemList_bend)) { $itemList_bend = []; } } catch (PDOException $Exception) { print "오류: ".$Exception->getMessage(); } // 주자재 단가 가져오기 $tablename_price_raw_materials = 'price_raw_materials'; $query = "SELECT itemList FROM $DB.$tablename_price_raw_materials WHERE is_deleted IS NULL OR is_deleted = 0"; $stmt = $pdo->prepare($query); $stmt->execute(); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); // 대상 자재 목록 (구분 항목) $materials = ['방화', '방범','조인트바', '실리카', '화이바', '와이어', '신설비상문','제연커튼','실리카원단','화이바원단','와이어원단','단열셔터','이중파이프']; // 자재 단가 저장용 배열 $materialBasePrice = []; // 자재 코드 $materialBaseCode = []; foreach ($materials as $material) { foreach ($rows as $row) { $itemList = json_decode($row['itemList'], true); $price = unapprovedSlatPrice($itemList, '', $material); // col1=스크린, col2=각 자재명 col15에서 비인정 불러옴 $code = unapprovedSlatCode($itemList, $material); // col1=스크린, col2=각 자재명 $materialBasePrice[$material] = floatval($price); $materialBaseCode[$material] = $code; } } // print_r($materialBasePrice); // print_r($materialBaseCode); // 자바스크립트에 단가 데이터 전달 echo ""; // 전동개폐기 등 Ecount 단가 가져오기 // (2) KDunitprice 테이블 전체 또는 필요한 prodcode만 조회 $prodcode_sql = " SELECT prodcode, item_name, spec, unitprice FROM {$DB}.KDunitprice WHERE is_deleted IS NULL "; $stmt = $pdo->prepare($prodcode_sql); $stmt->execute(); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); // (3) PHP associative 배열에 담기 $unitInfo = []; foreach ($rows as $r) { $unitInfo[$r['item_name']] = [ 'prodcode' => $r['prodcode'], 'item_name' => $r['item_name'], 'spec' => $r['spec'], 'price' => (float)$r['unitprice'], ]; } // print_r($unitInfo); // (4) JS 전역 변수로 내보내기 echo ""; if($mode === 'copy') $title_message = "(데이터복사) 수주내역"; else $title_message = "수주내역 " ; $authorities = ["개발자","전진","노완호","이세희","함신옥","손금주","이은진","이경호","김진호","이세희","함신옥"]; // 서버에서 날짜 값을 받아온다고 가정 $receivedCode = ""; // 예시값, 실제로는 서버에서 받아오는 값으로 대체 if(!empty($authority)) echo 'authority : ' . $authority ; ?> <?=$title_message?> prepare($sql); $stmh->bindValue(1,$num,PDO::PARAM_STR); $stmh->execute(); $count = $stmh->rowCount(); $row = $stmh->fetch(PDO::FETCH_ASSOC); // $row 배열로 DB 정보를 불러온다. if($count<1){ print "검색결과가 없습니다.
"; }else{ include '_row.php'; if($indate!="0000-00-00") $indate = date("Y-m-d", strtotime( $indate) ); else $indate=""; if($outdate!="0000-00-00") $outdate = date("Y-m-d", strtotime( $outdate) ); else $outdate=""; // output_extra 테이블에서 데이터 불러오기 require_once $_SERVER['DOCUMENT_ROOT'] . '/output/load_output_extraTable.php'; } }catch (PDOException $Exception) { print "오류: ".$Exception->getMessage(); } } else if ($mode!="modify" && $mode!="view" && $mode!="copy" ){ // 수정모드가 아닐때 신규 자료일때는 변수 초기화 한다. include '_request.php'; $outdate=date("Y-m-d"); $indate=date("Y-m-d"); $orderdate=date("Y-m-d"); $orderman=$_SESSION["name"]; $outworkplace=null; $outputplace=null; $receiver=null; $phone=null; $comment=null; $updatecomment=null; $con_num=null; $steel=null; $motor=null; $delivery=null; $regist_state="등록"; $is_deleted=null; $motor_state ='등록'; $bend_state ='등록'; $root="경동"; if(!empty($_SESSION["division"])) if($_SESSION["division"]=='주일') $root="주일"; } else { // 복사, 분할등 선택시 try{ $sql = "select * from $DB.$tablename where num = ? "; $stmh = $pdo->prepare($sql); $stmh->bindValue(1,$num,PDO::PARAM_STR); $stmh->execute(); $count = $stmh->rowCount(); $row = $stmh->fetch(PDO::FETCH_ASSOC); // $row 배열로 DB 정보를 불러온다. if($count<1){ print "검색결과가 없습니다.
"; }else{ include '_row.php'; if($indate!="0000-00-00") $indate = date("Y-m-d", strtotime( $indate) ); else $indate=""; if($outdate!="0000-00-00") $outdate = date("Y-m-d", strtotime( $outdate) ); else $outdate=""; $outdate=date("Y-m-d"); $indate=date("Y-m-d"); $orderdate=date("Y-m-d"); $orderman=$_SESSION["name"]; // output_extra 테이블에서 데이터 불러오기 $sql_extra = "SELECT * FROM $DB.$tablename_sub WHERE parent_num = ?"; $stmh_extra = $pdo->prepare($sql_extra); $stmh_extra->bindValue(1, $num, PDO::PARAM_STR); $stmh_extra->execute(); $row_extra = $stmh_extra->fetch(PDO::FETCH_ASSOC); // 값이 있으면 _row_extra.php로 변수화 if ($row_extra) { include '_row_extra.php'; } } }catch (PDOException $Exception) { print "오류: ".$Exception->getMessage(); } } // print 'devMode : ' . $devMode; // print 'ET_total : ' . $ET_total; // print 'regist_state : ' . $regist_state; // print 'prodcode : ' . $prodCode ; // (2) PHP에서 JSON 직렬화 $deliveryfeeList_jsonString = json_encode($deliveryfeeList); // 물류비용 JSON // (3) HTML에서 문제될 수 있는 특수문자를 URL 인코딩 // rawurlencode() / urlencode() 등 사용 가능 $deliveryfeeList_encodedJson = rawurlencode($deliveryfeeList_jsonString); $detailJson_jsonString = json_encode($detailJson); // 물류비용 JSON $detailJson_jsonString_encodedJson = rawurlencode($detailJson_jsonString); ?>

       
 
배송비 기록
구분 하차업체명 상차지 물류업체명 차량톤수 금 액 부가세 합계 착/선불 차량번호 기사 연락처 비고
스크린 비인정제품
번호 종류 부호 추가메모 가로(W) 세로(H) 수량(틀) 비상문 인쇄면 인쇄방향 좌간격 우간격 개구부 덮개폭 좌문구 중앙문구 우문구 도면 발주서 기록
비인정 철재-슬랫
번호 품목 부호 재질 가로(W) 세로(H) 수량
(EA)
비상문 띄울
치수
힌지
종류
힌지
띄울치수
힌지
방향
발주서 기록
전동 개폐기 & 베어링부(브라켓트)
일련번호 품명 모터 용량 사이즈 수량 구형/신형 안전리미트 비고
브라켓(mm) 샤프트(인치)
연동 폐쇄기구(제어기) & 방범스위치
일련번호 품명 수량 구형/신형 비고
절곡품 - 규격 및 타입은 도면 참조 > 풀세트 불러오기
일련번호 품명 두께 길이(mm) 검색 폭합(mm) 이미지 수량 비고
부자재
일련번호 품명 규격 길이(mm) 수량 비고
스크린

스크린   발주서     

'; // print_r($screenlist_item); // echo ''; $counter++; $screenlist_item['num'] = $counter; // 고유 번호 부여 $floors = isset($screenlist_item['floors']) ? trim($screenlist_item['floors']) : ''; $text1 = isset($screenlist_item['text1']) ? trim($screenlist_item['text1']) : ''; $cutwidth = isset($screenlist_item['cutwidth']) ? trim($screenlist_item['cutwidth']) : ''; $cutheight = isset($screenlist_item['cutheight']) ? trim($screenlist_item['cutheight']) : ''; $number = isset($screenlist_item['number']) ? trim($screenlist_item['number']) : ''; $printside = isset($screenlist_item['printside']) ? trim($screenlist_item['printside']) : ''; $direction = isset($screenlist_item['direction']) ? trim($screenlist_item['direction']) : ''; $exititem = isset($screenlist_item['exititem']) ? trim($screenlist_item['exititem']) : ''; if ($exititem == '0') { $intervalnum = ''; $intervalnumsecond = ''; $exitinterval = ''; $cover = ''; } else { $intervalnum = isset($screenlist_item['intervalnum']) ? trim($screenlist_item['intervalnum']) : ''; $intervalnumsecond = isset($screenlist_item['intervalnumsecond']) ? trim($screenlist_item['intervalnumsecond']) : ''; $exitinterval = isset($screenlist_item['exitinterval']) ? trim($screenlist_item['exitinterval']) : ''; $cover = isset($screenlist_item['cover']) ? trim($screenlist_item['cover']) : ''; } $memo = isset($screenlist_item['memo']) ? trim($screenlist_item['memo']) : ''; $text2 = isset($screenlist_item['text2']) ? trim($screenlist_item['text2']) : ''; $drawbottom1 = isset($screenlist_item['drawbottom1']) ? trim($screenlist_item['drawbottom1']) : ''; $drawbottom2 = isset($screenlist_item['drawbottom2']) ? trim($screenlist_item['drawbottom2']) : ''; $drawbottom3 = isset($screenlist_item['drawbottom3']) ? trim($screenlist_item['drawbottom3']) : ''; $remain_check = isset($screenlist_item['remain_check']) ? trim($screenlist_item['remain_check']) : ''; $done_check = isset($screenlist_item['done_check']) ? trim($screenlist_item['done_check']) : ''; $mid_check = isset($screenlist_item['mid_check']) ? trim($screenlist_item['mid_check']) : ''; $left_check = isset($screenlist_item['left_check']) ? trim($screenlist_item['left_check']) : ''; $right_check = isset($screenlist_item['right_check']) ? trim($screenlist_item['right_check']) : ''; $draw = isset($screenlist_item['draw']) ? trim($screenlist_item['draw']) : ''; if($draw != 'screen0.jpg' && !empty($draw) && $draw != 'screennull.jpg') $imagePath = '../img/screen/' . $draw; else $imagePath = ''; ?>
번호 + 부호 추가메모 가로(W) 세로(H) 수량(틀) 비상문 인쇄면 인쇄방향 좌간격 우간격 개구부 덮개폭 좌문구 중앙문구 우문구 도면 발주서 기록 작업
onclick="showLargeImage(this)"> + -
철재스라트

철재(스라트)   발주서     

번호 + 부호 재질 가로(W) 세로(H) 수량(틀) 비상문 띄울치수 힌지
종류
힌지
띄울치수
힌지
방향
발주서 기록 작업
+ -