sa.php 7.0 KB

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