5) {
sleep(1);
header("Location:" . $WebSite . "login/login_form.php");
exit;
}
include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php';
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
$num = isset($_REQUEST["num"]) ? $_REQUEST["num"] : "";
$tablename = isset($_REQUEST["tablename"]) ? $_REQUEST["tablename"] : "";
$header = isset($_REQUEST["header"]) ? $_REQUEST["header"] : ""; // 수주창에서 호출하는 경우 사용
$itemoption = isset($_REQUEST["itemoption"]) ? $_REQUEST["itemoption"] : ""; // option = screen , slat 선택 전달 (수주내역에서 호출)
$tempKey = isset($_REQUEST["tempKey"]) ? $_REQUEST["tempKey"] : "";
$estimateSurang = $_REQUEST['estimateSurang'] ?? '';
$EstimateFirstSum = $_REQUEST['EstimateFirstSum'] ?? '';
$EstimateUpdatetSum = $_REQUEST['EstimateUpdatetSum'] ?? '';
$EstimateDiffer = $_REQUEST['EstimateDiffer'] ?? '';
$estimateTotal = $_REQUEST['estimateTotal'] ?? '';
$makeWidth = $_REQUEST['makeWidth'] ?? '';
$makeHeight = $_REQUEST['makeHeight'] ?? '';
$maguriWing = $_REQUEST['maguriWing'] ?? '';
$inspectionFee = $_REQUEST['inspectionFee'] ?? '';
// print '$makeWidth ' . $makeWidth . '
';
// print '$makeHeight ' . $makeHeight . '
';
// print '$maguriWing ' . $maguriWing . '
';
// print '$inspectionFee ' . $inspectionFee . '
';
if($header == 'header')
{
$title_message = "견적서에서 발주 산출";
}
else
{
if($mode === 'copy')
$title_message = "(데이터복사) 견적 산출";
else
$title_message = "견적 산출" ;
}
if($itemoption == 'screen')
{
$title_message = "스크린 발주서 수정";
$tablename = 'output';
$major_category = '스크린';
}
else if($itemoption == 'slat')
{
$title_message = "철재스라트 발주서 수정";
$tablename = 'output';
$major_category = '철재';
}
$authorities = ["개발자","전진","노완호","이세희","함신옥","손금주","이은진","이경호"];
// print $position;
?>
';
// print_r($estimateList);
// echo '';
}
else if(!empty($itemoption) && $itemoption == 'slat')
{
$today = date("Y-m-d"); // 현재일자 변수지정
$num = $_GET['num'] ?? '';
$tempKey = $_GET['tempKey'] ?? '';
if ($tempKey) {
$jsonFilePath = $_SERVER['DOCUMENT_ROOT'] . '/output/json/' . $tempKey . '.json';
// JSON 파일이 존재하면 읽어옴
if (file_exists($jsonFilePath)) {
$jsonData = file_get_contents($jsonFilePath);
$estimateSlatList = json_decode($jsonData, true);
$estimateSlatList_auto = json_decode($jsonData, true); // auto는 기존자료 복사
} else {
echo "JSON 파일을 찾을 수 없습니다.";
exit;
}
} else {
echo "유효하지 않은 접근입니다.";
exit;
}
if (empty($makeWidth) || !is_numeric($makeWidth)) $makeWidth = '110';
if (empty($makeHeight) || !is_numeric($makeHeight)) $makeHeight = '350';
if (empty($maguriWing) || !is_numeric($maguriWing)) $maguriWing = '50';
// echo '';
// print_r($estimateSlatList);
// echo '';
}
else
{
// 수주리스트에서 호출이 아닌 경우 이것 실행
if ($mode=="modify" || !empty($num) )
{
try{
$sql = "select * from $DB.$tablename where num = ? ";
$stmh = $pdo->prepare($sql);
$stmh->bindValue(1,$num,PDO::PARAM_STR);
$stmh->execute();
$count = $stmh->rowCount();
$row = $stmh->fetch(PDO::FETCH_ASSOC); // $row 배열로 DB 정보를 불러온다.
if($count<1){
print "검색결과가 없습니다.'; // print_r($row); // echo ''; // echo '모델명 : ' . $model_name; // 검사비가 0일때 신규일때는 만들어주고 수정일때는 무시함 if (!empty($inspectionFee)) { $inspectionFee = (int)str_replace(',', '', $inspectionFee); } // 검사비 출력용으로 포맷 적용 $inspectionFeeFormatted = number_format($inspectionFee); ?>