dealer.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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. $PageNo =$_REQUEST['pageno'];
  6. $PageSize =$_REQUEST['PageSize'];
  7. if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
  8. if (empty($PageSize)) {
  9. $PageSize=10; //목록개수설정
  10. }else{$PageSize=$PageSize;}
  11. $pagestartpoint=($PageNo-1)*$PageSize;
  12. $sql = "where ds_delind='N'";
  13. $searchtype = $_REQUEST['searchtype'];
  14. $searchword = $_REQUEST['searchword'];
  15. $ds_status = $_REQUEST['ds_status'];
  16. $dt_start = $_REQUEST['dt_start'];
  17. $dt_end = $_REQUEST['dt_end'];
  18. $ds_type = "D0";
  19. $sql = $sql. " and ds_type = '$ds_type' ";
  20. if($searchword != ""){
  21. if($searchtype=="" || $searchtype==null){
  22. $sql = $sql. " and (nm_name like '$searchword%' or cd_dealerid like '$searchword%') ";
  23. }else{
  24. $sql = $sql. " and $searchtype like '$searchword%'";
  25. }
  26. }
  27. if($ds_status != ""){
  28. if($ds_status == "Z0"){
  29. $sql = $sql. " and ds_status = 'Z0' ";
  30. }else{
  31. $sql = $sql. " and (ds_status is null or ds_status != 'Z0') ";
  32. }
  33. }
  34. if($dt_start != "" && $dt_end != ""){
  35. $sql = $sql. " and dt_insert between '$dt_start' and '$dt_end' ";
  36. }
  37. $totalrows = @mysql_result(mysql_query("select count(*) from dealer_master $sql"),0,0);
  38. ?>
  39. <? include("../inc/inc_top.php") ?>
  40. <? include("../inc/inc_header.php") ?>
  41. <section id="contents">
  42. <h2>딜러 회원관리</h2>
  43. <h3><em>▶</em> 회원검색</h3>
  44. <table class="tbl_search">
  45. <colgroup>
  46. <col width="10%">
  47. <col width="38%">
  48. <col width="10%">
  49. <col width="*">
  50. </colgroup>
  51. <form id="frmSearch" name="frmSearch" method="post">
  52. <input type="hidden" id="PageSize" name="PageSize">
  53. <input type="hidden" id="searchtype" name="searchtype">
  54. <tr>
  55. <th>검색어</th>
  56. <td>
  57. <span class="select2" style="margin-right:5px;width:100px;" id="sel_searchtype">
  58. <select>
  59. <option value="">전체</option>
  60. <option value="cd_dealerid"<? if($searchtype =="cd_dealerid"){?> selected<?}?>>아이디</option>
  61. <option value="nm_name"<? if($searchtype =="nm_name"){?> selected<?}?>>이름</option>
  62. </select>
  63. </span>
  64. <input type="text" class="inp_txt" style="width:60%;" id="searchword" name="searchword" value="<?=$searchword?>">
  65. </td>
  66. <th>가입승인</th>
  67. <td>
  68. <div class="radio_chk">
  69. <span class="check_wrap"><input type="radio" name="ds_status" id="radio1" value=""><i></i><label for="radio1">전체</label></span>
  70. <span class="check_wrap"><input type="radio" name="ds_status" id="radio2" value="Z0"><i></i><label for="radio2">승인</label></span>
  71. <span class="check_wrap"><input type="radio" name="ds_status" id="radio3" value="A0"><i></i><label for="radio3">미승인</label></span>
  72. </div>
  73. </td>
  74. </tr>
  75. <tr>
  76. <th>회원가입일</th>
  77. <td colspan="3">
  78. <input type="text" class="inp_txt" style="width:25%;" id="dt_start" name="dt_start" value="<?=$dt_start?>">
  79. <span class="btn_cal" id="btn_cal1">달력보기</span>
  80. ~
  81. <input type="text" class="inp_txt" style="width:25%;" id="dt_end" name="dt_end" value="<?=$dt_end?>">
  82. <span class="btn_cal" id="btn_cal2">달력보기</span>
  83. <input type="submit" class="rnd_btn ty3 gray" value="검색" title="검색">
  84. <div class="btn_right" style="margin-top:-28px">
  85. <a href="javascript:;" id="btn_download_excel" class="rnd_btn black" style='width:110px;'>엑셀다운로드</a>
  86. </div>
  87. </td>
  88. </tr>
  89. </form>
  90. </table>
  91. <div class="select_view_type">
  92. <span class="select" style="width:160px;" id="selBox">
  93. <select id="page_size">
  94. <option value="10"<? if($PageSize==10){ ?> selected<? } ?>>10개 보기</option>
  95. <option value="20"<? if($PageSize==20){ ?> selected<? } ?>>20개 보기</option>
  96. <option value="30"<? if($PageSize==30){ ?> selected<? } ?>>30개 보기</option>
  97. </select>
  98. </span>
  99. </div>
  100. <div class="tbl_wrap">
  101. <table class="tbl_list">
  102. <colgroup>
  103. <col width="7%">
  104. <col width="20%">
  105. <col width="14%">
  106. <col width="*">
  107. <col width="18%">
  108. <col width="15%">
  109. </colgroup>
  110. <thead>
  111. <tr>
  112. <th>번호</th>
  113. <th>아이디</th>
  114. <th>이름</th>
  115. <th>연락처</th>
  116. <th>가입승인</th>
  117. <th>등록일</th>
  118. </tr>
  119. </thead>
  120. <?
  121. if($totalrows>0) {
  122. $r = mysql_query("SELECT * FROM dealer_master $sql ORDER BY cd_dealer desc LIMIT $pagestartpoint,$PageSize");
  123. $i=1;
  124. while($col = mysql_fetch_array($r)) {
  125. $tmpNum =$totalrows-($PageSize*($PageNo-1));
  126. $no = ($tmpNum - $i)+1;
  127. ?>
  128. <tr onclick="location.href='./dealer_view.php?cd_dealer=<?=$col['cd_dealer']?>&PageNo=<?=$PageNo?>';" style="cursor: pointer; cursor: hand;">
  129. <td><?=$no?></td>
  130. <td><?=$col['cd_dealerid']?></td>
  131. <td><?=$col['nm_name']?></td>
  132. <td><?=$col['nm_hp_01']."-".$col['nm_hp_02']."-".$col['nm_hp_03']?></td>
  133. <td><?=$col['ds_status']?></td>
  134. <td><?=$col['dt_insert']?></td>
  135. </tr>
  136. <?
  137. $i++;
  138. }
  139. }else{
  140. ?>
  141. <tr>
  142. <td colspan="6">데이터가 존재 하지 않습니다.</td>
  143. </tr>
  144. <?
  145. }
  146. ?>
  147. </table>
  148. </div>
  149. <div class="paging">
  150. <?
  151. $url = "./dealer.php?searchtype=$searchtype&searchword=$searchword&ds_status=$ds_status&dt_start=$dt_start&dt_end=$dt_end";
  152. ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  153. ?>
  154. </div>
  155. <div class="btn_right">
  156. <a href="dealer_form.php?mode=Add" class="rnd_btn gray">+ 회원등록</a>
  157. </div>
  158. </section>
  159. <script language="javascript" type="text/javascript">
  160. $("#dt_start").datepicker({ dateFormat: 'yy-mm-dd' });
  161. $("#dt_end").datepicker({ dateFormat: 'yy-mm-dd' });
  162. $(document).ready(function() {
  163. $("#btn_cal1").bind("click",function(){
  164. $("#dt_start").datepicker('show');
  165. });
  166. $("#btn_cal2").bind("click",function(){
  167. $("#dt_end").datepicker('show');
  168. });
  169. $("#selBox div.jq_sel ul li a").bind("click",function(){
  170. // alert(this.value);
  171. // alert($("#selBox option:selected").val());
  172. // alert($("#selBox option:selected").text());
  173. // $("#PageSize").val(this.value);
  174. $("#PageSize").val($("#selBox option:selected").val());
  175. $("#frmSearch").submit();
  176. });
  177. $("#sel_searchtype div.jq_sel ul li a").bind("click",function(){
  178. $("#searchtype").val($("#sel_searchtype option:selected").val());
  179. });
  180. });
  181. function fnSearch(){
  182. if($("#searchtype").val()!="" && $("#searchword").val()==""){
  183. alert("검색어를 입력하세요");
  184. return false;
  185. }
  186. $("#frmSearch").submit();
  187. }
  188. //엑셀 추가
  189. $("#btn_download_excel").click(function(e) {
  190. var url = "dealer_excel.php?"+$("#excelForm").serialize();
  191. window.open(url, "excelWin");
  192. });
  193. </script>
  194. <form name="excelForm" id="excelForm" method="GET">
  195. <input type="hidden" name="dt_start" value="<?=$dt_start?>">
  196. <input type="hidden" name="dt_end" value="<?=$dt_end?>">
  197. <input type="hidden" name="searchtype" value="<?=$searchtype?>">
  198. <input type="hidden" name="searchword" value="<?=$searchword?>">
  199. <input type="hidden" name="ds_status" value="<?=$ds_status?>">
  200. </form>
  201. <? include("../inc/inc_footer.php") ?>
  202. <? include("../inc/inc_bottom.php") ?>
  203. <?
  204. mysql_close($connect);
  205. ?>