<?php
	$fail_msg = "";
	$fail_status = "";
	//거래연기
	if($ds_status_sale == 'Z0' && $ds_status_contract_sale == 'B0') {
		$fail_status 	= "1";
		$fail_msg 		= $nm_contract_fail_reason_sale;
	}
	//거래실패
	else if($ds_status_sale == 'Z0' && $ds_status_contract_sale == 'C0') {
		$fail_status 	= "2";
		$fail_msg 		= $nm_contract_fail_reason_sale;
	}
	else if($ds_status_sale == 'ZE') {
		//기타
		if($ds_status_contract_sale == "E0") {
			$fail_status 	= "3";
		}
		//견적 실수
		else if($ds_status_contract_sale == "M0") {
			$fail_status 	= "4";
		}
		$fail_msg 		= $nm_cont_tender_error_sale;
	}
	// $fail_msg = nl2br($fail_msg);
?>

	<section>
		<div class="car--info--wrap mt-5">
			<div class="title--wrapper d-flex align-items-center justify-content-between">
				<h2>유찰 사유</h2>
			</div>

			<div class="form--box mt-3">
				<div class="d-flex align-items-center">
					<div class="form--group ">
						<input type="radio" id="fail_status1" name="trd" hidden="" <?=($fail_status == "2" ? "checked" : "")?>>
						<label for="fail_status1">거래 실패</label>
					</div>
					<div class="form--group ml20">
						<input type="radio" id="fail_status2" name="trd" hidden="" <?=($fail_status == "4" ? "checked" : "")?>>
						<label for="fail_status2">견적 실수</label>
					</div>
					<div class="form--group ml20">
						<input type="radio" id="fail_status3" name="trd" hidden="" <?=($fail_status == "3" ? "checked" : "")?>>
						<label for="fail_status3">ETC</label>
					</div>
				</div>
				<div class="mt-3">
					<textarea rows="5" class="form-control" placeholder="ex) 앞 풴다교환 1개-20만원, 앞범퍼 1판-7만원 20만원으로 최종조율, 다음주 수요일 인수예정"><?=$fail_msg?></textarea>
				</div>
			</div>


		</div>
	</section>
