aap_view.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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. $cd_dealer_p = $_REQUEST["cd_dealer"];
  6. ?>
  7. <? include("../inc/inc_top.php") ?>
  8. <? include("../inc/inc_header.php") ?>
  9. <section id="contents">
  10. <h2>딜러 / AAP 회원관리</h2>
  11. <? include("../inc/inc_header_aap.php") ?>
  12. <div class="area_title">
  13. <h3><em>▶</em> 부관리자 리스트</h3>
  14. <a href="aap_view3.php?cd_dealer=<?=$cd_dealer?>" class="rnd_btn ty4 gray">+ 더보기</a>
  15. </div>
  16. <div class="tbl_wrap">
  17. <table class="tbl_list">
  18. <colgroup>
  19. <col width="7%">
  20. <col width="24%">
  21. <col width="24%">
  22. <col width="*">
  23. <col width="15%">
  24. </colgroup>
  25. <thead>
  26. <tr>
  27. <th>번호</th>
  28. <th>아이디</th>
  29. <th>이름</th>
  30. <th>연락처</th>
  31. <th>등록일</th>
  32. </tr>
  33. </thead>
  34. <?
  35. $PageSize=5; //목록개수설정
  36. $pagestartpoint=0;
  37. $sql_base = "WHERE ds_delind='N'";
  38. $ds_type = "D1";
  39. $sql = $sql_base. " and ds_type = '$ds_type' ";
  40. $sql = $sql. " and cd_dealer_p = '$cd_dealer_p' ";
  41. $r = mysql_query("SELECT * FROM aap_master $sql ORDER BY cd_dealer desc LIMIT $pagestartpoint,$PageSize");
  42. $i=1;
  43. while($col = mysql_fetch_array($r)) {
  44. ?>
  45. <tr onclick="location.href='./aap_view3_detail.php?cd_dealer=<?=$col['cd_dealer']?>&cd_dealer_p=<?=$col['cd_dealer_p']?>&PageNo=<?=$PageNo?>';" style="cursor: pointer; cursor: hand;">
  46. <td><?=$i?></td>
  47. <td><?=$col['cd_dealerid']?></td>
  48. <td><?=$col['nm_name']?></td>
  49. <td><?=$col['nm_hp_01']."-".$col['nm_hp_02']."-".$col['nm_hp_03']?></td>
  50. <td><?=$col['dt_insert']?></td>
  51. </tr>
  52. <?
  53. $i++;
  54. }
  55. ?>
  56. </table>
  57. </div>
  58. <div class="area_title">
  59. <h3><em>▶</em> 입찰요청 리스트</h3>
  60. <a href="aap_view4.php?cd_dealer=<?=$cd_dealer?>" class="rnd_btn ty4 gray">+ 더보기</a>
  61. </div>
  62. <div class="tbl_wrap">
  63. <table class="tbl_list ty2">
  64. <colgroup>
  65. <col width="7%">
  66. <col width="15%">
  67. <col width="11%">
  68. <col width="*">
  69. <col width="12%">
  70. <col width="10%">
  71. <col width="12%">
  72. <col width="15%">
  73. </colgroup>
  74. <thead>
  75. <tr>
  76. <th>번호</th>
  77. <th>판매자</th>
  78. <th>지역</th>
  79. <th>차종</th>
  80. <th>주행거리</th>
  81. <th>년식</th>
  82. <th>등록일</th>
  83. <th>입찰 마감시간</th>
  84. </tr>
  85. </thead>
  86. <?
  87. $sql = "where s.ds_delind='N'";
  88. $ds_type = "A0"; //A0 : 매입
  89. $sql = $sql. " and s.ds_type = '$ds_type' ";
  90. $sql = $sql. " and s.ds_area in (
  91. select
  92. SUBSTRING_INDEX (SUBSTRING_INDEX(nm_area,',',numbers.n),',',-1)
  93. from
  94. (select 1 n union all select 2
  95. union all select 3 union all select 4
  96. union all select 5 union all select 6
  97. union all select 7 union all select 8
  98. union all select 9 union all select 10
  99. union all select 11 union all select 12
  100. union all select 13 union all select 14
  101. union all select 15 union all select 16
  102. union all select 17 union all select 18
  103. union all select 19 union all select 20
  104. ) numbers INNER JOIN aap_master
  105. on CHAR_LENGTH ( nm_area ) - CHAR_LENGTH ( REPLACE ( nm_area , ',' , '' ))>= numbers . n-1
  106. where cd_dealer = $cd_dealer_p
  107. ) ";
  108. $sql1 = " and cd_dealer_p = '$cd_dealer_p' ";
  109. $sql = $sql. " and s.ds_status in ('E0','F0')";
  110. $sql = $sql. " and s.cd_sale not in (select cd_sale from tender_master where ds_delind = 'N' and cd_dealer_p = '$cd_dealer_p' group by cd_sale)";
  111. $r = mysql_query("SELECT
  112. a.*
  113. , b.nm_model
  114. , d.nm_brand
  115. , getCode('car_master','ds_type',a.ds_type) as nm_type
  116. , getCode('car_master','ds_open',a.ds_open) as nm_open
  117. , getCode('car_master','ds_sales',a.ds_sales) as nm_sales
  118. , getCode('car_master','ds_transmission',a.ds_transmission) as nm_transmission
  119. , getCode('member_master','ds_area',s.ds_area) as nm_area
  120. , getCode('sale_master','ds_status',s.ds_status) as nm_status
  121. , s.cd_sale
  122. , s.nm_name nm_name_sale
  123. , s.ds_status ds_status_sale
  124. , 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
  125. , case when a.nm_act_yn in ('Y') then '유' else '무' end as nm_act_yn_name
  126. FROM sale_master s
  127. inner join car_master a on (s.cd_car = a.cd_car)
  128. left outer join car_model b on (a.cd_model = b.cd_model)
  129. left outer join car_brand d on (a.cd_brand = d.cd_brand)
  130. $sql $orderby LIMIT $pagestartpoint,$PageSize");
  131. $i=1;
  132. while($col = mysql_fetch_array($r)) {
  133. ?>
  134. <tr onclick="location.href='./aap_view4_detail.php?list_url=<?=$list_url?>&cd_sale=<?=$col['cd_sale']?>&cd_dealer=<?=$cd_dealer_p?>&ds_status_sale=<?=$col['ds_status_sale']?>&ListPageNo=<?=$PageNo?>';" style="cursor: pointer; cursor: hand;">
  135. <td><?=$i?></td>
  136. <td><?=$col['nm_name_sale']?></td>
  137. <td><?=$col['nm_area']?></td>
  138. <td><?=$col['nm_brand']." ".$col['nm_model']?></td>
  139. <td><?=$col['nm_mileage']?>km</td>
  140. <td><?=$col['ds_year']?></td>
  141. <td><?=$col['dt_insert']?></td>
  142. <td><em class="txt_bold"><?//=$col[nm_status]?></em></td>
  143. </tr>
  144. <?
  145. $i++;
  146. }
  147. ?>
  148. </table>
  149. </div>
  150. <div class="area_title">
  151. <h3><em>▶</em> 입찰중 리스트</h3>
  152. <a href="aap_view4.php?cd_dealer=<?=$cd_dealer?>" class="rnd_btn ty4 gray">+ 더보기</a>
  153. </div>
  154. <div class="tbl_wrap">
  155. <table class="tbl_list ty2">
  156. <colgroup>
  157. <col width="7%">
  158. <col width="15%">
  159. <col width="11%">
  160. <col width="*">
  161. <col width="12%">
  162. <col width="10%">
  163. <col width="12%">
  164. <col width="15%">
  165. </colgroup>
  166. <thead>
  167. <tr>
  168. <th>번호</th>
  169. <th>판매자</th>
  170. <th>지역</th>
  171. <th>차종</th>
  172. <th>주행거리</th>
  173. <th>년식</th>
  174. <th>등록일</th>
  175. <th>상태</th>
  176. </tr>
  177. </thead>
  178. <?
  179. $sql = "where s.ds_delind='N'";
  180. $ds_type = "A0"; //A0 : 매입
  181. $sql = $sql. " and s.ds_type = '$ds_type' ";
  182. $sql1 = " and cd_dealer_p = '$cd_dealer_p' ";
  183. $sql = $sql. " and s.ds_status in ('E0','F0')";
  184. // $sql = $sql. " and s.cd_sale in (select cd_sale from tender_master where ds_delind = 'N' ".$sql1." group by cd_sale)"; //20191001이전 지연 쿼리
  185. $sql = $sql. " and exists(select cd_sale from tender_master where cd_sale = s.cd_sale and ds_delind = 'N' ".$sql1." )"; //20191001 cd_sale_cd_user_cd_dealer index 설정 후 쿼리 변경
  186. $r = mysql_query("SELECT
  187. a.*
  188. , b.nm_model
  189. , d.nm_brand
  190. , getCode('car_master','ds_type',a.ds_type) as nm_type
  191. , getCode('car_master','ds_open',a.ds_open) as nm_open
  192. , getCode('car_master','ds_sales',a.ds_sales) as nm_sales
  193. , getCode('car_master','ds_transmission',a.ds_transmission) as nm_transmission
  194. , getCode('member_master','ds_area',s.ds_area) as nm_area
  195. , getCode('sale_master','ds_status',s.ds_status) as nm_status
  196. , s.cd_sale
  197. , s.nm_name nm_name_sale
  198. , s.ds_status ds_status_sale
  199. , 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
  200. , case when a.nm_act_yn in ('Y') then '유' else '무' end as nm_act_yn_name
  201. FROM sale_master s
  202. inner join car_master a on (s.cd_car = a.cd_car)
  203. left outer join car_model b on (a.cd_model = b.cd_model)
  204. left outer join car_brand d on (a.cd_brand = d.cd_brand)
  205. $sql $orderby LIMIT $pagestartpoint,$PageSize");
  206. $i=1;
  207. while($col = mysql_fetch_array($r)) {
  208. ?>
  209. <tr onclick="location.href='./aap_view4_detail.php?list_url=<?=$list_url?>&cd_sale=<?=$col['cd_sale']?>&cd_dealer=<?=$cd_dealer_p?>&ds_status_sale=<?=$col['ds_status_sale']?>&ListPageNo=<?=$PageNo?>';" style="cursor: pointer; cursor: hand;">
  210. <td><?=$i?></td>
  211. <td><?=$col['nm_name_sale']?></td>
  212. <td><?=$col['nm_area']?></td>
  213. <td><?=$col['nm_brand']." ".$col['nm_model']?></td>
  214. <td><?=$col['nm_mileage']?>km</td>
  215. <td><?=$col['ds_year']?></td>
  216. <td><?=$col['dt_insert']?></td>
  217. <td><em class="txt_bold"><?=$col['nm_status_sale']?></em></td>
  218. </tr>
  219. <?
  220. $i++;
  221. }
  222. ?>
  223. </table>
  224. </div>
  225. </section>
  226. <? include("../inc/inc_footer.php") ?>
  227. <? include("../inc/inc_bottom.php") ?>
  228. <?
  229. mysql_close($connect);
  230. ?>