dealer_tender_view.php 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].'/common/dealer_chk.php';
  4. ?>
  5. <!DOCTYPE html>
  6. <HTML lang="ko">
  7. <head>
  8. <meta charset="utf-8">
  9. <title>UPRO</title>
  10. <meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width">
  11. <meta name="format-detection" content="telephone=no">
  12. <link rel="stylesheet" type="text/css" href="/m/css/sumogallery.css">
  13. <link rel="stylesheet" type="text/css" href="/m/css/common.css">
  14. <link rel="stylesheet" type="text/css" href="/m/css/sub.css">
  15. <script type="text/javascript" charset="utf-8" src="/m/js/jquery-1.11.2.min.js"></script>
  16. <script type="text/javascript" charset="utf-8" src="/m/js/jquery.panzoom.min.js"></script>
  17. <script type="text/javascript" charset="utf-8" src="/m/js/ui.js"></script>
  18. <script type="text/javascript" src="<?=JS_PATH?>"></script>
  19. </head>
  20. <body>
  21. <!-- s : header -->
  22. <? include("../inc/inc_header.php"); ?>
  23. <!-- // e : header -->
  24. <!-- s : container -->
  25. <section id="container">
  26. <section id="visual" class="visual_mypage">
  27. <h2>마이페이지</h2>
  28. <p>쉽고 간편한 내차팔기, 견적산출,<br>최종 매각까지 어떤 수수료도 요구하지 않습니다.</p>
  29. </section>
  30. <section id="content">
  31. <?
  32. $s_cd_dealer = $_SESSION['s_cd_dealer'];
  33. $s_cd_dealer_p = $_SESSION['s_cd_dealer_p'];
  34. $s_ds_type = $_SESSION['s_ds_type'];
  35. $s_ds_status_p = $_SESSION['s_ds_status_p'];
  36. if($s_ds_type == "D0"){ //딜러
  37. $sql_ds_type = " cd_dealer_p = '$s_cd_dealer' ";
  38. }else{ //딜러-관리자
  39. $sql_ds_type = " cd_dealer = '$s_cd_dealer' ";
  40. }
  41. $rq_ds_status = $_REQUEST['ds_status']; //요청받은 상태값 : request ds_status (naming request->rq, response->rs)
  42. if($rq_ds_status == "E0"){
  43. $nm_title = "입찰대기 리스트";
  44. }else if($rq_ds_status == "F0"){
  45. $nm_title = "입찰중 리스트";
  46. }else if($rq_ds_status == "Z0"){
  47. $nm_title = "낙찰 리스트";
  48. }else if($rq_ds_status == "ZS"){
  49. $nm_title = "구매확정 리스트";
  50. }
  51. $cd_sale = $_REQUEST["cd_sale"];
  52. $sql ="SELECT
  53. a.*
  54. , b.nm_model
  55. , c.nm_grade
  56. , d.nm_brand
  57. , e.nm_model_sub
  58. , getCode('car_master','ds_type',a.ds_type) as nm_type
  59. , getCode('car_master','ds_year',a.ds_year) as nm_year
  60. , getCode('car_master','ds_open',a.ds_open) as nm_open
  61. , getCode('car_master','ds_sales',a.ds_sales) as nm_sales
  62. , getCode('car_master','ds_transmission',a.ds_transmission) as nm_transmission
  63. , getCode('car_master','ds_oil',a.ds_oil) as nm_oil
  64. , getCode('car_master','ds_accident',a.ds_accident) as nm_accident
  65. , getCode('sale_master','ds_usertype',s.ds_usertype) as nm_usertype
  66. , getCode('member_master','ds_area',s.ds_area) as nm_area
  67. , getCode('member_master','ds_area',s.ds_area_user) as nm_area_user
  68. , getCode('sale_master','ds_status',s.ds_status) as nm_status
  69. , s.nm_name nm_name_sale
  70. , s.ds_status ds_status_sale
  71. , s.nm_hp nm_hp_sale
  72. , s.nm_email nm_email_sale
  73. , s.ds_area ds_area_sale
  74. , s.nm_recommend nm_recommend_sale
  75. , s.nm_cont_return nm_cont_return_sale
  76. , getRemainTime(".LIMIT_TIME_TENDER.", s.dt_approve, now()) as time_limit_tender
  77. FROM sale_master s
  78. inner join car_master a
  79. on (s.cd_car = a.cd_car)
  80. left outer join car_model b
  81. on (a.cd_model = b.cd_model)
  82. left outer join car_grade c
  83. on (a.cd_grade = c.cd_grade)
  84. left outer join car_brand d
  85. on (a.cd_brand = d.cd_brand)
  86. left outer join car_model_sub e
  87. on (a.cd_model_sub = e.cd_model_sub)
  88. WHERE s.cd_sale='$cd_sale' ";
  89. $col=mysql_fetch_array(mysql_query($sql));
  90. if (!empty($col[cd_car])){
  91. $cd_car = $col[cd_car];
  92. $cd_model = $col[cd_model];
  93. $cd_brand = $col[cd_brand];
  94. $ds_logo = $col[ds_logo];
  95. $cd_category = $col[cd_category];
  96. $cd_grade = $col[cd_grade];
  97. $ds_cate = $col[ds_cate];
  98. $ds_type = $col[ds_type];
  99. $ds_year = $col[ds_year];
  100. $nm_name = $col[nm_name];
  101. $nm_price = $col[nm_price];
  102. $nm_mileage = $col[nm_mileage];
  103. $ds_driving_system = $col[ds_driving_system];
  104. $ds_transmission = $col[ds_transmission];
  105. $nm_file_list = $col[nm_file_list];
  106. $nm_file_main = $col[nm_file_main];
  107. $nm_file_report = $col[nm_file_report];
  108. $nm_file_report_back = $col[nm_file_report_back];
  109. $nm_file_front = $col[nm_file_front];
  110. $nm_file_back = $col[nm_file_back];
  111. $nm_file_side1 = $col[nm_file_side1];
  112. $nm_file_side2 = $col[nm_file_side2];
  113. $nm_file_dashboard = $col[nm_file_dashboard];
  114. $ds_oil = $col[ds_oil];
  115. $nm_gearbox = $col[nm_gearbox];
  116. $nm_color = $col[nm_color];
  117. $nm_incolor = $col[nm_incolor];
  118. $ds_accident = $col[ds_accident];
  119. $nm_cont_accident = $col[nm_cont_accident];
  120. $nm_regdate = $col[nm_regdate];
  121. $ds_sales = $col[ds_sales];
  122. $nm_btitle = $col[nm_btitle];
  123. $nm_stitle = $col[nm_stitle];
  124. $nm_ltitle = $col[nm_ltitle];
  125. $nm_cont = $col[nm_cont];
  126. $nm_guide = $col[nm_guide];
  127. $ds_open = $col[ds_open];
  128. $ds_status = $col[ds_status];
  129. $dt_insert = $col[dt_insert];
  130. $nm_insert = $col[nm_insert];
  131. $dt_update = $col[dt_update];
  132. $nm_update = $col[nm_update];
  133. $ds_delind = $col[ds_delind];
  134. $nm_number = $col[nm_number];
  135. $nm_cc = $col[nm_cc];
  136. $ds_trade = $col[ds_trade];
  137. $ds_main = $col[ds_main];
  138. $nm_regdate_yyyy = $col[nm_regdate_yyyy];
  139. $nm_regdate_mm = $col[nm_regdate_mm];
  140. $nm_regdate_dd = $col[nm_regdate_dd];
  141. $nm_brand = $col[nm_brand];
  142. $nm_model = $col[nm_model];
  143. $nm_model_sub = $col[nm_model_sub];
  144. $nm_grade = $col[nm_grade];
  145. $nm_year = $col[nm_year];
  146. $nm_type = $col[nm_type];
  147. $nm_open = $col[nm_open];
  148. $nm_sales = $col[nm_sales];
  149. $nm_transmission = $col[nm_transmission];
  150. $nm_oil = $col[nm_oil];
  151. $nm_usertype = $col[nm_usertype];
  152. $nm_accident = $col[nm_accident];
  153. $nm_area = $col[nm_area];
  154. $nm_area_user = $col[nm_area_user];
  155. $nm_name_sale = $col[nm_name_sale];
  156. $ds_status_sale = $col[ds_status_sale];
  157. $nm_hp_sale = $col[nm_hp_sale];
  158. $nm_email_sale = $col[nm_email_sale];
  159. $ds_area_sale = $col[ds_area_sale];
  160. $nm_recommend_sale = $col[nm_recommend_sale];
  161. $nm_cont_return_sale = $col[nm_cont_return_sale];
  162. $time_limit_tender = $col[time_limit_tender];
  163. //보험처리
  164. $nm_act_chgno = $col[nm_act_chgno];
  165. $nm_act_chgnm = $col[nm_act_chgnm];
  166. $nm_act_s1 = $col[nm_act_s1];
  167. $nm_act_s2 = $col[nm_act_s2];
  168. $nm_act_s3 = $col[nm_act_s3];
  169. $nm_act_s4 = $col[nm_act_s4];
  170. $nm_act_my = $col[nm_act_my];
  171. $nm_act_my_amt = $col[nm_act_my_amt];
  172. $nm_act_other = $col[nm_act_other];
  173. $nm_act_other_amt = $col[nm_act_other_amt];
  174. $nm_act_searchdt = $col[nm_act_searchdt];
  175. $nm_act_cnt = $col[nm_act_cnt];
  176. $nm_act_general_spec = $col[nm_act_general_spec];
  177. $nm_act_use_record = $col[nm_act_use_record];
  178. $nm_act_use_record_lend = $col[nm_act_use_record_lend];
  179. $nm_act_use_record_biz = $col[nm_act_use_record_biz];
  180. $nm_act_use_record_official = $col[nm_act_use_record_official];
  181. $nm_act_ins_loss = $col[nm_act_ins_loss];
  182. $nm_act_ins_wet = $col[nm_act_ins_wet];
  183. $nm_act_ins_robbery = $col[nm_act_ins_robbery];
  184. $nm_file_act = $col[nm_file_act];
  185. $nm_act_yn = $col[nm_act_yn];
  186. $ds_g1_01 = $col[ds_g1_01];
  187. $ds_g1_02 = $col[ds_g1_02];
  188. $ds_g1_03 = $col[ds_g1_03];
  189. $ds_g1_04 = $col[ds_g1_04];
  190. $ds_g1_05 = $col[ds_g1_05];
  191. $ds_g2_01 = $col[ds_g2_01];
  192. $ds_g2_02 = $col[ds_g2_02];
  193. $ds_g2_03 = $col[ds_g2_03];
  194. $ds_g2_04 = $col[ds_g2_04];
  195. $ds_g2_05 = $col[ds_g2_05];
  196. $ds_g3_01 = $col[ds_g3_01];
  197. $ds_g3_02 = $col[ds_g3_02];
  198. $ds_g3_03 = $col[ds_g3_03];
  199. $ds_g3_04 = $col[ds_g3_04];
  200. $ds_g3_05 = $col[ds_g3_05];
  201. $ds_g4_01 = $col[ds_g4_01];
  202. $ds_g4_02 = $col[ds_g4_02];
  203. $ds_g4_03 = $col[ds_g4_03];
  204. $ds_g4_04 = $col[ds_g4_04];
  205. $ds_g4_05 = $col[ds_g4_05];
  206. /*
  207. $arr_nm_info1 = explode("-",$nm_info1);
  208. if(count($arr_nm_info1) == 3){
  209. $nm_info11 = $arr_nm_info1[0];
  210. $nm_info12 = $arr_nm_info1[1];
  211. $nm_info13 = $arr_nm_info1[2];
  212. }else{
  213. $nm_info11 = "";
  214. $nm_info12 = "";
  215. $nm_info13 = "";
  216. }
  217. $arr_nm_info3 = explode("@",$nm_info3);
  218. if(count($arr_nm_info3) == 2){
  219. $nm_info31 = $arr_nm_info3[0];
  220. $nm_info32 = $arr_nm_info3[1];
  221. }else{
  222. $nm_info31 = "";
  223. $nm_info32 = "";
  224. }
  225. $nm_info3 = $col[nm_info3];
  226. */
  227. }else{
  228. AlertBack("지정되지않은 요청입니다");
  229. }
  230. $sql ="SELECT *
  231. FROM car_history_master mst
  232. WHERE cd_car='$cd_car' AND ds_delind='N' and ds_type = 'user'";
  233. $history_col=mysql_fetch_array(mysql_query($sql));
  234. $r000 = $history_col["r000"];
  235. $r001 = $history_col["r001"];
  236. $r002 = $history_col["r002"];
  237. $r004 = $history_col["r004"];
  238. $r005 = $history_col["r005"];
  239. $r101 = $history_col["r101"];
  240. $r102 = $history_col["r102"];
  241. $r103 = $history_col["r103"];
  242. $r104 = $history_col["r104"];
  243. $r105 = $history_col["r105"];
  244. $r106 = $history_col["r106"];
  245. $r107 = $history_col["r107"];
  246. $r108 = $history_col["r108"];
  247. $r109 = $history_col["r109"];
  248. $r401 = $history_col["r401"];
  249. $r402 = $history_col["r402"];
  250. $r403 = $history_col["r403"];
  251. $r404 = $history_col["r404"];
  252. $r405 = $history_col["r405"];
  253. $r406_01 = $history_col["r406_01"];
  254. $r407 = $history_col["r407"];
  255. $r408_01 = $history_col["r408_01"];
  256. $r409 = $history_col["r409"];
  257. $r410_01 = $history_col["r410_01"];
  258. $r201 = $history_col["r201"];
  259. $r202 = $history_col["r202"];
  260. $r203 = $history_col["r203"];
  261. $r204 = $history_col["r204"];
  262. $r205 = $history_col["r205"];
  263. $r510 = $history_col["r510"];
  264. $r511_01 = $history_col["r511_01"];
  265. $r501 = $history_col["r501"];
  266. $r502 = $history_col["r502"];
  267. $r301 = $history_col["r301"];
  268. $r302 = $history_col["r302"];
  269. $r303 = $history_col["r303"];
  270. $r601 = $history_col["r601"];
  271. $r602 = $history_col["r602"];
  272. ?>
  273. <h3>차량 기본정보</h3>
  274. <div class="car_model">
  275. <p><?=$col[nm_model]." ".$col[nm_model_sub]." ".$col[nm_grade]?></p>
  276. <? if($ds_status_sale == "E0" || $ds_status_sale == "F0"){ ?>
  277. <p>입찰 마감 시간 : <em><?=$time_limit_tender?></em><!--시간--></p> <? } ?>
  278. </div>
  279. <table class="tbl_h">
  280. <colgroup>
  281. <col width="32%">
  282. <col width="*">
  283. </colgroup>
  284. <tr>
  285. <th>차량번호</th>
  286. <td><?=$nm_number?></td>
  287. </tr>
  288. <tr>
  289. <th>제조사</th>
  290. <td><?=$nm_brand?></td>
  291. </tr>
  292. <tr>
  293. <th>모델</th>
  294. <td><?=$nm_model?></td>
  295. </tr>
  296. <tr>
  297. <th>세부모델</th>
  298. <td><?=$nm_model_sub?></td>
  299. </tr>
  300. <tr>
  301. <th>등급</th>
  302. <td><?=$nm_grade?></td>
  303. </tr>
  304. <tr>
  305. <th>연식(최초등록일)</th>
  306. <td><?=$nm_regdate_yyyy."년 ".$nm_regdate_mm."월"?></td>
  307. </tr>
  308. <tr>
  309. <th>형식연도</th>
  310. <td><?=$nm_year?>년</td>
  311. </tr>
  312. <tr>
  313. <th>배기량</th>
  314. <td><?=$nm_cc?>cc</td>
  315. </tr>
  316. <tr>
  317. <th>변속기</th>
  318. <td><?=$nm_transmission?></td>
  319. </tr>
  320. <tr>
  321. <th>연료</th>
  322. <td><?=$nm_oil?></td>
  323. </tr>
  324. <tr>
  325. <th>색상</th>
  326. <td><?=$nm_color?></td>
  327. </tr>
  328. <tr>
  329. <th>주행거리</th>
  330. <td><?=$nm_mileage?>km</td>
  331. </tr>
  332. <!-- <tr>
  333. <th>추천인</th>
  334. <td>없음</td>
  335. </tr>-->
  336. <tr>
  337. <th>사고유무</th>
  338. <td>
  339. <?=$nm_accident?>
  340. &nbsp;<?=$nm_cont_accident?>
  341. </td>
  342. </tr>
  343. <tr>
  344. <th>옵션</th>
  345. <td><?=$nm_cont?></td>
  346. </tr>
  347. <tr>
  348. <!-- 판매 희망지역 추가 -->
  349. <th>판매희망지역</th>
  350. <td>
  351. <?=$nm_area_user?>
  352. </td>
  353. <!-- 판매 희망지역 추가 -->
  354. </tr>
  355. <tr>
  356. <th>필수사진</th>
  357. <td>
  358. <ul class="photo_list">
  359. <li>
  360. <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="차량전면">
  361. <span>차량전면</span>
  362. </li>
  363. <li>
  364. <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="차량후면">
  365. <span>차량후면</span>
  366. </li>
  367. <li>
  368. <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="운전석 측면">
  369. <span>운전석 측면</span>
  370. </li>
  371. <li>
  372. <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="조수석 측면">
  373. <span>조수석 측면</span>
  374. </li>
  375. <li>
  376. <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="계기판">
  377. <span>계기판</span>
  378. </li>
  379. </ul>
  380. </td>
  381. </tr>
  382. <tr>
  383. <th>추가사진</th>
  384. <td>
  385. <ul class="photo_list">
  386. <?
  387. if(!empty($col[cd_car])){
  388. $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 ");
  389. $i=1;
  390. while($imgs = mysql_fetch_array($r)) {
  391. ?>
  392. <li><img data-sgallery="group2" data-full="<?=UPLOAD_PATH_CAR?><?=$imgs[cd_car]?>_detail/<?=$imgs[nm_file]?>" data-thumb="<?=UPLOAD_PATH_CAR?><?=$imgs[cd_car]?>_detail/<?=$imgs[nm_file]?>" src="<?=UPLOAD_PATH_CAR?><?=$imgs[cd_car]?>_detail/<?=$imgs[nm_file]?>"></li>
  393. <?
  394. }
  395. }else{
  396. ?>
  397. <?
  398. }
  399. ?>
  400. <!-- <li><img src="/admin/img/@img_car.jpg"></li>
  401. <li><img src="/admin/img/@img_car.jpg"></li>
  402. <li><img src="/admin/img/@img_car.jpg"></li>-->
  403. </ul>
  404. </td>
  405. </tr>
  406. <tr>
  407. <th>담당자코멘트</th>
  408. <td><?=$nm_guide?></td>
  409. </tr>
  410. </table>
  411. <h3>사고이력정보</h3>
  412. <?/*
  413. <ul class="accident_history">
  414. <li><span>차량번호 변경</span> <em><?=$nm_act_chgno?>회</em></li>
  415. <li><span>소유자 변경</span> <em><?=$nm_act_chgnm?> 회</em></li>
  416. <li><span>자동차 보험 특수 사고</span> <em>전손 : <?=$nm_act_s1?> 회 / 침수전손 : <?=$nm_act_s2?> 회 / 침수분손 : <?=$nm_act_s3?> 회 / 도난 : <?=$nm_act_s4?> 회</em></li>
  417. <li><span>보험사고 (내차피해)</span> <em><?=$nm_act_my?> 회 (<?=$nm_act_my_amt?> 원)</em></li>
  418. <li><span>보험사고 (타차가해)</span> <em><?=$nm_act_other?>회 (<?=$nm_act_other_amt?>원)</em></li>
  419. <!--<li><span>사고이력 조회일</span> <em>2018-12-05</em></li>-->
  420. </ul>
  421. */?>
  422. <?
  423. //차량 보험처리 이력 요약 정보
  424. include_once($_SERVER['DOCUMENT_ROOT'].'/common/inc/inc_car_history_m_summary.php');
  425. ?>
  426. <div class="btn_center">
  427. <a href="#" class="button" onclick="openLayer('car'); return false;">사고이력 정보 조회 보기</a>
  428. </div>
  429. <!-- <div class="btn_center">
  430. <a href="#" class="button">목록가기</a>
  431. </div>-->
  432. <!-- layer popup -->
  433. <div class="layer_popup car_popup">
  434. <h3>중고차 보험처리 이력정보 보고서</h3>
  435. <p class="close">레이어팝업닫기</p>
  436. <div class="scr_cont">
  437. <?
  438. //차량 보험처리 이력 전체 정보
  439. include_once($_SERVER['DOCUMENT_ROOT'].'/common/inc/inc_car_history_m.php');
  440. ?>
  441. </div>
  442. </div>
  443. <!-- // layer popup -->
  444. <?
  445. // $sql ="select count(*) cnt, max(case when ".$sql_ds_type." then nm_price else 0 end) nm_price_max from tender_master where cd_sale = $cd_sale ";
  446. $sql ="select count(*) cnt
  447. , max(case when ".$sql_ds_type." then cast(nm_price as UNSIGNED) else 0 end) nm_price_max
  448. , min(cast(nm_price as UNSIGNED)) min_price
  449. , avg(cast(nm_price as UNSIGNED)) avg_price
  450. , max(cast(nm_price as UNSIGNED)) max_price
  451. from tender_master where cd_sale = $cd_sale ";
  452. // echo $sql;
  453. $col1=mysql_fetch_array(mysql_query($sql));
  454. // $col1=mysql_fetch_array(mysql_query($sql));
  455. ?>
  456. <?
  457. #유찰의 경우만 visible
  458. if($rq_ds_status == "ZE") {
  459. ?>
  460. <!-- 2020-01-23 유찰상세추가 -->
  461. <div class="price_info">
  462. <ul class="price_list">
  463. <li>최고가 : <?=number_format($col1[max_price])?>만원</li>
  464. <li>최저가 : <?=number_format($col1[min_price])?>만원</li>
  465. <li>평균 입찰금액 : <?=number_format($col1[avg_price])?>만원</li>
  466. <li>입찰자 수 : <?=$col1[cnt]?>곳</li>
  467. </ul>
  468. <ul class="ranking">
  469. <?
  470. $col2_cnt = 1;
  471. $col2_ord = 65;
  472. $sql2 =mysql_query("select nm_price
  473. ,(select nm_company from dealer_master a where a.cd_dealer = b.cd_dealer_p limit 1) as nm_company
  474. from tender_master b where cd_sale = $cd_sale
  475. order by cast(nm_price as UNSIGNED) desc limit 3");
  476. while($col2 = mysql_fetch_array($sql2)) {
  477. ?>
  478. <li><span class="rank"><?=$col2_cnt?>위</span> : <?=number_format($col2[nm_price])?>만원 / <?=chr($col2_ord)?>상사<?//$col2[nm_company]?></li>
  479. <?
  480. $col2_ord++;
  481. $col2_cnt++;
  482. }
  483. ?>
  484. <!-- <li><span class="rank">1위</span> : 3,000만원 / A상사</li>
  485. <li><span class="rank">2위</span> : 2,850만원 / B상사</li>
  486. <li><span class="rank">3위</span> : 2,500만원 / C상사</li> -->
  487. </ul>
  488. </div>
  489. <?
  490. if($col1[nm_price_max]>0) {
  491. ?>
  492. <div class="bidding_board">
  493. <p class="my_price">나의 입찰가는 <strong><?=number_format($col1[nm_price_max])?></strong>만원입니다.</p>
  494. </div>
  495. <?
  496. }
  497. ?>
  498. <!-- // 2020-01-23 유찰상세추가 -->
  499. <?
  500. }else {
  501. ?>
  502. <div class="bidding_board" <? if($col1[nm_price_max]>0) { ?> ty2<? } ?>>
  503. <dl>
  504. <dt>입찰 진행 중</dt>
  505. <dd><strong><?=$col1[cnt]?></strong>명의 딜러가 입찰하였습니다.</dd>
  506. </dl>
  507. <?
  508. if($col1[nm_price_max]>0) {
  509. ?>
  510. <p>나의 입찰가는 <strong><?=$col1[nm_price_max]?></strong>만원입니다.</p>
  511. <?
  512. }
  513. ?>
  514. </div>
  515. <?
  516. //select count(*) cnt_tender, sum(case when cd_dealer = '55' then 1 else 0 end) cnt_tender_dealer from tender_master where ds_delind ='N' and cd_sale = '73' and cd_dealer_p = '52'
  517. // $cd_tender = @mysql_result(mysql_query("select cd_tender from tender_master where ds_delind ='N' and cd_sale = '$cd_sale' and cd_dealer = '$s_cd_dealer' "),0,0);
  518. $cd_tender = mysql_fetch_array(mysql_query("select count(*) cnt_tender, sum(case when cd_dealer = '$s_cd_dealer' then 1 else 0 end) cnt_tender_dealer from tender_master where ds_delind ='N' and cd_sale = '$cd_sale' and cd_dealer_p = '$s_cd_dealer_p' "));
  519. //입찰하기 : 입찰대기건/부관리자/현재미입찰건(부관리자본인)
  520. // if($rq_ds_status == "E0" && $s_ds_type == "D1" && empty($cd_tender) && $time_limit_tender != "0분"){ //딜러-관리자
  521. //입찰하기 : 입찰대기건/부관리자/소속딜러입찰건1건이하일경우만(2건이상일경우제한)/현재미입찰건(부관리자본인)/소속총괄관리자 관리자에게 승인 받은 경우
  522. if($rq_ds_status == "E0" && $s_ds_type == "D1" && ($cd_tender[cnt_tender] < 2 && $cd_tender[cnt_tender_dealer] == 0) && $time_limit_tender != "0분" && $s_ds_status_p == "Z0"){ //딜러-관리자
  523. ?>
  524. <div class="btn_center">
  525. <a href="#" class="button" onclick="openLayer('price'); return false;">입찰하기</a>
  526. </div>
  527. <!-- layer_popup -->
  528. <div class="layer_popup price_popup">
  529. <div class="popup_wrap">
  530. <p class="msg">
  531. 내 입찰금액은<br><input type="text" class="inp_txt" style="width:100%;" name="nm_price_pop" id="nm_price_pop"><br>만원입니다.
  532. <span class="sub_txt">(※ 입력 예시 : 1500만원일 경우 1500입력, 500만원일 경우 500입력)</span>
  533. </p>
  534. <div class="btn_center">
  535. <a href="#" class="button" id="btn_write">입찰하기</a>
  536. </div>
  537. <!-- p class="msg2"><em>내 입찰금액은</em><strong>2,500</strong>만원입니다.</p>
  538. <div class="btn_center">
  539. <a href="#" class="button">확인</a>
  540. <a href="#" class="button gray" onclick="closeLayer('price'); return false;">취소</a>
  541. </div -->
  542. </div>
  543. <div class="close">레이어팝업 닫기</div>
  544. </div>
  545. <? } ?>
  546. <!-- // layer_popup -->
  547. <?
  548. //입찰금액 수정은 딱히 정해 진게 없어서 정의 후 작업
  549. /*
  550. * 딜러가 입찰한 내역이 있어야 하고
  551. * 현재 sale 상태가 입찰대기(E0)여야 하며
  552. * 수정 내역이 3번까지만 가능
  553. * 낙찰 마감일이 안지나야 가능
  554. */
  555. $cd_tender_sql = "select cd_tender, nm_modify_cnt
  556. , (select ds_status from sale_master s where s.cd_sale = t.cd_sale) as sale_ds_status
  557. from tender_master t
  558. where t.ds_delind ='N'
  559. and t.cd_sale = '$cd_sale'
  560. and t.cd_dealer_p = '$s_cd_dealer_p'
  561. limit 1";
  562. // echo $cd_tender_sql;
  563. $cd_tender = mysql_fetch_array(mysql_query($cd_tender_sql));
  564. if($rq_ds_status == "F0" && $s_ds_type == "D1" && $cd_tender[sale_ds_status] == 'E0' && !empty($cd_tender[cd_tender]) && $cd_tender[nm_modify_cnt] < 3 && $time_limit_tender != "0분" && $s_ds_status_p == "Z0"){ //딜러-관리자
  565. ?>
  566. <style>
  567. .price_popup{text-align:center;}
  568. .price_popup .msg{padding:15px 10px 0;line-height:30px;}
  569. .price_popup .msg .inp_txt{font-size:18px;color:#000;text-align:center;}
  570. .price_popup .msg strong{font-size:30px;color:#0496bb;}
  571. .price_popup .msg .sub_txt{display:block;font-size:9px;color:#b30303;}
  572. .price_popup .msg2{padding-top:20px;line-height:30px;text-align:center;}
  573. .price_popup .msg2 em{display:block;font-size:15px;}
  574. .price_popup .msg2 strong{font-size:21px;color:#0496bb;vertical-align:bottom;}
  575. .price_popup .btn_center{margin-top:10px;}
  576. .price_popup .msg2 + .btn_center{margin-top:20px;}
  577. </style>
  578. <div class="btn_center">
  579. <a href="#" class="button" onclick="openLayer('price'); return false;">가격수정</a>
  580. </div>
  581. <!-- layer_popup -->
  582. <div class="layer_popup price_popup">
  583. <div class="popup_wrap">
  584. <p class="msg">
  585. 내 입찰금액은<br><input type="text" class="inp_txt" style="width:100%;" name="mod_nm_price_pop" id="mod_nm_price_pop"><br>만원입니다.
  586. <span class="sub_txt">(※ 입력 예시 : 1500만원일 경우 1500입력, 500만원일 경우 500입력)</span>
  587. </p>
  588. <div class="btn_center">
  589. <a href="#" class="button" id="btn_mod_write">수정하기</a>
  590. </div>
  591. <!-- p class="msg2"><em>내 입찰금액은</em><strong>2,500</strong>만원입니다.</p>
  592. <div class="btn_center">
  593. <a href="#" class="button">확인</a>
  594. <a href="#" class="button gray" onclick="closeLayer('price'); return false;">취소</a>
  595. </div -->
  596. </div>
  597. <div class="close">레이어팝업 닫기</div>
  598. </div>
  599. <? } ?>
  600. <form id="frmForm" name="frmForm" method="post" action="./dealer_proc.php">
  601. <input type="hidden" name="mode" id="mode" value="Tender"/>
  602. <input type="hidden" name="cd_sale" id="cd_sale" value="<?=$cd_sale?>"/>
  603. <input type="hidden" name="nm_price" id="nm_price"/>
  604. <input type="hidden" name="ListPageNo" value="<?=$ListPageNo?>"/>
  605. </form>
  606. <script language="javascript" type="text/javascript">
  607. var ds_mode ="<?=$mode?>";
  608. $(document).ready(function() {
  609. $("#btn_write").bind("click",function(){
  610. var fieldlist = [["nm_price_pop","입찰금액"]]
  611. if (!fnCheckForm(fieldlist)){
  612. return false;
  613. }
  614. $("#nm_price").val($("#nm_price_pop").val());
  615. var c = confirm("처리하시겠습니까?");
  616. if(c){
  617. $("#frmForm").submit();
  618. }else{
  619. return false;
  620. }
  621. });
  622. $("#btn_mod_write").bind("click",function(){
  623. var fieldlist = [["mod_nm_price_pop","입찰 수정금액"]]
  624. if (!fnCheckForm(fieldlist)){
  625. return false;
  626. }
  627. $("#nm_price").val($("#mod_nm_price_pop").val());
  628. var c = confirm("처리하시겠습니까?");
  629. if(c){
  630. $("#mode").val("TenderModify");
  631. $("#frmForm").submit();
  632. }else{
  633. return false;
  634. }
  635. });
  636. });
  637. </script>
  638. <?
  639. }
  640. ?>
  641. <!-- layer popup3 -->
  642. <div class="layer_popup photo_popup">
  643. <div class="popup_wrap">
  644. <img src="/img/sell/ic_car_photo1.png" id="photoBig">
  645. </div>
  646. <div class="close" onclick="closeLayer('photo');">레이어팝업 닫기</div>
  647. </div>
  648. <!-- // layer popup3 -->
  649. </div>
  650. <script laguage="javascript" type="text/javascript">
  651. $('.photo_list li').on('click',function(){
  652. $(".SumoGallery").find('.Sbody img').panzoom({
  653. minScale: 0.7,
  654. maxScale: 3,
  655. exponential: true,
  656. // 기본적으로 패닝 끔
  657. disablePan: true
  658. }).on("panzoomzoom", function(e, panzoom, scale, opts) {
  659. // 확대/축소 동작시 패닝 켬
  660. panzoom.options.disablePan = false;
  661. }).on("panzoomend", function(e, panzoom, matrix, changed) {
  662. // 제스처가 끝난 시점에
  663. // 1. scale이 1보다 작음
  664. // 2. 변화가 없었고 더블 탭으로 판명
  665. // 1 혹은 2번을 만족하면 리셋한다. (scale을 1로, pan을 제자리로)
  666. if (panzoom.scale <= 1 || (!changed && +new Date() - prevTapTime < 300)) {
  667. panzoom.reset();
  668. panzoom.options.disablePan = true;
  669. }
  670. prevTapTime = +new Date();
  671. }).on("panzoomend", function(e, panzoom, matrix, changed) {
  672. var rect = panzoom.$elem.find("img").get(0).getBoundingClientRect();
  673. var diffW = Math.max(rect.width - $root.width(), 0);
  674. var diffH = Math.max(rect.height - $root.height(), 0);
  675. var maxX = diffW / 2;
  676. var minX = -maxX;
  677. var maxY = diffH / 2;
  678. var minY = -maxY;
  679. var x = parseFloat(matrix[4]);
  680. var y = parseFloat(matrix[5]);
  681. // 확대된 상태에서 패닝시 이미지가 뷰포트를 벗어나지 못하게 한다.
  682. if (panzoom.scale > 1) {
  683. x = Math.max(minX, Math.min(x, maxX));
  684. y = Math.max(minY, Math.min(y, maxY));
  685. panzoom.pan(x, y, {
  686. animate: true,
  687. silent: true
  688. });
  689. }
  690. })
  691. })
  692. function viewPhoto(arg1){
  693. $("#photoBig").attr("src", arg1);
  694. openLayer('photo');
  695. return false;
  696. }
  697. </script>
  698. </section>
  699. </section>
  700. <!-- e : container -->
  701. <!-- s : footer -->
  702. <? include("../inc/inc_footer.html"); ?>
  703. <!-- // e : footer -->
  704. <script type="text/javascript" charset="utf-8" src="/m/js/jquery.sumogallery.js"></script>
  705. </body>
  706. </html>
  707. <?
  708. mysql_close($connect);
  709. ?>