faq.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. $MENU_ACTV = '32';
  4. $list_url = "faq.php";
  5. $cd_board = "03";
  6. $ds_kind = $_REQUEST["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='$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_top.php") ?>
  31. <? include("../include/inc_header.php") ?>
  32. <main class="pb123">
  33. <section>
  34. <div class="sub--top--visual cscenter">
  35. <div class="contents--inner">
  36. <h2>고객 센터</h2>
  37. <p>이차조아에 대해 궁금하신 점이 있다면 무엇이든 물어보세요.</p>
  38. </div>
  39. </div>
  40. </section>
  41. <?php include_once($_SERVER['DOCUMENT_ROOT']."/include/inc_nav.php");?>
  42. <section>
  43. <div class="notice--board--wrap">
  44. <form id="searchForm" name="searchForm" method="get">
  45. <div class="board--search--wrap d-flex align-items-center justify-content-between">
  46. <div class="result--count">총<span><?=number_format($totalrows)?></span>건</div>
  47. <div class="sch--wrappers">
  48. <input type="text" id="searchword" name="searchword" class="form-control" placeholder="검색어를 입력해주세요" value="<?=$searchword?>">
  49. <button type="button" class="btn sch--btn" id="btn_search"></button>
  50. </div>
  51. </div>
  52. </form>
  53. <div class="faq--wrap">
  54. <div>
  55. <ul>
  56. <?php
  57. if($totalrows>0) {
  58. $r = mysql_query("SELECT * FROM board_master $add_sql ORDER BY ds_top desc, no_famally ASC, no_order ASC LIMIT $pagestartpoint,$PageSize");
  59. $i=1;
  60. while($col = mysql_fetch_array($r)) {
  61. $date = strtotime ($col['dt_insert']);
  62. $view_date = strtotime ("-1 day",time());
  63. if($date >= $view_date) {
  64. $newicon = " <img src='".ADMIN_PATH."img/i_new.gif' style='margin-top:1px;' /> ";
  65. } else {
  66. $newicon = "";
  67. }
  68. if($col['no_step']>0){
  69. $padding = $col['no_step'] * 8;
  70. $step = "<span style=\"padding-left:".$padding."px\"/>";
  71. }
  72. $tmpNum =$totalrows-($PageSize*($PageNo-1));
  73. $no = ($tmpNum - $i)+1;
  74. $actv_class = "";
  75. if($i == 1) {
  76. $actv_class = "actv";
  77. }
  78. ?>
  79. <li class="<?=$actv_class?>">
  80. <div class="faq--header">
  81. <i class="q--icon"></i>
  82. <h2><?=$col['nm_title']?></h2>
  83. </div>
  84. <div class="faq--body">
  85. <?=$col['nm_content']?>
  86. </div>
  87. </li>
  88. <?php
  89. $i++;
  90. }
  91. }else{
  92. ?>
  93. <li>
  94. <p>등록된 정보가 없습니다.</p>
  95. </li>
  96. <?php
  97. }
  98. ?>
  99. </ul>
  100. </div>
  101. </div>
  102. <div class="col-12 d-flex justify-content-center">
  103. <?php
  104. $url = "./$list_url?searchtype=$searchtype&searchword=$searchword&ds_status=$ds_status&ds_usertype=$ds_usertype&PageSort=$PageSort";
  105. ListPg($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  106. ?>
  107. </div>
  108. </div>
  109. </section>
  110. </main>
  111. <script>
  112. $(".faq--wrap li").on("click", function() {
  113. $(this).toggleClass("actv");
  114. });
  115. </script>
  116. <script>
  117. function go_search() {
  118. $("#searchForm").submit();
  119. }
  120. $(function() {
  121. $("#btn_search").on("click", function() {
  122. go_search();
  123. });
  124. })
  125. </script>
  126. <?php include("../include/inc_footer.php") ?>
  127. <?php
  128. mysql_close($connect);
  129. ?>