dealer_view.php 8.9 KB

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