qna_list.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].'/common/auth_login_chk.php';
  4. $cd_board = "02";
  5. $ds_kind = $_REQUEST["ds_kind"];
  6. $s_cd_user = $_SESSION['s_cd_user'];
  7. $s_cd_dealer = $_SESSION['s_cd_dealer'];
  8. $s_cd_dealer_p = $_SESSION['s_cd_dealer_p'];
  9. $s_ds_type = $_SESSION['s_ds_type'];
  10. if ( !($ds_kind == "A" || $ds_kind == "D")
  11. || ($ds_kind == "A" && empty($s_cd_user))
  12. || ($ds_kind == "D" && empty($s_cd_dealer_p))
  13. ){
  14. AlertRedirect("잘못된 요청입니다.","/index.php");
  15. }
  16. if($ds_kind == "D"){
  17. $cd_user = $s_cd_dealer_p;
  18. }else{
  19. $cd_user = $s_cd_user;
  20. }
  21. if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
  22. $PageSize=10; //목록개수설정
  23. $pagestartpoint=($PageNo-1)*$PageSize;
  24. $sql = "where cd_board='$cd_board' and ds_delind='N'";
  25. $sql = $sql." and ds_kind='$ds_kind' ";
  26. $sql = $sql." and cd_user='$cd_user' ";
  27. if($searchword != ""){
  28. if($searchtype=="" || $searchtype==null){
  29. $sql = $sql. " and (nm_title like '$searchword%' or nm_content like '$searchword%' or cd_userid like '$searchword%')";
  30. }else{
  31. $sql = $sql. " and $searchtype like '$searchword%'";
  32. }
  33. }
  34. $totalrows = @mysql_result(mysql_query("select count(*) from board_master $sql"),0,0);
  35. ?>
  36. <? include("../include/inc_top.php") ?>
  37. <? include("../include/inc_header.php") ?>
  38. <section id="wrap">
  39. <section id="visual" class="visual_mypage">
  40. <h2>마이페이지</h2>
  41. <p>쉽고 간편한 내차팔기, 견적산출, 최종 매각까지 어떤 수수료도 요구하지 않습니다.</p>
  42. </section>
  43. <section id="content">
  44. <?
  45. if($ds_kind=="D"){
  46. ?>
  47. <? include("./inc_menu_main_dealer.php"); ?>
  48. <? include("./inc_menu_dealer.php"); ?>
  49. <?
  50. }else{
  51. // /common/lib/func.php 1662에 정의됨
  52. $is_upro_member = getUproMember($_SESSION['s_cd_user']);
  53. $depth_info = array("NAME" => array("문의내역", "문의내역"));
  54. if($is_upro_member) {
  55. include_once($_SERVER['DOCUMENT_ROOT']."/mypage/inc_menu_member_company.php");
  56. }else {
  57. include_once($_SERVER['DOCUMENT_ROOT']."/mypage/inc_menu_main_member.php");
  58. }
  59. }
  60. ?>
  61. <h3>문의내역</h3>
  62. <table class="tbl_v">
  63. <colgroup>
  64. <col width="7%">
  65. <col width="*">
  66. <col width="13%">
  67. <col width="13%">
  68. </colgroup>
  69. <thead>
  70. <tr>
  71. <th>번호</th>
  72. <th>제목</th>
  73. <th>작성일</th>
  74. <th>답변여부</th>
  75. </tr>
  76. </thead>
  77. <tbody>
  78. <?
  79. if($totalrows>0) {
  80. $r = mysql_query("SELECT * FROM board_master $sql ORDER BY ds_top desc, no_famally ASC, no_order ASC LIMIT $pagestartpoint,$PageSize");
  81. $i=1;
  82. while($col = mysql_fetch_array($r)) {
  83. $date = strtotime ($col[dt_insert]);
  84. $view_date = strtotime ("-1 day",time());
  85. if($date >= $view_date) {
  86. $newicon = " <img src='".ADMIN_PATH."img/i_new.gif' style='margin-top:1px;' /> ";
  87. } else {
  88. $newicon = "";
  89. }
  90. if($col[no_step]>0){
  91. $padding = $col[no_step] * 8;
  92. $step = "<span style=\"padding-left:".$padding."px\"/>";
  93. }
  94. $tmpNum =$totalrows-($PageSize*($PageNo-1));
  95. $no = ($tmpNum - $i)+1;
  96. ?>
  97. <tr onclick="location.href='./qna_view.php?cd_board=<?=$cd_board?>&ds_kind=<?=$ds_kind?>&cd_seq=<?=$col[cd_seq]?>&PageNo=<?=$PageNo?>';" style="cursor: pointer; cursor: hand;">
  98. <td><?=$no?></td>
  99. <? if($cd_board=="99"){?>
  100. <td width="10%" align="center" class="list03"><img src="<?=UPLOAD_PATH?>board/board_<?=$cd_board?>/<?=$col[nm_file]?>" width="50"/></td>
  101. <?}?>
  102. <td class="al"><?=text_cut($col[nm_title],50)?></td>
  103. <td><?=$col[dt_insert]?></td>
  104. <? if($cd_board=="02"){?>
  105. <td><?=($col[nm_reply] == "") ? "미답변" : "답변완료" ?></td>
  106. <?}?>
  107. </tr>
  108. <?
  109. $i++;
  110. }
  111. }else{
  112. ?>
  113. <tr>
  114. <td colspan="4">등록된 정보가 없습니다.</td>
  115. </tr>
  116. <?
  117. }
  118. ?>
  119. </tbody>
  120. </table>
  121. <div class="paging">
  122. <?
  123. $url = "/mypage/qna_list.php?cd_board=$cd_board&searchtype=$searchtype&searchword=$searchword&ds_kind=$ds_kind";
  124. ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  125. ?>
  126. </div>
  127. <div class="btn_right">
  128. <a href="./qna_write.php?cd_board=<?=$cd_board?>&ds_kind=<?=$ds_kind?>" class="button">문의하기</a>
  129. </div>
  130. </section>
  131. </section>
  132. <? include("../include/inc_footer.php") ?>
  133. <? include("../include/inc_bottom.php") ?>
  134. <?
  135. mysql_close($connect);
  136. ?>