<?php
	include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
	include $_SERVER['DOCUMENT_ROOT'].'/common/auth_chk.php';

?>
<? include("../include/inc_top.php") ?>
<? include("../include/inc_header.php") ?>

<section id="wrap">
	<section id="visual" class="visual_mypage">
		<h2>마이페이지</h2>
		<p>쉽고 간편한 내차팔기, 견적산출, 최종 매각까지 어떤 수수료도 요구하지 않습니다.</p>
	</section>

	<section id="content">
		<?
			// /common/lib/func.php 1662에 정의됨
			$is_upro_member = getUproMember($_SESSION['s_cd_user']);
			$depth_info = array("NAME" => array("입찰정보", "입찰중"));
			if($is_upro_member) {
				include_once($_SERVER['DOCUMENT_ROOT']."/mypage/inc_menu_member_company.php");
			}else {
				include_once($_SERVER['DOCUMENT_ROOT']."/mypage/inc_menu_main_member.php");
			}
		?>
		<!-- <ul class="location">
			<li><a href="/" class="home">홈</a></li>
			<li><span class="depth1">입찰정보</span>
				<ul class="sub_depth">
					<li><a href="/mypage/mypage.php">마이페이지</a></li>
                    <li><a href="/sell/sell_step1.php">내찰팔기</a></li>
					<li><a href="/mypage/sell_list.php">전체 입찰내역</a></li>
                     <li><a href="/mypage/sell_list_06.php">입찰중</a></li>
                      <li><a href="/mypage/sell_list_04.php">낙찰내역</a></li>
                      <li><a href="/mypage/sell_list_03.php">거래완료</a></li>
                    <li><a href="/mypage/sell_list_02.php">유찰내역</a></li>
					<li><a href="/mypage/sell_list_05.php">거래실패/연기</a></li>
					<li><a href="/mypage/qna_list.php?cd_board=02&ds_kind=A">문의내역</a></li>
				</ul>
			</li>
			<li><span class="depth2">입찰내역</span></li>
		</ul> -->

<?
	$cd_sale = $_REQUEST["cd_sale"];

	$sql ="SELECT
						a.*
						, b.nm_model
						, c.nm_grade
						, d.nm_brand
						, e.nm_model_sub
						, getCode('car_master','ds_type',a.ds_type) as nm_type
						, getCode('car_master','ds_year',a.ds_year) as nm_year
						, getCode('car_master','ds_open',a.ds_open) as nm_open
						, getCode('car_master','ds_sales',a.ds_sales) as nm_sales
						, getCode('car_master','ds_transmission',a.ds_transmission) as nm_transmission
						, getCode('car_master','ds_oil',a.ds_oil) as nm_oil
						, getCode('car_master','ds_accident',a.ds_accident) as nm_accident
						, getCode('sale_master','ds_usertype',s.ds_usertype) as nm_usertype
						, getCode('sale_master','ds_area',s.ds_area) as nm_area
						, getCode('sale_master','ds_status',s.ds_status) as nm_status
						, s.nm_name nm_name_sale
						, s.ds_status ds_status_sale
						, s.nm_hp nm_hp_sale
						, s.nm_email nm_email_sale
						, s.ds_area ds_area_sale
						, s.nm_recommend nm_recommend_sale
						, s.nm_cont_return nm_cont_return_sale
						, getRemainTimeByPhase(".LIMIT_TIME_TENDER.", ".LIMIT_TIME_SELL.", s.dt_approve, now()) as time_limit_sell
						FROM sale_master s
							inner join car_master a
							on (s.cd_car = a.cd_car)
							left outer join car_model b
							on (a.cd_model = b.cd_model)
							left outer join car_grade c
							on (a.cd_grade = c.cd_grade)
							left outer join car_brand d
							on (a.cd_brand = d.cd_brand)
							left outer join car_model_sub e
							on (a.cd_model_sub = e.cd_model_sub)
						WHERE s.cd_sale='$cd_sale' ";

	$col=mysql_fetch_array(mysql_query($sql));
	if (!empty($col[cd_car])){

		$cd_car = $col[cd_car];
		$cd_model = $col[cd_model];
		$cd_brand = $col[cd_brand];
		$ds_logo = $col[ds_logo];
		$cd_category = $col[cd_category];
		$cd_grade = $col[cd_grade];
		$ds_cate = $col[ds_cate];
		$ds_type = $col[ds_type];
		$ds_year = $col[ds_year];
		$nm_name = $col[nm_name];
		$nm_price = $col[nm_price];
		$nm_mileage = $col[nm_mileage];
		$ds_driving_system = $col[ds_driving_system];
		$ds_transmission = $col[ds_transmission];
		$nm_file_list = $col[nm_file_list];
		$nm_file_main = $col[nm_file_main];
		$nm_file_report = $col[nm_file_report];
		$nm_file_report_back = $col[nm_file_report_back];
		$nm_file_front = $col[nm_file_front];
		$nm_file_back = $col[nm_file_back];
		$nm_file_side1 = $col[nm_file_side1];
		$nm_file_side2 = $col[nm_file_side2];
		$nm_file_dashboard = $col[nm_file_dashboard];
		$ds_oil = $col[ds_oil];
		$nm_gearbox = $col[nm_gearbox];
		$nm_color = $col[nm_color];
		$nm_incolor = $col[nm_incolor];
		$ds_accident = $col[ds_accident];
		$nm_cont_accident  = $col[nm_cont_accident];
		$nm_regdate = $col[nm_regdate];
		$ds_sales = $col[ds_sales];
		$nm_btitle = $col[nm_btitle];
		$nm_stitle = $col[nm_stitle];
		$nm_ltitle = $col[nm_ltitle];
		$nm_cont = $col[nm_cont];
		$nm_guide = $col[nm_guide];
		$ds_open = $col[ds_open];
		$ds_status = $col[ds_status];
		$dt_insert = $col[dt_insert];
		$nm_insert = $col[nm_insert];
		$dt_update = $col[dt_update];
		$nm_update = $col[nm_update];
		$ds_delind = $col[ds_delind];
		$nm_number = $col[nm_number];
		$nm_cc = $col[nm_cc];
		$ds_trade = $col[ds_trade];
		$ds_main = $col[ds_main];
		$nm_regdate_yyyy = $col[nm_regdate_yyyy];
		$nm_regdate_mm = $col[nm_regdate_mm];
		$nm_regdate_dd = $col[nm_regdate_dd];

		$nm_brand = $col[nm_brand];
		$nm_model = $col[nm_model];
		$nm_model_sub = $col[nm_model_sub];
		$nm_grade = $col[nm_grade];

		$nm_year = $col[nm_year];
		$nm_type = $col[nm_type];
		$nm_open = $col[nm_open];
		$nm_sales = $col[nm_sales];
		$nm_transmission = $col[nm_transmission];
		$nm_oil = $col[nm_oil];
		$nm_usertype = $col[nm_usertype];
		$nm_accident = $col[nm_accident];
		$nm_area = $col[nm_area];
		$nm_name_sale = $col[nm_name_sale];
		$ds_status_sale = $col[ds_status_sale];
		$nm_hp_sale = $col[nm_hp_sale];
		$nm_email_sale = $col[nm_email_sale];
		$ds_area_sale = $col[ds_area_sale];
		$nm_recommend_sale = $col[nm_recommend_sale];
		$nm_cont_return_sale = $col[nm_cont_return_sale];
		$time_limit_sell = $col[time_limit_sell];

		//보험처리
		$nm_act_chgno = $col[nm_act_chgno];
		$nm_act_chgnm = $col[nm_act_chgnm];
		$nm_act_s1 = $col[nm_act_s1];
		$nm_act_s2 = $col[nm_act_s2];
		$nm_act_s3 = $col[nm_act_s3];
		$nm_act_s4 = $col[nm_act_s4];
		$nm_act_my = $col[nm_act_my];
		$nm_act_my_amt = $col[nm_act_my_amt];
		$nm_act_other = $col[nm_act_other];
		$nm_act_other_amt = $col[nm_act_other_amt];
		$nm_act_searchdt = $col[nm_act_searchdt];
		$nm_act_cnt = $col[nm_act_cnt];
		$nm_act_general_spec = $col[nm_act_general_spec];
		$nm_act_use_record = $col[nm_act_use_record];
		$nm_act_use_record_lend = $col[nm_act_use_record_lend];
		$nm_act_use_record_biz = $col[nm_act_use_record_biz];
		$nm_act_use_record_official = $col[nm_act_use_record_official];
		$nm_act_ins_loss = $col[nm_act_ins_loss];
		$nm_act_ins_wet = $col[nm_act_ins_wet];
		$nm_act_ins_robbery = $col[nm_act_ins_robbery];
		$nm_file_act = $col[nm_file_act];
		$nm_act_yn = $col[nm_act_yn];


/*
		$arr_nm_info1 = explode("-",$nm_info1);
		if(count($arr_nm_info1) == 3){
			$nm_info11 = $arr_nm_info1[0];
			$nm_info12 = $arr_nm_info1[1];
			$nm_info13 = $arr_nm_info1[2];
		}else{
			$nm_info11 = "";
			$nm_info12 = "";
			$nm_info13 = "";
		}

		$arr_nm_info3 = explode("@",$nm_info3);
		if(count($arr_nm_info3) == 2){
			$nm_info31 = $arr_nm_info3[0];
			$nm_info32 = $arr_nm_info3[1];
		}else{
			$nm_info31 = "";
			$nm_info32 = "";
		}
		$nm_info3 = $col[nm_info3];
*/

	}else{
			AlertBack("지정되지않은 요청입니다");
	}

	$sql ="SELECT *
		FROM car_history_master mst
		WHERE  cd_car='$cd_car' AND ds_delind='N' and ds_type = 'user'";
	$history_col=mysql_fetch_array(mysql_query($sql));

	$r000  		= $history_col["r000"];
	$r001  		= $history_col["r001"];
	$r002  		= $history_col["r002"];
	$r004  		= $history_col["r004"];
	$r005  		= $history_col["r005"];
	$r101  		= $history_col["r101"];
	$r102  		= $history_col["r102"];
	$r103  		= $history_col["r103"];
	$r104  		= $history_col["r104"];
	$r105  		= $history_col["r105"];
	$r106  		= $history_col["r106"];
	$r107  		= $history_col["r107"];
	$r108  		= $history_col["r108"];
	$r109  		= $history_col["r109"];
	$r401  		= $history_col["r401"];
	$r402  		= $history_col["r402"];
	$r403  		= $history_col["r403"];
	$r404  		= $history_col["r404"];
	$r405  		= $history_col["r405"];
	$r406_01  	= $history_col["r406_01"];
	$r407  		= $history_col["r407"];
	$r408_01  	= $history_col["r408_01"];
	$r409  		= $history_col["r409"];
	$r410_01  	= $history_col["r410_01"];
	$r201  		= $history_col["r201"];
	$r202  		= $history_col["r202"];
	$r203  		= $history_col["r203"];
	$r204  		= $history_col["r204"];
	$r205  		= $history_col["r205"];
	$r510  		= $history_col["r510"];
	$r511_01  	= $history_col["r511_01"];
	$r501  		= $history_col["r501"];
	$r502  		= $history_col["r502"];
	$r301  		= $history_col["r301"];
	$r302  		= $history_col["r302"];
	$r303  		= $history_col["r303"];
	$r601  		= $history_col["r601"];
	$r602  		= $history_col["r602"];

?>

		<h3>차량기본정보</h3>
		<div class="car_model">
			<p class="fl"><?=$nm_brand." ".$nm_model." ".$nm_model_sub." ".$nm_grade?></p>
			<? if($ds_status_sale == "E0" || $ds_status_sale == "F0"){ ?>
			<p class="fr">입찰 마감 시간 : <em><?=$time_limit_sell?></em></p>
			<? } ?>
		</div>
		<table class="tbl_h">
			<colgroup>
				<col width="16%">
				<col width="34%">
				<col width="16%">
				<col width="*">
			</colgroup>
			<tr>
				<th>차량번호</th>
				<td><?=$nm_number?></td>
				<th>제조사</th>
				<td><?=$nm_brand?></td>
			</tr>
			<tr>
				<th>모델</th>
				<td><?=$nm_model?></td>
				<th>세부모델</th>
				<td><?=$nm_model_sub?></td>
			</tr>
			<tr>
				<th>등급</th>
				<td><?=$nm_grade?></td>
				<th>연식(최초등록일)</th>
				<td><?=$nm_regdate_yyyy."년 ".$nm_regdate_mm."월"?></td>
			</tr>
			<tr>
				<th>형식연도</th>
				<td><?=$nm_year?>년</td>
				<th>배기량</th>
				<td><?=$nm_cc?>cc</td>
			</tr>
			<tr>
				<th>변속기</th>
				<td><?=$nm_transmission?></td>
				<th>연료</th>
				<td><?=$nm_oil?></td>
			</tr>
			<tr>
				<th>색상</th>
				<td><?=$nm_color?></td>
				<th>주행거리</th>
				<td><?=$nm_mileage?>km</td>
			</tr>
			<tr>
				<th>사고유무</th>
				<td><?=$nm_accident?>
		    &nbsp;<?=$nm_cont_accident?></td>
				<th>추천인</th>
				<td><?= ($nm_recommend_sale == "") ? "없음": $nm_recommend_sale ?></td>
			</tr>
			<tr>
				<th>옵션</th>
				<td colspan="3"><?=$nm_cont?></td>
			</tr>
			<tr>
				<th>필수사진</th>
				<td colspan="3">
					<ul class="photo_list">
            <li>
							<!-- img src="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_front?>" onclick="viewPhoto('<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_front?>')" -->
							<img data-sgallery="group1" data-full="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_front?>" data-thumb="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_front?>" src="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_front?>" title="차량전면">
							<span>차량전면</span>
						</li>
						<li>
							<img data-sgallery="group1" data-full="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_back?>" data-thumb="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_back?>" src="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_back?>" title="차량후면">
							<span>차량후면</span>
						</li>
						<li>
							<img data-sgallery="group1" data-full="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_side1?>" data-thumb="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_side1?>" src="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_side1?>" title="운전석 측면">
							<span>운전석 측면</span>
						</li>
						<li>
							<img data-sgallery="group1" data-full="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_side2?>" data-thumb="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_side2?>" src="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_side2?>" title="조수석 측면">
							<span>조수석 측면</span>
						</li>
						<li>
							<img data-sgallery="group1" data-full="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_dashboard?>" data-thumb="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_dashboard?>" src="<?=UPLOAD_PATH_CAR?>nm_file_main/ratio/<?=$nm_file_dashboard?>" title="계기판">
							<span>계기판</span>
						</li>
					</ul>
				</td>
			</tr>
			<tr>
				<th>추가사진</th>
				<td colspan="3">
					<ul class="photo_list">
					<?
						if(!empty($col[cd_car])){
							$r = mysql_query("SELECT * FROM car_file WHERE cd_car = '$cd_car' and ds_type='' and ds_delind='N' Order by no_sort asc ,  cd_car ASC ");
							$i=1;
							while($imgs = mysql_fetch_array($r)) {
					?>
						<li><img src="<?=UPLOAD_PATH_CAR?><?=$imgs[cd_car]?>_detail/<?=$imgs[nm_file]?>" onclick="viewPhoto('<?=UPLOAD_PATH_CAR?><?=$imgs[cd_car]?>_detail/<?=$imgs[nm_file]?>')"></li>
					<?
							}
						}else{
					?>
					<?
						}
					?>
					</ul>
				</td>
			</tr>
		</table>

		<div class="btn_right">
		<?
		if($ds_status_sale == "A0" || $ds_status_sale == "B0" || $ds_status_sale == "C0" || $ds_status_sale == "D0"){
		?>
			<a href="#" class="button gray" id="btn_update">수정하기</a>
		<?
		}
		?>
			<a href="./sell_list_06.php?PageNo=<?=$ListPageNo?>" class="button">목록가기</a>
		</div>

		<h3>사고이력정보</h3>
		<table class="tbl_h">
			<colgroup>
				<col width="16%">
				<col width="*">
			</colgroup>
			<tr>
				<th>차량번호 변경</th>
				<td><?=number_format($r201)?> 회</td>
			</tr>
			<tr>
				<th>소유자 변경</th>
				<td><?=number_format($r204)?> 회</td>
			</tr>
			<tr>
				<th>자동차 보험 특수 사고</th>
				<td>전손 : <?=number_format($r405)?>회 / 침수전(분)손 : <?=number_format($r407)?>회 / 도난 : <?=number_format($r409)?>회</td>
			</tr>
			<tr>
				<th>보험사고 (내차피해)</th>
				<td><?=number_format($r401)?> 회(<?=number_format($r402)?> 원)</td>
			</tr>
			<tr>
				<th>보험사고 (타차가해)</th>
				<td><?=number_format($r403)?> 회(<?=number_format($r404)?> 원)</td>
			</tr>
			<!--tr>
				<th>사고이력 조회일</th>
				<td>2018-12-05 </td>
			</tr-->
		</table>
		<div class="btn_right">
			<a href="#" class="button" onclick="openLayer('car'); return false;">사고이력 정보 조회 보기</a>
		</div>

		<!-- layer popup -->
		<div class="layer_popup car_popup">
			<h3>중고차 보험처리 이력정보 보고서</h3>
			<p class="close">레이어팝업닫기</p>
			<?
				//차량 보험처리 이력 정보
				include_once($_SERVER['DOCUMENT_ROOT'].'/common/inc/inc_car_history.php');
			?>
		</div>
		<!-- // layer popup -->

<?
	$cd_sale = $_REQUEST["cd_sale"];

	$PageNo = $_REQUEST['pageno'];
	$PageSize = $_REQUEST['PageSize'];
	if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
	if (empty($PageSize)) {
		$PageSize=10; //목록개수설정
	}else{$PageSize=$PageSize;}

	$pagestartpoint=($PageNo-1)*$PageSize;

	$OrderBy = $_REQUEST['OrderBy'];
	if ($OrderBy == "") $OrderBy = "cast(t.nm_price as unsigned) desc, t.cd_tender desc ";

	$sOrderBy = "ORDER BY ".$OrderBy;

	//$sql = "where ds_delind='N'";
	$sql = "";

	$totalrows = @mysql_result(mysql_query("select count(*) FROM dealer_master d inner join tender_master t on (d.cd_dealer = t.cd_dealer_p and t.cd_sale = $cd_sale and t.ds_delind='N' $sql) "),0,0);

?>
		<h3>입찰리스트</h3>
		<table class="tbl_v">
			<colgroup>
				<col width="7%">
				<col width="*">
				<col width="12%">
				<col width="15%">
				<!--col width="13%"-->
				<col width="15%">
				<col width="15%">
			</colgroup>
			<thead>
			<tr>
				<th>번호</th>
				<th>입찰업체</th>
				<th>입찰금액</th>
				<th>입찰일</th>
				<!--th>연락처</th-->
				<th>업체정보</th>
				<th>상태</th>
			</tr>
			</thead>
			<tbody>
<?
		if($totalrows>0) {

			$r = mysql_query("SELECT t.*, d.nm_company nm_company_dealer, d.nm_name nm_name_dealer, s.ds_status ds_status_sale, getRemainTimeByPhase(".LIMIT_TIME_TENDER.", ".LIMIT_TIME_SELL.", s.dt_approve, now()) as time_limit_sell, d1.nm_name nm_name_dealer1 FROM dealer_master d inner join tender_master t on (d.cd_dealer = t.cd_dealer_p and t.cd_sale = $cd_sale and t.ds_delind='N' $sql) inner join dealer_master d1 on (t.cd_dealer = d1.cd_dealer) inner join sale_master s on (t.cd_sale = s.cd_sale) $sOrderBy LIMIT $pagestartpoint,$PageSize");


			$i=1;
			while($col = mysql_fetch_array($r)) {
?>
			<tr>
				<td><?=$i?></td>
				<td><?=$col[nm_company_dealer]?> / <?=$col[nm_name_dealer1]?></td>
				<td><?=$col[nm_price]?> 만원</td>
				<td><?=$col[dt_insert]?></td>
				<!--td><?//=$col[nm_hp]?></td-->
				<td><a href="#" class="link" onclick="openPostScript('<?=$col[cd_dealer_p]?>','<?=$col[cd_tender]?>'); return false;">후기 보기</a></td>
				<td>
				<?
				if($col[ds_status_sale] == "Z0" || $col[ds_status_sale] == "ZS" || $col[ds_status_sale] == "ZE"){
				?>
				<?
					if($col[ds_status_sale] == "ZE"){
				?>
					거래실수
				<?
					}else{
				?>
					<?= ($col[ds_status] == "Z0") ? "낙찰" : "낙첨"	?>
				<?
					}
				?>
				<?
				}else{
				?>
				<?
					if($col[ds_status_sale] == "E0" || $col[ds_status_sale] == "F0"){
						if($col[time_limit_sell]=="0분"){
				?>
				낙첨
				<?
						}else{
				?>
				<a href="#" class="td_btn ty3" onclick="selectTender('<?=$col[cd_tender]?>','<?=$col[nm_company_dealer]?>','<?=$col[nm_price]?>')" id="a_Tender" value="<?=$col[cd_tender]?>">낙찰하기</a>
				<?
						}
				?>
				<?
					}
				?>
				<?
				}
				?>
				</td>
			</tr>
<?
				$i++;
			}
		}else{
?>
			<tr>
				<td colspan="7">데이터가 존재 하지 않습니다.</td>
			</tr>
<?
		}
?>
			</tbody>
		</table>

	<div class="paging">
		<?
				$url = "./sell_view.php?list_url=$list_url&cd_sale=$cd_sale&ds_status_sale=$ds_status_sale&ListPageNo=$ListPageNo&PageNo=$PageNo";
//				ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
		?>
	</div>

		<!-- layer popup -->
		<div class="layer_popup tender_popup">
			<div class="popup_wrap">
				<p class="msg"><em id="nm_dealer_popup">고진상사</em>에게 낙찰정보를 보내시겠습니까?</p>
				<div class="btn_center">
					<a href="#" class="button" id="btn_write">확인</a>
					<a href="#" class="button gray" onclick="closeLayer('tender'); return false;">취소</a>
				</div>
			</div>
		</div>
		<!-- // layer popup -->

		<!-- layer popup2 -->
		<div class="layer_popup review_popup">
			<div class="popup_wrap">
				<dl class="business_info">
					<dt>고진상사 <span></span></dt>
					<dd class="thumb"></dd>
					<dd>약속드립니다.<br>정직하게 일하겠습니다.</dd>
					<dd class="estimation"><span>입찰성공률</span> <em>98%</em> <span>고객만족도</span> <em>95점</em></dd>
				</dl>
				<dl class="review">
					<dt><em>스파크</em> 판매고객</dt>
					<dd>
						<img src="/img/mypage/@photo_review.jpg"><br><br>
						입찰가 그대로 판매하였습니다.<br>
						입찰가 그대로 판매하였습니다. 입찰가 그대로 판매하였습니다.<br>
						정말 좋아요!<br>
						정말 좋아요!<br>
						정말 좋아요!<br>
						정말 좋아요!
					</dd>
					<dt><em>스파크</em> 판매고객</dt>
					<dd>
						<img src="/img/mypage/@photo_review.jpg"><br><br>
						입찰가 그대로 판매하였습니다.<br>
						입찰가 그대로 판매하였습니다. 입찰가 그대로 판매하였습니다.<br>
						정말 좋아요!<br>
						정말 좋아요!<br>
						정말 좋아요!<br>
						정말 좋아요!
					</dd>
					<dt><em>스파크</em> 판매고객</dt>
					<dd>
						<img src="/img/mypage/@photo_review.jpg"><br><br>
						입찰가 그대로 판매하였습니다.<br>
						입찰가 그대로 판매하였습니다. 입찰가 그대로 판매하였습니다.<br>
						정말 좋아요!<br>
						정말 좋아요!<br>
						정말 좋아요!<br>
						정말 좋아요!
					</dd>
				</dl>
			</div>
			<div class="close">레이어팝업 닫기</div>
		</div>
		<!-- // layer popup2 -->

		<!-- layer popup3 -->
		<div class="layer_popup photo_popup">
			<div class="popup_wrap">
				<img src="/img/sell/ic_car_photo1.png" id="photoBig">
				<!--div class="btn_center">
					<a href="#" class="button gray" onclick="closeLayer('photo'); return false;">확인</a>
				</div -->
			</div>
			<div class="close" onclick="closeLayer('photo');">레이어팝업 닫기</div>
		</div>
		<!-- // layer popup3 -->

	</section>
</section>
<form name="frmForm" id="frmForm" method="post" action="dealer_proc.php">
	<input type="hidden" name="mode" id="mode" value="TenderSuccess">
	<input type="hidden" name="cd_sale" id="cd_sale" value="<?=$cd_sale?>">
	<input type="hidden" name="cd_tender" id="cd_tender">
	<input type="hidden" name="nm_price" id="nm_price">
</form>

<script laguage="javascript" type="text/javascript">

	function openPostScript(arg1, arg2){
		var url = "/mypage/sell_view_postscript.php?cd_dealer_p="+arg1+"&cd_tender="+arg2;
		var winname = "winPostscript";
		var opt = "width=600,height=719,scrollbars=auto";

		popup_window(url, winname, opt);
	}

	function selectTender(arg1, arg2, arg3){

		$("#cd_tender").val(arg1);
		$("#nm_dealer_popup").text(arg2);
		$("#nm_price").val(arg3);

		openLayer('tender'); return false;

	}

	function viewPhoto(arg1){

		$("#photoBig").attr("src", arg1);

		openLayer('photo'); return false;

	}

    $(document).ready(function() {

        $("#btn_write").bind("click",function(){

//			$("#cd_tender").val($("#a_Tender").attr('value'));

			var c=confirm("정보를 등록하시겠습니까?");
			if(c){
				$("#btn_write").hide();
				$("#frmForm").submit();
			}else{
				$("#btn_write").show();
				return false;
			}

		});


		$("#btn_update").on("click", function(){

			$.post("/sell/proc.php", { mode:"updateCar", cd_car:"<?=$cd_car?>", cd_sale:"<?=$cd_sale?>"},function(data) {
//				alert(data);
				if(data=="Y"){
					location.href = "/sell/sell_step1.php?mode=Step1";
				}else{
					alert("수정할 수 없습니다.");
					return;
				}
			});
		});

	});
</script>
<script type="text/javascript" charset="utf-8" src="/js/jquery.sumogallery.js"></script>

<? include("../include/inc_footer.php") ?>
<? include("../include/inc_bottom.php") ?>
<?
mysql_close($connect);
?>
