manager_list.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].'/common/aap_chk.php';
  4. $MENU_ACTV = 8;
  5. $s_cd_dealer = $_SESSION['s_cd_dealer'];
  6. $s_cd_dealer_p = $_SESSION['s_cd_dealer_p'];
  7. $s_ds_type = $_SESSION['s_ds_type'];
  8. $PageNo = $_REQUEST['pageno'];
  9. $PageSize = $_REQUEST['PageSize'];
  10. if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
  11. if (empty($PageSize)) {
  12. $PageSize=10; //목록개수설정
  13. }else{$PageSize=$PageSize;}
  14. $pagestartpoint=($PageNo-1)*$PageSize;
  15. $sql = "where ds_delind='N'";
  16. $searchtype = $_REQUEST['searchtype'];
  17. $searchword = $_REQUEST['searchword'];
  18. $dt_start = $_REQUEST['dt_start'];
  19. $dt_end = $_REQUEST['dt_end'];
  20. $ds_type = "D1";
  21. $sql = $sql. " and ds_type = '$ds_type' ";
  22. $sql = $sql. " and cd_dealer_p = '$s_cd_dealer_p' ";
  23. if($searchword != ""){
  24. if($searchtype=="" || $searchtype==null){
  25. $sql = $sql. " and (nm_name like '$searchword%' or nm_email like '$searchword%') ";
  26. }else{
  27. $sql = $sql. " and $searchtype like '$searchword%'";
  28. }
  29. }
  30. if($dt_start != "" && $dt_end != ""){
  31. $sql = $sql. " and dt_insert between '$dt_start' and '$dt_end' ";
  32. }
  33. $totalrows = @mysql_result(mysql_query("select count(*) from aap_master $sql"),0,0);
  34. ?>
  35. <?php include("include/header.php") ?>
  36. <main class="pb123">
  37. <section>
  38. <div class="sub--top--visual">
  39. <div class="contents--inner">
  40. <h2>관리자 관리</h2>
  41. <p>이차조아에서는 사고 이력 조회 후 최고가 내차를 판매할 수 있습니다.</p>
  42. </div>
  43. </div>
  44. </section>
  45. <section>
  46. <div class="top--nav--wrap">
  47. <div class="contents--inner">
  48. <div class="breadcrumbs--wrap">
  49. <span></span>
  50. <span>관리자 관리</span>
  51. <span>관리자 관리</span>
  52. </div>
  53. </div>
  54. </div>
  55. </section>
  56. <section>
  57. <div class="car--list--wrap ty2">
  58. <div class="title--wrapper">
  59. <h2></h2>
  60. <div class="col-md-6 d-flex justify-content-end">
  61. <div>
  62. <select id="inputState" class="form-select" style="width:120px;">
  63. <option selected="">선택</option>
  64. <option></option>
  65. </select>
  66. </div>
  67. <div class="ms-2">
  68. <input type="text" class="form-control" style="width:280px;" id="" placeholder="검색어를 입력하세요">
  69. </div>
  70. <button type="button" style="width:90px;" class="btn btn-primary ms-2">검색</button>
  71. </div>
  72. </div>
  73. <section class="mt-3">
  74. <div class="data--table--wrap">
  75. <table class="table table-bordered">
  76. <colgroup>
  77. <col style="width:8%;">
  78. <col />
  79. <col style="width:20%;">
  80. <col style="width:15%;">
  81. <col style="width:15%;">
  82. </colgroup>
  83. <thead>
  84. <tr>
  85. <th><div class="d-flex justify-content-center">NO</div></th>
  86. <th><div class="d-flex justify-content-center">아이디</div></th>
  87. <th><div class="d-flex justify-content-center">이름</div></th>
  88. <th><div class="d-flex justify-content-center">연락처</div></th>
  89. <th><div class="d-flex justify-content-center">등록일</div></th>
  90. </tr>
  91. </thead>
  92. <tbody>
  93. <?php
  94. if($totalrows>0) {
  95. $r = mysql_query("SELECT * FROM aap_master $sql ORDER BY cd_dealer desc LIMIT $pagestartpoint,$PageSize");
  96. $i=1;
  97. while($col = mysql_fetch_array($r)) {
  98. $tmpNum =$totalrows-($PageSize*($PageNo-1));
  99. $no = ($tmpNum - $i)+1;
  100. ?>
  101. <tr>
  102. <td>
  103. <div class="d-flex justify-content-center"><?=$no?></div>
  104. </td>
  105. <td>
  106. <div class="d-flex align-items-center justify-content-center">
  107. <a href="manager_form.php?cd_dealerid=<?=$col['cd_dealerid']?>"><?=$col['cd_dealerid']?></a>
  108. </div>
  109. </td>
  110. <td>
  111. <div class="d-flex align-items-center justify-content-center">
  112. <?=$col['nm_name']?>
  113. </div>
  114. </td>
  115. <td>
  116. <div class="d-flex justify-content-center"><?=$col['nm_hp']?></div>
  117. </td>
  118. <td>
  119. <div class="d-flex justify-content-center"><?=left($col['dt_insert'], 10)?></div>
  120. </td>
  121. </tr>
  122. <?php
  123. $i++;
  124. }
  125. }else{
  126. ?>
  127. <tr>
  128. <td colspan="5" align="center">등록된 관리자가 없습니다</td>
  129. </tr>
  130. <?php
  131. }
  132. ?>
  133. </tbody>
  134. </table>
  135. </div>
  136. <div class="col-12 d-flex justify-content-center pagination--wrapper">
  137. <?php
  138. $url = "./manager_list.php?searchtype=$searchtype&searchword=$searchword&ds_status=$ds_status&dt_start=$dt_start&dt_end=$dt_end";
  139. ListPg($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  140. ?>
  141. <div class="btn--left--wrap">
  142. <button type='button' _data-bs-toggle="modal" _data-bs-target="#exampleModal2" _type="submit" class="btn btn-primary ml15" style="width:130px; height:45px;" id="btn_manager_form">관리자 등록</button>
  143. </div>
  144. </div>
  145. </section>
  146. </div>
  147. </section>
  148. </main>
  149. <script type="text/javascript">
  150. var cd_dealer = "<?=$_REQUEST['cd_dealer']?>";
  151. function li_class_reset() {
  152. $(".admin_list > li.lists").removeClass("on");
  153. }
  154. function manager_view(cd_dealer) {
  155. var url = "dealer_manager_form.php";
  156. var datas = {cd_dealer : cd_dealer, PageNo : "<?=$PageNo?>"};
  157. $("#block_right").load(url, datas,function(data) {
  158. });
  159. }
  160. $(document).ready(function() {
  161. $(".admin_list > li.lists").on("click", function(){
  162. li_class_reset();
  163. $(this).addClass("on");
  164. manager_view($(this).attr("cd_dealer"));
  165. });
  166. $(document).on("click", "#btn_manager_form", function() {
  167. link("manager_form.php");
  168. });
  169. if($.trim(cd_dealer) == "") {
  170. // if($(".admin_list").has("li.lists").length) {
  171. // $(".admin_list li.lists:eq(0)").click();
  172. // }else {
  173. // manager_view("");
  174. // }
  175. manager_view("");
  176. }else {
  177. if($(".admin_list").has("li.lists").length) {
  178. $(".admin_list li.lists").each(function(i) {
  179. console.log(cd_dealer, $(this).attr("cd_dealer"))
  180. if($(this).attr("cd_dealer") == cd_dealer) {
  181. $(this).click();
  182. return false;
  183. }
  184. });
  185. }
  186. }
  187. });
  188. </script>
  189. <?php include("include/footer.php") ?>