sell_list.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].'/common/auth_chk.php';
  4. $list_url = "sell_list.php";
  5. $cd_user = $_SESSION['s_cd_user'];
  6. $PageNo = $_REQUEST['pageno'];
  7. $PageSize = $_REQUEST['PageSize'];
  8. if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
  9. if (empty($PageSize)) {
  10. $PageSize=8; //목록개수설정
  11. }else{$PageSize=$PageSize;}
  12. $pagestartpoint=($PageNo-1)*$PageSize;
  13. $sql = "where s.ds_delind='N'";
  14. $sql = $sql. " and s.cd_user='$cd_user' ";
  15. $searchtype = $_REQUEST['searchtype'];
  16. $searchword = $_REQUEST['searchword'];
  17. $ds_usertype = $_REQUEST['ds_usertype'];
  18. $ds_status = 'Z0';
  19. $ds_type = "A0"; //A0 : 매입
  20. $sql = $sql. " and s.ds_type = '$ds_type' ";
  21. if($searchword != ""){
  22. if($searchtype=="" || $searchtype==null){
  23. $sql = $sql. " and (s.nm_name like '$searchword%' or a.nm_number like '$searchword%') ";
  24. }else{
  25. $sql = $sql. " and $searchtype like '$searchword%'";
  26. }
  27. }
  28. if($ds_usertype != ""){
  29. $sql = $sql. " and s.ds_usertype = '$ds_usertype'";
  30. }
  31. $sql = $sql. " and s.ds_status in ('B0','C0','D0','E0','F0','G0','Z0','ZE','ZS')";
  32. $orderby = " order by s.cd_sale desc ";
  33. $totalrows = @mysql_result(mysql_query("select count(*) from sale_master s inner join car_master a on ( s.cd_car = a.cd_car ) $sql"),0,0);
  34. ?>
  35. <? include("../include/inc_top.php") ?>
  36. <? include("../include/inc_header.php") ?>
  37. <section id="wrap">
  38. <section id="visual" class="visual_mypage">
  39. <h2>마이페이지</h2>
  40. <p>쉽고 간편한 내차팔기, 견적산출, 최종 매각까지 어떤 수수료도 요구하지 않습니다.</p>
  41. </section>
  42. <section id="content">
  43. <?
  44. // /common/lib/func.php 1662에 정의됨
  45. $is_upro_member = getUproMember($_SESSION['s_cd_user']);
  46. $depth_info = array("NAME" => array("입찰정보", "전체 입찰내역"));
  47. if($is_upro_member) {
  48. include_once($_SERVER['DOCUMENT_ROOT']."/mypage/inc_menu_member_company.php");
  49. }else {
  50. include_once($_SERVER['DOCUMENT_ROOT']."/mypage/inc_menu_main_member.php");
  51. }
  52. ?>
  53. <? if($ds_kind=="D"){?>
  54. <? //include("./inc_menu_member_company.php") ?>
  55. <?}else{?>
  56. <? //include("./inc_menu_main_member.php") ?>
  57. <?}?>
  58. <h3>전체 입찰내역</h3>
  59. <table class="tbl_v">
  60. <colgroup>
  61. <col width="7%">
  62. <col width="*">
  63. <col width="10%">
  64. <col width="10%">
  65. <col width="10%">
  66. <col width="15%">
  67. <col width="15%">
  68. </colgroup>
  69. <thead>
  70. <tr>
  71. <th>번호</th>
  72. <th>차종</th>
  73. <th>차량번호</th>
  74. <th>년식</th>
  75. <th>지역</th>
  76. <th>판매일</th>
  77. <th>처리상태</th>
  78. </tr>
  79. </thead>
  80. <tbody>
  81. <?
  82. if($totalrows>0) {
  83. $r = mysql_query("SELECT
  84. a.*
  85. , b.nm_model
  86. , c.nm_grade
  87. , d.nm_brand
  88. , e.nm_model_sub
  89. , getCode('car_master','ds_type',a.ds_type) as nm_type
  90. , getCode('car_master','ds_open',a.ds_open) as nm_open
  91. , getCode('car_master','ds_sales',a.ds_sales) as nm_sales
  92. , getCode('car_master','ds_transmission',a.ds_transmission) as nm_transmission
  93. , getCode('member_master','ds_area',s.ds_area) as nm_area
  94. , getCode('sale_master','ds_status',s.ds_status) as nm_status
  95. , s.cd_sale
  96. , s.nm_name nm_name_sale
  97. , s.ds_status ds_status_sale
  98. , case when s.ds_status in ('B0','C0') then '미승인' when s.ds_status in ('D0') then '반려' when s.ds_status in ('E0','F0') then '입찰중' when s.ds_status in ('G0') then '입찰마감' when s.ds_status in ('Z0') and s.ds_status_contract in ('B0') then '거래연기' when s.ds_status in ('Z0') and s.ds_status_contract in ('C0') then '거래실패' when s.ds_status in ('Z0') then '낙찰' when s.ds_status in ('ZE') then '거래실수' when s.ds_status in ('ZS') then '구매확정' else '' end as nm_status_sale
  99. , case when a.nm_act_yn in ('Y') then '유' else '무' end as nm_act_yn_name
  100. , getRemainTime(".LIMIT_TIME_SELL.", s.dt_approve, now()) as time_limit_sell
  101. FROM sale_master s
  102. inner join car_master a
  103. on (s.cd_car = a.cd_car)
  104. left outer join car_model b
  105. on (a.cd_model = b.cd_model)
  106. left outer join car_grade c
  107. on (a.cd_grade = c.cd_grade)
  108. left outer join car_brand d
  109. on (a.cd_brand = d.cd_brand)
  110. left outer join car_model_sub e
  111. on (a.cd_model_sub = e.cd_model_sub)
  112. $sql $orderby LIMIT $pagestartpoint,$PageSize");
  113. $i=1;
  114. while($col = mysql_fetch_array($r)) {
  115. $tmpNum =$totalrows-($PageSize*($PageNo-1));
  116. $no = ($tmpNum - $i)+1;
  117. ?>
  118. <tr onclick="location.href='./<? if($col[ds_status_sale]=="ZS"){ ?>sell_view2.php<? }else{ ?>sell_view.php<? } ?>?list_url=<?=$list_url?>&cd_sale=<?=$col[cd_sale]?>&ds_status_sale=<?=$col[ds_status_sale]?>&ListPageNo=<?=$PageNo?>';" style="cursor:pointer;">
  119. <td><?=$no?></td>
  120. <td><?=$col[nm_brand]." ".$col[nm_model]?></td>
  121. <td><?=$col[nm_number]?></td>
  122. <td><?=$col[ds_year]?>년</td>
  123. <td><?=$col[nm_area]?></td>
  124. <td><?=$col[dt_insert]?></td>
  125. <td>
  126. <? if($col[time_limit_sell]=="0분" && ($col[ds_status_sale] == "E0" || $col[ds_status_sale] == "F0")){ ?>
  127. 거래마감
  128. <? }else{ ?>
  129. <?=$col[nm_status_sale]?>
  130. <? } ?>
  131. </td>
  132. </tr>
  133. <?
  134. $i++;
  135. }
  136. }else{
  137. ?>
  138. <tr>
  139. <td colspan="6">등록된 정보가 없습니다.</td>
  140. </tr>
  141. <?
  142. }
  143. ?>
  144. </tbody>
  145. </table>
  146. <div class="paging">
  147. <?
  148. $url = "./sell_list.php?searchtype=$searchtype&searchword=$searchword&ds_status=$ds_status&ds_usertype=$ds_usertype";
  149. ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  150. ?>
  151. </div>
  152. <div class="btn_right">
  153. <a href="/sell/sell.php" class="button">내차팔기</a>
  154. </div>
  155. </section>
  156. </section>
  157. <? include("../include/inc_footer.php") ?>
  158. <? include("../include/inc_bottom.php") ?>
  159. <?
  160. mysql_close($connect);
  161. ?>