aap_view4.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].ADMIN_PATH.'common/auth_chk.php';
  4. $mp = "21"; //set top nav
  5. $s_cd_dealer = $_REQUEST["cd_dealer"];
  6. $s_cd_dealer_p = $s_cd_dealer;
  7. $PageNo = $_REQUEST['pageno'];
  8. $PageSize = $_REQUEST['PageSize'];
  9. if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
  10. if (empty($PageSize)) {
  11. $PageSize=8; //목록개수설정
  12. }else{$PageSize=$PageSize;}
  13. $pagestartpoint=($PageNo-1)*$PageSize;
  14. $sql = "where s.ds_delind='N'";
  15. $orderby = "order by s.dt_insert desc";
  16. $searchtype = $_REQUEST['searchtype'];
  17. $searchword = $_REQUEST['searchword'];
  18. $ds_usertype = $_REQUEST['ds_usertype'];
  19. $ds_status = $_REQUEST['ds_status'];
  20. $ds_type = "A0"; //A0 : 매입
  21. $sql_from = "";
  22. $sql = $sql. " and s.ds_type = '$ds_type' ";
  23. $sql1 = " and cd_dealer_p = '$s_cd_dealer' ";
  24. if($searchword != ""){
  25. if($searchtype=="" || $searchtype==null){
  26. $sql = $sql. " and (s.nm_name like '$searchword%' or a.nm_number like '$searchword%') ";
  27. }else{
  28. $sql = $sql. " and $searchtype like '$searchword%'";
  29. }
  30. }
  31. if($ds_usertype != ""){
  32. $sql = $sql. " and s.ds_usertype = '$ds_usertype'";
  33. }
  34. $sql_from = $sql_from. " inner join ( ";
  35. $sql_from = $sql_from. " select cd_sale from tender_master where ds_delind = 'N' ".$sql1." group by cd_sale) i ";
  36. $sql_from = $sql_from. " on (s.cd_sale = i.cd_sale) ";
  37. // $sql = $sql. " and s.cd_sale in (select cd_sale from tender_master where ds_delind = 'N' ".$sql1." group by cd_sale)";
  38. $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);
  39. ?>
  40. <? include("../inc/inc_top.php") ?>
  41. <? include("../inc/inc_header.php") ?>
  42. <section id="contents">
  43. <h2>딜러 / AAP 회원관리</h2>
  44. <? include("../inc/inc_header_aap.php") ?>
  45. <!--div class="select_view_type">
  46. <span class="select" style="width:160px;">
  47. <select>
  48. <option value="">10개 보기</option>
  49. <option value="">20개 보기</option>
  50. <option value="">30개 보기</option>
  51. </select>
  52. </span>
  53. </div-->
  54. <div class="tbl_wrap">
  55. <table class="tbl_list ty2">
  56. <colgroup>
  57. <col width="7%">
  58. <col width="11%">
  59. <col width="*">
  60. <col width="9%">
  61. <col width="11%">
  62. <col width="8%">
  63. <col width="8%">
  64. <col width="9%">
  65. <col width="9%">
  66. <col width="13%">
  67. </colgroup>
  68. <thead>
  69. <tr>
  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. <th>등록일</th>
  80. </tr>
  81. </thead>
  82. <?
  83. if($totalrows>0) {
  84. $r = mysql_query("SELECT
  85. a.*
  86. , b.nm_model
  87. , c.nm_grade
  88. , d.nm_brand
  89. , e.nm_model_sub
  90. , getCode('car_master','ds_type',a.ds_type) as nm_type
  91. , getCode('car_master','ds_open',a.ds_open) as nm_open
  92. , getCode('car_master','ds_sales',a.ds_sales) as nm_sales
  93. , getCode('car_master','ds_transmission',a.ds_transmission) as nm_transmission
  94. , getCode('member_master','ds_area',s.ds_area) as nm_area
  95. , getCode('sale_master','ds_status',s.ds_status) as nm_status
  96. , s.cd_sale
  97. , s.nm_name nm_name_sale
  98. , s.ds_status ds_status_sale
  99. , 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
  100. FROM sale_master s
  101. inner join car_master a
  102. on (s.cd_car = a.cd_car)
  103. left outer join car_model b
  104. on (a.cd_model = b.cd_model)
  105. left outer join car_grade c
  106. on (a.cd_grade = c.cd_grade)
  107. left outer join car_brand d
  108. on (a.cd_brand = d.cd_brand)
  109. left outer join car_model_sub e
  110. on (a.cd_model_sub = e.cd_model_sub)
  111. $sql_from $sql $orderby LIMIT $pagestartpoint,$PageSize");
  112. $i=1;
  113. while($col = mysql_fetch_array($r)) {
  114. $tmpNum =$totalrows-($PageSize*($PageNo-1));
  115. $no = ($tmpNum - $i)+1;
  116. ?>
  117. <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;">
  118. <td><?=$no?></td>
  119. <td><?=$col['nm_name_sale']?></td>
  120. <td><?=$col['nm_brand']." ".$col['nm_model']?></td>
  121. <td><?=$col['nm_number']?></td>
  122. <td><?=$col['nm_mileage']?>km</td>
  123. <td><?=$col['nm_color']?></td>
  124. <td><?=$col['nm_transmission']?></td>
  125. <td><?=$col['nm_area']?></td>
  126. <td><em class="txt_bold"><?=$col['nm_status']?></em></td>
  127. <td><?=$col['dt_insert']?></td>
  128. </tr>
  129. <?
  130. $i++;
  131. }
  132. }else{
  133. ?>
  134. <tr>
  135. <td colspan="10">등록된 정보가 없습니다.</td>
  136. </tr>
  137. <?
  138. }
  139. ?>
  140. </table>
  141. </div>
  142. <div class="paging">
  143. <?php
  144. $url = "./dealer_view4.php?searchtype=$searchtype&searchword=$searchword&ds_status=$ds_status&ds_usertype=$ds_usertype&cd_dealer=$s_cd_dealer";
  145. ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  146. ?>
  147. </div>
  148. </section>
  149. <? include("../inc/inc_footer.php") ?>
  150. <? include("../inc/inc_bottom.php") ?>
  151. <?
  152. mysql_close($connect);
  153. ?>