sell_view_nomember.php_20190419_getRemainTimeByPhase_success 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. // include $_SERVER['DOCUMENT_ROOT'].'/common/auth_chk.php';
  4. ?>
  5. <? include("../include/inc_top.php") ?>
  6. <? include("../include/inc_header.php") ?>
  7. <section id="wrap">
  8. <section id="visual" class="visual_sell">
  9. <h2>내차팔기</h2>
  10. <p>쉽고 간편한 내차팔기, 견적산출, 최종 매각까지 어떤 수수료도 요구하지 않습니다.</p>
  11. </section>
  12. <section id="content">
  13. <ul class="location">
  14. <li><a href="/" class="home">홈</a></li>
  15. <li><span class="depth1">내차팔기</span></li>
  16. <li><span class="depth2">차량정보</span></li>
  17. </ul>
  18. <?
  19. $mode = $_REQUEST["mode"];
  20. $p_nm_name = $_REQUEST["nm_name"];
  21. $p_nm_hp = $_REQUEST["nm_hp"];
  22. $p_nm_number = $_REQUEST["nm_number"];
  23. $sql ="SELECT
  24. a.*
  25. , b.nm_model
  26. , c.nm_grade
  27. , d.nm_brand
  28. , e.nm_model_sub
  29. , getCode('car_master','ds_type',a.ds_type) as nm_type
  30. , getCode('car_master','ds_year',a.ds_year) as nm_year
  31. , getCode('car_master','ds_open',a.ds_open) as nm_open
  32. , getCode('car_master','ds_sales',a.ds_sales) as nm_sales
  33. , getCode('car_master','ds_transmission',a.ds_transmission) as nm_transmission
  34. , getCode('car_master','ds_oil',a.ds_oil) as nm_oil
  35. , getCode('car_master','ds_accident',a.ds_accident) as nm_accident
  36. , getCode('sale_master','ds_usertype',s.ds_usertype) as nm_usertype
  37. , getCode('sale_master','ds_area',s.ds_area) as nm_area
  38. , getCode('sale_master','ds_status',s.ds_status) as nm_status
  39. , s.cd_sale
  40. , s.nm_name nm_name_sale
  41. , s.ds_status ds_status_sale
  42. , s.nm_hp nm_hp_sale
  43. , s.nm_email nm_email_sale
  44. , s.ds_area ds_area_sale
  45. , s.nm_recommend nm_recommend_sale
  46. , s.nm_cont_return nm_cont_return_sale
  47. , getRemainTimeByPhase(".LIMIT_TIME_TENDER.", ".LIMIT_TIME_SELL.", s.dt_approve, now()) as time_limit_sell
  48. FROM sale_master s
  49. inner join car_master a
  50. on (s.cd_car = a.cd_car)
  51. left outer join car_model b
  52. on (a.cd_model = b.cd_model)
  53. left outer join car_grade c
  54. on (a.cd_grade = c.cd_grade)
  55. left outer join car_brand d
  56. on (a.cd_brand = d.cd_brand)
  57. left outer join car_model_sub e
  58. on (a.cd_model_sub = e.cd_model_sub)
  59. WHERE s.nm_name='$nm_name'
  60. and s.nm_hp='$nm_hp'
  61. and a.nm_number='$nm_number'
  62. and s.ds_delind = 'N'
  63. and s.ds_status in ('B0','C0','D0','E0','F0','Z0','ZS')
  64. ORDER BY s.cd_sale desc LIMIT 0,1
  65. ";
  66. $col=mysql_fetch_array(mysql_query($sql));
  67. if (!empty($col[cd_car])){
  68. $cd_sale = $col[cd_sale];
  69. $cd_car = $col[cd_car];
  70. $cd_model = $col[cd_model];
  71. $cd_brand = $col[cd_brand];
  72. $ds_logo = $col[ds_logo];
  73. $cd_category = $col[cd_category];
  74. $cd_grade = $col[cd_grade];
  75. $ds_cate = $col[ds_cate];
  76. $ds_type = $col[ds_type];
  77. $ds_year = $col[ds_year];
  78. $nm_name = $col[nm_name];
  79. $nm_price = $col[nm_price];
  80. $nm_mileage = $col[nm_mileage];
  81. $ds_driving_system = $col[ds_driving_system];
  82. $ds_transmission = $col[ds_transmission];
  83. $nm_file_list = $col[nm_file_list];
  84. $nm_file_main = $col[nm_file_main];
  85. $nm_file_report = $col[nm_file_report];
  86. $nm_file_report_back = $col[nm_file_report_back];
  87. $nm_file_front = $col[nm_file_front];
  88. $nm_file_back = $col[nm_file_back];
  89. $nm_file_side1 = $col[nm_file_side1];
  90. $nm_file_side2 = $col[nm_file_side2];
  91. $nm_file_dashboard = $col[nm_file_dashboard];
  92. $ds_oil = $col[ds_oil];
  93. $nm_gearbox = $col[nm_gearbox];
  94. $nm_color = $col[nm_color];
  95. $nm_incolor = $col[nm_incolor];
  96. $ds_accident = $col[ds_accident];
  97. $nm_cont_accident = $col[nm_cont_accident];
  98. $nm_regdate = $col[nm_regdate];
  99. $ds_sales = $col[ds_sales];
  100. $nm_btitle = $col[nm_btitle];
  101. $nm_stitle = $col[nm_stitle];
  102. $nm_ltitle = $col[nm_ltitle];
  103. $nm_cont = $col[nm_cont];
  104. $nm_guide = $col[nm_guide];
  105. $ds_open = $col[ds_open];
  106. $ds_status = $col[ds_status];
  107. $dt_insert = $col[dt_insert];
  108. $nm_insert = $col[nm_insert];
  109. $dt_update = $col[dt_update];
  110. $nm_update = $col[nm_update];
  111. $ds_delind = $col[ds_delind];
  112. $nm_number = $col[nm_number];
  113. $nm_cc = $col[nm_cc];
  114. $ds_trade = $col[ds_trade];
  115. $ds_main = $col[ds_main];
  116. $nm_regdate_yyyy = $col[nm_regdate_yyyy];
  117. $nm_regdate_mm = $col[nm_regdate_mm];
  118. $nm_regdate_dd = $col[nm_regdate_dd];
  119. $nm_brand = $col[nm_brand];
  120. $nm_model = $col[nm_model];
  121. $nm_model_sub = $col[nm_model_sub];
  122. $nm_grade = $col[nm_grade];
  123. $nm_year = $col[nm_year];
  124. $nm_type = $col[nm_type];
  125. $nm_open = $col[nm_open];
  126. $nm_sales = $col[nm_sales];
  127. $nm_transmission = $col[nm_transmission];
  128. $nm_oil = $col[nm_oil];
  129. $nm_usertype = $col[nm_usertype];
  130. $nm_accident = $col[nm_accident];
  131. $nm_area = $col[nm_area];
  132. $nm_name_sale = $col[nm_name_sale];
  133. $ds_status_sale = $col[ds_status_sale];
  134. $nm_hp_sale = $col[nm_hp_sale];
  135. $nm_email_sale = $col[nm_email_sale];
  136. $ds_area_sale = $col[ds_area_sale];
  137. $nm_recommend_sale = $col[nm_recommend_sale];
  138. $nm_cont_return_sale = $col[nm_cont_return_sale];
  139. $time_limit_sell = $col[time_limit_sell];
  140. //보험처리
  141. $nm_act_chgno = $col[nm_act_chgno];
  142. $nm_act_chgnm = $col[nm_act_chgnm];
  143. $nm_act_s1 = $col[nm_act_s1];
  144. $nm_act_s2 = $col[nm_act_s2];
  145. $nm_act_s3 = $col[nm_act_s3];
  146. $nm_act_s4 = $col[nm_act_s4];
  147. $nm_act_my = $col[nm_act_my];
  148. $nm_act_my_amt = $col[nm_act_my_amt];
  149. $nm_act_other = $col[nm_act_other];
  150. $nm_act_other_amt = $col[nm_act_other_amt];
  151. $nm_act_searchdt = $col[nm_act_searchdt];
  152. $nm_act_cnt = $col[nm_act_cnt];
  153. $nm_act_general_spec = $col[nm_act_general_spec];
  154. $nm_act_use_record = $col[nm_act_use_record];
  155. $nm_act_use_record_lend = $col[nm_act_use_record_lend];
  156. $nm_act_use_record_biz = $col[nm_act_use_record_biz];
  157. $nm_act_use_record_official = $col[nm_act_use_record_official];
  158. $nm_act_ins_loss = $col[nm_act_ins_loss];
  159. $nm_act_ins_wet = $col[nm_act_ins_wet];
  160. $nm_act_ins_robbery = $col[nm_act_ins_robbery];
  161. $nm_file_act = $col[nm_file_act];
  162. $nm_act_yn = $col[nm_act_yn];
  163. $ds_g1_01 = $col[ds_g1_01];
  164. $ds_g1_02 = $col[ds_g1_02];
  165. $ds_g1_03 = $col[ds_g1_03];
  166. $ds_g1_04 = $col[ds_g1_04];
  167. $ds_g1_05 = $col[ds_g1_05];
  168. $ds_g2_01 = $col[ds_g2_01];
  169. $ds_g2_02 = $col[ds_g2_02];
  170. $ds_g2_03 = $col[ds_g2_03];
  171. $ds_g2_04 = $col[ds_g2_04];
  172. $ds_g2_05 = $col[ds_g2_05];
  173. $ds_g3_01 = $col[ds_g3_01];
  174. $ds_g3_02 = $col[ds_g3_02];
  175. $ds_g3_03 = $col[ds_g3_03];
  176. $ds_g3_04 = $col[ds_g3_04];
  177. $ds_g3_05 = $col[ds_g3_05];
  178. $ds_g4_01 = $col[ds_g4_01];
  179. $ds_g4_02 = $col[ds_g4_02];
  180. $ds_g4_03 = $col[ds_g4_03];
  181. $ds_g4_04 = $col[ds_g4_04];
  182. $ds_g4_05 = $col[ds_g4_05];
  183. /*
  184. $arr_nm_info1 = explode("-",$nm_info1);
  185. if(count($arr_nm_info1) == 3){
  186. $nm_info11 = $arr_nm_info1[0];
  187. $nm_info12 = $arr_nm_info1[1];
  188. $nm_info13 = $arr_nm_info1[2];
  189. }else{
  190. $nm_info11 = "";
  191. $nm_info12 = "";
  192. $nm_info13 = "";
  193. }
  194. $arr_nm_info3 = explode("@",$nm_info3);
  195. if(count($arr_nm_info3) == 2){
  196. $nm_info31 = $arr_nm_info3[0];
  197. $nm_info32 = $arr_nm_info3[1];
  198. }else{
  199. $nm_info31 = "";
  200. $nm_info32 = "";
  201. }
  202. $nm_info3 = $col[nm_info3];
  203. */
  204. }else{
  205. AlertBack("진행중인 차량 정보가 존재하지 않습니다.");
  206. }
  207. ?>
  208. <h3>차량기본정보</h3>
  209. <div class="car_model">
  210. <p class="fl"><?=$nm_brand." ".$nm_model." ".$nm_model_sub." ".$nm_grade?></p>
  211. <? if($ds_status_sale == "E0" || $ds_status_sale == "F0"){ ?>
  212. <p class="fr">입찰 마감 시간 : <em><?=$time_limit_sell?></em></p>
  213. <? } ?>
  214. </div>
  215. <table class="tbl_h">
  216. <colgroup>
  217. <col width="16%">
  218. <col width="34%">
  219. <col width="16%">
  220. <col width="*">
  221. </colgroup>
  222. <tr>
  223. <th>차량번호</th>
  224. <td><?=$nm_number?></td>
  225. <th>제조사</th>
  226. <td><?=$nm_brand?></td>
  227. </tr>
  228. <tr>
  229. <th>모델</th>
  230. <td><?=$nm_model?></td>
  231. <th>세부모델</th>
  232. <td><?=$nm_model_sub?></td>
  233. </tr>
  234. <tr>
  235. <th>등급</th>
  236. <td><?=$nm_grade?></td>
  237. <th>연식(최초등록일)</th>
  238. <td><?=$nm_regdate_yyyy."년 ".$nm_regdate_mm."월"?></td>
  239. </tr>
  240. <tr>
  241. <th>형식연도</th>
  242. <td><?=$nm_year?>년</td>
  243. <th>배기량</th>
  244. <td><?=$nm_cc?>cc</td>
  245. </tr>
  246. <tr>
  247. <th>변속기</th>
  248. <td><?=$nm_transmission?></td>
  249. <th>연료</th>
  250. <td><?=$nm_oil?></td>
  251. </tr>
  252. <tr>
  253. <th>색상</th>
  254. <td><?=$nm_color?></td>
  255. <th>주행거리</th>
  256. <td><?=$nm_mileage?>km</td>
  257. </tr>
  258. <tr>
  259. <th>사고유무</th>
  260. <td><?=$nm_accident?><?=($ds_accident == "A0") ? " - ".$nm_cont_accident : "" ?></td>
  261. <th>추천인</th>
  262. <td><?= ($nm_recommend_sale == "") ? "없음":$nm_recommend_sale ?></td>
  263. </tr>
  264. <tr>
  265. <th>옵션</th>
  266. <td colspan="3"><?=$nm_cont?></td>
  267. </tr>
  268. <tr>
  269. <th>필수사진</th>
  270. <td colspan="3">
  271. <ul class="photo_list">
  272. <li>
  273. <img src="<?=UPLOAD_PATH_CAR?>nm_file_main/<?=$nm_file_front?>" onclick="viewPhoto('<?=UPLOAD_PATH_CAR?>nm_file_main/<?=$nm_file_front?>')">
  274. <span>차량전면</span>
  275. </li>
  276. <li>
  277. <img src="<?=UPLOAD_PATH_CAR?>nm_file_main/<?=$nm_file_back?>" onclick="viewPhoto('<?=UPLOAD_PATH_CAR?>nm_file_main/<?=$nm_file_back?>')">
  278. <span>차량후면</span>
  279. </li>
  280. <li>
  281. <img src="<?=UPLOAD_PATH_CAR?>nm_file_main/<?=$nm_file_side1?>" onclick="viewPhoto('<?=UPLOAD_PATH_CAR?>nm_file_main/<?=$nm_file_side1?>')">
  282. <span>운전석 측면</span>
  283. </li>
  284. <li>
  285. <img src="<?=UPLOAD_PATH_CAR?>nm_file_main/<?=$nm_file_side2?>" onclick="viewPhoto('<?=UPLOAD_PATH_CAR?>nm_file_main/<?=$nm_file_side2?>')">
  286. <span>조수석 측면</span>
  287. </li>
  288. <li>
  289. <img src="<?=UPLOAD_PATH_CAR?>nm_file_main/<?=$nm_file_dashboard?>" onclick="viewPhoto('<?=UPLOAD_PATH_CAR?>nm_file_main/<?=$nm_file_dashboard?>')">
  290. <span>계기판</span>
  291. </li>
  292. </ul>
  293. </td>
  294. </tr>
  295. <tr>
  296. <th>추가사진</th>
  297. <td colspan="3">
  298. <ul class="photo_list">
  299. <?
  300. if(!empty($col[cd_car])){
  301. $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 ");
  302. $i=1;
  303. while($imgs = mysql_fetch_array($r)) {
  304. ?>
  305. <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>
  306. <?
  307. }
  308. }else{
  309. ?>
  310. <?
  311. }
  312. ?>
  313. </ul>
  314. </td>
  315. </tr>
  316. </table>
  317. <div class="btn_right">
  318. <?
  319. if($ds_status_sale == "A0" || $ds_status_sale == "B0" || $ds_status_sale == "C0" || $ds_status_sale == "D0"){ //ds_status_sale=A0,B0,C0,D0 입력중,입력완료,승인대기,반려
  320. ?>
  321. <a href="#" class="button gray" id="btn_update">수정하기</a>
  322. <?
  323. }
  324. ?>
  325. <!--a href="./sell_list.php?PageNo=<?=$ListPageNo?>" class="button">목록가기</a-->
  326. </div>
  327. <h3>사고이력정보</h3>
  328. <table class="tbl_h">
  329. <colgroup>
  330. <col width="16%">
  331. <col width="*">
  332. </colgroup>
  333. <tr>
  334. <th>차량번호 변경</th>
  335. <td><?=$nm_act_chgno?> 회</td>
  336. </tr>
  337. <tr>
  338. <th>소유자 변경</th>
  339. <td><?=$nm_act_chgnm?> 회</td>
  340. </tr>
  341. <tr>
  342. <th>자동차 보험 특수 사고</th>
  343. <td>전손 : <?=$nm_act_s1?>회 / 침수전손 : <?=$nm_act_s2?>회 / 침수분손 : <?=$nm_act_s3?>회 / 도난 : <?=$nm_act_s4?>회</td>
  344. </tr>
  345. <tr>
  346. <th>보험사고 (내차피해)</th>
  347. <td><?=$nm_act_my?> 회(<?=$nm_act_my_amt?> 원)</td>
  348. </tr>
  349. <tr>
  350. <th>보험사고 (타차가해)</th>
  351. <td><?=$nm_act_other?> 회(<?=$nm_act_other_amt?> 원)</td>
  352. </tr>
  353. <!--tr>
  354. <th>사고이력 조회일</th>
  355. <td>2018-12-05 </td>
  356. </tr-->
  357. </table>
  358. <div class="btn_right">
  359. <a href="#" class="button" onclick="openLayer('car'); return false;">사고이력 정보 조회 보기</a>
  360. </div>
  361. <?
  362. // $cd_sale = $_REQUEST["cd_sale"];
  363. $PageNo = $_REQUEST['pageno'];
  364. $PageSize = $_REQUEST['PageSize'];
  365. if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
  366. if (empty($PageSize)) {
  367. $PageSize=10; //목록개수설정
  368. }else{$PageSize=$PageSize;}
  369. $pagestartpoint=($PageNo-1)*$PageSize;
  370. $OrderBy = $_REQUEST['OrderBy'];
  371. if ($OrderBy == "") $OrderBy = "cast(t.nm_price as unsigned) desc, t.cd_tender desc ";
  372. $sOrderBy = "ORDER BY ".$OrderBy;
  373. //$sql = "where ds_delind='N'";
  374. $sql = "";
  375. $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);
  376. ?>
  377. <h3>입찰리스트</h3>
  378. <table class="tbl_v">
  379. <colgroup>
  380. <col width="7%">
  381. <col width="*">
  382. <col width="12%">
  383. <col width="15%">
  384. <!--col width="13%"-->
  385. <col width="15%">
  386. <col width="15%">
  387. </colgroup>
  388. <thead>
  389. <tr>
  390. <th>번호</th>
  391. <th>입찰업체</th>
  392. <th>입찰금액</th>
  393. <th>입찰일</th>
  394. <!--th>연락처</th-->
  395. <th>업체정보</th>
  396. <th>상태</th>
  397. </tr>
  398. </thead>
  399. <tbody>
  400. <?
  401. if($totalrows>0) {
  402. $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");
  403. $i=1;
  404. while($col = mysql_fetch_array($r)) {
  405. ?>
  406. <tr>
  407. <td><?=$i?></td>
  408. <td><?=$col[nm_company_dealer]?> / <?=$col[nm_name_dealer1]?></td>
  409. <td><?=$col[nm_price]?> 만원</td>
  410. <td><?=$col[dt_insert]?></td>
  411. <!--td><?//=$col[nm_hp]?></td-->
  412. <td><a href="#" class="link" onclick="openPostScript('<?=$col[cd_dealer_p]?>','<?=$col[cd_tender]?>'); return false;">후기 보기</a></td>
  413. <td>
  414. <?
  415. if($col[ds_status_sale] == "Z0" || $col[ds_status_sale] == "ZS" || $col[ds_status_sale] == "ZE"){
  416. ?>
  417. <?
  418. if($col[ds_status_sale] == "ZE"){
  419. ?>
  420. 거래실수
  421. <?
  422. }else{
  423. ?>
  424. <?= ($col[ds_status] == "Z0") ? "낙찰" : "낙첨" ?>
  425. <?
  426. }
  427. ?>
  428. <?
  429. }else{
  430. ?>
  431. <?
  432. if($col[ds_status_sale] == "E0" || $col[ds_status_sale] == "F0"){
  433. if($col[time_limit_sell]=="0분"){
  434. ?>
  435. 낙첨
  436. <?
  437. }else{
  438. ?>
  439. <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>
  440. <?
  441. }
  442. ?>
  443. <?
  444. }
  445. ?>
  446. <?
  447. }
  448. ?>
  449. </td>
  450. </tr>
  451. <?
  452. $i++;
  453. }
  454. }else{
  455. ?>
  456. <tr>
  457. <td colspan="7">데이터가 존재 하지 않습니다.</td>
  458. </tr>
  459. <?
  460. }
  461. ?>
  462. </tbody>
  463. </table>
  464. <div class="paging">
  465. <?
  466. $url = "./sell_view_nomember.php?list_url=$list_url&cd_sale=$cd_sale&ds_status_sale=$ds_status_sale&ListPageNo=$ListPageNo&PageNo=$PageNo&nm_name=$p_nm_name&nm_hp=$p_nm_hp&nm_number=$p_nm_number&mode=$mode";
  467. // ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  468. ?>
  469. </div>
  470. <!-- Postscript -->
  471. <?
  472. if ($ds_status_sale == "ZS"){
  473. $sql = "SELECT
  474. t.*
  475. , d.nm_name nm_name_dealer_p
  476. , d.nm_zip nm_zip_dealer_p
  477. , d.nm_addr nm_addr_dealer_p
  478. , d.nm_addr_sub nm_addr_sub_dealer_p
  479. , d.nm_area nm_area_dealer_p
  480. , p.nm_name nm_name_dealer
  481. , p.nm_hp_01+'-'+p.nm_hp_02+'-'+p.nm_hp_03 nm_hp_dealer
  482. , p.nm_file nm_file_dealer
  483. , report.cd_dealer_p_min
  484. , report.cd_dealer_p_max
  485. , report.nm_price_min
  486. , report.nm_price_max
  487. , report.nm_price_avg
  488. , report.nm_name_min
  489. , report.nm_name_max
  490. , report.cnt
  491. , s.nm_price_final
  492. , s.nm_score_postscript
  493. , s.nm_cont_postscript
  494. FROM tender_master t
  495. inner join dealer_master d
  496. on (t.cd_dealer_p = d.cd_dealer
  497. and t.cd_sale = '$cd_sale'
  498. and t.ds_delind = 'N'
  499. and t.ds_status = 'Z0'
  500. )
  501. inner join dealer_master p
  502. on (t.cd_dealer = p.cd_dealer
  503. )
  504. inner join (
  505. select
  506. ff.cd_sale
  507. , ff.cd_dealer_p_min
  508. , ff.cd_dealer_p_max
  509. , ff.nm_price_min
  510. , ff.nm_price_max
  511. , ff.nm_price_avg
  512. , ff.cnt
  513. , d1.nm_name nm_name_min
  514. , d2.nm_name nm_name_max
  515. from (
  516. select
  517. max(cc.cd_sale) cd_sale
  518. , max(cc.cd_dealer_p_min) cd_dealer_p_min
  519. , max(cc.cd_dealer_p_max) cd_dealer_p_max
  520. , max(cc.nm_price_min) nm_price_min
  521. , max(cc.nm_price_max) nm_price_max
  522. , max(cc.nm_price_avg) nm_price_avg
  523. , max(cc.cnt) cnt
  524. from (
  525. select
  526. aa.cd_sale
  527. , case when aa.nm_price = bb.nm_price_min then aa.cd_dealer_p else 0 end cd_dealer_p_min
  528. , case when aa.nm_price = bb.nm_price_max then aa.cd_dealer_p else 0 end cd_dealer_p_max
  529. , bb.nm_price_min
  530. , bb.nm_price_max
  531. , bb.nm_price_avg
  532. , bb.cnt
  533. from (select * from tender_master where cd_sale = '$cd_sale' and ds_delind = 'N') aa
  534. , (
  535. select
  536. min(nm_price) nm_price_min
  537. , max(nm_price) nm_price_max
  538. , avg(nm_price) nm_price_avg
  539. , count(*) cnt
  540. from tender_master
  541. where cd_sale = '$cd_sale' and ds_delind = 'N'
  542. ) bb
  543. ) cc
  544. ) ff
  545. inner join dealer_master d1
  546. on (ff.cd_dealer_p_min = d1.cd_dealer)
  547. inner join dealer_master d2
  548. on (ff.cd_dealer_p_max = d2.cd_dealer)
  549. ) report
  550. on (t.cd_sale = report.cd_sale
  551. )
  552. inner join sale_master s
  553. on (t.cd_sale = s.cd_sale
  554. )
  555. ";
  556. $col=mysql_fetch_array(mysql_query($sql));
  557. if (!empty($col[cd_sale])){
  558. $cd_sale = $col[cd_sale];
  559. $nm_price = $col[nm_price];
  560. $nm_name_dealer_p = $col[nm_name_dealer_p];
  561. $nm_zip_dealer_p = $col[nm_zip_dealer_p];
  562. $nm_addr_dealer_p = $col[nm_addr_dealer_p];
  563. $nm_addr_sub_dealer_p = $col[nm_addr_sub_dealer_p];
  564. $nm_area_dealer_p = $col[nm_area_dealer_p];
  565. $nm_name_dealer = $col[nm_name_dealer];
  566. $nm_hp_dealer = $col[nm_hp_dealer];
  567. $nm_file_dealer = $col[nm_file_dealer];
  568. $cd_dealer_p_min = $col[cd_dealer_p_min];
  569. $cd_dealer_p_max = $col[cd_dealer_p_max];
  570. $nm_price_min = $col[nm_price_min];
  571. $nm_price_max = $col[nm_price_max];
  572. $nm_price_avg = $col[nm_price_avg];
  573. $nm_name_min = $col[nm_name_min];
  574. $nm_name_max = $col[nm_name_max];
  575. $cnt = $col[cnt];
  576. $nm_price_final = $col[nm_price_final];
  577. $nm_score_postscript = $col[nm_score_postscript];
  578. $nm_cont_postscript = $col[nm_cont_postscript];
  579. /*
  580. $arr_nm_info1 = explode("-",$nm_info1);
  581. if(count($arr_nm_info1) == 3){
  582. $nm_info11 = $arr_nm_info1[0];
  583. $nm_info12 = $arr_nm_info1[1];
  584. $nm_info13 = $arr_nm_info1[2];
  585. }else{
  586. $nm_info11 = "";
  587. $nm_info12 = "";
  588. $nm_info13 = "";
  589. }
  590. $arr_nm_info3 = explode("@",$nm_info3);
  591. if(count($arr_nm_info3) == 2){
  592. $nm_info31 = $arr_nm_info3[0];
  593. $nm_info32 = $arr_nm_info3[1];
  594. }else{
  595. $nm_info31 = "";
  596. $nm_info32 = "";
  597. }
  598. $nm_info3 = $col[nm_info3];
  599. */
  600. }else{
  601. // AlertBack("지정되지않은 요청입니다");
  602. }
  603. ?>
  604. <h3>낙찰업체</h3>
  605. <div class="tender_business">
  606. <dl class="info">
  607. <dt><?=$nm_name_dealer_p?></dt>
  608. <dd class="thumb" style="background-image:url('<?=UPLOAD_PATH?>dealer/nm_file/<?=$nm_file_dealer?>');"></dd>
  609. <dd>약속드립니다.<br>정직하게 일하겠습니다.</dd>
  610. <dd class="price">
  611. <span>참여업체 : <?=$cnt?></span>
  612. <span>평균견적 : <?=$nm_price_avg?> 만원</span>
  613. <span>낙찰가 <em><?=$nm_price_final?> 만원</em></span>
  614. <!--a href="#" class="button td_btn ty2">딜러 정보 보기</a-->
  615. </dd>
  616. </dl>
  617. <form name="frmFormPostscript" id="frmFormPostscript" method="post" action="/mypage/dealer_proc.php">
  618. <input type="hidden" name="mode" id="mode" value="WritePostscriptNomember">
  619. <input type="hidden" name="cd_sale" id="cd_sale" value="<?=$cd_sale?>">
  620. <input type="hidden" name="nm_name" id="nm_name" value="<?=$p_nm_name?>">
  621. <input type="hidden" name="nm_hp" id="nm_hp" value="<?=$p_nm_hp?>">
  622. <input type="hidden" name="nm_number" id="nm_number" value="<?=$p_nm_number?>">
  623. <div class="review_write">
  624. <p class="customer_grade">
  625. <label for="customer_score">고객만족도</label>
  626. <span id="customer_score">
  627. <select name="nm_score_postscript" id="nm_score_postscript" class="select" style="width:130px;">
  628. </select>
  629. </span>
  630. <em>점</em>
  631. </p>
  632. <p><textarea cols="90" rows="8" name="nm_cont_postscript" id="nm_cont_postscript"><?=$nm_cont_postscript?></textarea></p>
  633. </div>
  634. </form>
  635. </div>
  636. <div class="btn_center">
  637. <a href="#" class="button" id="btn_write_postscript">후기쓰기</a>
  638. </div>
  639. <?
  640. }
  641. ?>
  642. <!-- // Postscript -->
  643. <!-- layer popup -->
  644. <div class="layer_popup tender_popup">
  645. <div class="popup_wrap">
  646. <p class="msg"><em id="nm_dealer_popup">고진상사</em>에게 낙찰정보를 보내시겠습니까?</p>
  647. <div class="btn_center">
  648. <a href="#" class="button" id="btn_write">확인</a>
  649. <a href="#" class="button gray" onclick="closeLayer('tender'); return false;">취소</a>
  650. </div>
  651. </div>
  652. </div>
  653. <!-- // layer popup -->
  654. <!-- layer popup -->
  655. <div class="layer_popup car_popup">
  656. <h3>중고차 보험처리 이력정보 보고서</h3>
  657. <p class="close">레이어팝업닫기</p>
  658. <div class="scr_cont">
  659. <h4>중고차 사고이력 요약 정보</h4>
  660. <table class="tbl_data">
  661. <colgroup>
  662. <col width="35%">
  663. <col width="*">
  664. </colgroup>
  665. <tr>
  666. <th>자동차 일반사양</th>
  667. <td><?=$nm_act_general_spec?></td>
  668. </tr>
  669. <tr>
  670. <th>자동차 용도이력</th>
  671. <td><?=$nm_act_use_record?></td>
  672. </tr>
  673. <tr>
  674. <th>자동차 번호 / 소유자 변경횟수</th>
  675. <td><?=$nm_act_chgno?> 회 / <?=$nm_act_chgnm?> 회</td>
  676. </tr>
  677. <tr>
  678. <th>자동차보험 특수 사고이력(전손, 침수, 도난)</th>
  679. <td>전손 : <?=$nm_act_s1?>, 도난 : <?=$nm_act_s4?>, 침수(전손 : <?=$nm_act_s2?>, 분손 : <?=$nm_act_s3?>)</td>
  680. </tr>
  681. <tr>
  682. <th>보험사고이력(내차 피해)</th>
  683. <td><?=$nm_act_my?> 회, <?=$nm_act_my_amt?> 원</td>
  684. </tr>
  685. <tr>
  686. <th>보험사고이력(타차 피해)</th>
  687. <td><?=$nm_act_other?> 회, <?=$nm_act_other_amt?> 원</td>
  688. </tr>
  689. </table>
  690. <p class="notice01">자동차보험 사고기록이 없었다고 해서 반드시 무사고라고 할 수는 없습니다.</p>
  691. <h5>1. 자동차 용도 이력정보</h5>
  692. <table class="tbl_data">
  693. <colgroup>
  694. <col width="35%">
  695. <col width="*">
  696. </colgroup>
  697. <tr>
  698. <th>대여용도 사용이력(렌터카)</th>
  699. <td><?=$nm_act_use_record_lend?></td>
  700. </tr>
  701. <tr>
  702. <th>영업용도 사용이력</th>
  703. <td><?=$nm_act_use_record_biz?></td>
  704. </tr>
  705. <tr>
  706. <th>관용용도 사용이력</th>
  707. <td><?=$nm_act_use_record_official?></td>
  708. </tr>
  709. </table>
  710. <p class="notice02">과거 자동차번호 변경기록을 모두 검색하여 제공하는 것으로 대여용(렌트카), 영업용(택시 등)으로 사용된 적이 있는지 확인할 수 있습니다.</p>
  711. <h5>2. 자동차보험 특수 사고 이력 정보</h5>
  712. <table class="tbl_data">
  713. <colgroup>
  714. <col width="35%">
  715. <col width="*">
  716. </colgroup>
  717. <tr>
  718. <th>전손 보험사고</th>
  719. <td><?=$nm_act_ins_loss?></td>
  720. </tr>
  721. <tr>
  722. <th>침수 보험사고</th>
  723. <td><?=$nm_act_ins_wet?></td>
  724. </tr>
  725. <tr>
  726. <th>도난 보험사고</th>
  727. <td><?=$nm_act_ins_robbery?></td>
  728. </tr>
  729. </table>
  730. <h5>3. 보험사고 이력정보 : 내차 피해</h5>
  731. <table class="tbl_data2">
  732. <colgroup>
  733. <col width="20%">
  734. <col width="20%">
  735. <col width="20%">
  736. <col width="20%">
  737. <col width="20%">
  738. </colgroup>
  739. <thead>
  740. <tr>
  741. <th>사고일자</th>
  742. <th>부품</th>
  743. <th>공임</th>
  744. <th>도장</th>
  745. <th>총 수리비용</th>
  746. </tr>
  747. </thead>
  748. <tbody>
  749. <tr>
  750. <th><?=$ds_g1_01?></th>
  751. <td><?=$ds_g1_02?>원</td>
  752. <td><?=$ds_g1_03?>원</td>
  753. <td><?=$ds_g1_04?>원</td>
  754. <td><?=$ds_g1_05?>원</td>
  755. </tr>
  756. <tr>
  757. <th><?=$ds_g2_01?></th>
  758. <td><?=$ds_g2_02?>원</td>
  759. <td><?=$ds_g2_03?>원</td>
  760. <td><?=$ds_g2_04?>원</td>
  761. <td><?=$ds_g2_05?>원</td>
  762. </tr>
  763. <tr>
  764. <th><?=$ds_g3_01?></th>
  765. <td><?=$ds_g3_02?>원</td>
  766. <td><?=$ds_g3_03?>원</td>
  767. <td><?=$ds_g3_04?>원</td>
  768. <td><?=$ds_g3_05?>원</td>
  769. </tr>
  770. <tr>
  771. <th><?=$ds_g4_01?></th>
  772. <td><?=$ds_g4_02?>원</td>
  773. <td><?=$ds_g4_03?>원</td>
  774. <td><?=$ds_g4_04?>원</td>
  775. <td><?=$ds_g4_05?>원</td>
  776. </tr>
  777. </tbody>
  778. </table>
  779. <!--h5>4. 보험사고 이력정보 : 타차 가해</h5>
  780. <table class="tbl_data2">
  781. <colgroup>
  782. <col width="20%">
  783. <col width="20%">
  784. <col width="20%">
  785. <col width="20%">
  786. <col width="20%">
  787. </colgroup>
  788. <thead>
  789. <tr>
  790. <th>사고일자</th>
  791. <th>부품</th>
  792. <th>공임</th>
  793. <th>도장</th>
  794. <th>총 수리비용</th>
  795. </tr>
  796. </thead>
  797. <tbody>
  798. <tr>
  799. <th>2017-05-27</th>
  800. <td>857,610원</td>
  801. <td>857,610원</td>
  802. <td>857,610원</td>
  803. <td>857,610원</td>
  804. </tr>
  805. <tr>
  806. <th>2017-05-27</th>
  807. <td>857,610원</td>
  808. <td>857,610원</td>
  809. <td>857,610원</td>
  810. <td>857,610원</td>
  811. </tr>
  812. </tbody>
  813. </table>
  814. <ul class="notice03">
  815. <li>중고차 사고 이력정보 서비스는 자동차 보험을 취급하는 14개 손해보험사의 자동차 보험수리비 지급기록(1996년 이후)에 근거하여 제공하고 있습니다.<br>
  816. 따라서 다음과 같은 경우에는 중고차 사고 이력정보 서비스를 제공할 수 없습니다.</li>
  817. <li>
  818. <ol>
  819. <li>사고가 있었다하더라도 보험회사에 사전신고를 하지 않고 자비로 처리한 경우,<br>
  820. 사고신고를 하였더라도 면책, 취소 등의 사유로 보험금이 지급되지 않은경우,<br>
  821. 사고신고 후 자비로 처리한 경우입니다.</li>
  822. <li>사고가 있었다하더라도 종합보험, 즉 자기차량담보나 대물배상담보의 자동차 보험에 가입하지 않아서 자동차 보험으로 수리비용을 청구하지 못한 경우<br>
  823. (단, 이경우라도 타인 자동차보험에서 보상받은 경우에는 사고정보 제공가능)</li>
  824. <li>자동차보험이 아니 운수공제(택시공제, 화물공제, 버스공제 등)에 가입되어 운수공제로부터 자동차의 피해에 대한 손해를 보상받은 경우 등</li>
  825. </ol>
  826. </li>
  827. <li>본 중고차 사고이력정보는 중고차 품질확인을 위한 보조정보이며 결정적인 판단 자료로 사용되어서는 아니됩니다. 따라서 정밀한 중고차 품질확인을<br>
  828. 원하시면 차량진단 전문업체의 진단을 받아보시기 바랍니다.</li>
  829. <li>※ 보험개발원(www.kidi.or.kr)은 보험입법 제 176조에 의하여 설립된 보험요율산출기관이며,<br>
  830. 중고차사고이력정보서비스(www.carhistory.or.kr)는 보험업법시행령 제86조 제1호 근거하여 제공합니다. </li>
  831. </ul>
  832. <p class="sign"><img src="/img/img_sign.gif"></p-->
  833. </div>
  834. </div>
  835. <!-- // layer popup -->
  836. <!-- layer popup3 -->
  837. <div class="layer_popup photo_popup">
  838. <div class="popup_wrap">
  839. <img src="/img/sell/ic_car_photo1.png" id="photoBig">
  840. <!-- div class="btn_center">
  841. <a href="#" class="button gray" onclick="closeLayer('photo'); return false;">확인</a>
  842. </div -->
  843. </div>
  844. <div class="close" onclick="closeLayer('photo');">레이어팝업 닫기</div>
  845. </div>
  846. <!-- // layer popup3 -->
  847. <?
  848. if($ds_status_sale == "D0"){ //ds_status_sale=D0
  849. ?>
  850. <!-- layer_popup -->
  851. <div class="layer_popup return_popup">
  852. <div class="popup_wrap">
  853. <p class="msg">
  854. <?=$nm_cont_return_sale?>
  855. </p>
  856. <div class="btn_center">
  857. <a href="#" class="button" id="btn_update_return">차량정보 수정</a>
  858. </div>
  859. </div>
  860. <div class="close">레이어팝업 닫기</div>
  861. </div>
  862. <!-- // layer_popup -->
  863. <script type="text/javascript">
  864. openLayer('return');
  865. </script>
  866. <?
  867. }
  868. ?>
  869. </section>
  870. </section>
  871. <form name="frmForm" id="frmForm" method="post" action="/mypage/dealer_proc.php">
  872. <input type="hidden" name="mode" id="mode" value="TenderSuccessNomember">
  873. <input type="hidden" name="cd_sale" id="cd_sale" value="<?=$cd_sale?>">
  874. <input type="hidden" name="cd_tender" id="cd_tender">
  875. <input type="hidden" name="nm_price" id="nm_price">
  876. <input type="hidden" name="nm_name" id="nm_name" value="<?=$p_nm_name?>">
  877. <input type="hidden" name="nm_hp" id="nm_hp" value="<?=$p_nm_hp?>">
  878. <input type="hidden" name="nm_number" id="nm_number" value="<?=$p_nm_number?>">
  879. </form>
  880. <script laguage="javascript" type="text/javascript">
  881. function openPostScript(arg1, arg2){
  882. var url = "/mypage/sell_view_postscript.php?cd_dealer_p="+arg1+"&cd_tender="+arg2;
  883. var winname = "winPostscript";
  884. var opt = "width=600,height=700,scrollbar=no";
  885. popup_window(url, winname, opt);
  886. }
  887. function selectTender(arg1, arg2, arg3){
  888. $("#cd_tender").val(arg1);
  889. $("#nm_dealer_popup").text(arg2);
  890. $("#nm_price").val(arg3);
  891. openLayer('tender'); return false;
  892. }
  893. function viewPhoto(arg1){
  894. $("#photoBig").attr("src", arg1);
  895. openLayer('photo'); return false;
  896. }
  897. $(document).ready(function() {
  898. $("#btn_write").bind("click",function(){
  899. // $("#cd_tender").val($("#a_Tender").attr('value'));
  900. var c=confirm("정보를 등록하시겠습니까?");
  901. if(c){
  902. $("#btn_write").hide();
  903. $("#frmForm").submit();
  904. }else{
  905. $("#btn_write").show();
  906. return false;
  907. }
  908. });
  909. $("#btn_update,#btn_update_return").on("click", function(){
  910. $.post("/sell/proc.php", { mode:"updateCar", cd_car:"<?=$cd_car?>", cd_sale:"<?=$cd_sale?>"},function(data) {
  911. // alert(data);
  912. if(data=="Y"){
  913. location.href = "./sell_step1.php?mode=Step1";
  914. }else{
  915. alert("수정할 수 없습니다.");
  916. return;
  917. }
  918. });
  919. });
  920. //<!-- Postscript -->
  921. <?
  922. if ($ds_status_sale == "ZS"){
  923. ?>
  924. setCodeSelect("listcode","nm_score_postscript", "sale_master","nm_score_postscript","<?=$nm_score_postscript?>","선택하세요","");
  925. $("#btn_write_postscript").bind("click",function(){
  926. var fieldlist = [["nm_score_postscript","고객만족도"],["nm_cont_postscript","내용"]]
  927. if (!fnCheckForm(fieldlist)){
  928. return false;
  929. }
  930. var c=confirm("정보를 등록하시겠습니까?");
  931. if(c){
  932. $("#btn_write_postscript").hide();
  933. $("#frmFormPostscript").submit();
  934. }else{
  935. $("#btn_write_postscript").show();
  936. return false;
  937. }
  938. });
  939. <?
  940. }
  941. ?>
  942. //<!-- // Postscript -->
  943. });
  944. </script>
  945. <? include("../include/inc_footer.php") ?>
  946. <? include("../include/inc_bottom.php") ?>
  947. <?
  948. mysql_close($connect);
  949. ?>