buy_list0620.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].ADMIN_PATH.'common/auth_chk.php';
  4. $list_url = "buy_list.php";
  5. $mp = "30"; //set top nav
  6. $PageNo = $_REQUEST['pageno'];
  7. $PageSize = $_REQUEST['PageSize'];
  8. if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
  9. if (empty($PageSize)) {
  10. $PageSize=10; //목록개수설정
  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 = $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. if($ds_status != ""){
  32. if($ds_status == "Z0"){
  33. $sql = $sql. " and s.ds_status in ('E0','F0','G0','Z0')";
  34. }else{
  35. $sql = $sql. " and s.ds_status in ('B0','C0','D0')";
  36. }
  37. }
  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"),0,0);
  39. ?>
  40. <? include("../inc/inc_top.php") ?>
  41. <? include("../inc/inc_header.php") ?>
  42. <section id="contents">
  43. <h2>매입통합 리스트</h2>
  44. <form id="frmSearch" name="frmSearch" method="post">
  45. <input type="hidden" id="PageSize" name="PageSize">
  46. <input type="hidden" id="searchtype" name="searchtype">
  47. <table class="tbl_search">
  48. <colgroup>
  49. <col width="10%">
  50. <col width="38%">
  51. <col width="10%">
  52. <col width="*">
  53. </colgroup>
  54. <tr>
  55. <th>검색어</th>
  56. <td colspan="3">
  57. <span class="select2" style="margin-right:5px;width:100px;" id="sel_searchtype">
  58. <select>
  59. <option value="">전체</option>
  60. <option value="s.nm_name"<? if($searchtype =="nm_name"){?> selected<?}?>>판매자</option>
  61. <option value="a.nm_number"<? if($searchtype =="nm_number"){?> selected<?}?>>차량번호</option>
  62. </select>
  63. </span>
  64. <input type="text" id="searchword" name="searchword" class="inp_txt" style="width:60%;">
  65. </td>
  66. </tr>
  67. <tr>
  68. <th>회원구분</th>
  69. <td>
  70. <div class="radio_chk">
  71. <span class="check_wrap"><input type="radio" name="ds_usertype" id="radio1" value=""><i></i><label for="radio1">전체</label></span>
  72. <span class="check_wrap"><input type="radio" name="ds_usertype" id="radio2" value="A0"<?if($ds_usertype=="A0"){?> checked="checked"<?}?>><i></i><label for="radio2">개인회원</label></span>
  73. <span class="check_wrap"><input type="radio" name="ds_usertype" id="radio3" value="B0"<?if($ds_usertype=="B0"){?> checked="checked"<?}?>><i></i><label for="radio3">사업자회원</label></span>
  74. <span class="check_wrap"><input type="radio" name="ds_usertype" id="radio4" value="C0"<?if($ds_usertype=="C0"){?> checked="checked"<?}?>><i></i><label for="radio4">비회원</label></span>
  75. </div>
  76. </td>
  77. <th>가입승인</th>
  78. <td>
  79. <div class="radio_chk">
  80. <span class="check_wrap"><input type="radio" name="ds_status" id="radio11" value=""><i></i><label for="radio11">전체</label></span>
  81. <span class="check_wrap"><input type="radio" name="ds_status" id="radio12" value="Z0"<?if($ds_status=="Z0"){?> checked="checked"<?}?>><i></i><label for="radio12">승인</label></span>
  82. <span class="check_wrap"><input type="radio" name="ds_status" id="radio13" value="A0"<?if($ds_status=="A0"){?> checked="checked"<?}?>><i></i><label for="radio13">미승인</label></span>
  83. </div>
  84. <input type="submit" class="rnd_btn ty3 gray" value="검색" title="검색">
  85. </td>
  86. </tr>
  87. </table>
  88. </form>
  89. <h3><em>▶</em> 매입통합관리</h3>
  90. <div class="tbl_wrap">
  91. <table class="tbl_list ty2">
  92. <colgroup>
  93. <col width="7%">
  94. <col width="11%">
  95. <col width="*">
  96. <col width="9%">
  97. <col width="11%">
  98. <col width="8%">
  99. <col width="8%">
  100. <col width="9%">
  101. <col width="9%">
  102. <col width="13%">
  103. </colgroup>
  104. <thead>
  105. <tr>
  106. <th>번호</th>
  107. <th>판매자</th>
  108. <th>차종</th>
  109. <th>차량번호</th>
  110. <th>주행거리</th>
  111. <th>색상</th>
  112. <th>변속기</th>
  113. <th>판매지역</th>
  114. <th>판매상태</th>
  115. <th>등록일</th>
  116. </tr>
  117. </thead>
  118. <?
  119. if($totalrows>0) {
  120. $r = mysql_query("SELECT
  121. a.*
  122. , b.nm_model
  123. , c.nm_grade
  124. , d.nm_brand
  125. , e.nm_model_sub
  126. , getCode('car_master','ds_type',a.ds_type) as nm_type
  127. , getCode('car_master','ds_open',a.ds_open) as nm_open
  128. , getCode('car_master','ds_sales',a.ds_sales) as nm_sales
  129. , getCode('car_master','ds_transmission',a.ds_transmission) as nm_transmission
  130. , getCode('member_master','ds_area',s.ds_area) as nm_area
  131. , getCode('sale_master','ds_status',s.ds_status) as nm_status
  132. , s.cd_sale
  133. , s.nm_name nm_name_sale
  134. , s.ds_status ds_status_sale
  135. , 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
  136. FROM sale_master s
  137. inner join car_master a
  138. on (s.cd_car = a.cd_car)
  139. left outer join car_model b
  140. on (a.cd_model = b.cd_model)
  141. left outer join car_grade c
  142. on (a.cd_grade = c.cd_grade)
  143. left outer join car_brand d
  144. on (a.cd_brand = d.cd_brand)
  145. left outer join car_model_sub e
  146. on (a.cd_model_sub = e.cd_model_sub)
  147. $sql $orderby LIMIT $pagestartpoint,$PageSize");
  148. $i=1;
  149. while($col = mysql_fetch_array($r)) {
  150. $tmpNum =$totalrows-($PageSize*($PageNo-1));
  151. $no = ($tmpNum - $i)+1;
  152. ?>
  153. <tr onclick="location.href='./buy_view.php?list_url=<?=$list_url?>&cd_sale=<?=$col[cd_sale]?>&ds_status_sale=<?=$col[ds_status_sale]?>&ListPageNo=<?=$PageNo?>';" style="cursor:pointer;">
  154. <td><?=$no?></td>
  155. <td><?=$col[nm_name_sale]?></td>
  156. <td><?=$col[nm_brand]." ".$col[nm_model]?></td>
  157. <td><?=$col[nm_number]?></td>
  158. <td><?=$col[nm_mileage]?>km</td>
  159. <td><?=$col[nm_color]?></td>
  160. <td><?=$col[nm_transmission]?></td>
  161. <td><?=$col[nm_area]?></td>
  162. <td><em class="txt_bold"><?=$col[nm_status]?></em></td>
  163. <td><?=$col[dt_insert]?></td>
  164. </tr>
  165. <?
  166. $i++;
  167. }
  168. }else{
  169. ?>
  170. <tr>
  171. <td colspan="10">등록된 정보가 없습니다.</td>
  172. </tr>
  173. <?
  174. }
  175. ?>
  176. </table>
  177. </div>
  178. <div class="paging">
  179. <?
  180. $url = "./$list_url?searchtype=$searchtype&searchword=$searchword&ds_status=$ds_status&ds_usertype=$ds_usertype";
  181. ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  182. ?>
  183. </div>
  184. </section>
  185. <script language="javascript" type="text/javascript">
  186. $(document).ready(function() {
  187. $("#btn_cal1").bind("click",function(){
  188. $("#dt_start").datepicker('show');
  189. });
  190. $("#btn_cal2").bind("click",function(){
  191. $("#dt_end").datepicker('show');
  192. });
  193. /*
  194. $("#selBox div.jq_sel ul li a").bind("click",function(){
  195. // alert(this.value);
  196. // alert($("#selBox option:selected").val());
  197. // alert($("#selBox option:selected").text());
  198. // $("#PageSize").val(this.value);
  199. $("#PageSize").val($("#selBox option:selected").val());
  200. $("#frmSearch").submit();
  201. });
  202. */
  203. $("#sel_searchtype div.jq_sel ul li a").bind("click",function(){
  204. $("#searchtype").val($("#sel_searchtype option:selected").val());
  205. });
  206. });
  207. function fnSearch(){
  208. if($("#searchtype").val()!="" && $("#searchword").val()==""){
  209. alert("검색어를 입력하세요");
  210. return false;
  211. }
  212. $("#frmSearch").submit();
  213. }
  214. </script>
  215. <? include("../inc/inc_footer.php") ?>
  216. <? include("../inc/inc_bottom.php") ?>
  217. <?
  218. mysql_close($connect);
  219. ?>