dealer_view4.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].ADMIN_PATH.'common/auth_chk.php';
  4. $s_cd_dealer = $_REQUEST["cd_dealer"];
  5. $s_cd_dealer_p = $s_cd_dealer;
  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. $orderby = "order by s.dt_insert desc";
  15. $searchtype = $_REQUEST['searchtype'];
  16. $searchword = $_REQUEST['searchword'];
  17. $ds_usertype = $_REQUEST['ds_usertype'];
  18. $ds_status = $_REQUEST['ds_status'];
  19. $ds_type = "A0"; //A0 : 매입
  20. $sql_from = "";
  21. $sql = $sql. " and s.ds_type = '$ds_type' ";
  22. $sql1 = " and cd_dealer_p = '$s_cd_dealer' ";
  23. if($searchword != ""){
  24. if($searchtype=="" || $searchtype==null){
  25. $sql = $sql. " and (s.nm_name like '$searchword%' or a.nm_number like '$searchword%') ";
  26. }else{
  27. $sql = $sql. " and $searchtype like '$searchword%'";
  28. }
  29. }
  30. if($ds_usertype != ""){
  31. $sql = $sql. " and s.ds_usertype = '$ds_usertype'";
  32. }
  33. $sql_from = $sql_from. " inner join ( ";
  34. $sql_from = $sql_from. " select cd_sale from tender_master where ds_delind = 'N' ".$sql1." group by cd_sale) i ";
  35. $sql_from = $sql_from. " on (s.cd_sale = i.cd_sale) ";
  36. // $sql = $sql. " and s.cd_sale in (select cd_sale from tender_master where ds_delind = 'N' ".$sql1." group by cd_sale)";
  37. $totalrows = @mysql_result(mysql_query("select count(*) from sale_master s inner join car_master a on ( s.cd_car = a.cd_car ) $sql_from $sql"),0,0);
  38. ?>
  39. <? include("../inc/inc_top.php") ?>
  40. <? include("../inc/inc_header.php") ?>
  41. <section id="contents">
  42. <h2>딜러 회원관리</h2>
  43. <? include("../inc/inc_header_dealer.php") ?>
  44. <!--div class="select_view_type">
  45. <span class="select" style="width:160px;">
  46. <select>
  47. <option value="">10개 보기</option>
  48. <option value="">20개 보기</option>
  49. <option value="">30개 보기</option>
  50. </select>
  51. </span>
  52. </div-->
  53. <div class="tbl_wrap">
  54. <table class="tbl_list ty2">
  55. <colgroup>
  56. <col width="7%">
  57. <col width="11%">
  58. <col width="*">
  59. <col width="9%">
  60. <col width="11%">
  61. <col width="8%">
  62. <col width="8%">
  63. <col width="9%">
  64. <col width="9%">
  65. <col width="13%">
  66. </colgroup>
  67. <thead>
  68. <tr>
  69. <th>번호</th>
  70. <th>판매자</th>
  71. <th>차종</th>
  72. <th>차량번호</th>
  73. <th>주행거리</th>
  74. <th>색상</th>
  75. <th>변속기</th>
  76. <th>판매지역</th>
  77. <th>판매상태</th>
  78. <th>등록일</th>
  79. </tr>
  80. </thead>
  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') then '낙찰' when s.ds_status in ('ZS') then '구매확정' else '' end as nm_status_sale
  99. FROM sale_master s
  100. inner join car_master a
  101. on (s.cd_car = a.cd_car)
  102. left outer join car_model b
  103. on (a.cd_model = b.cd_model)
  104. left outer join car_grade c
  105. on (a.cd_grade = c.cd_grade)
  106. left outer join car_brand d
  107. on (a.cd_brand = d.cd_brand)
  108. left outer join car_model_sub e
  109. on (a.cd_model_sub = e.cd_model_sub)
  110. $sql_from $sql $orderby LIMIT $pagestartpoint,$PageSize");
  111. $i=1;
  112. while($col = mysql_fetch_array($r)) {
  113. $tmpNum =$totalrows-($PageSize*($PageNo-1));
  114. $no = ($tmpNum - $i)+1;
  115. ?>
  116. <tr onclick="location.href='./dealer_view4_detail.php?list_url=<?=$list_url?>&cd_sale=<?=$col['cd_sale']?>&cd_dealer=<?=$s_cd_dealer?>&ds_status_sale=<?=$col['ds_status_sale']?>&ListPageNo=<?=$PageNo?>';" style="cursor:pointer;">
  117. <td><?=$no?></td>
  118. <td><?=$col['nm_name_sale']?></td>
  119. <td><?=$col['nm_brand']." ".$col['nm_model']?></td>
  120. <td><?=$col['nm_number']?></td>
  121. <td><?=$col['nm_mileage']?>km</td>
  122. <td><?=$col['nm_color']?></td>
  123. <td><?=$col['nm_transmission']?></td>
  124. <td><?=$col['nm_area']?></td>
  125. <td><em class="txt_bold"><?=$col['nm_status']?></em></td>
  126. <td><?=$col['dt_insert']?></td>
  127. </tr>
  128. <?
  129. $i++;
  130. }
  131. }else{
  132. ?>
  133. <tr>
  134. <td colspan="10">등록된 정보가 없습니다.</td>
  135. </tr>
  136. <?
  137. }
  138. ?>
  139. </table>
  140. </div>
  141. <div class="paging">
  142. <?
  143. $url = "./dealer_view4.php?searchtype=$searchtype&searchword=$searchword&ds_status=$ds_status&ds_usertype=$ds_usertype&cd_dealer=$s_cd_dealer";
  144. ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  145. ?>
  146. </div>
  147. </section>
  148. <? include("../inc/inc_footer.php") ?>
  149. <? include("../inc/inc_bottom.php") ?>
  150. <?
  151. mysql_close($connect);
  152. ?>