<?php
// $price_sql ="select count(*) cnt
// 				, min(nm_price) min_price
// 				, avg(nm_price) avg_price
// 				, max(nm_price) max_price
// 				, max(case when ds_status = 'Z0' then nm_price else 0 end) tender_price
//  			from tender_master where cd_sale = $cd_sale ";
//2023-11-12 수수료 적용금액으로 변경
$price_sql ="select count(*) cnt
				, min(cast(nm_ex_vat_price as decimal)) min_price
				, avg(cast(nm_ex_vat_price as decimal)) avg_price
				, max(cast(nm_ex_vat_price as decimal)) max_price
				, max(case when ds_status = 'Z0' then nm_ex_vat_price else 0 end) tender_price
 			from tender_master where cd_sale = $cd_sale ";
// echo $price_sql;
$price_col = mysql_fetch_array(mysql_query($price_sql));
?>

	<!-- 금액 이슈 -->
	<section class="mt-5 pt30">
		<div class="price--info--wrap">
		<?php if($ds_status_sale == 'ZS') { ?>
			<div>
				<div class="thumb ic--01"></div>
				<div class="desc">
					<h2>완료 금액</h2>
					<p><?=number_format($nm_price_final_sale)?><span>만원</span></p>
				</div>
			</div>
		<?php }else { ?>
			<div>
				<div class="thumb ic--01"></div>
				<div class="desc">
					<h2>낙찰 금액</h2>
					<p><?=number_format($price_col['tender_price'])?><span>만원</span></p>
				</div>
			</div>
		<?php } ?>
			<div>
				<div class="thumb ic--02"></div>
				<div class="desc">
					<h2>최고가</h2>
					<p><?=number_format($price_col['max_price'])?><span>만원</span></p>
				</div>
			</div>
			<div>
				<div class="thumb ic--03"></div>
				<div class="desc">
					<h2>최저가</h2>
					<p><?=number_format($price_col['min_price'])?><span>만원</span></p>
				</div>
			</div>
			<div>
				<div class="thumb ic--04"></div>
				<div class="desc">
					<h2>평균입찰가</h2>
					<p><?=number_format($price_col['avg_price'])?><span>만원</span></p>
				</div>
			</div>
		</div>
	</section>
