| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- <?php
- include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
- include $_SERVER['DOCUMENT_ROOT'].'/common/aap_chk.php';
- $MENU_ACTV = 8;
- $s_cd_dealer = $_SESSION['s_cd_dealer'];
- $s_cd_dealer_p = $_SESSION['s_cd_dealer_p'];
- $s_ds_type = $_SESSION['s_ds_type'];
- $PageNo = $_REQUEST['pageno'];
- $PageSize = $_REQUEST['PageSize'];
- if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
- if (empty($PageSize)) {
- $PageSize=10; //목록개수설정
- }else{$PageSize=$PageSize;}
- $pagestartpoint=($PageNo-1)*$PageSize;
- $sql = "where ds_delind='N'";
- $searchtype = $_REQUEST['searchtype'];
- $searchword = $_REQUEST['searchword'];
- $dt_start = $_REQUEST['dt_start'];
- $dt_end = $_REQUEST['dt_end'];
- $ds_type = "D1";
- $sql = $sql. " and ds_type = '$ds_type' ";
- $sql = $sql. " and cd_dealer_p = '$s_cd_dealer_p' ";
- if($searchword != ""){
- if($searchtype=="" || $searchtype==null){
- $sql = $sql. " and (nm_name like '$searchword%' or nm_email like '$searchword%') ";
- }else{
- $sql = $sql. " and $searchtype like '$searchword%'";
- }
- }
- if($dt_start != "" && $dt_end != ""){
- $sql = $sql. " and dt_insert between '$dt_start' and '$dt_end' ";
- }
- $totalrows = @mysql_result(mysql_query("select count(*) from aap_master $sql"),0,0);
- ?>
- <?php include("include/header.php") ?>
- <main class="pb123">
- <section>
- <div class="sub--top--visual">
- <div class="contents--inner">
- <h2>관리자 관리</h2>
- <p>이차조아에서는 사고 이력 조회 후 최고가 내차를 판매할 수 있습니다.</p>
- </div>
- </div>
- </section>
- <section>
- <div class="top--nav--wrap">
- <div class="contents--inner">
- <div class="breadcrumbs--wrap">
- <span></span>
- <span>관리자 관리</span>
- <span>관리자 관리</span>
- </div>
- </div>
- </div>
- </section>
- <section>
- <div class="car--list--wrap ty2">
- <div class="title--wrapper">
- <h2></h2>
- <div class="col-md-6 d-flex justify-content-end">
- <div>
- <select id="inputState" class="form-select" style="width:120px;">
- <option selected="">선택</option>
- <option></option>
- </select>
- </div>
- <div class="ms-2">
- <input type="text" class="form-control" style="width:280px;" id="" placeholder="검색어를 입력하세요">
- </div>
- <button type="button" style="width:90px;" class="btn btn-primary ms-2">검색</button>
- </div>
- </div>
- <section class="mt-3">
- <div class="data--table--wrap">
- <table class="table table-bordered">
- <colgroup>
- <col style="width:8%;">
- <col />
- <col style="width:20%;">
- <col style="width:15%;">
- <col style="width:15%;">
- </colgroup>
- <thead>
- <tr>
- <th><div class="d-flex justify-content-center">NO</div></th>
- <th><div class="d-flex justify-content-center">아이디</div></th>
- <th><div class="d-flex justify-content-center">이름</div></th>
- <th><div class="d-flex justify-content-center">연락처</div></th>
- <th><div class="d-flex justify-content-center">등록일</div></th>
- </tr>
- </thead>
- <tbody>
- <?php
- if($totalrows>0) {
- $r = mysql_query("SELECT * FROM aap_master $sql ORDER BY cd_dealer desc LIMIT $pagestartpoint,$PageSize");
- $i=1;
- while($col = mysql_fetch_array($r)) {
- $tmpNum =$totalrows-($PageSize*($PageNo-1));
- $no = ($tmpNum - $i)+1;
- ?>
- <tr>
- <td>
- <div class="d-flex justify-content-center"><?=$no?></div>
- </td>
- <td>
- <div class="d-flex align-items-center justify-content-center">
- <a href="manager_form.php?cd_dealerid=<?=$col['cd_dealerid']?>"><?=$col['cd_dealerid']?></a>
- </div>
- </td>
- <td>
- <div class="d-flex align-items-center justify-content-center">
- <?=$col['nm_name']?>
- </div>
- </td>
- <td>
- <div class="d-flex justify-content-center"><?=$col['nm_hp']?></div>
- </td>
- <td>
- <div class="d-flex justify-content-center"><?=left($col['dt_insert'], 10)?></div>
- </td>
- </tr>
- <?php
- $i++;
- }
- }else{
- ?>
- <tr>
- <td colspan="5" align="center">등록된 관리자가 없습니다</td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- </table>
- </div>
- <div class="col-12 d-flex justify-content-center pagination--wrapper">
- <?php
- $url = "./manager_list.php?searchtype=$searchtype&searchword=$searchword&ds_status=$ds_status&dt_start=$dt_start&dt_end=$dt_end";
- ListPg($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
- ?>
- <div class="btn--left--wrap">
- <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>
- </div>
- </div>
- </section>
- </div>
- </section>
- </main>
- <script type="text/javascript">
- var cd_dealer = "<?=$_REQUEST['cd_dealer']?>";
- function li_class_reset() {
- $(".admin_list > li.lists").removeClass("on");
- }
- function manager_view(cd_dealer) {
- var url = "dealer_manager_form.php";
- var datas = {cd_dealer : cd_dealer, PageNo : "<?=$PageNo?>"};
- $("#block_right").load(url, datas,function(data) {
- });
- }
- $(document).ready(function() {
- $(".admin_list > li.lists").on("click", function(){
- li_class_reset();
- $(this).addClass("on");
- manager_view($(this).attr("cd_dealer"));
- });
- $(document).on("click", "#btn_manager_form", function() {
- link("manager_form.php");
- });
- if($.trim(cd_dealer) == "") {
- // if($(".admin_list").has("li.lists").length) {
- // $(".admin_list li.lists:eq(0)").click();
- // }else {
- // manager_view("");
- // }
- manager_view("");
- }else {
- if($(".admin_list").has("li.lists").length) {
- $(".admin_list li.lists").each(function(i) {
- console.log(cd_dealer, $(this).attr("cd_dealer"))
- if($(this).attr("cd_dealer") == cd_dealer) {
- $(this).click();
- return false;
- }
- });
- }
- }
- });
- </script>
- <?php include("include/footer.php") ?>
|