<?php
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");  

$major_category = $_REQUEST["major_category"] ?? '';
if($major_category == '스크린') 
{
	$title_message = '스크린 견적 비교'; 
	$loadestimate = "screen_view_original.php" ;
	$loadestimate_modify = "screen_view_modified.php" ;
	$edit_table = $_SERVER['DOCUMENT_ROOT'] . '/estimate/common/compare_price_edit_table.php';
	$jscode = $_SERVER['DOCUMENT_ROOT'] . '/estimate/common/compare_lastJS.php';
} else
{
	$title_message = '철재 견적 비교'; 
	$loadestimate = "slat_view_original.php" ;
	$loadestimate_modify = "slat_view_modified.php" ;
	$edit_table = $_SERVER['DOCUMENT_ROOT'] . '/estimate/common/compare_price_edit_table.php';
	$jscode = $_SERVER['DOCUMENT_ROOT'] . '/estimate/common/compare_lastJS.php';
}
$tablename = 'estimate'; 
$emailTitle = '견적 비교';
$subTitle = '자동방화셔터 인정제품';
include $_SERVER['DOCUMENT_ROOT'] . '/' . $tablename . '/common/estimate_compare_head.php';
?>

<style>
    .compare-container {
        display: flex;
        flex-direction: row;
        width: 100%;
    }
    .compare-half {
        width: 50%;
        padding: 10px;
        border-right: 1px solid #ccc;
        overflow-x: auto;
    }
    .compare-half:last-child {
        border-right: none;
    }
    .compare-title {
        text-align: center;
        font-size: 1.2rem;
        font-weight: bold;
        margin-bottom: 10px;
    }
</style>

<form id="board_form" name="board_form" method="post" enctype="multipart/form-data">
    <input type="hidden" id="mode" name="mode" value="<?= $mode ?? '' ?>">
    <input type="hidden" id="num" name="num" value="<?= $num ?? '' ?>">
    <input type="hidden" id="tablename" name="tablename" value="<?= $tablename ?? '' ?>">
    <input type="hidden" id="detailJson" name="detailJson"> 
    <input type="hidden" id="estimateSurang" name="estimateSurang">
    <input type="hidden" id="estimateTotal" name="estimateTotal">

    <div class="container-fluid mt-3">		
        <div class="compare-container">		
            <!-- 기존 견적 -->
            <div class="compare-half">
                <div class="compare-title">기존 견적</div>
                <?php include $loadestimate; ?>
            </div>			
            <!-- 수정된 견적 -->
            <div class="compare-half">
				<div class="d-flex justify-content-center align-items-center mt-2 mb-2 w-50">
					<?php include $edit_table; ?>
				</div>					
                <div class="compare-title mt-3">변경 단가 적용 견적</div>
                <?php include $loadestimate_modify; ?>
            </div>
        </div>		
    </div>
</form>

<?php include $jscode ; ?>
</body>
</html>
