dormant.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].ADMIN_PATH.'common/auth_chk.php';
  4. $mp = "23"; //set top nav
  5. $searchtype = $_REQUEST['searchtype'];
  6. $searchword = $_REQUEST['searchword'];
  7. $dt_start = $_REQUEST['dt_start'];
  8. $dt_end = $_REQUEST['dt_end'];
  9. $PageNo = $_REQUEST['pageno'];
  10. $PageSize =$_REQUEST['PageSize'];
  11. if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
  12. if (empty($PageSize)) {
  13. $PageSize=10; //목록개수설정
  14. }else{$PageSize=$PageSize;}
  15. $pagestartpoint=($PageNo-1)*$PageSize;
  16. $add_sql = " WHERE ds_delind='N'"; //삭제하지 않은
  17. $add_sql.= " AND ds_status = 'B0' "; //활동 중인 - A0:활동,B0:휴면
  18. //echo $_REQUEST['searchtype'];
  19. //echo "<BR>";
  20. if($searchword != ""){
  21. if($searchtype=="" || $searchtype==null){
  22. $add_sql.= " AND (nm_name like '$searchword%' or nm_email like '$searchword%') ";
  23. }else{
  24. $add_sql.= " AND $searchtype like '$searchword%'";
  25. }
  26. }
  27. if($dt_start != "" && $dt_end != ""){
  28. $add_sql.= " AND dt_dormant between '$dt_start' and '$dt_end' ";
  29. }
  30. $sql = "select count(*) from member_master $add_sql";
  31. // echo $sql;
  32. $totalrows = @mysql_result(mysql_query($sql),0,0);
  33. ?>
  34. <? include("../inc/inc_top.php") ?>
  35. <? include("../inc/inc_header.php") ?>
  36. <section id="contents">
  37. <h2>휴면 회원관리</h2>
  38. <h3><em>▶</em> 회원검색</h3>
  39. <table class="tbl_search">
  40. <colgroup>
  41. <col width="10%">
  42. <col width="38%">
  43. <col width="10%">
  44. <col width="*">
  45. </colgroup>
  46. <form id="frmSearch" name="frmSearch" method="post">
  47. <input type="hidden" id="PageSize" name="PageSize">
  48. <input type="hidden" id="searchtype" name="searchtype">
  49. <tr>
  50. <th>검색어</th>
  51. <td>
  52. <span class="select2" style="margin-right:5px;width:100px;" id="sel_searchtype">
  53. <select>
  54. <option value="">전체</option>
  55. <option value="nm_email"<? if($searchtype =="nm_email"){?> selected<?}?>>E-Mail</option>
  56. <option value="nm_name"<? if($searchtype =="nm_name"){?> selected<?}?>>이름</option>
  57. </select>
  58. </span>
  59. <input type="text" class="inp_txt" style="width:60%;">
  60. </td>
  61. <th>휴면회원 전환일</th>
  62. <td colspan="3">
  63. <input type="text" class="inp_txt" style="width:34%;" id="dt_start" name="dt_start" value="<?=$dt_start?>">
  64. <span class="btn_cal" id="btn_cal1">달력보기</span>
  65. ~
  66. <input type="text" class="inp_txt" style="width:34%;" id="dt_end" name="dt_end" value="<?=$dt_end?>">
  67. <span class="btn_cal" id="btn_cal2">달력보기</span>
  68. <input type="submit" class="rnd_btn ty3 gray" value="검색" title="검색">
  69. </td>
  70. </tr>
  71. </form>
  72. </table>
  73. <div class="select_view_type">
  74. <span class="select" style="width:160px;" id="selBox">
  75. <select>
  76. <option value="10"<? if($PageSize==10){ ?> selected<? } ?>>10개 보기</option>
  77. <option value="20"<? if($PageSize==20){ ?> selected<? } ?>>20개 보기</option>
  78. <option value="30"<? if($PageSize==30){ ?> selected<? } ?>>30개 보기</option>
  79. </select>
  80. </span>
  81. </div>
  82. <div class="tbl_wrap">
  83. <form id="frmMember" name="frmMember" method="post" action="member_proc.php" enctype="multipart/form-data">
  84. <input type="hidden" name="mode" id="mode" value="DeleteArr"/>
  85. <table class="tbl_list" id="layout_table">
  86. <colgroup>
  87. <col width="7%">
  88. <col width="7%">
  89. <col width="*">
  90. <col width="13%">
  91. <col width="18%">
  92. <col width="18%">
  93. <col width="15%">
  94. </colgroup>
  95. <thead>
  96. <tr>
  97. <th>선택</th>
  98. <th>번호</th>
  99. <th>아이디</th>
  100. <th>이름</th>
  101. <th>연락처</th>
  102. <th>휴면해제</th>
  103. <th>등록일</th>
  104. </tr>
  105. </thead>
  106. <?
  107. if($totalrows>0) {
  108. $r = mysql_query("SELECT *
  109. FROM member_master $add_sql
  110. ORDER BY cd_user desc
  111. LIMIT $pagestartpoint,$PageSize");
  112. $i=1;
  113. while($col = mysql_fetch_array($r)) {
  114. ?>
  115. <tr>
  116. <td class="chk"><span class="check_wrap"><input type="checkbox" name="arr_cd_user[]" id="arr_cd_user[]" value="<?=$col['cd_user']?>"><i></i></span></td>
  117. <td><?=$i?></td>
  118. <td><?=$col['nm_email']?></td>
  119. <td><?=$col['nm_name']?></td>
  120. <td><?=$col['nm_hp']?></td>
  121. <td><a href="#" class="rnd_s_btn btn_cancel" value="<?=$col['cd_user']?>">해제하기</a></td>
  122. <td><?=$col['dt_insert']?></td>
  123. </tr>
  124. <?
  125. $i++;
  126. }
  127. }else{
  128. ?>
  129. <tr>
  130. <td colspan="7">데이터가 존재 하지 않습니다.</td>
  131. </tr>
  132. <?
  133. }
  134. ?>
  135. </table>
  136. </form>
  137. </div>
  138. <div class="paging">
  139. <?
  140. $url = "./dormant.php?searchtype=$searchtype&searchword=$searchword&dt_start=$dt_start&dt_end=$dt_end";
  141. ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  142. ?>
  143. </div>
  144. <div class="btn_right">
  145. <a href="#" class="rnd_btn gray" id="btn_write">탈퇴처리</a>
  146. </div>
  147. </section>
  148. <form name="frmCancel" id="frmCancel" method="post" action="member_proc.php">
  149. <input type="hidden" name="mode" id="mode_cancel" value="cancelDormant">
  150. <input type="hidden" name="cd_user" id="cd_user_cancel">
  151. </form>
  152. <script laguage="javascript" type="text/javascript">
  153. $(document).ready(function() {
  154. $(".btn_cancel").bind("click",function(){
  155. $("#cd_user_cancel").val($(this).attr("value"));
  156. var custom_opts = {
  157. title : '',
  158. btn_close_show : false,
  159. }
  160. custom_opts.title = '휴면 해제하시겠습니까?';
  161. custom_modal_confirm(custom_opts, function(confirm) {
  162. if(confirm) {
  163. $(".btn_cancel").hide();
  164. var data = $("#frmCancel").serialize();
  165. $.ajax({
  166. url : 'member_proc.php',
  167. type: 'POST',
  168. dataType : 'json',
  169. data: data,
  170. success: function(res) {
  171. custom_modal_confirm_close();
  172. $(".btn_cancel").show();
  173. //세션 종료시 로그인 페이지로 이동
  174. if(res.CODE != "0000") {
  175. custom_opts.title = res.MSG;
  176. if(res.CODE == "4444") {
  177. window.location.href = res.DATAS.URL;
  178. }
  179. custom_modal_alert(custom_opts);
  180. return false;
  181. }
  182. custom_opts.title = '휴면 해제가 완료되었습니다.';
  183. custom_opts.event_esc_key = false;
  184. custom_modal_alert(custom_opts, function() {
  185. reload();
  186. });
  187. },
  188. error:function(request,status,error){
  189. $(".btn_cancel").show();
  190. custom_modal_confirm_close();
  191. alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
  192. }
  193. });
  194. }else {
  195. $(".btn_cancel").show();
  196. return false;
  197. }
  198. });
  199. // alert($("#btn_cancel").attr('value'));
  200. // if(confirm("해제하시겠습니까?")){
  201. // $("#cd_user_cancel").val($("#btn_cancel").attr('value'));
  202. // $("#frmCancel").submit();
  203. // }
  204. });
  205. $("#btn_write").bind("click",function(){
  206. var custom_opts = {
  207. title : '',
  208. btn_close_show : false,
  209. }
  210. var checked_length = $("#layout_table tbody input[type=checkbox]:checked").length;
  211. if(checked_length < 1) {
  212. custom_opts.title = '탈퇴처리하려는 회원을 선택해 주세요.';
  213. custom_modal_alert(custom_opts);
  214. return false;
  215. }
  216. custom_opts.title = '탈퇴 처리하시겠습니까?';
  217. custom_modal_confirm(custom_opts, function(confirm) {
  218. if(confirm) {
  219. $("#btn_write").hide();
  220. var data = $("#frmMember").serialize();
  221. $.ajax({
  222. url : 'member_proc.php',
  223. type: 'POST',
  224. dataType : 'json',
  225. data: data,
  226. success: function(res) {
  227. custom_modal_confirm_close();
  228. $("#btn_write").show();
  229. //세션 종료시 로그인 페이지로 이동
  230. if(res.CODE != "0000") {
  231. custom_opts.title = res.MSG;
  232. if(res.CODE == "4444") {
  233. window.location.href = res.DATAS.URL;
  234. }
  235. custom_modal_alert(custom_opts);
  236. return false;
  237. }
  238. custom_opts.title = '탈퇴처리가 완료되었습니다.';
  239. custom_opts.event_esc_key = false;
  240. custom_modal_alert(custom_opts, function() {
  241. reload();
  242. });
  243. },
  244. error:function(request,status,error){
  245. $("#btn_write").show();
  246. custom_modal_confirm_close();
  247. alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
  248. }
  249. });
  250. }else {
  251. $("#btn_write").show();
  252. return false;
  253. }
  254. });
  255. // var c=confirm("정보를 등록하시겠습니까?");
  256. // if(c){
  257. // $("#btn_write").hide();
  258. // $("#frmMember").submit();
  259. // }else{
  260. // $("#btn_write").show();
  261. // return false;
  262. // }
  263. });
  264. });
  265. </script>
  266. <? include("../inc/inc_footer.php") ?>
  267. <? include("../inc/inc_bottom.php") ?>
  268. <?
  269. mysql_close($connect);
  270. ?>