faq.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. $HEADER_LOC = 'main';
  4. $nav_title = "FAQ";
  5. $list_url = "faq.php";
  6. $cd_board = "03";
  7. $ds_kind = $_REQUEST["ds_kind"];
  8. $s_cd_user = $_SESSION['s_cd_user'];
  9. $s_cd_dealer = $_SESSION['s_cd_dealer'];
  10. $searchword = $_REQUEST['searchword'];
  11. // if ( ($ds_kind == "A" && empty($s_cd_user))
  12. // || ($ds_kind == "D" && empty($s_cd_dealer))
  13. // ){
  14. // AlertRedirect("잘못된 요청입니다.","/index.php");
  15. // }
  16. if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
  17. $PageSize=10; //목록개수설정
  18. $pagestartpoint=($PageNo-1)*$PageSize;
  19. $add_sql = "where cd_board='$cd_board' and ds_delind='N'";
  20. // $add_sql.=" and ds_kind='$ds_kind' ";
  21. if($searchword != ""){
  22. if($searchtype=="" || $searchtype==null){
  23. $add_sql.= " and (nm_title like '$searchword%' or nm_content like '$searchword%' )";
  24. }else{
  25. $add_sql.= " and $searchtype like '$searchword%'";
  26. }
  27. }
  28. $sql = "select count(*) from board_master $add_sql";
  29. $totalrows = @mysql_result(mysql_query($sql),0,0);
  30. ?>
  31. <?php include("../inc/inc_header.php"); ?>
  32. <main class="pb123">
  33. <section>
  34. <div class="sub--top--visual">
  35. <div class="contents--inner">
  36. <h2>고객 센터</h2>
  37. <p>이차조아에 대해 궁금하신 점이 있다면 무엇이든 물어보세요.</p>
  38. </div>
  39. </div>
  40. </section>
  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. <div class="faq--wrap">
  53. <div>
  54. <ul>
  55. <?php
  56. if($totalrows>0) {
  57. $r = mysql_query("SELECT * FROM board_master $add_sql ORDER BY ds_top desc, no_famally ASC, no_order ASC LIMIT $pagestartpoint,$PageSize");
  58. $i=1;
  59. while($col = mysql_fetch_array($r)) {
  60. $date = strtotime ($col['dt_insert']);
  61. $view_date = strtotime ("-1 day",time());
  62. if($date >= $view_date) {
  63. $newicon = " <img src='".ADMIN_PATH."img/i_new.gif' style='margin-top:1px;' /> ";
  64. } else {
  65. $newicon = "";
  66. }
  67. if($col['no_step']>0){
  68. $padding = $col['no_step'] * 8;
  69. $step = "<span style=\"padding-left:".$padding."px\"/>";
  70. }
  71. $tmpNum =$totalrows-($PageSize*($PageNo-1));
  72. $no = ($tmpNum - $i)+1;
  73. $actv_class = "";
  74. if($i == 1) {
  75. $actv_class = "actv";
  76. }
  77. ?>
  78. <li class="<?=$actv_class?>">
  79. <div class="faq--header">
  80. <i class="q--icon"></i>
  81. <h2><?=$col['nm_title']?></h2>
  82. </div>
  83. <div class="faq--body">
  84. <?=$col['nm_content']?>
  85. </div>
  86. </li>
  87. <?php
  88. $i++;
  89. }
  90. }else{
  91. ?>
  92. <li>
  93. <p>등록된 정보가 없습니다.</p>
  94. </li>
  95. <?php
  96. }
  97. ?>
  98. </ul>
  99. </div>
  100. </div>
  101. <div class="col-12 d-flex justify-content-center">
  102. <?php
  103. $url = "./$list_url?searchtype=$searchtype&searchword=$searchword&ds_status=$ds_status&ds_usertype=$ds_usertype&PageSort=$PageSort";
  104. ListMobilePg($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  105. ?>
  106. </div>
  107. </div>
  108. </section>
  109. </main>
  110. <script>
  111. $(".faq--wrap li").on("click", function() {
  112. $(this).toggleClass("actv");
  113. });
  114. </script>
  115. <script>
  116. function go_search() {
  117. $("#searchForm").submit();
  118. }
  119. $(function() {
  120. $("#btn_search").on("click", function() {
  121. go_search();
  122. });
  123. })
  124. </script>
  125. <?php include("../inc/inc_footer.php"); ?>
  126. <?
  127. mysql_close($connect);
  128. ?>