member.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].ADMIN_PATH.'common/auth_chk.php';
  4. $mp = "20"; //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. $sql = $sql. " and ds_status = 'A0' "; //활동 중인 - A0:활동,B0:휴면
  14. //echo $_REQUEST['searchtype'];
  15. //echo "<BR>";
  16. $searchtype = $_REQUEST['searchtype'];
  17. $searchword = $_REQUEST['searchword'];
  18. $dt_start = $_REQUEST['dt_start'];
  19. $dt_end = $_REQUEST['dt_end'];
  20. if($searchword != ""){
  21. if($searchtype=="" || $searchtype==null){
  22. $sql = $sql. " and (nm_name like '$searchword%' or nm_email like '$searchword%') ";
  23. }else{
  24. $sql = $sql. " and $searchtype like '$searchword%'";
  25. }
  26. }
  27. if($dt_start != "" && $dt_end != ""){
  28. $sql = $sql. " and dt_insert between '$dt_start' and '$dt_end' ";
  29. }
  30. // echo $sql;
  31. $totalrows = @mysql_result(mysql_query("select count(*) from member_master $sql"),0,0);
  32. ?>
  33. <? include("../inc/inc_top.php") ?>
  34. <? include("../inc/inc_header.php") ?>
  35. <section id="contents">
  36. <h2>일반회원 관리</h2>
  37. <h3><em>▶</em> 회원검색</h3>
  38. <table class="tbl_search">
  39. <colgroup>
  40. <col width="10%">
  41. <col width="35%">
  42. <col width="10%">
  43. <col width="*">
  44. </colgroup>
  45. <form id="frmSearch" name="frmSearch" method="post">
  46. <input type="hidden" id="PageSize" name="PageSize">
  47. <input type="hidden" id="searchtype" name="searchtype">
  48. <tr>
  49. <th>검색어</th>
  50. <td>
  51. <span class="select2" style="margin-right:5px;width:100px;" id="sel_searchtype">
  52. <select>
  53. <option value="">전체</option>
  54. <option value="nm_email"<? if($searchtype =="nm_email"){?> selected<?}?>>E-Mail</option>
  55. <option value="nm_name"<? if($searchtype =="nm_name"){?> selected<?}?>>이름</option>
  56. </select>
  57. </span>
  58. <input type="text" class="inp_txt" style="width:60%;" id="searchword" name="searchword" value="<?=$searchword?>">
  59. </td>
  60. <th>회원가입일</th>
  61. <td>
  62. <input type="text" class="inp_txt" style="width:34%;" id="dt_start" name="dt_start" value="<?=$dt_start?>">
  63. <span class="btn_cal" id="btn_cal1">달력보기</span>
  64. ~
  65. <input type="text" class="inp_txt" style="width:34%;" id="dt_end" name="dt_end" value="<?=$dt_end?>">
  66. <span class="btn_cal" id="btn_cal2">달력보기</span>
  67. <input type="submit" class="rnd_btn ty3 gray" value="검색" title="검색">
  68. </td>
  69. </tr>
  70. </form>
  71. </table>
  72. <div class="select_view_type">
  73. <span class="select" style="width:160px;" id="selBox">
  74. <select id="page_size">
  75. <option value="10"<? if($PageSize==10){ ?> selected<? } ?>>10개 보기</option>
  76. <option value="20"<? if($PageSize==20){ ?> selected<? } ?>>20개 보기</option>
  77. <option value="30"<? if($PageSize==30){ ?> selected<? } ?>>30개 보기</option>
  78. </select>
  79. </span>
  80. </div>
  81. <div class="tbl_wrap">
  82. <table class="tbl_list">
  83. <colgroup>
  84. <col width="7%">
  85. <col width="20%">
  86. <col width="14%">
  87. <col width="*">
  88. <col width="18%">
  89. <!--col width="15%"-->
  90. </colgroup>
  91. <thead>
  92. <tr>
  93. <th>번호</th>
  94. <th>아이디</th>
  95. <th>이름</th>
  96. <th>연락처</th>
  97. <th>관계사</th>
  98. <th>지점</th>
  99. <!--th>추천인</th-->
  100. <th>등록일</th>
  101. </tr>
  102. </thead>
  103. <?
  104. if($totalrows>0) {
  105. $r = mysqli_query($connect, "SELECT *, getCode('member_master','ds_company_bp',ds_company_bp) as nm_company_bp, getCode('member_master','ds_branch',ds_branch) as nm_branch FROM member_master $sql ORDER BY cd_user desc LIMIT $pagestartpoint,$PageSize");
  106. $i=1;
  107. while($col = mysqli_fetch_array($r)) {
  108. $tmpNum =$totalrows-($PageSize*($PageNo-1));
  109. $no = ($tmpNum - $i)+1;
  110. ?>
  111. <tr onclick="location.href='./member_view.php?cd_user=<?=$col['cd_user']?>&PageNo=<?=$PageNo?>';" style="cursor: pointer; cursor: hand;">
  112. <td><?=$no?></td>
  113. <td><?=$col['nm_email']?></td>
  114. <td><?=$col['nm_name']?></td>
  115. <td><?=$col['nm_hp']?></td>
  116. <td><?=$col['nm_company_bp'] == "" ? "":$col['nm_company_bp']."모터스" ?></td>
  117. <td><?=$col['nm_branch'] == "" ? "":$col['nm_branch']."지점" ?></td>
  118. <td><?=$col['dt_insert']?></td>
  119. <!--td><a href="./admin_view.php?cd_userid=<?=$col['cd_userid']?>&PageNo=<?=$PageNo?>" class="rnd_s_btn">수정</a></td-->
  120. </tr>
  121. <?
  122. $i++;
  123. }
  124. }else{
  125. ?>
  126. <tr>
  127. <td colspan="7">데이터가 존재 하지 않습니다.</td>
  128. </tr>
  129. <?
  130. }
  131. ?>
  132. </table>
  133. </div>
  134. <div class="paging">
  135. <?
  136. $url = "./member.php?searchtype=$searchtype&searchword=$searchword&dt_start=$dt_start&dt_end=$dt_end";
  137. ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  138. ?>
  139. </div>
  140. <div class="btn_right">
  141. <a href="member_form.php?mode=Add" class="rnd_btn gray">+ 회원등록</a>
  142. </div>
  143. </section>
  144. <script language="javascript" type="text/javascript">
  145. $("#dt_start").datepicker({ dateFormat: 'yy-mm-dd' });
  146. $("#dt_end").datepicker({ dateFormat: 'yy-mm-dd' });
  147. $(document).ready(function() {
  148. $("#btn_cal1").bind("click",function(){
  149. $("#dt_start").datepicker('show');
  150. });
  151. $("#btn_cal2").bind("click",function(){
  152. $("#dt_end").datepicker('show');
  153. });
  154. $("#selBox div.jq_sel ul li a").bind("click",function(){
  155. // alert(this.value);
  156. // alert($("#selBox option:selected").val());
  157. // alert($("#selBox option:selected").text());
  158. // $("#PageSize").val(this.value);
  159. $("#PageSize").val($("#selBox option:selected").val());
  160. $("#frmSearch").submit();
  161. });
  162. $("#sel_searchtype div.jq_sel ul li a").bind("click",function(){
  163. $("#searchtype").val($("#sel_searchtype option:selected").val());
  164. });
  165. });
  166. function fnSearch(){
  167. if($("#searchtype").val()!="" && $("#searchword").val()==""){
  168. var custom_opts = {
  169. title : '검색어를 입력하세요',
  170. btn_close_show : false,
  171. }
  172. custom_modal_alert(custom_opts);
  173. return false;
  174. }
  175. $("#frmSearch").submit();
  176. }
  177. </script>
  178. <? include("../inc/inc_footer.php") ?>
  179. <? include("../inc/inc_bottom.php") ?>
  180. <?
  181. mysql_close($connect);
  182. ?>