초기 커밋: 5130 레거시 시스템
- URL 하드코딩 → .env APP_URL 기반 동적 URL로 변경 - DB 연결 하드코딩 → .env 기반으로 변경 - MySQL strict mode DATE 오류 수정
This commit is contained in:
4
output/.!12437!update.php
Normal file
4
output/.!12437!update.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
session_start();
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>=8) {
|
||||
117
output/000.php
Normal file
117
output/000.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
// make의 자료를 output의 screenlist로 json형태로 저장된 자료를 변형하는 코드이다.
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect(); // DB 연결 함수 호출
|
||||
|
||||
// 타임 리미트 설정
|
||||
set_time_limit(0);
|
||||
|
||||
// 출력 버퍼링 비활성화
|
||||
ob_implicit_flush(true);
|
||||
|
||||
// 디버깅을 위한 에러 출력 설정
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
print 'screenlist 일부값을 변경하기 <br>';
|
||||
|
||||
try {
|
||||
// output 테이블에서 num 컬럼 가져오기
|
||||
$output_sql = "SELECT num FROM chandj.output";
|
||||
$output_stmt = $pdo->prepare($output_sql);
|
||||
$output_stmt->execute();
|
||||
$output_results = $output_stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$total_rows = count($output_results);
|
||||
$current_row = 0;
|
||||
|
||||
foreach ($output_results as $output_row) {
|
||||
$output_num = $output_row['num'];
|
||||
// make 테이블에서 outputnum이 같은 데이터를 가져오기
|
||||
$make_sql = "SELECT `upnum`, `outputnum`, `num`, `text1`, `text2`, `text3`, `text4`, `text5`,
|
||||
`ordercompany`, `callname`, `cutwidth`, `cutheight`, `number`, `printside`,
|
||||
`direction`, `exititem`, `intervalnum`, `intervalnumsecond`, `memo`, `draw`,
|
||||
`drawbottom1`, `drawbottom2`, `drawbottom3`, `exitinterval`, `cover`, `left_check`,
|
||||
`mid_check`, `right_check`, `done_check`, `remain_check`
|
||||
FROM chandj.make WHERE outputnum = :outputnum ORDER BY num ASC";
|
||||
$make_stmt = $pdo->prepare($make_sql);
|
||||
$make_stmt->bindParam(':outputnum', $output_num, PDO::PARAM_INT);
|
||||
$make_stmt->execute();
|
||||
$make_results = $make_stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$screenlist_data = [];
|
||||
|
||||
if ($make_stmt->rowCount() > 0) {
|
||||
// 각 make 테이블의 행을 배열로 추가
|
||||
foreach ($make_results as $make_row) {
|
||||
// '우에서'를 '우'로, '좌에서'를 '좌'로 변경
|
||||
// '띄우고'를 '띄고'로
|
||||
$drawbottom1 = str_replace(['', '좌에서'], ['우', '좌'], $make_row['drawbottom1']);
|
||||
$drawbottom2 = str_replace(['우에서', '좌에서'], ['우', '좌'], $make_row['drawbottom2']);
|
||||
$drawbottom3 = str_replace(['우에서', '좌에서'], ['우', '좌'], $make_row['drawbottom3']);
|
||||
|
||||
$screenlist_data[] = [
|
||||
'upnum' => $make_row['upnum'],
|
||||
'outputnum' => $make_row['outputnum'],
|
||||
'num' => $make_row['num'],
|
||||
'text1' => $make_row['text1'],
|
||||
'text2' => $make_row['text2'],
|
||||
'text3' => $make_row['text3'],
|
||||
'text4' => $make_row['text4'],
|
||||
'text5' => $make_row['text5'],
|
||||
'ordercompany' => $make_row['ordercompany'],
|
||||
'callname' => $make_row['callname'],
|
||||
'cutwidth' => $make_row['cutwidth'],
|
||||
'cutheight' => $make_row['cutheight'],
|
||||
'number' => $make_row['number'],
|
||||
'printside' => $make_row['printside'],
|
||||
'direction' => $make_row['direction'],
|
||||
'exititem' => $make_row['exititem'],
|
||||
'intervalnum' => $make_row['intervalnum'],
|
||||
'intervalnumsecond' => $make_row['intervalnumsecond'],
|
||||
'memo' => $make_row['memo'],
|
||||
'draw' => $make_row['draw'],
|
||||
'drawbottom1' => $drawbottom1,
|
||||
'drawbottom2' => $drawbottom2,
|
||||
'drawbottom3' => $drawbottom3,
|
||||
'exitinterval' => $make_row['exitinterval'],
|
||||
'cover' => $make_row['cover'],
|
||||
'left_check' => $make_row['left_check'],
|
||||
'mid_check' => $make_row['mid_check'],
|
||||
'right_check' => $make_row['right_check'],
|
||||
'done_check' => $make_row['done_check'],
|
||||
'remain_check' => $make_row['remain_check']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// JSON으로 인코딩
|
||||
$screenlist_json = json_encode($screenlist_data, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
// output 테이블의 screenlist 업데이트
|
||||
$update_sql = "UPDATE chandj.output SET screenlist = :screenlist WHERE num = :num";
|
||||
$update_stmt = $pdo->prepare($update_sql);
|
||||
$update_stmt->bindParam(':screenlist', $screenlist_json, PDO::PARAM_STR);
|
||||
$update_stmt->bindParam(':num', $output_num, PDO::PARAM_INT);
|
||||
if (!$update_stmt->execute()) {
|
||||
echo "Error updating record for num $output_num: " . implode(", ", $update_stmt->errorInfo()) . "<br>";
|
||||
}
|
||||
|
||||
// 진행 상황 출력
|
||||
$current_row++;
|
||||
echo "Processed rows: $current_row<br>";
|
||||
if ($current_row % 100 == 0) {
|
||||
echo "Processed $current_row of $total_rows rows<br>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "Finished processing all records.";
|
||||
} catch (PDOException $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
120
output/001.php
Normal file
120
output/001.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
// make의 자료를 output의 screenlist로 json형태로 저장된 자료를 변형하는 코드이다.
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect(); // DB 연결 함수 호출
|
||||
|
||||
// 타임 리미트 설정
|
||||
set_time_limit(0);
|
||||
|
||||
// 출력 버퍼링 비활성화
|
||||
ob_implicit_flush(true);
|
||||
|
||||
// 디버깅을 위한 에러 출력 설정
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
print 'screenlist 일부값을 변경하기 <br>';
|
||||
|
||||
try {
|
||||
// output 테이블에서 num 컬럼 가져오기
|
||||
$output_sql = "SELECT num FROM chandj.output";
|
||||
$output_stmt = $pdo->prepare($output_sql);
|
||||
$output_stmt->execute();
|
||||
$output_results = $output_stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$total_rows = count($output_results);
|
||||
$current_row = 0;
|
||||
|
||||
foreach ($output_results as $output_row) {
|
||||
$output_num = $output_row['num'];
|
||||
// make 테이블에서 outputnum이 같은 데이터를 가져오기
|
||||
$make_sql = "SELECT `upnum`, `outputnum`, `num`, `text1`, `text2`, `text3`, `text4`, `text5`,
|
||||
`ordercompany`, `callname`, `cutwidth`, `cutheight`, `number`, `printside`,
|
||||
`direction`, `exititem`, `intervalnum`, `intervalnumsecond`, `memo`, `draw`,
|
||||
`drawbottom1`, `drawbottom2`, `drawbottom3`, `exitinterval`, `cover`, `left_check`,
|
||||
`mid_check`, `right_check`, `done_check`, `remain_check`
|
||||
FROM chandj.make WHERE outputnum = :outputnum ORDER BY num ASC";
|
||||
$make_stmt = $pdo->prepare($make_sql);
|
||||
$make_stmt->bindParam(':outputnum', $output_num, PDO::PARAM_INT);
|
||||
$make_stmt->execute();
|
||||
$make_results = $make_stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$screenlist_data = [];
|
||||
|
||||
if ($make_stmt->rowCount() > 0) {
|
||||
// 각 make 테이블의 행을 배열로 추가
|
||||
foreach ($make_results as $make_row) {
|
||||
// '띄우고'를 '띄고'로 변경
|
||||
$drawbottom1 = str_replace('띄우고', '띄고', $make_row['drawbottom1']);
|
||||
$drawbottom2 = str_replace('띄우고', '띄고', $make_row['drawbottom2']);
|
||||
$drawbottom3 = str_replace('띄우고', '띄고', $make_row['drawbottom3']);
|
||||
|
||||
// draw 필드에서 파일명만 추출
|
||||
preg_match('/<img src="\.\.\/img\/screen\/(.+?)">/', $make_row['draw'], $matches);
|
||||
$draw = $matches[1] ?? '';
|
||||
|
||||
$screenlist_data[] = [
|
||||
'upnum' => $make_row['upnum'],
|
||||
'outputnum' => $make_row['outputnum'],
|
||||
'num' => $make_row['num'],
|
||||
'text1' => $make_row['text1'],
|
||||
'text2' => $make_row['text2'],
|
||||
'text3' => $make_row['text3'],
|
||||
'text4' => $make_row['text4'],
|
||||
'text5' => $make_row['text5'],
|
||||
'ordercompany' => $make_row['ordercompany'],
|
||||
'callname' => $make_row['callname'],
|
||||
'cutwidth' => $make_row['cutwidth'],
|
||||
'cutheight' => $make_row['cutheight'],
|
||||
'number' => $make_row['number'],
|
||||
'printside' => $make_row['printside'],
|
||||
'direction' => $make_row['direction'],
|
||||
'exititem' => $make_row['exititem'],
|
||||
'intervalnum' => $make_row['intervalnum'],
|
||||
'intervalnumsecond' => $make_row['intervalnumsecond'],
|
||||
'memo' => $make_row['memo'],
|
||||
'draw' => $draw,
|
||||
'drawbottom1' => $drawbottom1,
|
||||
'drawbottom2' => $drawbottom2,
|
||||
'drawbottom3' => $drawbottom3,
|
||||
'exitinterval' => $make_row['exitinterval'],
|
||||
'cover' => $make_row['cover'],
|
||||
'left_check' => $make_row['left_check'],
|
||||
'mid_check' => $make_row['mid_check'],
|
||||
'right_check' => $make_row['right_check'],
|
||||
'done_check' => $make_row['done_check'],
|
||||
'remain_check' => $make_row['remain_check']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// JSON으로 인코딩
|
||||
$screenlist_json = json_encode($screenlist_data, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
// output 테이블의 screenlist 업데이트
|
||||
$update_sql = "UPDATE chandj.output SET screenlist = :screenlist WHERE num = :num";
|
||||
$update_stmt = $pdo->prepare($update_sql);
|
||||
$update_stmt->bindParam(':screenlist', $screenlist_json, PDO::PARAM_STR);
|
||||
$update_stmt->bindParam(':num', $output_num, PDO::PARAM_INT);
|
||||
if (!$update_stmt->execute()) {
|
||||
echo "Error updating record for num $output_num: " . implode(", ", $update_stmt->errorInfo()) . "<br>";
|
||||
}
|
||||
|
||||
// 진행 상황 출력
|
||||
$current_row++;
|
||||
echo "Processed rows: $current_row<br>";
|
||||
if ($current_row % 100 == 0) {
|
||||
echo "Processed $current_row of $total_rows rows<br>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "Finished processing all records.";
|
||||
} catch (PDOException $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
81
output/002.php
Normal file
81
output/002.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect(); // DB 연결 함수 호출
|
||||
|
||||
// 타임 리미트 설정
|
||||
set_time_limit(0);
|
||||
|
||||
// 출력 버퍼링 비활성화
|
||||
ob_implicit_flush(true);
|
||||
|
||||
// 디버깅을 위한 에러 출력 설정
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
print 'slat 정보 업데이트 시작<br>';
|
||||
|
||||
try {
|
||||
// output 테이블에서 num, slatlist 컬럼 가져오기
|
||||
$output_sql = "SELECT num, slatlist FROM chandj.output";
|
||||
$output_stmt = $pdo->prepare($output_sql);
|
||||
$output_stmt->execute();
|
||||
$output_results = $output_stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$total_rows = count($output_results);
|
||||
$current_row = 0;
|
||||
|
||||
foreach ($output_results as $output_row) {
|
||||
$output_num = $output_row['num'];
|
||||
$slatlist_json = $output_row['slatlist'];
|
||||
$slatlist_data = json_decode($slatlist_json, true);
|
||||
|
||||
$slat = '0';
|
||||
$slat_su = 0;
|
||||
$slat_m2 = 0;
|
||||
|
||||
if (!is_null($slatlist_data) && !empty($slatlist_data)) {
|
||||
$slat = '1';
|
||||
foreach ($slatlist_data as $row_temp) {
|
||||
$number = (int)$row_temp["number"];
|
||||
$cutwidth = (int)$row_temp["cutwidth"];
|
||||
$cutheight = (int)$row_temp["cutheight"];
|
||||
|
||||
$slat_su += $number;
|
||||
$slat_m2 += $cutwidth / 1000 * $cutheight / 1000 * $number;
|
||||
}
|
||||
}
|
||||
|
||||
$slat_state = '제작완료';
|
||||
|
||||
// output 테이블 업데이트
|
||||
$update_sql = "UPDATE chandj.output
|
||||
SET slat = :slat, slat_state = :slat_state, slat_su = :slat_su, slat_m2 = :slat_m2
|
||||
WHERE num = :num";
|
||||
$update_stmt = $pdo->prepare($update_sql);
|
||||
$update_stmt->bindParam(':slat', $slat, PDO::PARAM_STR);
|
||||
$update_stmt->bindParam(':slat_state', $slat_state, PDO::PARAM_STR);
|
||||
$update_stmt->bindParam(':slat_su', $slat_su, PDO::PARAM_INT);
|
||||
$update_stmt->bindParam(':slat_m2', $slat_m2, PDO::PARAM_STR); // m2 값을 소수점으로 저장하기 위해 STR 사용
|
||||
$update_stmt->bindParam(':num', $output_num, PDO::PARAM_INT);
|
||||
|
||||
if (!$update_stmt->execute()) {
|
||||
echo "Error updating record for num $output_num: " . implode(", ", $update_stmt->errorInfo()) . "<br>";
|
||||
}
|
||||
|
||||
// 진행 상황 출력
|
||||
$current_row++;
|
||||
echo "Processed rows: $current_row<br>";
|
||||
if ($current_row % 100 == 0) {
|
||||
echo "Processed $current_row of $total_rows rows<br>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "Finished processing all records.";
|
||||
} catch (PDOException $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
109
output/_request.php
Normal file
109
output/_request.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
$con_num = isset($_REQUEST["con_num"]) ? $_REQUEST["con_num"] : '';
|
||||
$outdate = isset($_REQUEST["outdate"]) ? $_REQUEST["outdate"] : '';
|
||||
$indate = isset($_REQUEST["indate"]) ? $_REQUEST["indate"] : '';
|
||||
$orderman = isset($_REQUEST["orderman"]) ? $_REQUEST["orderman"] : '';
|
||||
$outworkplace = isset($_REQUEST["outworkplace"]) ? $_REQUEST["outworkplace"] : '';
|
||||
$outputplace = isset($_REQUEST["outputplace"]) ? $_REQUEST["outputplace"] : '';
|
||||
$phone = isset($_REQUEST["phone"]) ? $_REQUEST["phone"] : '';
|
||||
$receiver = isset($_REQUEST["receiver"]) ? $_REQUEST["receiver"] : '';
|
||||
$comment = isset($_REQUEST["comment"]) ? $_REQUEST["comment"] : '';
|
||||
$root = isset($_REQUEST["root"]) ? $_REQUEST["root"] : '';
|
||||
$steel = isset($_REQUEST["steel"]) ? $_REQUEST["steel"] : '';
|
||||
$motor = isset($_REQUEST["motor"]) ? $_REQUEST["motor"] : '';
|
||||
$delivery = isset($_REQUEST["delivery"]) ? $_REQUEST["delivery"] : '';
|
||||
$regist_state = isset($_REQUEST["regist_state"]) ? $_REQUEST["regist_state"] : '';
|
||||
$bend_state = isset($_REQUEST["bend_state"]) ? $_REQUEST["bend_state"] : '';
|
||||
$motor_state = isset($_REQUEST["motor_state"]) ? $_REQUEST["motor_state"] : '';
|
||||
|
||||
$is_deleted = isset($_REQUEST["is_deleted"]) ? $_REQUEST["is_deleted"] : '0' ;
|
||||
$searchtag = isset($_REQUEST["searchtag"]) ? $_REQUEST["searchtag"] : null ;
|
||||
$update_log = isset($_REQUEST["update_log"]) ? $_REQUEST["update_log"] : null ;
|
||||
|
||||
$screen = isset($_REQUEST["screen"]) ? $_REQUEST["screen"] : "" ;
|
||||
$screen_state = isset($_REQUEST["screen_state"]) ? $_REQUEST["screen_state"] : '' ;
|
||||
$screen_su = isset($_REQUEST["screen_su"]) ? $_REQUEST["screen_su"] : '' ;
|
||||
$screen_m2 = isset($_REQUEST["screen_m2"]) ? $_REQUEST["screen_m2"] : '' ;
|
||||
|
||||
$slat = isset($_REQUEST["slat"]) ? $_REQUEST["slat"] : "" ;
|
||||
$slat_state = isset($_REQUEST["slat_state"]) ? $_REQUEST["slat_state"] : '' ;
|
||||
$slat_su = isset($_REQUEST["slat_su"]) ? $_REQUEST["slat_su"] : '' ;
|
||||
$slat_m2 = isset($_REQUEST["slat_m2"]) ? $_REQUEST["slat_m2"] : '' ;
|
||||
|
||||
$updatecomment = isset($_REQUEST["updatecomment"]) ? $_REQUEST["updatecomment"] : '' ;
|
||||
|
||||
$secondord = isset($_REQUEST['secondord']) ? $_REQUEST['secondord'] : '';
|
||||
$secondordman = isset($_REQUEST['secondordman']) ? $_REQUEST['secondordman'] : '';
|
||||
$secondordmantel = isset($_REQUEST['secondordmantel']) ? $_REQUEST['secondordmantel'] : '';
|
||||
$secondordnum = isset($_REQUEST['secondordnum']) ? $_REQUEST['secondordnum'] : '';
|
||||
$prodCode = isset($_REQUEST['prodCode']) ? $_REQUEST['prodCode'] : '';
|
||||
$warrantyNum = isset($_REQUEST['warrantyNum']) ? $_REQUEST['warrantyNum'] : '';
|
||||
$orderdate = isset($_REQUEST['orderdate']) ? $_REQUEST['orderdate'] : '';
|
||||
$lotNum = isset($_REQUEST['lotNum']) ? $_REQUEST['lotNum'] : '';
|
||||
|
||||
$etcList = isset($_REQUEST['etcList']) ? $_REQUEST['etcList'] : '{}';
|
||||
|
||||
$screen_unapprovedList = isset($_REQUEST['screen_unapprovedList']) ? $_REQUEST['screen_unapprovedList'] : '{}';
|
||||
$slat_unapprovedList = isset($_REQUEST['slat_unapprovedList']) ? $_REQUEST['slat_unapprovedList'] : '{}';
|
||||
$motorList = isset($_REQUEST['motorList']) ? $_REQUEST['motorList'] : '{}';
|
||||
$bendList = isset($_REQUEST['bendList']) ? $_REQUEST['bendList'] : '{}';
|
||||
$controllerList = isset($_REQUEST['controllerList']) ? $_REQUEST['controllerList'] : '{}';
|
||||
|
||||
$recordscreen = isset($_REQUEST['recordscreen']) ? $_REQUEST['recordscreen'] : '{}';
|
||||
$recordslat = isset($_REQUEST['recordslat']) ? $_REQUEST['recordslat'] : '{}';
|
||||
$recordbending = isset($_REQUEST['recordbending']) ? $_REQUEST['recordbending'] : '{}';
|
||||
$screenlist = isset($_REQUEST['screenlist']) ? $_REQUEST['screenlist'] : '{}';
|
||||
$slatlist = isset($_REQUEST['slatlist']) ? $_REQUEST['slatlist'] : '{}';
|
||||
$estimateList = isset($_REQUEST['estimateList']) ? $_REQUEST['estimateList'] : '{}';
|
||||
$estimateSlatList = isset($_REQUEST['estimateSlatList']) ? $_REQUEST['estimateSlatList'] : '{}';
|
||||
$COD = isset($_REQUEST['COD']) ? $_REQUEST['COD'] : '{}'; // 출고증
|
||||
$recordslatMid = isset($_REQUEST['recordslatMid']) ? $_REQUEST['recordslatMid'] : '{}';
|
||||
$recordscreenMid = isset($_REQUEST['recordscreenMid']) ? $_REQUEST['recordscreenMid'] : '{}';
|
||||
$recordbendingMid = isset($_REQUEST['recordbendingMid']) ? $_REQUEST['recordbendingMid'] : '{}';
|
||||
$warranty = isset($_REQUEST['warranty']) ? $_REQUEST['warranty'] : '';
|
||||
$ordersheet = isset($_REQUEST['ordersheet']) ? $_REQUEST['ordersheet'] : '{}';
|
||||
$ordersheet_slat = isset($_REQUEST['ordersheet_slat']) ? $_REQUEST['ordersheet_slat'] : '{}';
|
||||
|
||||
$ACIregDate = isset($_REQUEST["ACIregDate"]) ? $_REQUEST["ACIregDate"] : ''; // 인정검사 관련 4가지
|
||||
$ACIaskDate = isset($_REQUEST["ACIaskDate"]) ? $_REQUEST["ACIaskDate"] : '';
|
||||
$ACIdoneDate = isset($_REQUEST["ACIdoneDate"]) ? $_REQUEST["ACIdoneDate"] : '';
|
||||
$ACImemo = isset($_REQUEST["ACImemo"]) ? $_REQUEST["ACImemo"] : '';
|
||||
|
||||
$iList = isset($_REQUEST['iList']) ? $_REQUEST['iList'] : '{}'; // 인정검사 자료
|
||||
$recordjointbar = isset($_REQUEST['recordjointbar']) ? $_REQUEST['recordjointbar'] : '{}'; // 조인트바 중간검사
|
||||
$ACIcheck = isset($_REQUEST["ACIcheck"]) ? $_REQUEST["ACIcheck"] : null;
|
||||
$deliveryfeeList = isset($_REQUEST['deliveryfeeList']) ? $_REQUEST['deliveryfeeList'] : '{}'; // 배송비 json
|
||||
$ACIgroupCode = $_REQUEST["ACIgroupCode"] ?? '';
|
||||
$ACIgroupName = $_REQUEST["ACIgroupName"] ?? '';
|
||||
|
||||
// 매출과 관련된 견적에서 가져오는 변수 추가 25/04/22일자
|
||||
$detailJson = isset($_REQUEST['detailJson']) ? $_REQUEST['detailJson'] : '{}';
|
||||
$estimateTotal = isset($_REQUEST["estimateTotal"]) ? $_REQUEST["estimateTotal"] : 0;
|
||||
$EstimateFirstSum = isset($_REQUEST["EstimateFirstSum"]) ? $_REQUEST["EstimateFirstSum"] : 0;
|
||||
$EstimateUpdatetSum = isset($_REQUEST["EstimateUpdatetSum"]) ? $_REQUEST["EstimateUpdatetSum"] : 0;
|
||||
$EstimateDiffer = isset($_REQUEST["EstimateDiffer"]) ? $_REQUEST["EstimateDiffer"] : 0;
|
||||
$estimateSurang = isset($_REQUEST["estimateSurang"]) ? $_REQUEST["estimateSurang"] : 0;
|
||||
$EstimateDiscountRate = isset($_REQUEST["EstimateDiscountRate"]) ? $_REQUEST["EstimateDiscountRate"] : '';
|
||||
$EstimateDiscount = isset($_REQUEST["EstimateDiscount"]) ? $_REQUEST["EstimateDiscount"] : 0;
|
||||
$EstimateFinalSum = isset($_REQUEST["EstimateFinalSum"]) ? $_REQUEST["EstimateFinalSum"] : 0;
|
||||
|
||||
$pjnum = isset($_REQUEST['pjnum']) ? $_REQUEST['pjnum'] : '';
|
||||
$major_category = isset($_REQUEST['major_category']) ? $_REQUEST['major_category'] : '';
|
||||
$position = isset($_REQUEST['position']) ? $_REQUEST['position'] : '';
|
||||
$makeWidth = isset($_REQUEST['makeWidth']) ? $_REQUEST['makeWidth'] : '';
|
||||
$makeHeight = isset($_REQUEST['makeHeight']) ? $_REQUEST['makeHeight'] : '';
|
||||
$maguriWing = isset($_REQUEST['maguriWing']) ? $_REQUEST['maguriWing'] : '';
|
||||
$inspectionFee = isset($_REQUEST['inspectionFee']) ? $_REQUEST['inspectionFee'] : 50000;
|
||||
$accountDate = isset($_REQUEST['accountDate']) ? $_REQUEST['accountDate'] : date('Y-m-d');
|
||||
$accountList = isset($_REQUEST['accountList']) ? $_REQUEST['accountList'] : '{}';
|
||||
$ET_unapproved = isset($_REQUEST['ET_unapproved']) ? $_REQUEST['ET_unapproved'] : 0; // 견적 비인정 금액
|
||||
$ET_total = isset($_REQUEST['ET_total']) ? $_REQUEST['ET_total'] : 0; // 견적 총 금액
|
||||
$estimate_num = isset($_REQUEST['estimate_num']) ? $_REQUEST['estimate_num'] : ''; // 견적서 번호
|
||||
$devMode = $_REQUEST['devMode'] ?? '' ; // 개발자모드
|
||||
$displayText = $_REQUEST['displayText'] ?? '' ; // 발주서 출고증등 표시할 텍스트
|
||||
|
||||
// 주자재 부자재 체크 추가요청 25/06/29
|
||||
$slatcheck = isset($_REQUEST['slatcheck']) ? $_REQUEST['slatcheck'] : '';
|
||||
$partscheck = isset($_REQUEST['partscheck']) ? $_REQUEST['partscheck'] : '';
|
||||
$requestBendingASSY = isset($_REQUEST['requestBendingASSY']) ? $_REQUEST['requestBendingASSY'] : '';
|
||||
?>
|
||||
109
output/_row.php
Normal file
109
output/_row.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
$num = isset($row["num"]) ? $row["num"] : '';
|
||||
$parent_num = isset($row["parent_num"]) ? $row["parent_num"] : '';
|
||||
$con_num = isset($row["con_num"]) ? $row["con_num"] : '';
|
||||
$outdate = isset($row["outdate"]) ? $row["outdate"] : '';
|
||||
$indate = isset($row["indate"]) ? $row["indate"] : '';
|
||||
$orderman = isset($row["orderman"]) ? $row["orderman"] : '';
|
||||
$outworkplace = isset($row["outworkplace"]) ? $row["outworkplace"] : '';
|
||||
$outputplace = isset($row["outputplace"]) ? $row["outputplace"] : '';
|
||||
$phone = isset($row["phone"]) ? $row["phone"] : '';
|
||||
$receiver = isset($row["receiver"]) ? $row["receiver"] : '';
|
||||
$comment = isset($row["comment"]) ? $row["comment"] : '';
|
||||
$root = isset($row["root"]) ? $row["root"] : '';
|
||||
$steel = isset($row["steel"]) ? $row["steel"] : '';
|
||||
$motor = isset($row["motor"]) ? $row["motor"] : '';
|
||||
$delivery = isset($row["delivery"]) ? $row["delivery"] : '';
|
||||
$regist_state = isset($row["regist_state"]) ? $row["regist_state"] : '';
|
||||
|
||||
$bend_state = isset($row["bend_state"]) ? $row["bend_state"] : '';
|
||||
$motor_state = isset($row["motor_state"]) ? $row["motor_state"] : '';
|
||||
|
||||
$is_deleted = isset($row["is_deleted"]) ? $row["is_deleted"] : '0' ;
|
||||
$searchtag = isset($row["searchtag"]) ? $row["searchtag"] : null ;
|
||||
$update_log = isset($row["update_log"]) ? $row["update_log"] : null ;
|
||||
|
||||
$screen = isset($row["screen"]) ? $row["screen"] : "" ;
|
||||
$screen_state = isset($row["screen_state"]) ? $row["screen_state"] : '' ;
|
||||
$screen_su = isset($row["screen_su"]) ? $row["screen_su"] : '' ;
|
||||
$screen_m2 = isset($row["screen_m2"]) ? $row["screen_m2"] : '' ;
|
||||
|
||||
$slat = isset($row["slat"]) ? $row["slat"] : "" ;
|
||||
$slat_state = isset($row["slat_state"]) ? $row["slat_state"] : '' ;
|
||||
$slat_su = isset($row["slat_su"]) ? $row["slat_su"] : '' ;
|
||||
$slat_m2 = isset($row["slat_m2"]) ? $row["slat_m2"] : '' ;
|
||||
|
||||
$updatecomment = isset($row["updatecomment"]) ? $row["updatecomment"] : '' ;
|
||||
$secondord = isset($row['secondord']) ? $row['secondord'] : '';
|
||||
$secondordman = isset($row['secondordman']) ? $row['secondordman'] : '';
|
||||
$secondordmantel = isset($row['secondordmantel']) ? $row['secondordmantel'] : '';
|
||||
$secondordnum = isset($row['secondordnum']) ? $row['secondordnum'] : '';
|
||||
|
||||
$prodCode = isset($row['prodCode']) ? $row['prodCode'] : '';
|
||||
$warrantyNum = isset($row['warrantyNum']) ? $row['warrantyNum'] : '';
|
||||
$orderdate = isset($row['orderdate']) ? $row['orderdate'] : '';
|
||||
$lotNum = isset($row['lotNum']) ? $row['lotNum'] : '';
|
||||
|
||||
$screenlist = isset($row['screenlist']) ? $row['screenlist'] : '{}';
|
||||
$slatlist = isset($row['slatlist']) ? $row['slatlist'] : '{}';
|
||||
$recordscreen = isset($row['recordscreen']) ? $row['recordscreen'] : '{}';
|
||||
$recordslat = isset($row['recordslat']) ? $row['recordslat'] : '{}';
|
||||
$recordbending = isset($row['recordbending']) ? $row['recordbending'] : '{}';
|
||||
$estimateList = isset($row['estimateList']) ? $row['estimateList'] : '{}';
|
||||
$estimateSlatList = isset($row['estimateSlatList']) ? $row['estimateSlatList'] : '{}';
|
||||
$etcList = isset($row['etcList']) ? $row['etcList'] : '{}';
|
||||
$screen_unapprovedList = isset($row['screen_unapprovedList']) ? $row['screen_unapprovedList'] : '{}';
|
||||
$slat_unapprovedList = isset($row['slat_unapprovedList']) ? $row['slat_unapprovedList'] : '{}';
|
||||
$motorList = isset($row['motorList']) ? $row['motorList'] : '{}';
|
||||
$bendList = isset($row['bendList']) ? $row['bendList'] : '{}';
|
||||
|
||||
$COD = isset($row['COD']) ? $row['COD'] : '{}';
|
||||
$recordslatMid = isset($row['recordslatMid']) ? $row['recordslatMid'] : '{}';
|
||||
$recordscreenMid = isset($row['recordscreenMid']) ? $row['recordscreenMid'] : '{}';
|
||||
$recordbendingMid = isset($row['recordbendingMid']) ? $row['recordbendingMid'] : '{}';
|
||||
$warranty = isset($row['warranty']) ? $row['warranty'] : '';
|
||||
$ordersheet = isset($row['ordersheet']) ? $row['ordersheet'] : '{}';
|
||||
$ordersheet_slat = isset($row['ordersheet_slat']) ? $row['ordersheet_slat'] : '{}'; // 슬랫 발주서
|
||||
|
||||
$ACIregDate = isset($row["ACIregDate"]) ? $row["ACIregDate"] : ''; // 인정검사 관련 4가지
|
||||
$ACIaskDate = isset($row["ACIaskDate"]) ? $row["ACIaskDate"] : '';
|
||||
$ACIdoneDate = isset($row["ACIdoneDate"]) ? $row["ACIdoneDate"] : '';
|
||||
$ACImemo = isset($row["ACImemo"]) ? $row["ACImemo"] : '';
|
||||
|
||||
$iList = isset($row['iList']) ? $row['iList'] : '{}'; // 인정검사 자료
|
||||
$recordjointbar = isset($row['recordjointbar']) ? $row['recordjointbar'] : '{}'; // 조인트바 중간검사
|
||||
$ACIcheck = isset($row["ACIcheck"]) ? $row["ACIcheck"] : null;
|
||||
$deliveryfeeList = isset($row['deliveryfeeList']) ? $row['deliveryfeeList'] : '{}'; // 배송비 json
|
||||
|
||||
$ACIgroupCode = $row["ACIgroupCode"] ?? '';
|
||||
$ACIgroupName = $row["ACIgroupName"] ?? '';
|
||||
|
||||
$detailJson = isset($row['detailJson']) ? $row['detailJson'] : '{}';
|
||||
$estimateTotal = isset($row['estimateTotal']) ? $row['estimateTotal'] : 0;
|
||||
$EstimateFirstSum = isset($row['EstimateFirstSum']) ? $row['EstimateFirstSum'] : 0;
|
||||
$EstimateUpdatetSum = isset($row['EstimateUpdatetSum']) ? $row['EstimateUpdatetSum'] : 0;
|
||||
$EstimateDiffer = isset($row['EstimateDiffer']) ? $row['EstimateDiffer'] : 0;
|
||||
$estimateSurang = isset($row['estimateSurang']) ? $row['estimateSurang'] : 0;
|
||||
|
||||
$pjnum = isset($row['pjnum']) ? $row['pjnum'] : '';
|
||||
$major_category = isset($row['major_category']) ? $row['major_category'] : '';
|
||||
$position = isset($row['position']) ? $row['position'] : '';
|
||||
$makeWidth = isset($row['makeWidth']) ? $row['makeWidth'] : '';
|
||||
$makeHeight = isset($row['makeHeight']) ? $row['makeHeight'] : '';
|
||||
$maguriWing = isset($row['maguriWing']) ? $row['maguriWing'] : '';
|
||||
$estimateList_auto = isset($row['estimateList_auto']) ? $row['estimateList_auto'] : '{}';
|
||||
$estimateSlatList_auto = isset($row['estimateSlatList_auto']) ? $row['estimateSlatList_auto'] : '{}';
|
||||
|
||||
$ET_unapproved = isset($row['ET_unapproved']) ? $row['ET_unapproved'] : 0;
|
||||
$ET_total = isset($row['ET_total']) ? $row['ET_total'] : 0;
|
||||
$estimate_num = isset($row['estimate_num']) ? $row['estimate_num'] : ''; // 견적서 번호
|
||||
$devMode = $row['devMode'] ?? '' ; // 개발자 모드
|
||||
$displayText = $row['displayText'] ?? '' ; // 발주서 출고증등 표시할 텍스트
|
||||
|
||||
// 주자재 부자재 체크 추가요청 25/06/29
|
||||
$slatcheck = isset($row['slatcheck']) ? $row['slatcheck'] : '';
|
||||
$partscheck = isset($row['partscheck']) ? $row['partscheck'] : '';
|
||||
|
||||
// 절곡바라시 요청
|
||||
$requestBendingASSY = isset($row['requestBendingASSY']) ? $row['requestBendingASSY'] : '';
|
||||
?>
|
||||
33
output/_row_extra.php
Normal file
33
output/_row_extra.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
$detailJson = isset($row_extra['detailJson']) ? $row_extra['detailJson'] : '{}';
|
||||
$estimateTotal = isset($row_extra['estimateTotal']) ? $row_extra['estimateTotal'] : 0;
|
||||
$EstimateFirstSum = isset($row_extra['EstimateFirstSum']) ? $row_extra['EstimateFirstSum'] : 0;
|
||||
$EstimateUpdatetSum = isset($row_extra['EstimateUpdatetSum']) ? $row_extra['EstimateUpdatetSum'] : 0;
|
||||
$EstimateDiffer = isset($row_extra['EstimateDiffer']) ? $row_extra['EstimateDiffer'] : 0;
|
||||
$estimateSurang = isset($row_extra['estimateSurang']) ? $row_extra['estimateSurang'] : 0;
|
||||
$EstimateDiscountRate = isset($row_extra['EstimateDiscountRate']) ? $row_extra['EstimateDiscountRate'] : '';
|
||||
$EstimateDiscount = isset($row_extra['EstimateDiscount']) ? $row_extra['EstimateDiscount'] : 0;
|
||||
$EstimateFinalSum = isset($row_extra['EstimateFinalSum']) ? $row_extra['EstimateFinalSum'] : 0;
|
||||
$estimateList = isset($row_extra['estimateList']) ? $row_extra['estimateList'] : '{}';
|
||||
$estimateSlatList = isset($row_extra['estimateSlatList']) ? $row_extra['estimateSlatList'] : '{}';
|
||||
$etcList = isset($row_extra['etcList']) ? $row_extra['etcList'] : '{}';
|
||||
$pjnum = isset($row_extra['pjnum']) ? $row_extra['pjnum'] : '';
|
||||
$major_category = isset($row_extra['major_category']) ? $row_extra['major_category'] : '';
|
||||
$position = isset($row_extra['position']) ? $row_extra['position'] : '';
|
||||
$makeWidth = isset($row_extra['makeWidth']) ? $row_extra['makeWidth'] : '160';
|
||||
$makeHeight = isset($row_extra['makeHeight']) ? $row_extra['makeHeight'] : '350';
|
||||
$maguriWing = isset($row_extra['maguriWing']) ? $row_extra['maguriWing'] : '50';
|
||||
$screen_unapprovedList = isset($row_extra['screen_unapprovedList']) ? $row_extra['screen_unapprovedList'] : '{}';
|
||||
$slat_unapprovedList = isset($row_extra['slat_unapprovedList']) ? $row_extra['slat_unapprovedList'] : '{}';
|
||||
$motorList = isset($row_extra['motorList']) ? $row_extra['motorList'] : '{}';
|
||||
$bendList = isset($row_extra['bendList']) ? $row_extra['bendList'] : '{}';
|
||||
$inspectionFee = isset($row_extra['inspectionFee']) ? $row_extra['inspectionFee'] : 50000;
|
||||
$estimateList_auto = isset($row_extra['estimateList_auto']) ? $row_extra['estimateList_auto'] : '{}';
|
||||
$estimateSlatList_auto = isset($row_extra['estimateSlatList_auto']) ? $row_extra['estimateSlatList_auto'] : '{}';
|
||||
$ET_unapproved = isset($row_extra['ET_unapproved']) ? $row_extra['ET_unapproved'] : 0; // 견적 비인정 금액
|
||||
$ET_total = isset($row_extra['ET_total']) ? $row_extra['ET_total'] : 0; // 견적 총 금액
|
||||
// 2025/5/21 추가
|
||||
$controllerList = isset($row_extra['controllerList']) ? $row_extra['controllerList'] : '{}';
|
||||
$accountDate = isset($row_extra['accountDate']) ? $row_extra['accountDate'] : date('Y-m-d');
|
||||
$accountList = isset($row_extra['accountList']) ? $row_extra['accountList'] : '{}';
|
||||
?>
|
||||
311
output/agGrid_test.php
Normal file
311
output/agGrid_test.php
Normal file
@@ -0,0 +1,311 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
|
||||
if(!isset($_SESSION["level"]) || $_SESSION["level"]>5) {
|
||||
sleep(1);
|
||||
header("Location:" . $WebSite . "login/login_form.php");
|
||||
exit;
|
||||
}
|
||||
include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php';
|
||||
$title_message = '경동기업 수주 List';
|
||||
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// 검색 조건 설정
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if(isset($_REQUEST["separate_date"]))
|
||||
$separate_date=$_REQUEST["separate_date"];
|
||||
|
||||
$rstate=$_GET['rstate'];
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if($separate_date=="") $separate_date="1";
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 months", strtotime($currentDate))); // 1개월 이전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+3 months", strtotime($currentDate))); // 3개월 이전 날짜
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
|
||||
if($separate_date=="1")
|
||||
$SettingDate="outdate ";
|
||||
else
|
||||
$SettingDate="indate ";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<form id="board_form" name="board_form" method="post" action="list.php?mode=search">
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-center align-items-center">
|
||||
<h5><?=$title_message?></h5>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-start align-items-center">
|
||||
<a href="?rstate=1"><span class="btn_state color-red">등록</span></a>
|
||||
<a href="?rstate=2"><span class="btn_state color-green">접수</span></a>
|
||||
<a href="?rstate=3"><span class="btn_state color-black">완료</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-start align-items-center">
|
||||
<ion-icon name="caret-forward-outline"></ion-icon> <?=$total_row?>
|
||||
<label> 출고일 <input type="radio" name="separate_date" value="1" <?= $separate_date == "1" ? 'checked' : '' ?>></label>
|
||||
<label> 접수일 <input type="radio" name="separate_date" class="me-3" value="2" <?= $separate_date == "2" ? 'checked' : '' ?>></label>
|
||||
|
||||
<button type="button" id="premonth" class="btn btn-dark btn-sm me-1" onclick='yesterday()'> 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1" onclick='this_today()'> 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-4" onclick='this_tomorrow()'> 익일 </button>
|
||||
|
||||
<input type="checkbox" id="setRange" name="setRange" value="기간">
|
||||
<label for="setRange" class="me-1"> 기간 </label>
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>"> ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?=$todate?>">
|
||||
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control" style="width:150px;">
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
|
||||
<div id="autocomplete-list"></div>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm"> <ion-icon name="search"></ion-icon> </button>
|
||||
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" id="writeBtn"> <i class="bi bi-pencil-fill"></i> 신규 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" onclick="popupCenter('delivery.php','경동 출고List',1800,900);"> <i class="bi bi-print"></i> 화물/택배 출고List </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div id="myGrid" class="ag-theme-alpine" style="height: 600px; width: 100%;"></div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var columnDefs = [
|
||||
{ headerName: "번호", field: "num", width: 80 },
|
||||
{ headerName: "출고일자", field: "outdate", width: 120 },
|
||||
{ headerName: "접수일", field: "indate", width: 120 },
|
||||
{ headerName: "진행", field: "regist_state", width: 100, cellRenderer: function(params) {
|
||||
if (params.value == "1") {
|
||||
return '<span class="badge bg-danger">등록</span>';
|
||||
} else if (params.value == "2") {
|
||||
return '<span class="badge bg-success">접수</span>';
|
||||
} else if (params.value == "3") {
|
||||
return '<span class="badge bg-dark">완료</span>';
|
||||
}
|
||||
}},
|
||||
{ headerName: "구분", field: "root", width: 100, cellClass: function(params) {
|
||||
return params.value == "주일" ? "text-dark" : "text-primary";
|
||||
}},
|
||||
{ headerName: "절곡", field: "steel", width: 100 },
|
||||
{ headerName: "모터", field: "motor", width: 100 },
|
||||
{ headerName: "현장명", field: "outworkplace", width: 180 },
|
||||
{ headerName: "수신자", field: "receiver", width: 100 },
|
||||
{ headerName: "수신 주소", field: "outputplace", width: 200 },
|
||||
{ headerName: "수신 연락처", field: "phone", width: 120 },
|
||||
{ headerName: "운송방식", field: "delivery", width: 120 },
|
||||
{ headerName: "담당", field: "orderman", width: 100 },
|
||||
{ headerName: "틀수", field: "number", width: 80 },
|
||||
{ headerName: "면적", field: "area", width: 100 },
|
||||
{ headerName: "비고", field: "comment", width: 200 }
|
||||
];
|
||||
|
||||
var gridOptions = {
|
||||
columnDefs: columnDefs,
|
||||
rowModelType: 'infinite',
|
||||
paginationPageSize: 50,
|
||||
cacheBlockSize: 50,
|
||||
datasource: {
|
||||
getRows: function(params) {
|
||||
console.log('Requesting rows: ', params.startRow, ' to ', params.endRow);
|
||||
$.ajax({
|
||||
url: 'loadpage.php',
|
||||
type: 'GET',
|
||||
data: {
|
||||
startRow: params.startRow,
|
||||
endRow: params.endRow,
|
||||
fromdate: $('#fromdate').val(),
|
||||
todate: $('#todate').val(),
|
||||
SettingDate: $("input[name='separate_date']:checked").val(),
|
||||
setRange: $('#setRange').is(':checked'),
|
||||
search: $('#search').val()
|
||||
},
|
||||
success: function(data) {
|
||||
console.log(data);
|
||||
if (data.error) {
|
||||
alert('Error: ' + data.error);
|
||||
} else {
|
||||
params.successCallback(data.rowsThisPage, data.lastRow);
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
params.failCallback();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var eGridDiv = document.querySelector('#myGrid');
|
||||
const gridApi = agGrid.createGrid(eGridDiv, gridOptions);
|
||||
|
||||
$('#searchBtn').on('click', function() {
|
||||
gridApi.setDatasource(gridOptions.datasource);
|
||||
});
|
||||
|
||||
$('#fromdate, #todate, #setRange, input[name="separate_date"]').on('change', function() {
|
||||
gridApi.setDatasource(gridOptions.datasource);
|
||||
});
|
||||
|
||||
$('#premonth').on('click', function() {
|
||||
$('#fromdate').val(new Date(new Date().setDate(new Date().getDate() - 1)).toISOString().split('T')[0]);
|
||||
gridApi.setDatasource(gridOptions.datasource);
|
||||
});
|
||||
|
||||
$('#this_today').on('click', function() {
|
||||
$('#fromdate').val(new Date().toISOString().split('T')[0]);
|
||||
gridApi.setDatasource(gridOptions.datasource);
|
||||
});
|
||||
|
||||
$('#this_tomorrow').on('click', function() {
|
||||
$('#fromdate').val(new Date(new Date().setDate(new Date().getDate() + 1)).toISOString().split('T')[0]);
|
||||
gridApi.setDatasource(gridOptions.datasource);
|
||||
});
|
||||
|
||||
$("input:radio[name=separate_date]").click(function() {
|
||||
gridApi.setDatasource(gridOptions.datasource);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#writeBtn").click(function(){
|
||||
var tablename = '<?php echo $tablename; ?>';
|
||||
var url = "write_form.php?tablename=" + tablename;
|
||||
customPopup(url, '수주내역', 1850, 900);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$pdo = db_connect();
|
||||
$tablename = 'output';
|
||||
$DB = 'chandj';
|
||||
|
||||
try {
|
||||
// 파라미터 값 읽기
|
||||
$startRow = isset($_GET['startRow']) ? intval($_GET['startRow']) : 0;
|
||||
$endRow = isset($_GET['endRow']) ? intval($_GET['endRow']) : 50;
|
||||
$search = isset($_GET['search']) ? $_GET['search'] : '';
|
||||
$fromdate = isset($_GET['fromdate']) ? $_GET['fromdate'] : '';
|
||||
$todate = isset($_GET['todate']) ? $_GET['todate'] : '';
|
||||
$SettingDate = isset($_GET['SettingDate']) ? $_GET['SettingDate'] : 'regist_day';
|
||||
$setRange = isset($_GET['setRange']) ? filter_var($_GET['setRange'], FILTER_VALIDATE_BOOLEAN) : false;
|
||||
|
||||
// 기본 쿼리 설정
|
||||
$sql = "SELECT SQL_CALC_FOUND_ROWS * FROM $DB.$tablename WHERE is_deleted = '0'";
|
||||
$params = [];
|
||||
|
||||
if ($setRange && !empty($fromdate) && !empty($todate)) {
|
||||
$sql .= " AND $SettingDate BETWEEN :fromdate AND :todate";
|
||||
$params[':fromdate'] = $fromdate;
|
||||
$params[':todate'] = $todate;
|
||||
}
|
||||
if (!empty($search)) {
|
||||
$sql .= " AND searchtag LIKE :search";
|
||||
$params[':search'] = "%$search%";
|
||||
}
|
||||
|
||||
// 정렬 파라미터 추가
|
||||
$sortField = isset($_GET['sortField']) ? $_GET['sortField'] : $SettingDate;
|
||||
$sortOrder = isset($_GET['sortOrder']) && strtolower($_GET['sortOrder']) === 'asc' ? 'ASC' : 'DESC';
|
||||
$sql .= " ORDER BY $sortField $sortOrder LIMIT :startRow, :pageSize";
|
||||
|
||||
$params[':startRow'] = $startRow;
|
||||
$params[':pageSize'] = $endRow - $startRow;
|
||||
|
||||
// 데이터 페칭
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute($params);
|
||||
$rowsThisPage = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
// 전체 데이터 개수 계산
|
||||
$totalQuery = "SELECT FOUND_ROWS()";
|
||||
$totalStmt = $pdo->query($totalQuery);
|
||||
$totalRows = $totalStmt->fetchColumn();
|
||||
|
||||
// JSON 형식으로 결과 반환
|
||||
echo json_encode([
|
||||
'rowsThisPage' => $rowsThisPage,
|
||||
'lastRow' => $totalRows
|
||||
]);
|
||||
} catch (PDOException $e) {
|
||||
echo json_encode([
|
||||
'error' => $e->getMessage()
|
||||
]);
|
||||
}
|
||||
?>
|
||||
1178
output/bendingview.php
Normal file
1178
output/bendingview.php
Normal file
File diff suppressed because it is too large
Load Diff
1088
output/common/ACI_JS.php
Normal file
1088
output/common/ACI_JS.php
Normal file
File diff suppressed because it is too large
Load Diff
454
output/common/ACIhead.php
Normal file
454
output/common/ACIhead.php
Normal file
@@ -0,0 +1,454 @@
|
||||
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/instock/commonRequest.php'; // 구글드라이브 세션 파일 포함
|
||||
$title_message = '인정검사';
|
||||
$tablename = 'output';
|
||||
$item = $title_message;
|
||||
include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php';
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
<link rel="stylesheet" href="../instock/css/style.css">
|
||||
<link rel="stylesheet" href="../instock/css/style_inspection.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
|
||||
// echo '<pre>';
|
||||
// print_r($page);
|
||||
// echo '</pre>';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
|
||||
$pdo = db_connect();
|
||||
|
||||
// $todayStr = date("m/d");
|
||||
// $inspectionDate = date("m/d");
|
||||
$todayStr = date("y/m/d"); // 연도를 두 자리로 나타냄
|
||||
$inspectionDate = date("y/m/d"); // 동일한 형식으로 출력
|
||||
|
||||
$approvalDate = null;
|
||||
$writerName = $user_name; // 기본값: 로그인 사용자 이름
|
||||
$approvalName = '';
|
||||
$userNameInput = '';
|
||||
$screenorslat ='';
|
||||
|
||||
try {
|
||||
$sql = "SELECT * FROM {$DB}.{$tablename} WHERE num = ?";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $num, PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC);
|
||||
include $_SERVER['DOCUMENT_ROOT'] . "/output/_row.php";
|
||||
|
||||
// 전체수량 합산
|
||||
$shutterSurang = 0; // 셔터 수량 합계를 저장할 변수 초기화
|
||||
$shutterSurang_slat = 0; // 철재
|
||||
|
||||
// 길이, 높이
|
||||
$prod_width = [];
|
||||
$prod_height = [];
|
||||
|
||||
// JSON 데이터를 배열로 디코딩
|
||||
// $eList_screenData = json_decode($eList_screen, true);
|
||||
// $eList_slatData = json_decode($eList_slat, true);
|
||||
|
||||
// if (is_array($eList_screenData)) {
|
||||
// foreach ($eList_screenData as $item) {
|
||||
// $shutterSurang += isset($item['col14']) ? (int)$item['col14'] : 0;
|
||||
// $prod_width[] = isset($item['col8']) ? intval($item['col8']) : 0;
|
||||
// $prod_height[] = isset($item['col9']) ? intval($item['col9']) : 0;
|
||||
// }
|
||||
// $screenorslat ='스크린';
|
||||
// if($shutterSurang>0)
|
||||
// $lotVolumn = $shutterSurang ;
|
||||
// }
|
||||
// // slat 반복문을 통해
|
||||
// if (is_array($eList_slatData)) {
|
||||
// foreach ($eList_slatData as $item) {
|
||||
// $shutterSurang_slat += isset($item['col15']) ? (int)$item['col15'] : 0;
|
||||
// $prod_width[] = isset($item['col8']) ? intval($item['col8']) : 0;
|
||||
// $prod_height[] = isset($item['col9']) ? intval($item['col9']) : 0;
|
||||
// }
|
||||
// $screenorslat ='철재';
|
||||
// if($shutterSurang_slat>0)
|
||||
// $lotVolumn = $shutterSurang_slat ;
|
||||
// }
|
||||
|
||||
// // JSON 파일에서 iList 데이터 읽기
|
||||
// $jsonFilePath = "../output/i_json/" . $num . ".json";
|
||||
// if (file_exists($jsonFilePath)) {
|
||||
// $iList = json_decode(file_get_contents($jsonFilePath), true);
|
||||
// } else {
|
||||
// $iList = '{}' ; // 기본값
|
||||
// }
|
||||
|
||||
// echo "<script>";
|
||||
// echo "var iList = " . json_encode($iList) . ";"; // 전역 변수 iList에 할당
|
||||
// echo "var iListData;"; // iListData 변수만 선언
|
||||
// echo "$(document).ready(function() {";
|
||||
// echo " iListData = iList; console.log('초기로드 데이터 상태:', iListData);"; // iListData에 iList 할당
|
||||
// echo "});";
|
||||
// echo "</script>";
|
||||
|
||||
// i_json 파일 우선 로드
|
||||
$jsonFilePath = "../output/i_json/" . $num . ".json";
|
||||
if (file_exists($jsonFilePath)) {
|
||||
// 파일 내용어 '[]'은 삭제하고 다시 읽음
|
||||
$iList = json_decode(file_get_contents($jsonFilePath), true);
|
||||
if (empty($iList)) {
|
||||
unlink($jsonFilePath); // 빈 배열일 경우 파일 삭제
|
||||
$jsonFilePath = "../output/real_json/" . $num . ".json";
|
||||
if (file_exists($jsonFilePath)) {
|
||||
$iList = json_decode(file_get_contents($jsonFilePath), true);
|
||||
$dataSource = 'real_json';
|
||||
} else {
|
||||
echo "<h1 style='color: red; text-align: center;'>생성된 자료가 없습니다.</h1>";
|
||||
}
|
||||
} else {
|
||||
$dataSource = 'i_json';
|
||||
}
|
||||
} else {
|
||||
// i_json 파일이 없으면 real_json 파일 로드
|
||||
$jsonFilePath = "../output/real_json/" . $num . ".json";
|
||||
if (file_exists($jsonFilePath)) {
|
||||
$iList = json_decode(file_get_contents($jsonFilePath), true);
|
||||
$dataSource = 'real_json';
|
||||
} else {
|
||||
// JSON 파일이 없으면 메시지 출력
|
||||
echo "<h1 style='color: red; text-align: center;'>생성된 자료가 없습니다.</h1>";
|
||||
exit; // 이후 코드 실행 중단
|
||||
}
|
||||
}
|
||||
|
||||
// exceptCheck 값이 1인 항목 제외 및 데이터 처리
|
||||
$lotVolumn = 0;
|
||||
if (isset($iList['exceptCheck'])) {
|
||||
foreach ($iList['exceptCheck'] as $index => $except) {
|
||||
if ($except === "1") {
|
||||
continue; // 제외 처리
|
||||
}
|
||||
|
||||
// 수량 합산
|
||||
$lotVolumn ++;
|
||||
|
||||
// 길이, 높이 추가
|
||||
if (isset($iList['afterWidth'][$index])) {
|
||||
$prod_width[] = (int)$iList['afterWidth'][$index];
|
||||
}
|
||||
if (isset($iList['afterHeight'][$index])) {
|
||||
$prod_height[] = (int)$iList['afterHeight'][$index];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "<script>";
|
||||
echo "var iList = " . json_encode($iList) . ";"; // 전역 변수 iList에 할당
|
||||
echo "var iListData;"; // iListData 변수만 선언
|
||||
echo "$(document).ready(function() {";
|
||||
echo " iListData = iList; console.log('초기로드 데이터 상태:', iListData);"; // iListData에 iList 할당
|
||||
echo "});";
|
||||
echo "</script>";
|
||||
|
||||
// echo "<pre>";
|
||||
// echo print_r($iList);
|
||||
// echo "</pre>";
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
|
||||
$prodName = ""; // 상품명을 저장할 변수
|
||||
|
||||
// if문을 사용하여 제품 코드에 따른 상품명 설정
|
||||
if ($prodCode == 'KSS01') {
|
||||
$prodName = '국민방화 스크린 셔터';
|
||||
$arrayWidth = $prod_width[$page-1] ;
|
||||
$arrayHeight = $prod_height[$page-1] ;
|
||||
} elseif ($prodCode == 'KSE01') {
|
||||
$prodName = '국민방화 스크린 셔터';
|
||||
$arrayWidth = $prod_width[$page-1] ;
|
||||
$arrayHeight = $prod_height[$page-1] ;
|
||||
} elseif ($prodCode == 'KWE01') {
|
||||
$prodName = '국민방화 스크린 플러스 셔터';
|
||||
$arrayWidth = $prod_width[$page-1] ;
|
||||
$arrayHeight = $prod_height[$page-1] ;
|
||||
} elseif ($prodCode == 'KD-SL60') {
|
||||
$prodName = '국민방화 스틸 셔터';
|
||||
$arrayWidth = $prod_width[$page-1] ;
|
||||
$arrayHeight = $prod_height[$page-1] ;
|
||||
} elseif ($prodCode == 'KTE01') {
|
||||
$prodName = '국민방화 스틸 셔터';
|
||||
$arrayWidth = $prod_width[$page-1] ;
|
||||
$arrayHeight = $prod_height[$page-1] ;
|
||||
} elseif ($prodCode == 'KQTS01') {
|
||||
$prodName = '국민방화 투시형 스틸 셔터';
|
||||
$arrayWidth = $prod_width[$page-1] ;
|
||||
$arrayHeight = $prod_height[$page-1] ;
|
||||
} else {
|
||||
$prodName = "유효하지 않은 제품 코드입니다.";
|
||||
}
|
||||
|
||||
$pageWidth = $arrayWidth;
|
||||
$pageHeight = $arrayHeight;
|
||||
?>
|
||||
|
||||
<?php
|
||||
$itemTitle = '인정검사';
|
||||
$today = date("Y-m-d");
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/' . $tablename . '/common/GDload.php'; // 구글드라이브 파일형태 이미지형태 읽어오기 모듈
|
||||
$savetitle ='인정검사';
|
||||
?>
|
||||
|
||||
<?php
|
||||
// 품질담당자 및 관리자인 경우 권한 부여
|
||||
$QCadmin = false ;
|
||||
if($user_name=='이세희' || $user_name=='개발자' || $user_name=='함신옥' || $user_name=='노완호' )
|
||||
$QCadmin = true ;
|
||||
?>
|
||||
|
||||
<form id="board_form" name="board_form" method="post" enctype="multipart/form-data" onkeydown="return captureReturnKey(event)" >
|
||||
<input type="hidden" id="id" name="id" value="<?= isset($num) ? $num : '' ?>" >
|
||||
<input type="hidden" id="num" name="num" value="<?= isset($num) ? $num : '' ?>">
|
||||
<input type="hidden" id="item" name="item" value="<?= isset($item) ? $item : '' ?>" >
|
||||
<input type="hidden" id="page" name="page" value="<?= isset($page) ? $page : 1 ?>" >
|
||||
<input type="hidden" id="lotVolumn" name="lotVolumn" value="<?= isset($lotVolumn) ? $lotVolumn : 1 ?>" >
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?= isset($tablename) ? $tablename : '' ?>" >
|
||||
<input type="hidden" id="drivetablename" name="drivetablename" value="<?= isset($drivetablename) ? $drivetablename : $tablename ?>" >
|
||||
<input type="hidden" id="savetitle" name="savetitle" value="<?= isset($savetitle) ? $savetitle : '' ?>" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?= isset($mode) ? $mode : '' ?>" >
|
||||
<input type="hidden" id="timekey" name="timekey" value="<?= isset($timekey) ? $timekey : '' ?>" >
|
||||
<input type="hidden" id="user_name" name="user_name" value="<?= isset($user_name) ? $user_name : '' ?>">
|
||||
<input type="hidden" id="update_log" name="update_log" value="<?= isset($update_log) ? $update_log : NULL ?>">
|
||||
<input type="hidden" id="item_name" name="item_name" value="<?= isset($item_name) ? $item_name : '' ?>">
|
||||
<input type="hidden" id="screenorslat" name="screenorslat" value="<?= isset($screenorslat) ? $screenorslat : '' ?>">
|
||||
<input type="hidden" id="ACIdoneDate" name="ACIdoneDate" value="<?= isset($ACIdoneDate) ? $ACIdoneDate : null ?>">
|
||||
<input type="hidden" id="iList" name="iList" >
|
||||
|
||||
|
||||
<div class="container mt-2">
|
||||
<div class="d-flex align-items-center justify-content-end mt-1">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-center">
|
||||
<!-- 파일 선택 -->
|
||||
<input type="file" id="upfile" name="upfile[]" multiple style="display:none;">
|
||||
<button class="btn btn-dark btn-sm me-4" type="button" onclick="document.getElementById('upfile').click();">
|
||||
<i class="bi bi-image"></i> </button>
|
||||
|
||||
<!-- 드롭 영역 -->
|
||||
<div id="dropArea" style="border: 1px dashed #ccc; padding: 5px; width:220px; text-align: center;">
|
||||
사진 drop 영역
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex mt-2 justify-content-center">
|
||||
<!-- 파일 목록 표시 -->
|
||||
<div id="displayFile"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php if($QCadmin) { ?>
|
||||
<button class="btn btn-primary btn-sm me-1 ms-2 approvalBtn" ><i class="bi bi-award-fill"></i> 승인 </button>
|
||||
<?php } ?>
|
||||
<button type="button" class="btn btn-danger btn-sm me-1 ms-1 initialBtn" > <i class="bi bi-arrow-counterclockwise"></i> 초기화 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1 ms-1 saveData" > <i class="bi bi-floppy2-fill"></i> 저장 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1 ms-1" onclick="generatePDF()"> PDF </button>
|
||||
<!-- <button class="btn btn-dark btn-sm me-1" onclick="sendmail();"> <i class="bi bi-envelope-arrow-up"></i> 전송 </button> -->
|
||||
<button type="button" class="btn btn-secondary btn-sm me-1 ms-1" onclick="self.close();"> <i class="bi bi-x-lg"></i> 닫기 </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container mt-2">
|
||||
<table class="table table-bordered">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>요청일</th>
|
||||
<th>페이지 이동</th>
|
||||
<th>사진 등록 미완료 페이지</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<!-- 요청일 -->
|
||||
<td>
|
||||
<span class="border d-flex justify-content-center align-items-center p-2">
|
||||
<input type="date" id="ACIaskDate" name="ACIaskDate" class="form-control text-center noborder-input w-auto" autocomplete="off" value="<?=$ACIaskDate?>">
|
||||
</span>
|
||||
</td>
|
||||
|
||||
<!-- 페이지 이동 -->
|
||||
<td>
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<!-- 왼쪽 화살표 -->
|
||||
<button type="button" class="btn btn-outline-primary btn-sm" id="prevPage">
|
||||
<i class="bi bi-arrow-left"></i>
|
||||
</button>
|
||||
|
||||
<!-- 현재 페이지 표시 (select로 변환) -->
|
||||
<select id="pageSelect" class="form-select mx-3 w-auto">
|
||||
<?php for ($i = 1; $i <= $lotVolumn; $i++): ?>
|
||||
<option value="<?= $i ?>" <?= $i == $page ? 'selected' : '' ?>><?= $i ?></option>
|
||||
<?php endfor; ?>
|
||||
</select><span class="mx-3 fs-6">/ <?=$lotVolumn?></span>
|
||||
|
||||
<!-- 오른쪽 화살표 -->
|
||||
<button type="button" class="btn btn-outline-primary btn-sm" id="nextPage">
|
||||
<i class="bi bi-arrow-right"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<!-- 사진 등록 미완료 페이지 -->
|
||||
<td>
|
||||
<div class="text-center" id="missingPagesContainer">
|
||||
<div id="missingPagesButtons" class="mt-2"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="content-to-print">
|
||||
<br>
|
||||
<div class="container mt-1">
|
||||
<div class="d-flex align-items-center justify-content-center m-1">
|
||||
<table class="table " style="border-collapse: collapse;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="3" class="text-center" style="width:70%;">
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<img src="../img/kdlogo.png" alt="경동기업" class="me-1" style="width:100%; height:auto;">
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<div class="d-flex align-items-center justify-content-center m-1">
|
||||
<span class="text-dark ms-1 me-1 fs-2" > 제 </span>
|
||||
<span class="text-dark me-1 fs-2" > 품</span>
|
||||
<span class="text-dark me-1 fs-2" > 검 </span>
|
||||
<span class="text-dark me-1 fs-2" > 사 </span>
|
||||
<span class="text-dark me-1 fs-2" > </span>
|
||||
<span class="text-dark me-1 fs-2" > 성 </span>
|
||||
<span class="text-dark me-1 fs-2" > 적 </span>
|
||||
<span class="text-dark me-1 fs-2" > 서 </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th rowspan="3" class="text-center fw-bold" style="height:100px;"> 결<br>재</th>
|
||||
<th class="text-center p-1" style="width : 100px; height:22px; padding:2px;"> <span id="editButton" > 작성 </span> </th>
|
||||
<th class="text-center p-1" style="width : 100px; height:22px; padding:2px;"> 승인 </th>
|
||||
</tr>
|
||||
<tr style="height:40px;">
|
||||
<th class="text-center">
|
||||
<div id="chargedDiv">
|
||||
<span id="writer"> <?= htmlspecialchars($writerName) ?> </span> <br>
|
||||
<span id="writerDate"> <?= htmlspecialchars($inspectionDate) ?> </span>
|
||||
</div>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<div id="approvalDiv">
|
||||
<span id="approval"> <?= htmlspecialchars($approvalName) ?> </span> <br>
|
||||
<span id="approvalDate">
|
||||
<?= htmlspecialchars($approvalDate) ?>
|
||||
<?php if(!empty($approvalDate)): ?>
|
||||
<i class="bi bi-x-circle remove-approval" style="cursor: pointer;"></i>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center justify-content-center m-1">
|
||||
<table class="table table-bordered" style="border-collapse: collapse;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center align-middle w100px">상 품 명</td>
|
||||
<td class="text-center fw-bold"><?=$prodName?></td>
|
||||
<td class="text-center align-middle w100px">제품 LOT NO</td>
|
||||
<td class="text-center text-primary fw-bold">
|
||||
<?= $lotNum ?>-<?= str_pad($page, 2, "0", STR_PAD_LEFT) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center align-middle ">제 품 명</td>
|
||||
<td class="text-center fw-bold"><?=$prodCode?></td>
|
||||
<td class="text-center align-middle ">로트크기</td>
|
||||
<td class="text-center text-dark fw-bold">
|
||||
<input type="text" class="form-control text-center noborder-input" id="lotVolumn" name="lotVolumn" value="<?=$lotVolumn?> EA" autocomplete="off">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center align-middle ">발주처</td>
|
||||
<td class="text-center text-secondary fw-bold"><?=$secondord?> </td>
|
||||
<td class="text-center align-middle ">검사일자</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="form-control text-center noborder-input" id="inspectionDate" name="inspectionDate" value="<?=$inspectionDate?>" autocomplete="off">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center align-middle ">현장명</td>
|
||||
<td class="text-center text-dark fw-bold"><?=$outworkplace?> </td>
|
||||
<td class="text-center align-middle ">검사자</td>
|
||||
<td class="text-center">
|
||||
<div class="d-flex justify-content-center">
|
||||
<div id="inspectionDiv" >
|
||||
<input type="text" id="userNameInput" name="userNameInput" class="form-control d-inline-block noborder-input text-center" style="width:100px;" autocomplete="off" value="<?=$userNameInput?>">
|
||||
<button type="button" id="cancelButton" class="btn btn-outline-danger btn-sm"> <i class="bi bi-x"> </i> </button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center align-middle blueBlackBold ">제품사진</td>
|
||||
<td class="text-center" colspan="3" >
|
||||
<div class="d-flex justify-content-center">
|
||||
<img src="img/<?=$prodCode?>.jpg" style="width:100%; height:auto;">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// '검사자' 버튼 클릭 시
|
||||
$('#editButton').on('click', function() {
|
||||
// 입력 필드 표시 및 버튼 숨기기
|
||||
$('#inspectionDiv').show();
|
||||
$('#chargedDiv').show();
|
||||
|
||||
// 작성자와 작성일 표시
|
||||
const userName = '<?=$user_name?>'; // PHP에서 로그인 사용자 이름 가져오기
|
||||
const today = new Date();
|
||||
const todayStr = '<?=$todayStr?>';
|
||||
const formattedDate = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`;
|
||||
|
||||
|
||||
$('#writer').text(userName);
|
||||
$('#writerDate').text(todayStr);
|
||||
|
||||
// 검사일자 설정
|
||||
$('#inspectionDate').val(formattedDate);
|
||||
$('#userNameInput').val(userName);
|
||||
});
|
||||
|
||||
// '취소' 버튼 클릭 시
|
||||
$('#cancelButton').on('click', function() {
|
||||
// 입력 필드 숨기기 및 버튼 표시
|
||||
$('#inspectionDivBtn').show();
|
||||
|
||||
// 데이터 초기화
|
||||
$('#writer').text('');
|
||||
$('#writerDate').text('');
|
||||
$('#userNameInput').val('');
|
||||
$('#inspectionDate').val('');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
182
output/common/GDload.php
Normal file
182
output/common/GDload.php
Normal file
@@ -0,0 +1,182 @@
|
||||
<?php
|
||||
// 첨부파일 있는 것 불러오기
|
||||
$savefilename_arr=array();
|
||||
$realname_arr=array();
|
||||
$item = 'attached';
|
||||
$drivetablename = '인정검사사진';
|
||||
|
||||
$sql = "SELECT * FROM {$DB}.picuploads WHERE tablename=? AND item = ? AND parentnum = ? AND page = ? ";
|
||||
try {
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->execute([$drivetablename, $item, $num, $page]);
|
||||
while ($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
$picname = $row["picname"];
|
||||
$realname = $row["realname"];
|
||||
$realname_arr[] = $realname; // realname 배열에 추가
|
||||
|
||||
if (preg_match('/^[a-zA-Z0-9_-]{25,}$/', $picname)) {
|
||||
// Google Drive 파일 ID로 처리
|
||||
$fileId = $picname;
|
||||
|
||||
try {
|
||||
// Google Drive 파일 정보 가져오기
|
||||
$file = $service->files->get($fileId, ['fields' => 'webViewLink, thumbnailLink']);
|
||||
$thumbnailUrl = $file->thumbnailLink ?? "https://drive.google.com/uc?id=$fileId";
|
||||
$webViewLink = $file->webViewLink;
|
||||
$savefilename_arr[] = [
|
||||
'thumbnail' => $thumbnailUrl,
|
||||
'link' => $webViewLink,
|
||||
'fileId' => $fileId,
|
||||
'realname' => $realname // realname 포함
|
||||
];
|
||||
} catch (Exception $e) {
|
||||
error_log("Google Drive 파일 정보 가져오기 실패: " . $e->getMessage());
|
||||
$savefilename_arr[] = [
|
||||
'thumbnail' => "https://drive.google.com/uc?id=$fileId",
|
||||
'link' => null,
|
||||
'fileId' => $fileId,
|
||||
'realname' => $realname // realname 포함
|
||||
];
|
||||
}
|
||||
} else {
|
||||
// Google Drive에서 파일 이름으로 검색
|
||||
try {
|
||||
$query = sprintf("name='%s' and trashed=false", addslashes($picname)); // 파일 이름으로 검색
|
||||
$response = $service->files->listFiles([
|
||||
'q' => $query,
|
||||
'fields' => 'files(id, webViewLink, thumbnailLink)',
|
||||
'pageSize' => 1
|
||||
]);
|
||||
|
||||
if (count($response->files) > 0) {
|
||||
$file = $response->files[0];
|
||||
$fileId = $file->id; // 검색된 파일의 ID
|
||||
$thumbnailUrl = $file->thumbnailLink ?? "https://drive.google.com/uc?id=$fileId";
|
||||
$webViewLink = $file->webViewLink;
|
||||
$savefilename_arr[] = [
|
||||
'thumbnail' => $thumbnailUrl,
|
||||
'link' => $webViewLink,
|
||||
'fileId' => $fileId,
|
||||
'realname' => $realname // realname 포함
|
||||
];
|
||||
|
||||
// 데이터베이스 업데이트: 검색된 파일 ID 저장
|
||||
$updateSql = "UPDATE {$DB}.picuploads SET picname = ? WHERE item = ? AND parentnum = ? AND picname = ? AND page = ? ";
|
||||
$updateStmh = $pdo->prepare($updateSql);
|
||||
$updateStmh->execute([$fileId, $item, $num, $picname, $page]);
|
||||
} else {
|
||||
error_log("Google Drive에서 파일을 찾을 수 없습니다: " . $picname);
|
||||
$savefilename_arr[] = [
|
||||
'thumbnail' => null,
|
||||
'link' => null,
|
||||
'fileId' => null,
|
||||
'realname' => $realname // realname 포함
|
||||
];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
error_log("Google Drive 파일 검색 실패: " . $e->getMessage());
|
||||
$savefilename_arr[] = [
|
||||
'thumbnail' => null,
|
||||
'link' => null,
|
||||
'fileId' => null,
|
||||
'realname' => $realname // realname 포함
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
|
||||
// print_r($savefilename_arr);
|
||||
|
||||
// 첨부이미지 불러오기
|
||||
$saveimagename_arr=array();
|
||||
$realimagename_arr=array();
|
||||
$item = 'image';
|
||||
|
||||
$sql = "SELECT * FROM {$DB}.picuploads WHERE tablename=? AND item = ? AND parentnum = ? AND page = ? ";
|
||||
try {
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->execute([$tablename, $item, $num, $page]);
|
||||
while ($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
$picname = $row["picname"];
|
||||
$realname = $row["realname"];
|
||||
$realimagename_arr[] = $realname; // realname 배열에 추가
|
||||
|
||||
if (preg_match('/^[a-zA-Z0-9_-]{25,}$/', $picname)) {
|
||||
// Google Drive 파일 ID로 처리
|
||||
$fileId = $picname;
|
||||
|
||||
try {
|
||||
// Google Drive 파일 정보 가져오기
|
||||
$file = $service->files->get($fileId, ['fields' => 'webViewLink, thumbnailLink']);
|
||||
$thumbnailUrl = $file->thumbnailLink ?? "https://drive.google.com/uc?id=$fileId";
|
||||
$webViewLink = $file->webViewLink;
|
||||
$saveimagename_arr[] = [
|
||||
'thumbnail' => $thumbnailUrl,
|
||||
'link' => $webViewLink,
|
||||
'fileId' => $fileId,
|
||||
'realname' => $realname // realname 포함
|
||||
];
|
||||
} catch (Exception $e) {
|
||||
error_log("Google Drive 파일 정보 가져오기 실패: " . $e->getMessage());
|
||||
$saveimagename_arr[] = [
|
||||
'thumbnail' => "https://drive.google.com/uc?id=$fileId",
|
||||
'link' => null,
|
||||
'fileId' => $fileId,
|
||||
'realname' => $realname // realname 포함
|
||||
];
|
||||
}
|
||||
} else {
|
||||
// Google Drive에서 파일 이름으로 검색
|
||||
try {
|
||||
$query = sprintf("name='%s' and trashed=false", addslashes($picname)); // 파일 이름으로 검색
|
||||
$response = $service->files->listFiles([
|
||||
'q' => $query,
|
||||
'fields' => 'files(id, webViewLink, thumbnailLink)',
|
||||
'pageSize' => 1
|
||||
]);
|
||||
|
||||
if (count($response->files) > 0) {
|
||||
$file = $response->files[0];
|
||||
$fileId = $file->id; // 검색된 파일의 ID
|
||||
$thumbnailUrl = $file->thumbnailLink ?? "https://drive.google.com/uc?id=$fileId";
|
||||
$webViewLink = $file->webViewLink;
|
||||
$saveimagename_arr[] = [
|
||||
'thumbnail' => $thumbnailUrl,
|
||||
'link' => $webViewLink,
|
||||
'fileId' => $fileId,
|
||||
'realname' => $realname // realname 포함
|
||||
];
|
||||
|
||||
// 데이터베이스 업데이트: 검색된 파일 ID 저장
|
||||
$updateSql = "UPDATE {$DB}.picuploads SET picname = ? WHERE item = ? AND parentnum = ? AND picname = ? AND page = ? ";
|
||||
$updateStmh = $pdo->prepare($updateSql);
|
||||
$updateStmh->execute([$fileId, $item, $num, $picname]);
|
||||
} else {
|
||||
error_log("Google Drive에서 파일을 찾을 수 없습니다: " . $picname);
|
||||
$saveimagename_arr[] = [
|
||||
'thumbnail' => null,
|
||||
'link' => null,
|
||||
'fileId' => null,
|
||||
'realname' => $realname // realname 포함
|
||||
];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
error_log("Google Drive 파일 검색 실패: " . $e->getMessage());
|
||||
$saveimagename_arr[] = [
|
||||
'thumbnail' => null,
|
||||
'link' => null,
|
||||
'fileId' => null,
|
||||
'realname' => $realname // realname 포함
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
|
||||
// print_r($saveimagename_arr);
|
||||
?>
|
||||
19
output/common/basicJS.php
Normal file
19
output/common/basicJS.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
|
||||
});
|
||||
|
||||
function captureReturnKey(e) {
|
||||
if(e.keyCode==13 && e.srcElement.type != 'textarea')
|
||||
return false;
|
||||
}
|
||||
|
||||
function recaptureReturnKey(e) {
|
||||
if(e.keyCode==13 && e.srcElement.type != 'textarea')
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
107
output/common/bottom.php
Normal file
107
output/common/bottom.php
Normal file
@@ -0,0 +1,107 @@
|
||||
|
||||
|
||||
<!-- 하단마감재 -->
|
||||
<?php
|
||||
// 하단 마감재 및 구성품 테이블 출력
|
||||
if (True) {
|
||||
// 하단 마감재, 하단 보강엘바, 하단 보강평철, 하단 무게평철의 데이터를 저장할 배열
|
||||
$item_data = [
|
||||
'하단마감재' => [
|
||||
'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
|
||||
],
|
||||
'하단 무게평철' => [
|
||||
'size' => '[50*12T]',
|
||||
'length_2000' => 0
|
||||
]
|
||||
];
|
||||
|
||||
// 데이터를 누적하여 합산
|
||||
foreach ($eList as $item) {
|
||||
$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']);
|
||||
$item_data['하단 무게평철']['length_2000'] += intval($item['col57']);
|
||||
}
|
||||
|
||||
// 테이블 출력 시작
|
||||
echo '<div class="row">';
|
||||
echo '<div class="d-flex align-items-center justify-content-start">';
|
||||
echo '<table class="table avoid-break" style="border-collapse: collapse;">';
|
||||
|
||||
// 첫 번째 행: 자재 구성품명, 길이, 수량 표시
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center lightgray fw-bold">구성품</td>';
|
||||
echo '<td class="text-center lightgray fw-bold">길이 (mm)</td>';
|
||||
echo '<td class="text-center lightgray fw-bold">수량</td>';
|
||||
echo '<td class="text-center lightgray fw-bold">구성품</td>';
|
||||
echo '<td class="text-center lightgray fw-bold">길이 (mm)</td>';
|
||||
echo '<td class="text-center lightgray fw-bold">수량</td>';
|
||||
echo '<td class="text-center lightgray fw-bold">구성품</td>';
|
||||
echo '<td class="text-center lightgray fw-bold">길이 (mm)</td>';
|
||||
echo '<td class="text-center lightgray fw-bold">수량</td>';
|
||||
echo '<td class="text-center lightgray fw-bold">구성품</td>';
|
||||
echo '<td class="text-center lightgray fw-bold">길이 (mm)</td>';
|
||||
echo '<td class="text-center lightgray fw-bold">수량</td>';
|
||||
echo '</tr>';
|
||||
|
||||
// 두 번째 행: 3000mm 길이에 대한 수량 표시
|
||||
echo '<tr>';
|
||||
// 하단 마감재
|
||||
echo '<td class="text-center lightgray fw-bold" rowspan="2">하단마감재<br>' . $item_data['하단마감재']['size'] . '</td>';
|
||||
echo '<td class="text-center">L : 3,000</td>';
|
||||
echo '<td class="text-center text-danger">' . ($item_data['하단마감재']['length_3000'] ?: '-') . '</td>';
|
||||
|
||||
// 하단 보강엘바
|
||||
echo '<td class="text-center lightgray fw-bold" rowspan="2">하단<br>보강엘바<br>' . $item_data['하단 보강엘바']['size'] . '</td>';
|
||||
echo '<td class="text-center">L : 3,000</td>';
|
||||
echo '<td class="text-center text-danger">' . ($item_data['하단 보강엘바']['length_3000'] ?: '-') . '</td>';
|
||||
|
||||
// 하단 보강평철
|
||||
echo '<td class="text-center lightgray fw-bold" rowspan="2">하단<br>보강평철</td>';
|
||||
echo '<td class="text-center">L : 3,000</td>';
|
||||
echo '<td class="text-center text-danger">' . ($item_data['하단 보강평철']['length_3000'] ?: '-') . '</td>';
|
||||
|
||||
// 하단 무게평철
|
||||
echo '<td class="text-center lightgray fw-bold" rowspan="2">하단<br>무게평철<br>' . $item_data['하단 무게평철']['size'] . '</td>';
|
||||
echo '<td class="text-center">L : 2,000</td>';
|
||||
echo '<td class="text-center text-danger">' . ($item_data['하단 무게평철']['length_2000'] ?: '-') . '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
// 세 번째 행: 4000mm 길이에 대한 수량 표시
|
||||
echo '<tr>';
|
||||
// 하단 마감재 (길이 4000)
|
||||
echo '<td class="text-center">L : 4,000</td>';
|
||||
echo '<td class="text-center text-danger">' . ($item_data['하단마감재']['length_4000'] ?: '-') . '</td>';
|
||||
|
||||
// 하단 보강엘바 (길이 4000)
|
||||
echo '<td class="text-center">L : 4,000</td>';
|
||||
echo '<td class="text-center text-danger">' . ($item_data['하단 보강엘바']['length_4000'] ?: '-') . '</td>';
|
||||
|
||||
// 하단 보강평철 (길이 4000)
|
||||
echo '<td class="text-center">L : 4,000</td>';
|
||||
echo '<td class="text-center text-danger">' . ($item_data['하단 보강평철']['length_4000'] ?: '-') . '</td>';
|
||||
|
||||
// 하단 무게평철은 2000mm만 존재하므로 공백 처리
|
||||
echo '</tr>';
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
?>
|
||||
53
output/common/bottombar_slat.php
Normal file
53
output/common/bottombar_slat.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
// 하단 마감재 및 구성품 테이블 출력
|
||||
if (True) {
|
||||
// 하단 마감재, 하단 보강엘바, 하단 보강평철, 하단 무게평철의 데이터를 저장할 배열
|
||||
$item_data = [
|
||||
'하단마감재' => [
|
||||
'size' => '(60*40)',
|
||||
'length_3000' => 0,
|
||||
'length_4000' => 0
|
||||
]
|
||||
];
|
||||
|
||||
// 데이터를 누적하여 합산
|
||||
foreach ($eList as $item) {
|
||||
$item_data['하단마감재']['length_3000'] += intval($item['col50']);
|
||||
$item_data['하단마감재']['length_4000'] += intval($item['col51']);
|
||||
}
|
||||
|
||||
// 테이블 출력 시작
|
||||
echo '<div class="row">';
|
||||
echo '<div class="d-flex align-items-center justify-content-start">';
|
||||
echo '<table class="table avoid-break" style="border-collapse: collapse;">';
|
||||
|
||||
// 첫 번째 행: 자재 구성품명, 길이, 수량 표시
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center lightgray fw-bold">구성품</td>';
|
||||
echo '<td class="text-center lightgray fw-bold">도면 </td>';
|
||||
echo '<td class="text-center lightgray fw-bold">길이 (mm)</td>';
|
||||
echo '<td class="text-center lightgray fw-bold">수량</td>';
|
||||
echo '</tr>';
|
||||
|
||||
// 두 번째 행: 3000mm 길이에 대한 수량 표시
|
||||
echo '<tr>';
|
||||
// 하단 마감재
|
||||
echo '<td class="text-center lightgray fw-bold" rowspan="2">하단마감재<br>' . $item_data['하단마감재']['size'] . '</td>';
|
||||
echo '<td class="text-center fw-bold" rowspan="2"> <img src="../img/bottombar/bottombar_' . $prodcode . '.jpg" alt="하장바" width="120px"></td>';
|
||||
echo '<td class="text-center">L : 3,000</td>';
|
||||
echo '<td class="text-center text-danger">' . ($item_data['하단마감재']['length_3000'] ?: '-') . '</td>';
|
||||
|
||||
// 세 번째 행: 4000mm 길이에 대한 수량 표시
|
||||
echo '<tr>';
|
||||
// 하단 마감재 (길이 4000)
|
||||
echo '<td class="text-center">L : 4,000</td>';
|
||||
echo '<td class="text-center text-danger">' . ($item_data['하단마감재']['length_4000'] ?: '-') . '</td>';
|
||||
|
||||
// 하단 무게평철은 2000mm만 존재하므로 공백 처리
|
||||
echo '</tr>';
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
98
output/common/company_detail.php
Normal file
98
output/common/company_detail.php
Normal file
@@ -0,0 +1,98 @@
|
||||
<div class="row">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<table class="table " style="border-collapse: collapse;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="5" rowspan="3" class="text-center" style="width:70%;">
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<img src="../img/kdlogo.png" alt="경동기업" class="me-1" style="width:100%; height:auto;">
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<div class="d-flex align-items-center justify-content-center m-1">
|
||||
<span class="text-dark ms-2 me-2 fs-2" > 납 </span>
|
||||
<span class="text-dark ms-2 me-2 fs-2" > 품 </span>
|
||||
<span class="text-dark ms-2 me-2 fs-2" > 확 </span>
|
||||
<span class="text-dark ms-2 me-2 fs-2" > 인 </span>
|
||||
<span class="text-dark ms-2 fs-2" > 서 </span>
|
||||
</div>
|
||||
<br>
|
||||
<div class="d-flex align-items-center justify-content-center mt-2">
|
||||
<span class="text-dark ms-2 " style="font-size:10px;" > 전화 : 031-983-5130 | 팩스 : 02-6911-6315 | 이메일 : kd5130@naver.com </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th class="text-center " style="width:5%;">로트번호</th>
|
||||
<th colspan="3" class="text-center text-primary fw-bold fs-6" > <?=$lotNum?> </th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center fw-bold" style="height:80px;">결 재</th>
|
||||
<th colspan="3" rowspan="2" class="text-center fs-5" style="width : 70px; height:22px; padding:2px;"> 경 동 기 업
|
||||
<img src="../img/KDstamp.png" alt="도장" style="width:45px; height:45px;">
|
||||
<!-- <span class="ms-3 fs-6"> (인) </span> -->
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center blueBlackBold" >상 품 명</th>
|
||||
<th class="text-center blueBlackBold"><?=$prodname?></th>
|
||||
<th class="text-center blueBlackBold">제품명</th>
|
||||
<th class="text-center blueBlackBold"><?=$prodcode?></th>
|
||||
<th class="text-center blueBlackBold">인정번호</th>
|
||||
<th colspan="4" class="text-center blueBlackBold fw-bold"><?=$warrantyNum?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex align-items-center justify-content-start ">
|
||||
<table class="table table-bordered" style="border-collapse: collapse;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" class="text-center align-middle lightgray" style="width:33%;">신 청 업 체</th>
|
||||
<th colspan="2" class="text-center align-middle lightgray" style="width:33%;">신 청 내 용</th>
|
||||
<th colspan="2" class="text-center align-middle lightgray" style="width:33%;">납 품 정 보</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="text-center align-middle lightgray">발주일</th>
|
||||
<th class="text-center"><?=specialDate($orderdate)?></th>
|
||||
<th class="text-center align-middle lightgray">현 장 명</th>
|
||||
<th colspan="3" class="text-center text-primary fw-bold"><?=$outworkplace?> </th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center align-middle lightgray">발주처</th>
|
||||
<th class="text-center"><?=$secondord?> </th>
|
||||
<th class="text-center align-middle lightgray">납기요청일</th>
|
||||
<th colspan="1" class="text-center text-primary fw-bold"><?=specialDate($outdateplusone)?> </th>
|
||||
<th class="text-center align-middle lightgray">인수담당자</th>
|
||||
<th colspan="1" class="text-center text-primary fw-bold"><?=$orderman?> </th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center align-middle lightgray">발주 담당자</th>
|
||||
<th class="text-center"><?=$orderman?></th>
|
||||
<th class="text-center align-middle lightgray">출고일</th>
|
||||
<th colspan="1" class="text-center text-primary fw-bold"><?=specialDate($outdate)?> </th>
|
||||
<th class="text-center align-middle lightgray">인수자연락처</th>
|
||||
<th class="text-center text-primary fw-bold"><?=$_SESSION['hp']?> </th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center align-middle lightgray">담당자 연락처</th>
|
||||
<th class="text-center text-dark fw-bold"><?=$_SESSION['hp']?> </th>
|
||||
<th class="text-center align-middle lightgray">셔터총수량</th>
|
||||
<th class="text-center"> <?=$surang ?> (개소) </th>
|
||||
<th class="text-center align-middle lightgray">배 송 방 법</th>
|
||||
<th class="text-center"> <?=$delivery ?> </th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center align-middle lightgray">배송지 주소</th>
|
||||
<th colspan="5" class="text-center"><?=$outputplace?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
39
output/common/etc.php
Normal file
39
output/common/etc.php
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<?php
|
||||
|
||||
// 디코딩된 데이터를 HTML 테이블로 변환
|
||||
if (is_array($etcListArray) && count($etcListArray) > 0) {
|
||||
echo '<table class="table avoid-break" style="border-collapse: collapse;">';
|
||||
echo '<thead>';
|
||||
echo ' <tr>';
|
||||
echo ' <th class="text-center align-middle lightgray">품명</th>';
|
||||
echo ' <th class="text-center align-middle lightgray">규격</th>';
|
||||
echo ' <th class="text-center align-middle lightgray">단위</th>';
|
||||
echo ' <th class="text-center align-middle lightgray">수량</th>';
|
||||
echo ' <th class="text-center align-middle lightgray">비고</th>';
|
||||
echo ' </tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
// 테이블의 각 행을 생성
|
||||
foreach ($etcListArray as $index => $item) {
|
||||
echo '<tr>';
|
||||
echo ' <td class="text-center">' . htmlspecialchars($item['col1']) . '</td>';
|
||||
echo ' <td class="text-center">' . htmlspecialchars($item['col2']) . '</td>';
|
||||
echo ' <td class="text-center">' . htmlspecialchars($item['col3']) . '</td>';
|
||||
echo ' <td class="text-center">' . htmlspecialchars($item['col4']) . '</td>';
|
||||
echo ' <td class="text-center">' . htmlspecialchars($item['col5'] ?? '') . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
} else {
|
||||
// etcList가 비어 있거나 유효하지 않은 경우에는 아무 것도 출력하지 않음
|
||||
// echo '<p class="text-muted">소모품 발주 정보가 없습니다.</p>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
80
output/common/function.php
Normal file
80
output/common/function.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* 컷팅 매수 계산
|
||||
*
|
||||
* @param string $itemSelect '실리카'|'와이어'|'화이바'
|
||||
* @param int $height 원단 세로 길이(mm)
|
||||
* @return array [
|
||||
* 'firstCut' => 전체 절단 횟수,
|
||||
* '900' => 900 규격 매수(0 or 1),
|
||||
* '800' => 800 규격 매수(0 or 1),
|
||||
* '600' => 600 규격 매수(0 or 1),
|
||||
* '400' => 400 규격 매수(0 or 1),
|
||||
* '300' => 300 규격 매수(0 or 1),
|
||||
* 'remaining'=> 최종 남은 높이(mm)
|
||||
* ]
|
||||
*/
|
||||
function calculateCutSize(string $itemSelect, int $height): array {
|
||||
|
||||
// 1) 기준 폭 선택
|
||||
switch ($itemSelect) {
|
||||
case (strpos($itemSelect, '실리') !== false): $value = 1220; $threshold = 940; $itemSelect='실리카'; break;
|
||||
case (strpos($itemSelect, '와이어') !== false): $value = 1180; $threshold = 900; $itemSelect='와이어'; break;
|
||||
case (strpos($itemSelect, '화이') !== false): $value = 1200; $threshold = 924; $itemSelect='화이바'; break;
|
||||
default:
|
||||
throw new InvalidArgumentException("지원하지 않는 원단: {$itemSelect}");
|
||||
}
|
||||
|
||||
// 2) 시접 추가
|
||||
$makeVertical = $height
|
||||
+ 140
|
||||
+ floor($height / $value) * 40;
|
||||
|
||||
// 3) 기본 절단 횟수
|
||||
$firstCut = (int) floor($makeVertical / $value);
|
||||
|
||||
// 4) 남은 높이 계산
|
||||
$remaining = $makeVertical - ($firstCut * $value);
|
||||
|
||||
// 5) 남은 높이가 임계치 넘으면 추가 절단
|
||||
if ($remaining > $threshold) {
|
||||
$firstCut++;
|
||||
// $remaining -= $value;
|
||||
}
|
||||
|
||||
// 6) 공차별 분류 범위 정의
|
||||
$ranges = [
|
||||
'실리카' => [
|
||||
'900' => [841, 940],
|
||||
'800' => [641, 840],
|
||||
'600' => [441, 640],
|
||||
'400' => [341, 440],
|
||||
'300' => [ 1, 340],
|
||||
],
|
||||
'와이어' => [
|
||||
'900' => [801, 900],
|
||||
'800' => [601, 800],
|
||||
'600' => [401, 600],
|
||||
'400' => [301, 400],
|
||||
'300' => [ 1, 300],
|
||||
],
|
||||
'화이바' => [
|
||||
'900' => [825, 924],
|
||||
'800' => [625, 824],
|
||||
'600' => [425, 624],
|
||||
'400' => [325, 424],
|
||||
'300' => [ 1, 324],
|
||||
],
|
||||
];
|
||||
|
||||
// 7) 결과 배열 구성
|
||||
$result = [
|
||||
'firstCut' => $firstCut,
|
||||
'remaining' => $remaining,
|
||||
];
|
||||
foreach ($ranges[$itemSelect] as $key => [$min, $max]) {
|
||||
$result[$key] = ($remaining >= $min && $remaining <= $max) ? 1 : 0;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
?>
|
||||
232
output/common/guiderail.php
Normal file
232
output/common/guiderail.php
Normal file
@@ -0,0 +1,232 @@
|
||||
<!-- 스크린 가이드 레일 -->
|
||||
<?php
|
||||
// 1) 길이 기준 배열과 합계 초기화
|
||||
$lengths = [2438, 3000, 3500, 4000, 4300];
|
||||
$wall_rows = array_fill_keys($lengths, 0); // 벽면형 합계
|
||||
$side_rows = array_fill_keys($lengths, 0); // 측면형 합계
|
||||
|
||||
// 2) $eList 순회하며 조건에 맞는 길이 구간에 수량 누적
|
||||
foreach ($eList as $item) {
|
||||
$validLength = floatval($item['col23']); // 실제 사용 길이
|
||||
$railType = trim($item['col6']); // 레일 타입
|
||||
$surang = intval($item['col14']); // 수량
|
||||
|
||||
// 유효 길이가 해당 길이 기준 이하인 첫 번째 구간을 찾아 누적
|
||||
foreach ($lengths as $length) {
|
||||
if ($validLength <= $length) {
|
||||
if ($railType === '혼합형(120*70)(120*120)') {
|
||||
// 혼합형은 벽면·측면 둘 다에 수량을 더함
|
||||
$wall_rows[$length] += $surang;
|
||||
$side_rows[$length] += $surang;
|
||||
}
|
||||
elseif ($railType === '벽면형(120*70)') {
|
||||
// 벽면형은 수량*2로 계산
|
||||
$wall_rows[$length] += $surang * 2;
|
||||
}
|
||||
elseif ($railType === '측면형(120*120)') {
|
||||
// 측면형은 수량*2로 계산
|
||||
$side_rows[$length] += $surang * 2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// // 3) 결과 출력
|
||||
// echo '<pre>';
|
||||
|
||||
// // 각 길이별 벽면형 합계
|
||||
// echo "벽면형 합계:\n";
|
||||
// foreach ($wall_rows as $length => $sum) {
|
||||
// echo " {$length}mm 이하: {$sum}EA\n";
|
||||
// }
|
||||
|
||||
// // 각 길이별 측면형 합계
|
||||
// echo "\n측면형 합계:\n";
|
||||
// foreach ($side_rows as $length => $sum) {
|
||||
// echo " {$length}mm 이하: {$sum}EA\n";
|
||||
// }
|
||||
// echo '</pre>';
|
||||
|
||||
|
||||
|
||||
// 4) 인덱스 배열로 변환 및 수량>0 필터링
|
||||
$wall_list = [];
|
||||
foreach ($wall_rows as $length => $sum) {
|
||||
if ($sum > 0) {
|
||||
$wall_list[] = ['length' => $length, 'sum' => $sum];
|
||||
}
|
||||
}
|
||||
$side_list = [];
|
||||
foreach ($side_rows as $length => $sum) {
|
||||
if ($sum > 0) {
|
||||
$side_list[] = ['length' => $length, 'sum' => $sum];
|
||||
}
|
||||
}
|
||||
|
||||
$wall_count = count($wall_list);
|
||||
$side_count = count($side_list);
|
||||
$maxRows = max($wall_count, $side_count);
|
||||
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<table class="table avoid-break" style="border-collapse: collapse;">
|
||||
<?php if ($maxRows > 0): ?>
|
||||
<thead class="table-secondary">
|
||||
<tr>
|
||||
<?php if ($wall_count): ?>
|
||||
<th class="text-center">벽면형 (120×70)</th>
|
||||
<th class="text-center">길이</th>
|
||||
<th class="text-center">수량</th>
|
||||
<?php endif; ?>
|
||||
<?php if ($side_count): ?>
|
||||
<th class="text-center">측면형 (120×120)</th>
|
||||
<th class="text-center">길이</th>
|
||||
<th class="text-center">수량</th>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php for ($i = 0; $i < $maxRows; $i++): ?>
|
||||
<tr>
|
||||
<!-- 벽면형 -->
|
||||
<?php if ($i < $wall_count): ?>
|
||||
<?php if ($i === 0): ?>
|
||||
<td rowspan="<?= $maxRows ?>" class="text-center">
|
||||
<img src="../img/guiderail/guiderail_<?= $prodCode ?>_wall_120x70.jpg"
|
||||
alt="벽면형" width="120">
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="text-center"><?= $wall_list[$i]['length'] ?></td>
|
||||
<td class="text-center"><?= $wall_list[$i]['sum'] ?></td>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- 측면형 -->
|
||||
<?php if ($i < $side_count): ?>
|
||||
<?php if ($i === 0): ?>
|
||||
<td rowspan="<?= $maxRows ?>" class="text-center">
|
||||
<img src="../img/guiderail/guiderail_<?= $prodCode ?>_side_120x120.jpg"
|
||||
alt="측면형" width="120">
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="text-center"><?= $side_list[$i]['length'] ?></td>
|
||||
<td class="text-center"><?= $side_list[$i]['sum'] ?></td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php endfor; ?>
|
||||
|
||||
<!-- 하부 BASE 합계 -->
|
||||
<tr>
|
||||
<?php if ($wall_count): ?>
|
||||
<td colspan="2" class="text-center fw-bold blueBold">하부BASE (130×80)</td>
|
||||
<td class="text-center fw-bold">
|
||||
<?= array_sum(array_column($wall_list, 'sum')) ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<?php if ($side_count): ?>
|
||||
<td colspan="2" class="text-center fw-bold blueBold">하부BASE (130×130)</td>
|
||||
<td class="text-center fw-bold">
|
||||
<?= array_sum(array_column($side_list, 'sum')) ?>
|
||||
</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>
|
||||
|
||||
|
||||
<!-- 가이드레일 연기차단재 -->
|
||||
<?php
|
||||
// 연기차단재(W50)
|
||||
if (True) {
|
||||
$smoke_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) {
|
||||
$validLength = floatval($item['col23']); // 셔터의 유효 길이
|
||||
|
||||
// 길이에 맞는 수량 계산
|
||||
for ($i = 0; $i < count($smoke_data); $i++) {
|
||||
$length = $smoke_data[$i]['length'];
|
||||
if ($validLength <= $length) {
|
||||
$smoke_data[$i]['sum'] += 4; // 1세트에 2개 레일 x 2개 기본적으로 연기차단재는 4개씩
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 연기차단재 데이터가 있는 경우만 출력
|
||||
$smoke_rows = [];
|
||||
foreach ($smoke_data as $row) {
|
||||
if ($row['sum'] > 0) {
|
||||
$smoke_rows[] = [
|
||||
'length' => $row['length'],
|
||||
'sum' => $row['sum']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$smoke_rowspan = count($smoke_rows);
|
||||
|
||||
// 테이블 출력 시작
|
||||
echo '<div class="row">';
|
||||
echo '<div class="d-flex align-items-center justify-content-center">';
|
||||
echo '<table class="table avoid-break" style="border-collapse: collapse;">';
|
||||
|
||||
// 연기차단재 데이터 출력
|
||||
echo '<tbody>';
|
||||
echo '<tr>';
|
||||
|
||||
// 첫 번째 td (연기차단재 설명)
|
||||
echo '<td rowspan="2" class="text-center fw-bold orangeBlackBold">';
|
||||
echo '연기차단재(W50)<br>가이드레일 마감재 <span class="text-danger">"양쪽에"</span> 설치';
|
||||
echo '</td>';
|
||||
|
||||
// 두 번째 td (재료 설명)
|
||||
echo '<td rowspan="2" class="text-center orangeBlackBold">';
|
||||
echo 'EGI 0.8T +<br>화이바글라스코팅직물';
|
||||
echo '</td>';
|
||||
|
||||
// 세 번째 td (이미지)
|
||||
echo '<td rowspan="2" class="text-center ">';
|
||||
echo '<img src="../img/part/smokeban.jpg" alt="연기차단재" width="150">';
|
||||
echo '</td>';
|
||||
|
||||
// 네 번째 td (규격과 길이)
|
||||
echo '<td class="text-center fw-bold orangeBlackBold">규격[L]</td>';
|
||||
foreach ($smoke_rows as $row) {
|
||||
echo '<td class="text-center fw-bold">' . $row['length'] . '</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
|
||||
// 다섯 번째 td (수량)
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center fw-bold orangeBlackBold">수량</td>';
|
||||
foreach ($smoke_rows as $row) {
|
||||
echo '<td class="text-center fw-bold">' . $row['sum'] . '</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
112
output/common/guiderail_confirm.php
Normal file
112
output/common/guiderail_confirm.php
Normal file
@@ -0,0 +1,112 @@
|
||||
|
||||
<!-- 가이드 레일 -->
|
||||
<?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['col23']); // 유효 길이
|
||||
$railType = trim($item['col6']); // 레일 타입 (혼합형, 벽면형, 측면형)
|
||||
|
||||
foreach ($row3_data as &$row) {
|
||||
if ($validLength <= $row['length']) {
|
||||
if ($railType == '혼합형(120*70)(120*120)') {
|
||||
$row['sum'] += 1;
|
||||
$wall_rows[] = ['length' => $row['length'], 'sum' => 1];
|
||||
$side_rows[] = ['length' => $row['length'], 'sum' => 1];
|
||||
} elseif ($railType == '벽면형(120*70)') {
|
||||
$row['sum'] += 2;
|
||||
$wall_rows[] = ['length' => $row['length'], 'sum' => $row['sum']];
|
||||
} elseif ($railType == '측면형(120*120)') {
|
||||
$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">벽면형 (120*70)</th>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($side_rows)): ?>
|
||||
<th class="text-center">측면형 (120*120)</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_120x70.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_120x120.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 (130*80)</td>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($side_rows)): ?>
|
||||
<td colspan="2" class="text-center blueBold fw-bold">하부BASE (130*130)</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>
|
||||
|
||||
218
output/common/guiderail_slat.php
Normal file
218
output/common/guiderail_slat.php
Normal file
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
// 1) 길이 기준 배열과 합계 초기화
|
||||
$lengths = [2438, 3000, 3500, 4000, 4300];
|
||||
$wall_rows = array_fill_keys($lengths, 0); // 벽면형 합계
|
||||
$side_rows = array_fill_keys($lengths, 0); // 측면형 합계
|
||||
|
||||
// 2) $eList 순회하며 조건에 맞는 길이 구간에 수량 누적
|
||||
foreach ($eList as $item) {
|
||||
$validLength = floatval($item['col24']); // 실제 사용 길이
|
||||
$railType = trim($item['col6']); // 레일 타입
|
||||
$surang = intval($item['col15']); // 수량 (col15)
|
||||
|
||||
foreach ($lengths as $length) {
|
||||
if ($validLength <= $length) {
|
||||
if ($railType === '혼합형(130*75)(130*125)') {
|
||||
// 혼합형은 벽면·측면 둘 다에 수량을 더함
|
||||
$wall_rows[$length] += $surang;
|
||||
$side_rows[$length] += $surang;
|
||||
}
|
||||
elseif ($railType === '벽면형(130*75)') {
|
||||
// 벽면형은 수량*2로 계산
|
||||
$wall_rows[$length] += $surang * 2;
|
||||
}
|
||||
elseif ($railType === '측면형(130*125)') {
|
||||
// 측면형은 수량*2로 계산
|
||||
$side_rows[$length] += $surang * 2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3) 인덱스 배열로 변환 및 sum>0 필터링
|
||||
$wall_list = [];
|
||||
foreach ($wall_rows as $length => $sum) {
|
||||
if ($sum > 0) {
|
||||
$wall_list[] = ['length' => $length, 'sum' => $sum];
|
||||
}
|
||||
}
|
||||
$side_list = [];
|
||||
foreach ($side_rows as $length => $sum) {
|
||||
if ($sum > 0) {
|
||||
$side_list[] = ['length' => $length, 'sum' => $sum];
|
||||
}
|
||||
}
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($wall_list);
|
||||
// print_r($side_list);
|
||||
// echo '</pre>';
|
||||
|
||||
$wall_count = count($wall_list);
|
||||
$side_count = count($side_list);
|
||||
$maxRows = max($wall_count, $side_count);
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($wall_count);
|
||||
// print_r($side_count);
|
||||
// print_r($maxRows);
|
||||
// echo '</pre>';
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<table class="table avoid-break" style="border-collapse: collapse;">
|
||||
<?php if ($maxRows > 0): ?>
|
||||
<thead class="table-secondary">
|
||||
<tr>
|
||||
<?php if (!empty($wall_count)): ?>
|
||||
<th class="text-center">벽면형 (130×75)</th>
|
||||
<th class="text-center">길이</th>
|
||||
<th class="text-center">수량</th>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($side_count)): ?>
|
||||
<th class="text-center">측면형 (130×125)</th>
|
||||
<th class="text-center">길이</th>
|
||||
<th class="text-center">수량</th>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php for ($i = 0; $i < $maxRows; $i++): ?>
|
||||
<tr>
|
||||
<?php if (!empty($wall_count) && $i < $wall_count): ?>
|
||||
<?php if ($i === 0): ?>
|
||||
<td rowspan="<?= $maxRows ?>" class="text-center">
|
||||
<img src="../img/guiderail/guiderail_<?= $prodCode ?>_wall_130x75.jpg"
|
||||
alt="벽면형" width="120">
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="text-center"><?= $wall_list[$i]['length'] ?></td>
|
||||
<td class="text-center"><?= $wall_list[$i]['sum'] ?></td>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($side_count) && $i < $side_count): ?>
|
||||
<?php if ($i === 0): ?>
|
||||
<td rowspan="<?= $maxRows ?>" class="text-center">
|
||||
<img src="../img/guiderail/guiderail_<?= $prodCode ?>_side_130x125.jpg"
|
||||
alt="측면형" width="120">
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="text-center"><?= $side_list[$i]['length'] ?></td>
|
||||
<td class="text-center"><?= $side_list[$i]['sum'] ?></td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php endfor; ?>
|
||||
|
||||
<tr>
|
||||
<?php if (!empty($wall_count)): ?>
|
||||
<td colspan="2" class="text-center fw-bold blueBold">하부BASE (140×85)</td>
|
||||
<td class="text-center fw-bold">
|
||||
<?= array_sum(array_column($wall_list, 'sum')) ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($side_count)): ?>
|
||||
<td colspan="2" class="text-center fw-bold blueBold">하부BASE (140×135)</td>
|
||||
<td class="text-center fw-bold">
|
||||
<?= array_sum(array_column($side_list, 'sum')) ?>
|
||||
</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>
|
||||
|
||||
|
||||
<!-- 가이드레일 연기차단재 -->
|
||||
<?php
|
||||
// 연기차단재(W50)
|
||||
if (True) {
|
||||
$smoke_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) {
|
||||
$validLength = floatval($item['col23']); // 셔터의 유효 길이
|
||||
|
||||
// 길이에 맞는 수량 계산
|
||||
for ($i = 0; $i < count($smoke_data); $i++) {
|
||||
$length = $smoke_data[$i]['length'];
|
||||
if ($validLength <= $length) {
|
||||
$smoke_data[$i]['sum'] += 4; // 1세트에 2개 레일 x 2개 기본적으로 연기차단재는 4개씩
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 연기차단재 데이터가 있는 경우만 출력
|
||||
$smoke_rows = [];
|
||||
foreach ($smoke_data as $row) {
|
||||
if ($row['sum'] > 0) {
|
||||
$smoke_rows[] = [
|
||||
'length' => $row['length'],
|
||||
'sum' => $row['sum']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$smoke_rowspan = count($smoke_rows);
|
||||
|
||||
// 테이블 출력 시작
|
||||
echo '<div class="row">';
|
||||
echo '<div class="d-flex align-items-center justify-content-center">';
|
||||
echo '<table class="table avoid-break" style="border-collapse: collapse;">';
|
||||
|
||||
// 연기차단재 데이터 출력
|
||||
echo '<tbody>';
|
||||
echo '<tr>';
|
||||
|
||||
// 첫 번째 td (연기차단재 설명)
|
||||
echo '<td rowspan="2" class="text-center fw-bold orangeBlackBold">';
|
||||
echo '연기차단재(W50)<br>가이드레일 마감재 <span class="text-danger">"양쪽에"</span> 설치';
|
||||
echo '</td>';
|
||||
|
||||
// 두 번째 td (재료 설명)
|
||||
echo '<td rowspan="2" class="text-center orangeBlackBold">';
|
||||
echo 'EGI 0.8T +<br>화이바글라스코팅직물';
|
||||
echo '</td>';
|
||||
|
||||
// 세 번째 td (이미지)
|
||||
echo '<td rowspan="2" class="text-center ">';
|
||||
echo '<img src="../img/part/smokeban.jpg" alt="연기차단재" width="150">';
|
||||
echo '</td>';
|
||||
|
||||
// 네 번째 td (규격과 길이)
|
||||
echo '<td class="text-center fw-bold orangeBlackBold">규격[L]</td>';
|
||||
foreach ($smoke_rows as $row) {
|
||||
echo '<td class="text-center fw-bold">' . $row['length'] . '</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
|
||||
// 다섯 번째 td (수량)
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center fw-bold orangeBlackBold">수량</td>';
|
||||
foreach ($smoke_rows as $row) {
|
||||
echo '<td class="text-center fw-bold">' . $row['sum'] . '</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
112
output/common/guiderail_slat_confirm.php
Normal file
112
output/common/guiderail_slat_confirm.php
Normal file
@@ -0,0 +1,112 @@
|
||||
|
||||
<!-- 가이드 레일 -->
|
||||
<?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>
|
||||
|
||||
158
output/common/motor.php
Normal file
158
output/common/motor.php
Normal file
@@ -0,0 +1,158 @@
|
||||
<?php
|
||||
// 스크링 인정제품 모터 부분 (철재와는 col의 배열이 다름)
|
||||
if (True) {
|
||||
// 함수 호출을 통해 계산된 값을 가져옴
|
||||
$specifications = calculateMotorSpecifications($eList);
|
||||
$bracketSpec = calculateBracket($eList);
|
||||
$bracketAngleSpec = calculateBracketAngle($eList);
|
||||
|
||||
// 모터 관련 데이터
|
||||
$columns = [
|
||||
$specifications['col1_sum'],
|
||||
$specifications['col2_sum'],
|
||||
$specifications['col3_sum'],
|
||||
$specifications['col4_sum'],
|
||||
$specifications['col5_sum'],
|
||||
$specifications['col6_sum'],
|
||||
$specifications['col7_sum']
|
||||
];
|
||||
// 연동제어기 관련 데이터
|
||||
$other_columns = [
|
||||
$specifications['col8_sum'],
|
||||
$specifications['col9_sum'],
|
||||
$specifications['col10_sum'],
|
||||
];
|
||||
|
||||
// 모터별 전압 데이터 수집
|
||||
$motorData = [
|
||||
'220V' => [],
|
||||
'380V' => []
|
||||
];
|
||||
|
||||
foreach ($eList as $item) {
|
||||
$motor_brand = isset($item['col18_brand']) ? $item['col18_brand'] : '';
|
||||
$volt = isset($item['col18'] ) ? $item['col18'] : '';
|
||||
$capacity = isset($item['col19'] ) ? $item['col19'] : '';
|
||||
$quantity = isset($item['col14'] ) ? intval($item['col14']): 0;
|
||||
|
||||
// '없음' 단어가 포함되지 않은 경우만 처리
|
||||
if ($volt && $capacity && $quantity > 0 && strpos($motor_brand, '없음') === false) {
|
||||
// 해당 전압의 용량이 없으면 초기화
|
||||
if (!isset($motorData[$volt][$capacity])) {
|
||||
$motorData[$volt][$capacity] = 0;
|
||||
}
|
||||
// 수량 합산
|
||||
$motorData[$volt][$capacity] += $quantity;
|
||||
}
|
||||
}
|
||||
|
||||
// HTML 구조 시작
|
||||
echo '<div class="row ">';
|
||||
|
||||
// 1) 모터 부분
|
||||
echo '<div class="col-sm-3 d-flex justify-content-start">';
|
||||
echo '<table class="table" style="border-collapse: collapse;">';
|
||||
echo '<thead>';
|
||||
echo '<tr><th colspan="3" class="text-center lightgray">모터종류(KG)</th></tr>';
|
||||
echo '<tr><th class="text-center lightgray">용량</th><th class="text-center lightgray">전원</th><th class="text-center lightgray">수량</th></tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
// 모터 데이터 출력
|
||||
foreach ($motorData as $volt => $capacities) {
|
||||
foreach ($capacities as $capacity => $quantity) {
|
||||
if ($quantity > 0) {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center">' . $capacity . '</td>';
|
||||
echo '<td class="text-center">' . $volt . '</td>';
|
||||
echo '<td class="text-center">' . $quantity . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>'; // 모터 부분 끝
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($motorData);
|
||||
// echo '</pre>';
|
||||
|
||||
// 2) 브라켓트 부분
|
||||
echo '<div class="col-sm-6 d-flex align-items-top justify-content-center">';
|
||||
echo '<table class="table" style="border-collapse: collapse;">';
|
||||
echo '<thead>';
|
||||
echo '<tr><th colspan="4" class="text-center lightgray">브라켓트 및 받침용 앵글</th></tr>';
|
||||
echo '<tr><th class="text-center lightgray">브라켓 크기</th>';
|
||||
echo '<th class="text-center lightgray">수량</th>';
|
||||
echo '<th class="text-center lightgray">받침용 앵글 </th>';
|
||||
echo '<th class="text-center lightgray">수량</th></tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
// 브라켓과 앵글 데이터를 배열에 저장
|
||||
$bracketData = array_values($bracketSpec['bracketSizes']); // 키를 숫자 인덱스로 변환
|
||||
$angleData = array_values($bracketAngleSpec['bracketAngleSizes']); // 키를 숫자 인덱스로 변환
|
||||
|
||||
// 두 배열의 최대 길이를 구함
|
||||
$maxRows = max(count($bracketData), count($angleData));
|
||||
|
||||
// 루프를 돌면서 데이터 출력
|
||||
for ($i = 0; $i < $maxRows; $i++) {
|
||||
echo '<tr>';
|
||||
|
||||
// 브라켓 데이터 출력 (해당 인덱스에 데이터가 있는지 확인)
|
||||
if (isset($bracketData[$i])) {
|
||||
echo '<td class="text-center">' . $bracketData[$i]['size'] . '</td>';
|
||||
echo '<td class="text-center">' . $bracketData[$i]['quantity'] . '</td>';
|
||||
} else {
|
||||
// 데이터가 없으면 빈 칸 출력
|
||||
echo '<td class="text-center">-</td>';
|
||||
echo '<td class="text-center">-</td>';
|
||||
}
|
||||
|
||||
// 앵글 데이터 출력 (해당 인덱스에 데이터가 있는지 확인)
|
||||
if (isset($angleData[$i])) {
|
||||
echo '<td class="text-center">' . $angleData[$i]['size'] . '</td>';
|
||||
echo '<td class="text-center">' . $angleData[$i]['quantity'] * 4 . '</td>';
|
||||
} else {
|
||||
// 데이터가 없으면 빈 칸 출력
|
||||
echo '<td class="text-center">-</td>';
|
||||
echo '<td class="text-center">-</td>';
|
||||
}
|
||||
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>'; // 브라켓트 부분 끝
|
||||
|
||||
// 3) 연동제어기 부분
|
||||
echo '<div class="col-sm-3 d-flex align-items-top justify-content-center">';
|
||||
echo '<table class="table" style="border-collapse: collapse;">';
|
||||
echo '<thead>';
|
||||
echo '<tr><th colspan="2" class="text-center lightgray">연동제어기</th></tr>';
|
||||
echo '<tr><th class="text-center lightgray">품명</th><th class="text-center lightgray">수량</th></tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
$control_labels = ['매립', '노출', '뒷박스'];
|
||||
for ($i = 0; $i < count($other_columns); $i++) {
|
||||
if (intval(trim($other_columns[$i])) !== 0 && $other_columns[$i] !== '0') {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center">' . $control_labels[$i] . '</td>';
|
||||
echo '<td class="text-center">' . $other_columns[$i] . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>'; // 연동제어기 부분 끝
|
||||
|
||||
echo '</div>'; // row 끝
|
||||
}
|
||||
?>
|
||||
149
output/common/motor_slat.php
Normal file
149
output/common/motor_slat.php
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
// 모터 부분
|
||||
if (True) {
|
||||
// 함수 호출을 통해 계산된 값을 가져옴
|
||||
$specifications = calculateMotorSpecifications_slat($eList);
|
||||
$bracketSpec = calculateBracket_slat($eList);
|
||||
$bracketAngleSpec = calculateBracketAngle_slat($eList);
|
||||
|
||||
// 모터 관련 데이터
|
||||
$columns = [
|
||||
$specifications['col1_sum'],
|
||||
$specifications['col2_sum'],
|
||||
$specifications['col3_sum'],
|
||||
$specifications['col4_sum'],
|
||||
$specifications['col5_sum'],
|
||||
$specifications['col6_sum'],
|
||||
$specifications['col7_sum']
|
||||
];
|
||||
// 연동제어기 관련 데이터
|
||||
$other_columns = [
|
||||
$specifications['col8_sum'],
|
||||
$specifications['col9_sum'],
|
||||
$specifications['col10_sum'],
|
||||
];
|
||||
|
||||
// 모터별 전압 데이터 수집
|
||||
$motorData = [
|
||||
'220V' => [],
|
||||
'380V' => []
|
||||
];
|
||||
|
||||
foreach ($eList as $item) {
|
||||
$motor_brand = isset($item['col19_brand']) ? $item['col19_brand'] : '';
|
||||
$volt = isset($item['col19']) ? $item['col19'] : '';
|
||||
$capacity = isset($item['col20']) ? $item['col20'] : '';
|
||||
$quantity = isset($item['col15']) ? intval($item['col15']) : 0;
|
||||
|
||||
if ($volt && $capacity && $quantity > 0 && strpos($motor_brand, '없음') === false) {
|
||||
// 해당 전압의 용량이 없으면 초기화
|
||||
if (!isset($motorData[$volt][$capacity])) {
|
||||
$motorData[$volt][$capacity] = 0;
|
||||
}
|
||||
// 수량 합산
|
||||
$motorData[$volt][$capacity] += $quantity;
|
||||
}
|
||||
}
|
||||
|
||||
// HTML 구조 시작
|
||||
echo '<div class="row ">';
|
||||
|
||||
// 1) 모터 부분
|
||||
echo '<div class="col-sm-3 d-flex justify-content-start">';
|
||||
echo '<table class="table" style="border-collapse: collapse;">';
|
||||
echo '<thead>';
|
||||
echo '<tr><th colspan="3" class="text-center lightgray">모터종류(KG)</th></tr>';
|
||||
echo '<tr><th class="text-center lightgray">용량</th><th class="text-center lightgray">전원</th><th class="text-center lightgray">수량</th></tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
// 모터 데이터 출력
|
||||
foreach ($motorData as $volt => $capacities) {
|
||||
foreach ($capacities as $capacity => $quantity) {
|
||||
if ($quantity > 0) {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center">' . $capacity . '</td>';
|
||||
echo '<td class="text-center">' . $volt . '</td>';
|
||||
echo '<td class="text-center">' . $quantity . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>'; // 모터 부분 끝
|
||||
|
||||
// 2) 브라켓트 부분
|
||||
echo '<div class="col-sm-6 d-flex align-items-top justify-content-center">';
|
||||
echo '<table class="table" style="border-collapse: collapse;">';
|
||||
echo '<thead>';
|
||||
echo '<tr><th colspan="4" class="text-center lightgray">브라켓트 및 받침용 앵글</th></tr>';
|
||||
echo '<tr><th class="text-center lightgray">브라켓 크기</th><th class="text-center lightgray">수량</th><th class="text-center lightgray">받침용 앵글 </th><th class="text-center lightgray">수량</th></tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
// 브라켓과 앵글 데이터를 배열에 저장
|
||||
$bracketData = array_values($bracketSpec['bracketSizes']); // 키를 숫자 인덱스로 변환
|
||||
$angleData = array_values($bracketAngleSpec['bracketAngleSizes']); // 키를 숫자 인덱스로 변환
|
||||
|
||||
// 두 배열의 최대 길이를 구함
|
||||
$maxRows = max(count($bracketData), count($angleData));
|
||||
|
||||
// 루프를 돌면서 데이터 출력
|
||||
for ($i = 0; $i < $maxRows; $i++) {
|
||||
echo '<tr>';
|
||||
|
||||
// 브라켓 데이터 출력 (해당 인덱스에 데이터가 있는지 확인)
|
||||
if (isset($bracketData[$i])) {
|
||||
echo '<td class="text-center">' . $bracketData[$i]['size'] . '</td>';
|
||||
echo '<td class="text-center">' . $bracketData[$i]['quantity'] . '</td>';
|
||||
} else {
|
||||
// 데이터가 없으면 빈 칸 출력
|
||||
echo '<td class="text-center">-</td>';
|
||||
echo '<td class="text-center">-</td>';
|
||||
}
|
||||
|
||||
// 앵글 데이터 출력 (해당 인덱스에 데이터가 있는지 확인)
|
||||
if (isset($angleData[$i])) {
|
||||
echo '<td class="text-center">' . $angleData[$i]['size'] . '</td>';
|
||||
echo '<td class="text-center">' . $angleData[$i]['quantity'] * 4 . '</td>';
|
||||
} else {
|
||||
// 데이터가 없으면 빈 칸 출력
|
||||
echo '<td class="text-center">-</td>';
|
||||
echo '<td class="text-center">-</td>';
|
||||
}
|
||||
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>'; // 브라켓트 부분 끝
|
||||
|
||||
// 3) 연동제어기 부분
|
||||
echo '<div class="col-sm-3 d-flex align-items-top justify-content-center">';
|
||||
echo '<table class="table" style="border-collapse: collapse;">';
|
||||
echo '<thead>';
|
||||
echo '<tr><th colspan="2" class="text-center lightgray">연동제어기</th></tr>';
|
||||
echo '<tr><th class="text-center lightgray">품명</th><th class="text-center lightgray">수량</th></tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
$control_labels = ['매립', '노출', '뒷박스'];
|
||||
for ($i = 0; $i < count($other_columns); $i++) {
|
||||
if (intval(trim($other_columns[$i])) !== 0 && $other_columns[$i] !== '0') {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center">' . $control_labels[$i] . '</td>';
|
||||
echo '<td class="text-center">' . $other_columns[$i] . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>'; // 연동제어기 부분 끝
|
||||
|
||||
echo '</div>'; // row 끝
|
||||
}
|
||||
?>
|
||||
425
output/common/output_write_form.php
Normal file
425
output/common/output_write_form.php
Normal file
@@ -0,0 +1,425 @@
|
||||
<div class="container-fluid" >
|
||||
<div class="row mb-2" >
|
||||
<div class="card" style="padding:2;" >
|
||||
<div class="card-body text-center" style="padding:2;" >
|
||||
<div id="output-list">
|
||||
<div class="d-flex justify-content-start align-items-center">
|
||||
<table class="table table-bordered w-100">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-end fw-bold" style="width:50px;">
|
||||
출고
|
||||
<td style="width:130px;">
|
||||
<input type="date" id="outdate" name="outdate" class="form-control" value="<?=$outdate?>" >
|
||||
</td>
|
||||
<td class="text-end fw-bold" style="width:50px;"> 접수 </td>
|
||||
<td style="width:130px;">
|
||||
<input type="date" id="indate" name="indate" class="form-control" value="<?=$indate?>" >
|
||||
</td>
|
||||
<td class="text-end fw-bold" style="width:90px;"> 발주 작성 </td>
|
||||
<td style="width:130px;">
|
||||
<input type="date" id="orderdate" name="orderdate" class="form-control" value="<?=$orderdate?>" >
|
||||
</td>
|
||||
<td class="text-end fw-bold" style="width:80px;"> 제품코드 </td>
|
||||
<td class="text-center" style="width:130px;">
|
||||
<!-- 제품모델(KSS01 등) 선택 -->
|
||||
<?php selectModel('prodCode', $prodCode); ?>
|
||||
</td>
|
||||
<td class="text-end fw-bold" style="width:250px;">
|
||||
<div class="d-flex justify-content-end align-items-center">
|
||||
<?php if ($mode === '' || $mode === 'insert' || $mode === 'copy' || $mode === 'modify'): ?>
|
||||
<label for="createAutoCode" class="text-primary fw-bold" > 로트번호 자동생성 </label>
|
||||
<input type="checkbox" id="createAutoCode" name="createAutoCode" >
|
||||
|
||||
<?php endif; ?>
|
||||
로트번호
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center" style="width:150px;">
|
||||
<input type="text" id="lotNum" name="lotNum" class="form-control text-start" value="<?=$lotNum?>" autocomplete="off" >
|
||||
</td>
|
||||
<td class="text-end fw-bold" style="width:80px;"> 인증번호 </td>
|
||||
<td class="text-center" style="width:250px;">
|
||||
<input type="text" id="warrantyNum" name="warrantyNum" class="form-control text-start" value="<?=$warrantyNum?>" autocomplete="off" >
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<div class="d-flex justify-content-start align-items-center">
|
||||
<table class="table table-bordered table-sm ">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center fw-bold w50px" > 진행 </td>
|
||||
<td style="width:250px;">
|
||||
<?php
|
||||
$aryreg=array();
|
||||
switch ($regist_state) {
|
||||
case "등록" : $aryreg[0] = "checked" ; break;
|
||||
case "수정" : $aryreg[1] = "checked" ; break;
|
||||
case "접수" : $aryreg[2] = "checked" ; break;
|
||||
case "완료" : $aryreg[3] = "checked" ; break;
|
||||
default: break;
|
||||
}
|
||||
?>
|
||||
등록 <input type="radio" <?=$aryreg[0]?> name="regist_state" value="등록">
|
||||
수정 <input type="radio" <?=$aryreg[1]?> name="regist_state" value="수정">
|
||||
접수 <input type="radio" <?=$aryreg[2]?> name="regist_state" value="접수">
|
||||
완료 <input type="radio" <?=$aryreg[3]?> name="regist_state" value="완료">
|
||||
</td>
|
||||
<td class="text-center fw-bold" style="width:50px;"> 회사 </td>
|
||||
<td style="width:150px;">
|
||||
<?php
|
||||
if ($root == null) {
|
||||
$root = "주일";
|
||||
}
|
||||
?>
|
||||
<label>
|
||||
주일 <input type="radio" name="root" id="root" value="주일" <?= $root == "주일" ? 'checked' : '' ?>>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
경동 <input type="radio" name="root" id="root" value="경동" <?= $root == "경동" ? 'checked' : '' ?>>
|
||||
</label>
|
||||
</td>
|
||||
<td >
|
||||
<?php
|
||||
$steelChecked = ($steel == "1") ? 'checked' : '' ; // 절곡체크가 steel 임.
|
||||
$motorChecked = ($motor == "1") ? 'checked' : ''; // 모터가 들어가는지 체크
|
||||
$warrantyChecked = ($warranty == "인정") ? 'checked' : ''; // 인정제품인지 체크
|
||||
$slatChecked = ($slatcheck == "1") ? 'checked' : ''; // 주자재(스크린,철재) 체크
|
||||
$partsChecked = ($partscheck == "1") ? 'checked' : ''; // 부자재 체크
|
||||
?>
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<h6>
|
||||
<label for="warranty">
|
||||
<input type="checkbox" id="warranty" data-readonly="true" name="warranty" value="인정" <?= $warrantyChecked ?> onchange="toggleOtherCheckboxes(this)">
|
||||
<span class="badge bg-primary-subtle border border-primary-subtle text-primary-emphasis rounded-pill me-1"> 인정 </span>
|
||||
</label>
|
||||
<label for="slatcheck">
|
||||
<input type="checkbox" id="slatcheck" data-readonly="true" name="slatcheck" value="1" <?= $slatChecked ?>>
|
||||
<span class="badge bg-info-subtle border border-info-subtle text-info-emphasis rounded-pill me-1"> 주자재(스크린,철재) </span>
|
||||
</label>
|
||||
<label for="motor">
|
||||
<input type="checkbox" id="motor" data-readonly="true" name="motor" value="1" <?= $motorChecked ?>>
|
||||
<span class="badge bg-success-subtle border border-success-subtle text-success-emphasis rounded-pill me-1"> 모터 </span>
|
||||
</label>
|
||||
<label for="steel">
|
||||
<input type="checkbox" data-readonly="true" id="steel" name="steel" value="1" <?= $steelChecked ?>>
|
||||
<span class="badge bg-secondary-subtle border border-secondary-subtle text-secondary-emphasis rounded-pill me-1"> 절곡 </span>
|
||||
</label>
|
||||
<label for="partscheck">
|
||||
<input type="checkbox" id="partscheck" data-readonly="true" name="partscheck" value="1" <?= $partsChecked ?>>
|
||||
<span class="badge bg-danger-subtle border border-danger-subtle text-danger-emphasis rounded-pill me-1"> 부자재 </span>
|
||||
</label>
|
||||
</h6>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleOtherCheckboxes(warrantyCheckbox) {
|
||||
// 나머지 4개 체크박스 ID들
|
||||
const otherCheckboxes = ['slatcheck', 'motor', 'steel', 'partscheck'];
|
||||
|
||||
// 인정 체크박스가 체크되었는지 확인
|
||||
const isChecked = warrantyCheckbox.checked;
|
||||
|
||||
// 나머지 체크박스들을 모두 동일한 상태로 설정
|
||||
otherCheckboxes.forEach(function(checkboxId) {
|
||||
const checkbox = document.getElementById(checkboxId);
|
||||
if (checkbox) {
|
||||
checkbox.checked = isChecked;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</td>
|
||||
<td class="text-center fw-bold" style="width:50px;"> 담당 </td>
|
||||
<td style="width:80px;">
|
||||
<input type="text" id="orderman" name="orderman" value="<?=$orderman?>" class="form-control" placeholder="담당자" >
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="d-flex align-items-center ">
|
||||
<table class="table table-bordered ">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-end" style="width:80px;">발주처</td>
|
||||
<td style="width:350px;">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<input type="text" id="secondord" name="secondord" value="<?=$secondord?>" class="form-control text-start w-80" autocomplete="off" onkeydown="if(event.keyCode == 13) { phonebookBtn('secondord'); }">
|
||||
<button type="button" id="searchsecondord" class="btn btn-primary searchsecondord btn-sm" onclick="phonebookBtn('secondord');" > <i class="bi bi-search"></i> </button>
|
||||
<!-- <button type="button" class="btn btn-dark-outline btn-sm restrictbtn" onclick="phonebookBtn('secondord');"> <ion-icon name="settings-outline"></ion-icon> </button> -->
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-end" >담당자</td>
|
||||
<td style="width:100px;">
|
||||
<input type="text" id="secondordman" name="secondordman" class="form-control text-start" autocomplete="off" value="<?=$secondordman?>" onkeydown="if(event.keyCode == 13) { phonebookBtn('secondordman'); }">
|
||||
</td>
|
||||
<td class="text-end" > <i class="bi bi-telephone-forward-fill"></i> 연락처 </td>
|
||||
<td style="width:130px;">
|
||||
<input type="text" id="secondordmantel" name="secondordmantel" value="<?=$secondordmantel?>" autocomplete="off" class="form-control text-start" style="width:140px;" onkeydown="if(event.keyCode == 13) { phonebookBtn('secondordmantel'); }">
|
||||
</td>
|
||||
<td class="text-end" > 발주처 Code </td>
|
||||
<td style="width:80px;">
|
||||
<input type="text" id="secondordnum" name="secondordnum" value="<?=$secondordnum?>" class="form-control" placeholder="발주처code" >
|
||||
</td>
|
||||
<td class="text-end" > 견적 Code </td>
|
||||
<td style="width:80px;">
|
||||
<input type="text" id="estimate_num" name="estimate_num" value="<?=$estimate_num?>" class="form-control" placeholder="견적code" >
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="d-flex align-items-center ">
|
||||
<table class="table table-bordered table-sm" style="border: 2px solid brown;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="5" class="text-center">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<span class="badge bg-danger " data-bs-toggle="tooltip" data-bs-placement="bottom" title=" 인정검사 요청이 오면 접수일자를 입력합니다." > 인정검사 </span>
|
||||
<span class="mx-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="같은 현장별 그룹화 작업, 그룹코드" > 그룹명 </span>
|
||||
<input type="text" id="ACIgroupName" name="ACIgroupName" value="<?=$ACIgroupName?>" class="form-control text-start w220px mx-1" placeholder="품질관리서명 " onkeydown="if(event.keyCode == 13) { acigroupBtn(); }" autocomplete="off" >
|
||||
|
||||
<button type="button" id="fetch_loadgroupBtn" class="btn btn-primary fetch_loadgroupBtn btn-sm" onclick="acigroupBtn(); return false;" > <i class="bi bi-search"></i> </button>
|
||||
<span class="mx-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="품질관리서번호" > 품질관리서<br>번호 </span>
|
||||
<input type="text" id="ACIgroupCode" name="ACIgroupCode" value="<?=$ACIgroupCode?>" class="form-control text-start w120px mx-1" placeholder="그룹코드">
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:80px;"> 접수 </td>
|
||||
<td style="width:80px;"> 요청 </td>
|
||||
<td style="width:80px;"> 완료 </td>
|
||||
<td style="width:80px;"> 제외 </td>
|
||||
<td style="width:100px;"> 메모 </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input
|
||||
type="date"
|
||||
id="ACIregDate"
|
||||
name="ACIregDate"
|
||||
class="form-control w60"
|
||||
autocomplete="off"
|
||||
value="<?= $ACIregDate !== '0000-00-00' ? $ACIregDate : '' ?>"
|
||||
>
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
type="date"
|
||||
id="ACIaskDate"
|
||||
name="ACIaskDate"
|
||||
class="form-control w60"
|
||||
autocomplete="off"
|
||||
readonly
|
||||
value="<?= $ACIaskDate !== '0000-00-00' ? $ACIaskDate : '' ?>"
|
||||
>
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
type="date"
|
||||
id="ACIdoneDate"
|
||||
name="ACIdoneDate"
|
||||
class="form-control"
|
||||
autocomplete="off"
|
||||
readonly
|
||||
value="<?= $ACIdoneDate !== '0000-00-00' ? $ACIdoneDate : '' ?>"
|
||||
>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" id="ACIcheck" name="ACIcheck" style="width:25px;" value="1" <?= $ACIcheck == '1' ? 'checked' : '' ?> >
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="ACImemo" name="ACImemo" class="form-control " autocomplete="off" value="<?=$ACImemo?>" >
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!-- end of com-sm -->
|
||||
</div> <!-- end of row -->
|
||||
|
||||
|
||||
<div class="d-flex justify-content-start align-items-center">
|
||||
<table class="table table-bordered table-sm ">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-end" style="width:80px;"> 현 장 명 </td>
|
||||
<td style="width:400px;">
|
||||
<div class="d-flex p-1 mb-1 justify-content-start align-items-center ">
|
||||
<input type="text" id="outworkplace" name="outworkplace" value="<?=$outworkplace?>" class="form-control searchplace text-start w-90 me-1" placeholder="주일은 현장명 경동은 업체명">
|
||||
<button type="button" id="searchplace" class="btn btn-primary searchplace fetch_outworkplaceBtn btn-sm"> <i class="bi bi-search"></i> </button>
|
||||
</div> <span class="text-danger"> (주일공사는 현장명 검색 후 선택해야 출고가 연계됨) </span>
|
||||
</td>
|
||||
<td class="text-center" style="width:50px;">
|
||||
<span class="text-dark fw-bold"> 공사 <br> 번호 </span>
|
||||
</td>
|
||||
<td class="text-center" style="width:60px;">
|
||||
<input type="text" id="con_num" name="con_num" value="<?=$con_num?>" class="form-control " placeholder="주일공사">
|
||||
</td>
|
||||
<td class="text-end" style="width:40px;"> 배송<br>방식 </td>
|
||||
<td style="width:400px;" class="text-start" >
|
||||
<?php
|
||||
if ($delivery == null) {
|
||||
$delivery = "상차(선불)";
|
||||
}
|
||||
|
||||
$deliveryOptions = [
|
||||
"상차(선불)" => "checked",
|
||||
"상차(착불)" => "",
|
||||
"경동화물(선불)" => "",
|
||||
"경동화물(착불)" => "",
|
||||
"경동택배(선불)" => "",
|
||||
"경동택배(착불)" => "",
|
||||
"직접배차" => "",
|
||||
"직접수령" => "",
|
||||
"대신화물(선불)" => "",
|
||||
"대신화물(착불)" => "",
|
||||
"대신택배(선불)" => "",
|
||||
"대신택배(착불)" => ""
|
||||
];
|
||||
|
||||
if (array_key_exists($delivery, $deliveryOptions)) {
|
||||
$deliveryOptions[$delivery] = "checked";
|
||||
}
|
||||
?>
|
||||
|
||||
상차(선불) <input type="radio" <?= $deliveryOptions["상차(선불)"] ?> name="delivery" value="상차(선불)">
|
||||
상차(착불) <input type="radio" <?= $deliveryOptions["상차(착불)"] ?> name="delivery" value="상차(착불)">
|
||||
직접배차 <input type="radio" <?= $deliveryOptions["직접배차"] ?> name="delivery" value="직접배차">
|
||||
직접수령 <input type="radio" <?= $deliveryOptions["직접수령"] ?> name="delivery" value="직접수령">
|
||||
<br>
|
||||
경동화물(선불) <input type="radio" <?= $deliveryOptions["경동화물(선불)"] ?> name="delivery" value="경동화물(선불)">
|
||||
경동화물(착불) <input type="radio" <?= $deliveryOptions["경동화물(착불)"] ?> name="delivery" value="경동화물(착불)">
|
||||
경동택배(선불) <input type="radio" <?= $deliveryOptions["경동택배(선불)"] ?> name="delivery" value="경동택배(선불)">
|
||||
경동택배(착불) <input type="radio" <?= $deliveryOptions["경동택배(착불)"] ?> name="delivery" value="경동택배(착불)">
|
||||
<br>
|
||||
대신화물(선불) <input type="radio" <?= $deliveryOptions["대신화물(선불)"] ?> name="delivery" value="대신화물(선불)">
|
||||
대신화물(착불) <input type="radio" <?= $deliveryOptions["대신화물(착불)"] ?> name="delivery" value="대신화물(착불)">
|
||||
대신택배(선불) <input type="radio" <?= $deliveryOptions["대신택배(선불)"] ?> name="delivery" value="대신택배(선불)">
|
||||
대신택배(착불) <input type="radio" <?= $deliveryOptions["대신택배(착불)"] ?> name="delivery" value="대신택배(착불)">
|
||||
</td>
|
||||
<td style="width:400px;">
|
||||
<table class="table table-bordered table-sm text-end" <?php echo $authority !== 'ACCOUNT' ? 'hidden' : ''; ?>>
|
||||
<thead >
|
||||
<tr>
|
||||
<td colspan="3" class="text-end">
|
||||
<button type='button' id='viewEstimateDetail' class='btn btn-success btn-sm mx-2 p-0'> <i class='bi bi-card-heading'></i> 인정제품 거래명세 </button>
|
||||
<button type="button" id="openUAaccountModal" class="btn btn-primary btn-sm mx-2 p-0"> <i class='bi bi-card-heading'></i> 비인정 거래명세 </button>
|
||||
(VAT포함)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center">인정제품 금액</th>
|
||||
<th class="text-center">비인정제품 금액</th>
|
||||
<th class="text-center">총 금액</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text" id="estimateTotal" name="estimateTotal" class="form-control text-end" readonly
|
||||
value="<?= isset($estimateTotal) && $estimateTotal != 0 ? number_format($estimateTotal) : $estimateTotal ?>">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="ET_unapproved" name="ET_unapproved" class="form-control text-end" readonly
|
||||
value="<?= isset($ET_unapproved) && $ET_unapproved != 0 ? number_format($ET_unapproved) : $ET_unapproved ?>">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="ET_total" name="ET_total" class="form-control text-end" readonly
|
||||
value="<?= isset($ET_total) && $ET_total != 0 ? number_format($ET_total) : $ET_total ?>">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="d-flex mb-1 justify-content-center align-items-center">
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-end" style="width:110px;"> 수신(반장/업체) </td>
|
||||
<td style="width:250px;">
|
||||
<div class="d-flex p-1 mb-1 justify-content-start align-items-center ">
|
||||
<input type="text" id="receiver" name="receiver" value="<?=$receiver?>" autocomplete="off" class="form-control w-90 me-1 text-start" placeholder="(작업반장/업체)" >
|
||||
<button type="button" class="btn btn-primary btn-sm fetch_receiverBtn" > <i class="bi bi-search"></i> </button>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="text-end" style="width:100px;"> 수신처주소 </td>
|
||||
<td style="width:400px;">
|
||||
<input type="text" id="outputplace" name="outputplace" value="<?=$outputplace?>" autocomplete="off" class="form-control text-start " placeholder="현장주소 또는 납품처 주소 or 화물 영업소" >
|
||||
</td>
|
||||
<td class="text-end w130px" >
|
||||
<span class="text-dark fw-bold ms-2 me-2" > 수신처 연락처 </span>
|
||||
</td>
|
||||
<td class="text-start" >
|
||||
<input type="text" id="phone" name="phone" value="<?=$phone?>" class="form-control text-start w150px" autocomplete="off" placeholder="반장 or 업체">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="d-flex mb-1 justify-content-center align-items-center">
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-end w40px" > 비고 </td>
|
||||
<td style="width:420px;" >
|
||||
<div class="d-flex p-1 mb-1 justify-content-start align-items-center ">
|
||||
<textarea rows="3" id="comment" name="comment" class="form-control fs-6 text-dark " style="height:64px;" placeholder="내부 메시지를 남겨주세요." ><?=$comment?></textarea>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-end fw-bold text-danger w50px"> 수정<br>기록 </td>
|
||||
<td style="width:420px;" >
|
||||
<div class="d-flex p-1 mb-1 justify-content-start align-items-center ">
|
||||
<textarea rows="3" id="updatecomment" name="updatecomment" style="height:64px;" class="form-control fs-6 text-danger " placeholder="수정사항 기록" ><?=$updatecomment?></textarea>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-end text-primary w80px"> 발주서,<br>출고증 등<br> 표시문구 </td>
|
||||
<td style="width:420px;" >
|
||||
<div class="d-flex p-1 mb-1 justify-content-start align-items-center ">
|
||||
<textarea rows="3" id="displayText" name="displayText" style="height:64px;" class="form-control fs-6 text-primary " placeholder="발주서 출고증 등 표시문구" ><?=$displayText?></textarea>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-start">
|
||||
<h6> <span class="badge bg-secondary mb-1"><i class="bi bi-paperclip"></i> 첨부파일</span></h6> <br>
|
||||
<div class="d-flex justify-content-start">
|
||||
<!-- 파일 선택 -->
|
||||
<input type="file" id="upfile" name="upfile[]" multiple style="display:none;">
|
||||
<button class="btn btn-dark btn-sm me-4" type="button" onclick="document.getElementById('upfile').click();">
|
||||
<i class="bi bi-image"></i> </button>
|
||||
|
||||
<!-- 드롭 영역 -->
|
||||
<div id="dropArea" style="border: 1px dashed #ccc; padding: 8px; width:320px; text-align: center;">
|
||||
파일 drop 영역
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex mt-1 justify-content-start">
|
||||
<!-- 파일 목록 표시 -->
|
||||
<div id="displayFile"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
389
output/common/output_write_form1.php
Normal file
389
output/common/output_write_form1.php
Normal file
@@ -0,0 +1,389 @@
|
||||
<div class="container-fluid" >
|
||||
<div class="row mb-2" >
|
||||
<div class="card" style="padding:2;" >
|
||||
<div class="card-body text-center" style="padding:2;" >
|
||||
<div id="output-list">
|
||||
<div class="d-flex justify-content-start align-items-center">
|
||||
<table class="table table-bordered w-100">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-end fw-bold" style="width:50px;">
|
||||
출고
|
||||
<td style="width:130px;">
|
||||
<input type="date" id="outdate" name="outdate" class="form-control" value="<?=$outdate?>" >
|
||||
</td>
|
||||
<td class="text-end fw-bold" style="width:50px;"> 접수 </td>
|
||||
<td style="width:130px;">
|
||||
<input type="date" id="indate" name="indate" class="form-control" value="<?=$indate?>" >
|
||||
</td>
|
||||
<td class="text-end fw-bold" style="width:90px;"> 발주 작성 </td>
|
||||
<td style="width:130px;">
|
||||
<input type="date" id="orderdate" name="orderdate" class="form-control" value="<?=$orderdate?>" >
|
||||
</td>
|
||||
<td class="text-end fw-bold" style="width:80px;"> 제품코드 </td>
|
||||
<td class="text-center" style="width:130px;">
|
||||
<!-- 제품모델(KSS01 등) 선택 -->
|
||||
<?php selectModel('prodCode', $prodCode); ?>
|
||||
</td>
|
||||
<td class="text-end fw-bold" style="width:250px;">
|
||||
<div class="d-flex justify-content-end align-items-center">
|
||||
<?php if ($mode === '' || $mode === 'insert' || $mode === 'copy' || $mode === 'modify'): ?>
|
||||
<label for="createAutoCode" class="text-primary fw-bold" > 로트번호 자동생성 </label>
|
||||
<input type="checkbox" id="createAutoCode" name="createAutoCode" >
|
||||
|
||||
<?php endif; ?>
|
||||
로트번호
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center" style="width:150px;">
|
||||
<input type="text" id="lotNum" name="lotNum" class="form-control text-start" value="<?=$lotNum?>" autocomplete="off" >
|
||||
</td>
|
||||
<td class="text-end fw-bold" style="width:80px;"> 인증번호 </td>
|
||||
<td class="text-center" style="width:250px;">
|
||||
<input type="text" id="warrantyNum" name="warrantyNum" class="form-control text-start" value="<?=$warrantyNum?>" autocomplete="off" >
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<div class="d-flex justify-content-start align-items-center">
|
||||
<table class="table table-bordered w-95">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center fw-bold" > 진행 </td>
|
||||
<td style="width:250px;">
|
||||
<?php
|
||||
$aryreg=array();
|
||||
switch ($regist_state) {
|
||||
case "등록" : $aryreg[0] = "checked" ; break;
|
||||
case "수정" : $aryreg[1] = "checked" ; break;
|
||||
case "접수" : $aryreg[2] = "checked" ; break;
|
||||
case "완료" : $aryreg[3] = "checked" ; break;
|
||||
default: break;
|
||||
}
|
||||
?>
|
||||
등록 <input type="radio" <?=$aryreg[0]?> name="regist_state" value="등록">
|
||||
수정 <input type="radio" <?=$aryreg[1]?> name="regist_state" value="수정">
|
||||
접수 <input type="radio" <?=$aryreg[2]?> name="regist_state" value="접수">
|
||||
완료 <input type="radio" <?=$aryreg[3]?> name="regist_state" value="완료">
|
||||
</td>
|
||||
<td class="text-center fw-bold" style="width:70px;"> 회사구분 </td>
|
||||
<td style="width:160px;">
|
||||
<?php
|
||||
if ($root == null) {
|
||||
$root = "주일";
|
||||
}
|
||||
?>
|
||||
<label>
|
||||
주일 <input type="radio" name="root" id="root" value="주일" <?= $root == "주일" ? 'checked' : '' ?>>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
경동 <input type="radio" name="root" id="root" value="경동" <?= $root == "경동" ? 'checked' : '' ?>>
|
||||
</label>
|
||||
</td>
|
||||
<td class="text-center fw-bold" style="width:80px;"> 발주표시 </td>
|
||||
<td style="width:380px;">
|
||||
<?php
|
||||
$steelChecked = ($steel == "1") ? 'checked' : '';
|
||||
$motorChecked = ($motor == "1") ? 'checked' : '';
|
||||
$warrantyChecked = ($warranty == "인정") ? 'checked' : '';
|
||||
?>
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<label for="steelcheck">
|
||||
<input type="checkbox" data-readonly="true" id="steelcheck" name="steel" value="1" <?= $steelChecked ?>>
|
||||
<span class="badge bg-secondary-subtle border border-secondary-subtle text-secondary-emphasis rounded-pill fs-6" > 절곡발주 </span>
|
||||
</label>
|
||||
|
||||
<label for="motorcheck">
|
||||
<input type="checkbox" data-readonly="true" id="motorcheck" name="motor" value="1" <?= $motorChecked ?>>
|
||||
<span class="badge bg-success-subtle border border-success-subtle text-success-emphasis rounded-pill fs-6" > 모터발주 </span>
|
||||
</label>
|
||||
|
||||
<label for="warranty">
|
||||
<input type="checkbox" id="warranty" data-readonly="true" name="warranty" value="인정" <?= $warrantyChecked ?>>
|
||||
<span class="badge bg-primary-subtle border border-primary-subtle text-primary-emphasis rounded-pill fs-6" > 인정제품 </span>
|
||||
<label>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center fw-bold" style="width:50px;"> 담당 </td>
|
||||
<td style="width:100px;">
|
||||
<input type="text" id="orderman" name="orderman" value="<?=$orderman?>" class="form-control" placeholder="주일/경동 직원" >
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="d-flex align-items-center ">
|
||||
<table class="table table-bordered ">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-end" style="width:80px;">발주처</td>
|
||||
<td style="width:350px;">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<input type="text" id="secondord" name="secondord" value="<?=$secondord?>" class="form-control text-start w-80" autocomplete="off" onkeydown="if(event.keyCode == 13) { phonebookBtn('secondord'); }">
|
||||
<button type="button" id="searchsecondord" class="btn btn-primary searchsecondord btn-sm" onclick="phonebookBtn('secondord');" > <i class="bi bi-search"></i> </button>
|
||||
<!-- <button type="button" class="btn btn-dark-outline btn-sm restrictbtn" onclick="phonebookBtn('secondord');"> <ion-icon name="settings-outline"></ion-icon> </button> -->
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-end" >담당자</td>
|
||||
<td style="width:130px;">
|
||||
<input type="text" id="secondordman" name="secondordman" class="form-control text-start" autocomplete="off" value="<?=$secondordman?>" onkeydown="if(event.keyCode == 13) { phonebookBtn('secondordman'); }">
|
||||
</td>
|
||||
<td class="text-end" > <i class="bi bi-telephone-forward-fill"></i> 연락처 </td>
|
||||
<td style="width:130px;">
|
||||
<input type="text" id="secondordmantel" name="secondordmantel" value="<?=$secondordmantel?>" autocomplete="off" class="form-control text-start" style="width:140px;" onkeydown="if(event.keyCode == 13) { phonebookBtn('secondordmantel'); }">
|
||||
</td>
|
||||
<td class="text-end" > 발주처 Code </td>
|
||||
<td style="width:100px;">
|
||||
<input type="text" id="secondordnum" name="secondordnum" value="<?=$secondordnum?>" class="form-control" placeholder="code" >
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="d-flex align-items-center ">
|
||||
<table class="table table-bordered" style="border: 2px solid brown;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="5" class="text-center">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<span class="badge bg-danger fs-6" data-bs-toggle="tooltip" data-bs-placement="bottom" title="인정검사 요청이 오면 접수일자를 입력합니다." > 인정검사 </span>
|
||||
<span class="mx-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="같은 현장별 그룹화 작업, 그룹코드" > 그룹명 </span>
|
||||
<input type="text" id="ACIgroupName" name="ACIgroupName" value="<?=$ACIgroupName?>" class="form-control text-start w220px mx-1" placeholder="품질관리서명 " onkeydown="if(event.keyCode == 13) { acigroupBtn(); }" autocomplete="off" >
|
||||
|
||||
<button type="button" id="fetch_loadgroupBtn" class="btn btn-primary fetch_loadgroupBtn btn-sm" onclick="acigroupBtn(); return false;" > <i class="bi bi-search"></i> </button>
|
||||
<span class="mx-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="품질관리서번호" > 품질관리서<br>번호 </span>
|
||||
<input type="text" id="ACIgroupCode" name="ACIgroupCode" value="<?=$ACIgroupCode?>" class="form-control text-start w120px mx-1" placeholder="그룹코드">
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:80px;"> 접수 </td>
|
||||
<td style="width:80px;"> 요청 </td>
|
||||
<td style="width:80px;"> 완료 </td>
|
||||
<td style="width:80px;"> 제외 </td>
|
||||
<td style="width:100px;"> 메모 </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input
|
||||
type="date"
|
||||
id="ACIregDate"
|
||||
name="ACIregDate"
|
||||
class="form-control w60"
|
||||
autocomplete="off"
|
||||
value="<?= $ACIregDate !== '0000-00-00' ? $ACIregDate : '' ?>"
|
||||
>
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
type="date"
|
||||
id="ACIaskDate"
|
||||
name="ACIaskDate"
|
||||
class="form-control w60"
|
||||
autocomplete="off"
|
||||
readonly
|
||||
value="<?= $ACIaskDate !== '0000-00-00' ? $ACIaskDate : '' ?>"
|
||||
>
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
type="date"
|
||||
id="ACIdoneDate"
|
||||
name="ACIdoneDate"
|
||||
class="form-control"
|
||||
autocomplete="off"
|
||||
readonly
|
||||
value="<?= $ACIdoneDate !== '0000-00-00' ? $ACIdoneDate : '' ?>"
|
||||
>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" id="ACIcheck" name="ACIcheck" style="width:25px;" value="1" <?= $ACIcheck == '1' ? 'checked' : '' ?> >
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="ACImemo" name="ACImemo" class="form-control " autocomplete="off" value="<?=$ACImemo?>" >
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!-- end of com-sm -->
|
||||
</div> <!-- end of row -->
|
||||
|
||||
|
||||
<div class="d-flex mb-1 justify-content-start align-items-center">
|
||||
<table class="table table-bordered ">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-end" style="width:80px;"> 현 장 명 </td>
|
||||
<td style="width:400px;">
|
||||
<div class="d-flex p-1 mb-1 justify-content-start align-items-center ">
|
||||
<input type="text" id="outworkplace" name="outworkplace" value="<?=$outworkplace?>" class="form-control searchplace text-start w-90 me-1" placeholder="주일은 현장명 경동은 업체명">
|
||||
<button type="button" id="searchplace" class="btn btn-primary searchplace fetch_outworkplaceBtn btn-sm"> <i class="bi bi-search"></i> </button>
|
||||
</div> <span class="text-danger"> (주일공사는 현장명 검색 후 선택해야 출고가 연계됨) </span>
|
||||
</td>
|
||||
<td class="text-center" style="width:50px;">
|
||||
<span class="text-dark fw-bold"> 공사 <br> 번호 </span>
|
||||
</td>
|
||||
<td class="text-center" style="width:60px;">
|
||||
<input type="text" id="con_num" name="con_num" value="<?=$con_num?>" class="form-control " placeholder="주일공사">
|
||||
</td>
|
||||
<td class="text-end" style="width:40px;"> 배송<br>방식 </td>
|
||||
<td style="width:400px;" class="text-start" >
|
||||
<?php
|
||||
if ($delivery == null) {
|
||||
$delivery = "상차(선불)";
|
||||
}
|
||||
|
||||
$deliveryOptions = [
|
||||
"상차(선불)" => "checked",
|
||||
"상차(착불)" => "",
|
||||
"경동화물(선불)" => "",
|
||||
"경동화물(착불)" => "",
|
||||
"경동택배(선불)" => "",
|
||||
"경동택배(착불)" => "",
|
||||
"직접배차" => "",
|
||||
"직접수령" => "",
|
||||
"대신화물(선불)" => "",
|
||||
"대신화물(착불)" => "",
|
||||
"대신택배(선불)" => "",
|
||||
"대신택배(착불)" => ""
|
||||
];
|
||||
|
||||
if (array_key_exists($delivery, $deliveryOptions)) {
|
||||
$deliveryOptions[$delivery] = "checked";
|
||||
}
|
||||
?>
|
||||
|
||||
상차(선불) <input type="radio" <?= $deliveryOptions["상차(선불)"] ?> name="delivery" value="상차(선불)">
|
||||
상차(착불) <input type="radio" <?= $deliveryOptions["상차(착불)"] ?> name="delivery" value="상차(착불)">
|
||||
직접배차 <input type="radio" <?= $deliveryOptions["직접배차"] ?> name="delivery" value="직접배차">
|
||||
직접수령 <input type="radio" <?= $deliveryOptions["직접수령"] ?> name="delivery" value="직접수령">
|
||||
<br>
|
||||
경동화물(선불) <input type="radio" <?= $deliveryOptions["경동화물(선불)"] ?> name="delivery" value="경동화물(선불)">
|
||||
경동화물(착불) <input type="radio" <?= $deliveryOptions["경동화물(착불)"] ?> name="delivery" value="경동화물(착불)">
|
||||
경동택배(선불) <input type="radio" <?= $deliveryOptions["경동택배(선불)"] ?> name="delivery" value="경동택배(선불)">
|
||||
경동택배(착불) <input type="radio" <?= $deliveryOptions["경동택배(착불)"] ?> name="delivery" value="경동택배(착불)">
|
||||
<br>
|
||||
대신화물(선불) <input type="radio" <?= $deliveryOptions["대신화물(선불)"] ?> name="delivery" value="대신화물(선불)">
|
||||
대신화물(착불) <input type="radio" <?= $deliveryOptions["대신화물(착불)"] ?> name="delivery" value="대신화물(착불)">
|
||||
대신택배(선불) <input type="radio" <?= $deliveryOptions["대신택배(선불)"] ?> name="delivery" value="대신택배(선불)">
|
||||
대신택배(착불) <input type="radio" <?= $deliveryOptions["대신택배(착불)"] ?> name="delivery" value="대신택배(착불)">
|
||||
</td>
|
||||
<td style="width:400px;">
|
||||
<table class="table table-bordered mt-0 text-end" <?php echo $authority !== 'ACCOUNT' ? 'hidden' : ''; ?>>
|
||||
<thead class="table-secondary">
|
||||
<tr>
|
||||
<td colspan="3" class="text-end">
|
||||
<button type='button' id='viewEstimateDetail' class='btn btn-success btn-sm mx-2 '> <i class='bi bi-card-heading'></i> 인정제품 거래명세 </button>
|
||||
<button type="button" id="openAccountModal" class="btn btn-primary btn-sm mx-2">
|
||||
비인정 거래명세
|
||||
</button>
|
||||
(공급가액, VAT별도)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center">인정제품 금액</th>
|
||||
<th class="text-center">비인정제품 금액</th>
|
||||
<th class="text-center">총 금액</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text" id="estimateTotal" name="estimateTotal" class="form-control text-end" readonly
|
||||
value="<?= isset($estimateTotal) && $estimateTotal != 0 ? number_format($estimateTotal) : $estimateTotal ?>">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="ET_unapproved" name="ET_unapproved" class="form-control text-end" readonly
|
||||
value="<?= isset($ET_unapproved) && $ET_unapproved != 0 ? number_format($ET_unapproved) : $ET_unapproved ?>">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="ET_total" name="ET_total" class="form-control text-end" readonly
|
||||
value="<?= isset($ET_total) && $ET_total != 0 ? number_format($ET_total) : $ET_total ?>">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="d-flex mb-1 justify-content-center align-items-center">
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-end" style="width:110px;"> 수신(반장/업체) </td>
|
||||
<td style="width:250px;">
|
||||
<div class="d-flex p-1 mb-1 justify-content-start align-items-center ">
|
||||
<input type="text" id="receiver" name="receiver" value="<?=$receiver?>" class="form-control w-90 me-1 text-start" placeholder="(작업반장/업체)" >
|
||||
<button type="button" class="btn btn-primary btn-sm fetch_receiverBtn" > <i class="bi bi-search"></i> </button>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="text-end" style="width:100px;"> 수신처주소 </td>
|
||||
<td style="width:400px;">
|
||||
<input type="text" id="outputplace" name="outputplace" value="<?=$outputplace?>" class="form-control text-start " placeholder="현장주소 또는 납품처 주소 or 화물 영업소" >
|
||||
</td>
|
||||
<td class="text-end w130px" >
|
||||
<span class="text-dark fw-bold ms-2 me-2" > 수신처 연락처 </span>
|
||||
</td>
|
||||
<td class="text-start" >
|
||||
<input type="text" id="phone" name="phone" value="<?=$phone?>" class="form-control text-start w150px" placeholder="반장 or 업체">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="d-flex mb-1 justify-content-center align-items-center">
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-end" > 비고 </td>
|
||||
<td style="width:680px;" >
|
||||
<div class="d-flex p-1 mb-1 justify-content-start align-items-center ">
|
||||
<textarea rows="3" id="comment" name="comment" class="form-control fs-5 text-dark " placeholder="기타 코멘트 남겨주세요." ><?=$comment?></textarea>
|
||||
</div>
|
||||
</td>
|
||||
<td style="width:680px;" >
|
||||
<div class="d-flex p-1 mb-1 justify-content-start align-items-center ">
|
||||
<textarea rows="3" id="updatecomment" name="updatecomment" class="form-control fs-5 text-danger " placeholder="수정사항 기록" ><?=$updatecomment?></textarea>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-start">
|
||||
<span class="badge bg-secondary fs-6 mb-1"><i class="bi bi-paperclip"></i> 첨부파일</span> <br>
|
||||
<div class="d-flex justify-content-start">
|
||||
<!-- 파일 선택 -->
|
||||
<input type="file" id="upfile" name="upfile[]" multiple style="display:none;">
|
||||
<button class="btn btn-dark btn-sm me-4" type="button" onclick="document.getElementById('upfile').click();">
|
||||
<i class="bi bi-image"></i> </button>
|
||||
|
||||
<!-- 드롭 영역 -->
|
||||
<div id="dropArea" style="border: 1px dashed #ccc; padding: 5px; width:320px; text-align: center;">
|
||||
파일 drop 영역
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex mt-2 justify-content-start">
|
||||
<!-- 파일 목록 표시 -->
|
||||
<div id="displayFile"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
190
output/common/pdfEmailJS.php
Normal file
190
output/common/pdfEmailJS.php
Normal file
@@ -0,0 +1,190 @@
|
||||
<script>
|
||||
|
||||
var ajaxRequest = null;
|
||||
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
|
||||
});
|
||||
|
||||
// 부트스트랩 툴팁
|
||||
$(document).ready(function() {
|
||||
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
|
||||
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
||||
return new bootstrap.Tooltip(tooltipTriggerEl);
|
||||
});
|
||||
});
|
||||
|
||||
function captureReturnKey(e) {
|
||||
if(e.keyCode==13 && e.srcElement.type != 'textarea')
|
||||
return false;
|
||||
}
|
||||
|
||||
function recaptureReturnKey(e) {
|
||||
if(e.keyCode==13 && e.srcElement.type != 'textarea')
|
||||
return false;
|
||||
}
|
||||
|
||||
function generatePDF() {
|
||||
var workplace = '<?php echo $title_message; ?>';
|
||||
var today = new Date();
|
||||
var formattedDate = "(" + String(today.getFullYear()).slice(-2) + "." + ("0" + (today.getMonth() + 1)).slice(-2) + "." + ("0" + today.getDate()).slice(-2) + ")";
|
||||
var result = 'KD(' + workplace +')' + formattedDate + '.pdf';
|
||||
|
||||
var element = document.getElementById('content-to-print');
|
||||
var opt = {
|
||||
margin: [10, 3, 12, 3], // Top, right, bottom, left margins
|
||||
filename: result,
|
||||
image: { type: 'jpeg', quality: 1 },
|
||||
html2canvas: {
|
||||
scale: 3, // ★★★ 해상도(기본은 1) → 2~4 정도로 높이면 선명해짐 4는 용량이 매우 큽니다. 보통 3M 이상
|
||||
useCORS: true,
|
||||
scrollY: 0,
|
||||
scrollX: 0,
|
||||
windowWidth: document.body.scrollWidth,
|
||||
windowHeight: document.body.scrollHeight
|
||||
},
|
||||
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
|
||||
pagebreak: {
|
||||
mode: ['css', 'legacy'],
|
||||
avoid: ['tr', '.avoid-break'] // 핵심
|
||||
}
|
||||
};
|
||||
html2pdf().from(element).set(opt).save();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function generatePDF_server(callback) {
|
||||
var workplace = '<?php echo $title_message; ?>';
|
||||
var item = '<?php echo $emailTitle; ?>';
|
||||
var today = new Date();
|
||||
var formattedDate = "(" + String(today.getFullYear()).slice(-2) + "." + ("0" + (today.getMonth() + 1)).slice(-2) + "." + ("0" + today.getDate()).slice(-2) + ")";
|
||||
var result = 'KD' + item +'(' + workplace + ')' + formattedDate + '.pdf';
|
||||
|
||||
var element = document.getElementById('content-to-print');
|
||||
var opt = {
|
||||
margin: [10, 3, 12, 3], // Top, right, bottom, left margins
|
||||
filename: result,
|
||||
image: { type: 'jpeg', quality: 1 },
|
||||
html2canvas: { scale: 3 },
|
||||
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
|
||||
pagebreak: { mode: [''] }
|
||||
};
|
||||
|
||||
html2pdf().from(element).set(opt).output('datauristring').then(function (pdfDataUri) {
|
||||
var pdfBase64 = pdfDataUri.split(',')[1]; // Base64 인코딩된 PDF 데이터 추출
|
||||
var formData = new FormData();
|
||||
formData.append('pdf', pdfBase64);
|
||||
formData.append('filename', result);
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/email/save_pdf.php', // PDF 파일을 저장하는 PHP 파일
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (response) {
|
||||
var res = JSON.parse(response);
|
||||
if (callback) {
|
||||
callback(res.filename); // 서버에 저장된 파일 경로를 콜백으로 전달
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
Swal.fire('Error', 'PDF 저장에 실패했습니다.', 'error');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function sendmail() {
|
||||
var secondordnum = '<?php echo $secondordnum; ?>'; // 서버에서 가져온 값
|
||||
var item = '<?php echo $emailTitle; ?>';
|
||||
|
||||
if (!secondordnum) {
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: '오류 알림',
|
||||
text: '발주처 코드가 없습니다.'
|
||||
});
|
||||
return; // 함수 종료
|
||||
}
|
||||
|
||||
if (typeof ajaxRequest !== 'undefined' && ajaxRequest !== null) {
|
||||
ajaxRequest.abort();
|
||||
}
|
||||
|
||||
ajaxRequest = $.ajax({
|
||||
type: 'POST',
|
||||
url: '/email/get_companyCode.php',
|
||||
data: { secondordnum: secondordnum },
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
console.log('response : ', response);
|
||||
if (response.error) {
|
||||
Swal.fire('Error', response.error, 'error');
|
||||
} else {
|
||||
var email = response.email;
|
||||
var vendorName = response.vendor_name;
|
||||
|
||||
Swal.fire({
|
||||
title: 'E메일 보내기',
|
||||
text: vendorName + ' Email 주소확인',
|
||||
icon: 'warning',
|
||||
input: 'text', // input 창을 텍스트 필드로 설정
|
||||
inputLabel: 'Email 주소 수정 가능',
|
||||
inputValue: email, // 기존 이메일 주소를 기본값으로 설정
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '보내기',
|
||||
cancelButtonText: '취소',
|
||||
reverseButtons: true,
|
||||
inputValidator: (value) => {
|
||||
if (!value) {
|
||||
return '이메일 주소를 입력해주세요!';
|
||||
}
|
||||
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
if (!emailPattern.test(value)) {
|
||||
return '올바른 이메일 형식을 입력해주세요!';
|
||||
}
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const updatedEmail = result.value; // 입력된 이메일 주소 가져오기
|
||||
generatePDF_server(function(filename) {
|
||||
sendEmail(updatedEmail, vendorName, item, filename);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error', '전송중 오류가 발생했습니다.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function sendEmail(recipientEmail, vendorName, item, filename) {
|
||||
if (typeof ajaxRequest !== 'undefined' && ajaxRequest !== null) {
|
||||
ajaxRequest.abort();
|
||||
}
|
||||
var today = new Date();
|
||||
var formattedDate = "(" + String(today.getFullYear()).slice(-2) + "." + ("0" + (today.getMonth() + 1)).slice(-2) + "." + ("0" + today.getDate()).slice(-2) + ")";
|
||||
|
||||
ajaxRequest = $.ajax({
|
||||
type: 'POST',
|
||||
url: '/email/send_email.php', // 이메일 전송을 처리하는 PHP 파일
|
||||
data: { email: recipientEmail, vendorName: vendorName, filename: filename, item: item, formattedDate: formattedDate },
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
Swal.fire('Success', '정상적으로 전송되었습니다.', 'success');
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error', '전송에 실패했습니다. 확인바랍니다.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
50
output/common/pdftooltip.php
Normal file
50
output/common/pdftooltip.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<script>
|
||||
var ajaxRequest_write = null;
|
||||
var ajaxRequest = null;
|
||||
var ajaxRequest5 = null;
|
||||
var ajaxRequest6 = null;
|
||||
var ajaxRequest7 = null;
|
||||
var isDisplaying = false;
|
||||
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
|
||||
function generatePDF() {
|
||||
var workplace = '<?php echo $title_message; ?>';
|
||||
var today = new Date();
|
||||
var formattedDate = "(" + String(today.getFullYear()).slice(-2) + "." + ("0" + (today.getMonth() + 1)).slice(-2) + "." + ("0" + today.getDate()).slice(-2) + ")";
|
||||
var result = 'KD(' + workplace +')' + formattedDate + '.pdf';
|
||||
|
||||
var element = document.getElementById('content-to-print');
|
||||
var opt = {
|
||||
margin: [10, 3, 12, 3], // Top, right, bottom, left margins
|
||||
filename: result,
|
||||
image: { type: 'jpeg', quality: 0.98 },
|
||||
html2canvas: { scale: 1 },
|
||||
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
|
||||
pagebreak: { mode: [''] }
|
||||
};
|
||||
html2pdf().from(element).set(opt).save();
|
||||
}
|
||||
|
||||
function captureReturnKey(e) {
|
||||
if(e.keyCode==13 && e.srcElement.type != 'textarea')
|
||||
return false;
|
||||
}
|
||||
|
||||
function recaptureReturnKey(e) {
|
||||
if(e.keyCode==13 && e.srcElement.type != 'textarea')
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// 부트스트랩 툴팁
|
||||
$(document).ready(function() {
|
||||
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
|
||||
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
||||
return new bootstrap.Tooltip(tooltipTriggerEl);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
155
output/common/screen.php
Normal file
155
output/common/screen.php
Normal file
@@ -0,0 +1,155 @@
|
||||
<div class="row">
|
||||
<div class="d-flex align-items-center justify-content-start ">
|
||||
<table id="screen_table" class="table " style="border-collapse: collapse;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td rowspan="2" class="text-center align-middle lightgray">일련<br>번호</td>
|
||||
<td rowspan="2" class="text-center align-middle yellowblackBold">종류</td>
|
||||
<td rowspan="2" class="text-center align-middle yellowblackBold">층 부호</td>
|
||||
<td colspan="2" class="text-center align-middle blueBlackBold">오픈(mm)<br>
|
||||
<span class="text-danger" style="font-size:10px;" > "레일 너비 120" <span> </td>
|
||||
<td colspan="2" class="text-center align-middle blueBlackBold">제작사이즈(mm)</td>
|
||||
<td rowspan="2" class="text-center align-middle greenblackBold" style="font-size:10px;" >가이드레일<br> 유형</td>
|
||||
<td rowspan="2" class="text-center align-middle purpleblackBold" style="font-size:10px;">샤프트 <br> (인치)</td>
|
||||
<td rowspan="2" class="text-center align-middle purpleblackBold">케이스 <br> (규격)</td>
|
||||
<td colspan="2" class="text-center align-middle orangeBlackBold">모터</td>
|
||||
<td rowspan="2" class="text-center align-middle lightgray">마감</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center blueBlackBold">가로</td>
|
||||
<td class="text-center blueBlackBold">세로</td>
|
||||
<td class="text-center blueBlackBold">가로 <br> <span class="text-danger" style="font-size:10px;"> (오픈<span class="width_diff_display">@</span>) </span></td>
|
||||
<td class="text-center blueBlackBold">세로 <br> <span class="text-danger" style="font-size:10px;"> (오픈<span class="height_diff_display">@</span>) </span></td>
|
||||
<td class="text-center orangeBlackBold" style="font-size:10px;">브라켓트</td>
|
||||
<td class="text-center orangeBlackBold" style="font-size:10px;">용량<br>(KG)</td>
|
||||
</tr>
|
||||
<?PHP
|
||||
$row_count = 0;
|
||||
foreach ($eList as $row) {
|
||||
echo '<tr>';
|
||||
|
||||
for ($i = 1; $i <= 13; $i++) {
|
||||
switch ($i) {
|
||||
case 1:
|
||||
// col1에만 HTML 태그를 해석하도록 출력
|
||||
echo '<td class="text-center ">' . $row['col1'] . '</td>';
|
||||
break;
|
||||
case 2:
|
||||
echo '<td class="text-center ">' . $row['col5'] . '</td>';
|
||||
break;
|
||||
case 3:
|
||||
echo '<td class="text-center ">' . $row['col2'] . ' '. $row['col3'] . '</td>';
|
||||
break;
|
||||
case 4:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col8']) . '</td>';
|
||||
break;
|
||||
case 5:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col9']) . '</td>';
|
||||
break;
|
||||
case 6:
|
||||
$open_width = intval($row['col8']); // 오픈 가로
|
||||
$make_width = intval(!empty($row['col10_SW']) ? $row['col10_SW'] : $row['col10']); // 제작 가로
|
||||
$width_diff = $make_width - $open_width;
|
||||
echo '<td class="text-center ">' . htmlspecialchars(!empty($row['col10_SW']) ? $row['col10_SW'] : $row['col10']) . '</td>';
|
||||
break;
|
||||
case 7:
|
||||
$open_height = intval($row['col9']); // 오픈 세로
|
||||
$make_height = intval(!empty($row['col11_SH']) ? $row['col11_SH'] : $row['col11']); // 제작 세로
|
||||
$height_diff = $make_height - $open_height;
|
||||
echo '<td class="text-center ">' . htmlspecialchars(!empty($row['col11_SH']) ? $row['col11_SH'] : $row['col11']) . '</td>';
|
||||
break;
|
||||
case 8:
|
||||
// 한글 혼합형만 나오게 하기 숫자제거
|
||||
echo '<td class="text-center">' . htmlspecialchars(preg_replace('/\(.+\)/', '', $row['col6'])) . '</td>';
|
||||
break;
|
||||
case 9:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col21']) . '</td>';
|
||||
break;
|
||||
case 10:
|
||||
if($row['col36'] =='custom')
|
||||
$case = $row['col36_custom'];
|
||||
else
|
||||
$case = $row['col36'];
|
||||
echo '<td class="text-center ">' . htmlspecialchars($case) . '</td>';
|
||||
break;
|
||||
case 11:
|
||||
// 브라켓크기
|
||||
$value = trim($row['col20']);
|
||||
echo '<td class="text-center">'
|
||||
. (
|
||||
$value !== ''
|
||||
? htmlspecialchars($value)
|
||||
: '(없음)'
|
||||
)
|
||||
. '</td>';
|
||||
break;
|
||||
case 12:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col19']) . '</td>'; // 중량
|
||||
break;
|
||||
case 13:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col7']) . '</td>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
echo '</tr>';
|
||||
$row_count ++ ;
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function updateSizeDifferences() {
|
||||
const table = document.getElementById('screen_table');
|
||||
if (!table) return;
|
||||
const rows = Array.from(table.querySelectorAll('tbody tr')).filter(row => {
|
||||
const cells = row.querySelectorAll('td');
|
||||
if (cells.length < 7) return false;
|
||||
return !isNaN(parseInt(cells[3].textContent)) && !isNaN(parseInt(cells[4].textContent)) &&
|
||||
!isNaN(parseInt(cells[5].textContent)) && !isNaN(parseInt(cells[6].textContent));
|
||||
});
|
||||
const widthDiffElements = table.querySelectorAll('.width_diff_display');
|
||||
const heightDiffElements = table.querySelectorAll('.height_diff_display');
|
||||
if (rows.length === 0) {
|
||||
widthDiffElements.forEach(e => e.textContent = '@');
|
||||
heightDiffElements.forEach(e => e.textContent = '@');
|
||||
return;
|
||||
}
|
||||
const widthDiffs = [];
|
||||
const heightDiffs = [];
|
||||
rows.forEach(row => {
|
||||
const cells = row.querySelectorAll('td');
|
||||
const openWidth = parseInt(cells[3].textContent.replace(/[^0-9.-]/g, '')) || 0;
|
||||
const openHeight = parseInt(cells[4].textContent.replace(/[^0-9.-]/g, '')) || 0;
|
||||
const makeWidth = parseInt(cells[5].textContent.replace(/[^0-9.-]/g, '')) || 0;
|
||||
const makeHeight = parseInt(cells[6].textContent.replace(/[^0-9.-]/g, '')) || 0;
|
||||
if (openWidth > 0 && makeWidth > 0) widthDiffs.push(makeWidth - openWidth);
|
||||
if (openHeight > 0 && makeHeight > 0) heightDiffs.push(makeHeight - openHeight);
|
||||
});
|
||||
function formatDiff(val) { return (val >= 0 ? '+' : '') + val; }
|
||||
widthDiffElements.forEach(element => {
|
||||
if (widthDiffs.length === 0) {
|
||||
element.textContent = '@';
|
||||
} else if (widthDiffs.length === 1) {
|
||||
element.textContent = formatDiff(widthDiffs[0]);
|
||||
} else {
|
||||
const allSame = widthDiffs.every(diff => diff === widthDiffs[0]);
|
||||
element.textContent = allSame ? formatDiff(widthDiffs[0]) : '@';
|
||||
}
|
||||
});
|
||||
heightDiffElements.forEach(element => {
|
||||
if (heightDiffs.length === 0) {
|
||||
element.textContent = '@';
|
||||
} else if (heightDiffs.length === 1) {
|
||||
element.textContent = formatDiff(heightDiffs[0]);
|
||||
} else {
|
||||
const allSame = heightDiffs.every(diff => diff === heightDiffs[0]);
|
||||
element.textContent = allSame ? formatDiff(heightDiffs[0]) : '@';
|
||||
}
|
||||
});
|
||||
}
|
||||
document.addEventListener('DOMContentLoaded', function() { updateSizeDifferences(); });
|
||||
</script>
|
||||
334
output/common/shutterbox.php
Normal file
334
output/common/shutterbox.php
Normal file
@@ -0,0 +1,334 @@
|
||||
<?php
|
||||
// 셔터박스 데이터 초기화
|
||||
$box_data = [];
|
||||
// echo $WebSite;
|
||||
|
||||
// $eList를 순회하며 데이터 생성
|
||||
foreach ($eList as $item) {
|
||||
$boxSize = trim($item['col36']); // 셔터박스 크기
|
||||
if ($boxSize == 'custom') {
|
||||
$boxSize = trim($item['col36_custom']);
|
||||
}
|
||||
|
||||
$boxdirection = $item['col36_boxdirection'];
|
||||
$boxfrontbottom = $item['col36_frontbottom'];
|
||||
$boxrailwidth = $item['col36_railwidth'];
|
||||
$cover = intval($item['col44']); // 상부덮개 수량
|
||||
$manguriSize = $item['col45'] ?? ''; // 마구리 size
|
||||
$fincover = intval($item['col46']); // 마구리 수량
|
||||
$boxLengths = [
|
||||
['length' => '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'])]
|
||||
];
|
||||
|
||||
// 동일한 `size` 값이 이미 존재하는지 확인
|
||||
$existingKey = array_search($boxSize, array_column($box_data, 'size'));
|
||||
|
||||
if ($existingKey === false) {
|
||||
// 새로운 사이즈 추가
|
||||
$box_data[] = [
|
||||
'size' => $boxSize,
|
||||
'sum' => 1,
|
||||
'cover' => $cover,
|
||||
'fincover' => $fincover,
|
||||
'boxdirection' => $boxdirection,
|
||||
'boxfrontbottom' => $boxfrontbottom,
|
||||
'boxrailwidth' => $boxrailwidth,
|
||||
'manguriSize' => $manguriSize,
|
||||
'length_data' => array_map(function ($length) {
|
||||
return ['length' => $length['length'], 'sum' => $length['quantity']];
|
||||
}, $boxLengths)
|
||||
];
|
||||
} else {
|
||||
// 기존 데이터에 값 누적
|
||||
$box_data[$existingKey]['sum'] += 1;
|
||||
$box_data[$existingKey]['cover'] += $cover;
|
||||
$box_data[$existingKey]['fincover'] += $fincover;
|
||||
$box_data[$existingKey]['manguriSize'] = $manguriSize;
|
||||
|
||||
// 길이 데이터 누적
|
||||
foreach ($boxLengths as $index => $length) {
|
||||
$box_data[$existingKey]['length_data'][$index]['sum'] += $length['quantity'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function fetchImageData($url) {
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // HTTPS 인증 무시
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); // 연결 시간 초과 설정
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // 리다이렉트 따라가기
|
||||
$imageData = curl_exec($ch);
|
||||
|
||||
// if (curl_errno($ch)) {
|
||||
// echo "DEBUG: cURL 오류 -> " . curl_error($ch) . "<br>";
|
||||
// }
|
||||
curl_close($ch);
|
||||
|
||||
return $imageData;
|
||||
}
|
||||
|
||||
function drawImage($sourcePath, $savePath, $textData, $fontSize = 3) {
|
||||
// URL을 로컬 경로로 변환
|
||||
$documentRoot = $_SERVER['DOCUMENT_ROOT'];
|
||||
global $root_dir;
|
||||
$relativePath = str_replace($root_dir, '', $savePath);
|
||||
$localSavePath = $documentRoot . $relativePath;
|
||||
|
||||
// echo "DEBUG: 변환된 로컬 저장 경로 -> {$localSavePath}<br>";
|
||||
|
||||
// 폴더 생성
|
||||
$saveDir = dirname($localSavePath);
|
||||
if (!is_dir($saveDir)) {
|
||||
if (!mkdir($saveDir, 0777, true)) {
|
||||
echo "DEBUG: 폴더 생성 실패 -> {$saveDir}<br>";
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
chmod($saveDir, 0777);
|
||||
// echo "DEBUG: 폴더 권한 설정 -> {$saveDir}<br>";
|
||||
}
|
||||
|
||||
// 원본 이미지 데이터 가져오기 (cURL 사용)
|
||||
// echo "DEBUG: 원본 이미지 경로 -> {$sourcePath}<br>";
|
||||
$imageData = fetchImageData($sourcePath);
|
||||
if (!$imageData) {
|
||||
// echo "DEBUG: 원본 이미지 데이터를 가져올 수 없습니다.<br>";
|
||||
return false;
|
||||
}
|
||||
// echo "DEBUG: 원본 이미지 데이터 로드 성공<br>";
|
||||
|
||||
// 이미지 로드 및 작업
|
||||
$tempImage = tempnam(sys_get_temp_dir(), 'image');
|
||||
file_put_contents($tempImage, $imageData);
|
||||
$image = @imagecreatefromjpeg($tempImage);
|
||||
unlink($tempImage);
|
||||
|
||||
if (!$image) {
|
||||
echo "DEBUG: JPEG 이미지를 로드할 수 없습니다.<br>";
|
||||
return false;
|
||||
}
|
||||
// echo "DEBUG: 이미지 리소스 생성 성공<br>";
|
||||
|
||||
// 텍스트 추가
|
||||
$textColor = imagecolorallocate($image, 255, 0, 0); // 빨간색
|
||||
foreach ($textData as $textItem) {
|
||||
if (isset($textItem['text'], $textItem['x'], $textItem['y'])) {
|
||||
imagestring(
|
||||
$image,
|
||||
$fontSize,
|
||||
intval($textItem['x']),
|
||||
intval($textItem['y']),
|
||||
$textItem['text'],
|
||||
$textColor
|
||||
);
|
||||
// echo "DEBUG: 텍스트 추가 -> '{$textItem['text']}' @ ({$textItem['x']}, {$textItem['y']})<br>";
|
||||
}
|
||||
}
|
||||
|
||||
// 이미지 저장
|
||||
$result = @imagejpeg($image, $localSavePath);
|
||||
// if ($result) {
|
||||
// echo "DEBUG: 이미지 저장 성공 -> {$localSavePath}<br>";
|
||||
// } else {
|
||||
// echo "DEBUG: 이미지 저장 실패 -> {$localSavePath}<br>";
|
||||
// }
|
||||
|
||||
imagedestroy($image);
|
||||
|
||||
return $result ? $localSavePath : false;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php foreach ($box_data as $box): ?>
|
||||
<?PHP
|
||||
// echo '<pre>';
|
||||
// print_r($box);
|
||||
// echo '</pre>';
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<table class="table avoid-break" style="border-collapse: collapse;">
|
||||
<thead class="table-secondary">
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $box['size']; ?> 셔터박스 (점검구:<?=$box['boxdirection']?>) </th>
|
||||
<th class="text-center">길이</th>
|
||||
<th class="text-center">수량</th>
|
||||
<th class="text-center">측면부<br>[마구리]</th>
|
||||
<th class="text-center">수량</th>
|
||||
<th class="text-center">상부덮개</th>
|
||||
<th class="text-center">수량</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if($box['boxdirection'] == '밑면')
|
||||
{
|
||||
// 점검구 양면 이미지 생성
|
||||
$sourcePath = $WebSite . 'img/box/source/box_bottom.jpg';
|
||||
$saveName = 'box_' . str_replace('*', 'x', $box['size']) . '_bottom.jpg';
|
||||
$savePath = $WebSite . 'img/box/' . $saveName;
|
||||
list($boxwidth, $boxheight) = explode('*', $box['size']);
|
||||
$TopcoverSize = $boxwidth - 111; // 텍스트로 추가할 값
|
||||
// 여러 텍스트 데이터
|
||||
$textData = [
|
||||
['text' => $boxheight , 'x' => 15, 'y' => 85],
|
||||
['text' => $TopcoverSize, 'x' => 100, 'y' => 2],
|
||||
['text' => $box['boxfrontbottom'] , 'x' => 25, 'y' => 170],
|
||||
['text' => $box['boxrailwidth'] , 'x' => 55, 'y' => 210],
|
||||
['text' => ($boxwidth-$box['boxfrontbottom']-$box['boxrailwidth']-140) , 'x' => 120, 'y' => 175],
|
||||
['text' => ($boxheight) , 'x' => 176, 'y' => 90],
|
||||
['text' => ($boxwidth+5) , 'x' => 100, 'y' => 225],
|
||||
['text' => ($boxheight+5) , 'x' => 135, 'y' => 250],
|
||||
];
|
||||
}
|
||||
else if($box['boxdirection'] == '후면')
|
||||
{
|
||||
// 점검구 후면 이미지 생성
|
||||
$sourcePath = $WebSite . 'img/box/source/box_rear.jpg';
|
||||
$saveName = 'box_' . str_replace('*', 'x', $box['size']) . '_rear.jpg';
|
||||
$savePath = $WebSite . 'img/box/' . $saveName;
|
||||
list($boxwidth, $boxheight) = explode('*', $box['size']);
|
||||
$TopcoverSize = $boxwidth - 111; // 텍스트로 추가할 값
|
||||
$textData = [
|
||||
['text' => $boxheight , 'x' => 15, 'y' => 85],
|
||||
['text' => $TopcoverSize, 'x' => 100, 'y' => 2],
|
||||
['text' => $box['boxfrontbottom'] , 'x' => 25, 'y' => 170],
|
||||
['text' => $box['boxrailwidth'] , 'x' => 55, 'y' => 210],
|
||||
['text' => ($boxwidth-$box['boxfrontbottom']-$box['boxrailwidth']) , 'x' => 120, 'y' => 165],
|
||||
['text' => ($boxheight-140) , 'x' => 192, 'y' => 90],
|
||||
['text' => ($boxwidth+5) , 'x' => 100, 'y' => 225],
|
||||
['text' => ($boxheight+5) , 'x' => 135, 'y' => 250],
|
||||
];
|
||||
}
|
||||
else // 없으면 양면으로 추정함 ($box['boxdirection'] == '양면')
|
||||
{
|
||||
// 점검구 양면 이미지 생성
|
||||
$sourcePath = $WebSite . 'img/box/source/box_both.jpg';
|
||||
$saveName = 'box_' . str_replace('*', 'x', $box['size']) . '_both.jpg';
|
||||
$savePath = $WebSite . 'img/box/' . $saveName;
|
||||
list($boxwidth, $boxheight) = explode('*', $box['size']);
|
||||
$TopcoverSize = $boxwidth - 111; // 텍스트로 추가할 값
|
||||
// 여러 텍스트 데이터
|
||||
$textData = [
|
||||
['text' => $boxheight , 'x' => 15, 'y' => 85],
|
||||
['text' => $TopcoverSize, 'x' => 100, 'y' => 2],
|
||||
['text' => $box['boxfrontbottom'] , 'x' => 25, 'y' => 170],
|
||||
['text' => $box['boxrailwidth'] , 'x' => 55, 'y' => 210],
|
||||
['text' => ($boxwidth-$box['boxfrontbottom']-$box['boxrailwidth']-140) , 'x' => 120, 'y' => 175],
|
||||
['text' => ($boxheight-140) , 'x' => 192, 'y' => 90],
|
||||
['text' => ($boxwidth+5) , 'x' => 100, 'y' => 225],
|
||||
['text' => ($boxheight+5) , 'x' => 135, 'y' => 250],
|
||||
];
|
||||
}
|
||||
|
||||
drawImage($sourcePath, $savePath, $textData, 4);
|
||||
|
||||
// 길이 데이터 필터링
|
||||
$filteredLengths = array_filter($box['length_data'], function ($length) {
|
||||
return $length['sum'] > 0;
|
||||
});
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($filteredLengths);
|
||||
// echo '</pre>';
|
||||
|
||||
$rowspan = count($filteredLengths); // 유효 길이의 개수만큼 rowspan 계산
|
||||
$innerCount = 0;
|
||||
?>
|
||||
<?php foreach ($filteredLengths as $index => $length):
|
||||
$innerCount ++ ;
|
||||
?>
|
||||
<tr>
|
||||
<?php if ($innerCount === 1): ?>
|
||||
<!-- 첫 번째 행에만 이미지를 출력 -->
|
||||
<td class="text-center" rowspan="<?php echo $rowspan; ?>">
|
||||
<img src="../img/box/<?php echo $saveName; ?>" alt="셔터박스" width="220">
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="text-center"><?php echo $length['length']; ?></td>
|
||||
<td class="text-center"><?php echo $length['sum']; ?></td>
|
||||
<?php if ($innerCount === 1): ?>
|
||||
<!-- 첫 번째 행에만 측면부와 상부덮개 정보 출력 -->
|
||||
<td class="text-center" rowspan="<?php echo $rowspan; ?>">
|
||||
<?php echo $box['manguriSize']; ?>
|
||||
</td>
|
||||
<td class="text-center" rowspan="<?php echo $rowspan; ?>">
|
||||
<?php echo $box['fincover']; ?>
|
||||
</td>
|
||||
<td class="text-center" rowspan="<?php echo $rowspan; ?>">
|
||||
<?PHP
|
||||
list($boxwidth, $boxheight) = explode('*', $box['size']); // 셔터박스 크기 분리
|
||||
echo '1219*' . ($boxwidth-111);
|
||||
?>
|
||||
</td>
|
||||
<td class="text-center" rowspan="<?php echo $rowspan; ?>">
|
||||
<?php echo $box['cover']; ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<!-- 셔터박스용 연기차단재(W80) -->
|
||||
<?php
|
||||
// 셔터박스용 연기차단재(W80)
|
||||
if (True) {
|
||||
// W80 기준 숫자 찾기
|
||||
$smokeban80 = 0;
|
||||
foreach ($eList as $item) {
|
||||
$smokeban80 += floatval($item['col47']);
|
||||
}
|
||||
|
||||
// 테이블 출력 시작
|
||||
echo '<div class="row">';
|
||||
echo '<div class="d-flex align-items-center justify-content-start">';
|
||||
echo '<table class="table avoid-break" style="border-collapse: collapse;">';
|
||||
|
||||
// 연기차단재 데이터 출력
|
||||
echo '<tbody>';
|
||||
echo '<tr>';
|
||||
|
||||
// 첫 번째 td (연기차단재 설명)
|
||||
echo '<td rowspan="2" class="text-center fw-bold orangeBlackBold">';
|
||||
echo '연기차단재(W80)<br> 전면부, 린텔부 <span class="text-danger">"양쪽에"</span> 설치';
|
||||
echo '</td>';
|
||||
|
||||
// 두 번째 td (재료 설명)
|
||||
echo '<td rowspan="2" class="text-center orangeBlackBold">';
|
||||
echo 'EGI 0.8T +<br>화이바글라스코팅직물';
|
||||
echo '</td>';
|
||||
|
||||
// 세 번째 td (이미지)
|
||||
echo '<td rowspan="2" class="text-center ">';
|
||||
echo '<img src="../img/part/smokeban.jpg" alt="연기차단재" width="150">';
|
||||
echo '</td>';
|
||||
|
||||
// 네 번째 td (규격과 길이)
|
||||
echo '<td class="text-center fw-bold orangeBlackBold">규격[L]</td>';
|
||||
echo '<td class="text-center fw-bold"> L : 3,000</td>';
|
||||
echo '</tr>';
|
||||
|
||||
// 다섯 번째 td (수량)
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center fw-bold orangeBlackBold">수량</td>';
|
||||
echo '<td class="text-center fw-bold">' . $smokeban80 . '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
256
output/common/shutterbox_confirm.php
Normal file
256
output/common/shutterbox_confirm.php
Normal file
@@ -0,0 +1,256 @@
|
||||
|
||||
<?php
|
||||
// 스크린 납품확인서용 셔터박스 데이터 초기화
|
||||
$box_data = [];
|
||||
|
||||
// echo $WebSite;
|
||||
|
||||
// $eList를 순회하며 데이터 생성
|
||||
foreach ($eList as $item) {
|
||||
$boxSize = trim($item['col36']); // 셔터박스 크기
|
||||
if ($boxSize == 'custom') {
|
||||
$boxSize = trim($item['col36_custom']);
|
||||
}
|
||||
|
||||
$boxdirection = $item['col36_boxdirection'];
|
||||
$boxfrontbottom = $item['col36_frontbottom'];
|
||||
$boxrailwidth = $item['col36_railwidth'];
|
||||
$cover = intval($item['col44']); // 상부덮개 수량
|
||||
$fincover = intval($item['col46']); // 측면부 수량
|
||||
$boxLengths = [
|
||||
['length' => '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'])]
|
||||
];
|
||||
|
||||
// 동일한 `size` 값이 이미 존재하는지 확인
|
||||
$existingKey = array_search($boxSize, array_column($box_data, 'size'));
|
||||
|
||||
if ($existingKey === false) {
|
||||
// 새로운 사이즈 추가
|
||||
$box_data[] = [
|
||||
'size' => $boxSize,
|
||||
'sum' => 1,
|
||||
'cover' => $cover,
|
||||
'fincover' => $fincover,
|
||||
'boxdirection' => $boxdirection,
|
||||
'boxfrontbottom' => $boxfrontbottom,
|
||||
'boxrailwidth' => $boxrailwidth,
|
||||
'length_data' => array_map(function ($length) {
|
||||
return ['length' => $length['length'], 'sum' => $length['quantity']];
|
||||
}, $boxLengths)
|
||||
];
|
||||
} else {
|
||||
// 기존 데이터에 값 누적
|
||||
$box_data[$existingKey]['sum'] += 1;
|
||||
$box_data[$existingKey]['cover'] += $cover;
|
||||
$box_data[$existingKey]['fincover'] += $fincover;
|
||||
|
||||
// 길이 데이터 누적
|
||||
foreach ($boxLengths as $index => $length) {
|
||||
$box_data[$existingKey]['length_data'][$index]['sum'] += $length['quantity'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function fetchImageData($url) {
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // HTTPS 인증 무시
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); // 연결 시간 초과 설정
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // 리다이렉트 따라가기
|
||||
$imageData = curl_exec($ch);
|
||||
|
||||
// if (curl_errno($ch)) {
|
||||
// echo "DEBUG: cURL 오류 -> " . curl_error($ch) . "<br>";
|
||||
// }
|
||||
curl_close($ch);
|
||||
|
||||
return $imageData;
|
||||
}
|
||||
|
||||
function drawImage($sourcePath, $savePath, $textData, $fontSize = 3) {
|
||||
// URL을 로컬 경로로 변환
|
||||
$documentRoot = $_SERVER['DOCUMENT_ROOT'];
|
||||
global $root_dir;
|
||||
$relativePath = str_replace($root_dir, '', $savePath);
|
||||
$localSavePath = $documentRoot . $relativePath;
|
||||
|
||||
// echo "DEBUG: 변환된 로컬 저장 경로 -> {$localSavePath}<br>";
|
||||
|
||||
// 폴더 생성
|
||||
$saveDir = dirname($localSavePath);
|
||||
if (!is_dir($saveDir)) {
|
||||
if (!mkdir($saveDir, 0777, true)) {
|
||||
echo "DEBUG: 폴더 생성 실패 -> {$saveDir}<br>";
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
chmod($saveDir, 0777);
|
||||
// echo "DEBUG: 폴더 권한 설정 -> {$saveDir}<br>";
|
||||
}
|
||||
|
||||
// 원본 이미지 데이터 가져오기 (cURL 사용)
|
||||
// echo "DEBUG: 원본 이미지 경로 -> {$sourcePath}<br>";
|
||||
$imageData = fetchImageData($sourcePath);
|
||||
if (!$imageData) {
|
||||
// echo "DEBUG: 원본 이미지 데이터를 가져올 수 없습니다.<br>";
|
||||
return false;
|
||||
}
|
||||
// echo "DEBUG: 원본 이미지 데이터 로드 성공<br>";
|
||||
|
||||
// 이미지 로드 및 작업
|
||||
$tempImage = tempnam(sys_get_temp_dir(), 'image');
|
||||
file_put_contents($tempImage, $imageData);
|
||||
$image = @imagecreatefromjpeg($tempImage);
|
||||
unlink($tempImage);
|
||||
|
||||
if (!$image) {
|
||||
echo "DEBUG: JPEG 이미지를 로드할 수 없습니다.<br>";
|
||||
return false;
|
||||
}
|
||||
// echo "DEBUG: 이미지 리소스 생성 성공<br>";
|
||||
|
||||
// 텍스트 추가
|
||||
$textColor = imagecolorallocate($image, 255, 0, 0); // 빨간색
|
||||
foreach ($textData as $textItem) {
|
||||
if (isset($textItem['text'], $textItem['x'], $textItem['y'])) {
|
||||
imagestring(
|
||||
$image,
|
||||
$fontSize,
|
||||
intval($textItem['x']),
|
||||
intval($textItem['y']),
|
||||
$textItem['text'],
|
||||
$textColor
|
||||
);
|
||||
// echo "DEBUG: 텍스트 추가 -> '{$textItem['text']}' @ ({$textItem['x']}, {$textItem['y']})<br>";
|
||||
}
|
||||
}
|
||||
|
||||
// 이미지 저장
|
||||
$result = @imagejpeg($image, $localSavePath);
|
||||
// if ($result) {
|
||||
// echo "DEBUG: 이미지 저장 성공 -> {$localSavePath}<br>";
|
||||
// } else {
|
||||
// echo "DEBUG: 이미지 저장 실패 -> {$localSavePath}<br>";
|
||||
// }
|
||||
|
||||
imagedestroy($image);
|
||||
|
||||
return $result ? $localSavePath : false;
|
||||
}
|
||||
?>
|
||||
<?php foreach ($box_data as $box): ?>
|
||||
<?PHP
|
||||
// echo '<pre>';
|
||||
// print_r($box);
|
||||
// echo '</pre>';
|
||||
?>
|
||||
<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;">
|
||||
<thead class="table-secondary">
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $box['size']; ?> 셔터박스 (점검구:<?=$box['boxdirection']?>) </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if($box['boxdirection'] == '밑면')
|
||||
{
|
||||
// 점검구 양면 이미지 생성
|
||||
$sourcePath = $WebSite . 'img/box/source/box_bottom.jpg';
|
||||
$saveName = 'box_' . str_replace('*', 'x', $box['size']) . '_bottom.jpg';
|
||||
$savePath = $WebSite . 'img/box/' . $saveName;
|
||||
list($boxwidth, $boxheight) = explode('*', $box['size']);
|
||||
$TopcoverSize = $boxwidth - 111; // 텍스트로 추가할 값
|
||||
// 여러 텍스트 데이터
|
||||
$textData = [
|
||||
['text' => $boxheight , 'x' => 15, 'y' => 85],
|
||||
['text' => $TopcoverSize, 'x' => 100, 'y' => 2],
|
||||
['text' => $box['boxfrontbottom'] , 'x' => 25, 'y' => 170],
|
||||
['text' => $box['boxrailwidth'] , 'x' => 55, 'y' => 210],
|
||||
['text' => ($boxwidth-$box['boxfrontbottom']-$box['boxrailwidth']-140) , 'x' => 120, 'y' => 175],
|
||||
['text' => ($boxheight) , 'x' => 176, 'y' => 90],
|
||||
['text' => ($boxwidth+5) , 'x' => 100, 'y' => 225],
|
||||
['text' => ($boxheight+5) , 'x' => 135, 'y' => 250],
|
||||
];
|
||||
}
|
||||
else if($box['boxdirection'] == '후면')
|
||||
{
|
||||
// 점검구 후면 이미지 생성
|
||||
$sourcePath = $WebSite . 'img/box/source/box_rear.jpg';
|
||||
$saveName = 'box_' . str_replace('*', 'x', $box['size']) . '_rear.jpg';
|
||||
$savePath = $WebSite . 'img/box/' . $saveName;
|
||||
list($boxwidth, $boxheight) = explode('*', $box['size']);
|
||||
$TopcoverSize = $boxwidth - 111; // 텍스트로 추가할 값
|
||||
$textData = [
|
||||
['text' => $boxheight , 'x' => 15, 'y' => 85],
|
||||
['text' => $TopcoverSize, 'x' => 100, 'y' => 2],
|
||||
['text' => $box['boxfrontbottom'] , 'x' => 25, 'y' => 170],
|
||||
['text' => $box['boxrailwidth'] , 'x' => 55, 'y' => 210],
|
||||
['text' => ($boxwidth-$box['boxfrontbottom']-$box['boxrailwidth']) , 'x' => 120, 'y' => 165],
|
||||
['text' => ($boxheight-140) , 'x' => 192, 'y' => 90],
|
||||
['text' => ($boxwidth+5) , 'x' => 100, 'y' => 225],
|
||||
['text' => ($boxheight+5) , 'x' => 135, 'y' => 250],
|
||||
];
|
||||
}
|
||||
else // 없으면 양면으로 추정함 ($box['boxdirection'] == '양면')
|
||||
{
|
||||
// 점검구 양면 이미지 생성
|
||||
$sourcePath = $WebSite . 'img/box/source/box_both.jpg';
|
||||
$saveName = 'box_' . str_replace('*', 'x', $box['size']) . '_both.jpg';
|
||||
$savePath = $WebSite . 'img/box/' . $saveName;
|
||||
list($boxwidth, $boxheight) = explode('*', $box['size']);
|
||||
$TopcoverSize = $boxwidth - 111; // 텍스트로 추가할 값
|
||||
// 여러 텍스트 데이터
|
||||
$textData = [
|
||||
['text' => $boxheight , 'x' => 15, 'y' => 85],
|
||||
['text' => $TopcoverSize, 'x' => 100, 'y' => 2],
|
||||
['text' => $box['boxfrontbottom'] , 'x' => 25, 'y' => 170],
|
||||
['text' => $box['boxrailwidth'] , 'x' => 55, 'y' => 210],
|
||||
['text' => ($boxwidth-$box['boxfrontbottom']-$box['boxrailwidth']-140) , 'x' => 120, 'y' => 175],
|
||||
['text' => ($boxheight-140) , 'x' => 192, 'y' => 90],
|
||||
['text' => ($boxwidth+5) , 'x' => 100, 'y' => 225],
|
||||
['text' => ($boxheight+5) , 'x' => 135, 'y' => 250],
|
||||
];
|
||||
}
|
||||
|
||||
drawImage($sourcePath, $savePath, $textData, 4);
|
||||
|
||||
// 길이 데이터 필터링
|
||||
$filteredLengths = array_filter($box['length_data'], function ($length) {
|
||||
return $length['sum'] > 0;
|
||||
});
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($filteredLengths);
|
||||
// echo '</pre>';
|
||||
|
||||
$rowspan = count($filteredLengths); // 유효 길이의 개수만큼 rowspan 계산
|
||||
$innerCount = 0;
|
||||
?>
|
||||
<?php foreach ($filteredLengths as $index => $length):
|
||||
$innerCount ++ ;
|
||||
?>
|
||||
<tr>
|
||||
<?php if ($innerCount === 1): ?>
|
||||
<!-- 첫 번째 행에만 이미지를 출력 -->
|
||||
<td class="text-center" rowspan="<?php echo $rowspan; ?>">
|
||||
<img src="../img/box/<?php echo $saveName; ?>" alt="셔터박스" width="220">
|
||||
<br>
|
||||
①전면부 ②린텔부 ③하부점검구 ④후면코너부 ⑤후면점검구 ⑥상부덮개 ⑦측면부(마구리)
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
337
output/common/shutterbox_slat.php
Normal file
337
output/common/shutterbox_slat.php
Normal file
@@ -0,0 +1,337 @@
|
||||
<?php
|
||||
// 셔터박스 데이터 초기화
|
||||
$box_data = [];
|
||||
|
||||
// echo $WebSite;
|
||||
|
||||
// $eList를 순회하며 데이터 생성
|
||||
foreach ($eList as $item) {
|
||||
$boxSize = trim($item['col37']); // 셔터박스 크기
|
||||
if ($boxSize == 'custom') {
|
||||
$boxSize = trim($item['col37_custom']);
|
||||
}
|
||||
|
||||
$boxdirection = $item['col37_boxdirection'];
|
||||
$boxfrontbottom = $item['col37_frontbottom'];
|
||||
$boxrailwidth = $item['col37_railwidth'];
|
||||
$cover = intval($item['col45']); // 상부덮개 수량
|
||||
$manguriSize = $item['col46'] ?? ''; // 마구리 size
|
||||
$fincover = intval($item['col47']); // 측면부(마구리) 수량
|
||||
$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'])]
|
||||
];
|
||||
|
||||
// 동일한 `size` 값이 이미 존재하는지 확인
|
||||
$existingKey = array_search($boxSize, array_column($box_data, 'size'));
|
||||
|
||||
if ($existingKey === false) {
|
||||
// 새로운 사이즈 추가
|
||||
$box_data[] = [
|
||||
'size' => $boxSize,
|
||||
'sum' => 1,
|
||||
'cover' => $cover,
|
||||
'fincover' => $fincover,
|
||||
'boxdirection' => $boxdirection,
|
||||
'boxfrontbottom' => $boxfrontbottom,
|
||||
'boxrailwidth' => $boxrailwidth,
|
||||
'manguriSize' => $manguriSize,
|
||||
'length_data' => array_map(function ($length) {
|
||||
return ['length' => $length['length'], 'sum' => $length['quantity']];
|
||||
}, $boxLengths)
|
||||
];
|
||||
} else {
|
||||
// 기존 데이터에 값 누적
|
||||
$box_data[$existingKey]['sum'] += 1;
|
||||
$box_data[$existingKey]['cover'] += $cover;
|
||||
$box_data[$existingKey]['fincover'] += $fincover;
|
||||
|
||||
// 길이 데이터 누적
|
||||
foreach ($boxLengths as $index => $length) {
|
||||
$box_data[$existingKey]['length_data'][$index]['sum'] += $length['quantity'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function fetchImageData($url) {
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // HTTPS 인증 무시
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); // 연결 시간 초과 설정
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // 리다이렉트 따라가기
|
||||
$imageData = curl_exec($ch);
|
||||
|
||||
// if (curl_errno($ch)) {
|
||||
// echo "DEBUG: cURL 오류 -> " . curl_error($ch) . "<br>";
|
||||
// }
|
||||
curl_close($ch);
|
||||
|
||||
return $imageData;
|
||||
}
|
||||
|
||||
function drawImage($sourcePath, $savePath, $textData, $fontSize = 3) {
|
||||
// URL을 로컬 경로로 변환
|
||||
$documentRoot = $_SERVER['DOCUMENT_ROOT'];
|
||||
global $root_dir;
|
||||
$relativePath = str_replace($root_dir, '', $savePath);
|
||||
$localSavePath = $documentRoot . $relativePath;
|
||||
|
||||
// echo "DEBUG: 변환된 로컬 저장 경로 -> {$localSavePath}<br>";
|
||||
|
||||
// 폴더 생성
|
||||
$saveDir = dirname($localSavePath);
|
||||
if (!is_dir($saveDir)) {
|
||||
if (!mkdir($saveDir, 0777, true)) {
|
||||
echo "DEBUG: 폴더 생성 실패 -> {$saveDir}<br>";
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
chmod($saveDir, 0777);
|
||||
// echo "DEBUG: 폴더 권한 설정 -> {$saveDir}<br>";
|
||||
}
|
||||
|
||||
// 원본 이미지 데이터 가져오기 (cURL 사용)
|
||||
// echo "DEBUG: 원본 이미지 경로 -> {$sourcePath}<br>";
|
||||
$imageData = fetchImageData($sourcePath);
|
||||
if (!$imageData) {
|
||||
// echo "DEBUG: 원본 이미지 데이터를 가져올 수 없습니다.<br>";
|
||||
return false;
|
||||
}
|
||||
// echo "DEBUG: 원본 이미지 데이터 로드 성공<br>";
|
||||
|
||||
// 이미지 로드 및 작업
|
||||
$tempImage = tempnam(sys_get_temp_dir(), 'image');
|
||||
file_put_contents($tempImage, $imageData);
|
||||
$image = @imagecreatefromjpeg($tempImage);
|
||||
unlink($tempImage);
|
||||
|
||||
if (!$image) {
|
||||
echo "DEBUG: JPEG 이미지를 로드할 수 없습니다.<br>";
|
||||
return false;
|
||||
}
|
||||
// echo "DEBUG: 이미지 리소스 생성 성공<br>";
|
||||
|
||||
// 텍스트 추가
|
||||
$textColor = imagecolorallocate($image, 255, 0, 0); // 빨간색
|
||||
foreach ($textData as $textItem) {
|
||||
if (isset($textItem['text'], $textItem['x'], $textItem['y'])) {
|
||||
imagestring(
|
||||
$image,
|
||||
$fontSize,
|
||||
intval($textItem['x']),
|
||||
intval($textItem['y']),
|
||||
$textItem['text'],
|
||||
$textColor
|
||||
);
|
||||
// echo "DEBUG: 텍스트 추가 -> '{$textItem['text']}' @ ({$textItem['x']}, {$textItem['y']})<br>";
|
||||
}
|
||||
}
|
||||
|
||||
// 이미지 저장
|
||||
$result = @imagejpeg($image, $localSavePath);
|
||||
// if ($result) {
|
||||
// echo "DEBUG: 이미지 저장 성공 -> {$localSavePath}<br>";
|
||||
// } else {
|
||||
// echo "DEBUG: 이미지 저장 실패 -> {$localSavePath}<br>";
|
||||
// }
|
||||
|
||||
imagedestroy($image);
|
||||
|
||||
return $result ? $localSavePath : false;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?php foreach ($box_data as $box): ?>
|
||||
<?PHP
|
||||
// echo '<pre>';
|
||||
// print_r($box);
|
||||
// echo '</pre>';
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<table class="table avoid-break" style="border-collapse: collapse;">
|
||||
<thead class="table-secondary">
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $box['size']; ?> 셔터박스 (점검구:<?=$box['boxdirection']?>) </th>
|
||||
<th class="text-center">길이</th>
|
||||
<th class="text-center">수량</th>
|
||||
<th class="text-center">측면부<br>[마구리]</th>
|
||||
<th class="text-center">수량</th>
|
||||
<th class="text-center">상부덮개</th>
|
||||
<th class="text-center">수량</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if($box['boxdirection'] == '밑면')
|
||||
{
|
||||
// 점검구 양면 이미지 생성
|
||||
$sourcePath = $WebSite . 'img/box/source/box_bottom.jpg';
|
||||
$saveName = 'box_' . str_replace('*', 'x', $box['size']) . '_bottom.jpg';
|
||||
$savePath = $WebSite . 'img/box/' . $saveName;
|
||||
list($boxwidth, $boxheight) = explode('*', $box['size']);
|
||||
$TopcoverSize = $boxwidth - 111; // 텍스트로 추가할 값
|
||||
// 여러 텍스트 데이터
|
||||
$textData = [
|
||||
['text' => $boxheight , 'x' => 15, 'y' => 85],
|
||||
['text' => $TopcoverSize, 'x' => 100, 'y' => 2],
|
||||
['text' => $box['boxfrontbottom'] , 'x' => 25, 'y' => 170],
|
||||
['text' => $box['boxrailwidth'] , 'x' => 55, 'y' => 210],
|
||||
['text' => ($boxwidth-$box['boxfrontbottom']-$box['boxrailwidth']-140) , 'x' => 120, 'y' => 175],
|
||||
['text' => ($boxheight) , 'x' => 176, 'y' => 90],
|
||||
['text' => ($boxwidth+5) , 'x' => 100, 'y' => 225],
|
||||
['text' => ($boxheight+5) , 'x' => 135, 'y' => 250],
|
||||
];
|
||||
}
|
||||
else if($box['boxdirection'] == '후면')
|
||||
{
|
||||
// 점검구 후면 이미지 생성
|
||||
$sourcePath = $WebSite . 'img/box/source/box_rear.jpg';
|
||||
$saveName = 'box_' . str_replace('*', 'x', $box['size']) . '_rear.jpg';
|
||||
$savePath = $WebSite . 'img/box/' . $saveName;
|
||||
list($boxwidth, $boxheight) = explode('*', $box['size']);
|
||||
$TopcoverSize = $boxwidth - 111; // 텍스트로 추가할 값
|
||||
$textData = [
|
||||
['text' => $boxheight , 'x' => 15, 'y' => 85],
|
||||
['text' => $TopcoverSize, 'x' => 100, 'y' => 2],
|
||||
['text' => $box['boxfrontbottom'] , 'x' => 25, 'y' => 170],
|
||||
['text' => $box['boxrailwidth'] , 'x' => 55, 'y' => 210],
|
||||
['text' => ($boxwidth-$box['boxfrontbottom']-$box['boxrailwidth']) , 'x' => 120, 'y' => 165],
|
||||
['text' => ($boxheight-140) , 'x' => 192, 'y' => 90],
|
||||
['text' => ($boxwidth+5) , 'x' => 100, 'y' => 225],
|
||||
['text' => ($boxheight+5) , 'x' => 135, 'y' => 250],
|
||||
];
|
||||
}
|
||||
else // 없으면 양면으로 추정함 ($box['boxdirection'] == '양면')
|
||||
{
|
||||
// 점검구 양면 이미지 생성
|
||||
$sourcePath = $WebSite . 'img/box/source/box_both.jpg';
|
||||
$saveName = 'box_' . str_replace('*', 'x', $box['size']) . '_both.jpg';
|
||||
$savePath = $WebSite . 'img/box/' . $saveName;
|
||||
list($boxwidth, $boxheight) = explode('*', $box['size']);
|
||||
$TopcoverSize = $boxwidth - 111; // 텍스트로 추가할 값
|
||||
// 여러 텍스트 데이터
|
||||
$textData = [
|
||||
['text' => $boxheight , 'x' => 15, 'y' => 85],
|
||||
['text' => $TopcoverSize, 'x' => 100, 'y' => 2],
|
||||
['text' => $box['boxfrontbottom'] , 'x' => 25, 'y' => 170],
|
||||
['text' => $box['boxrailwidth'] , 'x' => 55, 'y' => 210],
|
||||
['text' => ($boxwidth-$box['boxfrontbottom']-$box['boxrailwidth']-140) , 'x' => 120, 'y' => 175],
|
||||
['text' => ($boxheight-140) , 'x' => 192, 'y' => 90],
|
||||
['text' => ($boxwidth+5) , 'x' => 100, 'y' => 225],
|
||||
['text' => ($boxheight+5) , 'x' => 135, 'y' => 250],
|
||||
];
|
||||
}
|
||||
|
||||
drawImage($sourcePath, $savePath, $textData, 4);
|
||||
|
||||
// 길이 데이터 필터링
|
||||
$filteredLengths = array_filter($box['length_data'], function ($length) {
|
||||
return $length['sum'] > 0;
|
||||
});
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($filteredLengths);
|
||||
// echo '</pre>';
|
||||
|
||||
$rowspan = count($filteredLengths); // 유효 길이의 개수만큼 rowspan 계산
|
||||
$innerCount = 0;
|
||||
?>
|
||||
<?php foreach ($filteredLengths as $index => $length):
|
||||
$innerCount ++ ;
|
||||
?>
|
||||
<tr>
|
||||
<?php if ($innerCount === 1): ?>
|
||||
<!-- 첫 번째 행에만 이미지를 출력 -->
|
||||
<td class="text-center" rowspan="<?php echo $rowspan; ?>">
|
||||
<img src="../img/box/<?php echo $saveName; ?>" alt="셔터박스" width="220">
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="text-center"><?php echo $length['length']; ?></td>
|
||||
<td class="text-center"><?php echo $length['sum']; ?></td>
|
||||
<?php if ($innerCount === 1): ?>
|
||||
<!-- 첫 번째 행에만 측면부와 상부덮개 정보 출력 -->
|
||||
<td class="text-center" rowspan="<?php echo $rowspan; ?>">
|
||||
<?php echo $box['manguriSize']; ?>
|
||||
</td>
|
||||
<td class="text-center" rowspan="<?php echo $rowspan; ?>">
|
||||
<?php echo $box['fincover']; ?>
|
||||
</td>
|
||||
<td class="text-center" rowspan="<?php echo $rowspan; ?>">
|
||||
<?PHP
|
||||
list($boxwidth, $boxheight) = explode('*', $box['size']); // 셔터박스 크기 분리
|
||||
echo '1219*' . ($boxwidth-111);
|
||||
?>
|
||||
</td>
|
||||
<td class="text-center" rowspan="<?php echo $rowspan; ?>">
|
||||
<?php echo $box['cover']; ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<!-- 셔터박스용 연기차단재(W80) -->
|
||||
<?php
|
||||
// 셔터박스용 연기차단재(W80)
|
||||
if (True) {
|
||||
// W80 기준 숫자 찾기
|
||||
$smokeban80 = 0;
|
||||
foreach ($eList as $item) {
|
||||
$smokeban80 += floatval($item['col48']); // 철재는 48, 스크린은 47
|
||||
}
|
||||
|
||||
// 테이블 출력 시작
|
||||
echo '<div class="row">';
|
||||
echo '<div class="d-flex align-items-center justify-content-start">';
|
||||
echo '<table class="table avoid-break" style="border-collapse: collapse;">';
|
||||
|
||||
// 연기차단재 데이터 출력
|
||||
echo '<tbody>';
|
||||
echo '<tr>';
|
||||
|
||||
// 첫 번째 td (연기차단재 설명)
|
||||
echo '<td rowspan="2" class="text-center fw-bold orangeBlackBold">';
|
||||
echo '연기차단재(W80)<br> 전면부, 린텔부 <span class="text-danger">"양쪽에"</span> 설치';
|
||||
echo '</td>';
|
||||
|
||||
// 두 번째 td (재료 설명)
|
||||
echo '<td rowspan="2" class="text-center orangeBlackBold">';
|
||||
echo 'EGI 0.8T +<br>화이바글라스코팅직물';
|
||||
echo '</td>';
|
||||
|
||||
// 세 번째 td (이미지)
|
||||
echo '<td rowspan="2" class="text-center ">';
|
||||
echo '<img src="../img/part/smokeban.jpg" alt="연기차단재" width="150">';
|
||||
echo '</td>';
|
||||
|
||||
// 네 번째 td (규격과 길이)
|
||||
echo '<td class="text-center fw-bold orangeBlackBold">규격[L]</td>';
|
||||
echo '<td class="text-center fw-bold"> L : 3,000</td>';
|
||||
echo '</tr>';
|
||||
|
||||
// 다섯 번째 td (수량)
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center fw-bold orangeBlackBold">수량</td>';
|
||||
echo '<td class="text-center fw-bold">' . $smokeban80 . '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
261
output/common/shutterbox_slat_confirm.php
Normal file
261
output/common/shutterbox_slat_confirm.php
Normal file
@@ -0,0 +1,261 @@
|
||||
|
||||
<?php
|
||||
// 셔터박스 데이터 초기화
|
||||
$box_data = [];
|
||||
|
||||
// echo $WebSite;
|
||||
|
||||
// $eList를 순회하며 데이터 생성
|
||||
foreach ($eList as $item) {
|
||||
$boxSize = trim($item['col37']); // 셔터박스 크기
|
||||
if ($boxSize == 'custom') {
|
||||
$boxSize = trim($item['col37_custom']);
|
||||
}
|
||||
|
||||
$boxdirection = $item['col37_boxdirection'];
|
||||
$boxfrontbottom = $item['col37_frontbottom'];
|
||||
$boxrailwidth = $item['col37_railwidth'];
|
||||
$cover = intval($item['col45']); // 상부덮개 수량
|
||||
$fincover = intval($item['col47']); // 측면부(마구리) 수량
|
||||
$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'])]
|
||||
];
|
||||
|
||||
// 동일한 `size` 값이 이미 존재하는지 확인
|
||||
$existingKey = array_search($boxSize, array_column($box_data, 'size'));
|
||||
|
||||
if ($existingKey === false) {
|
||||
// 새로운 사이즈 추가
|
||||
$box_data[] = [
|
||||
'size' => $boxSize,
|
||||
'sum' => 1,
|
||||
'cover' => $cover,
|
||||
'fincover' => $fincover,
|
||||
'boxdirection' => $boxdirection,
|
||||
'boxfrontbottom' => $boxfrontbottom,
|
||||
'boxrailwidth' => $boxrailwidth,
|
||||
'length_data' => array_map(function ($length) {
|
||||
return ['length' => $length['length'], 'sum' => $length['quantity']];
|
||||
}, $boxLengths)
|
||||
];
|
||||
} else {
|
||||
// 기존 데이터에 값 누적
|
||||
$box_data[$existingKey]['sum'] += 1;
|
||||
$box_data[$existingKey]['cover'] += $cover;
|
||||
$box_data[$existingKey]['fincover'] += $fincover;
|
||||
|
||||
// 길이 데이터 누적
|
||||
foreach ($boxLengths as $index => $length) {
|
||||
$box_data[$existingKey]['length_data'][$index]['sum'] += $length['quantity'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function fetchImageData($url) {
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // HTTPS 인증 무시
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); // 연결 시간 초과 설정
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // 리다이렉트 따라가기
|
||||
$imageData = curl_exec($ch);
|
||||
|
||||
// if (curl_errno($ch)) {
|
||||
// echo "DEBUG: cURL 오류 -> " . curl_error($ch) . "<br>";
|
||||
// }
|
||||
curl_close($ch);
|
||||
|
||||
return $imageData;
|
||||
}
|
||||
|
||||
function drawImage($sourcePath, $savePath, $textData, $fontSize = 3) {
|
||||
// URL을 로컬 경로로 변환
|
||||
$documentRoot = $_SERVER['DOCUMENT_ROOT'];
|
||||
global $root_dir;
|
||||
$relativePath = str_replace($root_dir, '', $savePath);
|
||||
$localSavePath = $documentRoot . $relativePath;
|
||||
|
||||
// echo "DEBUG: 변환된 로컬 저장 경로 -> {$localSavePath}<br>";
|
||||
|
||||
// 폴더 생성
|
||||
$saveDir = dirname($localSavePath);
|
||||
if (!is_dir($saveDir)) {
|
||||
if (!mkdir($saveDir, 0777, true)) {
|
||||
echo "DEBUG: 폴더 생성 실패 -> {$saveDir}<br>";
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
chmod($saveDir, 0777);
|
||||
// echo "DEBUG: 폴더 권한 설정 -> {$saveDir}<br>";
|
||||
}
|
||||
|
||||
// 원본 이미지 데이터 가져오기 (cURL 사용)
|
||||
// echo "DEBUG: 원본 이미지 경로 -> {$sourcePath}<br>";
|
||||
$imageData = fetchImageData($sourcePath);
|
||||
if (!$imageData) {
|
||||
// echo "DEBUG: 원본 이미지 데이터를 가져올 수 없습니다.<br>";
|
||||
return false;
|
||||
}
|
||||
// echo "DEBUG: 원본 이미지 데이터 로드 성공<br>";
|
||||
|
||||
// 이미지 로드 및 작업
|
||||
$tempImage = tempnam(sys_get_temp_dir(), 'image');
|
||||
file_put_contents($tempImage, $imageData);
|
||||
$image = @imagecreatefromjpeg($tempImage);
|
||||
unlink($tempImage);
|
||||
|
||||
if (!$image) {
|
||||
echo "DEBUG: JPEG 이미지를 로드할 수 없습니다.<br>";
|
||||
return false;
|
||||
}
|
||||
// echo "DEBUG: 이미지 리소스 생성 성공<br>";
|
||||
|
||||
// 텍스트 추가
|
||||
$textColor = imagecolorallocate($image, 255, 0, 0); // 빨간색
|
||||
foreach ($textData as $textItem) {
|
||||
if (isset($textItem['text'], $textItem['x'], $textItem['y'])) {
|
||||
imagestring(
|
||||
$image,
|
||||
$fontSize,
|
||||
intval($textItem['x']),
|
||||
intval($textItem['y']),
|
||||
$textItem['text'],
|
||||
$textColor
|
||||
);
|
||||
// echo "DEBUG: 텍스트 추가 -> '{$textItem['text']}' @ ({$textItem['x']}, {$textItem['y']})<br>";
|
||||
}
|
||||
}
|
||||
|
||||
// 이미지 저장
|
||||
$result = @imagejpeg($image, $localSavePath);
|
||||
// if ($result) {
|
||||
// echo "DEBUG: 이미지 저장 성공 -> {$localSavePath}<br>";
|
||||
// } else {
|
||||
// echo "DEBUG: 이미지 저장 실패 -> {$localSavePath}<br>";
|
||||
// }
|
||||
|
||||
imagedestroy($image);
|
||||
|
||||
return $result ? $localSavePath : false;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?php foreach ($box_data as $box): ?>
|
||||
<?PHP
|
||||
// echo '<pre>';
|
||||
// print_r($box);
|
||||
// echo '</pre>';
|
||||
?>
|
||||
<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;">
|
||||
<thead class="table-secondary">
|
||||
<tr>
|
||||
<th class="text-center"><?php echo $box['size']; ?> 셔터박스 (점검구:<?=$box['boxdirection']?>) </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if($box['boxdirection'] == '밑면')
|
||||
{
|
||||
// 점검구 양면 이미지 생성
|
||||
$sourcePath = $WebSite . 'img/box/source/box_bottom.jpg';
|
||||
$saveName = 'box_' . str_replace('*', 'x', $box['size']) . '_bottom.jpg';
|
||||
$savePath = $WebSite . 'img/box/' . $saveName;
|
||||
list($boxwidth, $boxheight) = explode('*', $box['size']);
|
||||
$TopcoverSize = $boxwidth - 111; // 텍스트로 추가할 값
|
||||
// 여러 텍스트 데이터
|
||||
$textData = [
|
||||
['text' => $boxheight , 'x' => 15, 'y' => 85],
|
||||
['text' => $TopcoverSize, 'x' => 100, 'y' => 2],
|
||||
['text' => $box['boxfrontbottom'] , 'x' => 25, 'y' => 170],
|
||||
['text' => $box['boxrailwidth'] , 'x' => 55, 'y' => 210],
|
||||
['text' => ($boxwidth-$box['boxfrontbottom']-$box['boxrailwidth']-140) , 'x' => 120, 'y' => 175],
|
||||
['text' => ($boxheight) , 'x' => 176, 'y' => 90],
|
||||
['text' => ($boxwidth+5) , 'x' => 100, 'y' => 225],
|
||||
['text' => ($boxheight+5) , 'x' => 135, 'y' => 250],
|
||||
];
|
||||
}
|
||||
else if($box['boxdirection'] == '후면')
|
||||
{
|
||||
// 점검구 후면 이미지 생성
|
||||
$sourcePath = $WebSite . 'img/box/source/box_rear.jpg';
|
||||
$saveName = 'box_' . str_replace('*', 'x', $box['size']) . '_rear.jpg';
|
||||
$savePath = $WebSite . 'img/box/' . $saveName;
|
||||
list($boxwidth, $boxheight) = explode('*', $box['size']);
|
||||
$TopcoverSize = $boxwidth - 111; // 텍스트로 추가할 값
|
||||
$textData = [
|
||||
['text' => $boxheight , 'x' => 15, 'y' => 85],
|
||||
['text' => $TopcoverSize, 'x' => 100, 'y' => 2],
|
||||
['text' => $box['boxfrontbottom'] , 'x' => 25, 'y' => 170],
|
||||
['text' => $box['boxrailwidth'] , 'x' => 55, 'y' => 210],
|
||||
['text' => ($boxwidth-$box['boxfrontbottom']-$box['boxrailwidth']) , 'x' => 120, 'y' => 165],
|
||||
['text' => ($boxheight-140) , 'x' => 192, 'y' => 90],
|
||||
['text' => ($boxwidth+5) , 'x' => 100, 'y' => 225],
|
||||
['text' => ($boxheight+5) , 'x' => 135, 'y' => 250],
|
||||
];
|
||||
}
|
||||
else // 없으면 양면으로 추정함 ($box['boxdirection'] == '양면')
|
||||
{
|
||||
// 점검구 양면 이미지 생성
|
||||
$sourcePath = $WebSite . 'img/box/source/box_both.jpg';
|
||||
$saveName = 'box_' . str_replace('*', 'x', $box['size']) . '_both.jpg';
|
||||
$savePath = $WebSite . 'img/box/' . $saveName;
|
||||
list($boxwidth, $boxheight) = explode('*', $box['size']);
|
||||
$TopcoverSize = $boxwidth - 111; // 텍스트로 추가할 값
|
||||
// 여러 텍스트 데이터
|
||||
$textData = [
|
||||
['text' => $boxheight , 'x' => 15, 'y' => 85],
|
||||
['text' => $TopcoverSize, 'x' => 100, 'y' => 2],
|
||||
['text' => $box['boxfrontbottom'] , 'x' => 25, 'y' => 170],
|
||||
['text' => $box['boxrailwidth'] , 'x' => 55, 'y' => 210],
|
||||
['text' => ($boxwidth-$box['boxfrontbottom']-$box['boxrailwidth']-140) , 'x' => 120, 'y' => 175],
|
||||
['text' => ($boxheight-140) , 'x' => 192, 'y' => 90],
|
||||
['text' => ($boxwidth+5) , 'x' => 100, 'y' => 225],
|
||||
['text' => ($boxheight+5) , 'x' => 135, 'y' => 250],
|
||||
];
|
||||
}
|
||||
|
||||
drawImage($sourcePath, $savePath, $textData, 4);
|
||||
|
||||
// 길이 데이터 필터링
|
||||
$filteredLengths = array_filter($box['length_data'], function ($length) {
|
||||
return $length['sum'] > 0;
|
||||
});
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($filteredLengths);
|
||||
// echo '</pre>';
|
||||
|
||||
$rowspan = count($filteredLengths); // 유효 길이의 개수만큼 rowspan 계산
|
||||
$innerCount = 0;
|
||||
?>
|
||||
<?php foreach ($filteredLengths as $index => $length):
|
||||
$innerCount ++ ;
|
||||
?>
|
||||
<tr>
|
||||
<?php if ($innerCount === 1): ?>
|
||||
<!-- 첫 번째 행에만 이미지를 출력 -->
|
||||
<td class="text-center" rowspan="<?php echo $rowspan; ?>">
|
||||
<img src="../img/box/<?php echo $saveName; ?>" alt="셔터박스" width="220">
|
||||
<br>
|
||||
①전면부 ②린텔부 ③하부점검구 ④후면코너부 ⑤후면점검구 ⑥상부덮개 ⑦측면부(마구리)
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
145
output/common/slat.php
Normal file
145
output/common/slat.php
Normal file
@@ -0,0 +1,145 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="d-flex align-items-center justify-content-start ">
|
||||
<table id="slat_table" class="table avoid-break" style="border-collapse: collapse;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td rowspan="2" class="text-center align-middle lightgray">일련<br>번호</td>
|
||||
<td rowspan="2" class="text-center align-middle lightgray">마감</td>
|
||||
<td rowspan="2" class="text-center align-middle yellowblackBold">도면부호</td>
|
||||
<td colspan="2" class="text-center align-middle blueBlackBold">오픈(mm)<br>
|
||||
<span class="text-danger" style="font-size:10px;" > "레일 너비 130" <span> </td>
|
||||
<td colspan="2" class="text-center align-middle blueBlackBold">제작사이즈(mm) <br>
|
||||
<span class="text-danger" style="font-size:10px;" > "엔드락(미미)제외" <span>
|
||||
</td>
|
||||
<td rowspan="2" class="text-center align-middle blueBlackBold">조인 <br> 트바 </td>
|
||||
<td rowspan="2" class="text-center align-middle yellowblackBold">투시창 </td>
|
||||
<td rowspan="2" class="text-center align-middle purpleblackBold" style="font-size:10px;">샤프트 <br> (인치)</td>
|
||||
<td rowspan="2" class="text-center align-middle greenblackBold" style="font-size:10px;" >가이드레일<br> 유형</td>
|
||||
<td colspan="2" class="text-center align-middle orangeBlackBold">모터</td>
|
||||
<td rowspan="2" class="text-center align-middle purpleblackBold">셔터박스 <br> (규격)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center blueBlackBold">가로</td>
|
||||
<td class="text-center blueBlackBold">세로</td>
|
||||
<td class="text-center blueBlackBold">가로 <br> <span class="text-danger" style="font-size:10px;"> (오픈<span class="width_diff_display">@</span>) </span></td>
|
||||
<td class="text-center blueBlackBold">세로 <br> <span class="text-danger" style="font-size:10px;"> (오픈<span class="height_diff_display">@</span>) </span></td>
|
||||
<td class="text-center orangeBlackBold" style="font-size:10px;">브라켓트</td>
|
||||
<td class="text-center orangeBlackBold" style="font-size:10px;">용량<br>(KG)</td>
|
||||
</tr>
|
||||
<?PHP
|
||||
|
||||
$row_count = 0;
|
||||
foreach ($eList as $row) {
|
||||
echo '<tr>';
|
||||
|
||||
for ($i = 1; $i <= 14; $i++) {
|
||||
switch ($i) {
|
||||
case 1:
|
||||
// col1에만 HTML 태그를 해석하도록 출력
|
||||
echo '<td class="text-center ">' . $row['col1'] . '</td>';
|
||||
break;
|
||||
case 2:
|
||||
echo '<td class="text-center ">' . $row['col7'] . '</td>';
|
||||
break;
|
||||
case 3:
|
||||
echo '<td class="text-center ">' . $row['col3'] . '</td>';
|
||||
break;
|
||||
case 4:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col8']) . '</td>';
|
||||
break;
|
||||
case 5:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col9']) . '</td>';
|
||||
break;
|
||||
case 6:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col10']) . '</td>';
|
||||
break;
|
||||
case 7:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col11']) . '</td>';
|
||||
break;
|
||||
case 8:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col76']) . '</td>';
|
||||
break;
|
||||
case 9:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col14']) . '</td>';
|
||||
break;
|
||||
case 10:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col59']) . '</td>';
|
||||
break;
|
||||
case 11:
|
||||
// 한글 혼합형만 나오게 하기 숫자제거
|
||||
echo '<td class="text-center">' . htmlspecialchars(preg_replace('/\(.+\)/', '', $row['col6'])) . '</td>';
|
||||
break;
|
||||
case 12:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col21']) . '</td>';
|
||||
break;
|
||||
case 13:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col20']) . '</td>';
|
||||
break;
|
||||
case 14:
|
||||
echo '<td class="text-center ">' . htmlspecialchars($row['col37']) . '</td>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
echo '</tr>';
|
||||
$row_count ++ ;
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function updateSlatSizeDifferences() {
|
||||
const table = document.getElementById('slat_table');
|
||||
if (!table) return;
|
||||
const rows = Array.from(table.querySelectorAll('tbody tr')).filter(row => {
|
||||
const cells = row.querySelectorAll('td');
|
||||
if (cells.length < 7) return false;
|
||||
return !isNaN(parseInt(cells[3].textContent)) && !isNaN(parseInt(cells[4].textContent)) &&
|
||||
!isNaN(parseInt(cells[5].textContent)) && !isNaN(parseInt(cells[6].textContent));
|
||||
});
|
||||
const widthDiffElements = table.querySelectorAll('.width_diff_display');
|
||||
const heightDiffElements = table.querySelectorAll('.height_diff_display');
|
||||
if (rows.length === 0) {
|
||||
widthDiffElements.forEach(e => e.textContent = '@');
|
||||
heightDiffElements.forEach(e => e.textContent = '@');
|
||||
return;
|
||||
}
|
||||
const widthDiffs = [];
|
||||
const heightDiffs = [];
|
||||
rows.forEach(row => {
|
||||
const cells = row.querySelectorAll('td');
|
||||
const openWidth = parseInt(cells[3].textContent.replace(/[^0-9.-]/g, '')) || 0;
|
||||
const openHeight = parseInt(cells[4].textContent.replace(/[^0-9.-]/g, '')) || 0;
|
||||
const makeWidth = parseInt(cells[5].textContent.replace(/[^0-9.-]/g, '')) || 0;
|
||||
const makeHeight = parseInt(cells[6].textContent.replace(/[^0-9.-]/g, '')) || 0;
|
||||
if (openWidth > 0 && makeWidth > 0) widthDiffs.push(makeWidth - openWidth);
|
||||
if (openHeight > 0 && makeHeight > 0) heightDiffs.push(makeHeight - openHeight);
|
||||
});
|
||||
function formatDiff(val) { return (val >= 0 ? '+' : '') + val; }
|
||||
widthDiffElements.forEach(element => {
|
||||
if (widthDiffs.length === 0) {
|
||||
element.textContent = '@';
|
||||
} else if (widthDiffs.length === 1) {
|
||||
element.textContent = formatDiff(widthDiffs[0]);
|
||||
} else {
|
||||
const allSame = widthDiffs.every(diff => diff === widthDiffs[0]);
|
||||
element.textContent = allSame ? formatDiff(widthDiffs[0]) : '@';
|
||||
}
|
||||
});
|
||||
heightDiffElements.forEach(element => {
|
||||
if (heightDiffs.length === 0) {
|
||||
element.textContent = '@';
|
||||
} else if (heightDiffs.length === 1) {
|
||||
element.textContent = formatDiff(heightDiffs[0]);
|
||||
} else {
|
||||
const allSame = heightDiffs.every(diff => diff === heightDiffs[0]);
|
||||
element.textContent = allSame ? formatDiff(heightDiffs[0]) : '@';
|
||||
}
|
||||
});
|
||||
}
|
||||
document.addEventListener('DOMContentLoaded', function() { updateSlatSizeDifferences(); });
|
||||
</script>
|
||||
168
output/common/subgoods.php
Normal file
168
output/common/subgoods.php
Normal file
@@ -0,0 +1,168 @@
|
||||
<!-- 감기샤프트 -->
|
||||
<?php
|
||||
if (true) {
|
||||
// 감기샤프트 데이터를 누적하기 위한 배열 (혼합)
|
||||
$shaft_data = [];
|
||||
|
||||
// 고정 감기샤프트 항목 (기존 방식)
|
||||
$fixed_shaft = [
|
||||
'4인치_3000' => 0,
|
||||
'4인치_4500' => 0,
|
||||
'4인치_6000' => 0,
|
||||
'5인치_6000' => 0,
|
||||
'5인치_7000' => 0,
|
||||
'5인치_8200' => 0,
|
||||
];
|
||||
|
||||
// 부속자재 데이터
|
||||
$subs_data = [
|
||||
'각파이프_3000' => 0,
|
||||
'각파이프_6000' => 0,
|
||||
'앵글_2500' => 0,
|
||||
'마환봉_3000' => 0,
|
||||
];
|
||||
|
||||
// 누적 처리
|
||||
foreach ($eList as $item) {
|
||||
// 2인치, 3인치일 경우만 동적 shaft_data 처리
|
||||
$inch = isset($item['col59_inch']) ? $item['col59_inch'] : '2인치';
|
||||
$length = isset($item['col59_length']) ? $item['col59_length'] : '300';
|
||||
$qty = isset($item['col59']) ? intval($item['col59']) : 0;
|
||||
|
||||
if (in_array($inch, ['2인치', '3인치'])) {
|
||||
$shaft_key = "{$inch}_{$length}";
|
||||
if (!isset($shaft_data[$shaft_key])) {
|
||||
$shaft_data[$shaft_key] = 0;
|
||||
}
|
||||
$shaft_data[$shaft_key] += $qty;
|
||||
}
|
||||
|
||||
// 기존 방식 고정 컬럼들 (4~5인치 감기샤프트)
|
||||
$fixed_shaft['4인치_3000'] += intval($item['col60']);
|
||||
$fixed_shaft['4인치_4500'] += intval($item['col61']);
|
||||
$fixed_shaft['4인치_6000'] += intval($item['col62']);
|
||||
$fixed_shaft['5인치_6000'] += intval($item['col63']);
|
||||
$fixed_shaft['5인치_7000'] += intval($item['col64']);
|
||||
$fixed_shaft['5인치_8200'] += intval($item['col65']);
|
||||
|
||||
// 부속자재
|
||||
$subs_data['각파이프_3000'] += intval($item['col68']);
|
||||
$subs_data['각파이프_6000'] += intval($item['col69']);
|
||||
$subs_data['마환봉_3000'] += intval($item['col70']);
|
||||
$subs_data['앵글_2500'] += intval($item['col71']);
|
||||
}
|
||||
|
||||
// 출력 시작
|
||||
echo '<div class="row">';
|
||||
|
||||
// 감기샤프트 출력
|
||||
echo '<div class="col-sm-6 justify-content-start">';
|
||||
echo '<table class="table avoid-break" style="border-collapse: collapse;">';
|
||||
echo '<thead>';
|
||||
echo '<tr><th colspan="2" class="text-center lightgray">감기샤프트</th></tr>';
|
||||
echo '<tr><th class="text-center lightgray">규격</th><th class="text-center lightgray">수량</th></tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
// 감기샤프트 데이터 출력 전: 정렬
|
||||
uksort($shaft_data, function($a, $b) {
|
||||
// 1. 인치 숫자 추출 (2인치 → 2, 4인치 → 4 등)
|
||||
preg_match('/(\d+)인치/', $a, $matchA);
|
||||
preg_match('/(\d+)인치/', $b, $matchB);
|
||||
|
||||
$inchA = isset($matchA[1]) ? intval($matchA[1]) : 0;
|
||||
$inchB = isset($matchB[1]) ? intval($matchB[1]) : 0;
|
||||
|
||||
if ($inchA !== $inchB) {
|
||||
return $inchA - $inchB;
|
||||
}
|
||||
|
||||
// 2. 길이 숫자 추출 (ex: _3000 → 3000)
|
||||
preg_match('/_(\d+)/', $a, $lenA);
|
||||
preg_match('/_(\d+)/', $b, $lenB);
|
||||
|
||||
$lengthA = isset($lenA[1]) ? intval($lenA[1]) : 0;
|
||||
$lengthB = isset($lenB[1]) ? intval($lenB[1]) : 0;
|
||||
|
||||
return $lengthA - $lengthB;
|
||||
});
|
||||
|
||||
// 동적 2/3인치 출력
|
||||
foreach ($shaft_data as $label => $quantity) {
|
||||
if ($quantity > 0) {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center blueBold">' . str_replace('_', ' ', $label) . '</td>';
|
||||
echo '<td class="text-center fw-bold">' . $quantity . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// 고정 4/5인치 출력
|
||||
foreach ($fixed_shaft as $label => $quantity) {
|
||||
if ($quantity > 0) {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center blueBold">' . str_replace('_', ' ', $label) . '</td>';
|
||||
echo '<td class="text-center fw-bold">' . $quantity . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>'; // 감기샤프트 끝
|
||||
|
||||
// 부속자재 출력
|
||||
echo '<div class="col-sm-6">';
|
||||
echo '<table class="table avoid-break" style="border-collapse: collapse;">';
|
||||
echo '<thead>';
|
||||
echo '<tr><th colspan="3" class="text-center lightgray">부속자재</th></tr>';
|
||||
echo '<tr><th class="text-center lightgray">구성품</th><th class="text-center lightgray">길이</th><th class="text-center lightgray">수량</th></tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
// 각파이프 (rowspan)
|
||||
$pipe_rowspan = 0;
|
||||
if ($subs_data['각파이프_3000'] > 0) $pipe_rowspan++;
|
||||
if ($subs_data['각파이프_6000'] > 0) $pipe_rowspan++;
|
||||
|
||||
if ($pipe_rowspan > 0) {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center blueBold" rowspan="' . $pipe_rowspan . '">각파이프</td>';
|
||||
if ($subs_data['각파이프_3000'] > 0) {
|
||||
echo '<td class="text-center fw-bold">3000</td>';
|
||||
echo '<td class="text-center fw-bold">' . $subs_data['각파이프_3000'] . '</td>';
|
||||
echo '</tr>';
|
||||
if ($subs_data['각파이프_6000'] > 0) echo '<tr>';
|
||||
}
|
||||
if ($subs_data['각파이프_6000'] > 0) {
|
||||
echo '<td class="text-center fw-bold">6000</td>';
|
||||
echo '<td class="text-center fw-bold">' . $subs_data['각파이프_6000'] . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// 앵글
|
||||
if ($subs_data['앵글_2500'] > 0) {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center blueBold">앵글<br>(40*40*3T)</td>';
|
||||
echo '<td class="text-center fw-bold">2500</td>';
|
||||
echo '<td class="text-center fw-bold">' . $subs_data['앵글_2500'] . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
// 마환봉
|
||||
if ($subs_data['마환봉_3000'] > 0) {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center blueBold">마환봉<br>(6mm)</td>';
|
||||
echo '<td class="text-center fw-bold">3000</td>';
|
||||
echo '<td class="text-center fw-bold">' . $subs_data['마환봉_3000'] . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>'; // 부속자재 끝
|
||||
|
||||
echo '</div>'; // 전체 row 끝
|
||||
}
|
||||
?>
|
||||
136
output/common/subgoods_slat.php
Normal file
136
output/common/subgoods_slat.php
Normal file
@@ -0,0 +1,136 @@
|
||||
<!-- 감기샤프트 -->
|
||||
<?php
|
||||
// 감기샤프트와 부속자재 출력
|
||||
if (True) {
|
||||
// 감기샤프트 데이터를 누적하기 위한 배열
|
||||
$shaft_data = [
|
||||
'4인치_3000' => intval(0),
|
||||
'4인치_4500' => intval(0),
|
||||
'4인치_6000' => intval(0),
|
||||
'5인치_6000' => intval(0),
|
||||
'5인치_7000' => intval(0),
|
||||
'5인치_8200' => intval(0),
|
||||
'6인치_3000' => intval(0),
|
||||
'6인치_6000' => intval(0),
|
||||
'6인치_7000' => intval(0),
|
||||
'6인치_8000' => intval(0),
|
||||
'8인치_8200' => intval(0)
|
||||
];
|
||||
|
||||
// 부속자재 데이터를 누적하기 위한 배열
|
||||
$subs_data = [
|
||||
'각파이프_3000' => intval(0),
|
||||
'각파이프_6000' => intval(0),
|
||||
'앵글_2500' => intval(0),
|
||||
'조인트바_300' => intval(0)
|
||||
];
|
||||
|
||||
// 데이터를 누적하여 합산
|
||||
foreach ($eList as $item) {
|
||||
$shaft_data['4인치_3000'] += intval($item['col61']);
|
||||
$shaft_data['4인치_4500'] += intval($item['col62']);
|
||||
$shaft_data['4인치_6000'] += intval($item['col63']);
|
||||
$shaft_data['5인치_6000'] += intval($item['col64']);
|
||||
$shaft_data['5인치_7000'] += intval($item['col65']);
|
||||
$shaft_data['5인치_8200'] += intval($item['col66']);
|
||||
$shaft_data['6인치_3000'] += intval($item['col67']);
|
||||
$shaft_data['6인치_6000'] += intval($item['col68']);
|
||||
$shaft_data['6인치_7000'] += intval($item['col69']);
|
||||
$shaft_data['6인치_8000'] += intval($item['col70']);
|
||||
$shaft_data['8인치_8200'] += intval($item['col71']);
|
||||
|
||||
// 부속자재 누적
|
||||
$subs_data['각파이프_3000'] += intval($item['col74']);
|
||||
$subs_data['각파이프_6000'] += intval($item['col75']);
|
||||
$subs_data['조인트바_300'] += intval($item['col76']);
|
||||
$subs_data['앵글_2500'] += intval($item['col77']);
|
||||
}
|
||||
|
||||
// HTML 구조 시작
|
||||
echo '<div class="row">';
|
||||
|
||||
// 감기샤프트 부분
|
||||
echo '<div class="col-sm-6 justify-content-start">';
|
||||
echo '<table class="table avoid-break" style="border-collapse: collapse;">';
|
||||
echo '<thead>';
|
||||
echo '<tr><th colspan="2" class="text-center lightgray">감기샤프트</th></tr>';
|
||||
echo '<tr><th class="text-center lightgray">규격</th><th class="text-center lightgray">수량</th></tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
// 감기샤프트 데이터 출력
|
||||
foreach ($shaft_data as $label => $quantity) {
|
||||
if ($quantity > 0) {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center blueBold">' . str_replace('_', ' ', $label) . '</td>';
|
||||
echo '<td class="text-center fw-bold">' . $quantity . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>'; // 감기샤프트 부분 끝
|
||||
|
||||
// 부속자재 부분
|
||||
echo '<div class="col-sm-6 ">';
|
||||
echo '<table class="table avoid-break" style="border-collapse: collapse;">';
|
||||
echo '<thead>';
|
||||
echo '<tr><th colspan="3" class="text-center lightgray">부속자재</th></tr>';
|
||||
echo '<tr><th class="text-center lightgray">구성품</th><th class="text-center lightgray">길이</th><th class="text-center lightgray">수량</th></tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
// 각파이프 (길이별로 행을 따로 출력, 첫 번째 셀에 rowspan 적용)
|
||||
$pipe_rowspan = 0;
|
||||
if ($subs_data['각파이프_3000'] > 0) {
|
||||
$pipe_rowspan++;
|
||||
}
|
||||
if ($subs_data['각파이프_6000'] > 0) {
|
||||
$pipe_rowspan++;
|
||||
}
|
||||
|
||||
if ($pipe_rowspan > 0) {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center blueBold" rowspan="' . $pipe_rowspan . '">각파이프</td>';
|
||||
|
||||
if ($subs_data['각파이프_3000'] > 0) {
|
||||
echo '<td class="text-center fw-bold">3000</td>';
|
||||
echo '<td class="text-center fw-bold">' . $subs_data['각파이프_3000'] . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
if ($subs_data['각파이프_6000'] > 0) {
|
||||
// 6000 길이용 각파이프
|
||||
echo '<td class="text-center fw-bold">6000</td>';
|
||||
echo '<td class="text-center fw-bold">' . $subs_data['각파이프_6000'] . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 조인트바
|
||||
if ($subs_data['조인트바_300'] > 0) {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center blueBold">조인트바</td>';
|
||||
echo '<td class="text-center fw-bold">300</td>';
|
||||
echo '<td class="text-center fw-bold">' . $subs_data['조인트바_300'] . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
// 앵글
|
||||
if ($subs_data['앵글_2500'] > 0) {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center blueBold">앵글<br>(50*50*3T)</td>';
|
||||
echo '<td class="text-center fw-bold">2500</td>';
|
||||
echo '<td class="text-center fw-bold">' . $subs_data['앵글_2500'] . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>'; // 부속자재 부분 끝
|
||||
|
||||
echo '</div>'; // row 끝
|
||||
echo '</div>'; // row 끝
|
||||
}
|
||||
?>
|
||||
128
output/css/mystyle.css
Normal file
128
output/css/mystyle.css
Normal file
@@ -0,0 +1,128 @@
|
||||
textarea {
|
||||
overflow: hidden;
|
||||
resize: none; /* 사용자 크기 조절을 방지 */
|
||||
}
|
||||
/* 기본 스타일 설정 */
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
transform: scale(1.3); /* 크기 확대 */
|
||||
margin: 3px; /* 여백 추가 */
|
||||
}
|
||||
|
||||
/* "readonly" 상태일 때 스타일 설정 */
|
||||
.readonly-checkbox,
|
||||
.readonly-radio {
|
||||
pointer-events: none; /* 사용자 상호작용 비활성화 */
|
||||
opacity: 1; /* 불투명도 설정 */
|
||||
color: red;
|
||||
}
|
||||
|
||||
/* 레이블 텍스트 크게 설정 */
|
||||
label {
|
||||
font-size: 1.2em; /* 글꼴 크기 확대 */
|
||||
display: inline-block;
|
||||
margin: 3px 0;
|
||||
}
|
||||
.w-40{
|
||||
width: 40%!important;
|
||||
}
|
||||
.w-50{
|
||||
width: 50%!important;
|
||||
}
|
||||
.w-60{
|
||||
width: 60%!important;
|
||||
}
|
||||
.w-85{
|
||||
width: 85%!important;
|
||||
}
|
||||
|
||||
.viewNoBtn {
|
||||
cursor : pointer;
|
||||
}
|
||||
|
||||
/* 전체 모달 폰트 기본값 12px 유지 */
|
||||
#fullscreenModal * {
|
||||
font-size: 12px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 모달 배경 오버레이 */
|
||||
#fullscreenModal {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
z-index: 1050;
|
||||
}
|
||||
|
||||
/* 모달 내용 영역 (가운데 정렬) */
|
||||
#fullscreenModal > div {
|
||||
background: white;
|
||||
width: 1920px;
|
||||
margin: 40px auto;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 버튼 스타일 */
|
||||
#fullscreenModal .btn {
|
||||
padding: 2px 8px;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* 테이블 관련 */
|
||||
#fullscreenModal table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
#fullscreenModal table th,
|
||||
#fullscreenModal table td {
|
||||
padding: 4px;
|
||||
vertical-align: middle;
|
||||
font-size: 12px;
|
||||
border: 1px solid #dee2e6;
|
||||
}
|
||||
#fullscreenModal table thead {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
/* 모달 내부 스크롤 */
|
||||
#fullscreenModal .custom-modal-body {
|
||||
padding: 8px;
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
max-height: 800px;
|
||||
}
|
||||
|
||||
/* 모달 열릴 때 바디 스크롤 방지 */
|
||||
body.modal-open {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 자동완성 리스트 스타일 */
|
||||
/* 기존 스타일에 active 추가 */
|
||||
.autocomplete-suggestions {
|
||||
position: absolute;
|
||||
z-index: 10000;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.autocomplete-suggestion {
|
||||
padding: 6px 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.autocomplete-suggestion:hover,
|
||||
.autocomplete-suggestion.active {
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
|
||||
.tooltip .tooltip-inner {
|
||||
font-size: 20px !important;
|
||||
}
|
||||
184
output/css/style.css
Normal file
184
output/css/style.css
Normal file
@@ -0,0 +1,184 @@
|
||||
textarea {
|
||||
overflow: hidden;
|
||||
resize: none; /* 사용자 크기 조절을 방지 */
|
||||
}
|
||||
/* 기본 스타일 설정 */
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
transform: scale(1.2); /* 크기 확대 */
|
||||
margin: 3px; /* 여백 추가 */
|
||||
}
|
||||
|
||||
/* "readonly" 상태일 때 스타일 설정 */
|
||||
.readonly-checkbox,
|
||||
.readonly-radio {
|
||||
pointer-events: none; /* 사용자 상호작용 비활성화 */
|
||||
opacity: 1; /* 불투명도 설정 */
|
||||
color: red;
|
||||
}
|
||||
|
||||
/* 레이블 텍스트 크게 설정 */
|
||||
label {
|
||||
font-size: 1.1em; /* 글꼴 크기 확대 */
|
||||
display: inline-block;
|
||||
margin: 3px 0;
|
||||
}
|
||||
.w-40{
|
||||
width: 40%!important;
|
||||
}
|
||||
.w-60{
|
||||
width: 60%!important;
|
||||
}
|
||||
|
||||
.hover-pointer{
|
||||
cursor : pointer;
|
||||
}
|
||||
|
||||
/* #estimate_screenDiv와 #estimate_slatDiv 안의 table에만 적용 */
|
||||
#estimate_screenDiv .table td,
|
||||
#estimate_slatDiv .table td {
|
||||
white-space: normal; /* 텍스트가 셀 내부에서 줄바꿈이 가능하게 설정 */
|
||||
overflow: visible; /* 넘치는 텍스트를 숨기지 않음 */
|
||||
text-overflow: clip; /* 텍스트를 자르지 않음 */
|
||||
max-width: none; /* 셀의 최대 너비를 제한하지 않음 */
|
||||
word-wrap: break-word; /* 긴 단어를 줄바꿈 가능하게 설정 */
|
||||
}
|
||||
|
||||
#estimate_screenDiv .table,
|
||||
#estimate_slatDiv .table {
|
||||
table-layout: auto; /* 셀의 너비를 내용에 맞게 자동으로 조정 */
|
||||
width: auto; /* 테이블의 너비를 자동으로 설정 (부모 요소를 채우지 않음) */
|
||||
min-width: 100%; /* 최소 너비는 부모 요소를 채우도록 설정 */
|
||||
}
|
||||
|
||||
|
||||
table, th, td {
|
||||
border: 0.5px solid black !important; /* Bold border */
|
||||
font-size: 12px !important;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.calculate-row {
|
||||
background-color: #f0f0f0!important; /* Light gray background */
|
||||
}
|
||||
|
||||
/* 전체 테이블에 대한 설정 */
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
/* 모든 td 요소에 적용되는 기본 패딩 및 행간 조정 */
|
||||
td {
|
||||
padding: 4px !important; /* 셀의 내부 여백을 줄임 */
|
||||
line-height: 1.4 !important; /* 행간을 줄여서 상하단 여백을 줄임 */
|
||||
}
|
||||
|
||||
/* 테이블의 상단과 하단 마진을 제거하여 전체 공백 줄이기 */
|
||||
table, .d-flex {
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
/* 밝은 회색 배경을 가지는 th, td 요소에 적용할 클래스 */
|
||||
.lightgray {
|
||||
background-color: #d3d3d3 !important; /* 기존 lightgray보다 밝은 회색 */
|
||||
color: black !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
/* 연한 노란색 배경에 검정색 굵은 글씨 */
|
||||
.yellowBold {
|
||||
background-color: #ffffe0 !important; /* 연한 노란색 (light yellow) */
|
||||
color: black !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
/* 연한 노란색 배경에 붉은색 굵은 글씨 */
|
||||
.yellowredBold {
|
||||
background-color: #ffffe0 !important; /* 연한 노란색 (light yellow) */
|
||||
color: red !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
/* 연한 파란색 배경에 적색 글씨 */
|
||||
.blueBold {
|
||||
background-color: hsl(160, 5%, 85%) !important; /* 연한 파란색 */
|
||||
color: red !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
/* 연한 파란색 배경에 검정색 글씨 */
|
||||
.blueBlackBold {
|
||||
background-color: hsl(220, 60%, 90%) !important; /* 연한 파란색 */
|
||||
color: black !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
/* 연한 주황색 배경에 붉은색 글씨 */
|
||||
.orangeBold {
|
||||
background-color: hsl(30, 100%, 85%) !important; /* 연한 주황색 */
|
||||
color: red !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
/* 연한 주황색 배경에 검정 글씨 */
|
||||
.orangeBlackBold {
|
||||
background-color: hsl(30, 100%, 85%) !important; /* 연한 주황색 */
|
||||
color: black !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
/* 연한 노란색 배경에 검정 굵은 글씨 */
|
||||
.yellowblackBold {
|
||||
background-color: #ffffe0 !important; /* 연한 노란색 (light yellow) */
|
||||
color: black !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
/* 연한 녹색 배경에 붉은색 글씨 */
|
||||
.greenredBold {
|
||||
background-color: #90ee90 !important; /* 연한 녹색 (light green) */
|
||||
color: red !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
/* 더 연한 녹색 배경에 검정 글씨 */
|
||||
.greenblackBold {
|
||||
background-color: hsl(120, 73%, 92%) !important; /* 기존보다 50% 더 연한 녹색 */
|
||||
color: black !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
/* 더 연한 보라색 배경에 검정 글씨 */
|
||||
.purpleblackBold {
|
||||
background-color: hsl(270, 100%, 95%) !important; /* 연한 보라색 */
|
||||
color: black !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body {
|
||||
width: 210mm; /* A4 width */
|
||||
height: 297mm; /* A4 height */
|
||||
margin: 0; /* Remove default margin */
|
||||
font-size: 10pt; /* Font size for printing */
|
||||
}
|
||||
table {
|
||||
page-break-inside: auto !important;
|
||||
}
|
||||
|
||||
tr {
|
||||
page-break-inside: avoid !important;
|
||||
page-break-after: auto !important;
|
||||
}
|
||||
|
||||
thead {
|
||||
display: table-header-group !important; /* 페이지 넘어가도 thead 유지 */
|
||||
}
|
||||
|
||||
tfoot {
|
||||
display: table-footer-group !important;
|
||||
}
|
||||
}
|
||||
|
||||
.avoid-break {
|
||||
break-inside: avoid !important;
|
||||
page-break-inside: avoid !important;
|
||||
}
|
||||
|
||||
3378
output/debug_log.txt
Normal file
3378
output/debug_log.txt
Normal file
File diff suppressed because it is too large
Load Diff
113
output/delete.php
Normal file
113
output/delete.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
session_start();
|
||||
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>=8) {
|
||||
echo "<script> alert('관리자 승인이 필요합니다.') </script>";
|
||||
sleep(2);
|
||||
header ("Location:/login/logout.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$num=$_REQUEST["num"];
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$upload_dir = '../uplaods/output/'; //물리적 저장위치
|
||||
|
||||
try{
|
||||
$sql = "select * from chandj.output where num = ? ";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$count = $stmh->rowCount();
|
||||
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC);
|
||||
$copied_name[0] = $row[file_copied_0];
|
||||
$copied_name[1] = $row[file_copied_1];
|
||||
$copied_name[2] = $row[file_copied_2];
|
||||
$copied_name[3] = $row[file_copied_3];
|
||||
$copied_name[4] = $row[file_copied_4];
|
||||
|
||||
for ($i=0; $i<5; $i++)
|
||||
{
|
||||
if ($copied_name[$i])
|
||||
{
|
||||
$image_name = $upload_dir.$copied_name[$i];
|
||||
unlink($image_name);
|
||||
}
|
||||
}
|
||||
}catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "delete from chandj.output where num = ?";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
|
||||
} catch (Exception $ex) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "delete from chandj.orderlist where outputnum = ?";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (Exception $ex) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "delete from chandj.egiorderlist where outputnum = ?";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (Exception $ex) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "delete from chandj.motor where outputnum = ?";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (Exception $ex) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "delete from chandj.egimake where outputnum = ?";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
header("Location:/output/list.php");
|
||||
} catch (Exception $ex) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
23
output/delete_json.php
Normal file
23
output/delete_json.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
// delete_json.php
|
||||
|
||||
// 클라이언트로부터 전달받은 값 (필요에 따라 수정)
|
||||
$groupCode = $_POST['groupCode'] ?? '';
|
||||
|
||||
// 파일명에 사용할 수 없는 문자는 제거하여 안전한 그룹코드 생성
|
||||
$safeGroupCode = preg_replace('/[^a-zA-Z0-9]/', '', $groupCode);
|
||||
$jsonFilePath = $_SERVER['DOCUMENT_ROOT'] . "/output/qc_json/" . $safeGroupCode . ".json";
|
||||
|
||||
// 파일 존재 여부 확인 후 삭제 시도
|
||||
if (file_exists($jsonFilePath)) {
|
||||
if (unlink($jsonFilePath)) {
|
||||
echo json_encode(['success' => true, 'message' => 'JSON File deleted', 'safeGroupCode' => $safeGroupCode ]);
|
||||
} else {
|
||||
http_response_code(500);
|
||||
echo json_encode(['success' => false, 'message' => 'JSON 파일 삭제에 실패했습니다.']);
|
||||
}
|
||||
} else {
|
||||
// 파일이 없는 경우에도 성공 메시지 전송
|
||||
echo json_encode(['success' => true, 'message' => 'Dont exist JSON ', 'safeGroupCode' => $safeGroupCode ]);
|
||||
}
|
||||
?>
|
||||
21
output/delete_ripple.php
Normal file
21
output/delete_ripple.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
$num=$_REQUEST["num"];
|
||||
$page=$_REQUEST["page"];
|
||||
$ripple_num=$_REQUEST["ripple_num"];
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "delete from chandj.work_ripple where num = ?"; //db만 수정
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$ripple_num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
header("Location:/as/view.php?num=$num&page=$page");
|
||||
} catch (Exception $ex) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
343
output/delivery.php
Normal file
343
output/delivery.php
Normal file
@@ -0,0 +1,343 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
|
||||
include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php';
|
||||
|
||||
$title_message = '경동기업 화물택배';
|
||||
$tablename = 'output';
|
||||
|
||||
?>
|
||||
|
||||
<style>
|
||||
.smallfont {
|
||||
border: 0.5px solid #ccc !important; /* 가늘고 옅은 회색 테두리 */
|
||||
font-size: 11px !important;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
table, th {
|
||||
border: 1px solid #ccc !important; /* 가늘고 옅은 회색 테두리 */
|
||||
font-size: 13px !important;
|
||||
padding : 0px;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body {
|
||||
width: 210mm; /* Approx width of A4 paper */
|
||||
height: 297mm; /* Height of A4 paper */
|
||||
margin: 5mm; /* Provide a margin */
|
||||
font-size: 10pt; /* Reduce font size for printing */
|
||||
}
|
||||
.table th, .table td {
|
||||
padding: 1px; /* Reduce padding */
|
||||
}
|
||||
.text-center {
|
||||
text-align: center; /* Maintain center alignment */
|
||||
}
|
||||
}
|
||||
|
||||
td {
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border: 1px solid #ccc !important; /* 가늘고 옅은 회색 테두리 */
|
||||
font-size: 13px !important;
|
||||
padding-left: 1px; /* 좌측 여백 */
|
||||
padding-right: 1px; /* 우측 여백 */
|
||||
}
|
||||
|
||||
|
||||
input[type="checkbox"] {
|
||||
transform: scale(1.2); /* 크기를 1.5배로 확대 */
|
||||
}
|
||||
|
||||
.pagebreak { page-break-before: always; }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<title> <?=$title_message?> </title>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
$today_short = iconv_substr($currentDate, 5, 5, "utf-8");
|
||||
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null ) {
|
||||
$fromdate = date("Y-m-d", strtotime($currentDate)); // 오늘날짜
|
||||
}
|
||||
|
||||
if ( $todate === "" || $todate === null) {
|
||||
$todate = $currentDate; // 현재 날짜
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
|
||||
|
||||
$now = date("Y-m-d"); // 현재일자 변수지정
|
||||
|
||||
// 납기일(deadline)이 오늘 자정부터 미래인 경우를 조건으로 설정
|
||||
$common = " WHERE outdate between '$fromdate' and '$Transtodate' and is_deleted ='0' ";
|
||||
|
||||
$sql = "select * from " . $DB . "." . $tablename . " " . $common;
|
||||
|
||||
$nowday=date("Y-m-d"); // 현재일자 변수지정
|
||||
$counter=1;
|
||||
|
||||
$sum=array();
|
||||
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
|
||||
<div class="container mt-2">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-center justify-content-end mt-1 m-2">
|
||||
<button type="button" class="btn btn-dark btn-sm mx-3" onclick='location.reload();' title="새로고침"> <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" onclick="generateExcel();"> Excel 저장 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" onclick="generatePDF();"> PDF 저장 </button>
|
||||
<button type="button" class="btn btn-secondary btn-sm" onclick="self.close();" > <i class="bi bi-x-lg"></i> 닫기 </button>
|
||||
</div>
|
||||
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-center align-items-center">
|
||||
<!-- 기간부터 검색까지 연결 묶음 start -->
|
||||
|
||||
<button type="button" id="premonth" class="btn btn-dark btn-sm me-1 change_dateRange" onclick='yesterday()' > 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1 change_dateRange" onclick='this_today()' > 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1 change_dateRange" onclick='this_tomorrow()' > 익일 </button>
|
||||
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>" > ~
|
||||
<input type="date" id="todate" name="todate" class="form-control" style="width:100px;" value="<?=$todate?>" > </span>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm" > <i class="bi bi-search"></i> 검색 </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="content-to-print">
|
||||
<div class="container-fluid mt-2">
|
||||
<div class="d-flex align-items-center justify-content-center mt-2 mb-2 ">
|
||||
<h3 > 금일(<?=$today_short?>) 출고(화물,택배) 발송처 : (주)경동기업 </h3>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-center mb-1 ">
|
||||
<table class="table table-hover" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center align-middle" style="width:50px;"> <input type="checkbox" id="selectAll"></th>
|
||||
<th class="text-center align-middle" style="width:150px;" >경동/대신</th>
|
||||
<th class="text-center align-middle" style="width:150px;" >우편번호</th>
|
||||
<th class="text-center align-middle" style="width:180px;" >도착영업소</th>
|
||||
<th class="text-center align-middle" style="width:150px;">받는분</th>
|
||||
<th class="text-center align-middle" style="width:150px;">전화번호</th>
|
||||
<th class="text-center align-middle" style="width:150px;">기타<br>전화번호 </th>
|
||||
<th class="text-center align-middle" style="width:300px;">주소 </th>
|
||||
<th class="text-center align-middle" style="display:none;">상세주소 </th>
|
||||
<th class="text-center align-middle" style="width:100px;"> 품목명 </th>
|
||||
<th class="text-center align-middle" style="width:100px;">수량</th>
|
||||
<th class="text-center align-middle" style="width:150px;">포장상태</th>
|
||||
<th class="text-center align-middle" style="width:150px;">개별단가(만원)</th>
|
||||
<th class="text-center align-middle" style="width:150px;" > 배송구분</th>
|
||||
<th class="text-center align-middle" style="width:100px;" > 운임</th>
|
||||
<th class="text-center align-middle" style="display:none;"> 별도운임</th>
|
||||
<th class="text-center align-middle" style="display:none;"> 기타운임</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
|
||||
try {
|
||||
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$rowNum = $stmh->rowCount();
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
include '_row.php';
|
||||
|
||||
if (strpos($delivery, '경동') !== false || strpos($delivery, '대신') !== false) {
|
||||
print '<tr>';
|
||||
print ' <td class="text-center align-middle" style="white-space: nowrap;"><input type="checkbox" class="row-checkbox" name="recordIds[]" value="' . $num . '"></td>';
|
||||
print ' <td class="text-center align-middle" style="white-space: nowrap;">' . htmlspecialchars($delivery) . ' </td>';
|
||||
print ' <td class="text-center align-middle" style="white-space: nowrap;"> </td>';
|
||||
print ' <td class="text-center align-middle" style="white-space: nowrap;"> </td>';
|
||||
print ' <td class="text-center align-middle" style="white-space: nowrap;">' . htmlspecialchars($receiver) . ' </td>';
|
||||
print ' <td class="text-center align-middle" style="white-space: nowrap;">' . htmlspecialchars($phone) . ' </td>';
|
||||
print ' <td class="text-center align-middle" style="white-space: nowrap;"> </td>';
|
||||
print ' <td class="text-start align-middle" style="white-space: nowrap;">' . htmlspecialchars($outputplace) . ' </td>';
|
||||
print ' <td class="text-start align-middle" style="display:none; white-space: nowrap;"> </td>';
|
||||
print ' <td class="text-center align-middle" style="white-space: nowrap;"> </td>';
|
||||
print ' <td class="text-center align-middle" style="white-space: nowrap;"> </td>';
|
||||
print ' <td class="text-center align-middle" style="white-space: nowrap;"> </td>';
|
||||
print ' <td class="text-center align-middle" style="white-space: nowrap;"> </td>';
|
||||
print ' <td class="text-center align-middle" style="white-space: nowrap;"> </td>';
|
||||
print ' <td class="text-center align-middle" style="white-space: nowrap;"> </td>';
|
||||
print ' <td class="text-center align-middle" style="display:none; white-space: nowrap;"> </td>';
|
||||
print ' <td class="text-center align-middle" style="display:none; white-space: nowrap;"> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
$counter++;
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- end of content-to-print -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- 페이지로딩 -->
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function generatePDF() {
|
||||
var d = new Date();
|
||||
var currentDate = ( d.getMonth() + 1 ) + "-" + d.getDate() + "_" ;
|
||||
var currentTime = d.getHours() + "_" + d.getMinutes() +"_" + d.getSeconds() ;
|
||||
var result = '경동기업 화물택배 ' + currentDate + currentTime + '.pdf';
|
||||
|
||||
var element = document.getElementById('content-to-print');
|
||||
var opt = {
|
||||
margin: 0,
|
||||
filename: result,
|
||||
image: { type: 'jpeg', quality: 0.98 },
|
||||
html2canvas: { scale: 2 },
|
||||
// jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
|
||||
jsPDF: { unit: 'in', format: 'letter', orientation: 'landscape' } // 가로방향
|
||||
|
||||
};
|
||||
html2pdf().from(element).set(opt).save();
|
||||
|
||||
showMsgModal(10) ; // 다운로드 후 ctrl+j 안내함
|
||||
setTimeout(function() {
|
||||
hideMsgModal();
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
|
||||
function SearchEnter(){
|
||||
|
||||
if(event.keyCode == 13){
|
||||
saveSearch();
|
||||
}
|
||||
}
|
||||
|
||||
function saveSearch() {
|
||||
|
||||
document.getElementById('board_form').submit();
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#submitFormBtn").click(function(){ document.getElementById('board_form').submit(); }); // refresh
|
||||
$("#labelBtn").click(function(){
|
||||
var url = "label_tag.php";
|
||||
customPopup(url, '라벨인쇄', 1400, 900);
|
||||
}); // refresh
|
||||
$('#selectAll').click(function() {
|
||||
var isChecked = $(this).prop('checked');
|
||||
$('.row-checkbox').prop('checked', isChecked);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function generateExcel() {
|
||||
var table = document.getElementById('myTable');
|
||||
var rows = table.getElementsByTagName('tr');
|
||||
var data = [];
|
||||
|
||||
// 각 행을 반복하여 데이터 수집
|
||||
for (var i = 1; i < rows.length; i++) { // 헤더 행을 건너뜀
|
||||
var cells = rows[i].getElementsByTagName('td');
|
||||
var checkbox = cells[0].querySelector('input');
|
||||
|
||||
if (checkbox && checkbox.checked) { // 체크박스가 체크된 경우에만 데이터 수집
|
||||
var rowData = {};
|
||||
rowData['checkbox'] = checkbox.checked;
|
||||
rowData['delivery'] = cells[1].innerText;
|
||||
rowData['postalCode'] = cells[2].innerText;
|
||||
rowData['office'] = cells[3].innerText;
|
||||
rowData['receiver'] = cells[4].innerText;
|
||||
rowData['phone'] = cells[5].innerText;
|
||||
rowData['otherPhone'] = cells[6].innerText;
|
||||
rowData['address'] = cells[7].innerText;
|
||||
rowData['address1'] = cells[8].innerText;
|
||||
rowData['item'] = cells[9].innerText;
|
||||
rowData['quantity'] = cells[10].innerText;
|
||||
rowData['packaging'] = cells[11].innerText;
|
||||
rowData['unitPrice'] = cells[12].innerText;
|
||||
rowData['shippingType'] = cells[13].innerText;
|
||||
rowData['freight'] = cells[14].innerText;
|
||||
rowData['freight1'] = cells[15].innerText;
|
||||
rowData['freight2'] = cells[16].innerText;
|
||||
|
||||
data.push(rowData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// saveExcel.php에 데이터 전송
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "saveExcel.php", true);
|
||||
xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState == 4) {
|
||||
if (xhr.status == 200) {
|
||||
try {
|
||||
var response = JSON.parse(xhr.responseText);
|
||||
if (response.success) {
|
||||
console.log('Excel file generated successfully.');
|
||||
// 다운로드 스크립트로 리디렉션
|
||||
window.location.href = 'downloadExcel.php?filename=' + encodeURIComponent(response.filename.split('/').pop());
|
||||
} else {
|
||||
console.log('Failed to generate Excel file: ' + response.message);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('Error parsing response: ' + e.message + '\nResponse text: ' + xhr.responseText);
|
||||
}
|
||||
} else {
|
||||
console.log('Failed to generate Excel file: Server returned status ' + xhr.status);
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send(JSON.stringify(data));
|
||||
|
||||
showMsgModal(10) ; // 다운로드 후 ctrl+j 안내함
|
||||
setTimeout(function() {
|
||||
hideMsgModal();
|
||||
}, 2000);
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
178
output/dl_ex_deliveryfee.php
Normal file
178
output/dl_ex_deliveryfee.php
Normal file
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
// download_excel.php
|
||||
|
||||
// 에러 표시 설정 (개발 중에만 사용, 배포 시 비활성화 권장)
|
||||
ini_set('display_errors', 0); // 오류를 화면에 출력하지 않음
|
||||
ini_set('log_errors', 1);
|
||||
ini_set('error_log', '../error_log.txt'); // 에러 로그 파일 경로 설정
|
||||
error_reporting(E_ALL);
|
||||
|
||||
// JSON 응답 헤더 설정
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// JSON 응답을 쉽게 생성하기 위한 함수
|
||||
function sendResponse($success, $data = null, $message = '') {
|
||||
$response = ['success' => $success];
|
||||
if ($data !== null) {
|
||||
$response['filename'] = $data;
|
||||
}
|
||||
if ($message !== '') {
|
||||
$response['message'] = $message;
|
||||
}
|
||||
echo json_encode($response);
|
||||
exit;
|
||||
}
|
||||
|
||||
// 사용자 정의 에러 핸들러 설정 (모든 오류를 예외로 변환)
|
||||
set_error_handler(function($errno, $errstr, $errfile, $errline) {
|
||||
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
|
||||
});
|
||||
|
||||
try {
|
||||
// POST 요청인지 확인
|
||||
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
||||
sendResponse(false, null, '잘못된 요청 방법입니다.');
|
||||
}
|
||||
|
||||
// JSON으로 데이터 받기
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
|
||||
// JSON 디코딩 오류 및 데이터 유무 확인
|
||||
if (json_last_error() !== JSON_ERROR_NONE || empty($data)) {
|
||||
sendResponse(false, null, '유효하지 않은 데이터 형식이거나 데이터가 없습니다.');
|
||||
}
|
||||
|
||||
// PHPExcel 라이브러리 포함 (경로 확인 필요)
|
||||
$phpExcelPath = '../PHPExcel_1.8.0/Classes/PHPExcel.php';
|
||||
if (!file_exists($phpExcelPath)) {
|
||||
sendResponse(false, null, 'PHPExcel 라이브러리가 존재하지 않습니다. 경로를 확인하세요.');
|
||||
}
|
||||
require $phpExcelPath;
|
||||
|
||||
// 새로운 PHPExcel 객체 생성
|
||||
$objPHPExcel = new PHPExcel();
|
||||
$objPHPExcel->setActiveSheetIndex(0);
|
||||
$sheet = $objPHPExcel->getActiveSheet();
|
||||
|
||||
// 헤더 설정 (14개 컬럼)
|
||||
$headers = [
|
||||
'번호', '출고일', '현장명',
|
||||
'하차업체명', '상차지', '물류업체명',
|
||||
'차량톤수', '금 액', '부가세',
|
||||
'합계', '착/선불', '차량번호',
|
||||
'기사 연락처', '비고'
|
||||
];
|
||||
$col = 'A';
|
||||
foreach ($headers as $header) {
|
||||
$sheet->setCellValue($col . '1', $header);
|
||||
$col++;
|
||||
}
|
||||
|
||||
// 헤더 행에 음영 처리 추가 (예: 연한 회색 배경)
|
||||
$headerRange = 'A1:N1';
|
||||
$sheet->getStyle($headerRange)->getFill()->applyFromArray([
|
||||
'type' => PHPExcel_Style_Fill::FILL_SOLID,
|
||||
'startcolor' => [
|
||||
'rgb' => 'D3D3D3' // 연한 회색
|
||||
],
|
||||
]);
|
||||
|
||||
// 각 열의 너비 설정 (한글 문자 수 기준)
|
||||
$columnWidths = [
|
||||
'A' => 10, // 번호
|
||||
'B' => 15, // 출고일
|
||||
'C' => 30, // 현장명
|
||||
'D' => 20, // 하차업체명
|
||||
'E' => 20, // 상차지
|
||||
'F' => 20, // 물류업체명
|
||||
'G' => 15, // 차량톤수
|
||||
'H' => 15, // 금 액
|
||||
'I' => 15, // 부가세
|
||||
'J' => 15, // 합계
|
||||
'K' => 10, // 착/선불
|
||||
'L' => 20, // 차량번호
|
||||
'M' => 20, // 기사 연락처
|
||||
'N' => 30, // 비고
|
||||
];
|
||||
|
||||
foreach ($columnWidths as $column => $width) {
|
||||
$sheet->getColumnDimension($column)->setWidth($width);
|
||||
}
|
||||
|
||||
// 전체 데이터 범위를 가운데 정렬으로 설정
|
||||
$dataRange = 'A1:N' . (count($data) + 1);
|
||||
$sheet->getStyle($dataRange)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
||||
|
||||
// 특정 열의 데이터 정렬 설정
|
||||
// 전체 데이터를 좌측 정렬로 설정
|
||||
$dataRange = 'A2:N' . (count($data) + 1);
|
||||
$sheet->getStyle($dataRange)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
|
||||
|
||||
// 금액 관련 열 (H, I, J)만 우측 정렬로 변경
|
||||
$sheet->getStyle('H2:H' . (count($data) + 1))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
||||
$sheet->getStyle('I2:I' . (count($data) + 1))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
||||
$sheet->getStyle('J2:J' . (count($data) + 1))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
||||
|
||||
// 데이터 채우기
|
||||
$rowNumber = 2;
|
||||
foreach ($data as $row) {
|
||||
// 각 필드의 존재 여부 확인 및 기본값 설정
|
||||
$number = isset($row['번호']) ? $row['번호'] : '';
|
||||
$releaseDate = isset($row['출고일']) ? $row['출고일'] : '';
|
||||
$workplacename = isset($row['현장명']) ? $row['현장명'] : '';
|
||||
$unloadingCompany= isset($row['하차업체명']) ? $row['하차업체명'] : '';
|
||||
$loadingPlace = isset($row['상차지']) ? $row['상차지'] : '';
|
||||
$logisticsCompany= isset($row['물류업체명']) ? $row['물류업체명'] : '';
|
||||
$vehicleTon = isset($row['차량톤수']) ? $row['차량톤수'] : '';
|
||||
$amount = isset($row['금 액']) ? $row['금 액'] : '';
|
||||
$tax = isset($row['부가세']) ? $row['부가세'] : '';
|
||||
$total = isset($row['합계']) ? $row['합계'] : '';
|
||||
$paymentMethod = isset($row['착/선불']) ? $row['착/선불'] : '';
|
||||
$vehicleNumber = isset($row['차량번호']) ? $row['차량번호'] : '';
|
||||
$driverContact = isset($row['기사 연락처']) ? $row['기사 연락처'] : '';
|
||||
$remarks = isset($row['비고']) ? $row['비고'] : '';
|
||||
|
||||
// 데이터 삽입
|
||||
$sheet->setCellValue("A{$rowNumber}", $number);
|
||||
$sheet->setCellValue("B{$rowNumber}", $releaseDate);
|
||||
$sheet->setCellValue("C{$rowNumber}", $workplacename);
|
||||
$sheet->setCellValue("D{$rowNumber}", $unloadingCompany);
|
||||
$sheet->setCellValue("E{$rowNumber}", $loadingPlace);
|
||||
$sheet->setCellValue("F{$rowNumber}", $logisticsCompany);
|
||||
$sheet->setCellValue("G{$rowNumber}", $vehicleTon);
|
||||
$sheet->setCellValue("H{$rowNumber}", $amount);
|
||||
$sheet->setCellValue("I{$rowNumber}", $tax);
|
||||
$sheet->setCellValue("J{$rowNumber}", $total);
|
||||
$sheet->setCellValue("K{$rowNumber}", $paymentMethod);
|
||||
$sheet->setCellValue("L{$rowNumber}", $vehicleNumber);
|
||||
$sheet->setCellValue("M{$rowNumber}", $driverContact);
|
||||
$sheet->setCellValue("N{$rowNumber}", $remarks);
|
||||
|
||||
$rowNumber++;
|
||||
}
|
||||
|
||||
// 엑셀 파일 저장 경로 설정
|
||||
$filename = 'deliveryfee_' . date('YmdHis') . '.xlsx';
|
||||
$filePath = '../excelsave/' . $filename;
|
||||
|
||||
// PHPExcel Writer 설정
|
||||
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
|
||||
|
||||
// 엑셀 파일 저장
|
||||
$objWriter->save($filePath);
|
||||
|
||||
// 파일이 정상적으로 저장되었는지 확인
|
||||
if (file_exists($filePath)) {
|
||||
sendResponse(true, $filePath, '');
|
||||
} else {
|
||||
sendResponse(false, null, '엑셀 파일을 저장하지 못했습니다.');
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
// 에러 로그에 기록
|
||||
error_log($e->getMessage());
|
||||
|
||||
// JSON 응답으로 에러 메시지 전송
|
||||
sendResponse(false, null, '엑셀 파일 생성 중 오류가 발생했습니다: ' . $e->getMessage());
|
||||
}
|
||||
?>
|
||||
25
output/downloadExcel.php
Normal file
25
output/downloadExcel.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
// 파일 이름이 제공되었는지 확인
|
||||
if (!isset($_GET['filename']) || empty($_GET['filename'])) {
|
||||
die('Filename not specified.');
|
||||
}
|
||||
|
||||
$filename = basename($_GET['filename']);
|
||||
$filePath = '/chandj/www/excelsave/' . $filename;
|
||||
|
||||
// 파일이 존재하는지 확인
|
||||
if (!file_exists($filePath)) {
|
||||
die('File not found.');
|
||||
}
|
||||
|
||||
// 파일을 다운로드하도록 설정
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Disposition: attachment; filename=' . $filename);
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
header('Content-Length: ' . filesize($filePath));
|
||||
readfile($filePath);
|
||||
exit;
|
||||
?>
|
||||
756
output/estimateUnit.php
Normal file
756
output/estimateUnit.php
Normal file
@@ -0,0 +1,756 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
|
||||
if(!isset($_SESSION["level"]) || $_SESSION["level"]>5) {
|
||||
sleep(1);
|
||||
header("Location:" . $WebSite . "login/login_form.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php';
|
||||
|
||||
// 첫 화면 표시 문구
|
||||
$title_message = '견적 단가 관리';
|
||||
?>
|
||||
|
||||
<title> <?=$title_message?> </title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
$option = isset($_REQUEST['option']) ? $_REQUEST['option'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$header = isset($_REQUEST['header']) ? $_REQUEST['header'] : '';
|
||||
|
||||
$tablename = 'estimate_units';
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$num = isset($_REQUEST["num"]) ? $_REQUEST["num"] : 0;
|
||||
|
||||
$csv_data = [
|
||||
["스크린", "실리카", "33000", ""],
|
||||
["스크린", "와이어", "33000", ""],
|
||||
["슬랫", "환봉", "2000", ""],
|
||||
["모터", "KD-150", "285000", ""],
|
||||
["모터", "KD-300", "300000", ""],
|
||||
];
|
||||
|
||||
if($num > 0) {
|
||||
try {
|
||||
$sql = "SELECT * FROM ". $DB . "." . $tablename . " WHERE num=?";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $num, PDO::PARAM_INT);
|
||||
$stmh->execute();
|
||||
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC);
|
||||
include '_row.php';
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
if($option !=='add') {
|
||||
$mode = 'update';
|
||||
} else {
|
||||
$mode = 'insert';
|
||||
$item_name = '';
|
||||
$price = '';
|
||||
$title_message = '견적 단가 추가화면';
|
||||
|
||||
$parentnum = $num;
|
||||
$secondordnum = $num;
|
||||
}
|
||||
} else {
|
||||
include '_request.php';
|
||||
|
||||
$mode = 'insert';
|
||||
$item_name = '';
|
||||
$price = '';
|
||||
$note = '';
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>견적 단가 관리</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<style>
|
||||
input[type="text"] {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
}
|
||||
.table th, .table td {
|
||||
text-align: center;
|
||||
}
|
||||
.card {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="row justify-content-center align-items-center ">
|
||||
<div class="card align-middle " style="width: 55rem;">
|
||||
<div class="card-body text-center">
|
||||
<div class="row d-flex justify-content-center align-items-center mb-3" >
|
||||
<div class="col-sm-1" >
|
||||
<div class="d-flex p-1 mb-1 justify-content-start align-items-center ">
|
||||
<?=$mode?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-9" >
|
||||
<div class="d-flex p-1 mb-1 justify-content-center align-items-center ">
|
||||
<h3> <?=$title_message?> </h3>
|
||||
<?php if($mode =='view') { ?>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" onclick="location.href='write_form.php?mode=modify&num=<?=$num?>&tablename=<?=$tablename?>';" > <ion-icon name="color-wand-outline"></ion-icon> 수정 </button>
|
||||
<button id="copyBtn" class="btn btn-primary btn-sm me-1" type="button"><i class="bi bi-copy"></i> 복사</button>
|
||||
<?php } ?>
|
||||
<?php if($mode!=='view') { ?>
|
||||
<button id="saveBtn" class="btn btn-dark btn-sm me-1 " type="button">
|
||||
<? if((int)$num>0) print ' <i class="bi bi-hdd-fill"></i> 저장'; else print ' <i class="bi bi-hdd-fill"></i> 저장'; ?></button>
|
||||
<? } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2" >
|
||||
<button type="button" class="btn btn-outline-dark btn-sm " onclick="self.close();" > <i class="bi bi-box-arrow-left"></i> 창닫기 </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-12 col-md-10">
|
||||
<div class="card">
|
||||
<div class="card-header bg-primary text-white text-center">
|
||||
스크린, 슬랫, 모터
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">스크린</th>
|
||||
<th colspan="2">슬랫</th>
|
||||
<th colspan="3">모터</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>실리카</th>
|
||||
<th>환봉</th>
|
||||
<th>본체</th>
|
||||
<th>조인트바</th>
|
||||
<th>검사비</th>
|
||||
<th style="width:160px;">모터세트</th>
|
||||
<th>받침앵글</th>
|
||||
<th>연동제어기</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><input type="text" class="form-control" name="silica" value="33,000"></td>
|
||||
<td><input type="text" class="form-control" name="round_bar" value="2,000"></td>
|
||||
<td><input type="text" class="form-control" name="body" value="45,000"></td>
|
||||
<td><input type="text" class="form-control" name="joint_bar" value="5,000"></td>
|
||||
<td><input type="text" class="form-control" name="inspection_fee" value="100,000"></td>
|
||||
<td class="fw-bold">KD-150</td>
|
||||
<td><input type="text" class="form-control" name="support_angle" value="285,000"></td>
|
||||
<td><input type="text" class="form-control" name="control_unit" value="130,000"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fw-bold"> 와이어</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">KD-300</td>
|
||||
<td><input type="text" class="form-control" name="support_angle_300" value="300,000"></td>
|
||||
<td class="fw-bold">매립뒷박스</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" class="form-control" name="silica_2" value="33,000"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">KD-400</td>
|
||||
<td><input type="text" class="form-control" name="support_angle_400" value="330,000"></td>
|
||||
<td><input type="text" class="form-control" name="angle" value="10,000"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">KD-500</td>
|
||||
<td><input type="text" class="form-control" name="support_angle_500" value="370,000"></td>
|
||||
<td class="fw-bold">앵글</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">KD-600</td>
|
||||
<td><input type="text" class="form-control" name="support_angle_600" value="380,000"></td>
|
||||
<td><input type="text" class="form-control" name="inspection_fee_600" value="3,000"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">KD-800</td>
|
||||
<td><input type="text" class="form-control" name="support_angle_800" value="550,000"></td>
|
||||
<td><input type="text" class="form-control" name="inspection_fee_800" value="4,000"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">KD-1000</td>
|
||||
<td><input type="text" class="form-control" name="support_angle_1000" value="600,000"></td>
|
||||
<td><input type="text" class="form-control" name="inspection_fee_1000" value="4,500"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">KD-1500</td>
|
||||
<td><input type="text" class="form-control" name="support_angle_1500" value="1,300,000"></td>
|
||||
<td><input type="text" class="form-control" name="inspection_fee_1500" value="5,000"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">방폭모터(1000K)삼상</td>
|
||||
<td><input type="text" class="form-control" name="explosion_proof_motor_price" value="3,300,000"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">방폭제어기</td>
|
||||
<td><input type="text" class="form-control" name="explosion_proof_control_price" value="1,200,000"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 두 번째 카드 시작 -->
|
||||
<div class="card">
|
||||
<div class="card-header bg-primary text-white text-center">
|
||||
가이드레일, 케이스(셔터박스), 하단마감재
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4">가이드레일</th>
|
||||
<th colspan="3">케이스(셔터박스)</th>
|
||||
<th colspan="5">하단마감재</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width:150px;">레일높이</th>
|
||||
<th style="width:200px;">레일자재</th>
|
||||
<th>레일자재</th>
|
||||
<th>연기차단재</th>
|
||||
<th style="width:150px;">사이즈</th>
|
||||
<th>케이스자재</th>
|
||||
<th>마구리</th>
|
||||
<th>연기차단재</th>
|
||||
<th style="width:150px;">마감</th>
|
||||
<th>하장바</th>
|
||||
<th>엘바</th>
|
||||
<th>보강평철</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>KSS01</td>
|
||||
<td class="fw-bold">벽면형120*70</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_2" value="69,780"></td>
|
||||
<td><input type="text" class="form-control" name="smoke_control_1" value="5,080"></td>
|
||||
<td class="fw-bold">500*350</td>
|
||||
<td><input type="text" class="form-control" name="case_material_1" value="54,837"></td>
|
||||
<td><input type="text" class="form-control" name="maguri_1" value="14,865"></td>
|
||||
<td><input type="text" class="form-control" name="smoke_control_2" value="8,590"></td>
|
||||
<td>KSS01</td>
|
||||
<td><input type="text" class="form-control" name="lower_finishing_1" value="12,276"></td>
|
||||
<td><input type="text" class="form-control" name="elbar_1" value="4,158"></td>
|
||||
<td><input type="text" class="form-control" name="reinforced_plate_1" value="1,100"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="fw-bold">측면형120*120</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_4" value="91,674"></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">500*380</td>
|
||||
<td><input type="text" class="form-control" name="case_material_2" value="56,457"></td>
|
||||
<td><input type="text" class="form-control" name="maguri_2" value="15,845"></td>
|
||||
<td></td>
|
||||
<td>KSE01, KWE01 <br> (EGI)</td>
|
||||
<td><input type="text" class="form-control" name="lower_finishing_2" value="5,346"></td>
|
||||
<td><input type="text" class="form-control" name="elbar_2" value="4,158"></td>
|
||||
<td><input type="text" class="form-control" name="reinforced_plate_2" value="1,100"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="fw-bold">혼합형</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_6" value="80,727"></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">650*500</td>
|
||||
<td><input type="text" class="form-control" name="case_material_3" value="71,739"></td>
|
||||
<td><input type="text" class="form-control" name="maguri_3" value="24,666"></td>
|
||||
<td></td>
|
||||
<td>KWE01 <br>(SUS별도마감)</td>
|
||||
<td><input type="text" class="form-control" name="lower_finishing_3" value="17,484"></td>
|
||||
<td><input type="text" class="form-control" name="elbar_3" value="4,158"></td>
|
||||
<td><input type="text" class="form-control" name="reinforced_plate_3" value="1,100"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KTE01<br>(SUS마감)</td>
|
||||
<td class="fw-bold">벽면형130*75</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_8" value="97,158"></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">650*550</td>
|
||||
<td><input type="text" class="form-control" name="case_material_4" value="74,439"></td>
|
||||
<td><input type="text" class="form-control" name="maguri_4" value="26,704"></td>
|
||||
<td></td>
|
||||
<td>KTE01<br>(EGI)</td>
|
||||
<td><input type="text" class="form-control" name="lower_finishing_4" value="5,805"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="fw-bold">측면형130*125</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_10" value="112,444"></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">700*550</td>
|
||||
<td><input type="text" class="form-control" name="case_material_5" value="77,139"></td>
|
||||
<td><input type="text" class="form-control" name="maguri_5" value="28,473"></td>
|
||||
<td></td>
|
||||
<td>KTE01<br>(SUS별도마감)</td>
|
||||
<td><input type="text" class="form-control" name="lower_finishing_5" value="13,761"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="fw-bold">혼합형</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_12" value="102,761"></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">700*600</td>
|
||||
<td><input type="text" class="form-control" name="case_material_6" value="79,839"></td>
|
||||
<td><input type="text" class="form-control" name="maguri_6" value="30,646"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KTE01<br>(EGI마감)</td>
|
||||
<td class="fw-bold">벽면형130*75</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_14" value="57,786"></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">780*600</td>
|
||||
<td><input type="text" class="form-control" name="case_material_7" value="84,159"></td>
|
||||
<td><input type="text" class="form-control" name="maguri_7" value="33,692"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="fw-bold">측면형130*125</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_16" value="72,766"></td>
|
||||
<td></td>
|
||||
<td class="fw-bold">780*650</td>
|
||||
<td><input type="text" class="form-control" name="case_material_8" value="86,859"></td>
|
||||
<td><input type="text" class="form-control" name="maguri_8" value="36,081"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="fw-bold">혼합형</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_18" value="65,276"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KWE01<br>(SUS마감)</td>
|
||||
<td class="fw-bold">벽면형120*70</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_20" value="79,952"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="fw-bold">측면형120*120</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_22" value="104,046"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="fw-bold">혼합형</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_24" value="91,999"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KWE01<br>(EGI마감)</td>
|
||||
<td class="fw-bold">벽면형120*70</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_26" value="45,884"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="fw-bold">측면형120*120</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_28" value="64,878"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="fw-bold">혼합형</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_30" value="55,381"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KSE01</td>
|
||||
<td class="fw-bold">벽면형120*70</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_32" value="45,884"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="fw-bold">측면형120*120</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_34" value="64,878"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="fw-bold">혼합형</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_36" value="55,381"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>와이드</td>
|
||||
<td class="fw-bold">벽면형180*70</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_38" value="88,500"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="fw-bold">측면형180*120</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_40" value="111,942"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="fw-bold">혼합형</td>
|
||||
<td><input type="text" class="form-control" name="rail_material_42" value="100,221"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 세 번째 카드 시작 -->
|
||||
<div class="card">
|
||||
<div class="card-header bg-primary text-white text-center">
|
||||
감기샤프트, 무게평철, 각파이프, 앵글
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">감기샤프트</th>
|
||||
<th rowspan="2">무게평철</th>
|
||||
<th rowspan="2">각파이프</th>
|
||||
<th rowspan="2">앵글</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width:200px;">인치</th>
|
||||
<th>메인</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="fw-bold">3인치-300</td>
|
||||
<td><input type="text" class="form-control" name="main_1" value="3,000"></td>
|
||||
<td class="fw-bold">12T-1000</td>
|
||||
<td class="fw-bold">50*30-3000</td>
|
||||
<td class="fw-bold">40*40*3T-2500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fw-bold">3인치-500</td>
|
||||
<td><input type="text" class="form-control" name="main_2" value="5,000"></td>
|
||||
<td><input type="text" class="form-control" name="weight_plate_1" value="6,500"></td>
|
||||
<td><input type="text" class="form-control" name="angle_pipe_1" value="7,000"></td>
|
||||
<td><input type="text" class="form-control" name="angle_1" value="17,000"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fw-bold">3인치-6000</td>
|
||||
<td><input type="text" class="form-control" name="main_3" value="43,000"></td>
|
||||
<td class="fw-bold">12T - 2000</td>
|
||||
<td class="fw-bold">50*30- 6000</td>
|
||||
<td class="fw-bold">50*50*4T-2500</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="fw-bold">4인치-3000</td>
|
||||
<td><input type="text" class="form-control" name="main_4" value="28,000"></td>
|
||||
<td><input type="text" class="form-control" name="weight_plate_2" value="12,000"></td>
|
||||
<td><input type="text" class="form-control" name="angle_pipe_2" value="14,000"></td>
|
||||
<td><input type="text" class="form-control" name="angle_2" value="24,000"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fw-bold">4인치-4500</td>
|
||||
<td><input type="text" class="form-control" name="main_5" value="41,000"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fw-bold">4인치-6000</td>
|
||||
<td><input type="text" class="form-control" name="main_6" value="55,000"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fw-bold">5인치-6000</td>
|
||||
<td><input type="text" class="form-control" name="main_7" value="90,000"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fw-bold">5인치-7000</td>
|
||||
<td><input type="text" class="form-control" name="main_8" value="105,000"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fw-bold">5인치-8200</td>
|
||||
<td><input type="text" class="form-control" name="main_9" value="122,000"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fw-bold">6인치-3000</td>
|
||||
<td><input type="text" class="form-control" name="main_10" value="48,000"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fw-bold">6인치-6000</td>
|
||||
<td><input type="text" class="form-control" name="main_11" value="107,000"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fw-bold">6인치-7000</td>
|
||||
<td><input type="text" class="form-control" name="main_12" value="124,000"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fw-bold">6인치-8000</td>
|
||||
<td><input type="text" class="form-control" name="main_13" value="142,000"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fw-bold">8인치-8200</td>
|
||||
<td><input type="text" class="form-control" name="main_14" value="265,000"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 페이지로딩 -->
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
// 숫자 입력 필드에 대한 3자리 콤마 처리
|
||||
document.querySelectorAll('input[type="text"]').forEach(function(input) {
|
||||
input.addEventListener('input', function(e) {
|
||||
var value = e.target.value.replace(/,/g, '');
|
||||
if (!isNaN(value) && value !== '') {
|
||||
e.target.value = parseInt(value).toLocaleString();
|
||||
} else {
|
||||
e.target.value = '';
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
94
output/fetch_certificate.php
Normal file
94
output/fetch_certificate.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
|
||||
header("Content-Type: application/json");
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$lotnum = isset($_POST['lotnum']) ? trim($_POST['lotnum']) : '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (empty($lotnum)) {
|
||||
echo json_encode(['success' => false, 'message' => '로트번호가 비어 있습니다.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
if (ctype_alpha($lotnum[0])) {
|
||||
// lot 테이블에서 데이터 가져오기 (영문자로 시작하는 경우)
|
||||
$stmt = $pdo->prepare("
|
||||
SELECT
|
||||
num, lot_number, prod, spec, remark
|
||||
FROM
|
||||
{$DB}.lot
|
||||
WHERE
|
||||
lot_number = :lotnum
|
||||
AND (is_deleted IS NULL OR is_deleted = 0 OR is_deleted = '')
|
||||
");
|
||||
$stmt->bindParam(':lotnum', $lotnum);
|
||||
$stmt->execute();
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($row) {
|
||||
echo json_encode([
|
||||
'success' => true,
|
||||
'item' => 'offering',
|
||||
'num' => htmlspecialchars($row['num']),
|
||||
'lot_number' => htmlspecialchars($row['lot_number']),
|
||||
'prod' => htmlspecialchars($row['prod']),
|
||||
'spec' => htmlspecialchars($row['spec']),
|
||||
'remark' => htmlspecialchars($row['remark']),
|
||||
]);
|
||||
} else {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => '해당 제공품 정보를 찾을 수 없습니다.'
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
// instock 테이블에서 데이터 가져오기
|
||||
$stmt = $pdo->prepare("
|
||||
SELECT
|
||||
num,
|
||||
item_name AS itemname,
|
||||
specification AS spec,
|
||||
remarks
|
||||
FROM
|
||||
{$DB}.instock
|
||||
WHERE
|
||||
lot_no = :lot_no
|
||||
AND (is_deleted IS NULL OR is_deleted = 0 OR is_deleted = '')
|
||||
");
|
||||
$stmt->bindParam(':lot_no', $lotnum);
|
||||
$stmt->execute();
|
||||
$certificate = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($certificate) {
|
||||
echo json_encode([
|
||||
'success' => true,
|
||||
'item' => 'regular',
|
||||
'num' => htmlspecialchars($certificate['num']),
|
||||
'itemname' => htmlspecialchars($certificate['itemname']),
|
||||
'specification' => htmlspecialchars($certificate['spec']),
|
||||
'remarks' => htmlspecialchars($certificate['remarks']),
|
||||
]);
|
||||
} else {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => '해당 로트번호의 성적서를 찾을 수 없습니다.'
|
||||
]);
|
||||
}
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => '데이터베이스 오류: ' . $e->getMessage()
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => '잘못된 요청입니다.'
|
||||
]);
|
||||
}
|
||||
39
output/fetch_date.php
Normal file
39
output/fetch_date.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$month = $_POST['month'];
|
||||
$year = $_POST['year'];
|
||||
$dateType = $_POST['dateType']; // 'outdate'
|
||||
|
||||
$data_order = array();
|
||||
|
||||
try {
|
||||
$stmh = $pdo->prepare("SELECT num, con_num, outdate, indate, outworkplace, orderman, outputplace, receiver, phone, comment, root, steel, motor, delivery, regist_state, bend_state, motor_state, searchtag, update_log, screen, screen_state, screen_su, screen_m2, screenlist, slatlist, slat, slat_state, slat_su, slat_m2, updatecomment, secondord
|
||||
FROM " . $DB . ".output
|
||||
WHERE (is_deleted IS NULL or is_deleted = '0') and (devMode <> '1' OR devMode IS NULL)
|
||||
AND MONTH($dateType) = :month
|
||||
AND YEAR($dateType) = :year");
|
||||
|
||||
$stmh->bindValue(':month', $month);
|
||||
$stmh->bindValue(':year', $year);
|
||||
$stmh->execute();
|
||||
|
||||
while ($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
array_push($data_order, $row);
|
||||
}
|
||||
|
||||
$data_order = array(
|
||||
"data_order" => $data_order,
|
||||
"month" => $month,
|
||||
"dateType" => $dateType,
|
||||
"year" => $year
|
||||
);
|
||||
|
||||
echo json_encode($data_order, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
56
output/fetch_deliveryfee.php
Normal file
56
output/fetch_deliveryfee.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$search = $_POST['search'] ?? ''; // POST로 전달된 검색어, 기본값은 빈 문자열
|
||||
|
||||
// Assuming $DB is defined in mydb.php or session.php
|
||||
if (!isset($DB)) {
|
||||
$DB = 'chandj'; // 실제 데이터베이스 이름으로 대체하세요.
|
||||
}
|
||||
|
||||
try {
|
||||
// 검색어가 없을 경우 전체 목록을 가져옴
|
||||
if ($search === '') {
|
||||
// 전체 목록을 가져오는 SQL
|
||||
$sql = "SELECT item_name, unit, spec
|
||||
FROM {$DB}.price_etc
|
||||
WHERE is_deleted IS NULL OR is_deleted = '0'";
|
||||
} else {
|
||||
// 검색어가 있을 경우 해당 검색어를 기준으로 검색한 SQL
|
||||
$sql = "SELECT item_name, unit, spec
|
||||
FROM {$DB}.price_etc
|
||||
WHERE (is_deleted IS NULL OR is_deleted = '0')
|
||||
AND item_name LIKE :search";
|
||||
}
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
|
||||
if ($search !== '') {
|
||||
// 검색어가 있는 경우만 바인딩
|
||||
$searchTerm = '%' . $search . '%';
|
||||
$stmh->bindParam(':search', $searchTerm, PDO::PARAM_STR);
|
||||
}
|
||||
|
||||
$stmh->execute();
|
||||
$output_rows = $stmh->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
// 데이터가 존재하면 그대로 반환
|
||||
if ($output_rows) {
|
||||
// 결과를 JSON으로 출력
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($output_rows);
|
||||
} else {
|
||||
// 데이터가 없으면 빈 배열 반환
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode([]);
|
||||
}
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
// 오류가 발생하면 JSON으로 오류 메시지 반환
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(["error" => $Exception->getMessage()]);
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
53
output/fetch_estimate.php
Normal file
53
output/fetch_estimate.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$search = $_POST['search'] ?? ''; // 검색어 (없으면 빈 문자열)
|
||||
$whichItem = $_POST['whichItem'] ?? ''; // 스크린, 스라트
|
||||
|
||||
if (!isset($DB)) {
|
||||
$DB = 'chandj'; // 실제 데이터베이스 이름으로 설정
|
||||
}
|
||||
|
||||
try {
|
||||
// 1. 테이블의 컬럼 목록 가져오기
|
||||
$columnQuery = $pdo->query("SHOW COLUMNS FROM {$DB}.estimate");
|
||||
$columns = $columnQuery->fetchAll(PDO::FETCH_COLUMN);
|
||||
|
||||
// 2. 기본 WHERE 조건 설정 (major_category 필터 적용)
|
||||
$conditions = ["major_category = :whichItem"];
|
||||
$bindParams = [":whichItem" => $whichItem];
|
||||
|
||||
// 3. 검색어가 있는 경우, 전체 컬럼에서 LIKE 검색 적용
|
||||
if (!empty($search)) {
|
||||
$searchConditions = [];
|
||||
foreach ($columns as $index => $column) {
|
||||
$paramName = ":search" . $index; // 유니크한 바인딩 변수 생성 (:search0, :search1, ...)
|
||||
$searchConditions[] = "$column LIKE $paramName";
|
||||
$bindParams[$paramName] = "%{$search}%";
|
||||
}
|
||||
$conditions[] = "(" . implode(" OR ", $searchConditions) . ")";
|
||||
}
|
||||
|
||||
// 4. 최종 SQL 쿼리 구성
|
||||
$sql = "SELECT * FROM {$DB}.estimate WHERE " . implode(" AND ", $conditions) . " AND (is_deleted IS NULL or is_deleted ='0') ORDER BY indate DESC";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
|
||||
// 5. 1:1 바인딩 적용 (PHP 7.3 호환)
|
||||
foreach ($bindParams as $key => $val) {
|
||||
$stmh->bindValue($key, $val, PDO::PARAM_STR);
|
||||
}
|
||||
|
||||
$stmh->execute();
|
||||
$output_rows = $stmh->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
// JSON 출력
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($output_rows ?: []);
|
||||
} catch (PDOException $Exception) {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(["error" => $Exception->getMessage()]);
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
27
output/fetch_estimate_details.php
Normal file
27
output/fetch_estimate_details.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
|
||||
// Assuming $DB is defined in mydb.php or session.php
|
||||
if (!isset($DB)) {
|
||||
$DB = 'chandj'; // 실제 데이터베이스 이름으로 대체하세요.
|
||||
}
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$estimateId = $_POST['estimateId'];
|
||||
|
||||
try {
|
||||
$sql = "SELECT * FROM {$DB}.estimate WHERE num = :estimateId";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindParam(':estimateId', $estimateId, PDO::PARAM_INT);
|
||||
$stmh->execute();
|
||||
$estimateDetails = $stmh->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
// 데이터를 JSON 형식으로 반환
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($estimateDetails);
|
||||
} catch (PDOException $e) {
|
||||
echo json_encode(['error' => '데이터를 가져오는 중 오류가 발생했습니다: ' . $e->getMessage()]);
|
||||
}
|
||||
?>
|
||||
40
output/fetch_estimate_process.php
Normal file
40
output/fetch_estimate_process.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
|
||||
// Assuming $DB is defined in mydb.php or session.php
|
||||
if (!isset($DB)) {
|
||||
$DB = 'chandj'; // 실제 데이터베이스 이름으로 대체하세요.
|
||||
}
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// estimateIdList가 배열로 전달되는지 확인
|
||||
$estimateIdList = $_POST['estimateIdList'];
|
||||
|
||||
if (is_array($estimateIdList)) {
|
||||
try {
|
||||
// estimateIdList 내의 ID들을 사용하여 데이터베이스에서 일치하는 항목을 모두 가져옴
|
||||
$inQuery = implode(',', array_fill(0, count($estimateIdList), '?'));
|
||||
$sql = "SELECT num, pjnum, secondord, model_name, outworkplace, orderman, secondordmantel, estimateList, estimateSlatList, itemradio
|
||||
FROM {$DB}.estimate WHERE num IN ($inQuery) AND (is_deleted IS NULL or is_deleted ='0') ";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
|
||||
// 각 ID를 바인딩
|
||||
foreach ($estimateIdList as $index => $id) {
|
||||
$stmh->bindValue(($index+1), $id, PDO::PARAM_INT);
|
||||
}
|
||||
|
||||
$stmh->execute();
|
||||
$estimateDetails = $stmh->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
// 데이터를 JSON 형식으로 반환
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($estimateDetails);
|
||||
} catch (PDOException $e) {
|
||||
echo json_encode(['error' => '데이터를 가져오는 중 오류가 발생했습니다: ' . $e->getMessage()]);
|
||||
}
|
||||
} else {
|
||||
echo json_encode(['error' => '유효하지 않은 데이터 요청입니다.']);
|
||||
}
|
||||
?>
|
||||
56
output/fetch_etc.php
Normal file
56
output/fetch_etc.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$search = $_POST['search'] ?? ''; // POST로 전달된 검색어, 기본값은 빈 문자열
|
||||
|
||||
// Assuming $DB is defined in mydb.php or session.php
|
||||
if (!isset($DB)) {
|
||||
$DB = 'chandj'; // 실제 데이터베이스 이름으로 대체하세요.
|
||||
}
|
||||
|
||||
try {
|
||||
// 검색어가 없을 경우 전체 목록을 가져옴
|
||||
if ($search === '') {
|
||||
// 전체 목록을 가져오는 SQL
|
||||
$sql = "SELECT item_name, unit, spec
|
||||
FROM {$DB}.price_etc
|
||||
WHERE is_deleted IS NULL OR is_deleted = '0'";
|
||||
} else {
|
||||
// 검색어가 있을 경우 해당 검색어를 기준으로 검색한 SQL
|
||||
$sql = "SELECT item_name, unit, spec
|
||||
FROM {$DB}.price_etc
|
||||
WHERE (is_deleted IS NULL OR is_deleted = '0')
|
||||
AND item_name LIKE :search";
|
||||
}
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
|
||||
if ($search !== '') {
|
||||
// 검색어가 있는 경우만 바인딩
|
||||
$searchTerm = '%' . $search . '%';
|
||||
$stmh->bindParam(':search', $searchTerm, PDO::PARAM_STR);
|
||||
}
|
||||
|
||||
$stmh->execute();
|
||||
$output_rows = $stmh->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
// 데이터가 존재하면 그대로 반환
|
||||
if ($output_rows) {
|
||||
// 결과를 JSON으로 출력
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($output_rows);
|
||||
} else {
|
||||
// 데이터가 없으면 빈 배열 반환
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode([]);
|
||||
}
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
// 오류가 발생하면 JSON으로 오류 메시지 반환
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(["error" => $Exception->getMessage()]);
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
58
output/fetch_item_info.php
Normal file
58
output/fetch_item_info.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
// fetch_item_info.php
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . '/session.php');
|
||||
if (!isset($_SESSION['level']) || $_SESSION['level'] > 5) {
|
||||
// 권한 없음
|
||||
echo json_encode(['success' => false, 'message' => '권한이 없습니다.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . '/lib/mydb.php');
|
||||
$pdo = db_connect();
|
||||
|
||||
// GET 파라미터에서 prodcode 추출
|
||||
$prodcode = trim($_GET['prodcode'] ?? '');
|
||||
if ($prodcode === '') {
|
||||
echo json_encode(['success' => false, 'message' => '품목코드를 입력해주세요.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
global $DB;
|
||||
// 단가 테이블에서 해당 prodcode 조회
|
||||
$sql = "
|
||||
SELECT
|
||||
item_name,
|
||||
spec,
|
||||
unitprice
|
||||
FROM {$DB}.KDunitprice
|
||||
WHERE prodcode = :prodcode
|
||||
AND is_deleted IS NULL
|
||||
LIMIT 1
|
||||
";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute([':prodcode' => $prodcode]);
|
||||
|
||||
if ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
// 정상 조회
|
||||
echo json_encode([
|
||||
'success' => true,
|
||||
'item_name' => $row['item_name'],
|
||||
'spec' => $row['spec'],
|
||||
'unitprice' => (float)$row['unitprice']
|
||||
]);
|
||||
} else {
|
||||
// 조회 결과 없음
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => '해당 품목코드를 찾을 수 없습니다.'
|
||||
]);
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
// DB 오류 처리
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => 'DB 오류: ' . $e->getMessage()
|
||||
]);
|
||||
}
|
||||
97
output/fetch_lot.php
Normal file
97
output/fetch_lot.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
|
||||
$pdo = db_connect();
|
||||
|
||||
$item_name = isset($_POST['item_name']) ? trim($_POST['item_name']) : '';
|
||||
$tablename = 'instock';
|
||||
|
||||
if (empty($item_name)) {
|
||||
echo '<div class="alert alert-danger">품목명이 없습니다.</div>';
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
// 로트 번호를 품목명에 따라 조회
|
||||
$sql = "SELECT num, lot_no, received_qty, supplier,prodcode, inspection_date
|
||||
FROM {$DB}.instock
|
||||
WHERE item_name LIKE :item_name AND is_deleted IS NULL AND lotDone IS NULL
|
||||
ORDER BY inspection_date DESC, lot_no ASC
|
||||
LIMIT 12";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(':item_name', "%$item_name%", PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$rows = $stmh->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if (count($rows) > 0) {
|
||||
echo '<div style="max-height: 400px; overflow-y: auto;">'; // 스크롤 컨테이너 시작
|
||||
echo '<table class="table table-hover">';
|
||||
echo '<thead class="table-primary">';
|
||||
echo '<tr>';
|
||||
echo '<th class="text-center">로트 번호</th>';
|
||||
echo '<th class="text-center">규격</th>';
|
||||
echo '<th class="text-center">길이(M)</th>';
|
||||
echo '<th class="text-center">납품업체</th>';
|
||||
echo '<th class="text-center">로트소진</th>';
|
||||
echo '</tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody id="lotModalBody">';
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$lot_no = htmlspecialchars($row['lot_no']);
|
||||
$received_qty = number_format((int)$row['received_qty']);
|
||||
$supplier = htmlspecialchars($row['supplier']);
|
||||
$inspection_date = htmlspecialchars($row['prodcode']);
|
||||
$num = htmlspecialchars($row['num']); // 추가: num 값을 가져옵니다.
|
||||
|
||||
if ($item_name == '내화실') {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_wire(\'' . $lot_no . '\')">' . $lot_no . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_wire(\'' . $lot_no . '\')">' . $inspection_date . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_wire(\'' . $lot_no . '\')">' . $received_qty . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_wire(\'' . $lot_no . '\')">' . $supplier . '</td>';
|
||||
// '소진' 버튼 추가
|
||||
echo '<td class="text-center">';
|
||||
echo '<button class="btn btn-sm btn-danger lot-done-wire-btn " data-num="' . $num . '" data-tablename="' . $tablename . '">소진</button>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
} else if ($item_name == '실리카원단' or $item_name == '와이어원단' or $item_name == '화이바원단') {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $lot_no . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $inspection_date . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $received_qty . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $supplier . '</td>';
|
||||
// '소진' 버튼 추가
|
||||
echo '<td class="text-center">';
|
||||
echo '<button class="btn btn-sm btn-danger lot-done-btn" data-num="' . $num . '" data-tablename="' . $tablename . '">소진</button>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
} else if ($item_name == '슬랫코일' ) {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $lot_no . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $inspection_date . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $received_qty . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $supplier . '</td>';
|
||||
// '소진' 버튼 추가
|
||||
echo '<td class="text-center">';
|
||||
echo '<button class="btn btn-sm btn-danger lot-done-btn" data-num="' . $num . '" data-tablename="' . $tablename . '">소진</button>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>'; // 스크롤 컨테이너 종료
|
||||
} else {
|
||||
echo '<div class="alert alert-warning">해당 품목명에 대한 로트 번호가 없습니다.</div>';
|
||||
}
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo '<div class="alert alert-danger">오류: ' . htmlspecialchars($e->getMessage()) . '</div>';
|
||||
}
|
||||
?>
|
||||
87
output/fetch_lot_COD.php
Normal file
87
output/fetch_lot_COD.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
|
||||
if(empty($DB))
|
||||
$DB = 'chandj';
|
||||
|
||||
$pdo = db_connect();
|
||||
|
||||
$item_name = isset($_POST['item_name']) ? trim($_POST['item_name']) : '';
|
||||
$tablename = 'instock';
|
||||
|
||||
$lot_type = $_POST['lot_type'];
|
||||
$usesurang = $_POST['usesurang'];
|
||||
|
||||
echo "품목 : " . $item_name . " 로트 ";
|
||||
|
||||
if (empty($item_name)) {
|
||||
echo '<div class="alert alert-danger">품목명이 없습니다.</div>';
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
// 로트 번호를 품목명에 따라 조회
|
||||
$sql = "select * FROM {$DB}.instock
|
||||
WHERE prodcode = :search AND (is_deleted IS NULL or is_deleted = '' ) AND (lotDone IS NULL or lotDone = '')
|
||||
ORDER BY inspection_date DESC, lot_no ASC limit 12 ";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(':search', $item_name , PDO::PARAM_STR); // 와일드카드 추가
|
||||
$stmh->execute();
|
||||
$rows = $stmh->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if (count($rows) > 0) {
|
||||
echo '<div style="max-height: 400px; overflow-y: auto;">'; // 스크롤 컨테이너 시작
|
||||
echo '<table class="table table-hover">';
|
||||
echo '<thead class="table-primary">';
|
||||
echo '<tr>';
|
||||
echo '<th class="text-center">로트 번호</th>';
|
||||
echo '<th class="text-center">품명 </th>';
|
||||
echo '<th class="text-center">규격 </th>';
|
||||
echo '<th class="text-center">품목코드 </th>';
|
||||
echo '<th class="text-center">입고량 </th>';
|
||||
echo '<th class="text-center">납품업체</th>';
|
||||
echo '<th class="text-center">검사일</th>';
|
||||
echo '<th class="text-center">로트소진</th>';
|
||||
echo '</tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody id="lotModalBody">';
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$lot_no = htmlspecialchars($row['lot_no']);
|
||||
$received_qty = number_format((int)$row['received_qty']);
|
||||
$supplier = htmlspecialchars($row['supplier']);
|
||||
$inspection_date = htmlspecialchars($row['inspection_date']);
|
||||
$num = htmlspecialchars($row['num']);
|
||||
$item_name = htmlspecialchars($row['item_name']);
|
||||
$specification = htmlspecialchars($row['specification']);
|
||||
$prodcode = htmlspecialchars($row['prodcode']);
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $lot_no . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $item_name . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $specification . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $prodcode . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $received_qty . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $supplier . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $inspection_date . '</td>';
|
||||
// '소진' 버튼 추가
|
||||
echo '<td class="text-center">';
|
||||
echo '<button type="button" class="btn btn-sm btn-danger lot-done-btn" data-num="' . $num . '" data-tablename="' . $tablename . '" data-item_name="' . $item_name . '" data-lottype="' . $lot_type . '" >소진</button>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>'; // 스크롤 컨테이너 종료
|
||||
} else {
|
||||
echo '<div class="alert alert-warning">해당 품목명에 대한 로트 번호가 없습니다. item_name : ' . $item_name . '</div>';
|
||||
}
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo '<div class="alert alert-danger">오류: ' . htmlspecialchars($e->getMessage()) . '</div>';
|
||||
}
|
||||
?>
|
||||
291
output/fetch_lot_bending.php
Normal file
291
output/fetch_lot_bending.php
Normal file
@@ -0,0 +1,291 @@
|
||||
<?php
|
||||
// 절곡일지 fetch 파일
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$item_name = isset($_POST['item_name']) ? trim($_POST['item_name']) : '';
|
||||
$Request_item_name = isset($_POST['item_name']) ? trim($_POST['item_name']) : '';
|
||||
$tablename = 'instock';
|
||||
|
||||
$lot_type = $_POST['lot_type'];
|
||||
$usesurang = $_POST['usesurang'];
|
||||
|
||||
|
||||
// 품목명을 매핑하는 배열
|
||||
$prodNames = [
|
||||
'R' => '가이드레일(벽면형)',
|
||||
'S' => '가이드레일(측면형)',
|
||||
'G' => '연기차단재',
|
||||
'B' => '하단마감재(스크린)',
|
||||
'T' => '하단마감재(철재)',
|
||||
'L' => 'L - Bar',
|
||||
'C' => '케이스'
|
||||
];
|
||||
|
||||
// 종류명을 매핑하는 배열
|
||||
$specNames = [
|
||||
'I' => '화이바원단',
|
||||
'S' => 'SUS(마감)',
|
||||
'U' => 'SUS(마감)2',
|
||||
'E' => 'EGI(마감)',
|
||||
'A' => '스크린용',
|
||||
'D' => 'D형',
|
||||
'C' => 'C형',
|
||||
'M' => '본체',
|
||||
'T' => '본체(철재)',
|
||||
'B' => '후면코너부',
|
||||
'L' => '린텔부',
|
||||
'P' => '점검구',
|
||||
'F' => '전면부'
|
||||
];
|
||||
|
||||
// 모양&길이를 매핑하는 배열
|
||||
$slengthNames = [
|
||||
'53' => 'W50 × 3000',
|
||||
'54' => 'W50 × 4000',
|
||||
'83' => 'W80 × 3000',
|
||||
'84' => 'W80 × 4000',
|
||||
'12' => '1219', // 1219 기장 철판이 없어서 2438 적용
|
||||
'24' => '2438',
|
||||
'30' => '3000',
|
||||
'35' => '3500',
|
||||
'40' => '4000',
|
||||
'41' => '4150',
|
||||
'42' => '4200',
|
||||
'43' => '4300'
|
||||
];
|
||||
|
||||
echo "찾는 형태: " . $lot_type . '<br>' ;
|
||||
|
||||
// 'SS-24' 값을 'S', 'S', '24'로 분리하여 검색 조건에 적용
|
||||
$prod_value = substr($item_name, 0, 1); // 첫 번째 'S'는 prod
|
||||
$spec_value = substr($item_name, 1, 1); // 두 번째 'S'는 spec
|
||||
$slength_value = substr($item_name, 3); // '24'는 slength
|
||||
|
||||
// echo $prod_value . ' ' . $spec_value . ' ' . $slength_value ;
|
||||
|
||||
if ($lot_type === 'product') {
|
||||
// 생산품 로트번호 조회 코드
|
||||
echo '<div class="alert alert-primary"> 생산품 : ' . $item_name . ' </div>';
|
||||
} elseif ($lot_type === 'material') {
|
||||
// 원자재 로트번호 조회 코드
|
||||
switch ($spec_value)
|
||||
{
|
||||
case 'S':
|
||||
if ($prod_value == 'B')
|
||||
$rawitemname = "SUS1.55T";
|
||||
else
|
||||
$rawitemname = "SUS1.2T";
|
||||
break;
|
||||
case 'X' or 'M' :
|
||||
$rawitemname = "EGI1.55T";
|
||||
break;
|
||||
case 'H' :
|
||||
$rawitemname = "EGI1.15T";
|
||||
break;
|
||||
case 'Y' :
|
||||
$rawitemname = "SUS1.2T";
|
||||
break;
|
||||
}
|
||||
echo "원자재 " . $rawitemname . " 로트 ";
|
||||
}
|
||||
|
||||
if (empty($item_name)) {
|
||||
echo '<div class="alert alert-danger">품목명이 없습니다.</div>';
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($lot_type === 'product') {
|
||||
try {
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM {$DB}.lot
|
||||
WHERE prod = :prod_value
|
||||
AND spec = :spec_value
|
||||
AND slength = :slength_value
|
||||
AND (is_deleted IS NULL OR is_deleted = '0')
|
||||
ORDER BY reg_date DESC
|
||||
LIMIT 12";
|
||||
|
||||
// SQL 쿼리 실행 시 바인딩할 값 설정
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->bindValue(':prod_value', $prod_value);
|
||||
$stmt->bindValue(':spec_value', $spec_value);
|
||||
$stmt->bindValue(':slength_value', $slength_value);
|
||||
$stmt->execute();
|
||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC); // 여기서 'stmt' 사용
|
||||
|
||||
|
||||
if (count($rows) > 0) {
|
||||
echo '<div style="max-height: 400px; overflow-y: auto;">'; // 스크롤 컨테이너 시작
|
||||
echo '<table class="table table-hover">';
|
||||
echo '<thead class="table-primary">';
|
||||
echo '<tr>';
|
||||
echo '<th class="text-center">생산로트 </th>';
|
||||
echo '<th class="text-center">등록일</th>';
|
||||
echo '<th class="text-center">품목명</th>';
|
||||
echo '<th class="text-center">종류</th>';
|
||||
echo '<th class="text-center">모양&길이</th>';
|
||||
echo '<th class="text-center">원단로트</th>';
|
||||
echo '<th class="text-center">재고</th>';
|
||||
echo '<th class="text-center">사용수량</th>';
|
||||
echo '</tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody id="lotModalBody">';
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$lot_number = htmlspecialchars($row['lot_number']);
|
||||
$surang = number_format((int)$row['surang']);
|
||||
$prod = htmlspecialchars($row['prod']);
|
||||
$spec = htmlspecialchars($row['spec']);
|
||||
$slength = htmlspecialchars($row['slength']);
|
||||
$reg_date = htmlspecialchars($row['reg_date']);
|
||||
$num = htmlspecialchars($row['num']); // 추가: num 값을 가져옵니다.
|
||||
$fabric_lot = htmlspecialchars($row['fabric_lot']);
|
||||
|
||||
// 품목명, 종류, 모양&길이에 대한 친절한 표시를 준비
|
||||
$prodDisplay = isset($prodNames[$prod]) ? "{$prod}({$prodNames[$prod]})" : $prod;
|
||||
$specDisplay = isset($specNames[$spec]) ? "{$spec}({$specNames[$spec]})" : $spec;
|
||||
$slengthDisplay = isset($slengthNames[$slength]) ? "{$slength}({$slengthNames[$slength]})" : $slength;
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_prod(\'' . $lot_number . '\')">' . $lot_number . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_prod(\'' . $lot_number . '\')">' . $reg_date . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_prod(\'' . $lot_number . '\')">' . $prodDisplay . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_prod(\'' . $lot_number . '\')">' . $specDisplay . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_prod(\'' . $lot_number . '\')">' . $slengthDisplay . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_prod(\'' . $lot_number . '\')">' . $fabric_lot . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_prod(\'' . $lot_number . '\')">' . $surang . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_prod(\'' . $lot_number . '\')">' . $usesurang . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>'; // 스크롤 컨테이너 종료
|
||||
} else {
|
||||
echo '<div class="alert alert-warning">해당 품목명에 대한 로트 번호가 없습니다.</div>';
|
||||
}
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo '<div class="alert alert-danger">오류: ' . htmlspecialchars($e->getMessage()) . '</div>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($lot_type === 'material') {
|
||||
|
||||
switch (substr($item_name, 0, 1))
|
||||
{
|
||||
case 'H' :
|
||||
$rawitemname = "EGI1.15T";
|
||||
break;
|
||||
case 'X' :
|
||||
$rawitemname = "EGI1.55T";
|
||||
break;
|
||||
case 'Y' :
|
||||
$rawitemname = "SUS1.2T";
|
||||
break;
|
||||
}
|
||||
|
||||
try {
|
||||
// 로트 번호를 품목명에 따라 조회
|
||||
$sql = "SELECT num, item_name, lot_no, received_qty, supplier, inspection_date, specification
|
||||
FROM {$DB}.instock
|
||||
WHERE item_name LIKE :item_name AND is_deleted IS NULL AND lotDone IS NULL
|
||||
ORDER BY inspection_date DESC, lot_no ASC ";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(':item_name', "%$rawitemname%", PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$rows = $stmh->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($rows);
|
||||
// echo '</pre>';
|
||||
|
||||
$slength = substr($Request_item_name, 3); // '24'는 slength
|
||||
if($slength == '12')
|
||||
$slength = '24';
|
||||
|
||||
echo '<div class="alert alert-primary"> 검색어 item_name : ' . $item_name . ' ' . $rawitemname . ', 길이 : ' . $slength . ' </div>';
|
||||
|
||||
if (count($rows) > 0) {
|
||||
echo '<div style="max-height: 400px; overflow-y: auto;">'; // 스크롤 컨테이너 시작
|
||||
echo '<table class="table table-hover">';
|
||||
echo '<thead class="table-primary">';
|
||||
echo '<tr>';
|
||||
echo '<th class="text-center">로트 번호</th>';
|
||||
echo '<th class="text-center">품명 </th>';
|
||||
echo '<th class="text-center">규격</th>';
|
||||
echo '<th class="text-center">수량(EA)<br> 길이(M)</th>';
|
||||
echo '<th class="text-center">납품업체</th>';
|
||||
echo '<th class="text-center">검사일</th>';
|
||||
echo '<th class="text-center">로트소진</th>';
|
||||
echo '</tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody id="lotModalBody">';
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$lot_no = htmlspecialchars($row['lot_no']);
|
||||
$received_qty = number_format((int)$row['received_qty']);
|
||||
$supplier = htmlspecialchars($row['supplier']);
|
||||
$inspection_date = htmlspecialchars($row['inspection_date']);
|
||||
$num = htmlspecialchars($row['num']);
|
||||
$item_name = htmlspecialchars($row['item_name']);
|
||||
$specification = htmlspecialchars($row['specification']);
|
||||
$parts = explode('*', $specification);
|
||||
$beforeAsterisk = isset($parts[0]) ? $parts[0] : ''; // '*' 기준 앞으로
|
||||
$afterAsterisk = isset($parts[1]) ? $parts[1] : ''; // '*' 4000, 3500 이런식으로 뒤의 값 추출
|
||||
if($afterAsterisk =='1219')
|
||||
$afterAsterisk ='2438' ; // 철판 1219 기장은 없음
|
||||
|
||||
$slengthDisplay = isset($slengthNames[$slength]) ? "{$slengthNames[$slength]}" : $slength;
|
||||
// echo 'beforeAsterisk : ' . intval($beforeAsterisk) . 'afterAsterisk : ' . intval($afterAsterisk) . ' , slengthDisplay : ' . intval($slengthDisplay) . '<br>';
|
||||
|
||||
if ($item_name == '내화실') {
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_wire(\'' . $lot_no . '\')">' . $lot_no . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_wire(\'' . $lot_no . '\')">' . $item_name . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_wire(\'' . $lot_no . '\')">' . $specification . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_wire(\'' . $lot_no . '\')">' . $received_qty . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_wire(\'' . $lot_no . '\')">' . $supplier . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber_wire(\'' . $lot_no . '\')">' . $inspection_date . '</td>';
|
||||
// '소진' 버튼 추가
|
||||
echo '<td class="text-center">';
|
||||
echo '<button type="button" class="btn btn-sm btn-danger lot-done-wire-btn " data-num="' . $num . '" data-tablename="' . $tablename . '">소진</button>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
} else {
|
||||
if (intval($slengthDisplay) === intval($afterAsterisk) || strpos($slengthDisplay, '*') !== false) { // *3000 뒷 3000이 같은 코드만 or 하부베이스 120*120 형태로 불러오기
|
||||
echo '<tr>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $lot_no . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $item_name . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')">' . $specification . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $received_qty . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $supplier . '</td>';
|
||||
echo '<td class="text-center" onclick="selectLotNumber(\'' . $lot_no . '\')"> ' . $inspection_date . '</td>';
|
||||
// '소진' 버튼 추가
|
||||
echo '<td class="text-center">';
|
||||
echo '<button type="button" class="btn btn-sm btn-danger lot-done-btn" data-num="' . $num . '" data-tablename="' . $tablename . '" data-rawitemname="' . $rawitemname . '" data-lottype="' . $lot_type . '" >소진</button>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>'; // 스크롤 컨테이너 종료
|
||||
} else {
|
||||
echo '<div class="alert alert-warning">해당 품목명에 대한 로트 번호가 없습니다. item_name : ' . $item_name . '</div>';
|
||||
}
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo '<div class="alert alert-danger">오류: ' . htmlspecialchars($e->getMessage()) . '</div>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
57
output/fetch_outworkplace.php
Normal file
57
output/fetch_outworkplace.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$search = $_POST['search'] ?? '';
|
||||
|
||||
// Assuming $DB is defined in mydb.php or session.php
|
||||
// If $DB is not defined, define it explicitly
|
||||
if (!isset($DB)) {
|
||||
$DB = 'chandj'; // Replace with your actual database name
|
||||
}
|
||||
|
||||
try {
|
||||
// Construct SQL query to search in output table based on search term
|
||||
$sql = "SELECT phone, outputplace, outworkplace, receiver FROM {$DB}.output WHERE
|
||||
receiver LIKE :search1 or phone LIKE :search2 or outworkplace LIKE :search3 ";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$searchTerm = '%' . $search . '%';
|
||||
$stmh->bindParam(':search1', $searchTerm, PDO::PARAM_STR);
|
||||
$stmh->bindParam(':search2', $searchTerm, PDO::PARAM_STR);
|
||||
$stmh->bindParam(':search3', $searchTerm, PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$output_rows = $stmh->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
// Function to normalize strings: remove spaces, special characters and convert to lowercase
|
||||
function normalize($str) {
|
||||
return strtolower(preg_replace('/[^a-zA-Z0-9]/', '', $str));
|
||||
}
|
||||
|
||||
// Remove duplicate rows based on 'phone', 'outputplace', 'outworkplace', 'receiver' columns
|
||||
$unique_rows = [];
|
||||
$seen = [];
|
||||
foreach ($output_rows as $row) {
|
||||
$normalized_phone = normalize($row['phone']);
|
||||
$normalized_outputplace = normalize($row['outputplace']);
|
||||
$normalized_outworkplace = normalize($row['outworkplace']);
|
||||
$normalized_receiver = normalize($row['receiver']);
|
||||
$key = $normalized_phone . '|' . $normalized_outputplace . '|' . $normalized_outworkplace . '|' . $normalized_receiver;
|
||||
if (!isset($seen[$key])) {
|
||||
$unique_rows[] = $row;
|
||||
$seen[$key] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Output the results as JSON
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($unique_rows);
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
// Output the error message as JSON
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(["error" => $Exception->getMessage()]);
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
54
output/fetch_receiver.php
Normal file
54
output/fetch_receiver.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$search = $_POST['search'] ?? '';
|
||||
|
||||
// Assuming $DB is defined in mydb.php or session.php
|
||||
// If $DB is not defined, define it explicitly
|
||||
if (!isset($DB)) {
|
||||
$DB = 'chandj'; // Replace with your actual database name
|
||||
}
|
||||
|
||||
try {
|
||||
// Construct SQL query to search in output table based on search term
|
||||
$sql = "SELECT phone, outputplace, receiver FROM {$DB}.output WHERE
|
||||
receiver LIKE :search ";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$searchTerm = '%' . $search . '%';
|
||||
$stmh->bindParam(':search', $searchTerm, PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$output_rows = $stmh->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
// Function to normalize strings: remove spaces, special characters and convert to lowercase
|
||||
function normalize($str) {
|
||||
return strtolower(preg_replace('/[^a-zA-Z0-9]/', '', $str));
|
||||
}
|
||||
|
||||
// Remove duplicate rows based on 'phone', 'outputplace', 'receiver' columns
|
||||
$unique_rows = [];
|
||||
$seen = [];
|
||||
foreach ($output_rows as $row) {
|
||||
$normalized_phone = normalize($row['phone']);
|
||||
$normalized_outputplace = normalize($row['outputplace']);
|
||||
$normalized_receiver = normalize($row['receiver']);
|
||||
$key = $normalized_phone . '|' . $normalized_outputplace . '|' . $normalized_receiver;
|
||||
if (!isset($seen[$key])) {
|
||||
$unique_rows[] = $row;
|
||||
$seen[$key] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Output the results as JSON
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($unique_rows);
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
// Output the error message as JSON
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(["error" => $Exception->getMessage()]);
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
313
output/i_json/22545.json
Normal file
313
output/i_json/22545.json
Normal file
@@ -0,0 +1,313 @@
|
||||
{
|
||||
"inputValue": [
|
||||
"2024-12-03",
|
||||
"명보에스티",
|
||||
"KWE01 전체적인 테스트",
|
||||
"KD-WE-241203-10",
|
||||
"010-5123-8210",
|
||||
"KWE01 전체적인 테스트",
|
||||
"2025-02-01",
|
||||
"",
|
||||
"2",
|
||||
"2024-12-04",
|
||||
"KWE01 전체적인 테스트",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"1",
|
||||
"1",
|
||||
"FSS-1",
|
||||
"2",
|
||||
"1",
|
||||
"FSS-1"
|
||||
],
|
||||
"beforeWidth": [
|
||||
"8000",
|
||||
"7000"
|
||||
],
|
||||
"beforeHeight": [
|
||||
"4000",
|
||||
"3500"
|
||||
],
|
||||
"afterWidth": [
|
||||
"8000",
|
||||
"7000"
|
||||
],
|
||||
"afterHeight": [
|
||||
"4000",
|
||||
"3500"
|
||||
],
|
||||
"recordComent": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"exceptCheck": [
|
||||
"0",
|
||||
"0"
|
||||
],
|
||||
"pages": [
|
||||
{
|
||||
"page": "1",
|
||||
"inputItems": {
|
||||
"openWidth": "8000",
|
||||
"openHeight": "4000",
|
||||
"homegap": "20",
|
||||
"bottombargap": "23",
|
||||
"input_memo": null,
|
||||
"resultJudgement": "합격"
|
||||
},
|
||||
"checkboxData": [
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"page": "2",
|
||||
"inputItems": {
|
||||
"openWidth": "7000",
|
||||
"openHeight": "3500",
|
||||
"homegap": "20",
|
||||
"bottombargap": "23",
|
||||
"input_memo": null,
|
||||
"resultJudgement": "합격"
|
||||
},
|
||||
"checkboxData": [
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"approval": {
|
||||
"writer": {
|
||||
"name": "개발자",
|
||||
"date": "25\/01\/02"
|
||||
},
|
||||
"approver": {
|
||||
"name": "개발자",
|
||||
"date": "25\/01\/02"
|
||||
}
|
||||
}
|
||||
}
|
||||
206
output/i_json/22546.json
Normal file
206
output/i_json/22546.json
Normal file
@@ -0,0 +1,206 @@
|
||||
{
|
||||
"inputValue": [
|
||||
"2024-12-05",
|
||||
"명보에스티",
|
||||
"KSE01 여러가지 테스트",
|
||||
"KD-SE-241205-01",
|
||||
"010-5123-8210",
|
||||
"KSE01 여러가지 테스트",
|
||||
"2025-02-01",
|
||||
"",
|
||||
"2",
|
||||
"",
|
||||
"KSE01 여러가지 테스트",
|
||||
"테스트",
|
||||
"테스트",
|
||||
"이경호",
|
||||
"(주)주일기업",
|
||||
"서울특별시 양천구 목동중앙북로22길 7(목동) 4층 401호(동성빌딩)",
|
||||
"010-5292-3829",
|
||||
"이경주",
|
||||
"지유산업개발㈜",
|
||||
"경기도 화성시 경기대로 1011,비동 1413호 (병점동)",
|
||||
"031-373-9445",
|
||||
"김복렬",
|
||||
"동아건축사사무소",
|
||||
"경기도 안성시 중앙로 464, 4층",
|
||||
"031-675-2639",
|
||||
"1",
|
||||
"1",
|
||||
"FSS-1",
|
||||
"2",
|
||||
"2",
|
||||
"FSS-2"
|
||||
],
|
||||
"beforeWidth": [
|
||||
"8000",
|
||||
"7660"
|
||||
],
|
||||
"beforeHeight": [
|
||||
"4000",
|
||||
"4000"
|
||||
],
|
||||
"afterWidth": [
|
||||
"8020",
|
||||
"7660"
|
||||
],
|
||||
"afterHeight": [
|
||||
"4050",
|
||||
"4000"
|
||||
],
|
||||
"recordComent": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"exceptCheck": [
|
||||
"0",
|
||||
"0"
|
||||
],
|
||||
"pages": [
|
||||
{
|
||||
"page": "1",
|
||||
"inputItems": {
|
||||
"openWidth": "8020",
|
||||
"openHeight": "4050",
|
||||
"homegap": "20",
|
||||
"bottombargap": "23",
|
||||
"input_memo": null,
|
||||
"resultJudgement": "합격"
|
||||
},
|
||||
"checkboxData": [
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"page": "2",
|
||||
"inputItems": [],
|
||||
"checkboxData": []
|
||||
}
|
||||
],
|
||||
"approval": {
|
||||
"writer": {
|
||||
"name": "개발자",
|
||||
"date": "25\/01\/02"
|
||||
},
|
||||
"approver": {
|
||||
"name": "개발자",
|
||||
"date": "25\/01\/02"
|
||||
}
|
||||
}
|
||||
}
|
||||
667
output/i_json/22766.json
Normal file
667
output/i_json/22766.json
Normal file
@@ -0,0 +1,667 @@
|
||||
{
|
||||
"inputValue": [
|
||||
"2024-12-02",
|
||||
"명보에스티",
|
||||
"KQTS01 철재스라트",
|
||||
"KD-TS-241203-06",
|
||||
"010-5123-8210",
|
||||
"KQTS01 철재스라트",
|
||||
"2025-02-01",
|
||||
"철재스라트 테스트용",
|
||||
"6",
|
||||
"2024-12-03",
|
||||
"KQTS01 철재스라트",
|
||||
"철재스라트 테스트용",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"1",
|
||||
"1",
|
||||
"FST-01",
|
||||
"2",
|
||||
"2",
|
||||
"FST-01",
|
||||
"3",
|
||||
"3",
|
||||
"FST-01",
|
||||
"4",
|
||||
"4",
|
||||
"FST-01",
|
||||
"5",
|
||||
"5",
|
||||
"FST-01",
|
||||
"6",
|
||||
"6",
|
||||
"FST-01"
|
||||
],
|
||||
"beforeWidth": [
|
||||
"4000",
|
||||
"4030",
|
||||
"2550",
|
||||
"4830",
|
||||
"4710",
|
||||
"4710"
|
||||
],
|
||||
"beforeHeight": [
|
||||
"4000",
|
||||
"3000",
|
||||
"2900",
|
||||
"2850",
|
||||
"2850",
|
||||
"2850"
|
||||
],
|
||||
"afterWidth": [
|
||||
"4000",
|
||||
"4030",
|
||||
"2550",
|
||||
"4830",
|
||||
"4710",
|
||||
"4710"
|
||||
],
|
||||
"afterHeight": [
|
||||
"4000",
|
||||
"3000",
|
||||
"2900",
|
||||
"2850",
|
||||
"2850",
|
||||
"2850"
|
||||
],
|
||||
"recordComent": [
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"exceptCheck": [
|
||||
"1",
|
||||
"0",
|
||||
"0",
|
||||
"0",
|
||||
"0",
|
||||
"0"
|
||||
],
|
||||
"pages": [
|
||||
{
|
||||
"page": "1",
|
||||
"inputItems": {
|
||||
"openWidth": "4030",
|
||||
"openHeight": "3000",
|
||||
"homegap": "20",
|
||||
"bottombargap": "23",
|
||||
"input_memo": null,
|
||||
"resultJudgement": "합격"
|
||||
},
|
||||
"checkboxData": [
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"page": "2",
|
||||
"inputItems": {
|
||||
"openWidth": "2550",
|
||||
"openHeight": "2900",
|
||||
"homegap": "20",
|
||||
"bottombargap": "23",
|
||||
"input_memo": null,
|
||||
"resultJudgement": "합격"
|
||||
},
|
||||
"checkboxData": [
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"page": "3",
|
||||
"inputItems": {
|
||||
"openWidth": "4830",
|
||||
"openHeight": "2850",
|
||||
"homegap": "20",
|
||||
"bottombargap": "23",
|
||||
"input_memo": null,
|
||||
"resultJudgement": "합격"
|
||||
},
|
||||
"checkboxData": [
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"page": "4",
|
||||
"inputItems": {
|
||||
"openWidth": "4710",
|
||||
"openHeight": "2850",
|
||||
"homegap": "20",
|
||||
"bottombargap": "23",
|
||||
"input_memo": null,
|
||||
"resultJudgement": "합격"
|
||||
},
|
||||
"checkboxData": [
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"page": "5",
|
||||
"inputItems": {
|
||||
"openWidth": "4710",
|
||||
"openHeight": "2850",
|
||||
"homegap": "20",
|
||||
"bottombargap": "23",
|
||||
"input_memo": null,
|
||||
"resultJudgement": "합격"
|
||||
},
|
||||
"checkboxData": [
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"approval": {
|
||||
"writer": {
|
||||
"name": "개발자",
|
||||
"date": "25\/01\/02"
|
||||
},
|
||||
"approver": {
|
||||
"name": "개발자",
|
||||
"date": "25\/01\/02"
|
||||
}
|
||||
}
|
||||
}
|
||||
340
output/i_json/22899.json
Normal file
340
output/i_json/22899.json
Normal file
@@ -0,0 +1,340 @@
|
||||
{
|
||||
"inputValue": [
|
||||
"2024-12-03",
|
||||
"명보에스티",
|
||||
"KSS01 전반적인 테스트",
|
||||
"KD-SS-241205-02",
|
||||
"010-5123-8210",
|
||||
"KSS01(레일 한종류)",
|
||||
"2025-02-01",
|
||||
"",
|
||||
"3",
|
||||
"2024-12-04",
|
||||
"KSS01(레일 한종류)",
|
||||
"",
|
||||
"",
|
||||
"이경호",
|
||||
"(주)주일기업",
|
||||
"서울특별시 양천구 목동중앙북로22길 7(목동) 4층 401호(동성빌딩)",
|
||||
"010-5292-3829",
|
||||
"이경주",
|
||||
"지유산업개발㈜",
|
||||
"경기도 화성시 경기대로 1011,비동 1413호 (병점동)",
|
||||
"031-373-9445",
|
||||
"김복렬",
|
||||
"동아건축사사무소",
|
||||
"경기도 안성시 중앙로 464, 4층",
|
||||
"031-675-2639",
|
||||
"1",
|
||||
"1F",
|
||||
"FSS-1",
|
||||
"2",
|
||||
"2F",
|
||||
"FSS-2",
|
||||
"3",
|
||||
"3F",
|
||||
"FSS-3"
|
||||
],
|
||||
"beforeWidth": [
|
||||
"5000",
|
||||
"6000",
|
||||
"7000"
|
||||
],
|
||||
"beforeHeight": [
|
||||
"3000",
|
||||
"3500",
|
||||
"4000"
|
||||
],
|
||||
"afterWidth": [
|
||||
"5000",
|
||||
"6000",
|
||||
"7000"
|
||||
],
|
||||
"afterHeight": [
|
||||
"3000",
|
||||
"3500",
|
||||
"4000"
|
||||
],
|
||||
"recordComent": [
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"exceptCheck": [
|
||||
"1",
|
||||
"0",
|
||||
"0"
|
||||
],
|
||||
"pages": [
|
||||
{
|
||||
"page": "1",
|
||||
"inputItems": {
|
||||
"openWidth": "6000",
|
||||
"openHeight": "3500",
|
||||
"homegap": "20",
|
||||
"bottombargap": "23",
|
||||
"input_memo": null,
|
||||
"resultJudgement": "합격"
|
||||
},
|
||||
"checkboxData": [
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"page": "2",
|
||||
"inputItems": {
|
||||
"openWidth": "7000",
|
||||
"openHeight": "4000",
|
||||
"homegap": "20",
|
||||
"bottombargap": "23",
|
||||
"input_memo": null,
|
||||
"resultJudgement": "합격"
|
||||
},
|
||||
"checkboxData": [
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"approval": {
|
||||
"writer": {
|
||||
"name": "개발자",
|
||||
"date": "25\/01\/02"
|
||||
},
|
||||
"approver": {
|
||||
"name": "개발자",
|
||||
"date": "25\/01\/02"
|
||||
}
|
||||
}
|
||||
}
|
||||
425
output/i_json/23074.json
Normal file
425
output/i_json/23074.json
Normal file
@@ -0,0 +1,425 @@
|
||||
{
|
||||
"inputValue": [
|
||||
"2024-12-24",
|
||||
"테스트",
|
||||
"",
|
||||
"KD-TE-241224-01",
|
||||
"010-5123-8210",
|
||||
"테스트",
|
||||
"2025-03-03",
|
||||
"",
|
||||
"4",
|
||||
"2024-12-24",
|
||||
"테스트",
|
||||
"",
|
||||
"",
|
||||
"이경호",
|
||||
"(주)주일기업",
|
||||
"서울특별시 양천구 목동중앙북로22길 7(목동) 4층 401호(동성빌딩)",
|
||||
"010-5292-3829",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"1",
|
||||
"1",
|
||||
"Fss-1",
|
||||
"2",
|
||||
"2",
|
||||
"3",
|
||||
"3",
|
||||
"3",
|
||||
"Fss-3",
|
||||
"4",
|
||||
"4",
|
||||
"Fss-4"
|
||||
],
|
||||
"beforeWidth": [
|
||||
"8000",
|
||||
"6000",
|
||||
"5000",
|
||||
"6000"
|
||||
],
|
||||
"beforeHeight": [
|
||||
"4000",
|
||||
"1000",
|
||||
"3000",
|
||||
"3000"
|
||||
],
|
||||
"afterWidth": [
|
||||
"8140",
|
||||
"6140",
|
||||
"5140",
|
||||
"6140"
|
||||
],
|
||||
"afterHeight": [
|
||||
"4350",
|
||||
"1350",
|
||||
"3350",
|
||||
"3350"
|
||||
],
|
||||
"recordComent": [
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"exceptCheck": [
|
||||
"1",
|
||||
"0",
|
||||
"0",
|
||||
"0"
|
||||
],
|
||||
"pages": [
|
||||
{
|
||||
"page": "1",
|
||||
"inputItems": {
|
||||
"openWidth": "6140",
|
||||
"openHeight": "1350",
|
||||
"homegap": "20",
|
||||
"bottombargap": "23",
|
||||
"input_memo": null,
|
||||
"resultJudgement": "합격"
|
||||
},
|
||||
"checkboxData": [
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"page": "2",
|
||||
"inputItems": {
|
||||
"openWidth": "5140",
|
||||
"openHeight": "3350",
|
||||
"homegap": "20",
|
||||
"bottombargap": "23",
|
||||
"input_memo": null,
|
||||
"resultJudgement": "합격"
|
||||
},
|
||||
"checkboxData": [
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"page": "3",
|
||||
"inputItems": {
|
||||
"openWidth": "6140",
|
||||
"openHeight": "3350",
|
||||
"homegap": "20",
|
||||
"bottombargap": "23",
|
||||
"input_memo": null,
|
||||
"resultJudgement": "합격"
|
||||
},
|
||||
"checkboxData": [
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
},
|
||||
{
|
||||
"G": [
|
||||
true
|
||||
],
|
||||
"B": [
|
||||
null
|
||||
],
|
||||
"J": "적"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"approval": {
|
||||
"writer": {
|
||||
"name": "개발자",
|
||||
"date": "25\/01\/02"
|
||||
},
|
||||
"approver": {
|
||||
"name": "개발자",
|
||||
"date": "25\/01\/02"
|
||||
}
|
||||
}
|
||||
}
|
||||
158
output/inputModal.php
Normal file
158
output/inputModal.php
Normal file
@@ -0,0 +1,158 @@
|
||||
<!-- Bootstrap 5.3 필요 -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<style>
|
||||
/* 기본 폰트 크기 12px로 전체 적용 */
|
||||
#saleModal * {
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
/* input 및 select 등의 요소 높이와 padding 축소 */
|
||||
#saleModal .form-control {
|
||||
padding: 2px 4px !important;
|
||||
height: auto !important;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
/* 테이블 셀 패딩 최소화 */
|
||||
#saleModal table td,
|
||||
#saleModal table th {
|
||||
padding: 4px !important;
|
||||
vertical-align: middle;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
/* 버튼 크기도 작게 */
|
||||
#saleModal .btn {
|
||||
padding: 2px 8px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* 모달 내용 전체 크기 조절 (불필요한 공간 제거) */
|
||||
#saleModal .modal-body {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
#saleModal .modal-header,
|
||||
#saleModal .modal-footer {
|
||||
padding: 6px 10px;
|
||||
}
|
||||
|
||||
/* 입력박스 사이 간격도 줄이기 */
|
||||
#saleModal .row > [class^="col"] {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<!-- 모달 버튼 -->
|
||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#saleModal">판매 수정 열기</button>
|
||||
|
||||
<!-- 모달창 -->
|
||||
<div class="modal fade" id="saleModal" tabindex="-1" aria-labelledby="saleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-fullscreen">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-primary text-white">
|
||||
<h5 class="modal-title" id="saleModalLabel">판매 수정</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="saleForm">
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">일자</label>
|
||||
<input type="date" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">거래처</label>
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">담당자</label>
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">창고</label>
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-bordered text-center align-middle">
|
||||
<thead class="table-secondary">
|
||||
<tr>
|
||||
<th>품목코드</th>
|
||||
<th>품목명</th>
|
||||
<th>규격</th>
|
||||
<th>수량</th>
|
||||
<th>단가</th>
|
||||
<th>공급가액</th>
|
||||
<th>부가세</th>
|
||||
<th>적요</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><input type="text" class="form-control" value="N74202"></td>
|
||||
<td><input type="text" class="form-control" value="N컨트롤 기판"></td>
|
||||
<td><input type="text" class="form-control" value="380V"></td>
|
||||
<td><input type="number" class="form-control text-end" value="3"></td>
|
||||
<td><input type="number" class="form-control text-end" value="50000"></td>
|
||||
<td><input type="number" class="form-control text-end" value="150000"></td>
|
||||
<td><input type="number" class="form-control text-end" value="15000"></td>
|
||||
<td><input type="text" class="form-control" value="현대백화점점훈점/경동-최장"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" class="form-control" value="30006"></td>
|
||||
<td><input type="text" class="form-control" value="운송료"></td>
|
||||
<td><input type="text" class="form-control" value=""></td>
|
||||
<td><input type="number" class="form-control text-end" value="1"></td>
|
||||
<td><input type="number" class="form-control text-end" value="6000"></td>
|
||||
<td><input type="number" class="form-control text-end" value="6000"></td>
|
||||
<td><input type="number" class="form-control text-end" value="600"></td>
|
||||
<td><input type="text" class="form-control" value=""></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<span class="me-auto fw-bold">합계: 공급가액 156,000 | 부가세 15,600 | 합계 171,600</span>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
||||
<button type="button" class="btn btn-primary">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 모달 드래그 기능 추가
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const modal = document.querySelector('#saleModal .modal-dialog');
|
||||
const header = document.querySelector('#saleModal .modal-header');
|
||||
|
||||
let isDragging = false;
|
||||
let offsetX = 0;
|
||||
let offsetY = 0;
|
||||
|
||||
header.addEventListener('mousedown', (e) => {
|
||||
isDragging = true;
|
||||
offsetX = e.clientX - modal.offsetLeft;
|
||||
offsetY = e.clientY - modal.offsetTop;
|
||||
modal.style.position = 'absolute';
|
||||
modal.style.margin = 0;
|
||||
modal.style.zIndex = 1055;
|
||||
});
|
||||
|
||||
document.addEventListener('mousemove', (e) => {
|
||||
if (isDragging) {
|
||||
modal.style.left = `${e.clientX - offsetX}px`;
|
||||
modal.style.top = `${e.clientY - offsetY}px`;
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('mouseup', () => {
|
||||
isDragging = false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
309
output/inputModal1.php
Normal file
309
output/inputModal1.php
Normal file
@@ -0,0 +1,309 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if(!isset($_SESSION["level"]) || $_SESSION["level"]>5) {
|
||||
sleep(1);
|
||||
header("Location:" . $WebSite . "login/login_form.php");
|
||||
exit;
|
||||
}
|
||||
include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php';
|
||||
?>
|
||||
|
||||
<style>
|
||||
/* 기본 폰트 크기 12px로 전체 적용 */
|
||||
#fullscreenModal * {
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
/* 모달 전체를 강제로 화면에 맞춤 */
|
||||
#fullscreenModal .modal-dialog {
|
||||
width: 1920px !important;
|
||||
max-width: 1920px !important;
|
||||
height: 1080px !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
#fullscreenModal .modal-content {
|
||||
height: 100vh;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* 스크롤 충돌 방지 */
|
||||
body.modal-open {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#fullscreenModal .form-control {
|
||||
padding: 2px 4px !important;
|
||||
height: auto !important;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
#fullscreenModal table td,
|
||||
#fullscreenModal table th {
|
||||
padding: 4px !important;
|
||||
vertical-align: middle;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
#fullscreenModal .btn {
|
||||
padding: 2px 8px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#fullscreenModal .modal-body {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
#fullscreenModal .modal-header,
|
||||
#fullscreenModal .modal-footer {
|
||||
padding: 6px 10px;
|
||||
}
|
||||
|
||||
#fullscreenModal .row > [class^="col"] {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- 버튼 -->
|
||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#fullscreenModal">전체화면 모달 열기</button>
|
||||
|
||||
<!-- 전체화면 모달 -->
|
||||
<div class="modal fade" id="fullscreenModal" tabindex="-1" aria-labelledby="fullscreenModalLabel"
|
||||
data-bs-backdrop="static" data-bs-keyboard="false" aria-hidden="true">
|
||||
<div class="modal-dialog modal-fullscreen">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-dark text-white">
|
||||
<h5 class="modal-title" id="fullscreenModalLabel">발주 내역 + 가격 입력</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="row h-100">
|
||||
<!-- 왼쪽: 발주 내역 -->
|
||||
<div class="col-6 border-end pe-3 overflow-auto">
|
||||
<h6 class="mb-3">📋 발주 내역</h6>
|
||||
<table class="table table-bordered table-sm text-center">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>번호</th>
|
||||
<th>품목명</th>
|
||||
<th>수량</th>
|
||||
<th>단가</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>1</td><td>기판</td><td>3</td><td>50,000</td></tr>
|
||||
<tr><td>2</td><td>운송료</td><td>1</td><td>6,000</td></tr>
|
||||
<!-- 필요 시 반복 -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 오른쪽: 가격 입력 -->
|
||||
<div class="col-6 ps-3">
|
||||
<h6 class="mb-3">💰 가격 입력</h6>
|
||||
<form>
|
||||
<div class="row g-2 mb-2">
|
||||
<div class="col-6">
|
||||
<label class="form-label">일자</label>
|
||||
<input type="date" class="form-control form-control-sm">
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<label class="form-label">거래처</label>
|
||||
<input type="text" class="form-control form-control-sm">
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary add-row-account">+ 행추가</button>
|
||||
<table class="table table-bordered table-sm text-center" id="accountList">
|
||||
<thead class="table-secondary">
|
||||
<tr>
|
||||
<th>일련번호</th>
|
||||
<th>품목코드</th>
|
||||
<th>품목명</th>
|
||||
<th>규격</th>
|
||||
<th>수량</th>
|
||||
<th>단가</th>
|
||||
<th>공급가액</th>
|
||||
<th>부가세</th>
|
||||
<th>적요</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="accountListBody">
|
||||
<!-- 동적 행이 여기에 생성됨 -->
|
||||
</tbody>
|
||||
<tfoot class="table-light fw-bold">
|
||||
<tr>
|
||||
<td colspan="7" class="text-end">합계</td>
|
||||
<td id="sumQty">0</td>
|
||||
<td id="sumTotal">0</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer justify-content-between">
|
||||
<span class="text-muted">총합계: 171,600</span>
|
||||
<div>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
||||
<button type="button" class="btn btn-primary">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// 모달 드래그 기능 추가
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const modal = document.querySelector('#fullscreenModal .modal-dialog');
|
||||
const header = document.querySelector('#fullscreenModal .modal-header');
|
||||
|
||||
let isDragging = false;
|
||||
let offsetX = 0;
|
||||
let offsetY = 0;
|
||||
|
||||
header.addEventListener('mousedown', (e) => {
|
||||
isDragging = true;
|
||||
offsetX = e.clientX - modal.offsetLeft;
|
||||
offsetY = e.clientY - modal.offsetTop;
|
||||
modal.style.position = 'absolute';
|
||||
modal.style.margin = 0;
|
||||
modal.style.zIndex = 1055;
|
||||
});
|
||||
|
||||
document.addEventListener('mousemove', (e) => {
|
||||
if (isDragging) {
|
||||
modal.style.left = `${e.clientX - offsetX}px`;
|
||||
modal.style.top = `${e.clientY - offsetY}px`;
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('mouseup', () => {
|
||||
isDragging = false;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function updateTableSums() {
|
||||
let sumQty = 0;
|
||||
let sumVAT = 0;
|
||||
let sumTotal = 0;
|
||||
|
||||
$('#accountListBody tr').each(function () {
|
||||
const qty = parseFloat($(this).find('input[name="col4[]"]').val()) || 0;
|
||||
const vat = parseFloat($(this).find('input[name="colVAT[]"]').val()) || 0;
|
||||
const supply = parseFloat($(this).find('input[name="col6[]"]').val()) || 0;
|
||||
|
||||
sumQty += qty;
|
||||
sumVAT += vat;
|
||||
sumTotal += supply + vat;
|
||||
});
|
||||
|
||||
$('#sumQty').text(sumQty.toLocaleString());
|
||||
$('#sumVAT').text(sumVAT.toLocaleString());
|
||||
$('#sumTotal').text(sumTotal.toLocaleString());
|
||||
}
|
||||
|
||||
|
||||
$(document).on('input', '#accountListBody input', function () {
|
||||
updateTableSums();
|
||||
});
|
||||
|
||||
function addRow_Account(
|
||||
tableBody = $('#accountListBody'),
|
||||
afterRow = null,
|
||||
rowData = {}
|
||||
) {
|
||||
rowData = Object.assign({ col7: '1' }, rowData);
|
||||
|
||||
const fields = [
|
||||
{ name: 'col1' }, // 품목코드
|
||||
{ name: 'col2' }, // 품목명
|
||||
{ name: 'col3' }, // 규격
|
||||
{ name: 'col4' }, // 수량
|
||||
{ name: 'col5' }, // 단가
|
||||
{ name: 'col6' }, // 공급가액
|
||||
{ name: 'colVAT' }, // 부가세
|
||||
{ name: 'col7' } // 적요
|
||||
];
|
||||
|
||||
const options = {
|
||||
};
|
||||
|
||||
createCommonRow(tableBody, fields, options, rowData, afterRow);
|
||||
updateTableSums(); // 추가 후 합계 갱신
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
// .add-row-account 클릭 시 행 추가
|
||||
$('.add-row-account').on('click', function () {
|
||||
addRow_Account($('#accountListBody'));
|
||||
alertToast('행추가');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function createCommonRow(tableBody, fields, selectOptions = {}, rowData = {}, afterRow = null) {
|
||||
let newRow = $('<tr>');
|
||||
|
||||
newRow.append('<td class="text-center">' +
|
||||
'<div class="d-flex justify-content-center align-items-center">' +
|
||||
'<span class="serial-number me-2"></span>' +
|
||||
'<button type="button" class="btn btn-outline-dark btn-sm viewNoBtn me-1 add-row-account" style="border:0px;">+</button>' +
|
||||
'<button type="button" class="btn btn-outline-danger btn-sm viewNoBtn me-1 remove-row-generic" style="border:0px;">-</button>' +
|
||||
'<button type="button" class="btn btn-outline-secondary btn-sm viewNoBtn copy-row-generic" style="border:0px;"><i class="bi bi-files"></i></button>' +
|
||||
'</div></td>');
|
||||
|
||||
fields.forEach(field => {
|
||||
if (field.type === 'select') {
|
||||
newRow.append(`<td class="text-center">${createSelect(field.name, selectOptions[field.name] || [], rowData[field.name] || '')}</td>`);
|
||||
} else {
|
||||
newRow.append(`<td class="text-center">${createInput(field.name, rowData[field.name] || '')}</td>`);
|
||||
}
|
||||
});
|
||||
|
||||
if (afterRow && afterRow.length) {
|
||||
afterRow.after(newRow);
|
||||
} else {
|
||||
tableBody.append(newRow);
|
||||
}
|
||||
|
||||
updateSerialNumbers(tableBody);
|
||||
}
|
||||
|
||||
function createSelect(name, options, selectedValue = '') {
|
||||
let html = `<select name="${name}[]" class="form-select form-select-sm text-center ${name}" style="height:30px; font-size:0.75rem;">`;
|
||||
html += `<option value="(없음)">(없음)</option>`;
|
||||
options.forEach(opt => {
|
||||
html += `<option value="${opt}"${opt === selectedValue ? ' selected' : ''}>${opt}</option>`;
|
||||
});
|
||||
html += '</select>';
|
||||
return html;
|
||||
}
|
||||
|
||||
function createInput(name, value = '', type = 'text') {
|
||||
return `<input type="${type}" name="${name}[]" class="form-control form-control-sm text-center" autocomplete="off" value="${value}" style="height:30px; font-size:0.75rem;">`;
|
||||
}
|
||||
|
||||
function updateSerialNumbers(tableBody) {
|
||||
tableBody.find('tr').each(function (index) {
|
||||
$(this).find('.serial-number').text(index + 1);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
342
output/insert.php
Normal file
342
output/insert.php
Normal file
@@ -0,0 +1,342 @@
|
||||
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : '';
|
||||
$tablename_sub = 'output_extra';
|
||||
isset($_REQUEST["timekey"]) ? $timekey=$_REQUEST["timekey"] : $timekey=''; // 신규데이터에 생성할때 임시저장키
|
||||
|
||||
include '_request.php';
|
||||
|
||||
if (isset($_REQUEST["regist_state"])) { // 등록하면 1로 설정 접수상태
|
||||
$regist_state = $_REQUEST["regist_state"];
|
||||
} else {
|
||||
$regist_state = "등록";
|
||||
$motor_state = "등록";
|
||||
}
|
||||
// 완료처리시 모터는 준비완료 문구 넣어줌
|
||||
|
||||
if($regist_state == '완료')
|
||||
$motor_state = "준비완료";
|
||||
|
||||
// json 형태는 저장할때 주의해야 한다.
|
||||
if (isset($_POST['screenlist'])) {
|
||||
$screen_jsondata = json_decode($_POST['screenlist'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$screen_jsondata = null;
|
||||
}
|
||||
|
||||
// json 형태는 저장할때 주의해야 한다.
|
||||
if (isset($_POST['slatlist'])) {
|
||||
$slat_jsondata = json_decode($_POST['slatlist'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$slat_jsondata = null;
|
||||
}
|
||||
|
||||
if (isset($_POST['estimateList'])) {
|
||||
$estimateList_jsondata = json_decode($_POST['estimateList'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$estimateList_jsondata = null;
|
||||
}
|
||||
|
||||
if (isset($_POST['estimateSlatList'])) {
|
||||
$estimateSlatList_jsondata = json_decode($_POST['estimateSlatList'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$estimateSlatList_jsondata = null;
|
||||
}
|
||||
|
||||
if (isset($_POST['estimateList_auto'])) {
|
||||
$estimateList_auto_jsondata = json_decode($_POST['estimateList_auto'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$estimateList_auto_jsondata = null;
|
||||
}
|
||||
|
||||
if (isset($_POST['estimateSlatList_auto'])) {
|
||||
$estimateSlatList_auto_jsondata = json_decode($_POST['estimateSlatList_auto'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$estimateSlatList_auto_jsondata = null;
|
||||
}
|
||||
|
||||
if (isset($_POST['etcList'])) {
|
||||
$etcList_jsondata = json_decode($_POST['etcList'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$etcList_jsondata = null;
|
||||
}
|
||||
|
||||
if (isset($_POST['screen_unapprovedList'])) {
|
||||
$screen_unapprovedList_jsondata = json_decode($_POST['screen_unapprovedList'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$screen_unapprovedList_jsondata = null;
|
||||
}
|
||||
|
||||
if (isset($_POST['slat_unapprovedList'])) {
|
||||
$slat_unapprovedList_jsondata = json_decode($_POST['slat_unapprovedList'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$slat_unapprovedList_jsondata = null;
|
||||
}
|
||||
|
||||
if (isset($_POST['motorList'])) {
|
||||
$motorList_jsondata = json_decode($_POST['motorList'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$motorList_jsondata = null;
|
||||
}
|
||||
|
||||
if (isset($_POST['bendList'])) {
|
||||
$bendList_jsondata = json_decode($_POST['bendList'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$bendList_jsondata = null;
|
||||
}
|
||||
|
||||
if (isset($_POST['controllerList'])) {
|
||||
$controllerList_jsondata = json_decode($_POST['controllerList'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$controllerList_jsondata = null;
|
||||
}
|
||||
|
||||
if (isset($_POST['accountList'])) {
|
||||
$accountList_jsondata = json_decode($_POST['accountList'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$accountList_jsondata = null;
|
||||
}
|
||||
|
||||
if (isset($_POST['deliveryfeeList'])) {
|
||||
$deliveryfeeList_jsondata = json_decode($_POST['deliveryfeeList'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$deliveryfeeList_jsondata = null;
|
||||
}
|
||||
|
||||
if (isset($_POST['detailJson'])) {
|
||||
$detailJson_jsondata = json_decode($_POST['detailJson'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$detailJson_jsondata = null;
|
||||
}
|
||||
|
||||
// 모든 변수를 하나의 문자열로 합칩니다.
|
||||
$searchtag = $outworkplace . ' ' .
|
||||
$orderman . ' ' .
|
||||
$outputplace . ' ' .
|
||||
$receiver . ' ' .
|
||||
$phone . ' ' .
|
||||
$comment . ' ' .
|
||||
$root . ' ' .
|
||||
$steel . ' ' .
|
||||
$motor . ' ' .
|
||||
$secondord . ' ' .
|
||||
$secondordman . ' ' .
|
||||
$prodCode . ' ' .
|
||||
$warrantyNum . ' ' .
|
||||
$warranty . ' ' .
|
||||
$lotNum . ' ' .
|
||||
$displayText . ' ' .
|
||||
$delivery;
|
||||
|
||||
// 마지막 공백 제거
|
||||
$searchtag = rtrim($searchtag, ' ');
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
if ($mode == "insert" || $mode == "copy") {
|
||||
$update_log = date("Y-m-d H:i:s") . " - " . $_SESSION["name"] . " ";
|
||||
$pdo->beginTransaction();
|
||||
|
||||
$sql = "INSERT INTO $DB.$tablename (outdate, indate, orderman, outworkplace, outputplace,
|
||||
receiver, phone, comment, con_num, root,
|
||||
steel, motor, delivery, regist_state, searchtag,
|
||||
update_log, bend_state, motor_state, screen, screen_su,
|
||||
screen_m2, screenlist, slat, slat_su, slat_m2,
|
||||
slatlist, updatecomment, secondord, secondordman, secondordmantel,
|
||||
secondordnum, prodCode, warrantyNum, orderdate, lotNum,
|
||||
warranty, ACIregDate, ACIaskDate, ACIdoneDate, ACImemo,
|
||||
ACIcheck, deliveryfeeList, ACIgroupCode, ACIgroupName, estimate_num,
|
||||
devMode, displayText, slatcheck, partscheck, requestBendingASSY) ";
|
||||
$sql .= " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||
?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->execute([
|
||||
$outdate, $indate, $orderman, $outworkplace, $outputplace,
|
||||
$receiver, $phone, $comment, $con_num, $root,
|
||||
$steel, $motor, $delivery, $regist_state, $searchtag,
|
||||
$update_log, $bend_state, $motor_state, $screen, $screen_su,
|
||||
$screen_m2, json_encode($screen_jsondata), $slat, $slat_su, $slat_m2,
|
||||
json_encode($slat_jsondata), $updatecomment, $secondord, $secondordman, $secondordmantel,
|
||||
$secondordnum, $prodCode, $warrantyNum, $orderdate, $lotNum,
|
||||
$warranty, $ACIregDate, $ACIaskDate, $ACIdoneDate, $ACImemo,
|
||||
$ACIcheck, json_encode($deliveryfeeList_jsondata), $ACIgroupCode, $ACIgroupName, $estimate_num,
|
||||
$devMode, $displayText, $slatcheck, $partscheck, $requestBendingASSY
|
||||
]);
|
||||
|
||||
$output_num = $pdo->lastInsertId();
|
||||
|
||||
// output_extra 저장
|
||||
$sql2 = "INSERT INTO $DB.$tablename_sub (
|
||||
parent_num, detailJson, estimateTotal, EstimateFirstSum, EstimateUpdatetSum,
|
||||
EstimateDiffer, estimateSurang, estimateList, estimateSlatList, estimateList_auto,
|
||||
estimateSlatList_auto, pjnum, major_category, position, makeWidth,
|
||||
makeHeight, maguriWing, screen_unapprovedList, slat_unapprovedList, motorList,
|
||||
bendList, etcList, inspectionFee, controllerList, accountDate,
|
||||
accountList, ET_unapproved, ET_total, EstimateDiscountRate, EstimateDiscount,
|
||||
EstimateFinalSum
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
||||
|
||||
$stmh2 = $pdo->prepare($sql2);
|
||||
$stmh2->execute([
|
||||
$output_num, json_encode($detailJson_jsondata), intval(str_replace(',', '', $estimateTotal)),
|
||||
intval(str_replace(',', '', $EstimateFirstSum)), intval(str_replace(',', '', $EstimateUpdatetSum)), intval(str_replace(',', '', $EstimateDiffer)),
|
||||
$estimateSurang, json_encode($estimateList_jsondata), json_encode($estimateSlatList_jsondata), json_encode($estimateList_auto_jsondata), json_encode($estimateSlatList_auto_jsondata),
|
||||
$pjnum, $major_category, $position, $makeWidth, $makeHeight, $maguriWing,
|
||||
json_encode($screen_unapprovedList_jsondata), json_encode($slat_unapprovedList_jsondata),
|
||||
json_encode($motorList_jsondata), json_encode($bendList_jsondata), json_encode($etcList_jsondata),
|
||||
intval(str_replace(',', '', $inspectionFee)), json_encode($controllerList_jsondata), $accountDate, json_encode($accountList_jsondata),
|
||||
intval(str_replace(',', '', $ET_unapproved)), intval(str_replace(',', '', $ET_total)),
|
||||
floatval(str_replace(',', '', $EstimateDiscountRate)), intval(str_replace(',', '', $EstimateDiscount)), intval(str_replace(',', '', $EstimateFinalSum))
|
||||
]);
|
||||
|
||||
$pdo->commit();
|
||||
|
||||
if ($timekey != '') {
|
||||
$pdo->beginTransaction();
|
||||
$sql = "update ".$DB.".picuploads set parentnum=? where parentnum=? ";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->execute([$output_num, $timekey]);
|
||||
$pdo->commit();
|
||||
}
|
||||
|
||||
$num = $output_num;
|
||||
} else if ($mode == "modify") {
|
||||
$update_log = date("Y-m-d H:i:s") . " - " . $_SESSION["name"] . " 수정 ";
|
||||
$pdo->beginTransaction();
|
||||
|
||||
$sql = "UPDATE $DB.$tablename SET outdate=?, indate=?, orderman=?, outworkplace=?, outputplace=?, receiver=?, phone=?, comment=?, con_num=?, root=?, steel=?, motor=?, ";
|
||||
$sql .= "delivery=?, regist_state=?, searchtag=?, update_log=?, bend_state=?, motor_state=?, screen=?, screen_su=?, screen_m2=?, screenlist=?, slat=?, ";
|
||||
$sql .= "slat_su=?, slat_m2=?, slatlist=?, updatecomment=?, secondord=?, secondordman=?, secondordmantel=?, secondordnum=?, prodCode=?, warrantyNum=?, orderdate=?, ";
|
||||
$sql .= "lotNum=?, warranty=?, ACIregDate=?, ACIaskDate=?, ACIdoneDate=?, ACImemo=?, ACIcheck=?, deliveryfeeList=?, ACIgroupCode=?, ACIgroupName=?, estimate_num=?, devMode=?, displayText=?, slatcheck=?, partscheck=?, requestBendingASSY=? WHERE num=?";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->execute([
|
||||
$outdate, $indate, $orderman, $outworkplace, $outputplace, $receiver, $phone, $comment, $con_num, $root, $steel, $motor, $delivery,
|
||||
$regist_state, $searchtag, $update_log, $bend_state, $motor_state, $screen, $screen_su, $screen_m2, json_encode($screen_jsondata),
|
||||
$slat, $slat_su, $slat_m2, json_encode($slat_jsondata), $updatecomment, $secondord, $secondordman, $secondordmantel, $secondordnum,
|
||||
$prodCode, $warrantyNum, $orderdate, $lotNum,
|
||||
$warranty, $ACIregDate, $ACIaskDate, $ACIdoneDate, $ACImemo, $ACIcheck,
|
||||
json_encode($deliveryfeeList_jsondata), $ACIgroupCode, $ACIgroupName, $estimate_num, $devMode, $displayText, $slatcheck, $partscheck, $requestBendingASSY, $num
|
||||
]);
|
||||
|
||||
// output_extra update
|
||||
$sql2 = "UPDATE $DB.$tablename_sub SET detailJson=?, estimateTotal=?, EstimateFirstSum=?, EstimateUpdatetSum=?, EstimateDiffer=?, estimateSurang=?, ";
|
||||
$sql2 .=" estimateList=?, estimateSlatList=?, estimateList_auto=?, estimateSlatList_auto=?, pjnum=?, major_category=?, position=?, makeWidth=?, makeHeight=?, ";
|
||||
$sql2 .=" maguriWing=?, screen_unapprovedList=?, slat_unapprovedList=?, motorList=?, bendList=?, etcList=?, inspectionFee=?, controllerList=?, accountDate=?, accountList=?, ";
|
||||
$sql2 .=" ET_unapproved=?, ET_total=?, EstimateDiscountRate=?, EstimateDiscount=?, EstimateFinalSum=? ";
|
||||
$sql2 .=" WHERE parent_num = ? ";
|
||||
|
||||
$stmh2 = $pdo->prepare($sql2);
|
||||
$stmh2->execute([
|
||||
json_encode($detailJson_jsondata), intval(str_replace(',', '', $estimateTotal)),
|
||||
intval(str_replace(',', '', $EstimateFirstSum)), intval(str_replace(',', '', $EstimateUpdatetSum)), intval(str_replace(',', '', $EstimateDiffer)),
|
||||
$estimateSurang, json_encode($estimateList_jsondata), json_encode($estimateSlatList_jsondata), json_encode($estimateList_auto_jsondata), json_encode($estimateSlatList_auto_jsondata),
|
||||
$pjnum, $major_category, $position, $makeWidth, $makeHeight, $maguriWing,
|
||||
json_encode($screen_unapprovedList_jsondata), json_encode($slat_unapprovedList_jsondata),
|
||||
json_encode($motorList_jsondata), json_encode($bendList_jsondata), json_encode($etcList_jsondata),
|
||||
intval(str_replace(',', '', $inspectionFee)), json_encode($controllerList_jsondata),
|
||||
$accountDate, json_encode($accountList_jsondata), intval(str_replace(',', '', $ET_unapproved)), intval(str_replace(',', '', $ET_total)),
|
||||
floatval(str_replace(',', '', $EstimateDiscountRate)), intval(str_replace(',', '', $EstimateDiscount)), intval(str_replace(',', '', $EstimateFinalSum)), $num
|
||||
]);
|
||||
|
||||
$pdo->commit();
|
||||
} else if ($mode == "delete") {
|
||||
$pdo->beginTransaction();
|
||||
$sql = "UPDATE $DB.$tablename SET is_deleted='1' WHERE num=?";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->execute([$num]);
|
||||
|
||||
// output_extra 논리 삭제
|
||||
$sql2 = "DELETE FROM $DB.$tablename_sub WHERE parent_num = ?";
|
||||
$stmh2 = $pdo->prepare($sql2);
|
||||
$stmh2->execute([$num]);
|
||||
$pdo->commit();
|
||||
|
||||
// 첨부파일 삭제
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql1 = "delete from {$DB}.picuploads where parentnum = ? and tablename = ? ";
|
||||
$stmh1 = $pdo->prepare($sql1);
|
||||
$stmh1->bindValue(1,$num, PDO::PARAM_STR);
|
||||
$stmh1->bindValue(2,$tablename, PDO::PARAM_STR);
|
||||
$stmh1->execute();
|
||||
$pdo->commit();
|
||||
} catch (Exception $ex) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
if ($mode == "insert" || $mode == "copy") {
|
||||
$sql = "SELECT * FROM $DB.$tablename ORDER BY num DESC LIMIT 1";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->execute();
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC);
|
||||
$num = $row["num"];
|
||||
|
||||
|
||||
// 신규데이터인 경우 첨부파일/첨부이미지 추가한 것이 있으면 parentid 변경해줌
|
||||
// 신규데이터인경우 num을 추출한 후 view로 보여주기
|
||||
|
||||
if ($mode == "insert" && $timekey != '') {
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "update ".$DB.".picuploads set parentnum=? where parentnum=? ";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $num, PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $timekey, PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$data = [
|
||||
'num' => $num,
|
||||
'mode' => $mode,
|
||||
'prodCode' => $prodCode
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
} catch (PDOException $Exception) {
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
http_response_code(500);
|
||||
echo json_encode(['error' => $Exception->getMessage()]);
|
||||
} catch (Exception $e) {
|
||||
error_log("오류: " . $e->getMessage());
|
||||
http_response_code(500);
|
||||
echo json_encode(['error' => $e->getMessage()]);
|
||||
}
|
||||
?>
|
||||
55
output/insert_ACImemo.php
Normal file
55
output/insert_ACImemo.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
header("Content-Type: application/json");
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : 'output';
|
||||
$ACImemo = isset($_REQUEST['ACImemo']) ? $_REQUEST['ACImemo'] : '';
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
// 디버그: 전달받은 값 로그 확인
|
||||
error_log("num: $num");
|
||||
|
||||
$pdo->beginTransaction();
|
||||
|
||||
// SQL 디버그: 쿼리 확인
|
||||
$sql = "UPDATE {$DB}.{$tablename}
|
||||
SET ACImemo=? WHERE num=? LIMIT 1";
|
||||
error_log("SQL: $sql");
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $ACImemo, PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $num, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
|
||||
// 디버그: 쿼리 실행 후 확인
|
||||
if ($stmh->rowCount() > 0) {
|
||||
error_log("데이터가 성공적으로 업데이트되었습니다.");
|
||||
} else {
|
||||
error_log("업데이트된 행이 없습니다. num 또는 tablename 확인 필요.");
|
||||
}
|
||||
|
||||
$pdo->commit();
|
||||
} catch (PDOException $Exception) {
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
$pdo->rollBack();
|
||||
echo json_encode(['error' => $Exception->getMessage()], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
// 반환 데이터 로그 확인
|
||||
$data = [
|
||||
'num' => $num,
|
||||
'ACImemo' => $ACImemo
|
||||
];
|
||||
error_log("반환 데이터: " . json_encode($data));
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
?>
|
||||
56
output/insert_COD.php
Normal file
56
output/insert_COD.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : '';
|
||||
|
||||
include '_request.php';
|
||||
|
||||
// json 형태는 저장할때 주의해야 한다.
|
||||
if (isset($_POST['COD'])) {
|
||||
$COD_jsondata = json_decode($_POST['COD'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$COD_jsondata = null;
|
||||
}
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
$update_log = date("Y-m-d H:i:s") . " - " . $_SESSION["name"] . " " . $update_log . "
";
|
||||
// 공백 2개 이상 제거
|
||||
$update_log = preg_replace('/\s{2,}/', ' ', $update_log);
|
||||
$pdo->beginTransaction();
|
||||
|
||||
// 추가된 컬럼도 업데이트에 포함
|
||||
$sql = "UPDATE $DB.$tablename
|
||||
SET COD=?, update_log=? WHERE num=? LIMIT 1";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, json_encode($COD_jsondata), PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $update_log, PDO::PARAM_STR);
|
||||
$stmh->bindValue(3, $num, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
}
|
||||
|
||||
$data = [
|
||||
'num' => $num,
|
||||
'is_deleted' => $is_deleted,
|
||||
'COD_jsondata' => $COD_jsondata
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
?>
|
||||
90
output/insert_QCgroupList.php
Normal file
90
output/insert_QCgroupList.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
|
||||
// 오류 메시지 출력 억제 (실제 운영 환경에서는 로그에 기록되도록 설정)
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('log_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : 'output';
|
||||
$safeGroupCode = isset($_REQUEST['safeGroupCode']) ? $_REQUEST['safeGroupCode'] : '';
|
||||
|
||||
// JSON 데이터를 저장할 경로 설정
|
||||
$jsonFilePath = "../output/qc_json/" . $safeGroupCode . ".json";
|
||||
|
||||
/**
|
||||
* 모든 필드가 빈 값인지 확인하는 함수
|
||||
* 각 항목은 객체 형태로 저장되며,
|
||||
* - 일반 입력 요소: 'value' 값이 빈 문자열인지,
|
||||
* - 체크박스: 'checked'가 '1'인지 확인합니다.
|
||||
*/
|
||||
function isAllEmpty($data) {
|
||||
$keys = ['inputValue', 'beforeWidth', 'beforeHeight', 'afterWidth', 'afterHeight', 'recordComent', 'exceptCheck'];
|
||||
foreach ($keys as $key) {
|
||||
if (isset($data[$key]) && is_array($data[$key])) {
|
||||
foreach ($data[$key] as $item) {
|
||||
// 일반 입력 요소의 경우
|
||||
if (isset($item['value']) && trim($item['value']) !== '') {
|
||||
return false;
|
||||
}
|
||||
// 체크박스의 경우 (값이 '1'이면 체크된 상태)
|
||||
if (isset($item['checked']) && $item['checked'] === '1') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isset($_POST['realiList'])) {
|
||||
$realiList_jsondata = json_decode($_POST['realiList'], true);
|
||||
|
||||
if ($realiList_jsondata === null && json_last_error() !== JSON_ERROR_NONE) {
|
||||
echo json_encode([
|
||||
'error' => 'Invalid JSON data provided.',
|
||||
'json_error' => json_last_error_msg()
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
// 기존 JSON 파일 삭제
|
||||
if (file_exists($jsonFilePath)) {
|
||||
unlink($jsonFilePath);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
// 만약 모든 데이터가 빈 값이라면, JSON 파일을 삭제하고 DB 업데이트 시 빈 값으로 처리
|
||||
if (isAllEmpty($realiList_jsondata)) {
|
||||
if (file_exists($jsonFilePath)) {
|
||||
unlink($jsonFilePath);
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
'num' => $safeGroupCode,
|
||||
'message' => 'JSON data is empty. JSON file deleted and database updated.',
|
||||
'realiList_jsondata' => $realiList_jsondata
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
// JSON 데이터를 파일에 저장
|
||||
$saveResult = file_put_contents($jsonFilePath, json_encode($realiList_jsondata, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
|
||||
if ($saveResult === false) {
|
||||
echo json_encode(['error' => 'Failed to write JSON file.'], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
echo json_encode(['error' => 'No realiList data provided.'], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
$data = [
|
||||
'num' => $safeGroupCode,
|
||||
'json_file' => $jsonFilePath,
|
||||
'realiList_jsondata' => $realiList_jsondata,
|
||||
'message' => 'JSON data saved to file and database updated successfully.'
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
?>
|
||||
51
output/insert_account.php
Normal file
51
output/insert_account.php
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : '';
|
||||
$tablename_sub = 'output_extra';
|
||||
isset($_REQUEST["timekey"]) ? $timekey=$_REQUEST["timekey"] : $timekey=''; // 신규데이터에 생성할때 임시저장키
|
||||
|
||||
include '_request.php';
|
||||
|
||||
if (isset($_POST['accountList'])) {
|
||||
$accountList_jsondata = json_decode($_POST['accountList'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$accountList_jsondata = null;
|
||||
}
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
|
||||
$pdo->beginTransaction();
|
||||
// output_extra update
|
||||
$sql2 = "UPDATE $DB.$tablename_sub SET accountDate=?, accountList=?, ET_unapproved=?, ET_total=? WHERE parent_num = ? ";
|
||||
$stmh2 = $pdo->prepare($sql2);
|
||||
$stmh2->execute([
|
||||
$accountDate, json_encode($accountList_jsondata), intval(str_replace(',', '', $ET_unapproved)), intval(str_replace(',', '', $ET_total)), $num
|
||||
]);
|
||||
$pdo->commit();
|
||||
$data = [
|
||||
'num' => $num
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
} catch (PDOException $Exception) {
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
http_response_code(500);
|
||||
echo json_encode(['error' => $Exception->getMessage()]);
|
||||
} catch (Exception $e) {
|
||||
error_log("오류: " . $e->getMessage());
|
||||
http_response_code(500);
|
||||
echo json_encode(['error' => $e->getMessage()]);
|
||||
}
|
||||
?>
|
||||
49
output/insert_bendingMid.php
Normal file
49
output/insert_bendingMid.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : '';
|
||||
|
||||
include '_request.php';
|
||||
|
||||
if (isset($_POST['recordbendingMid'])) {
|
||||
$recordbendingMid_jsondata = json_decode($_POST['recordbendingMid'], true);
|
||||
} else {
|
||||
$recordbendingMid_jsondata = null;
|
||||
}
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
// $update_log = date("Y-m-d H:i:s") . " - " . $_SESSION["name"] . " " . substr($update_log, 0, 200) . "
";
|
||||
$pdo->beginTransaction();
|
||||
|
||||
$sql = "UPDATE $DB.$tablename
|
||||
SET recordbendingMid=? WHERE num=? LIMIT 1";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, json_encode($recordbendingMid_jsondata), PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $num, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
}
|
||||
|
||||
$data = [
|
||||
'num' => $num,
|
||||
'is_deleted' => $is_deleted ?? null,
|
||||
'recordbendingMid_jsondata' => $recordbendingMid_jsondata
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
?>
|
||||
70
output/insert_iList.php
Normal file
70
output/insert_iList.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : 'output';
|
||||
$ACIaskDate = isset($_REQUEST['ACIaskDate']) ? $_REQUEST['ACIaskDate'] : '';
|
||||
$ACIdoneDate = isset($_REQUEST['ACIdoneDate']) ? $_REQUEST['ACIdoneDate'] : '';
|
||||
|
||||
// JSON 데이터를 저장할 경로 설정
|
||||
$jsonFilePath = "../output/i_json/" . $num . ".json";
|
||||
|
||||
if (isset($_POST['iList'])) {
|
||||
$iList_jsondata = json_decode($_POST['iList'], true);
|
||||
if ($iList_jsondata === null && json_last_error() !== JSON_ERROR_NONE) {
|
||||
echo json_encode(['error' => 'Invalid JSON data provided.'], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
// 기존 JSON 파일 삭제
|
||||
if (file_exists($jsonFilePath)) {
|
||||
unlink($jsonFilePath); // 기존 파일 삭제
|
||||
}
|
||||
|
||||
// JSON 데이터를 파일에 저장
|
||||
file_put_contents($jsonFilePath, json_encode($iList_jsondata, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
|
||||
} else {
|
||||
$iList_jsondata = null;
|
||||
}
|
||||
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
$pdo->beginTransaction();
|
||||
|
||||
// 데이터베이스에 파일 경로를 저장
|
||||
$sql = "UPDATE {$DB}.{$tablename} SET iList=?, ACIdoneDate=?, ACIaskDate=? WHERE num=? LIMIT 1";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
|
||||
$stmh->bindValue(1, $jsonFilePath, PDO::PARAM_STR); // JSON 파일 경로를 저장
|
||||
$stmh->bindValue(2, $ACIdoneDate, PDO::PARAM_STR);
|
||||
$stmh->bindValue(3, $ACIaskDate, PDO::PARAM_STR);
|
||||
$stmh->bindValue(4, $num, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack(); // 트랜잭션 롤백
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
echo json_encode(['error' => $Exception->getMessage()], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
$data = [
|
||||
'num' => $num,
|
||||
'iList source : ' => $_POST['iList'],
|
||||
'json_file' => $jsonFilePath,
|
||||
'iList_jsondata' => $iList_jsondata,
|
||||
'message' => 'JSON data saved to file and database updated successfully.'
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
?>
|
||||
41
output/insert_jointbar.php
Normal file
41
output/insert_jointbar.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
header("Content-Type: application/json");
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : '';
|
||||
|
||||
if (isset($_POST['recordjointbar'])) {
|
||||
$recordjointbar_jsondata = json_decode($_POST['recordjointbar'], true);
|
||||
} else {
|
||||
$recordjointbar_jsondata = null;
|
||||
}
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
$pdo->beginTransaction();
|
||||
$sql = "UPDATE {$DB}.{$tablename}
|
||||
SET recordjointbar=? WHERE num=? LIMIT 1";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, json_encode($recordjointbar_jsondata), PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $num, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
}
|
||||
|
||||
$data = [
|
||||
'num' => $num,
|
||||
'recordjointbar_jsondata' => $recordjointbar_jsondata,
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
?>
|
||||
38
output/insert_logmenu.php
Normal file
38
output/insert_logmenu.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$menu = isset($_REQUEST['menu']) ? $_REQUEST['menu'] : '';
|
||||
|
||||
$tablename = 'logdata_menu';
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
// log 기록
|
||||
$data = date("Y-m-d H:i:s") . " - " . $menu . " - " . $_SESSION["name"];
|
||||
$pdo->beginTransaction();
|
||||
$sql = "INSERT INTO chandj.logdata_menu(data) VALUES(?)";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $data, PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
$response = ['status' => 'success', 'message' => 'Log recorded successfully'];
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
http_response_code(500);
|
||||
echo json_encode(['error' => $Exception->getMessage()]);
|
||||
} catch (Exception $e) {
|
||||
error_log("오류: " . $e->getMessage());
|
||||
http_response_code(500);
|
||||
echo json_encode(['error' => $e->getMessage()]);
|
||||
}
|
||||
?>
|
||||
53
output/insert_ordersheet.php
Normal file
53
output/insert_ordersheet.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : '';
|
||||
|
||||
include '_request.php';
|
||||
|
||||
// json 형태는 저장할때 주의해야 한다.
|
||||
if (isset($_POST['ordersheet'])) {
|
||||
$ordersheet_jsondata = json_decode($_POST['ordersheet'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$ordersheet_jsondata = null;
|
||||
}
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
// 자료수정
|
||||
$update_log = date("Y-m-d H:i:s") . " - " . $_SESSION["name"] . " " . $update_log . "
";
|
||||
// 공백 2개 이상 제거
|
||||
$update_log = preg_replace('/\s{2,}/', ' ', $update_log);
|
||||
$pdo->beginTransaction();
|
||||
$sql = "UPDATE $DB.$tablename SET ordersheet=?, update_log=? WHERE num=? LIMIT 1";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, json_encode($ordersheet_jsondata), PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $update_log, PDO::PARAM_STR);
|
||||
$stmh->bindValue(3, $num, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
}
|
||||
|
||||
$data = [
|
||||
'num' => $num,
|
||||
'is_deleted' => $is_deleted
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
?>
|
||||
51
output/insert_ordersheet_slat.php
Normal file
51
output/insert_ordersheet_slat.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : '';
|
||||
|
||||
include '_request.php';
|
||||
|
||||
// json 형태는 저장할때 주의해야 한다.
|
||||
if (isset($_POST['ordersheet_slat'])) {
|
||||
$ordersheet_slat_jsondata = json_decode($_POST['ordersheet_slat'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$ordersheet_slat_jsondata = null;
|
||||
}
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
// 자료수정
|
||||
$update_log = date("Y-m-d H:i:s") . " - " . $_SESSION["name"] . " " . $update_log . "
";
|
||||
$pdo->beginTransaction();
|
||||
$sql = "UPDATE $DB.$tablename SET ordersheet_slat=?, update_log=? WHERE num=? LIMIT 1";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, json_encode($ordersheet_slat_jsondata), PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $update_log, PDO::PARAM_STR);
|
||||
$stmh->bindValue(3, $num, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
}
|
||||
|
||||
$data = [
|
||||
'num' => $num,
|
||||
'is_deleted' => $is_deleted
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
?>
|
||||
134
output/insert_realiList.php
Normal file
134
output/insert_realiList.php
Normal file
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : 'output';
|
||||
$ACIaskDate = isset($_REQUEST['ACIaskDate']) ? $_REQUEST['ACIaskDate'] : '';
|
||||
$ACIdoneDate = isset($_REQUEST['ACIdoneDate']) ? $_REQUEST['ACIdoneDate'] : '';
|
||||
|
||||
// JSON 데이터를 저장할 경로 설정
|
||||
$jsonFilePath = "../output/real_json/" . $num . ".json";
|
||||
|
||||
/**
|
||||
* 모든 필드가 빈 값인지 확인하는 함수
|
||||
* 각 항목은 객체 형태로 저장되며,
|
||||
* - 일반 입력 요소: 'value' 값이 빈 문자열인지,
|
||||
* - 체크박스: 'checked'가 '1'이 아닌지 확인합니다.
|
||||
*/
|
||||
function isAllEmpty($data) {
|
||||
$keys = ['inputValue', 'beforeWidth', 'beforeHeight', 'afterWidth', 'afterHeight', 'recordComent', 'exceptCheck'];
|
||||
foreach ($keys as $key) {
|
||||
if (isset($data[$key]) && is_array($data[$key])) {
|
||||
foreach ($data[$key] as $item) {
|
||||
// 일반 입력 요소의 경우
|
||||
if (isset($item['value']) && trim($item['value']) !== '') {
|
||||
return false;
|
||||
}
|
||||
// 체크박스의 경우 (값이 '1'이면 체크된 상태)
|
||||
if (isset($item['checked']) && $item['checked'] === '1') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isset($_POST['realiList'])) {
|
||||
$realiList_jsondata = json_decode($_POST['realiList'], true);
|
||||
|
||||
if ($realiList_jsondata === null && json_last_error() !== JSON_ERROR_NONE) {
|
||||
echo json_encode([
|
||||
'error' => 'Invalid JSON data provided.',
|
||||
'json_error' => json_last_error_msg()
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
// 기존 JSON 파일 삭제
|
||||
if (file_exists($jsonFilePath)) {
|
||||
unlink($jsonFilePath);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
// 만약 모든 데이터가 빈 값이라면, JSON 파일을 삭제하고 DB 업데이트 시 빈 값으로 처리
|
||||
if (isAllEmpty($realiList_jsondata)) {
|
||||
if (file_exists($jsonFilePath)) {
|
||||
unlink($jsonFilePath);
|
||||
}
|
||||
|
||||
// 데이터베이스 업데이트: realiList 필드를 빈 값으로 저장
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
try {
|
||||
$pdo->beginTransaction();
|
||||
$sql = "UPDATE {$DB}.{$tablename} SET realiList=? WHERE num=? LIMIT 1";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, '', PDO::PARAM_STR); // 빈 값 저장
|
||||
$stmh->bindValue(2, $num, PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
echo json_encode(['error' => $Exception->getMessage()], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
'num' => $num,
|
||||
'message' => 'JSON data is empty. JSON file deleted and database updated.',
|
||||
'realiList_jsondata' => $realiList_jsondata
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
// 기존 JSON 파일 삭제 (덮어쓰기 위해)
|
||||
if (file_exists($jsonFilePath)) {
|
||||
unlink($jsonFilePath);
|
||||
}
|
||||
|
||||
// JSON 데이터를 파일에 저장
|
||||
$saveResult = file_put_contents($jsonFilePath, json_encode($realiList_jsondata, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
|
||||
if ($saveResult === false) {
|
||||
echo json_encode(['error' => 'Failed to write JSON file.'], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
echo json_encode(['error' => 'No realiList data provided.'], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
$pdo->beginTransaction();
|
||||
// 데이터베이스에 JSON 파일 경로 저장
|
||||
$sql = "UPDATE {$DB}.{$tablename} SET realiList=? WHERE num=? LIMIT 1";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $jsonFilePath, PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $num, PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
echo json_encode(['error' => $Exception->getMessage()], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
$data = [
|
||||
'num' => $num,
|
||||
'realiList source' => $_POST['realiList'],
|
||||
'json_file' => $jsonFilePath,
|
||||
'realiList_jsondata' => $realiList_jsondata,
|
||||
'message' => 'JSON data saved to file and database updated successfully.'
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
?>
|
||||
51
output/insert_recordbending.php
Normal file
51
output/insert_recordbending.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : '';
|
||||
|
||||
include '_request.php';
|
||||
|
||||
// json 형태는 저장할때 주의해야 한다.
|
||||
if (isset($_POST['recordbending'])) {
|
||||
$recordbending_jsondata = json_decode($_POST['recordbending'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$recordbending_jsondata = null;
|
||||
}
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
$pdo->beginTransaction();
|
||||
// 추가된 컬럼도 업데이트에 포함
|
||||
$sql = "UPDATE $DB.$tablename
|
||||
SET recordbending=?
|
||||
WHERE num=? LIMIT 1";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, json_encode($recordbending_jsondata), PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $num, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
}
|
||||
|
||||
$data = [
|
||||
'num' => $num,
|
||||
'recordbending_jsondata' => $recordbending_jsondata
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
?>
|
||||
52
output/insert_recordscreen.php
Normal file
52
output/insert_recordscreen.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : '';
|
||||
|
||||
include '_request.php';
|
||||
|
||||
// json 형태는 저장할때 주의해야 한다.
|
||||
if (isset($_POST['recordscreen'])) {
|
||||
$recordscreen_jsondata = json_decode($_POST['recordscreen'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$recordscreen_jsondata = null;
|
||||
}
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
$update_log = date("Y-m-d H:i:s") . " - " . $_SESSION["name"] . " " . $update_log . "
";
|
||||
// 공백 2개 이상 제거
|
||||
$update_log = preg_replace('/\s{2,}/', ' ', $update_log);
|
||||
$pdo->beginTransaction();
|
||||
$sql = "UPDATE $DB.$tablename SET recordscreen=?, update_log=? WHERE num=? LIMIT 1";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, json_encode($recordscreen_jsondata), PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $update_log, PDO::PARAM_STR);
|
||||
$stmh->bindValue(3, $num, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
}
|
||||
|
||||
$data = [
|
||||
'num' => $num,
|
||||
'is_deleted' => $is_deleted
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
?>
|
||||
54
output/insert_recordslat.php
Normal file
54
output/insert_recordslat.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : '';
|
||||
|
||||
include '_request.php';
|
||||
|
||||
// json 형태는 저장할때 주의해야 한다.
|
||||
if (isset($_POST['recordslat'])) {
|
||||
$recordslat_jsondata = json_decode($_POST['recordslat'], true);
|
||||
} else {
|
||||
// Error handling or fallback
|
||||
$recordslat_jsondata = null;
|
||||
}
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
// 자료수정
|
||||
$update_log = date("Y-m-d H:i:s") . " - " . $_SESSION["name"] . " " . $update_log . "
";
|
||||
// 공백 2개 이상 제거
|
||||
$update_log = preg_replace('/\s{2,}/', ' ', $update_log);
|
||||
|
||||
$pdo->beginTransaction();
|
||||
$sql = "UPDATE $DB.$tablename SET recordslat=?, update_log=? WHERE num=? LIMIT 1";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, json_encode($recordslat_jsondata), PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $update_log, PDO::PARAM_STR);
|
||||
$stmh->bindValue(3, $num, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
}
|
||||
|
||||
$data = [
|
||||
'num' => $num,
|
||||
'is_deleted' => $is_deleted
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
?>
|
||||
53
output/insert_screenMid.php
Normal file
53
output/insert_screenMid.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : '';
|
||||
$update_log = isset($_REQUEST['update_log']) ? $_REQUEST['update_log'] : ''; // 추가된 부분
|
||||
|
||||
include '_request.php';
|
||||
|
||||
if (isset($_POST['recordscreenMid'])) {
|
||||
$recordscreenMid_jsondata = json_decode($_POST['recordscreenMid'], true);
|
||||
} else {
|
||||
$recordscreenMid_jsondata = null;
|
||||
}
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
$update_log = date("Y-m-d H:i:s") . " - " . $_SESSION["name"] . " " . $update_log . "
";
|
||||
// 공백 2개 이상 제거
|
||||
$update_log = preg_replace('/\s{2,}/', ' ', $update_log);
|
||||
$pdo->beginTransaction();
|
||||
|
||||
$sql = "UPDATE $DB.$tablename
|
||||
SET recordscreenMid=?, update_log=? WHERE num=? LIMIT 1";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, json_encode($recordscreenMid_jsondata), PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $update_log, PDO::PARAM_STR);
|
||||
$stmh->bindValue(3, $num, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
}
|
||||
|
||||
$data = [
|
||||
'num' => $num,
|
||||
'is_deleted' => $is_deleted ?? null,
|
||||
'recordscreenMid_jsondata' => $recordscreenMid_jsondata
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
?>
|
||||
64
output/insert_slatMid.php
Normal file
64
output/insert_slatMid.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
header("Content-Type: application/json");
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '';
|
||||
$tablename = isset($_REQUEST['tablename']) ? $_REQUEST['tablename'] : '';
|
||||
$update_log = isset($_REQUEST['update_log']) ? $_REQUEST['update_log'] : '';
|
||||
|
||||
if (isset($_POST['recordslatMid'])) {
|
||||
$recordslatMid_jsondata = json_decode($_POST['recordslatMid'], true);
|
||||
} else {
|
||||
$recordslatMid_jsondata = null;
|
||||
}
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try {
|
||||
// 디버그: 전달받은 값 로그 확인
|
||||
error_log("num: $num");
|
||||
error_log("tablename: $tablename");
|
||||
error_log("recordslatMid_jsondata: " . json_encode($recordslatMid_jsondata));
|
||||
|
||||
$pdo->beginTransaction();
|
||||
|
||||
// SQL 디버그: 쿼리 확인
|
||||
$sql = "UPDATE {$DB}.{$tablename}
|
||||
SET recordslatMid=? WHERE num=? LIMIT 1";
|
||||
error_log("SQL: $sql");
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, json_encode($recordslatMid_jsondata), PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $num, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
|
||||
// 디버그: 쿼리 실행 후 확인
|
||||
if ($stmh->rowCount() > 0) {
|
||||
error_log("데이터가 성공적으로 업데이트되었습니다.");
|
||||
} else {
|
||||
error_log("업데이트된 행이 없습니다. num 또는 tablename 확인 필요.");
|
||||
}
|
||||
|
||||
$pdo->commit();
|
||||
} catch (PDOException $Exception) {
|
||||
error_log("오류: " . $Exception->getMessage());
|
||||
$pdo->rollBack();
|
||||
echo json_encode(['error' => $Exception->getMessage()], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
// 반환 데이터 로그 확인
|
||||
$data = [
|
||||
'num' => $num,
|
||||
'recordslatMid_jsondata' => $recordslatMid_jsondata
|
||||
];
|
||||
error_log("반환 데이터: " . json_encode($data));
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
?>
|
||||
1
output/json/screen_20250704T143823557Z.json
Normal file
1
output/json/screen_20250704T143823557Z.json
Normal file
@@ -0,0 +1 @@
|
||||
[{"col1":"1","col2":"","col3":"FSS-01","col4":"KSS02","col5":"실리카","col6":"벽면형(120*70)","col7":"SUS마감","col8":"1330","col9":"1950","col10_SW":"1490","col11_SH":"2300","col10":"1490","col11":"2300","col12":"3.43","col13":"25.70","col14":"1","col15":"1","col16":"","col17":"","col18_brand":"경동(견적가포함)","col18":"220V","col18_wireless":"유선","col19":"150K","col20":"380*180","col21":"4","col22":"40*40*380","col23":"2200","col24":"2","col25":"","col26":"","col27":"","col28":"","col29":"130*80","col30":"130*80","col31":"4","col32":"","col33":"","col34":"","col35":"","col36":"500*350","col36_custom":"","col36_frontbottom":"50","col36_railwidth":"70","col36_boxdirection":"양면","col37":"1550","col38":"","col39":"1","col40":"","col41":"","col42":"","col43":"","col44":"2","col45":"505*355","col45_wing":"50","col46":"2","col47":"2","col48":"1330","col49":"1","col50":"","col51":"1550","col52":"2","col53":"","col54":"1550","col55":"1","col56":"","col57":"1","col58":"4","col59_inch":"2인치","col59_length":"300","col59":"1","col60":"1","col61":"","col62":"","col63":"","col64":"","col65":"","col66":"3","col67":"10550","col68":"6","col69":"","col70":"1","col71":"1"}]
|
||||
1
output/json/screen_20250704T143825700Z.json
Normal file
1
output/json/screen_20250704T143825700Z.json
Normal file
@@ -0,0 +1 @@
|
||||
[{"col1":"1","col2":"","col3":"FSS-01","col4":"KSS02","col5":"실리카","col6":"벽면형(120*70)","col7":"SUS마감","col8":"1330","col9":"1950","col10_SW":"1490","col11_SH":"2300","col10":"1490","col11":"2300","col12":"3.43","col13":"25.70","col14":"1","col15":"1","col16":"","col17":"","col18_brand":"경동(견적가포함)","col18":"220V","col18_wireless":"유선","col19":"150K","col20":"380*180","col21":"4","col22":"40*40*380","col23":"2200","col24":"2","col25":"","col26":"","col27":"","col28":"","col29":"130*80","col30":"130*80","col31":"4","col32":"","col33":"","col34":"","col35":"","col36":"500*350","col36_custom":"","col36_frontbottom":"50","col36_railwidth":"70","col36_boxdirection":"양면","col37":"1550","col38":"","col39":"1","col40":"","col41":"","col42":"","col43":"","col44":"2","col45":"505*355","col45_wing":"50","col46":"2","col47":"2","col48":"1330","col49":"1","col50":"","col51":"1550","col52":"2","col53":"","col54":"1550","col55":"1","col56":"","col57":"1","col58":"4","col59_inch":"2인치","col59_length":"300","col59":"1","col60":"1","col61":"","col62":"","col63":"","col64":"","col65":"","col66":"3","col67":"10550","col68":"6","col69":"","col70":"1","col71":"1"}]
|
||||
602
output/list.php
Normal file
602
output/list.php
Normal file
@@ -0,0 +1,602 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if(!isset($_SESSION["level"]) || $_SESSION["level"]>5) {
|
||||
sleep(1);
|
||||
header("Location:" . $WebSite . "login/login_form.php");
|
||||
exit;
|
||||
}
|
||||
include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php';
|
||||
|
||||
// 권한 부여
|
||||
$authorities = ["개발자","전진","노완호","이세희","함신옥","손금주","이은진","이경호","이세희","함신옥"];
|
||||
|
||||
$option = $_REQUEST['option'] ?? ''; // 조회시 조건 부여
|
||||
if($option == '미출고') {
|
||||
$title_message = '미출고 수주 List';
|
||||
$existing_status=$_REQUEST["status_option"] ?? '미출고' ;
|
||||
}
|
||||
else {
|
||||
$title_message = '경동기업 수주 List';
|
||||
$existing_status=$_REQUEST["status_option"] ?? '전체' ;
|
||||
}
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$developer_filter = $_REQUEST['developer_filter'] ?? '';
|
||||
|
||||
// echo '개발자 모드 ' . $developer_filter;
|
||||
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if(isset($_REQUEST["separate_date"]))
|
||||
$separate_date=$_REQUEST["separate_date"];
|
||||
else
|
||||
$separate_date="";
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if($separate_date=="") $separate_date="1";
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
if($option == '미출고') {
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("- 120 months", strtotime($currentDate))); // 1개월 이전 날짜 1주전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+4 months", strtotime($currentDate))); // 4개월 이후
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 weeks", strtotime($currentDate))); // 1개월 이전 날짜 1주전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+3 months", strtotime($currentDate))); // 3개월 이전 날짜
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
}
|
||||
|
||||
// 개발모드인 경우는 일자를 1년전에서 시작한다.
|
||||
if (in_array($user_name, $authorities, true) && $developer_filter === 'on') {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 year", strtotime($currentDate)));
|
||||
}
|
||||
|
||||
|
||||
if($separate_date == "1")
|
||||
$SettingDate = "outdate";
|
||||
else
|
||||
$SettingDate = "indate";
|
||||
|
||||
// 진행상태에 대한 검색
|
||||
$orderby = " order by " . $SettingDate . " desc, num desc"; // 내림차순 전체
|
||||
|
||||
if ($existing_status == '전체') {
|
||||
$where = " where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') and (is_deleted = '0' or is_deleted is null) " ;
|
||||
$searchwhere = " where is_deleted = '0' and searchtag like '%$search%'" ;
|
||||
} else if ($existing_status == '미출고') {
|
||||
$where = " where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') and (is_deleted = '0' or is_deleted is null) and regist_state != '완료' " ;
|
||||
$searchwhere = " where is_deleted = '0' and regist_state != '완료' and searchtag like '%$search%'" ;
|
||||
}
|
||||
else {
|
||||
$where = " where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') and (is_deleted = '0' or is_deleted is null) and regist_state = '$existing_status'" ;
|
||||
$searchwhere = " where is_deleted = '0' and regist_state = '$existing_status' and searchtag like '%$search%'" ;
|
||||
}
|
||||
|
||||
// 개발모드에 따라 검색하는 로직
|
||||
if(in_array($user_name, $authorities, true) && $developer_filter == 'on') {
|
||||
$where .= " and devMode = '1' ";
|
||||
$searchwhere .= " and devMode = '1' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$where .= " and (devMode <> '1' OR devMode IS NULL) ";
|
||||
$searchwhere .= " and (devMode <> '1' OR devMode IS NULL) ";
|
||||
}
|
||||
|
||||
|
||||
$where .= $orderby;
|
||||
$searchwhere .= $orderby;
|
||||
|
||||
// 수정된 쿼리: outputnum이 존재하는 자료만 선택
|
||||
if ($search == "") {
|
||||
$sql = "select * from $DB.$tablename " . $where;
|
||||
} else {
|
||||
$sql = "select * from $DB.$tablename " . $searchwhere;
|
||||
}
|
||||
|
||||
$today=date("Y-m-d"); // 현재일자 변수지정
|
||||
|
||||
// print $sql;
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_row = $stmh->rowCount();
|
||||
|
||||
$total_sum=0;
|
||||
$total_m2=0;
|
||||
$total_egi=0;
|
||||
$total_egi_m2=0;
|
||||
?>
|
||||
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
<input type="hidden" id="option" name="option" value="<?=$option?>">
|
||||
<div class="container-fluid">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-end align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm " onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
<?php if($user_id == "pro") : ?>
|
||||
<button type="button" class="btn btn-danger btn-sm mx-3" onclick="location.href='list1.php'">개발자 list1.php </button>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
// // 권한 검사: $user_id 가 $authorities 배열에 있으면 버튼 출력
|
||||
// if (in_array($user_name, $authorities, true)) :
|
||||
// echo '<button type="button" class="btn btn-outline-danger btn-sm mx-3" onclick="location.href=\'list1.php\'">
|
||||
// 개발 화면
|
||||
// </button>';
|
||||
// endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="d-flex justify-content-end align-items-center ">
|
||||
<h5> <span id="total_screen" class="text-primary me-2"></span>
|
||||
<span id="total_screen_m2" class="badge bg-primary me-5"></span>
|
||||
<span id="total_egi" class="text-secondary me-2"></span>
|
||||
<span id="total_egi_m2" class="badge bg-secondary me-2"></span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<?php if($option !== '미출고') : ?>
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-start align-items-center">
|
||||
<label>
|
||||
<input type="radio" name="status_option" value="전체" onclick="submitForm('전체');" <?php if($existing_status == '전체') echo 'checked'; ?>>
|
||||
<span class="badge bg-secondary me-2 " style="font-size:12px;" >전체</span>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="status_option" value="등록" onclick="submitForm('등록');" <?php if($existing_status == '등록') echo 'checked'; ?>>
|
||||
<span class="badge bg-danger me-2 " style="font-size:12px;" >등록</span>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="status_option" value="수정" onclick="submitForm('수정');" <?php if($existing_status == '수정') echo 'checked'; ?>>
|
||||
<span class="badge bg-warning me-2 " style="font-size:12px;" >수정</span>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="status_option" value="접수" onclick="submitForm('접수');" <?php if($existing_status == '접수') echo 'checked'; ?>>
|
||||
<span class="badge bg-success me-2 " style="font-size:12px;">접수</span>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="status_option" value="완료" onclick="submitForm('완료');" <?php if($existing_status == '완료') echo 'checked'; ?>>
|
||||
<span class="badge bg-dark me-2 " style="font-size:12px;" >완료</span>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="status_option" value="미출고" onclick="submitForm('미출고');" <?php if($existing_status == '미출고') echo 'checked'; ?>>
|
||||
<span class="badge bg-primary me-2 " style="font-size:12px;" >미출고</span>
|
||||
</label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-start align-items-center">
|
||||
▷ <?= $total_row ?>
|
||||
<label> 출고일 <input type="radio" name="separate_date" value="1" <?= $separate_date == "1" ? 'checked' : '' ?>></label>
|
||||
<label> 접수일 <input type="radio" name="separate_date" class="me-3" value="2" <?= $separate_date == "2" ? 'checked' : '' ?>></label>
|
||||
|
||||
<?php if(in_array($user_name, $authorities, true) ): ?>
|
||||
<?php
|
||||
$checked = (isset($developer_filter) && $developer_filter === 'on') ? 'checked' : '';
|
||||
$checkMessage = (isset($developer_filter) && $developer_filter === 'on') ? '개발모드' : '개발모드';
|
||||
?>
|
||||
<label> <?= $checkMessage ?>
|
||||
<input type="checkbox" id="developer_filter" name="developer_filter" class="mx-3" <?= $checked ?>>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<button type="button" id="premonth" class="btn btn-dark btn-sm me-1 " onclick='yesterday()' > 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1 " onclick='this_today()' > 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1 " onclick='this_tomorrow()' > 익일 </button>
|
||||
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>" > ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?=$todate?>" >
|
||||
|
||||
<!-- <button type="button" id ="Fromthistoday" type='button' class="btn btn-dark btn-sm me-1 " onclick='Fromthis_today()' > 금일이후 </button>
|
||||
<button type="button" id ="Fromtomorrow" type='button' class="btn btn-dark btn-sm me-1 " onclick='From_tomorrow()' > 익일이후 </button>
|
||||
-->
|
||||
|
||||
</span>
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control mx-1" style="width:150px;height:30px;" >
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
<div id="autocomplete-list">
|
||||
</div>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm" > <i class="bi bi-search"></i> 검색 </button>
|
||||
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" id="writeBtn"> <i class="bi bi-pencil-fill"></i> 신규 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" onclick="popupCenter('delivery.php','경동 출고List',1800,900);"> <i class="bi bi-print"></i> </ion-icon> 화물/택배 출고List </button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--card-body-->
|
||||
</div> <!--card -->
|
||||
</div> <!--container-fluid -->
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<table class="table table-hover table-sm" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center" style="width:30px;">번호</th>
|
||||
<th class="text-center" style="width:90px;">출고</th>
|
||||
<th class="text-center" style="width:40px;">접수</th>
|
||||
<th class="text-center" style="width:30px;">진행</th>
|
||||
<th class="text-center" style="width:40px;">절곡</th>
|
||||
<th class="text-center" style="width:30px;">모터</th>
|
||||
<th class="text-center" style="width:100px;">발주처</th>
|
||||
<th class="text-center" style="width:60px;">모델</th>
|
||||
<th class="text-center" style="width:140px;">현장명</th>
|
||||
<th class="text-center" style="width:80px;">수신자</th>
|
||||
<th class="text-center" style="width:120px;">수신 주소</th>
|
||||
<th class="text-center" style="width:90px;"><i class="bi bi-telephone-fill"> </i> 수신처</th>
|
||||
<th class="text-start" style="width:45px; "><i class="bi bi-truck"></i> 운송</th>
|
||||
<th class="text-center" style="width:40px;">담당</th>
|
||||
<th class="text-center" style="width:30px;">틀수</th>
|
||||
<th class="text-center" style="width:30px;">(㎡)</th>
|
||||
<!-- <th class="text-center" style="width:50px;">인정</th> -->
|
||||
<th class="text-center" style="width:250px;">비고</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
$total_m2_formatted = 0 ;
|
||||
$total_egi_m2_formatted = 0 ;
|
||||
|
||||
$total_screen_sum = 0;
|
||||
$total_screen_m2 = 0;
|
||||
|
||||
$total_egi_sum = 0;
|
||||
$total_egi_m2 = 0;
|
||||
|
||||
if($total_row>10000) {
|
||||
echo '<tr> <td colspan="18"> <span class="text-primary fs-3"> 검색량이 10000개 넘어갑니다. 검색 기간을 변경 후 검색하세요! </span> </td><tr>';
|
||||
}
|
||||
else {
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
include '_row.php';
|
||||
|
||||
// 콤마를 제거하고 숫자로 변환
|
||||
$screen_su_cleaned = floatval(str_replace(',', '', $screen_su));
|
||||
$screen_m2_cleaned = floatval(str_replace(',', '', $screen_m2));
|
||||
|
||||
$slat_su_cleaned = floatval(str_replace(',', '', $slat_su));
|
||||
$slat_m2_cleaned = floatval(str_replace(',', '', $slat_m2));
|
||||
|
||||
$screenlists = json_decode($screenlist, true);
|
||||
// var_dump($screenlists["screen_m2"]);
|
||||
|
||||
if($steel!="1")
|
||||
$bend_state="";
|
||||
|
||||
if($motor=="1")
|
||||
$motor="모터";
|
||||
|
||||
if($root=="주일")
|
||||
$root_font="text-dark";
|
||||
else
|
||||
$root_font="text-primary";
|
||||
|
||||
$date_font="text-dark"; // 현재일자 Red 색상으로 표기
|
||||
if($today==$outdate) {
|
||||
$date_font="text-danger";
|
||||
}
|
||||
|
||||
$font="text-dark";
|
||||
switch ($delivery) {
|
||||
case "상차(선불)" : $font="text-dark"; break;
|
||||
case "상차(착불)" :$font="color-grey" ; break;
|
||||
case "경동화물(선불)" :$font="color-brown"; break;
|
||||
case "경동화물(착불)" :$font="color-brown"; break;
|
||||
case "경동택배(선불)" :$font="color-brown"; break;
|
||||
case "경동택배(착불)" :$font="color-brown"; break;
|
||||
case "직접배차" :$font="color-purple"; break;
|
||||
case "직접수령" :$font="text-danger"; break;
|
||||
case "대신화물(선불)" :$font="color-blue"; break;
|
||||
case "대신화물(착불)" :$font="color-blue"; break;
|
||||
case "대신택배(선불)" :$font="color-blue"; break;
|
||||
case "대신택배(착불)" :$font="color-blue"; break;
|
||||
}
|
||||
|
||||
if($outdate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ;
|
||||
$formatedoutdate = $outdate;
|
||||
$formatedindate = date("m-d",strtotime($indate));
|
||||
}
|
||||
?>
|
||||
<tr onclick="redirectToView('<?= $num ?>', '<?= $tablename ?>')">
|
||||
<td class="text-center" ><?= $start_num ?></td>
|
||||
<td class="text-center" data-outdate="<?=$outdate ?>"> <?= $formatedoutdate ?></td>
|
||||
<td class="text-center" data-indate="<?=$indate ?>"> <?= $formatedindate ?></td>
|
||||
<td class="text-center" >
|
||||
<?php
|
||||
switch ($regist_state) {
|
||||
case "등록" :
|
||||
$regist_word="등록";
|
||||
echo '<span class="badge bg-danger">' .$regist_word . '</span>';
|
||||
break;
|
||||
case "수정" :
|
||||
$regist_word="수정";
|
||||
echo '<span class="badge bg-warning blink">' .$regist_word . '</span>';
|
||||
break;
|
||||
case "접수" :
|
||||
$regist_word="접수";
|
||||
echo '<span class="badge bg-success">' .$regist_word . '</span>';
|
||||
break;
|
||||
case "완료" :
|
||||
$regist_word="완료";
|
||||
echo '<span class="badge bg-dark">' .$regist_word . '</span>';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="text-center"><?= $bend_state ?></td>
|
||||
<td class="text-center"><?= $motor ?></td>
|
||||
<td class="text-start" ><?= $secondord ?></td>
|
||||
<td class="text-center" ><?= $prodCode ?></td>
|
||||
<td class="text-start" ><?= $outworkplace ?></td>
|
||||
<td class="text-start" ><?= $receiver ?></td>
|
||||
<td class="text-start" ><?= $outputplace ?></td>
|
||||
<td class="text-start" ><?= $phone ?></td>
|
||||
<td class="text-start" >
|
||||
<?php
|
||||
if (strpos($delivery, '경동') !== false) {
|
||||
echo '<span class="text-primary">' . $delivery . '</span>';
|
||||
} else if (strpos($delivery, '대신') !== false) {
|
||||
echo '<span class="text-success">' . $delivery . '</span>';
|
||||
} else {
|
||||
switch ($delivery) {
|
||||
case "직접배차":
|
||||
echo '<span class="badge bg-secondary">' . $delivery . '</span>';
|
||||
break;
|
||||
case "직접수령":
|
||||
echo '<span class="badge bg-dark">' . $delivery . '</span>';
|
||||
break;
|
||||
case "상차(선불)":
|
||||
echo '<span class="badge bg-info">' . $delivery . '</span>';
|
||||
break;
|
||||
case "상차(착불)":
|
||||
echo '<span class="badge bg-warning">' . $delivery . '</span>';
|
||||
break;
|
||||
default:
|
||||
echo '<span class="text-dark">' . $delivery . '</span>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="text-center"><?= $orderman ?></td>
|
||||
<?php
|
||||
$row_sum = $screen_su_cleaned + $slat_su_cleaned ;
|
||||
$row_m2 = $screen_m2_cleaned + $slat_m2_cleaned ;
|
||||
|
||||
$row_sum_formatted = number_format($row_sum);
|
||||
$row_m2_formatted = number_format($row_m2, 1);
|
||||
|
||||
if ($row_sum_formatted > 0)
|
||||
print '<td class="text-end" style=>' . $row_sum_formatted . '</td>';
|
||||
else
|
||||
print '<td class="text-end" style=> </td>';
|
||||
|
||||
if ($row_m2_formatted > 0)
|
||||
print '<td class="text-end" style=>' . $row_m2_formatted . '</td>';
|
||||
else
|
||||
print '<td class="text-end" style=> </td>';
|
||||
|
||||
$total_sum += $screen_su_cleaned;
|
||||
$total_m2 += $screen_m2_cleaned;
|
||||
$total_egi += $slat_su_cleaned;
|
||||
$total_egi_m2 += $slat_m2_cleaned;
|
||||
|
||||
// // 소수점 첫째자리까지만 포맷팅
|
||||
$total_m2_formatted = number_format($total_m2, 1);
|
||||
$total_egi_m2_formatted = number_format($total_egi_m2, 1);
|
||||
?>
|
||||
<!-- <td class="text-center"></td> -->
|
||||
<td class="text-start">
|
||||
<?= $comment ?>
|
||||
<?php if (!empty($updatecomment) && $regist_state !== '완료'): ?>
|
||||
<span class="text-danger fw-bold blink"><?= $updatecomment ?></span>
|
||||
<?php else: ?>
|
||||
<span class="text-danger fw-bold"><?= $updatecomment ?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!--container-->
|
||||
|
||||
</form>
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var outputpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 100,
|
||||
"lengthMenu": [100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[1, 'desc']] // 출고예정기준 내림정렬
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var outputpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('outputpageNumber', outputpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
// // 검색 버튼 클릭 이벤트 처리 (form submit)
|
||||
// $('#board_form').on('submit', function(e) {
|
||||
// e.preventDefault();
|
||||
|
||||
// });
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(num, tablename) {
|
||||
var url = "write_form.php?mode=view&num=" + num + "&tablename=" + tablename;
|
||||
customPopup(url, '수주 내역', 1900, 920);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("input:radio[name=separate_date]").click(function() {
|
||||
process_list();
|
||||
})
|
||||
});
|
||||
|
||||
function process_list(){ // 접수일 출고일 라디오버튼 클릭시
|
||||
document.getElementById('search').value=null;
|
||||
// dataTable.page(0).draw(false); // 검색 후 첫 페이지로 이동
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#writeBtn").click(function(){
|
||||
var tablename = '<?php echo $tablename; ?>';
|
||||
var url = "write_form.php?tablename=" + tablename;
|
||||
customPopup(url, '수주내역', 1900, 920);
|
||||
});
|
||||
});
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
document.getElementById('total_screen').textContent = '스크린 : <?= $total_sum ?>';
|
||||
document.getElementById('total_screen_m2').textContent = '면적 : <?= $total_m2_formatted ?> ㎡';
|
||||
document.getElementById('total_egi').textContent = '철재(스라트) : <?= $total_egi ?>';
|
||||
document.getElementById('total_egi_m2').textContent = '면적 : <?= $total_egi_m2_formatted ?> ㎡';
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#developer_filter").change(function() {
|
||||
if (this.checked) {
|
||||
$('input[name=developer_filter]').val('on');
|
||||
} else {
|
||||
$('input[name=developer_filter]').val('');
|
||||
|
||||
// 현재 날짜에서 1주일 전 계산
|
||||
const today = new Date();
|
||||
today.setDate(today.getDate() - 7);
|
||||
const year = today.getFullYear();
|
||||
const month = String(today.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(today.getDate()).padStart(2, '0');
|
||||
const oneWeekAgo = `${year}-${month}-${day}`;
|
||||
|
||||
// #fromdate 필드에 값 설정
|
||||
$('#fromdate').val(oneWeekAgo);
|
||||
}
|
||||
document.getElementById('board_form').submit();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
601
output/list1.php
Normal file
601
output/list1.php
Normal file
@@ -0,0 +1,601 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if(!isset($_SESSION["level"]) || $_SESSION["level"]>5) {
|
||||
sleep(1);
|
||||
header("Location:" . $WebSite . "login/login_form.php");
|
||||
exit;
|
||||
}
|
||||
include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php';
|
||||
|
||||
// 권한 부여
|
||||
$authorities = ["개발자","전진","노완호","이세희","함신옥","손금주","이은진","이경호","이세희","함신옥"];
|
||||
|
||||
$option = $_REQUEST['option'] ?? ''; // 조회시 조건 부여
|
||||
if($option == '미출고') {
|
||||
$title_message = '(개발자전용) 미출고 수주 List';
|
||||
$existing_status=$_REQUEST["status_option"] ?? '미출고' ;
|
||||
}
|
||||
else {
|
||||
$title_message = '(개발자전용) 경동기업 수주 List';
|
||||
$existing_status=$_REQUEST["status_option"] ?? '전체' ;
|
||||
}
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$developer_filter = $_REQUEST['developer_filter'] ?? '';
|
||||
|
||||
// echo '개발자 모드 ' . $developer_filter;
|
||||
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if(isset($_REQUEST["separate_date"]))
|
||||
$separate_date=$_REQUEST["separate_date"];
|
||||
else
|
||||
$separate_date="";
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if($separate_date=="") $separate_date="1";
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
if($option == '미출고') {
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("- 120 months", strtotime($currentDate))); // 1개월 이전 날짜 1주전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+4 months", strtotime($currentDate))); // 4개월 이후
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 weeks", strtotime($currentDate))); // 1개월 이전 날짜 1주전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+3 months", strtotime($currentDate))); // 3개월 이전 날짜
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
}
|
||||
|
||||
// 개발모드인 경우는 일자를 1년전에서 시작한다.
|
||||
if (in_array($user_name, $authorities, true) && $developer_filter === 'on') {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 year", strtotime($currentDate)));
|
||||
}
|
||||
|
||||
|
||||
if($separate_date == "1")
|
||||
$SettingDate = "outdate";
|
||||
else
|
||||
$SettingDate = "indate";
|
||||
|
||||
// 진행상태에 대한 검색
|
||||
$orderby = " order by " . $SettingDate . " desc, num desc"; // 내림차순 전체
|
||||
|
||||
if ($existing_status == '전체') {
|
||||
$where = " where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') and (is_deleted = '0' or is_deleted is null) " ;
|
||||
$searchwhere = " where is_deleted = '0' and searchtag like '%$search%'" ;
|
||||
} else if ($existing_status == '미출고') {
|
||||
$where = " where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') and (is_deleted = '0' or is_deleted is null) and regist_state != '완료' " ;
|
||||
$searchwhere = " where is_deleted = '0' and regist_state != '완료' and searchtag like '%$search%'" ;
|
||||
}
|
||||
else {
|
||||
$where = " where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') and (is_deleted = '0' or is_deleted is null) and regist_state = '$existing_status'" ;
|
||||
$searchwhere = " where is_deleted = '0' and regist_state = '$existing_status' and searchtag like '%$search%'" ;
|
||||
}
|
||||
|
||||
// 개발모드에 따라 검색하는 로직
|
||||
if(in_array($user_name, $authorities, true) && $developer_filter == 'on') {
|
||||
$where .= " and devMode = '1' ";
|
||||
$searchwhere .= " and devMode = '1' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$where .= " and (devMode <> '1' OR devMode IS NULL) ";
|
||||
$searchwhere .= " and (devMode <> '1' OR devMode IS NULL) ";
|
||||
}
|
||||
|
||||
|
||||
$where .= $orderby;
|
||||
$searchwhere .= $orderby;
|
||||
|
||||
// 수정된 쿼리: outputnum이 존재하는 자료만 선택
|
||||
if ($search == "") {
|
||||
$sql = "select * from $DB.$tablename " . $where;
|
||||
} else {
|
||||
$sql = "select * from $DB.$tablename " . $searchwhere;
|
||||
}
|
||||
|
||||
$today=date("Y-m-d"); // 현재일자 변수지정
|
||||
|
||||
// print $sql;
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_row = $stmh->rowCount();
|
||||
|
||||
$total_sum=0;
|
||||
$total_m2=0;
|
||||
$total_egi=0;
|
||||
$total_egi_m2=0;
|
||||
?>
|
||||
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
<input type="hidden" id="option" name="option" value="<?=$option?>">
|
||||
<div class="container-fluid">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-end align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm " onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
<?php
|
||||
// // 권한 검사: $user_id 가 $authorities 배열에 있으면 버튼 출력
|
||||
// if (in_array($user_name, $authorities, true)) :
|
||||
// echo '<button type="button" class="btn btn-outline-danger btn-sm mx-3" onclick="location.href=\'list1.php\'">
|
||||
// 개발 화면
|
||||
// </button>';
|
||||
// endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="d-flex justify-content-end align-items-center ">
|
||||
<h5> <span id="total_screen" class="text-primary me-2"></span>
|
||||
<span id="total_screen_m2" class="badge bg-primary me-5"></span>
|
||||
<span id="total_egi" class="text-secondary me-2"></span>
|
||||
<span id="total_egi_m2" class="badge bg-secondary me-2"></span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<?php if($option !== '미출고') : ?>
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-start align-items-center">
|
||||
<label>
|
||||
<input type="radio" name="status_option" value="전체" onclick="submitForm('전체');" <?php if($existing_status == '전체') echo 'checked'; ?>>
|
||||
<span class="badge bg-secondary me-2 " style="font-size:12px;" >전체</span>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="status_option" value="등록" onclick="submitForm('등록');" <?php if($existing_status == '등록') echo 'checked'; ?>>
|
||||
<span class="badge bg-danger me-2 " style="font-size:12px;" >등록</span>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="status_option" value="수정" onclick="submitForm('수정');" <?php if($existing_status == '수정') echo 'checked'; ?>>
|
||||
<span class="badge bg-warning me-2 " style="font-size:12px;" >수정</span>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="status_option" value="접수" onclick="submitForm('접수');" <?php if($existing_status == '접수') echo 'checked'; ?>>
|
||||
<span class="badge bg-success me-2 " style="font-size:12px;">접수</span>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="status_option" value="완료" onclick="submitForm('완료');" <?php if($existing_status == '완료') echo 'checked'; ?>>
|
||||
<span class="badge bg-dark me-2 " style="font-size:12px;" >완료</span>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="status_option" value="미출고" onclick="submitForm('미출고');" <?php if($existing_status == '미출고') echo 'checked'; ?>>
|
||||
<span class="badge bg-primary me-2 " style="font-size:12px;" >미출고</span>
|
||||
</label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-start align-items-center">
|
||||
▷ <?= $total_row ?>
|
||||
<label> 출고일 <input type="radio" name="separate_date" value="1" <?= $separate_date == "1" ? 'checked' : '' ?>></label>
|
||||
<label> 접수일 <input type="radio" name="separate_date" class="me-3" value="2" <?= $separate_date == "2" ? 'checked' : '' ?>></label>
|
||||
|
||||
<?php if(in_array($user_name, $authorities, true) ): ?>
|
||||
<?php
|
||||
$checked = (isset($developer_filter) && $developer_filter === 'on') ? 'checked' : '';
|
||||
$checkMessage = (isset($developer_filter) && $developer_filter === 'on') ? '개발모드' : '개발모드';
|
||||
?>
|
||||
<label> <?= $checkMessage ?>
|
||||
<input type="checkbox" id="developer_filter" name="developer_filter" class="mx-3" <?= $checked ?>>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<button type="button" id="premonth" class="btn btn-dark btn-sm me-1 " onclick='yesterday()' > 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1 " onclick='this_today()' > 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1 " onclick='this_tomorrow()' > 익일 </button>
|
||||
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>" > ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?=$todate?>" >
|
||||
|
||||
<!-- <button type="button" id ="Fromthistoday" type='button' class="btn btn-dark btn-sm me-1 " onclick='Fromthis_today()' > 금일이후 </button>
|
||||
<button type="button" id ="Fromtomorrow" type='button' class="btn btn-dark btn-sm me-1 " onclick='From_tomorrow()' > 익일이후 </button>
|
||||
-->
|
||||
|
||||
</span>
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control mx-1" style="width:150px;height:30px;" >
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
<div id="autocomplete-list">
|
||||
</div>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm" > <i class="bi bi-search"></i> 검색 </button>
|
||||
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" id="writeBtn"> <i class="bi bi-pencil-fill"></i> 신규 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" onclick="popupCenter('delivery.php','경동 출고List',1800,900);"> <i class="bi bi-print"></i> </ion-icon> 화물/택배 출고List </button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--card-body-->
|
||||
</div> <!--card -->
|
||||
</div> <!--container-fluid -->
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<table class="table table-hover table-sm" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center" style="width:30px;">번호</th>
|
||||
<th class="text-center" style="width:90px;">출고</th>
|
||||
<th class="text-center" style="width:40px;">접수</th>
|
||||
<th class="text-center" style="width:30px;">진행</th>
|
||||
<th class="text-center" style="width:40px;">절곡</th>
|
||||
<th class="text-center" style="width:30px;">모터</th>
|
||||
<th class="text-center" style="width:100px;">발주처</th>
|
||||
<th class="text-center" style="width:60px;">모델</th>
|
||||
<th class="text-center" style="width:140px;">현장명</th>
|
||||
<th class="text-center" style="width:80px;">수신자</th>
|
||||
<th class="text-center" style="width:120px;">수신 주소</th>
|
||||
<th class="text-center" style="width:90px;"><i class="bi bi-telephone-fill"> </i> 수신처</th>
|
||||
<th class="text-start" style="width:45px; "><i class="bi bi-truck"></i> 운송</th>
|
||||
<th class="text-center" style="width:40px;">담당</th>
|
||||
<th class="text-center" style="width:30px;">틀수</th>
|
||||
<th class="text-center" style="width:30px;">(㎡)</th>
|
||||
<th class="text-center" style="width:50px;">인정</th>
|
||||
<th class="text-center" style="width:250px;">비고</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
$total_m2_formatted = 0 ;
|
||||
$total_egi_m2_formatted = 0 ;
|
||||
|
||||
$total_screen_sum = 0;
|
||||
$total_screen_m2 = 0;
|
||||
|
||||
$total_egi_sum = 0;
|
||||
$total_egi_m2 = 0;
|
||||
|
||||
if($total_row>10000) {
|
||||
echo '<tr> <td colspan="18"> <span class="text-primary fs-3"> 검색량이 10000개 넘어갑니다. 검색 기간을 변경 후 검색하세요! </span> </td><tr>';
|
||||
}
|
||||
else {
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
include '_row.php';
|
||||
|
||||
// 콤마를 제거하고 숫자로 변환
|
||||
$screen_su_cleaned = floatval(str_replace(',', '', $screen_su));
|
||||
$screen_m2_cleaned = floatval(str_replace(',', '', $screen_m2));
|
||||
|
||||
$slat_su_cleaned = floatval(str_replace(',', '', $slat_su));
|
||||
$slat_m2_cleaned = floatval(str_replace(',', '', $slat_m2));
|
||||
|
||||
$screenlists = json_decode($screenlist, true);
|
||||
// var_dump($screenlists["screen_m2"]);
|
||||
|
||||
if($steel!="1")
|
||||
$bend_state="";
|
||||
|
||||
if($motor=="1")
|
||||
$motor="모터";
|
||||
|
||||
if($root=="주일")
|
||||
$root_font="text-dark";
|
||||
else
|
||||
$root_font="text-primary";
|
||||
|
||||
$date_font="text-dark"; // 현재일자 Red 색상으로 표기
|
||||
if($today==$outdate) {
|
||||
$date_font="text-danger";
|
||||
}
|
||||
|
||||
$font="text-dark";
|
||||
switch ($delivery) {
|
||||
case "상차(선불)" : $font="text-dark"; break;
|
||||
case "상차(착불)" :$font="color-grey" ; break;
|
||||
case "경동화물(선불)" :$font="color-brown"; break;
|
||||
case "경동화물(착불)" :$font="color-brown"; break;
|
||||
case "경동택배(선불)" :$font="color-brown"; break;
|
||||
case "경동택배(착불)" :$font="color-brown"; break;
|
||||
case "직접배차" :$font="color-purple"; break;
|
||||
case "직접수령" :$font="text-danger"; break;
|
||||
case "대신화물(선불)" :$font="color-blue"; break;
|
||||
case "대신화물(착불)" :$font="color-blue"; break;
|
||||
case "대신택배(선불)" :$font="color-blue"; break;
|
||||
case "대신택배(착불)" :$font="color-blue"; break;
|
||||
}
|
||||
|
||||
if($outdate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ;
|
||||
$formatedoutdate = $outdate;
|
||||
$formatedindate = date("m-d",strtotime($indate));
|
||||
}
|
||||
?>
|
||||
<tr onclick="redirectToView('<?= $num ?>', '<?= $tablename ?>')">
|
||||
<td class="text-center" ><?= $start_num ?></td>
|
||||
<td class="text-center" data-outdate="<?=$outdate ?>"> <?= $formatedoutdate ?></td>
|
||||
<td class="text-center" data-indate="<?=$indate ?>"> <?= $formatedindate ?></td>
|
||||
<td class="text-center" >
|
||||
<?php
|
||||
switch ($regist_state) {
|
||||
case "등록" :
|
||||
$regist_word="등록";
|
||||
echo '<span class="badge bg-danger">' .$regist_word . '</span>';
|
||||
break;
|
||||
case "수정" :
|
||||
$regist_word="수정";
|
||||
echo '<span class="badge bg-warning blink">' .$regist_word . '</span>';
|
||||
break;
|
||||
case "접수" :
|
||||
$regist_word="접수";
|
||||
echo '<span class="badge bg-success">' .$regist_word . '</span>';
|
||||
break;
|
||||
case "완료" :
|
||||
$regist_word="완료";
|
||||
echo '<span class="badge bg-dark">' .$regist_word . '</span>';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="text-center"><?= $bend_state ?></td>
|
||||
<td class="text-center"><?= $motor ?></td>
|
||||
<td class="text-start" ><?= $secondord ?></td>
|
||||
<td class="text-center" ><?= $prodCode ?></td>
|
||||
<td class="text-start" ><?= $outworkplace ?></td>
|
||||
<td class="text-start" ><?= $receiver ?></td>
|
||||
<td class="text-start" ><?= $outputplace ?></td>
|
||||
<td class="text-start" ><?= $phone ?></td>
|
||||
<td class="text-start" >
|
||||
<?php
|
||||
if (strpos($delivery, '경동') !== false) {
|
||||
echo '<span class="text-primary">' . $delivery . '</span>';
|
||||
} else if (strpos($delivery, '대신') !== false) {
|
||||
echo '<span class="text-success">' . $delivery . '</span>';
|
||||
} else {
|
||||
switch ($delivery) {
|
||||
case "직접배차":
|
||||
echo '<span class="badge bg-secondary">' . $delivery . '</span>';
|
||||
break;
|
||||
case "직접수령":
|
||||
echo '<span class="badge bg-dark">' . $delivery . '</span>';
|
||||
break;
|
||||
case "상차(선불)":
|
||||
echo '<span class="badge bg-info">' . $delivery . '</span>';
|
||||
break;
|
||||
case "상차(착불)":
|
||||
echo '<span class="badge bg-warning">' . $delivery . '</span>';
|
||||
break;
|
||||
default:
|
||||
echo '<span class="text-dark">' . $delivery . '</span>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="text-center"><?= $orderman ?></td>
|
||||
<?php
|
||||
$row_sum = $screen_su_cleaned + $slat_su_cleaned ;
|
||||
$row_m2 = $screen_m2_cleaned + $slat_m2_cleaned ;
|
||||
|
||||
$row_sum_formatted = number_format($row_sum);
|
||||
$row_m2_formatted = number_format($row_m2, 1);
|
||||
|
||||
if ($row_sum_formatted > 0)
|
||||
print '<td class="text-end" style=>' . $row_sum_formatted . '</td>';
|
||||
else
|
||||
print '<td class="text-end" style=> </td>';
|
||||
|
||||
if ($row_m2_formatted > 0)
|
||||
print '<td class="text-end" style=>' . $row_m2_formatted . '</td>';
|
||||
else
|
||||
print '<td class="text-end" style=> </td>';
|
||||
|
||||
$total_sum += $screen_su_cleaned;
|
||||
$total_m2 += $screen_m2_cleaned;
|
||||
$total_egi += $slat_su_cleaned;
|
||||
$total_egi_m2 += $slat_m2_cleaned;
|
||||
|
||||
// // 소수점 첫째자리까지만 포맷팅
|
||||
$total_m2_formatted = number_format($total_m2, 1);
|
||||
$total_egi_m2_formatted = number_format($total_egi_m2, 1);
|
||||
?>
|
||||
<td class="text-center"><?= $warranty ?></td>
|
||||
<td class="text-start">
|
||||
<?= $comment ?>
|
||||
<?php if (!empty($updatecomment) && $regist_state !== '완료'): ?>
|
||||
<span class="text-danger fw-bold blink"><?= $updatecomment ?></span>
|
||||
<?php else: ?>
|
||||
<span class="text-danger fw-bold"><?= $updatecomment ?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!--container-->
|
||||
|
||||
</form>
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var outputpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 100,
|
||||
"lengthMenu": [100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[1, 'desc']] // 출고예정기준 내림정렬
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var outputpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('outputpageNumber', outputpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
// // 검색 버튼 클릭 이벤트 처리 (form submit)
|
||||
// $('#board_form').on('submit', function(e) {
|
||||
// e.preventDefault();
|
||||
|
||||
// });
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(num, tablename) {
|
||||
// 개발자전용
|
||||
var url = "write_form1.php?mode=view&num=" + num + "&tablename=" + tablename;
|
||||
customPopup(url, '수주 내역', 1900, 920);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("input:radio[name=separate_date]").click(function() {
|
||||
process_list();
|
||||
})
|
||||
});
|
||||
|
||||
function process_list(){ // 접수일 출고일 라디오버튼 클릭시
|
||||
document.getElementById('search').value=null;
|
||||
// dataTable.page(0).draw(false); // 검색 후 첫 페이지로 이동
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#writeBtn").click(function(){
|
||||
var tablename = '<?php echo $tablename; ?>';
|
||||
// 개발자전용
|
||||
var url = "write_form1.php?tablename=" + tablename;
|
||||
customPopup(url, '수주내역', 1900, 920);
|
||||
});
|
||||
});
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
document.getElementById('total_screen').textContent = '스크린 : <?= $total_sum ?>';
|
||||
document.getElementById('total_screen_m2').textContent = '면적 : <?= $total_m2_formatted ?> ㎡';
|
||||
document.getElementById('total_egi').textContent = '철재(스라트) : <?= $total_egi ?>';
|
||||
document.getElementById('total_egi_m2').textContent = '면적 : <?= $total_egi_m2_formatted ?> ㎡';
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#developer_filter").change(function() {
|
||||
if (this.checked) {
|
||||
$('input[name=developer_filter]').val('on');
|
||||
} else {
|
||||
$('input[name=developer_filter]').val('');
|
||||
|
||||
// 현재 날짜에서 1주일 전 계산
|
||||
const today = new Date();
|
||||
today.setDate(today.getDate() - 7);
|
||||
const year = today.getFullYear();
|
||||
const month = String(today.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(today.getDate()).padStart(2, '0');
|
||||
const oneWeekAgo = `${year}-${month}-${day}`;
|
||||
|
||||
// #fromdate 필드에 값 설정
|
||||
$('#fromdate').val(oneWeekAgo);
|
||||
}
|
||||
document.getElementById('board_form').submit();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
330
output/list_ACI.php
Normal file
330
output/list_ACI.php
Normal file
@@ -0,0 +1,330 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if (!isset($_SESSION["level"]) || $_SESSION["level"] > 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';
|
||||
$title_message = '인정검사';
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// 검색 조건 설정
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if (isset($_REQUEST["separate_date"])) {
|
||||
$separate_date = $_REQUEST["separate_date"];
|
||||
} else {
|
||||
$separate_date = "";
|
||||
}
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if ($separate_date == "") {
|
||||
$separate_date = "1";
|
||||
}
|
||||
|
||||
if (isset($_REQUEST["status_option"])) {
|
||||
$existing_status = $_REQUEST["status_option"];
|
||||
} else {
|
||||
$existing_status = '전체';
|
||||
}
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 weeks", strtotime($currentDate))); // 1주 전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+3 months", strtotime($currentDate))); // 3개월 후 날짜
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
|
||||
if ($separate_date == "1") {
|
||||
$SettingDate = "outdate";
|
||||
} else {
|
||||
$SettingDate = "indate";
|
||||
}
|
||||
|
||||
// 진행상태에 대한 검색
|
||||
$orderby = " ORDER BY " . $SettingDate . " DESC, num DESC"; // 내림차순 정렬
|
||||
|
||||
if ($existing_status == '전체') {
|
||||
$where = " WHERE CAST(" . $SettingDate . " AS CHAR) NOT IN ('', '0000-00-00') AND " . $SettingDate . " BETWEEN '$fromdate' AND '$Transtodate' AND is_deleted = '0' AND ACIregDate IS NOT NULL AND CAST(ACIregDate AS CHAR) NOT IN ('', '0000-00-00') " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND ACIregDate IS NOT NULL AND CAST(ACIregDate AS CHAR) NOT IN ('', '0000-00-00') AND searchtag LIKE '%$search%'" . $orderby;
|
||||
} else {
|
||||
$where = " WHERE CAST(" . $SettingDate . " AS CHAR) NOT IN ('', '0000-00-00') AND " . $SettingDate . " BETWEEN '$fromdate' AND '$Transtodate' AND is_deleted = '0' AND regist_state = '$existing_status' AND ACIregDate IS NOT NULL AND CAST(ACIregDate AS CHAR) NOT IN ('', '0000-00-00') " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND regist_state = '$existing_status' AND ACIregDate IS NOT NULL AND CAST(ACIregDate AS CHAR) NOT IN ('', '0000-00-00') AND searchtag LIKE '%$search%'" . $orderby;
|
||||
}
|
||||
|
||||
// 수정된 쿼리: ACIregDate이 존재하고 is_deleted가 0인 자료만 선택
|
||||
if ($search == "") {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $where;
|
||||
} else {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $searchwhere;
|
||||
}
|
||||
|
||||
// 현재일자 변수지정
|
||||
$today = date("Y-m-d");
|
||||
|
||||
// SQL 실행 및 데이터 처리
|
||||
print 'SQL ' . $sql;
|
||||
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_row = $stmh->rowCount();
|
||||
|
||||
$total_sum=0;
|
||||
$total_m2=0;
|
||||
$total_egi=0;
|
||||
$total_egi_m2=0;
|
||||
?>
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
|
||||
<div class="container">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-end align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm " onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="d-flex justify-content-end align-items-center ">
|
||||
<h5> <span id="total_screen" class="text-primary me-2"></span>
|
||||
<span id="total_screen_m2" class="badge bg-primary me-5"></span>
|
||||
<span id="total_egi" class="text-secondary me-2"></span>
|
||||
<span id="total_egi_m2" class="badge bg-secondary me-2"></span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-center align-items-center">
|
||||
▷ <?= $total_row ?>
|
||||
<button type="button" id="premonth" class="btn btn-dark btn-sm me-1" onclick='yesterday()' > 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1" onclick='this_today()' > 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" onclick='this_tomorrow()' > 익일 </button>
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>" > ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?=$todate?>" >
|
||||
</span>
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control" style="width:150px;" >
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
<div id="autocomplete-list">
|
||||
</div>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm" > <i class="bi bi-search"></i> 검색 </button>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--card-body-->
|
||||
</div> <!--card -->
|
||||
</div> <!--container-fluid -->
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<table class="table table-hover" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center" style="width:50px;">번호</th>
|
||||
<th class="text-center" style="width:80px;">접수</th>
|
||||
<th class="text-center" style="width:80px;">요청 </th>
|
||||
<th class="text-center" style="width:80px;">완료 </th>
|
||||
<th class="text-center" style="width:100px;">발주처</th>
|
||||
<th class="text-center" style="width:100px;">제품종류 </th>
|
||||
<th class="text-center" style="width:80px;">제품코드</th>
|
||||
<th class="text-center" style="width:50px;">수량(틀)</th>
|
||||
<th class="text-center" style="width:250px;">현장명</th>
|
||||
<th class="text-center" style="width:200px;">메모</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
include '_row.php';
|
||||
|
||||
if($ACIregDate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$ACIregDate = $ACIregDate . $week[ date('w', strtotime($ACIregDate) ) ] ;
|
||||
}
|
||||
|
||||
$shutterSurang = 0; // 셔터 수량 합계를 저장할 변수 초기화
|
||||
$shutterSurang_slat = 0; // 철재
|
||||
|
||||
// JSON 데이터를 배열로 디코딩
|
||||
$estimateListData = json_decode($estimateList, true);
|
||||
$estimateSlatListData = json_decode($estimateSlatList, true);
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($estimateList);
|
||||
// echo '</pre>';
|
||||
// echo '<pre>';
|
||||
// print_r($estimateSlatList);
|
||||
// echo '</pre>';
|
||||
|
||||
// 반복문을 통해 col14 값을 누적
|
||||
if (is_array($estimateList)) {
|
||||
foreach ($estimateList as $item) {
|
||||
$shutterSurang += isset($item['col14']) ? (int)$item['col14'] : 0;
|
||||
}
|
||||
}
|
||||
// slat 반복문을 통해 col15 값을 누적 slat
|
||||
if (is_array($estimateSlatList)) {
|
||||
foreach ($estimateSlatList as $item) {
|
||||
$shutterSurang_slat += isset($item['col15']) ? (int)$item['col15'] : 0;
|
||||
}
|
||||
}
|
||||
// 스크린,철재스라트 구분하기 JSON 데이터가 비어있는지 확인하여 값 설정
|
||||
$separate_item = '';
|
||||
// 스크린,철재스라트 구분하기 JSON 데이터가 비어있는지 확인하여 값 설정
|
||||
if (!empty(json_decode($estimateList, true))) {
|
||||
$separate_item = '스크린';
|
||||
} elseif (!empty(json_decode($estimateSlatList, true))) {
|
||||
$separate_item = '철재스라트';
|
||||
}
|
||||
if(!empty($separate_item))
|
||||
{
|
||||
?>
|
||||
<tr onclick="redirectToView('<?= $num ?>', '<?= $tablename ?>', '<?= $prodCode ?>')">
|
||||
<td class="text-center"><?= $start_num ?></td>
|
||||
<td class="text-center"><?= $ACIregDate ?></td>
|
||||
<td class="text-center"><?= $ACIaskDate === '0000-00-00' ? '' : $ACIaskDate ?></td>
|
||||
<td class="text-center"><?= $ACIdoneDate === '0000-00-00' ? '' : $ACIdoneDate ?></td>
|
||||
<td class="text-center"><?= $secondord ?></td>
|
||||
<td class="text-center<?= $separate_item === '철재스라트' ? ' text-primary' : '' ?>">
|
||||
<?= $separate_item ?>
|
||||
</td>
|
||||
<td class="text-center"><?= $prodCode ?></td>
|
||||
<td class="text-center"> <?= ($shutterSurang + $shutterSurang_slat) ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $ACImemo ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!--container-->
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var ACIpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 100,
|
||||
"lengthMenu": [100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[1, 'desc']] // 출고예정기준 내림정렬
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('ACIpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var ACIpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('ACIpageNumber', ACIpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('ACIpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('ACIpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(num, tablename, prodcode) {
|
||||
let prodName, arrayWidth, arrayHeight, url;
|
||||
|
||||
// prodcode에 따라 URL 설정
|
||||
if (prodcode.startsWith('KS') || prodcode.startsWith('KW')) {
|
||||
url = "write_ACI.php?num=" + num + "&tablename=" + tablename;
|
||||
} else {
|
||||
url = "write_ACI_slat.php?num=" + num + "&tablename=" + tablename;
|
||||
}
|
||||
|
||||
customPopup(url, '인정검사', 800, 900);
|
||||
}
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
375
output/list_POD.php
Normal file
375
output/list_POD.php
Normal file
@@ -0,0 +1,375 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if (!isset($_SESSION["level"]) || $_SESSION["level"] > 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';
|
||||
$title_message = '납품확인서 리스트';
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// 검색 조건 설정
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if (isset($_REQUEST["separate_date"])) {
|
||||
$separate_date = $_REQUEST["separate_date"];
|
||||
} else {
|
||||
$separate_date = "";
|
||||
}
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if ($separate_date == "") {
|
||||
$separate_date = "1";
|
||||
}
|
||||
|
||||
if (isset($_REQUEST["status_option"])) {
|
||||
$existing_status = $_REQUEST["status_option"];
|
||||
} else {
|
||||
$existing_status = '전체';
|
||||
}
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 weeks", strtotime($currentDate))); // 1주 전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+3 months", strtotime($currentDate))); // 3개월 후 날짜
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
|
||||
if ($separate_date == "1") {
|
||||
$SettingDate = "outdate";
|
||||
} else {
|
||||
$SettingDate = "indate";
|
||||
}
|
||||
|
||||
// 진행상태에 대한 검색
|
||||
$orderby = " ORDER BY " . $SettingDate . " DESC, num DESC"; // 내림차순 정렬
|
||||
|
||||
if ($existing_status == '전체') {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND COD IS NOT NULL AND COD != '' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND COD IS NOT NULL AND COD != '' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
} else {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND regist_state = '$existing_status' AND COD IS NOT NULL AND COD != '' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND regist_state = '$existing_status' AND COD IS NOT NULL AND COD != '' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
}
|
||||
|
||||
// 수정된 쿼리: COD이 존재하고 is_deleted가 0인 자료만 선택
|
||||
if ($search == "") {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $where;
|
||||
} else {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $searchwhere;
|
||||
}
|
||||
|
||||
// 현재일자 변수지정
|
||||
$today = date("Y-m-d");
|
||||
|
||||
// SQL 실행 및 데이터 처리
|
||||
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_row = $stmh->rowCount();
|
||||
|
||||
$total_sum=0;
|
||||
$total_m2=0;
|
||||
$total_egi=0;
|
||||
$total_egi_m2=0;
|
||||
?>
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
|
||||
<div class="container">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-end align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm " onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="d-flex justify-content-end align-items-center ">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-center align-items-center">
|
||||
▷ <?= $total_row ?>
|
||||
<button type="button" id="premonth" class="btn btn-dark btn-sm me-1 " onclick='yesterday()' > 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1 " onclick='this_today()' > 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1 " onclick='this_tomorrow()' > 익일 </button>
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>" > ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?=$todate?>" >
|
||||
</span>
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control" style="width:150px;" >
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
|
||||
<div id="autocomplete-list">
|
||||
</div>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm" > <i class="bi bi-search"></i> 검색 </button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--card-body-->
|
||||
</div> <!--card -->
|
||||
</div> <!--container-fluid -->
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<table class="table table-hover" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center" style="width:30px;">번호</th>
|
||||
<th class="text-center" style="width:120px;">출고일</th>
|
||||
<th class="text-center" style="width:100px;">접수일</th>
|
||||
<th class="text-center" style="width:90px;">작성일</th>
|
||||
<th class="text-center" style="width:100px;">제품종류 </th>
|
||||
<th class="text-center" style="width:100px;">제품코드</th>
|
||||
<th class="text-center" style="width:50px;">완료여부 </th>
|
||||
<th class="text-center" style="width:100px;">발주처</th>
|
||||
<th class="text-center" style="width:200px;">현장명</th>
|
||||
<th class="text-center" style="width:100px;">수신자</th>
|
||||
<th class="text-center" style="width:50px;">담당</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
|
||||
$total_m2_formatted = 0 ;
|
||||
$total_egi_m2_formatted = 0 ;
|
||||
|
||||
$total_screen_sum = 0;
|
||||
$total_screen_m2 = 0;
|
||||
|
||||
$total_egi_sum = 0;
|
||||
$total_egi_m2 = 0;
|
||||
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
include '_row.php';
|
||||
|
||||
// COD에서 작성일 및 작성자 추출
|
||||
$CODData = json_decode($row['COD'], true);
|
||||
$writerDate = isset($CODData[0]['approval']['writer']['date']) ? $CODData[0]['approval']['writer']['date'] : '';
|
||||
|
||||
$date_font="text-dark"; // 현재일자 Red 색상으로 표기
|
||||
if($today==$outdate) {
|
||||
$date_font="text-danger";
|
||||
}
|
||||
|
||||
if($outdate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ;
|
||||
}
|
||||
$separate_item = '';
|
||||
// 스크린,철재스라트 구분하기 JSON 데이터가 비어있는지 확인하여 값 설정
|
||||
if (!empty(json_decode($estimateList, true))) {
|
||||
$separate_item = '스크린';
|
||||
} elseif (!empty(json_decode($estimateSlatList, true))) {
|
||||
$separate_item = '철재스라트';
|
||||
}
|
||||
if(!empty($separate_item))
|
||||
{
|
||||
?>
|
||||
<tr onclick="redirectToView('<?= $num ?>', '<?= $tablename ?>', '<?= $separate_item ?>')">
|
||||
<td class="text-center"><?= $start_num ?></td>
|
||||
<td class="text-center"><?= $outdate ?></td>
|
||||
<td class="text-center"><?= $indate ?></td>
|
||||
<td class="text-center"><?= htmlspecialchars($writerDate) ?></td>
|
||||
<td class="text-center<?= $separate_item === '철재스라트' ? ' text-primary' : '' ?>">
|
||||
<?= $separate_item ?>
|
||||
</td>
|
||||
<td class="text-center"><?= $prodCode ?></td>
|
||||
<td class="text-center">
|
||||
<?php
|
||||
// COD에서 각 로트의 상태를 검사
|
||||
$CODData = json_decode($row['COD'], true);
|
||||
|
||||
// 기본값 설정
|
||||
$state = '등록전';
|
||||
$allCompleted = true; // 모든 LOT 번호가 입력되었는지 확인
|
||||
$hasInProgress = false; // 하나라도 입력된 상태가 있는지 확인
|
||||
|
||||
// COD 데이터가 유효할 경우 상태 확인
|
||||
if (is_array($CODData)) {
|
||||
// LOT 번호 배열이 있는지 확인
|
||||
$lotNumbers = isset($CODData[2]['lotNumbers']) ? $CODData[2]['lotNumbers'] : [];
|
||||
$wireLotNumbers = isset($CODData[3]['wireLotNumbers']) ? $CODData[3]['wireLotNumbers'] : [];
|
||||
|
||||
// 모든 LOT 번호가 입력되었는지 확인
|
||||
foreach ($lotNumbers as $lot) {
|
||||
if (trim($lot) === '') {
|
||||
$allCompleted = false;
|
||||
} else {
|
||||
$hasInProgress = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 모든 내화실 LOT 번호가 입력되었는지 확인
|
||||
foreach ($wireLotNumbers as $lot) {
|
||||
if (trim($lot) === '') {
|
||||
$allCompleted = false;
|
||||
} else {
|
||||
$hasInProgress = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 모든 LOT 번호가 입력된 경우 '완료'
|
||||
if ($allCompleted && $hasInProgress) {
|
||||
$state = '완료';
|
||||
}
|
||||
// 일부는 입력되었지만 모두 완료되지 않은 경우 '진행중'
|
||||
elseif ($hasInProgress) {
|
||||
$state = '진행중';
|
||||
}
|
||||
}
|
||||
|
||||
// 상태에 따라 출력
|
||||
switch ($state) {
|
||||
case "등록전":
|
||||
echo '<span class="badge bg-danger">등록전</span>';
|
||||
break;
|
||||
case "진행중":
|
||||
echo '<span class="badge bg-warning blink">진행중</span>';
|
||||
break;
|
||||
case "완료":
|
||||
echo '<span class="badge bg-dark">완료</span>';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="text-center"><?= $secondord ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $receiver ?></td>
|
||||
<td class="text-center"><?= $orderman ?></td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!--container-->
|
||||
|
||||
</form>
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var outputpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 100,
|
||||
"lengthMenu": [100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[1, 'desc']] // 출고예정기준 내림정렬
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var outputpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('outputpageNumber', outputpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(num, tablename, sep) {
|
||||
if(sep == '스크린')
|
||||
var url = "viewConfirm.php?num=" + num + "&tablename=" + tablename;
|
||||
else
|
||||
var url = "viewConfirm_slat.php?num=" + num + "&tablename=" + tablename;
|
||||
|
||||
customPopup(url, '납품확인서', 800, 900);
|
||||
}
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
278
output/list_QCdoc.php
Normal file
278
output/list_QCdoc.php
Normal file
@@ -0,0 +1,278 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if (!isset($_SESSION["level"]) || $_SESSION["level"] > 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';
|
||||
$title_message = '자동방화셔터 품질관리서';
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// 검색 날짜 파라미터 (GET)
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$search = $_REQUEST['search'] ?? '';
|
||||
$currentDate = date("Y-m-d");
|
||||
if (empty($fromdate) || empty($todate)) {
|
||||
$fromdate = date("Y-m-d", strtotime("-6 months", strtotime($currentDate)));
|
||||
$todate = date("Y-m-d", strtotime("+3 months", strtotime($currentDate)));
|
||||
}
|
||||
|
||||
// 유틸리티 함수: inputValue 배열에서 특정 id의 값을 찾음
|
||||
function getInputValue($inputArray, $id) {
|
||||
foreach ($inputArray as $item) {
|
||||
if ($item['id'] === $id) {
|
||||
return $item['value'];
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
// JSON 파일들이 저장된 폴더 (서버 경로)
|
||||
// 주의: 현재 스크립트의 위치에 따라 경로를 조정합니다.
|
||||
$jsonDir = $_SERVER['DOCUMENT_ROOT'] . "/output/qc_json/";
|
||||
$jsonFiles = glob($jsonDir . "*.json");
|
||||
|
||||
$records = array();
|
||||
foreach ($jsonFiles as $file) {
|
||||
$jsonContent = file_get_contents($file);
|
||||
$data = json_decode($jsonContent, true);
|
||||
if (!$data) continue;
|
||||
// "inputValue" 배열에 필요한 정보가 저장되어 있음.
|
||||
$inputValue = isset($data['inputValue']) ? $data['inputValue'] : array();
|
||||
$ACIregDate = getInputValue($inputValue, "ACIregDate");
|
||||
// 날짜 필터: ACIregDate가 존재하고, fromdate <= ACIregDate <= todate
|
||||
if (!empty($ACIregDate) && $ACIregDate >= $fromdate && $ACIregDate <= $todate) {
|
||||
$record = array(
|
||||
"ACIregDate" => $ACIregDate,
|
||||
"groupCode" => getInputValue($inputValue, "groupCode"),
|
||||
"outworkplace" => getInputValue($inputValue, "outworkplace"),
|
||||
"secondord" => getInputValue($inputValue, "secondord"),
|
||||
"outdate" => getInputValue($inputValue, "outdate"),
|
||||
"lotVolumn" => getInputValue($inputValue, "lotVolumn")
|
||||
);
|
||||
|
||||
// 검색어가 있을 경우, outworkplace와 secondord 필드 중 하나라도 검색어를 포함하는지 확인
|
||||
if (!empty($search)) {
|
||||
if (stripos($record['outworkplace'], $search) === false && stripos($record['secondord'], $search) === false) {
|
||||
continue; // 검색어가 없으면 이 레코드는 건너뜁니다.
|
||||
}
|
||||
}
|
||||
|
||||
// 추가 필드도 필요하면 여기에 추가합니다.
|
||||
$records[] = $record;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 내림차순 정렬 (접수일 기준)
|
||||
usort($records, function($a, $b) {
|
||||
return strcmp($b["ACIregDate"], $a["ACIregDate"]);
|
||||
});
|
||||
|
||||
$total_row = count($records);
|
||||
?>
|
||||
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
|
||||
<div class="container">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-end align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm " onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="d-flex justify-content-end align-items-center ">
|
||||
<h5> <span id="total_screen" class="text-primary me-2"></span>
|
||||
<span id="total_screen_m2" class="badge bg-primary me-5"></span>
|
||||
<span id="total_egi" class="text-secondary me-2"></span>
|
||||
<span id="total_egi_m2" class="badge bg-secondary me-2"></span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-center align-items-center">
|
||||
▷ <?= $total_row ?>
|
||||
|
||||
<!-- 작년 분기 버튼 -->
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm me-1" onclick="setLastYearQuarter(1)">작년 1분기</button>
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm me-1" onclick="setLastYearQuarter(2)">작년 2분기</button>
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm me-1" onclick="setLastYearQuarter(3)">작년 3분기</button>
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm me-1" onclick="setLastYearQuarter(4)">작년 4분기</button>
|
||||
<!-- 올해 분기 버튼 -->
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1" onclick="setQuarter(1)">1분기</button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1" onclick="setQuarter(2)">2분기</button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1" onclick="setQuarter(3)">3분기</button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1" onclick="setQuarter(4)">4분기</button>
|
||||
|
||||
<!-- 반기 버튼 -->
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" onclick="setHalfYear(1)">상반기</button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" onclick="setHalfYear(2)">하반기</button>
|
||||
|
||||
<!-- 날짜 입력 -->
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?= $fromdate ?>"> ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?= $todate ?>">
|
||||
|
||||
<!-- 검색 -->
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control mx-1" style="width:150px;height:30px;" >
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm"><i class="bi bi-search"></i> 검색 </button>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--card-body-->
|
||||
</div> <!--card -->
|
||||
</div> <!--container-fluid -->
|
||||
|
||||
<div class="container-fluid">
|
||||
<table class="table table-hover" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center" style="width:50px;">번호</th>
|
||||
<th class="text-center" style="width:80px;">접수일</th>
|
||||
<th class="text-center" style="width:120px;">품질관리서 번호</th>
|
||||
<th class="text-center" style="width:150px;">현장명</th>
|
||||
<th class="text-center" style="width:100px;">발주처</th>
|
||||
<th class="text-center" style="width:80px;">출고일</th>
|
||||
<th class="text-center" style="width:60px;">수량</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if ($total_row > 0) {
|
||||
$i = 1;
|
||||
foreach ($records as $record) {
|
||||
// 포맷: 접수일 날짜 뒤에 요일을 추가하고 싶다면 추가 처리 가능
|
||||
$ACIregDate = $record["ACIregDate"];
|
||||
$groupCode = $record["groupCode"];
|
||||
$outworkplace = $record["outworkplace"];
|
||||
$secondord = $record["secondord"];
|
||||
$outdate = $record["outdate"];
|
||||
$lotVolumn = $record["lotVolumn"];
|
||||
echo "<tr onclick=\"redirectToView('{$groupCode}')\">";
|
||||
echo "<td class=\"text-center\">{$i}</td>";
|
||||
echo "<td class=\"text-center\">{$ACIregDate}</td>";
|
||||
echo "<td class=\"text-center\">{$groupCode}</td>";
|
||||
echo "<td class=\"text-center\">{$outworkplace}</td>";
|
||||
echo "<td class=\"text-center\">{$secondord}</td>";
|
||||
echo "<td class=\"text-center\">{$outdate}</td>";
|
||||
echo "<td class=\"text-center\">{$lotVolumn}</td>";
|
||||
echo "</tr>";
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
echo "<tr><td colspan='7' class='text-center'>검색된 자료가 없습니다.</td></tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var QClistpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 100,
|
||||
"lengthMenu": [100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[1, 'desc']] // 출고예정기준 내림정렬
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('QClistpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var QClistpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('QClistpageNumber', QClistpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('QClistpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('QClistpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(groupCode) {
|
||||
let url;
|
||||
|
||||
url = "view_QCcertificate.php?groupCode=" + encodeURIComponent(groupCode) ;
|
||||
|
||||
customPopup(url, '', 800, 900);
|
||||
}
|
||||
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
417
output/list_QCsales.php
Normal file
417
output/list_QCsales.php
Normal file
@@ -0,0 +1,417 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if (!isset($_SESSION["level"]) || $_SESSION["level"] > 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';
|
||||
$title_message = '품질인정제품 판매실적';
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
<style>
|
||||
/* 테이블의 총 너비를 강제로 키움 */
|
||||
#myTable table {
|
||||
min-width: 3000px; /* 부모 요소보다 큰 너비 설정 */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// 검색 조건 설정
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if (isset($_REQUEST["separate_date"])) {
|
||||
$separate_date = $_REQUEST["separate_date"];
|
||||
} else {
|
||||
$separate_date = "";
|
||||
}
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if ($separate_date == "") {
|
||||
$separate_date = "1";
|
||||
}
|
||||
|
||||
if (isset($_REQUEST["status_option"])) {
|
||||
$existing_status = $_REQUEST["status_option"];
|
||||
} else {
|
||||
$existing_status = '전체';
|
||||
}
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$year = date("Y");
|
||||
$month = date("n");
|
||||
|
||||
// 현재 월을 기준으로 분기 계산
|
||||
if ($month >= 1 && $month <= 3) {
|
||||
$quarter = 1;
|
||||
$fromdate = "$year-01-01";
|
||||
$todate = "$year-03-31";
|
||||
} elseif ($month >= 4 && $month <= 6) {
|
||||
$quarter = 2;
|
||||
$fromdate = "$year-04-01";
|
||||
$todate = "$year-06-30";
|
||||
} elseif ($month >= 7 && $month <= 9) {
|
||||
$quarter = 3;
|
||||
$fromdate = "$year-07-01";
|
||||
$todate = "$year-09-30";
|
||||
} else {
|
||||
$quarter = 4;
|
||||
$fromdate = "$year-10-01";
|
||||
$todate = "$year-12-31";
|
||||
}
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
|
||||
if ($separate_date == "1") {
|
||||
$SettingDate = "ACIdoneDate";
|
||||
} else {
|
||||
$SettingDate = "ACIdoneDate";
|
||||
}
|
||||
|
||||
// 진행상태에 대한 검색
|
||||
$orderby = " ORDER BY " . $SettingDate . " DESC, num DESC"; // 내림차순 정렬
|
||||
|
||||
if ($existing_status == '전체') {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND ACIdoneDate IS NOT NULL AND ACIdoneDate != '' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND ACIdoneDate IS NOT NULL AND ACIdoneDate != '' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
} else {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND regist_state = '$existing_status' AND ACIdoneDate IS NOT NULL AND ACIdoneDate != '' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND regist_state = '$existing_status' AND ACIdoneDate IS NOT NULL AND ACIdoneDate != '' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
}
|
||||
|
||||
// 수정된 쿼리: ACIdoneDate이 존재하고 is_deleted가 0인 자료만 선택
|
||||
if ($search == "") {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $where;
|
||||
} else {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $searchwhere;
|
||||
}
|
||||
|
||||
// 현재일자 변수지정
|
||||
$today = date("Y-m-d");
|
||||
|
||||
// SQL 실행 및 데이터 처리
|
||||
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_row = $stmh->rowCount();
|
||||
|
||||
$total_sum=0;
|
||||
$total_m2=0;
|
||||
$total_egi=0;
|
||||
$total_egi_m2=0;
|
||||
?>
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
|
||||
<div class="container">
|
||||
<div class="card mb-1 mt-1 p-1">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="d-flex p-1 mb-2 mt-1 justify-content-center align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm " onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<table class="table table-bordered text-center align-middle w-50">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="text-center">상호(법인명)</th>
|
||||
<td>㈜경동기업</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center">법인등록번호</th>
|
||||
<td>124411-0174300</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center">사업자등록번호</th>
|
||||
<td>139-87-00333</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center">제조현장(공장) 소재지</th>
|
||||
<td>김포시 통진읍 옹정로 45-22</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center">전화번호</th>
|
||||
<td>031-983-5130</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-center align-items-center">
|
||||
▷ <?= $total_row ?>
|
||||
|
||||
<!-- 작년 분기 버튼 -->
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm me-1" onclick="setLastYearQuarter(1)">작년 1분기</button>
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm me-1" onclick="setLastYearQuarter(2)">작년 2분기</button>
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm me-1" onclick="setLastYearQuarter(3)">작년 3분기</button>
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm me-1" onclick="setLastYearQuarter(4)">작년 4분기</button>
|
||||
<!-- 올해 분기 버튼 -->
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1" onclick="setQuarter(1)">1분기</button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1" onclick="setQuarter(2)">2분기</button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1" onclick="setQuarter(3)">3분기</button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1" onclick="setQuarter(4)">4분기</button>
|
||||
|
||||
<!-- 반기 버튼 -->
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" onclick="setHalfYear(1)">상반기</button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" onclick="setHalfYear(2)">하반기</button>
|
||||
|
||||
<!-- 날짜 입력 -->
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?= $fromdate ?>"> ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?= $todate ?>">
|
||||
|
||||
<!-- 검색 -->
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control mx-1" style="width:150px;height:30px;" >
|
||||
<button class="btnClear"></button> </div>
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm"> <i class="bi bi-search"></i> 검색 </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="table-responsive">
|
||||
<div class="row justify-content-center align-items-center">
|
||||
<table class="table table-hover" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center">일련번호</th>
|
||||
<th class="text-center">품질관리서번호</th>
|
||||
<th class="text-center">작성일자</th>
|
||||
<th class="text-center">인정품목</th>
|
||||
<th class="text-center">품질인정번호</th>
|
||||
<th class="text-center">내화성능시간</th>
|
||||
<th class="text-center">상품명</th>
|
||||
<th class="text-center">구조 또는 제품명</th>
|
||||
<th class="text-center">사용부위</th>
|
||||
<th class="text-center">로트번호</th>
|
||||
<th class="text-center">규격</th>
|
||||
<th class="text-center">수량</th>
|
||||
<th class="text-center">현장명</th>
|
||||
<th class="text-center">대지위치</th>
|
||||
<th class="text-center">지번</th>
|
||||
<th class="text-center">성명</th>
|
||||
<th class="text-center">사무소명</th>
|
||||
<th class="text-center">사무소주소</th>
|
||||
<th class="text-center">사무소전화번호</th>
|
||||
<th class="text-center">성명</th>
|
||||
<th class="text-center">회사명</th>
|
||||
<th class="text-center">회사주소</th>
|
||||
<th class="text-center">회사전화번호</th>
|
||||
<th class="text-center">성명</th>
|
||||
<th class="text-center">회사명</th>
|
||||
<th class="text-center">회사주소</th>
|
||||
<th class="text-center">회사전화번호</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
include '_row.php';
|
||||
|
||||
if($ACIregDate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$ACIregDate = $ACIregDate . $week[ date('w', strtotime($ACIregDate) ) ] ;
|
||||
}
|
||||
|
||||
$shutterSurang = 0; // 셔터 수량 합계를 저장할 변수 초기화
|
||||
$shutterSurang_slat = 0; // 철재
|
||||
|
||||
// JSON 데이터를 배열로 디코딩
|
||||
$eList_screenData = json_decode($eList_screen, true);
|
||||
$eList_slatData = json_decode($eList_slat, true);
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($eList_screen);
|
||||
// echo '</pre>';
|
||||
// echo '<pre>';
|
||||
// print_r($eList_slat);
|
||||
// echo '</pre>';
|
||||
|
||||
// 반복문을 통해 col14 값을 누적
|
||||
if (is_array($eList_screenData)) {
|
||||
foreach ($eList_screenData as $item) {
|
||||
$shutterSurang += isset($item['col14']) ? (int)$item['col14'] : 0;
|
||||
}
|
||||
}
|
||||
// slat 반복문을 통해 col15 값을 누적 slat
|
||||
if (is_array($eList_slatData)) {
|
||||
foreach ($eList_slatData as $item) {
|
||||
$shutterSurang_slat += isset($item['col15']) ? (int)$item['col15'] : 0;
|
||||
}
|
||||
}
|
||||
// 스크린,철재스라트 구분하기 JSON 데이터가 비어있는지 확인하여 값 설정
|
||||
if (!empty(json_decode($eList_screen, true))) {
|
||||
$separate_item = '스크린';
|
||||
} elseif (!empty(json_decode($eList_slat, true))) {
|
||||
$separate_item = '철재스라트';
|
||||
}
|
||||
?>
|
||||
<tr onclick="redirectToView('<?= $num ?>', '<?= $tablename ?>', '<?= $prodCode ?>')">
|
||||
<td class="text-center"><?= $start_num ?></td>
|
||||
<td class="text-center"><?= $ACIregDate ?></td>
|
||||
<td class="text-center"><?= $ACIaskDate === '0000-00-00' ? '' : $ACIaskDate ?></td>
|
||||
<td class="text-center"><?= $ACIdoneDate === '0000-00-00' ? '' : $ACIdoneDate ?></td>
|
||||
<td class="text-center"><?= $secondord ?></td>
|
||||
<td class="text-center<?= $separate_item === '철재스라트' ? ' text-primary' : '' ?>">
|
||||
<?= $separate_item ?>
|
||||
</td>
|
||||
<td class="text-center"><?= $prodCode ?></td>
|
||||
<td class="text-center"> <?= ($shutterSurang + $shutterSurang_slat) ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $ACImemo ?></td>
|
||||
<td class="text-start"><?= $ACImemo ?></td>
|
||||
<td class="text-start"><?= $ACImemo ?></td>
|
||||
<td class="text-start"><?= $ACImemo ?></td>
|
||||
<td class="text-start"><?= $ACImemo ?></td>
|
||||
<td class="text-start"><?= $ACImemo ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--container-->
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var QClistpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 20,
|
||||
"lengthMenu": [20, 100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[0, 'desc']]
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('QClistpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var QClistpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('QClistpageNumber', QClistpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('QClistpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('QClistpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(num, tablename, prodcode) {
|
||||
let prodName, arrayWidth, arrayHeight, url;
|
||||
|
||||
// prodcode에 따라 URL 설정
|
||||
if (prodcode.startsWith('KS') || prodcode.startsWith('KW')) {
|
||||
url = "view_requestACI.php?num=" + num + "&tablename=" + tablename;
|
||||
} else {
|
||||
url = "view_requestACI.php?num=" + num + "&tablename=" + tablename;
|
||||
}
|
||||
|
||||
customPopup(url, '제품 인정검사 요청', 800, 900);
|
||||
}
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
522
output/list_account.php
Normal file
522
output/list_account.php
Normal file
@@ -0,0 +1,522 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if(!isset($_SESSION["level"]) || $_SESSION["level"]>5) {
|
||||
sleep(1);
|
||||
header("Location:" . $WebSite . "login/login_form.php");
|
||||
exit;
|
||||
}
|
||||
include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php';
|
||||
|
||||
$option = $_REQUEST['option'] ?? ''; // 조회시 조건 부여
|
||||
|
||||
$title_message = '판매 List';
|
||||
$existing_status=$_REQUEST["status_option"] ?? '전체' ;
|
||||
|
||||
// 권한 부여
|
||||
$authorities = ["개발자","전진","노완호","이세희","함신옥","손금주","이은진","이경호","김진호","이세희","함신옥"];
|
||||
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$developer_filter = $_REQUEST['developer_filter'] ?? '';
|
||||
|
||||
// echo '개발자 모드 ' . $developer_filter;
|
||||
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
$tablename_sub = 'output_extra';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if(isset($_REQUEST["separate_date"]))
|
||||
$separate_date=$_REQUEST["separate_date"];
|
||||
else
|
||||
$separate_date="";
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if($separate_date=="") $separate_date="1";
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
if($option == '미출고') {
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("- 120 months", strtotime($currentDate))); // 1개월 이전 날짜 1주전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+4 months", strtotime($currentDate))); // 4개월 이후
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 weeks", strtotime($currentDate))); // 1개월 이전 날짜 1주전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+3 months", strtotime($currentDate))); // 3개월 이전 날짜
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
}
|
||||
|
||||
// 개발모드인 경우는 일자를 1년전에서 시작한다.
|
||||
if (in_array($user_name, $authorities, true) && $developer_filter === 'on') {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 year", strtotime($currentDate)));
|
||||
}
|
||||
|
||||
if($separate_date == "1")
|
||||
$SettingDate = "outdate";
|
||||
else
|
||||
$SettingDate = "indate";
|
||||
|
||||
// 진행상태에 대한 검색
|
||||
$orderby = " order by " . $SettingDate . " desc, num desc"; // 내림차순 전체
|
||||
|
||||
if ($existing_status == '전체') {
|
||||
$where = " where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') and (is_deleted = '0' or is_deleted is null) " ;
|
||||
$searchwhere = " where is_deleted = '0' and searchtag like '%$search%'" ;
|
||||
} else if ($existing_status == '미출고') {
|
||||
$where = " where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') and (is_deleted = '0' or is_deleted is null) and regist_state != '완료' " ;
|
||||
$searchwhere = " where is_deleted = '0' and regist_state != '완료' and searchtag like '%$search%'" ;
|
||||
}
|
||||
else {
|
||||
$where = " where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') and (is_deleted = '0' or is_deleted is null) and regist_state = '$existing_status'" ;
|
||||
$searchwhere = " where is_deleted = '0' and regist_state = '$existing_status' and searchtag like '%$search%'" ;
|
||||
}
|
||||
|
||||
// 개발모드에 따라 검색하는 로직
|
||||
if(in_array($user_name, $authorities, true) && $developer_filter == 'on') {
|
||||
$where .= " and devMode = '1' ";
|
||||
$searchwhere .= " and devMode = '1' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$where .= " and (devMode <> '1' OR devMode IS NULL) ";
|
||||
$searchwhere .= " and (devMode <> '1' OR devMode IS NULL) ";
|
||||
}
|
||||
|
||||
$where .= $orderby;
|
||||
$searchwhere .= $orderby;
|
||||
|
||||
// 수정된 쿼리: outputnum이 존재하는 자료만 선택
|
||||
if ($search == "") {
|
||||
$sql = "select * from $DB.$tablename " . $where;
|
||||
} else {
|
||||
$sql = "select * from $DB.$tablename " . $searchwhere;
|
||||
}
|
||||
|
||||
$today=date("Y-m-d"); // 현재일자 변수지정
|
||||
|
||||
// print $sql;
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_row = $stmh->rowCount();
|
||||
|
||||
$total_sum=0;
|
||||
$total_m2=0;
|
||||
$total_egi=0;
|
||||
$total_egi_m2=0;
|
||||
?>
|
||||
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
<input type="hidden" id="option" name="option" value="<?=$option?>">
|
||||
<div class="container-fluid">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-end align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm " onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-start align-items-center">
|
||||
▷ <?= $total_row ?>
|
||||
<label> 출고일 <input type="radio" name="separate_date" value="1" <?= $separate_date == "1" ? 'checked' : '' ?>></label>
|
||||
<label> 접수일 <input type="radio" name="separate_date" class="me-3" value="2" <?= $separate_date == "2" ? 'checked' : '' ?>></label>
|
||||
|
||||
<?php if($user_id == "pro"): ?>
|
||||
<?php
|
||||
$checked = (isset($developer_filter) && $developer_filter === 'on') ? 'checked' : '';
|
||||
$checkMessage = (isset($developer_filter) && $developer_filter === 'on') ? '개발모드' : '개발모드';
|
||||
?>
|
||||
<label> <?= $checkMessage ?>
|
||||
<input type="checkbox" id="developer_filter" name="developer_filter" class="mx-3" <?= $checked ?>>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<button type="button" id="premonth" class="btn btn-dark btn-sm me-1 " onclick='yesterday()' > 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1 " onclick='this_today()' > 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1 " onclick='this_tomorrow()' > 익일 </button>
|
||||
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>" > ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?=$todate?>" >
|
||||
|
||||
<!-- <button type="button" id ="Fromthistoday" type='button' class="btn btn-dark btn-sm me-1 " onclick='Fromthis_today()' > 금일이후 </button>
|
||||
<button type="button" id ="Fromtomorrow" type='button' class="btn btn-dark btn-sm me-1 " onclick='From_tomorrow()' > 익일이후 </button>
|
||||
-->
|
||||
|
||||
</span>
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control mx-1" style="width:150px;height:30px;" >
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
<div id="autocomplete-list">
|
||||
</div>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm" > <i class="bi bi-search"></i> 검색 </button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--card-body-->
|
||||
</div> <!--card -->
|
||||
</div> <!--container-fluid -->
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<table class="table table-hover table-sm" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center" style="width:30px;">번호</th>
|
||||
<th class="text-center" style="width:90px;">출고</th>
|
||||
<th class="text-center" style="width:100px;">발주처</th>
|
||||
<th class="text-center" style="width:60px;">모델</th>
|
||||
<th class="text-center" style="width:140px;">현장명</th>
|
||||
<th class="text-center" style="width:80px;">수신자</th>
|
||||
<th class="text-center" style="width:120px;">수신 주소</th>
|
||||
<th class="text-center" style="width:90px;"><i class="bi bi-telephone-fill"> </i> 수신처</th>
|
||||
<th class="text-start" style="width:45px; "><i class="bi bi-truck"></i> 운송</th>
|
||||
<th class="text-center" style="width:40px;">담당</th>
|
||||
<th class="text-center" style="width:30px;">틀수</th>
|
||||
<th class="text-center" style="width:30px;">(㎡)</th>
|
||||
<th class="text-center" style="width:50px;">인정</th>
|
||||
<th class="text-end" style="width:150px;">인정제품 판매금액</th>
|
||||
<th class="text-end" style="width:150px;">비인정제품 판매금액</th>
|
||||
<th class="text-end" style="width:150px;">판매금액 합계</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
$total_m2_formatted = 0 ;
|
||||
$total_egi_m2_formatted = 0 ;
|
||||
|
||||
$total_screen_sum = 0;
|
||||
$total_screen_m2 = 0;
|
||||
|
||||
$total_egi_sum = 0;
|
||||
$total_egi_m2 = 0;
|
||||
|
||||
if($total_row>10000) {
|
||||
echo '<tr> <td colspan="18"> <span class="text-primary fs-3"> 검색량이 10000개 넘어갑니다. 검색 기간을 변경 후 검색하세요! </span> </td><tr>';
|
||||
}
|
||||
else {
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
include '_row.php';
|
||||
// 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';
|
||||
}
|
||||
|
||||
// 콤마를 제거하고 숫자로 변환
|
||||
$screen_su_cleaned = floatval(str_replace(',', '', $screen_su));
|
||||
$screen_m2_cleaned = floatval(str_replace(',', '', $screen_m2));
|
||||
|
||||
$slat_su_cleaned = floatval(str_replace(',', '', $slat_su));
|
||||
$slat_m2_cleaned = floatval(str_replace(',', '', $slat_m2));
|
||||
|
||||
$screenlists = json_decode($screenlist, true);
|
||||
// var_dump($screenlists["screen_m2"]);
|
||||
|
||||
if($steel!="1")
|
||||
$bend_state="";
|
||||
|
||||
if($motor=="1")
|
||||
$motor="모터";
|
||||
|
||||
if($root=="주일")
|
||||
$root_font="text-dark";
|
||||
else
|
||||
$root_font="text-primary";
|
||||
|
||||
$date_font="text-dark"; // 현재일자 Red 색상으로 표기
|
||||
if($today==$outdate) {
|
||||
$date_font="text-danger";
|
||||
}
|
||||
|
||||
$font="text-dark";
|
||||
switch ($delivery) {
|
||||
case "상차(선불)" : $font="text-dark"; break;
|
||||
case "상차(착불)" :$font="color-grey" ; break;
|
||||
case "경동화물(선불)" :$font="color-brown"; break;
|
||||
case "경동화물(착불)" :$font="color-brown"; break;
|
||||
case "경동택배(선불)" :$font="color-brown"; break;
|
||||
case "경동택배(착불)" :$font="color-brown"; break;
|
||||
case "직접배차" :$font="color-purple"; break;
|
||||
case "직접수령" :$font="text-danger"; break;
|
||||
case "대신화물(선불)" :$font="color-blue"; break;
|
||||
case "대신화물(착불)" :$font="color-blue"; break;
|
||||
case "대신택배(선불)" :$font="color-blue"; break;
|
||||
case "대신택배(착불)" :$font="color-blue"; break;
|
||||
}
|
||||
|
||||
if($outdate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ;
|
||||
$formatedoutdate = $outdate;
|
||||
$formatedindate = date("m-d",strtotime($indate));
|
||||
}
|
||||
?>
|
||||
<tr onclick="redirectToView('<?= $num ?>', '<?= $tablename ?>')">
|
||||
<td class="text-center" ><?= $start_num ?></td>
|
||||
<td class="text-center" data-outdate="<?=$outdate ?>"> <?= $formatedoutdate ?></td>
|
||||
<td class="text-start" ><?= $secondord ?></td>
|
||||
<td class="text-center" ><?= $prodCode ?></td>
|
||||
<td class="text-start" ><?= $outworkplace ?></td>
|
||||
<td class="text-start" ><?= $receiver ?></td>
|
||||
<td class="text-start" ><?= $outputplace ?></td>
|
||||
<td class="text-start" ><?= $phone ?></td>
|
||||
<td class="text-start" >
|
||||
<?php
|
||||
if (strpos($delivery, '경동') !== false) {
|
||||
echo '<span class="text-primary">' . $delivery . '</span>';
|
||||
} else if (strpos($delivery, '대신') !== false) {
|
||||
echo '<span class="text-success">' . $delivery . '</span>';
|
||||
} else {
|
||||
switch ($delivery) {
|
||||
case "직접배차":
|
||||
echo '<span class="badge bg-secondary">' . $delivery . '</span>';
|
||||
break;
|
||||
case "직접수령":
|
||||
echo '<span class="badge bg-dark">' . $delivery . '</span>';
|
||||
break;
|
||||
case "상차(선불)":
|
||||
echo '<span class="badge bg-info">' . $delivery . '</span>';
|
||||
break;
|
||||
case "상차(착불)":
|
||||
echo '<span class="badge bg-warning">' . $delivery . '</span>';
|
||||
break;
|
||||
default:
|
||||
echo '<span class="text-dark">' . $delivery . '</span>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="text-center"><?= $orderman ?></td>
|
||||
<?php
|
||||
$row_sum = $screen_su_cleaned + $slat_su_cleaned ;
|
||||
$row_m2 = $screen_m2_cleaned + $slat_m2_cleaned ;
|
||||
|
||||
$row_sum_formatted = number_format($row_sum);
|
||||
$row_m2_formatted = number_format($row_m2, 1);
|
||||
|
||||
if ($row_sum_formatted > 0)
|
||||
print '<td class="text-end" style=>' . $row_sum_formatted . '</td>';
|
||||
else
|
||||
print '<td class="text-end" style=> </td>';
|
||||
|
||||
if ($row_m2_formatted > 0)
|
||||
print '<td class="text-end" style=>' . $row_m2_formatted . '</td>';
|
||||
else
|
||||
print '<td class="text-end" style=> </td>';
|
||||
|
||||
$total_sum += $screen_su_cleaned;
|
||||
$total_m2 += $screen_m2_cleaned;
|
||||
$total_egi += $slat_su_cleaned;
|
||||
$total_egi_m2 += $slat_m2_cleaned;
|
||||
|
||||
// // 소수점 첫째자리까지만 포맷팅
|
||||
$total_m2_formatted = number_format($total_m2, 1);
|
||||
$total_egi_m2_formatted = number_format($total_egi_m2, 1);
|
||||
?>
|
||||
<td class="text-center"><?= $warranty ?></td>
|
||||
<td class="text-end"><?= is_numeric($estimateTotal) ? number_format($estimateTotal) : '' ?></td>
|
||||
<td class="text-end"><?= is_numeric($ET_unapproved) ? number_format($ET_unapproved) : '' ?></td>
|
||||
<td class="text-end"><?= is_numeric($ET_total) ? number_format($ET_total) : '' ?></td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!--container-->
|
||||
|
||||
</form>
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var outputpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 100,
|
||||
"lengthMenu": [100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[1, 'desc']] // 출고예정기준 내림정렬
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var outputpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('outputpageNumber', outputpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
// // 검색 버튼 클릭 이벤트 처리 (form submit)
|
||||
// $('#board_form').on('submit', function(e) {
|
||||
// e.preventDefault();
|
||||
|
||||
// });
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(num, tablename) {
|
||||
var url = "write_form.php?mode=view&num=" + num + "&tablename=" + tablename;
|
||||
customPopup(url, '수주 내역', 1900, 920);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("input:radio[name=separate_date]").click(function() {
|
||||
process_list();
|
||||
})
|
||||
});
|
||||
|
||||
function process_list(){ // 접수일 출고일 라디오버튼 클릭시
|
||||
document.getElementById('search').value=null;
|
||||
// dataTable.page(0).draw(false); // 검색 후 첫 페이지로 이동
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#writeBtn").click(function(){
|
||||
var tablename = '<?php echo $tablename; ?>';
|
||||
var url = "write_form.php?tablename=" + tablename;
|
||||
customPopup(url, '수주내역', 1900, 920);
|
||||
});
|
||||
});
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#developer_filter").change(function() {
|
||||
if (this.checked) {
|
||||
$('input[name=developer_filter]').val('on');
|
||||
} else {
|
||||
$('input[name=developer_filter]').val('');
|
||||
|
||||
// 현재 날짜에서 1주일 전 계산
|
||||
const today = new Date();
|
||||
today.setDate(today.getDate() - 7);
|
||||
const year = today.getFullYear();
|
||||
const month = String(today.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(today.getDate()).padStart(2, '0');
|
||||
const oneWeekAgo = `${year}-${month}-${day}`;
|
||||
|
||||
// #fromdate 필드에 값 설정
|
||||
$('#fromdate').val(oneWeekAgo);
|
||||
}
|
||||
document.getElementById('board_form').submit();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
374
output/list_bending.php
Normal file
374
output/list_bending.php
Normal file
@@ -0,0 +1,374 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if (!isset($_SESSION["level"]) || $_SESSION["level"] > 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';
|
||||
$title_message = '절곡 작업일지';
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// 검색 조건 설정
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if (isset($_REQUEST["separate_date"])) {
|
||||
$separate_date = $_REQUEST["separate_date"];
|
||||
} else {
|
||||
$separate_date = "";
|
||||
}
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if ($separate_date == "") {
|
||||
$separate_date = "1";
|
||||
}
|
||||
|
||||
if (isset($_REQUEST["status_option"])) {
|
||||
$existing_status = $_REQUEST["status_option"];
|
||||
} else {
|
||||
$existing_status = '전체';
|
||||
}
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 weeks", strtotime($currentDate))); // 1주 전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+3 months", strtotime($currentDate))); // 3개월 후 날짜
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
|
||||
if ($separate_date == "1") {
|
||||
$SettingDate = "outdate";
|
||||
} else {
|
||||
$SettingDate = "indate";
|
||||
}
|
||||
|
||||
// 진행상태에 대한 검색
|
||||
$orderby = " ORDER BY " . $SettingDate . " DESC, num DESC"; // 내림차순 정렬
|
||||
|
||||
if ($existing_status == '전체') {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND recordbending IS NOT NULL AND recordbending != '' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND recordbending IS NOT NULL AND recordbending != '' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
} else {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND regist_state = '$existing_status' AND recordbending IS NOT NULL AND recordbending != '' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND regist_state = '$existing_status' AND recordbending IS NOT NULL AND recordbending != '' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
}
|
||||
|
||||
// 수정된 쿼리: recordbending이 존재하고 is_deleted가 0인 자료만 선택
|
||||
if ($search == "") {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $where;
|
||||
} else {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $searchwhere;
|
||||
}
|
||||
|
||||
// 현재일자 변수지정
|
||||
$today = date("Y-m-d");
|
||||
|
||||
// SQL 실행 및 데이터 처리
|
||||
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_row = $stmh->rowCount();
|
||||
|
||||
?>
|
||||
<form id="board_form" name="board_form" method="post" action="list_bending.php?mode=search">
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
|
||||
<div class="container">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-end align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm " onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="d-flex justify-content-end align-items-center ">
|
||||
<h5> <span id="total_screen" class="text-primary me-2"></span>
|
||||
<span id="total_screen_m2" class="badge bg-primary me-5"></span>
|
||||
<span id="total_egi" class="text-secondary me-2"></span>
|
||||
<span id="total_egi_m2" class="badge bg-secondary me-2"></span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-center align-items-center">
|
||||
▷ <?= $total_row ?>
|
||||
<button type="button" id="premonth" class="btn btn-dark btn-sm me-1 " onclick='yesterday()' > 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1 " onclick='this_today()' > 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1 " onclick='this_tomorrow()' > 익일 </button>
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>" > ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?=$todate?>" >
|
||||
</span>
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control" style="width:150px;" >
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
|
||||
<div id="autocomplete-list">
|
||||
</div>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm" > <i class="bi bi-search"></i> 검색 </button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--card-body-->
|
||||
</div> <!--card -->
|
||||
</div> <!--container-fluid -->
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<table class="table table-hover" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center" style="width:30px;">번호</th>
|
||||
<th class="text-center" style="width:120px;">출고일</th>
|
||||
<th class="text-center" style="width:150px;">제품종류 </th>
|
||||
<th class="text-center" style="width:100px;">제품코드</th>
|
||||
<th class="text-center" style="width:50px;">완료여부 </th>
|
||||
<th class="text-center" style="width:90px;">작성일</th>
|
||||
<th class="text-center" style="width:100px;">발주처</th>
|
||||
<th class="text-center" style="width:200px;">현장명</th>
|
||||
<th class="text-center" style="width:100px;">수신자</th>
|
||||
<th class="text-center" style="width:50px;">담당</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
include '_row.php';
|
||||
|
||||
// recordbending에서 작성일 및 작성자 추출
|
||||
$recordbendingData = json_decode($row['recordbending'], true);
|
||||
$writerDate = isset($recordbendingData[0]['approval']['writer']['date']) ? $recordbendingData[0]['approval']['writer']['date'] : '';
|
||||
|
||||
|
||||
// 콤마를 제거하고 숫자로 변환
|
||||
$screen_su_cleaned = floatval(str_replace(',', '', $screen_su));
|
||||
$screen_m2_cleaned = floatval(str_replace(',', '', $screen_m2));
|
||||
|
||||
$slat_su_cleaned = floatval(str_replace(',', '', $slat_su));
|
||||
$slat_m2_cleaned = floatval(str_replace(',', '', $slat_m2));
|
||||
|
||||
$screenlists = json_decode($screenlist, true);
|
||||
// var_dump($screenlists["screen_m2"]);
|
||||
|
||||
|
||||
$date_font="text-dark"; // 현재일자 Red 색상으로 표기
|
||||
if($today==$outdate) {
|
||||
$date_font="text-danger";
|
||||
}
|
||||
|
||||
if($outdate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ;
|
||||
}
|
||||
|
||||
// 스크린,철재스라트 구분하기 JSON 데이터가 비어있는지 확인하여 값 설정
|
||||
if (!empty(json_decode($eList_screen, true))) {
|
||||
$separate_item = '스크린';
|
||||
} elseif (!empty(json_decode($eList_slat, true))) {
|
||||
$separate_item = '철재스라트';
|
||||
}
|
||||
?>
|
||||
<tr data-sep='<?=$separate_item?>' onclick="redirectToView('<?= $num ?>', '<?= $tablename ?>', '<?= $separate_item ?>')">
|
||||
<td class="text-center"><?= $start_num ?></td>
|
||||
<td class="text-center"><?= $outdate ?></td>
|
||||
<td class="text-center<?= $separate_item === '철재스라트' ? ' text-primary' : '' ?>">
|
||||
<?= $separate_item ?>
|
||||
</td>
|
||||
<td class="text-center"><?= $prodCode ?></td>
|
||||
<td class="text-center">
|
||||
<?php
|
||||
// recordbending에서 각 로트의 상태를 검사
|
||||
$recordbendingData = json_decode($row['recordbending'], true);
|
||||
|
||||
// 기본값 설정
|
||||
$state = '등록전';
|
||||
$allCompleted = true; // 모든 LOT 번호가 입력되었는지 확인
|
||||
$hasInProgress = false; // 하나라도 입력된 상태가 있는지 확인
|
||||
|
||||
// recordbending 데이터가 유효할 경우 상태 확인
|
||||
if (is_array($recordbendingData)) {
|
||||
// LOT 번호 배열이 있는지 확인
|
||||
$lotNumbers = isset($recordbendingData[2]['lotNumbers']) ? $recordbendingData[2]['lotNumbers'] : [];
|
||||
$wireLotNumbers = isset($recordbendingData[3]['wireLotNumbers']) ? $recordbendingData[3]['wireLotNumbers'] : [];
|
||||
|
||||
// 모든 LOT 번호가 입력되었는지 확인
|
||||
foreach ($lotNumbers as $lot) {
|
||||
if (trim($lot) === '') {
|
||||
$allCompleted = false;
|
||||
} else {
|
||||
$hasInProgress = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 모든 내화실 LOT 번호가 입력되었는지 확인
|
||||
foreach ($wireLotNumbers as $lot) {
|
||||
if (trim($lot) === '') {
|
||||
$allCompleted = false;
|
||||
} else {
|
||||
$hasInProgress = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 모든 LOT 번호가 입력된 경우 '완료'
|
||||
if ($allCompleted && $hasInProgress) {
|
||||
$state = '완료';
|
||||
}
|
||||
// 일부는 입력되었지만 모두 완료되지 않은 경우 '진행중'
|
||||
elseif ($hasInProgress) {
|
||||
$state = '진행중';
|
||||
}
|
||||
}
|
||||
|
||||
// 상태에 따라 출력
|
||||
switch ($state) {
|
||||
case "등록전":
|
||||
echo '<span class="badge bg-danger">등록전</span>';
|
||||
break;
|
||||
case "진행중":
|
||||
echo '<span class="badge bg-warning blink">진행중</span>';
|
||||
break;
|
||||
case "완료":
|
||||
echo '<span class="badge bg-dark">완료</span>';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="text-center"><?= htmlspecialchars($writerDate) ?></td>
|
||||
<td class="text-center"><?= $secondord ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $receiver ?></td>
|
||||
<td class="text-center"><?= $orderman ?></td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!--container-->
|
||||
|
||||
</form>
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var outputpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 100,
|
||||
"lengthMenu": [100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[1, 'desc']] // 출고예정기준 내림정렬
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var outputpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('outputpageNumber', outputpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(num, tablename, sep) {
|
||||
if(sep =='스크린')
|
||||
var url = "viewBendingWork.php?num=" + num + "&tablename=" + tablename;
|
||||
else
|
||||
var url = "viewBendingWork_slat.php?num=" + num + "&tablename=" + tablename;
|
||||
|
||||
customPopup(url, '절곡 작업일지', 800, 900);
|
||||
}
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
417
output/list_bending_mid.php
Normal file
417
output/list_bending_mid.php
Normal file
@@ -0,0 +1,417 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if (!isset($_SESSION["level"]) || $_SESSION["level"] > 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';
|
||||
$title_message = '절곡-중간 검사성적서';
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// 검색 조건 설정
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if (isset($_REQUEST["separate_date"])) {
|
||||
$separate_date = $_REQUEST["separate_date"];
|
||||
} else {
|
||||
$separate_date = "";
|
||||
}
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if ($separate_date == "") {
|
||||
$separate_date = "1";
|
||||
}
|
||||
|
||||
if (isset($_REQUEST["status_option"])) {
|
||||
$existing_status = $_REQUEST["status_option"];
|
||||
} else {
|
||||
$existing_status = '전체';
|
||||
}
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 weeks", strtotime($currentDate))); // 1주 전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+3 months", strtotime($currentDate))); // 3개월 후 날짜
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
|
||||
if ($separate_date == "1") {
|
||||
$SettingDate = "outdate";
|
||||
} else {
|
||||
$SettingDate = "indate";
|
||||
}
|
||||
|
||||
// 진행상태에 대한 검색
|
||||
$orderby = " ORDER BY " . $SettingDate . " DESC, num DESC"; // 내림차순 정렬
|
||||
|
||||
if ($existing_status == '전체') {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND recordbendingMid IS NOT NULL AND recordbendingMid != '' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND recordbendingMid IS NOT NULL AND recordbendingMid != '' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
} else {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND regist_state = '$existing_status' AND recordbendingMid IS NOT NULL AND recordbendingMid != '' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND regist_state = '$existing_status' AND recordbendingMid IS NOT NULL AND recordbendingMid != '' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
}
|
||||
|
||||
// 수정된 쿼리: recordscreen이 존재하고 is_deleted가 0인 자료만 선택
|
||||
if ($search == "") {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $where;
|
||||
} else {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $searchwhere;
|
||||
}
|
||||
|
||||
// 현재일자 변수지정
|
||||
$today = date("Y-m-d");
|
||||
|
||||
// SQL 실행 및 데이터 처리
|
||||
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_row = $stmh->rowCount();
|
||||
|
||||
$total_sum=0;
|
||||
$total_m2=0;
|
||||
$total_egi=0;
|
||||
$total_egi_m2=0;
|
||||
?>
|
||||
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
|
||||
<div class="container">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-end align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm " onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="d-flex justify-content-end align-items-center ">
|
||||
<h5> <span id="total_screen" class="text-primary me-2"></span>
|
||||
<span id="total_screen_m2" class="badge bg-primary me-5"></span>
|
||||
<span id="total_egi" class="text-secondary me-2"></span>
|
||||
<span id="total_egi_m2" class="badge bg-secondary me-2"></span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-center align-items-center">
|
||||
▷ <?= $total_row ?>
|
||||
<button type="button" id="premonth" class="btn btn-dark btn-sm me-1 " onclick='yesterday()' > 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1 " onclick='this_today()' > 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1 " onclick='this_tomorrow()' > 익일 </button>
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>" > ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?=$todate?>" >
|
||||
</span>
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control" style="width:150px;" >
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
<div id="autocomplete-list">
|
||||
</div>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm" > <i class="bi bi-search"></i> 검색 </button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--card-body-->
|
||||
</div> <!--card -->
|
||||
</div> <!--container-fluid -->
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<table class="table table-hover" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center" style="width:30px;">번호</th>
|
||||
<th class="text-center" style="width:120px;">출고일</th>
|
||||
<th class="text-center" style="width:100px;">접수일</th>
|
||||
<th class="text-center" style="width:150px;">제품종류 </th>
|
||||
<th class="text-center" style="width:100px;">제품코드</th>
|
||||
<th class="text-center" style="width:50px;">완료여부 </th>
|
||||
<th class="text-center" style="width:90px;">작성일</th>
|
||||
<th class="text-center" style="width:100px;">발주처</th>
|
||||
<th class="text-center" style="width:200px;">현장명</th>
|
||||
<th class="text-center" style="width:100px;">수신자</th>
|
||||
<th class="text-center" style="width:50px;">담당</th>
|
||||
<th class="text-center" style="width:50px;">틀수</th>
|
||||
<th class="text-center" style="width:50px;">(㎡)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
|
||||
$total_m2_formatted = 0 ;
|
||||
$total_egi_m2_formatted = 0 ;
|
||||
|
||||
$total_screen_sum = 0;
|
||||
$total_screen_m2 = 0;
|
||||
|
||||
$total_egi_sum = 0;
|
||||
$total_egi_m2 = 0;
|
||||
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
include '_row.php';
|
||||
|
||||
// recordscreen에서 작성일 및 작성자 추출
|
||||
$recordscreenData = json_decode($row['recordbendingMid'], true);
|
||||
$writerDate = isset($recordscreenData[0]['approval']['writer']['date']) ? $recordscreenData[0]['approval']['writer']['date'] : '';
|
||||
|
||||
|
||||
// 콤마를 제거하고 숫자로 변환
|
||||
$screen_su_cleaned = floatval(str_replace(',', '', $screen_su));
|
||||
$screen_m2_cleaned = floatval(str_replace(',', '', $screen_m2));
|
||||
|
||||
$slat_su_cleaned = floatval(str_replace(',', '', $slat_su));
|
||||
$slat_m2_cleaned = floatval(str_replace(',', '', $slat_m2));
|
||||
|
||||
$screenlists = json_decode($screenlist, true);
|
||||
// var_dump($screenlists["screen_m2"]);
|
||||
|
||||
|
||||
$date_font="text-dark"; // 현재일자 Red 색상으로 표기
|
||||
if($today==$outdate) {
|
||||
$date_font="text-danger";
|
||||
}
|
||||
|
||||
if($outdate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ;
|
||||
}
|
||||
// 스크린,철재스라트 구분하기 JSON 데이터가 비어있는지 확인하여 값 설정
|
||||
if (!empty(json_decode($eList_screen, true))) {
|
||||
$separate_item = '스크린';
|
||||
} elseif (!empty(json_decode($eList_slat, true))) {
|
||||
$separate_item = '철재스라트';
|
||||
}
|
||||
?>
|
||||
<tr data-sep='<?=$separate_item?>' onclick="redirectToView('<?= $num ?>', '<?= $tablename ?>', '<?= $separate_item ?>')">
|
||||
<td class="text-center"><?= $start_num ?></td>
|
||||
<td class="text-center"><?= $outdate ?></td>
|
||||
<td class="text-center"><?= $indate ?></td>
|
||||
<td class="text-center<?= $separate_item === '철재스라트' ? ' text-primary' : '' ?>">
|
||||
<?= $separate_item ?>
|
||||
</td>
|
||||
<td class="text-center"><?= $prodCode ?></td>
|
||||
<td class="text-center">
|
||||
<?php
|
||||
// recordscreen에서 각 로트의 상태를 검사
|
||||
$recordscreenData = json_decode($row['recordbendingMid'], true);
|
||||
|
||||
// 기본값 설정
|
||||
$state = '등록전';
|
||||
$allCompleted = true; // 모든 LOT 번호가 입력되었는지 확인
|
||||
$hasInProgress = false; // 하나라도 입력된 상태가 있는지 확인
|
||||
|
||||
// recordbendingMid 데이터가 유효할 경우 상태 확인
|
||||
if (is_array($recordscreenData)) {
|
||||
// LOT 번호 배열이 있는지 확인
|
||||
$lotNumbers = isset($recordscreenData[2]['lotNumbers']) ? $recordscreenData[2]['lotNumbers'] : [];
|
||||
$wireLotNumbers = isset($recordscreenData[3]['wireLotNumbers']) ? $recordscreenData[3]['wireLotNumbers'] : [];
|
||||
|
||||
// 모든 LOT 번호가 입력되었는지 확인
|
||||
foreach ($lotNumbers as $lot) {
|
||||
if (trim($lot) === '') {
|
||||
$allCompleted = false;
|
||||
} else {
|
||||
$hasInProgress = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 모든 내화실 LOT 번호가 입력되었는지 확인
|
||||
foreach ($wireLotNumbers as $lot) {
|
||||
if (trim($lot) === '') {
|
||||
$allCompleted = false;
|
||||
} else {
|
||||
$hasInProgress = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 모든 LOT 번호가 입력된 경우 '완료'
|
||||
if ($allCompleted && $hasInProgress) {
|
||||
$state = '완료';
|
||||
}
|
||||
// 일부는 입력되었지만 모두 완료되지 않은 경우 '진행중'
|
||||
elseif ($hasInProgress) {
|
||||
$state = '진행중';
|
||||
}
|
||||
}
|
||||
|
||||
// 상태에 따라 출력
|
||||
switch ($state) {
|
||||
case "등록전":
|
||||
echo '<span class="badge bg-danger">등록전</span>';
|
||||
break;
|
||||
case "진행중":
|
||||
echo '<span class="badge bg-warning blink">진행중</span>';
|
||||
break;
|
||||
case "완료":
|
||||
echo '<span class="badge bg-dark">완료</span>';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="text-center"><?= htmlspecialchars($writerDate) ?></td>
|
||||
<td class="text-center"><?= $secondord ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $receiver ?></td>
|
||||
<td class="text-center"><?= $orderman ?></td>
|
||||
<?php
|
||||
$row_sum = $screen_su_cleaned + $slat_su_cleaned;
|
||||
$row_m2 = $screen_m2_cleaned + $slat_m2_cleaned;
|
||||
|
||||
$row_sum_formatted = number_format($row_sum);
|
||||
$row_m2_formatted = number_format($row_m2, 1);
|
||||
|
||||
if ($row_sum_formatted > 0) {
|
||||
echo '<td class="text-end">' . $row_sum_formatted . '</td>';
|
||||
} else {
|
||||
echo '<td class="text-end"> </td>';
|
||||
}
|
||||
|
||||
if ($row_m2_formatted > 0) {
|
||||
echo '<td class="text-end">' . $row_m2_formatted . '</td>';
|
||||
} else {
|
||||
echo '<td class="text-end"> </td>';
|
||||
}
|
||||
|
||||
$total_sum += $screen_su_cleaned;
|
||||
$total_m2 += $screen_m2_cleaned;
|
||||
$total_egi += $slat_su_cleaned;
|
||||
$total_egi_m2 += $slat_m2_cleaned;
|
||||
|
||||
// 소수점 첫째 자리까지만 포맷팅
|
||||
$total_m2_formatted = number_format($total_m2, 1);
|
||||
$total_egi_m2_formatted = number_format($total_egi_m2, 1);
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!--container-->
|
||||
|
||||
</form>
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var outputpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 100,
|
||||
"lengthMenu": [100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[1, 'desc']] // 출고예정기준 내림정렬
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var outputpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('outputpageNumber', outputpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(num, tablename, sep) {
|
||||
if(sep =='스크린')
|
||||
var url = "viewMidInspectBending.php?num=" + num + "&tablename=" + tablename;
|
||||
else
|
||||
var url = "viewMidInspectBending_slat.php?num=" + num + "&tablename=" + tablename;
|
||||
|
||||
customPopup(url, '절곡 중간검사 성적서', 800, 900);
|
||||
}
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
546
output/list_deliveryfee.php
Normal file
546
output/list_deliveryfee.php
Normal file
@@ -0,0 +1,546 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if (!isset($_SESSION["level"]) || $_SESSION["level"] > 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';
|
||||
$title_message = '배차 차량 일지';
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// 검색 조건 설정
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if (isset($_REQUEST["separate_date"])) {
|
||||
$separate_date = $_REQUEST["separate_date"];
|
||||
} else {
|
||||
$separate_date = "";
|
||||
}
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
$separate_date = "1";
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
// 이번 달의 첫째 날
|
||||
$fromdate = date("Y-m-01", strtotime($currentDate));
|
||||
|
||||
// 이번 달의 마지막 날
|
||||
$todate = date("Y-m-t", strtotime($currentDate)); // t는 해당 월의 마지막 날을 반환
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
|
||||
if ($separate_date == "1") {
|
||||
$SettingDate = "outdate";
|
||||
} else {
|
||||
$SettingDate = "indate";
|
||||
}
|
||||
|
||||
// 진행상태에 대한 검색
|
||||
$orderby = " ORDER BY " . $SettingDate . " DESC, num DESC"; // 내림차순 정렬
|
||||
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' and (devMode <> '1' OR devMode IS NULL) AND deliveryfeeList IS NOT NULL AND deliveryfeeList != '' AND deliveryfeeList != '[]' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND deliveryfeeList IS NOT NULL and (devMode <> '1' OR devMode IS NULL) AND deliveryfeeList != '' AND deliveryfeeList != '[]' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
|
||||
|
||||
// 수정된 쿼리: COD이 존재하고 is_deleted가 0인 자료만 선택
|
||||
if ($search == "") {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $where;
|
||||
} else {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $searchwhere;
|
||||
}
|
||||
|
||||
// 현재일자 변수지정
|
||||
$today = date("Y-m-d");
|
||||
|
||||
// SQL 실행 및 데이터 처리
|
||||
|
||||
// print $sql;
|
||||
|
||||
?>
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
|
||||
<div class="container">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-end align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm mx-2" onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm downloadExcel"> <i class="bi bi-floppy"></i> 엑셀 다운로드</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="d-flex justify-content-end align-items-center ">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-center align-items-center">
|
||||
<?php
|
||||
/********************************************************
|
||||
* 1) 전체 데이터를 가져오면서, 요약 계산을 동시에 수행
|
||||
********************************************************/
|
||||
|
||||
// (A) 합계를 저장할 배열·변수 준비
|
||||
$companySums = []; // 예: [ '25시물류' => 500000, '조운물류' => 300000, ... ]
|
||||
$prepaidSum = 0; // 선불 합계
|
||||
$collectSum = 0; // 착불 합계
|
||||
$totalSum = 0; // 총합 (모든 합계)
|
||||
|
||||
$resultRows = []; // 실제 목록 표시에 사용할 모든 레코드+deliveryfeeList 데이터를 담아둘 배열
|
||||
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // PDOStatement
|
||||
$total_row = $stmh->rowCount();
|
||||
|
||||
while ($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
// deliveryfeeList를 JSON -> 배열 디코딩
|
||||
$deliveryfeeListData = json_decode($row['deliveryfeeList'], true);
|
||||
if (!is_array($deliveryfeeListData) || count($deliveryfeeListData) === 0) {
|
||||
$deliveryfeeListData = [[]];
|
||||
}
|
||||
|
||||
// (B) 각 행을 순회하면서 합계 계산
|
||||
foreach ($deliveryfeeListData as $feeRow) {
|
||||
// col1 : 물류업체명, col5 : 합계(숫자), col6 : 착불/선불
|
||||
$company = $feeRow['col1'] ?? ''; // 예: '25시물류'
|
||||
$sumText = $feeRow['col5'] ?? ''; // 예: '12,345' (콤마가 있을 수도 있으므로)
|
||||
$payType = $feeRow['col6'] ?? ''; // 예: '착불' or '선불'
|
||||
|
||||
// 숫자 변환 (콤마 제거 후 float/int 변환)
|
||||
$sumValue = floatval(str_replace(',', '', $sumText));
|
||||
|
||||
// 물류업체명별 합계
|
||||
if (!isset($companySums[$company])) {
|
||||
$companySums[$company] = 0;
|
||||
}
|
||||
$companySums[$company] += $sumValue;
|
||||
|
||||
// 착불/선불 합계
|
||||
if ($payType === '선불') {
|
||||
$prepaidSum += $sumValue;
|
||||
} elseif ($payType === '착불') {
|
||||
$collectSum += $sumValue;
|
||||
}
|
||||
|
||||
// 총합
|
||||
$totalSum += $sumValue;
|
||||
}
|
||||
|
||||
// (C) 화면에 출력할 수 있도록, 원본 $row + deliveryfeeListData를 저장
|
||||
$resultRows[] = $row;
|
||||
}
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
|
||||
// (D) 합계 테이블을 출력하기 전에, 물류업체명 배열을 정렬(필요 시)
|
||||
ksort($companySums); // 키(물류업체명)로 정렬 - 사용 여부는 선택
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($deliveryfeeListData);
|
||||
// echo '</pre>';
|
||||
|
||||
?>
|
||||
|
||||
<!-- *********************************************** -->
|
||||
<!-- 2) 배송업체별 합계금액/선불 합계/착불 합계 테이블 -->
|
||||
<!-- *********************************************** -->
|
||||
<style>
|
||||
/* 예시 스타일 - 필요에 따라 조정 */
|
||||
.summary-table {
|
||||
margin-bottom: 1rem;
|
||||
border: 2px solid #333;
|
||||
border-collapse: collapse;
|
||||
width: auto; /* 상황에 맞춰 조정 */
|
||||
}
|
||||
.summary-table th, .summary-table td {
|
||||
border: 1px solid #333;
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.text-green { color: green; }
|
||||
.text-red { color: red; }
|
||||
</style>
|
||||
|
||||
<table class="summary-table mx-4">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
// 동적으로 물류업체명 컬럼 생성
|
||||
foreach ($companySums as $companyName => $amount) {
|
||||
echo "<th>" . htmlspecialchars($companyName) . "</th>";
|
||||
}
|
||||
?>
|
||||
<th class="text-green">선불</th>
|
||||
<th class="text-red">착불</th>
|
||||
<th>합계</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php
|
||||
// 물류업체명별 합계 표시
|
||||
foreach ($companySums as $companyName => $amount) {
|
||||
// 3자리 콤마
|
||||
$formatted = number_format($amount);
|
||||
echo "<td>{$formatted}</td>";
|
||||
}
|
||||
// 선불, 착불, 전체 합계
|
||||
$formattedPrepaid = number_format($prepaidSum);
|
||||
$formattedCollect = number_format($collectSum);
|
||||
$formattedTotal = number_format($totalSum);
|
||||
|
||||
echo "<td class='text-green'>{$formattedPrepaid}</td>";
|
||||
echo "<td class='text-red'>{$formattedCollect}</td>";
|
||||
echo "<td>{$formattedTotal}</td>";
|
||||
?>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
▷ <?= $total_row ?>
|
||||
<button type="button" class="btn btn-danger btn-sm mx-1" onclick='pre_month()' > 전월 </button>
|
||||
<button type="button" class="btn btn-primary btn-sm mx-1" onclick='this_month()' > 당월 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm mx-1" onclick='yesterday()' > 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm mx-1" onclick='this_today()' > 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm mx-1" onclick='this_tomorrow()' > 익일 </button>
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>" > ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?=$todate?>" >
|
||||
</span>
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control" style="width:150px;" >
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
|
||||
<div id="autocomplete-list">
|
||||
</div>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm" > <i class="bi bi-search"></i> 검색 </button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--card-body-->
|
||||
</div> <!--card -->
|
||||
</div> <!--container-fluid -->
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
|
||||
<table class="table table-hover" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<!-- 1,2,3열 : 기존 컬럼(번호, 출고일, 현장명) -->
|
||||
<th class="text-center" style="width:30px;">번호</th>
|
||||
<th class="text-center" style="width:100px;">출고일</th>
|
||||
<th class="text-center" style="width:300px;">현장명</th>
|
||||
|
||||
<!-- 4열부터 col1~col11 (배송비 내역) -->
|
||||
<th class="text-center">하차업체명</th>
|
||||
<th class="text-center">상차지</th>
|
||||
<th class="text-center">물류업체명</th>
|
||||
<th class="text-center">차량톤수</th>
|
||||
<th class="text-center">금 액</th>
|
||||
<th class="text-center">부가세</th>
|
||||
<th class="text-center">합계</th>
|
||||
<th class="text-center">착/선불</th>
|
||||
<th class="text-center">차량번호</th>
|
||||
<th class="text-center">기사 연락처</th>
|
||||
<th class="text-center">비고</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_row = $stmh->rowCount();
|
||||
$start_num = 1; // 페이지당 표시되는 첫 번째 글 순번
|
||||
|
||||
while ($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
// (예) DB 필드에서 출고일, 현장명, 오늘 날짜 비교 등에 사용
|
||||
$outdate = $row['outdate'] ?? '';
|
||||
$outworkplace = $row['outworkplace'] ?? '';
|
||||
$num = $row['num'] ?? '';
|
||||
$tablename = $tablename ?? '';
|
||||
|
||||
// 오늘 날짜와 출고일 비교해 색상 지정 (선택 사항)
|
||||
$date_font = ($today == $outdate) ? "text-danger" : "text-dark";
|
||||
|
||||
// 요일 표기
|
||||
if ($outdate !== "") {
|
||||
$week = ["(일)", "(월)", "(화)", "(수)", "(목)", "(금)", "(토)"];
|
||||
$outdate .= $week[ date('w', strtotime($outdate)) ];
|
||||
}
|
||||
|
||||
// deliveryfeeList를 JSON -> 배열 디코딩 (여러 개 행이 있을 수 있음)
|
||||
$deliveryfeeListData = json_decode($row['deliveryfeeList'], true);
|
||||
// 만약 데이터가 없거나 파싱 실패하면, 1개짜리 빈 배열로 처리 (빈 화면 대신)
|
||||
if (!is_array($deliveryfeeListData) || count($deliveryfeeListData) === 0) {
|
||||
$deliveryfeeListData = [[]];
|
||||
}
|
||||
|
||||
// deliveryfeeList의 각 행마다 <tr> 생성
|
||||
foreach ($deliveryfeeListData as $index => $feeRow) {
|
||||
// 첫 번째 행($index===0)일 때만 번호/출고일/현장명 표시
|
||||
// $tdNumber = ($index === 0) ? $start_num : '';
|
||||
// $tdOutdate = ($index === 0) ? "<span class='{$date_font}'>{$outdate}</span>" : '';
|
||||
// $tdWork = ($index === 0) ? $outworkplace : '';
|
||||
$tdNumber = $start_num ;
|
||||
$tdOutdate = "<span class='{$date_font}'>{$outdate}</span>" ;
|
||||
$tdWork = $outworkplace ;
|
||||
|
||||
// col1 ~ col11
|
||||
$col1 = $feeRow['col1'] ?? '';
|
||||
$col2 = $feeRow['col2'] ?? '';
|
||||
$col3 = $feeRow['col3'] ?? '';
|
||||
$col4 = $feeRow['col4'] ?? '';
|
||||
$col5 = $feeRow['col5'] ?? '';
|
||||
$col6 = $feeRow['col6'] ?? ''; // 체크할 컬럼 (선불/착불)
|
||||
$col7 = $feeRow['col7'] ?? '';
|
||||
$col8 = $feeRow['col8'] ?? '';
|
||||
$col9 = $feeRow['col9'] ?? '';
|
||||
$col10 = $feeRow['col10'] ?? '';
|
||||
$col11 = $feeRow['col11'] ?? '';
|
||||
|
||||
// col6이 비어있으면 blink 클래스 추가 (선불/착불)
|
||||
$blinkClass = ($col6 === '') ? 'blink-row' : '';
|
||||
|
||||
?>
|
||||
<tr class="<?= $blinkClass ?>" data-col6="<?= $col6 ?>" onclick="redirectToView('<?= $num ?>','<?= $tablename ?>')">
|
||||
<!-- 1,2,3열: 첫 행이면 표시, 아니면 빈 칸 -->
|
||||
<td class="text-center"><?= $tdNumber ?></td>
|
||||
<td class="text-center"><?= $tdOutdate ?></td>
|
||||
<td class="text-start"><?= $tdWork ?></td>
|
||||
|
||||
<!-- 4열부터 col1~col11 -->
|
||||
<td class="text-center"><?= htmlspecialchars($col10) ?></td>
|
||||
<td class="text-center "><?= htmlspecialchars($col9) ?></td>
|
||||
<td class="text-center"><?= htmlspecialchars($col1) ?></td>
|
||||
<td class="text-center"><?= htmlspecialchars($col2) ?></td>
|
||||
<td class="text-center"><?= htmlspecialchars($col3) ?></td>
|
||||
<td class="text-center"><?= htmlspecialchars($col4) ?></td>
|
||||
<td class="text-center blink-target"><?= htmlspecialchars($col5) ?></td>
|
||||
<td class="text-center col6-cell"><?= htmlspecialchars($col6) ?></td>
|
||||
<td class="text-center"><?= htmlspecialchars($col7) ?></td>
|
||||
<td class="text-center"><?= htmlspecialchars($col8) ?></td>
|
||||
<td class="text-center"><?= htmlspecialchars($col11) ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$start_num++;
|
||||
}
|
||||
|
||||
// DB 1행 처리 끝 -> 다음 레코드
|
||||
|
||||
} // while($row)
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div> <!--container-->
|
||||
|
||||
</form>
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var outputpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 100,
|
||||
"lengthMenu": [100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[1, 'desc']] // 출고예정기준 내림정렬
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var outputpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('outputpageNumber', outputpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(num, tablename) {
|
||||
var url = "write_form.php?mode=view&num=" + num + "&tablename=" + tablename;
|
||||
customPopup(url, '수주 내역', 1900, 920);
|
||||
}
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
// 엑셀 다운로드 버튼 클릭 이벤트
|
||||
$('.downloadExcel').on('click', function() {
|
||||
var data = [];
|
||||
var rows = $('#myTable tbody tr'); // 모달 내의 테이블 선택
|
||||
|
||||
// 각 행의 데이터를 수집
|
||||
rows.each(function() {
|
||||
var rowData = {};
|
||||
rowData['번호'] = $(this).find('td').eq(0).text().trim();
|
||||
rowData['출고일'] = $(this).find('td').eq(1).text().trim();
|
||||
rowData['현장명'] = $(this).find('td').eq(2).text().trim();
|
||||
rowData['하차업체명'] = $(this).find('td').eq(3).text().trim();
|
||||
rowData['상차지'] = $(this).find('td').eq(4).text().trim();
|
||||
rowData['물류업체명'] = $(this).find('td').eq(5).text().trim();
|
||||
rowData['차량톤수'] = $(this).find('td').eq(6).text().trim();
|
||||
rowData['금 액'] = $(this).find('td').eq(7).text().trim();
|
||||
rowData['부가세'] = $(this).find('td').eq(8).text().trim();
|
||||
rowData['합계'] = $(this).find('td').eq(9).text().trim();
|
||||
rowData['착/선불'] = $(this).find('td').eq(10).text().trim();
|
||||
rowData['차량번호'] = $(this).find('td').eq(11).text().trim();
|
||||
rowData['기사 연락처'] = $(this).find('td').eq(12).text().trim();
|
||||
rowData['비고'] = $(this).find('td').eq(13).text().trim();
|
||||
data.push(rowData);
|
||||
});
|
||||
|
||||
|
||||
// 엑셀 파일 생성 요청
|
||||
$.ajax({
|
||||
url: '/output/dl_ex_deliveryfee.php',
|
||||
method: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify(data),
|
||||
success: function(response) {
|
||||
// 응답이 문자열인 경우 JSON으로 파싱 시도
|
||||
if (typeof response === 'string') {
|
||||
try {
|
||||
response = JSON.parse(response);
|
||||
} catch(e) {
|
||||
alert('서버에서 유효하지 않은 응답을 받았습니다.');
|
||||
console.error("응답 파싱 오류:", e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(response.success){
|
||||
// 다운로드 URL 조정 (파일 경로에 맞게 수정)
|
||||
var filename = response.filename.split('/').pop();
|
||||
var downloadUrl = '/excelsave/' + encodeURIComponent(filename);
|
||||
window.location.href = downloadUrl;
|
||||
} else {
|
||||
alert('엑셀 파일 생성에 실패했습니다: ' + response.message);
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
console.error("AJAX 오류:", textStatus, errorThrown);
|
||||
alert('엑셀 파일 생성 중 오류가 발생했습니다.');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
// jQuery로 깜빡이는(blink) 효과 추가
|
||||
$(document).ready(function () {
|
||||
setInterval(function () {
|
||||
$(".blink-row").each(function () {
|
||||
let col6Cell = $(this).find('.col6-cell');
|
||||
let originalText = $(this).attr('data-col6'); // 원래의 col6 값
|
||||
|
||||
if (originalText.trim() === '') {
|
||||
if (col6Cell.text().trim() === '선불/착불 기록 남겨주세요') {
|
||||
col6Cell.text(''); // 공백으로 변경
|
||||
} else {
|
||||
col6Cell.text('선불/착불 기록 남겨주세요'); // 경고 문구 표시
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000); // 1초마다 변경
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
319
output/list_document.php
Normal file
319
output/list_document.php
Normal file
@@ -0,0 +1,319 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if (!isset($_SESSION["level"]) || $_SESSION["level"] > 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';
|
||||
$title_message = '실적신고 대상 List';
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// 검색 조건 설정
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if (isset($_REQUEST["separate_date"])) {
|
||||
$separate_date = $_REQUEST["separate_date"];
|
||||
} else {
|
||||
$separate_date = "";
|
||||
}
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if ($separate_date == "") {
|
||||
$separate_date = "1";
|
||||
}
|
||||
|
||||
if (isset($_REQUEST["status_option"])) {
|
||||
$existing_status = $_REQUEST["status_option"];
|
||||
} else {
|
||||
$existing_status = '전체';
|
||||
}
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 weeks", strtotime($currentDate))); // 1주 전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+3 months", strtotime($currentDate))); // 3개월 후 날짜
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
|
||||
if ($separate_date == "1") {
|
||||
$SettingDate = "outdate";
|
||||
} else {
|
||||
$SettingDate = "indate";
|
||||
}
|
||||
|
||||
// 진행상태에 대한 검색
|
||||
$orderby = " ORDER BY " . $SettingDate . " DESC, num DESC"; // 내림차순 정렬
|
||||
|
||||
if ($existing_status == '전체') {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND ACIregDate IS NOT NULL AND ACIregDate != '' AND (ACIcheck = '' or ACIcheck IS NULL) " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND ACIregDate IS NOT NULL AND ACIregDate != '' AND (ACIcheck = '' or ACIcheck IS NULL) AND searchtag LIKE '%$search%'" . $orderby;
|
||||
} else {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND regist_state = '$existing_status' AND ACIregDate IS NOT NULL AND ACIregDate != '' AND (ACIcheck = '' or ACIcheck IS NULL) " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND regist_state = '$existing_status' AND ACIregDate IS NOT NULL AND ACIregDate != '' AND (ACIcheck = '' or ACIcheck IS NULL) AND searchtag LIKE '%$search%'" . $orderby;
|
||||
}
|
||||
|
||||
// 수정된 쿼리: ACIregDate이 존재하고 is_deleted가 0인 자료만 선택
|
||||
if ($search == "") {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $where;
|
||||
} else {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $searchwhere;
|
||||
}
|
||||
|
||||
// 현재일자 변수지정
|
||||
$today = date("Y-m-d");
|
||||
|
||||
// SQL 실행 및 데이터 처리
|
||||
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_row = $stmh->rowCount();
|
||||
|
||||
$total_sum=0;
|
||||
$total_m2=0;
|
||||
$total_egi=0;
|
||||
$total_egi_m2=0;
|
||||
?>
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
|
||||
<div class="container">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-end align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm " onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="d-flex justify-content-end align-items-center ">
|
||||
<h5> <span id="total_screen" class="text-primary me-2"></span>
|
||||
<span id="total_screen_m2" class="badge bg-primary me-5"></span>
|
||||
<span id="total_egi" class="text-secondary me-2"></span>
|
||||
<span id="total_egi_m2" class="badge bg-secondary me-2"></span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-center align-items-center">
|
||||
▷ <?= $total_row ?>
|
||||
<button type="button" id="premonth" class="btn btn-dark btn-sm me-1" onclick='yesterday()' > 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1" onclick='this_today()' > 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" onclick='this_tomorrow()' > 익일 </button>
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>" > ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?=$todate?>" >
|
||||
</span>
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control mx-1" style="width:150px;height:30px;" >
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
<div id="autocomplete-list">
|
||||
</div>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm" > <i class="bi bi-search"></i> 검색 </button>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--card-body-->
|
||||
</div> <!--card -->
|
||||
</div> <!--container-fluid -->
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<table class="table table-hover" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center" style="width:50px;">번호</th>
|
||||
<th class="text-center" style="width:80px;">접수</th>
|
||||
<th class="text-center" style="width:80px;">요청 </th>
|
||||
<th class="text-center" style="width:80px;">완료 </th>
|
||||
<th class="text-center" style="width:100px;">발주처</th>
|
||||
<th class="text-center" style="width:100px;">제품종류 </th>
|
||||
<th class="text-center" style="width:80px;">제품코드</th>
|
||||
<th class="text-center" style="width:50px;">수량(틀)</th>
|
||||
<th class="text-center" style="width:250px;">현장명</th>
|
||||
<th class="text-center" style="width:200px;">메모</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
include '_row.php';
|
||||
|
||||
if($ACIregDate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$ACIregDate = $ACIregDate . $week[ date('w', strtotime($ACIregDate) ) ] ;
|
||||
}
|
||||
|
||||
$shutterSurang = 0; // 셔터 수량 합계를 저장할 변수 초기화
|
||||
$shutterSurang_slat = 0; // 철재
|
||||
|
||||
// JSON 데이터를 배열로 디코딩
|
||||
$eList_screenData = json_decode($eList_screen, true);
|
||||
$eList_slatData = json_decode($eList_slat, true);
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($eList_screen);
|
||||
// echo '</pre>';
|
||||
// echo '<pre>';
|
||||
// print_r($eList_slat);
|
||||
// echo '</pre>';
|
||||
|
||||
// 반복문을 통해 col14 값을 누적
|
||||
if (is_array($eList_screenData)) {
|
||||
foreach ($eList_screenData as $item) {
|
||||
$shutterSurang += isset($item['col14']) ? (int)$item['col14'] : 0;
|
||||
}
|
||||
}
|
||||
// slat 반복문을 통해 col15 값을 누적 slat
|
||||
if (is_array($eList_slatData)) {
|
||||
foreach ($eList_slatData as $item) {
|
||||
$shutterSurang_slat += isset($item['col15']) ? (int)$item['col15'] : 0;
|
||||
}
|
||||
}
|
||||
// 스크린,철재스라트 구분하기 JSON 데이터가 비어있는지 확인하여 값 설정
|
||||
if (!empty(json_decode($eList_screen, true))) {
|
||||
$separate_item = '스크린';
|
||||
} elseif (!empty(json_decode($eList_slat, true))) {
|
||||
$separate_item = '철재스라트';
|
||||
}
|
||||
?>
|
||||
<tr onclick="redirectToView('<?= $num ?>', '<?= $tablename ?>', '<?= $prodCode ?>')">
|
||||
<td class="text-center"><?= $start_num ?></td>
|
||||
<td class="text-center"><?= $ACIregDate ?></td>
|
||||
<td class="text-center"><?= $ACIaskDate === '0000-00-00' ? '' : $ACIaskDate ?></td>
|
||||
<td class="text-center"><?= $ACIdoneDate === '0000-00-00' ? '' : $ACIdoneDate ?></td>
|
||||
<td class="text-center"><?= $secondord ?></td>
|
||||
<td class="text-center<?= $separate_item === '철재스라트' ? ' text-primary' : '' ?>">
|
||||
<?= $separate_item ?>
|
||||
</td>
|
||||
<td class="text-center"><?= $prodCode ?></td>
|
||||
<td class="text-center"> <?= ($shutterSurang + $shutterSurang_slat) ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $ACImemo ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!--container-->
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var ACIpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 100,
|
||||
"lengthMenu": [100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[1, 'desc']] // 출고예정기준 내림정렬
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('ACIpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var ACIpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('ACIpageNumber', ACIpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('ACIpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('ACIpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(num, tablename, prodcode) {
|
||||
let prodName, arrayWidth, arrayHeight, url;
|
||||
|
||||
url = "/output/viewBoardAll.php?num=" + num + "&tablename=" + tablename;
|
||||
|
||||
customPopup(url, '인정검사 심사자료', 1250, 800);
|
||||
}
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
319
output/list_document_except.php
Normal file
319
output/list_document_except.php
Normal file
@@ -0,0 +1,319 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if (!isset($_SESSION["level"]) || $_SESSION["level"] > 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';
|
||||
$title_message = '실적신고(제외) 대상 List';
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// 검색 조건 설정
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if (isset($_REQUEST["separate_date"])) {
|
||||
$separate_date = $_REQUEST["separate_date"];
|
||||
} else {
|
||||
$separate_date = "";
|
||||
}
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if ($separate_date == "") {
|
||||
$separate_date = "1";
|
||||
}
|
||||
|
||||
if (isset($_REQUEST["status_option"])) {
|
||||
$existing_status = $_REQUEST["status_option"];
|
||||
} else {
|
||||
$existing_status = '전체';
|
||||
}
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 weeks", strtotime($currentDate))); // 1주 전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+3 months", strtotime($currentDate))); // 3개월 후 날짜
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
|
||||
if ($separate_date == "1") {
|
||||
$SettingDate = "outdate";
|
||||
} else {
|
||||
$SettingDate = "indate";
|
||||
}
|
||||
|
||||
// 진행상태에 대한 검색
|
||||
$orderby = " ORDER BY " . $SettingDate . " DESC, num DESC"; // 내림차순 정렬
|
||||
|
||||
if ($existing_status == '전체') {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND ACIregDate IS NOT NULL AND ACIregDate != '' AND ACIcheck = '1' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND ACIregDate IS NOT NULL AND ACIregDate != '' AND ACIcheck = '1' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
} else {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND regist_state = '$existing_status' AND ACIregDate IS NOT NULL AND ACIregDate != '' AND ACIcheck = '1' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND regist_state = '$existing_status' AND ACIregDate IS NOT NULL AND ACIregDate != '' AND ACIcheck = '1' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
}
|
||||
|
||||
// 수정된 쿼리: ACIregDate이 존재하고 is_deleted가 0인 자료만 선택
|
||||
if ($search == "") {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $where;
|
||||
} else {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $searchwhere;
|
||||
}
|
||||
|
||||
// 현재일자 변수지정
|
||||
$today = date("Y-m-d");
|
||||
|
||||
// SQL 실행 및 데이터 처리
|
||||
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_row = $stmh->rowCount();
|
||||
|
||||
$total_sum=0;
|
||||
$total_m2=0;
|
||||
$total_egi=0;
|
||||
$total_egi_m2=0;
|
||||
?>
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
|
||||
<div class="container">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-end align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm " onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="d-flex justify-content-end align-items-center ">
|
||||
<h5> <span id="total_screen" class="text-primary me-2"></span>
|
||||
<span id="total_screen_m2" class="badge bg-primary me-5"></span>
|
||||
<span id="total_egi" class="text-secondary me-2"></span>
|
||||
<span id="total_egi_m2" class="badge bg-secondary me-2"></span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-center align-items-center">
|
||||
▷ <?= $total_row ?>
|
||||
<button type="button" id="premonth" class="btn btn-dark btn-sm me-1" onclick='yesterday()' > 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1" onclick='this_today()' > 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1" onclick='this_tomorrow()' > 익일 </button>
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>" > ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?=$todate?>" >
|
||||
</span>
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control" style="width:150px;" >
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
<div id="autocomplete-list">
|
||||
</div>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm" > <i class="bi bi-search"></i> 검색 </button>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--card-body-->
|
||||
</div> <!--card -->
|
||||
</div> <!--container-fluid -->
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<table class="table table-hover" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center" style="width:50px;">번호</th>
|
||||
<th class="text-center" style="width:80px;">접수</th>
|
||||
<th class="text-center" style="width:80px;">요청 </th>
|
||||
<th class="text-center" style="width:80px;">완료 </th>
|
||||
<th class="text-center" style="width:100px;">발주처</th>
|
||||
<th class="text-center" style="width:100px;">제품종류 </th>
|
||||
<th class="text-center" style="width:80px;">제품코드</th>
|
||||
<th class="text-center" style="width:50px;">수량(틀)</th>
|
||||
<th class="text-center" style="width:250px;">현장명</th>
|
||||
<th class="text-center" style="width:200px;">메모</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
include '_row.php';
|
||||
|
||||
if($ACIregDate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$ACIregDate = $ACIregDate . $week[ date('w', strtotime($ACIregDate) ) ] ;
|
||||
}
|
||||
|
||||
$shutterSurang = 0; // 셔터 수량 합계를 저장할 변수 초기화
|
||||
$shutterSurang_slat = 0; // 철재
|
||||
|
||||
// JSON 데이터를 배열로 디코딩
|
||||
$eList_screenData = json_decode($eList_screen, true);
|
||||
$eList_slatData = json_decode($eList_slat, true);
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($eList_screen);
|
||||
// echo '</pre>';
|
||||
// echo '<pre>';
|
||||
// print_r($eList_slat);
|
||||
// echo '</pre>';
|
||||
|
||||
// 반복문을 통해 col14 값을 누적
|
||||
if (is_array($eList_screenData)) {
|
||||
foreach ($eList_screenData as $item) {
|
||||
$shutterSurang += isset($item['col14']) ? (int)$item['col14'] : 0;
|
||||
}
|
||||
}
|
||||
// slat 반복문을 통해 col15 값을 누적 slat
|
||||
if (is_array($eList_slatData)) {
|
||||
foreach ($eList_slatData as $item) {
|
||||
$shutterSurang_slat += isset($item['col15']) ? (int)$item['col15'] : 0;
|
||||
}
|
||||
}
|
||||
// 스크린,철재스라트 구분하기 JSON 데이터가 비어있는지 확인하여 값 설정
|
||||
if (!empty(json_decode($eList_screen, true))) {
|
||||
$separate_item = '스크린';
|
||||
} elseif (!empty(json_decode($eList_slat, true))) {
|
||||
$separate_item = '철재스라트';
|
||||
}
|
||||
?>
|
||||
<tr onclick="redirectToView('<?= $num ?>', '<?= $tablename ?>', '<?= $prodCode ?>')">
|
||||
<td class="text-center"><?= $start_num ?></td>
|
||||
<td class="text-center"><?= $ACIregDate ?></td>
|
||||
<td class="text-center"><?= $ACIaskDate === '0000-00-00' ? '' : $ACIaskDate ?></td>
|
||||
<td class="text-center"><?= $ACIdoneDate === '0000-00-00' ? '' : $ACIdoneDate ?></td>
|
||||
<td class="text-center"><?= $secondord ?></td>
|
||||
<td class="text-center<?= $separate_item === '철재스라트' ? ' text-primary' : '' ?>">
|
||||
<?= $separate_item ?>
|
||||
</td>
|
||||
<td class="text-center"><?= $prodCode ?></td>
|
||||
<td class="text-center"> <?= ($shutterSurang + $shutterSurang_slat) ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $ACImemo ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!--container-->
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var ACIpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 100,
|
||||
"lengthMenu": [100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[1, 'desc']] // 출고예정기준 내림정렬
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('ACIpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var ACIpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('ACIpageNumber', ACIpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('ACIpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('ACIpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(num, tablename, prodcode) {
|
||||
let prodName, arrayWidth, arrayHeight, url;
|
||||
|
||||
url = "/output/viewBoardAll.php?num=" + num + "&tablename=" + tablename;
|
||||
|
||||
customPopup(url, '인정검사 심사자료', 1250, 800);
|
||||
}
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
376
output/list_jointbar.php
Normal file
376
output/list_jointbar.php
Normal file
@@ -0,0 +1,376 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if (!isset($_SESSION["level"]) || $_SESSION["level"] > 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';
|
||||
$title_message = '조인트바 중간 검사성적서';
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// 검색 조건 설정
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if (isset($_REQUEST["separate_date"])) {
|
||||
$separate_date = $_REQUEST["separate_date"];
|
||||
} else {
|
||||
$separate_date = "";
|
||||
}
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if ($separate_date == "") {
|
||||
$separate_date = "1";
|
||||
}
|
||||
|
||||
if (isset($_REQUEST["status_option"])) {
|
||||
$existing_status = $_REQUEST["status_option"];
|
||||
} else {
|
||||
$existing_status = '전체';
|
||||
}
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 weeks", strtotime($currentDate))); // 1주 전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+3 months", strtotime($currentDate))); // 3개월 후 날짜
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
|
||||
if ($separate_date == "1") {
|
||||
$SettingDate = "outdate";
|
||||
} else {
|
||||
$SettingDate = "indate";
|
||||
}
|
||||
|
||||
// 진행상태에 대한 검색
|
||||
$orderby = " ORDER BY " . $SettingDate . " DESC, num DESC"; // 내림차순 정렬
|
||||
|
||||
if ($existing_status == '전체') {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND recordjointbar IS NOT NULL AND recordjointbar != '' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND recordjointbar IS NOT NULL AND recordjointbar != '' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
} else {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND regist_state = '$existing_status' AND recordjointbar IS NOT NULL AND recordjointbar != '' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND regist_state = '$existing_status' AND recordjointbar IS NOT NULL AND recordjointbar != '' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
}
|
||||
|
||||
// 수정된 쿼리: recordjointbar이 존재하고 is_deleted가 0인 자료만 선택
|
||||
if ($search == "") {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $where;
|
||||
} else {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $searchwhere;
|
||||
}
|
||||
|
||||
// 현재일자 변수지정
|
||||
$today = date("Y-m-d");
|
||||
|
||||
// SQL 실행 및 데이터 처리
|
||||
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_row = $stmh->rowCount();
|
||||
|
||||
$total_sum=0;
|
||||
$total_m2=0;
|
||||
$total_egi=0;
|
||||
$total_egi_m2=0;
|
||||
?>
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
|
||||
<div class="container">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-end align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm " onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-center align-items-center">
|
||||
▷ <?= $total_row ?>
|
||||
<button type="button" id="premonth" class="btn btn-dark btn-sm me-1 " onclick='yesterday()' > 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1 " onclick='this_today()' > 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1 " onclick='this_tomorrow()' > 익일 </button>
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>" > ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?=$todate?>" >
|
||||
</span>
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control" style="width:150px;" >
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
|
||||
<div id="autocomplete-list">
|
||||
</div>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm" > <i class="bi bi-search"></i> 검색 </button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--card-body-->
|
||||
</div> <!--card -->
|
||||
</div> <!--container-fluid -->
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<table class="table table-hover" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center" style="width:30px;">번호</th>
|
||||
<th class="text-center" style="width:120px;">출고일</th>
|
||||
<th class="text-center" style="width:100px;">접수일</th>
|
||||
<th class="text-center" style="width:100px;">제품종류 </th>
|
||||
<th class="text-center" style="width:100px;">제품코드</th>
|
||||
<th class="text-center" style="width:50px;">완료여부 </th>
|
||||
<th class="text-center" style="width:90px;">작성일</th>
|
||||
<th class="text-center" style="width:100px;">발주처</th>
|
||||
<th class="text-center" style="width:200px;">현장명</th>
|
||||
<th class="text-center" style="width:100px;">수신자</th>
|
||||
<th class="text-center" style="width:50px;">담당</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
|
||||
$total_m2_formatted = 0 ;
|
||||
$total_egi_m2_formatted = 0 ;
|
||||
|
||||
$total_screen_sum = 0;
|
||||
$total_screen_m2 = 0;
|
||||
|
||||
$total_egi_sum = 0;
|
||||
$total_egi_m2 = 0;
|
||||
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
include '_row.php';
|
||||
|
||||
// recordjointbar에서 작성일 및 작성자 추출
|
||||
$recordjointbarData = json_decode($row['recordjointbar'], true);
|
||||
$writerDate = isset($recordjointbarData[0]['approval']['writer']['date']) ? $recordjointbarData[0]['approval']['writer']['date'] : '';
|
||||
|
||||
|
||||
// 콤마를 제거하고 숫자로 변환
|
||||
$screen_su_cleaned = floatval(str_replace(',', '', $screen_su));
|
||||
$screen_m2_cleaned = floatval(str_replace(',', '', $screen_m2));
|
||||
|
||||
$slat_su_cleaned = floatval(str_replace(',', '', $slat_su));
|
||||
$slat_m2_cleaned = floatval(str_replace(',', '', $slat_m2));
|
||||
|
||||
$screenlists = json_decode($screenlist, true);
|
||||
// var_dump($screenlists["screen_m2"]);
|
||||
|
||||
|
||||
$date_font="text-dark"; // 현재일자 Red 색상으로 표기
|
||||
if($today==$outdate) {
|
||||
$date_font="text-danger";
|
||||
}
|
||||
|
||||
if($outdate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ;
|
||||
}
|
||||
|
||||
// 스크린,철재스라트 구분하기 JSON 데이터가 비어있는지 확인하여 값 설정
|
||||
if (!empty(json_decode($eList_screen, true))) {
|
||||
$separate_item = '스크린';
|
||||
} elseif (!empty(json_decode($eList_slat, true))) {
|
||||
$separate_item = '철재스라트';
|
||||
}
|
||||
?>
|
||||
<tr onclick="redirectToView('<?= $num ?>', '<?= $tablename ?>')">
|
||||
<td class="text-center"><?= $start_num ?></td>
|
||||
<td class="text-center"><?= $outdate ?></td>
|
||||
<td class="text-center"><?= $indate ?></td>
|
||||
<td class="text-center<?= $separate_item === '철재스라트' ? ' text-primary' : '' ?>">
|
||||
<?= $separate_item ?>
|
||||
</td>
|
||||
<td class="text-center"><?= $prodCode ?></td>
|
||||
<td class="text-center">
|
||||
<?php
|
||||
// recordjointbar에서 각 로트의 상태를 검사
|
||||
$recordjointbarData = json_decode($row['recordjointbar'], true);
|
||||
|
||||
// 기본값 설정
|
||||
$state = '등록전';
|
||||
$allBlank = true; // 모든 LOT 번호가 공백인지 확인
|
||||
$hasInProgress = false; // 값이 있는 경우를 확인
|
||||
$hasPass = false; // "합격"이 있는지 확인
|
||||
|
||||
// recordjointbar 데이터가 유효할 경우 상태 확인
|
||||
if (is_array($recordjointbarData)) {
|
||||
// LOT 번호 배열이 있는지 확인
|
||||
$inputValue = isset($recordjointbarData[1]['inputValue']) ? $recordjointbarData[1]['inputValue'] : [];
|
||||
|
||||
// 모든 LOT 번호의 상태를 검사
|
||||
foreach ($inputValue as $lot) {
|
||||
$lot = trim($lot); // 공백 제거
|
||||
if ($lot !== '') {
|
||||
$allBlank = false; // 공백이 아닌 값이 있으면 false
|
||||
$hasInProgress = true; // 값이 있는 상태로 변경
|
||||
if ($lot === '합격') {
|
||||
$hasPass = true; // "합격" 상태 확인
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 모든 LOT 번호가 공백인 경우
|
||||
if ($allBlank) {
|
||||
$state = '등록전';
|
||||
}
|
||||
// "합격"이 있는 경우
|
||||
elseif ($hasPass) {
|
||||
$state = '완료';
|
||||
}
|
||||
// 값은 있으나 "합격"이 없는 경우
|
||||
elseif ($hasInProgress) {
|
||||
$state = '진행중';
|
||||
}
|
||||
}
|
||||
|
||||
// 상태에 따라 출력
|
||||
switch ($state) {
|
||||
case "등록전":
|
||||
echo '<span class="badge bg-danger">등록전</span>';
|
||||
break;
|
||||
case "진행중":
|
||||
echo '<span class="badge bg-warning blink">진행중</span>';
|
||||
break;
|
||||
case "완료":
|
||||
echo '<span class="badge bg-dark">완료</span>';
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="text-center"><?= htmlspecialchars($writerDate) ?></td>
|
||||
<td class="text-center"><?= $secondord ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $receiver ?></td>
|
||||
<td class="text-center"><?= $orderman ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!--container-->
|
||||
|
||||
</form>
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var outputpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 100,
|
||||
"lengthMenu": [100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[1, 'desc']] // 출고예정기준 내림정렬
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var outputpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('outputpageNumber', outputpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(num, tablename) {
|
||||
var url = "viewinspectionJointbar.php?num=" + num + "&tablename=" + tablename;
|
||||
customPopup(url, '조인트바 중간 검사', 800, 900);
|
||||
}
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
382
output/list_order.php
Normal file
382
output/list_order.php
Normal file
@@ -0,0 +1,382 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if (!isset($_SESSION["level"]) || $_SESSION["level"] > 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';
|
||||
$title_message = '발주서 리스트';
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// 검색 조건 설정
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if (isset($_REQUEST["separate_date"])) {
|
||||
$separate_date = $_REQUEST["separate_date"];
|
||||
} else {
|
||||
$separate_date = "";
|
||||
}
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if ($separate_date == "") {
|
||||
$separate_date = "1";
|
||||
}
|
||||
|
||||
if (isset($_REQUEST["status_option"])) {
|
||||
$existing_status = $_REQUEST["status_option"];
|
||||
} else {
|
||||
$existing_status = '전체';
|
||||
}
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 weeks", strtotime($currentDate))); // 1주 전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+3 months", strtotime($currentDate))); // 3개월 후 날짜
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
|
||||
if ($separate_date == "1") {
|
||||
$SettingDate = "outdate";
|
||||
} else {
|
||||
$SettingDate = "indate";
|
||||
}
|
||||
|
||||
// 진행상태에 대한 검색
|
||||
$orderby = " ORDER BY " . $SettingDate . " DESC, num DESC"; // 내림차순 정렬
|
||||
|
||||
if ($existing_status == '전체') {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND ( is_deleted = '0' or is_deleted IS NULL ) AND lotNum IS NOT NULL AND lotNum != '' " . $orderby;
|
||||
$searchwhere = " WHERE ( is_deleted = '0' or is_deleted IS NULL ) AND lotNum IS NOT NULL AND lotNum != '' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
} else {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND ( is_deleted = '0' or is_deleted IS NULL ) AND regist_state = '$existing_status' AND lotNum IS NOT NULL AND lotNum != '' " . $orderby;
|
||||
$searchwhere = " WHERE ( is_deleted = '0' or is_deleted IS NULL ) AND regist_state = '$existing_status' AND lotNum IS NOT NULL AND lotNum != '' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
}
|
||||
|
||||
// 수정된 쿼리: COD이 존재하고 is_deleted가 0인 자료만 선택
|
||||
if ($search == "") {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $where;
|
||||
} else {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $searchwhere;
|
||||
}
|
||||
|
||||
// 현재일자 변수지정
|
||||
$today = date("Y-m-d");
|
||||
|
||||
// SQL 실행 및 데이터 처리
|
||||
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_row = $stmh->rowCount();
|
||||
|
||||
?>
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
|
||||
<div class="container">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-end align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm " onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="d-flex justify-content-end align-items-center ">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-center align-items-center">
|
||||
▷ <?= $total_row ?>
|
||||
<button type="button" id="premonth" class="btn btn-dark btn-sm me-1 " onclick='yesterday()' > 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1 " onclick='this_today()' > 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1 " onclick='this_tomorrow()' > 익일 </button>
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>" > ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?=$todate?>" >
|
||||
</span>
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control" style="width:150px;" >
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
|
||||
<div id="autocomplete-list">
|
||||
</div>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm" > <i class="bi bi-search"></i> 검색 </button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--card-body-->
|
||||
</div> <!--card -->
|
||||
</div> <!--container-fluid -->
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<table class="table table-hover" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center" style="width:30px;">번호</th>
|
||||
<th class="text-center" style="width:120px;">출고일</th>
|
||||
<th class="text-center" style="width:90px;">작성일</th>
|
||||
<th class="text-center" style="width:90px;">승인일</th>
|
||||
<th class="text-center" style="width:100px;">제품종류 </th>
|
||||
<th class="text-center" style="width:100px;">제품코드</th>
|
||||
<th class="text-center" style="width:50px;">완료여부 </th>
|
||||
<th class="text-center" style="width:100px;">발주처</th>
|
||||
<th class="text-center" style="width:300px;">현장명</th>
|
||||
<th class="text-center" style="width:200px;">수신자</th>
|
||||
<th class="text-center" style="width:50px;">담당</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
include '_row.php';
|
||||
|
||||
// COD에서 작성일 및 작성자 추출
|
||||
$CODData = json_decode($row['lotNum'], true);
|
||||
$ordersheet1 = json_decode($row['ordersheet'], true);
|
||||
$ordersheet2 = json_decode($row['ordersheet_slat'], true);
|
||||
|
||||
$writerDisplay = '';
|
||||
$approver_date = '';
|
||||
|
||||
if (!empty($ordersheet1[0]['approval']['writer']['date'])) {
|
||||
$writerDisplay = $ordersheet1[0]['approval']['writer']['date'];
|
||||
} elseif (!empty($ordersheet2[0]['approval']['writer']['date'])) {
|
||||
$writerDisplay = $ordersheet2[0]['approval']['writer']['date'];
|
||||
}
|
||||
|
||||
if (!empty($ordersheet1[0]['approval']['approver']['date'])) {
|
||||
$approver_date = $ordersheet1[0]['approval']['approver']['date'];
|
||||
} elseif (!empty($ordersheet2[0]['approval']['approver']['date'])) {
|
||||
$approver_date = $ordersheet2[0]['approval']['approver']['date'];
|
||||
}
|
||||
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($ordersheet);
|
||||
// echo '</pre>';
|
||||
|
||||
$date_font="text-dark"; // 현재일자 Red 색상으로 표기
|
||||
if($today==$outdate) {
|
||||
$date_font="text-danger";
|
||||
}
|
||||
|
||||
if($outdate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ;
|
||||
}
|
||||
|
||||
$separate_item = '';
|
||||
// 스크린,철재스라트 구분하기 JSON 데이터가 비어있는지 확인하여 값 설정
|
||||
if (!empty(json_decode($estimateList, true))) {
|
||||
$separate_item = '스크린';
|
||||
} elseif (!empty(json_decode($estimateSlatList, true))) {
|
||||
$separate_item = '철재스라트';
|
||||
}
|
||||
if(!empty($separate_item))
|
||||
{
|
||||
?>
|
||||
<tr data-sep='<?=$separate_item?>' onclick="redirectToView('<?= $num ?>', '<?= $tablename ?>', '<?= $separate_item ?>')">
|
||||
<td class="text-center"><?= $start_num ?></td>
|
||||
<td class="text-center"><?= $outdate ?></td>
|
||||
<td class="text-center"><?= htmlspecialchars($writerDisplay) ?></td>
|
||||
<td class="text-center"><?= htmlspecialchars($approver_date ) ?></td>
|
||||
<td class="text-center<?= $separate_item === '철재스라트' ? ' text-primary' : '' ?>">
|
||||
<?= $separate_item ?>
|
||||
</td>
|
||||
<td class="text-center"><?= $prodCode ?></td>
|
||||
<td class="text-center">
|
||||
<?php
|
||||
// COD에서 각 로트의 상태를 검사
|
||||
$CODData = json_decode($row['lotNum'], true);
|
||||
|
||||
// 기본값 설정
|
||||
$state = '등록전';
|
||||
$allCompleted = true; // 모든 LOT 번호가 입력되었는지 확인
|
||||
$hasInProgress = false; // 하나라도 입력된 상태가 있는지 확인
|
||||
|
||||
// lotNum 데이터가 유효할 경우 상태 확인
|
||||
if (is_array($CODData)) {
|
||||
// LOT 번호 배열이 있는지 확인
|
||||
$lotNumbers = isset($CODData[2]['lotNumbers']) ? $CODData[2]['lotNumbers'] : [];
|
||||
$wireLotNumbers = isset($CODData[3]['wireLotNumbers']) ? $CODData[3]['wireLotNumbers'] : [];
|
||||
|
||||
// 모든 LOT 번호가 입력되었는지 확인
|
||||
foreach ($lotNumbers as $lot) {
|
||||
if (trim($lot) === '') {
|
||||
$allCompleted = false;
|
||||
} else {
|
||||
$hasInProgress = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 모든 내화실 LOT 번호가 입력되었는지 확인
|
||||
foreach ($wireLotNumbers as $lot) {
|
||||
if (trim($lot) === '') {
|
||||
$allCompleted = false;
|
||||
} else {
|
||||
$hasInProgress = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 모든 LOT 번호가 입력된 경우 '완료'
|
||||
if ($allCompleted && $hasInProgress) {
|
||||
$state = '완료';
|
||||
}
|
||||
// 일부는 입력되었지만 모두 완료되지 않은 경우 '진행중'
|
||||
elseif ($hasInProgress) {
|
||||
$state = '진행중';
|
||||
}
|
||||
}
|
||||
|
||||
// 상태에 따라 출력
|
||||
switch ($state) {
|
||||
case "등록전":
|
||||
echo '<span class="badge bg-danger">등록전</span>';
|
||||
break;
|
||||
case "진행중":
|
||||
echo '<span class="badge bg-warning blink">진행중</span>';
|
||||
break;
|
||||
case "완료":
|
||||
echo '<span class="badge bg-dark">완료</span>';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="text-center"><?= $secondord ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $receiver ?></td>
|
||||
<td class="text-center"><?= $orderman ?></td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!--container-->
|
||||
|
||||
</form>
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var outputpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 100,
|
||||
"lengthMenu": [100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[1, 'desc']] // 출고예정기준 내림정렬
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var outputpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('outputpageNumber', outputpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(num, tablename, sep) {
|
||||
if(sep =='스크린')
|
||||
var url = "viewOrder.php?num=" + num + "&tablename=" + tablename;
|
||||
else
|
||||
var url = "viewOrder_slat.php?num=" + num + "&tablename=" + tablename;
|
||||
|
||||
customPopup(url, '발주서', 800, 900);
|
||||
}
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
376
output/list_output.php
Normal file
376
output/list_output.php
Normal file
@@ -0,0 +1,376 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||||
if (!isset($_SESSION["level"]) || $_SESSION["level"] > 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';
|
||||
$title_message = '출고증 리스트';
|
||||
?>
|
||||
<title> <?=$title_message?> </title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/myheader.php'); ?>
|
||||
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/mymodal.php'); ?>
|
||||
<?php
|
||||
$tablename = 'output';
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// 검색 조건 설정
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
|
||||
$fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : '';
|
||||
$todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : '';
|
||||
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||||
$SettingDate = isset($_REQUEST['SettingDate']) ? $_REQUEST['SettingDate'] : " regist_day ";
|
||||
|
||||
if (isset($_REQUEST["separate_date"])) {
|
||||
$separate_date = $_REQUEST["separate_date"];
|
||||
} else {
|
||||
$separate_date = "";
|
||||
}
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if ($separate_date == "") {
|
||||
$separate_date = "1";
|
||||
}
|
||||
|
||||
if (isset($_REQUEST["status_option"])) {
|
||||
$existing_status = $_REQUEST["status_option"];
|
||||
} else {
|
||||
$existing_status = '전체';
|
||||
}
|
||||
|
||||
// 현재 날짜
|
||||
$currentDate = date("Y-m-d");
|
||||
|
||||
// fromdate 또는 todate가 빈 문자열이거나 null인 경우
|
||||
if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) {
|
||||
$fromdate = date("Y-m-d", strtotime("-1 weeks", strtotime($currentDate))); // 1주 전 날짜
|
||||
$todate = date("Y-m-d", strtotime("+3 months", strtotime($currentDate))); // 3개월 후 날짜
|
||||
$Transtodate = $todate;
|
||||
} else {
|
||||
// fromdate와 todate가 모두 설정된 경우 (기존 로직 유지)
|
||||
$Transtodate = $todate;
|
||||
}
|
||||
|
||||
if ($separate_date == "1") {
|
||||
$SettingDate = "outdate";
|
||||
} else {
|
||||
$SettingDate = "indate";
|
||||
}
|
||||
|
||||
// 진행상태에 대한 검색
|
||||
$orderby = " ORDER BY " . $SettingDate . " DESC, num DESC"; // 내림차순 정렬
|
||||
|
||||
if ($existing_status == '전체') {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND COD IS NOT NULL AND COD != '' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND COD IS NOT NULL AND COD != '' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
} else {
|
||||
$where = " WHERE " . $SettingDate . " BETWEEN date('$fromdate') AND date('$Transtodate') AND is_deleted = '0' AND regist_state = '$existing_status' AND COD IS NOT NULL AND COD != '' " . $orderby;
|
||||
$searchwhere = " WHERE is_deleted = '0' AND regist_state = '$existing_status' AND COD IS NOT NULL AND COD != '' AND searchtag LIKE '%$search%'" . $orderby;
|
||||
}
|
||||
|
||||
// 수정된 쿼리: COD이 존재하고 is_deleted가 0인 자료만 선택
|
||||
if ($search == "") {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $where;
|
||||
} else {
|
||||
$sql = "SELECT * FROM $DB.$tablename " . $searchwhere;
|
||||
}
|
||||
|
||||
// 현재일자 변수지정
|
||||
$today = date("Y-m-d");
|
||||
|
||||
// SQL 실행 및 데이터 처리
|
||||
|
||||
try {
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_row = $stmh->rowCount();
|
||||
|
||||
$total_sum=0;
|
||||
$total_m2=0;
|
||||
$total_egi=0;
|
||||
$total_egi_m2=0;
|
||||
?>
|
||||
<form id="board_form" name="board_form" method="post" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="num" name="num">
|
||||
<input type="hidden" id="tablename" name="tablename" value="<?=$tablename?>">
|
||||
<input type="hidden" id="header" name="header" value="<?=$header?>">
|
||||
|
||||
<div class="container">
|
||||
<div class="card mb-2 mt-2">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="d-flex p-1 m-1 mt-1 justify-content-end align-items-center ">
|
||||
<h5> <?=$title_message?> </h5>
|
||||
<button type="button" class="btn btn-dark btn-sm " onclick='location.reload();' > <i class="bi bi-arrow-clockwise"></i> </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="d-flex justify-content-end align-items-center ">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex p-1 m-1 mt-1 mb-1 justify-content-center align-items-center">
|
||||
▷ <?= $total_row ?>
|
||||
<button type="button" id="premonth" class="btn btn-dark btn-sm me-1 " onclick='yesterday()' > 전일 </button>
|
||||
<button type="button" class="btn btn-outline-dark btn-sm me-1 " onclick='this_today()' > 금일 </button>
|
||||
<button type="button" class="btn btn-dark btn-sm me-1 " onclick='this_tomorrow()' > 익일 </button>
|
||||
<input type="date" id="fromdate" name="fromdate" class="form-control" style="width:100px;" value="<?=$fromdate?>" > ~
|
||||
<input type="date" id="todate" name="todate" class="form-control me-1" style="width:100px;" value="<?=$todate?>" >
|
||||
</span>
|
||||
<div class="inputWrap">
|
||||
<input type="text" id="search" name="search" value="<?=$search?>" onkeydown="JavaScript:SearchEnter();" autocomplete="off" class="form-control" style="width:150px;" >
|
||||
<button class="btnClear"></button>
|
||||
</div>
|
||||
|
||||
<div id="autocomplete-list">
|
||||
</div>
|
||||
|
||||
<button id="searchBtn" type="button" class="btn btn-dark btn-sm" > <i class="bi bi-search"></i> 검색 </button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--card-body-->
|
||||
</div> <!--card -->
|
||||
</div> <!--container-fluid -->
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<table class="table table-hover" id="myTable">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th class="text-center" style="width:30px;">번호</th>
|
||||
<th class="text-center" style="width:120px;">출고일</th>
|
||||
<th class="text-center" style="width:100px;">접수일</th>
|
||||
<th class="text-center" style="width:90px;">작성일</th>
|
||||
<th class="text-center" style="width:100px;">제품종류 </th>
|
||||
<th class="text-center" style="width:100px;">제품코드</th>
|
||||
<th class="text-center" style="width:50px;">완료여부 </th>
|
||||
<th class="text-center" style="width:100px;">발주처</th>
|
||||
<th class="text-center" style="width:300px;">현장명</th>
|
||||
<th class="text-center" style="width:200px;">수신자</th>
|
||||
<th class="text-center" style="width:50px;">담당</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
|
||||
$total_m2_formatted = 0 ;
|
||||
$total_egi_m2_formatted = 0 ;
|
||||
|
||||
$total_screen_sum = 0;
|
||||
$total_screen_m2 = 0;
|
||||
|
||||
$total_egi_sum = 0;
|
||||
$total_egi_m2 = 0;
|
||||
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
include '_row.php';
|
||||
|
||||
// COD에서 작성일 및 작성자 추출
|
||||
$CODData = json_decode($row['COD'], true);
|
||||
$writerDate = isset($CODData[0]['approval']['writer']['date']) ? $CODData[0]['approval']['writer']['date'] : '';
|
||||
|
||||
$date_font="text-dark"; // 현재일자 Red 색상으로 표기
|
||||
if($today==$outdate) {
|
||||
$date_font="text-danger";
|
||||
}
|
||||
|
||||
if($outdate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ;
|
||||
}
|
||||
|
||||
$separate_item = '';
|
||||
// 스크린,철재스라트 구분하기 JSON 데이터가 비어있는지 확인하여 값 설정
|
||||
if (!empty(json_decode($estimateList, true))) {
|
||||
$separate_item = '스크린';
|
||||
} elseif (!empty(json_decode($estimateSlatList, true))) {
|
||||
$separate_item = '철재스라트';
|
||||
}
|
||||
if(!empty($separate_item))
|
||||
{
|
||||
?>
|
||||
<tr data-sep='<?=$separate_item?>' onclick="redirectToView('<?= $num ?>', '<?= $tablename ?>', '<?= $separate_item ?>')">
|
||||
<td class="text-center"><?= $start_num ?></td>
|
||||
<td class="text-center"><?= $outdate ?></td>
|
||||
<td class="text-center"><?= $indate ?></td>
|
||||
<td class="text-center"><?= htmlspecialchars($writerDate) ?></td>
|
||||
<td class="text-center<?= $separate_item === '철재스라트' ? ' text-primary' : '' ?>">
|
||||
<?= $separate_item ?>
|
||||
</td>
|
||||
<td class="text-center"><?= $prodCode ?></td>
|
||||
<td class="text-center">
|
||||
<?php
|
||||
// COD에서 각 로트의 상태를 검사
|
||||
$CODData = json_decode($row['COD'], true);
|
||||
|
||||
// 기본값 설정
|
||||
$state = '등록전';
|
||||
$allCompleted = true; // 모든 LOT 번호가 입력되었는지 확인
|
||||
$hasInProgress = false; // 하나라도 입력된 상태가 있는지 확인
|
||||
|
||||
// COD 데이터가 유효할 경우 상태 확인
|
||||
if (is_array($CODData)) {
|
||||
// LOT 번호 배열이 있는지 확인
|
||||
$lotNumbers = isset($CODData[2]['lotNumbers']) ? $CODData[2]['lotNumbers'] : [];
|
||||
$wireLotNumbers = isset($CODData[3]['wireLotNumbers']) ? $CODData[3]['wireLotNumbers'] : [];
|
||||
|
||||
// 모든 LOT 번호가 입력되었는지 확인
|
||||
foreach ($lotNumbers as $lot) {
|
||||
if (trim($lot) === '') {
|
||||
$allCompleted = false;
|
||||
} else {
|
||||
$hasInProgress = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 모든 내화실 LOT 번호가 입력되었는지 확인
|
||||
foreach ($wireLotNumbers as $lot) {
|
||||
if (trim($lot) === '') {
|
||||
$allCompleted = false;
|
||||
} else {
|
||||
$hasInProgress = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 모든 LOT 번호가 입력된 경우 '완료'
|
||||
if ($allCompleted && $hasInProgress) {
|
||||
$state = '완료';
|
||||
}
|
||||
// 일부는 입력되었지만 모두 완료되지 않은 경우 '진행중'
|
||||
elseif ($hasInProgress) {
|
||||
$state = '진행중';
|
||||
}
|
||||
}
|
||||
|
||||
// 상태에 따라 출력
|
||||
switch ($state) {
|
||||
case "등록전":
|
||||
echo '<span class="badge bg-danger">등록전</span>';
|
||||
break;
|
||||
case "진행중":
|
||||
echo '<span class="badge bg-warning blink">진행중</span>';
|
||||
break;
|
||||
case "완료":
|
||||
echo '<span class="badge bg-dark">완료</span>';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="text-center"><?= $secondord ?></td>
|
||||
<td class="text-start"><?= $outworkplace ?></td>
|
||||
<td class="text-start"><?= $receiver ?></td>
|
||||
<td class="text-center"><?= $orderman ?></td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: " . $Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!--container-->
|
||||
|
||||
</form>
|
||||
<script>
|
||||
// 페이지 로딩
|
||||
$(document).ready(function(){
|
||||
var loader = document.getElementById('loadingOverlay');
|
||||
if(loader)
|
||||
loader.style.display = 'none';
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var dataTable; // DataTables 인스턴스 전역 변수
|
||||
var outputpageNumber; // 현재 페이지 번호 저장을 위한 전역 변수
|
||||
|
||||
$(document).ready(function() {
|
||||
// DataTables 초기 설정
|
||||
dataTable = $('#myTable').DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"searching": false,
|
||||
"pageLength": 100,
|
||||
"lengthMenu": [100, 200, 500, 1000],
|
||||
"language": {
|
||||
"lengthMenu": "Show _MENU_ entries"
|
||||
},
|
||||
"order": [[1, 'desc']] // 출고예정기준 내림정렬
|
||||
});
|
||||
|
||||
// 페이지 번호 복원 (초기 로드 시)
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
|
||||
// 페이지 변경 이벤트 리스너
|
||||
dataTable.on('page.dt', function() {
|
||||
var outputpageNumber = dataTable.page.info().page + 1;
|
||||
setCookie('outputpageNumber', outputpageNumber, 10); // 쿠키에 페이지 번호 저장
|
||||
});
|
||||
|
||||
// 페이지 길이 셀렉트 박스 변경 이벤트 처리
|
||||
$('#myTable_length select').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
dataTable.page.len(selectedValue).draw(); // 페이지 길이 변경 (DataTable 파괴 및 재초기화 없이)
|
||||
|
||||
// 변경 후 현재 페이지 번호 복원
|
||||
savedPageNumber = getCookie('outputpageNumber');
|
||||
if (savedPageNumber) {
|
||||
dataTable.page(parseInt(savedPageNumber) - 1).draw(false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function restorePageNumber() {
|
||||
var savedPageNumber = getCookie('outputpageNumber');
|
||||
// if (savedPageNumber) {
|
||||
// dataTable.page(parseInt(savedPageNumber) - 1).draw('page');
|
||||
// }
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function redirectToView(num, tablename, sep) {
|
||||
if(sep =='스크린')
|
||||
var url = "viewOutput.php?num=" + num + "&tablename=" + tablename;
|
||||
else
|
||||
var url = "viewOutput_slat.php?num=" + num + "&tablename=" + tablename;
|
||||
|
||||
customPopup(url, '출고증', 800, 900);
|
||||
}
|
||||
|
||||
function submitForm(status) {
|
||||
$('input[name=status_option]').val(status);
|
||||
document.getElementById('board_form').submit();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
// 방문기록 남김
|
||||
var title = '<?php echo $title_message; ?>';
|
||||
saveMenuLog(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user