notice_list.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. $MENU_ACTV = '31';
  4. $list_url = "notice_list.php";
  5. $cd_board = "01";
  6. $ds_kind = (empty($_SESSION["s_ds_kind"]) ? $_REQUEST["ds_kind"]:$_SESSION["s_ds_kind"]);
  7. $s_cd_user = $_SESSION['s_cd_user'];
  8. $s_cd_dealer = $_SESSION['s_cd_dealer'];
  9. $searchword = $_REQUEST['searchword'];
  10. // if ( ($ds_kind == "A" && empty($s_cd_user))
  11. // || ($ds_kind == "D" && empty($s_cd_dealer))
  12. // ){
  13. // AlertRedirect("잘못된 요청입니다.","/index.php");
  14. // }
  15. if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
  16. $PageSize=10; //목록개수설정
  17. $pagestartpoint=($PageNo-1)*$PageSize;
  18. $add_sql = "where cd_board='$cd_board' and ds_delind='N'";
  19. $add_sql.= " and (ds_kind is null or ds_kind='' or ds_kind='$ds_kind') ";
  20. if($searchword != ""){
  21. if($searchtype=="" || $searchtype==null){
  22. $add_sql.= " and (nm_title like '$searchword%' or nm_content like '$searchword%')";
  23. }else{
  24. $add_sql.= " and $searchtype like '$searchword%'";
  25. }
  26. }
  27. $sql = "select count(*) from board_master $add_sql";
  28. $totalrows = @mysql_result(mysql_query($sql),0,0);
  29. ?>
  30. <? include("../include/inc_header.php") ?>
  31. <main class="pb123">
  32. <section>
  33. <div class="sub--top--visual cscenter">
  34. <div class="contents--inner">
  35. <h2>고객 센터</h2>
  36. <p>이차조아에 대해 궁금하신 점이 있다면 무엇이든 물어보세요.</p>
  37. </div>
  38. </div>
  39. </section>
  40. <?php include_once($_SERVER['DOCUMENT_ROOT']."/include/inc_nav.php");?>
  41. <section>
  42. <div class="notice--board--wrap">
  43. <form id="searchForm" name="searchForm" method="get">
  44. <div class="board--search--wrap d-flex align-items-center justify-content-between">
  45. <div class="result--count">총<span><?=number_format($totalrows)?></span>건</div>
  46. <div class="sch--wrappers">
  47. <input type="text" id="searchword" name="searchword" class="form-control" placeholder="검색어를 입력해주세요" value="<?=$searchword?>">
  48. <button type="button" class="btn sch--btn" id="btn_search"></button>
  49. </div>
  50. </div>
  51. </form>
  52. <table>
  53. <colgroup>
  54. <col style="width:100px;"/>
  55. <col width="*"/>
  56. <col style="width:135px;"/>
  57. <col style="width:0px;">
  58. </colgroup>
  59. <tbody>
  60. <?php
  61. if($totalrows>0) {
  62. $r = mysql_query("SELECT *
  63. FROM board_master
  64. $add_sql
  65. ORDER BY ds_top desc, no_famally ASC, no_order ASC
  66. LIMIT $pagestartpoint,$PageSize");
  67. $i=1;
  68. while($col = mysql_fetch_array($r)) {
  69. $date = strtotime ($col['dt_insert']);
  70. $view_date = strtotime ("-1 day",time());
  71. if($date >= $view_date) {
  72. $newicon = " <img src='".ADMIN_PATH."img/i_new.gif' style='margin-top:1px;' /> ";
  73. } else {
  74. $newicon = "";
  75. }
  76. if($col['no_step']>0){
  77. $padding = $col['no_step'] * 8;
  78. $step = "<span style=\"padding-left:".$padding."px\"/>";
  79. }
  80. $tmpNum =$totalrows-($PageSize*($PageNo-1));
  81. $no = ($tmpNum - $i)+1;
  82. ?>
  83. <tr onclick="location.href='./notice_view.php?cd_board=<?=$cd_board?>&cd_seq=<?=$col['cd_seq']?>&PageNo=<?=$PageNo?>&PageSort=<?=$PageSort?>&PageSize=<?=$PageSort?>&searchtype=<?=$searchtype?>&searchword=<?=$searchword?>'">
  84. <td class="text-center">
  85. <div class="numb"><?=$no?></div>
  86. </td>
  87. <td>
  88. <div class="board--captions">
  89. <span class="lock--notice">공지</span>
  90. <?=text_cut($col['nm_title'],50)?>
  91. </div>
  92. </td>
  93. <td class="text-center">
  94. <div class="date--text"><?=$col['dt_insert']?></div>
  95. </td>
  96. </tr>
  97. <?php
  98. $i++;
  99. }
  100. }else{
  101. ?>
  102. <tr>
  103. <td colspan="3">등록된 정보가 없습니다.</td>
  104. </tr>
  105. <?php
  106. }
  107. ?>
  108. </tbody>
  109. </table>
  110. <div class="col-12 d-flex justify-content-center">
  111. <?php
  112. $url = "./$list_url?searchtype=$searchtype&searchword=$searchword&ds_status=$ds_status&ds_usertype=$ds_usertype&PageSort=$PageSort";
  113. ListPg($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  114. ?>
  115. </div>
  116. </div>
  117. </section>
  118. </main>
  119. <script>
  120. function go_search() {
  121. $("#searchForm").submit();
  122. }
  123. $(function() {
  124. $("#btn_search").on("click", function() {
  125. go_search();
  126. });
  127. })
  128. </script>
  129. <!-- s : footer -->
  130. <? include("../include/inc_footer.php"); ?>
  131. <!-- // e : footer -->