complete_list20200513.php 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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 = "complete_list.php";
  5. // $mp = "33"; //set top nav
  6. $mp = "32"; //set top nav 20190805
  7. $PageNo = $_REQUEST['pageno'];
  8. $PageSize = $_REQUEST['PageSize'];
  9. if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
  10. if (empty($PageSize)) {
  11. $PageSize=10; //목록개수설정
  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 = $sql. " and s.ds_type = '$ds_type' ";
  22. if($searchword != ""){
  23. if($searchtype=="" || $searchtype==null){
  24. $sql = $sql. " and (s.nm_name like '$searchword%' or a.nm_number like '$searchword%') ";
  25. }else{
  26. $sql = $sql. " and $searchtype like '$searchword%'";
  27. }
  28. }
  29. if($ds_usertype != ""){
  30. $sql = $sql. " and s.ds_usertype = '$ds_usertype'";
  31. }
  32. $sql = $sql. " and s.ds_status in ('G0','Z0')";
  33. $sql = $sql. " and (s.ds_status_contract is null or s.ds_status_contract = '')";
  34. $sql = $sql. " and s.ds_status_contract_step1 != 'Y' ";
  35. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  36. //관계사/지점 Setting
  37. $admin_ds_company_bp = $_SESSION['admin_ds_company_bp']; //관계사
  38. $admin_ds_branch = $_SESSION['admin_ds_branch']; //지점
  39. $admin_bp_ok = ($admin_ds_company_bp != "" || $admin_ds_branch != "") ? true : false; //admin_ds_company_bp 나 admin_ds_branch 값이 하나라도 있으면 관계사로 보고 권한 제한한다. $admin_bp_ok == true 이면 해당 관계사/지점 데이타만 확인 가능하다.
  40. //관계사 일 경우 해당 관계사/지점 데이타만 확인 가능하다.
  41. if($admin_bp_ok){
  42. if($admin_ds_company_bp != "" && $admin_ds_branch != ""){
  43. $sql = $sql. " and s.ds_company_bp = '$admin_ds_company_bp' and s.ds_branch = '$admin_ds_branch' ";
  44. }else{ //admin_ds_company_bp 나 admin_ds_branch 값이 하나라도 없으면 데이타 확인 안되게 한다.
  45. $sql = $sql. " and 1 = 2 ";
  46. }
  47. }
  48. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  49. $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);
  50. ?>
  51. <? include("../inc/inc_top.php") ?>
  52. <? include("../inc/inc_header.php") ?>
  53. <section id="contents">
  54. <h2>낙찰(누적) 리스트</h2>
  55. <form id="frmSearch" name="frmSearch" method="post">
  56. <input type="hidden" id="PageSize" name="PageSize">
  57. <input type="hidden" id="searchtype" name="searchtype">
  58. <table class="tbl_search">
  59. <colgroup>
  60. <col width="10%">
  61. <col width="*">
  62. </colgroup>
  63. <tr>
  64. <th>검색어</th>
  65. <td>
  66. <span class="select2" style="margin-right:5px;width:100px;" id="sel_searchtype">
  67. <select>
  68. <option value="">전체</option>
  69. <option value="s.nm_name"<? if($searchtype =="nm_name"){?> selected<?}?>>판매자</option>
  70. <option value="a.nm_number"<? if($searchtype =="nm_number"){?> selected<?}?>>차량번호</option>
  71. </select>
  72. </span>
  73. <input type="text" id="searchword" name="searchword" class="inp_txt" style="width:60%;">
  74. </td>
  75. </tr>
  76. <tr>
  77. <th>회원구분</th>
  78. <td>
  79. <div class="radio_chk">
  80. <span class="check_wrap"><input type="radio" name="ds_usertype" id="radio1" value=""><i></i><label for="radio1">전체</label></span>
  81. <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>
  82. <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>
  83. <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>
  84. </div>
  85. <input type="submit" class="rnd_btn ty3 gray" value="검색" title="검색">
  86. </td>
  87. </tr>
  88. </table>
  89. </form>
  90. <div class="tbl_wrap">
  91. <table class="tbl_list ty2">
  92. <colgroup>
  93. <col width="7%">
  94. <col width="10%">
  95. <col width="*">
  96. <col width="12%">
  97. <col width="8%">
  98. <col width="13%">
  99. <!--col width="20%"-->
  100. <col width="11%">
  101. </colgroup>
  102. <thead>
  103. <tr>
  104. <th>번호</th>
  105. <th>판매자</th>
  106. <th>차종</th>
  107. <th>차량번호</th>
  108. <th>지역</th>
  109. <th>낙찰금액</th>
  110. <!--th>낙찰업체</th-->
  111. <th>등록일</th>
  112. </tr>
  113. </thead>
  114. <?
  115. if($totalrows>0) {
  116. $r = mysql_query("SELECT
  117. a.*
  118. , b.nm_model
  119. , c.nm_grade
  120. , d.nm_brand
  121. , e.nm_model_sub
  122. , getCode('car_master','ds_type',a.ds_type) as nm_type
  123. , getCode('car_master','ds_open',a.ds_open) as nm_open
  124. , getCode('car_master','ds_sales',a.ds_sales) as nm_sales
  125. , getCode('car_master','ds_transmission',a.ds_transmission) as nm_transmission
  126. , getCode('member_master','ds_area',s.ds_area) as nm_area
  127. , getCode('sale_master','ds_status',s.ds_status) as nm_status
  128. , s.cd_sale
  129. , s.nm_name nm_name_sale
  130. , s.nm_price nm_price_sale
  131. , s.nm_price_final nm_price_final_sale
  132. , s.nm_recommend nm_recommend_sale
  133. , s.ds_status ds_status_sale
  134. , s.ds_status_contract ds_status_contract_sale
  135. , s.ds_status_contract_step1 ds_status_contract_step1_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]?>&ds_status_contract_sale=<?=$col[ds_status_contract_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_area]?></td>
  159. <td><?=$col[nm_price_sale]?></td>
  160. <td><?=$col[dt_insert]?></td>
  161. </tr>
  162. <?
  163. $i++;
  164. }
  165. }else{
  166. ?>
  167. <tr>
  168. <td colspan="7">등록된 정보가 없습니다.</td>
  169. </tr>
  170. <?
  171. }
  172. ?>
  173. <!--tr>
  174. <td>10</td>
  175. <td>이도령</td>
  176. <td>벤츠 c-class</td>
  177. <td>23부1234</td>
  178. <td>서울</td>
  179. <td>2500만원</td>
  180. <td>고진상사/홍길동</td>
  181. <td>2018.09.10</td>
  182. </tr-->
  183. </table>
  184. </div>
  185. <div class="paging">
  186. <?
  187. $url = "./$list_url?searchtype=$searchtype&searchword=$searchword&ds_status=$ds_status&ds_usertype=$ds_usertype";
  188. ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  189. ?>
  190. </div>
  191. </section>
  192. <script language="javascript" type="text/javascript">
  193. $(document).ready(function() {
  194. $("#btn_cal1").bind("click",function(){
  195. $("#dt_start").datepicker('show');
  196. });
  197. $("#btn_cal2").bind("click",function(){
  198. $("#dt_end").datepicker('show');
  199. });
  200. /*
  201. $("#selBox div.jq_sel ul li a").bind("click",function(){
  202. // alert(this.value);
  203. // alert($("#selBox option:selected").val());
  204. // alert($("#selBox option:selected").text());
  205. // $("#PageSize").val(this.value);
  206. $("#PageSize").val($("#selBox option:selected").val());
  207. $("#frmSearch").submit();
  208. });
  209. */
  210. $("#sel_searchtype div.jq_sel ul li a").bind("click",function(){
  211. $("#searchtype").val($("#sel_searchtype option:selected").val());
  212. });
  213. });
  214. function fnSearch(){
  215. if($("#searchtype").val()!="" && $("#searchword").val()==""){
  216. alert("검색어를 입력하세요");
  217. return false;
  218. }
  219. $("#frmSearch").submit();
  220. }
  221. </script>
  222. <? include("../inc/inc_footer.php") ?>
  223. <? include("../inc/inc_bottom.php") ?>
  224. <?
  225. mysql_close($connect);
  226. ?>