admin_list.php 6.3 KB

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