1:1문의 동일한 답변 문의드립니다.

현재 저희 자사몰에 1:1 문의가 커스텀 되어있는데
각 회원마다 어드민이 답변을 하면
최초 답변한 1번이 모든 답변에 달리더라구요...
1번만 불러오도록되어있는거같은데
itemqalist 확인해보니
$thumbnail_width = 500;
$num = $total_count - ($page - 1) * $rows;
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$iq_subject = conv_subject($row['iq_subject'],50,"…");
$is_secret = false;
if($row['iq_secret']) {
$iq_subject .= ' ';
if($is_admin || $member['mb_id' ] == $row['mb_id']) {
$iq_question = get_view_thumbnail(conv_content($row['iq_question'], 1), $thumbnail_width);
} else {
$iq_question = '비밀글로 보호된 문의입니다.';
$is_secret = true;
}
} else {
$iq_question = get_view_thumbnail(conv_content($row['iq_question'], 1), $thumbnail_width);
}
$it_href = shop_item_url($row['it_id']);
if ($row['iq_answer'])
{
$iq_answer = get_view_thumbnail(conv_content($row['iq_answer'], 1), $thumbnail_width);
$iq_stats = '답변완료';
$iq_style = 'sit_qaa_done';
$is_answer = true;
} else {
$iq_stats = '답변대기';
$iq_style = 'sit_qaa_yet';
$iq_answer = '답변이 등록되지 않았습니다.';
$is_answer = false;
}
if ($i == 0) echo '
- ';
이부분이 문제인거같은데
혹시 해결방법이있을까요?
답변 7개
이게 답변인거같은데 이걸 뿌려주는 반복문이 for ($i=0; $row=sql_fetch_array($result); $i++) 이 부분이고, $result 가 어디서부터 오는지 봐야할거같습니다. 그 안에서 쿼리문이 어떻게 작성되어있는지 봐야할거같은데요
답변에 대한 댓글 9개
<div id="qalist">
<h2>1:1 문의</h2>
<div class="btn_wrap">
<a href="<?php echo G5_BBS_URL?>/customer.php?bo_table=qa" class="btn_write">1:1문의하기</a>
</div>
<div class="tbl_head03 tbl_wrap">
<table>
<thead>
<tr>
<th scope="col" width="10%">번호</th>
<th scope="col" width="50%">내용</th>
<th scope="col" width="10%">답변여부</th>
<th scope="col" width="10%">작성일</th>
</tr>
</thead>
<tbody>
<?php
for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td align="center"><?php echo $list[$i]['num']; ?></td>
<td class="td_subject">
<div class="qa_subject">
<span class="bo_cate_link">[<?php echo $list[$i]['category']; ?>]</span>
<?php echo $list[$i]['subject']; ?>
<?php if ($list[$i]['icon_file']) echo " <i class=\"fa fa-download\" aria-hidden=\"true\"></i>" ; ?>
</div>
<div class="qa_content">
<div class="sit_qa_questions">
<span class="qa_questions_icon">문의 내용 :</span>
<?php echo $list[$i]['content']; ?>
</div>
<?php foreach($anslist as $j=> $value) {
$start = $j+1;
?>
<div class="sit_qa_answer">
<span class="qa_answer_icon">문의 답변 <?=$start?> :</span>
<?php echo $value['content']; ?>
</div>
<?php } ?>
</div>
</td>
<td align="center"><span class="<?php echo ($list[$i]['qa_status'] ? 'sit_qaa_done' : 'sit_qaa_yet'); ?>"><?php echo ($list[$i]['qa_status'] ? '답변완료' : '답변대기'); ?></span></td>
<td align="center"><?php echo $list[$i]['date']; ?></td>
</tr>
<?php } ?>
<?php if ($i == 0) { echo '<tr><td colspan="'.$colspan.'" class="empty_table">문의내역이 없습니다.</td></tr>'; } ?>
</tbody>
</table>
</div>
이쪽에서 불러들여오는거같습니다...
<div class="qa_content">
<div class="sit_qa_questions">
<span class="qa_questions_icon">문의 내용 :</span>
<?php echo $list[$i]['content']; ?>
</div>
<?php foreach($anslist as $j=> $value) {
$start = $j+1;
?>
<div class="sit_qa_answer">
<span class="qa_answer_icon">문의 답변 <?=$start?> :</span>
<?php echo $value['content']; ?>
</div>
<?php } ?>
</div>
[/code]
이 부분 같은데여 $anslist 요걸 print_r($anslist) 로 찍어보세요
<div class="sit_qa_questions">
<span class="qa_questions_icon">문의 내용 :</span>
<?php echo $list[$i]['content']; ?>
</div>
<?php foreach(print_r($anslist) as $j=> $value) {
$start = $j+1;
?>
<div class="sit_qa_answer">
<span class="qa_answer_icon">문의 답변 <?=$start?> :</span>
<?php echo $value['content']; ?>
</div>
이렇게 변경하면될까요?
<div class="qa_content">
<div class="sit_qa_questions">
<span class="qa_questions_icon">문의 내용 :</span>
<?php echo $list[$i]['content']; ?>
</div>
<!-- 요기요 -->
<?php print_r ($anslist) ?>
<?php foreach($anslist as $j=> $value) {
$start = $j+1;
?>
<div class="sit_qa_answer">
<span class="qa_answer_icon">문의 답변 <?=$start?> :</span>
<?php echo $value['content']; ?>
</div>
<?php } ?>
</div>
[/code]
댓글을 작성하려면 로그인이 필요합니다.
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('', 0);
?>
$thumbnail_width = 500;
$num = $total_count - ($page - 1) * $rows;
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$iq_subject = conv_subject($row['iq_subject'],50,"…");
$is_secret = false;
if($row['iq_secret']) {
$iq_subject .= ' ';
if($is_admin || $member['mb_id' ] == $row['mb_id']) {
$iq_question = get_view_thumbnail(conv_content($row['iq_question'], 1), $thumbnail_width);
} else {
$iq_question = '비밀글로 보호된 문의입니다.';
$is_secret = true;
}
} else {
$iq_question = get_view_thumbnail(conv_content($row['iq_question'], 1), $thumbnail_width);
}
$it_href = shop_item_url($row['it_id']);
if ($row['iq_answer'])
{
$iq_answer = get_view_thumbnail(conv_content($row['iq_answer'], 1), $thumbnail_width);
$iq_stats = '답변완료';
$iq_style = 'sit_qaa_done';
$is_answer = true;
} else {
$iq_stats = '답변대기';
$iq_style = 'sit_qaa_yet';
$iq_answer = '답변이 등록되지 않았습니다.';
$is_answer = false;
}
if ($i == 0) echo '
- ';
-
- 작성자
- 작성일
?>
$num--;
}
if ($i > 0) echo '
if ($i == 0) echo '
자료가 없습니다.
';?>
$(function(){
// 상품문의 더보기
$(".sqa_con_btn button").click(function(){
var $con = $(this).parent().prev();
if($con.is(":visible")) {
$con.slideUp();
$(this).html("내용보기 ");
} else {
$(".sps_con_btn button").html("내용보기 ");
$("div[id^=sps_con]:visible").hide();
$con.slideDown(
function() {
// 이미지 리사이즈
$con.viewimageresize2();
}
);
$(this).html("내용닫기 ");
}
});
});
댓글을 작성하려면 로그인이 필요합니다.
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('', 0);
?>
$thumbnail_width = 500;
$num = $total_count - ($page - 1) * $rows;
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$iq_subject = conv_subject($row['iq_subject'],50,"…");
$is_secret = false;
if($row['iq_secret']) {
$iq_subject .= ' ';
if($is_admin || $member['mb_id' ] == $row['mb_id']) {
$iq_question = get_view_thumbnail(conv_content($row['iq_question'], 1), $thumbnail_width);
} else {
$iq_question = '비밀글로 보호된 문의입니다.';
$is_secret = true;
}
} else {
$iq_question = get_view_thumbnail(conv_content($row['iq_question'], 1), $thumbnail_width);
}
$it_href = shop_item_url($row['it_id']);
if ($row['iq_answer'])
{
$iq_answer = get_view_thumbnail(conv_content($row['iq_answer'], 1), $thumbnail_width);
$iq_stats = '답변완료';
$iq_style = 'sit_qaa_done';
$is_answer = true;
} else {
$iq_stats = '답변대기';
$iq_style = 'sit_qaa_yet';
$iq_answer = '답변이 등록되지 않았습니다.';
$is_answer = false;
}
if ($i == 0) echo '
- ';
-
- 작성자
- 작성일
?>
$num--;
}
if ($i > 0) echo '
if ($i == 0) echo '
자료가 없습니다.
';?>
$(function(){
// 상품문의 더보기
$(".sqa_con_btn button").click(function(){
var $con = $(this).parent().prev();
if($con.is(":visible")) {
$con.slideUp();
$(this).html("내용보기 ");
} else {
$(".sps_con_btn button").html("내용보기 ");
$("div[id^=sps_con]:visible").hide();
$con.slideDown(
function() {
// 이미지 리사이즈
$con.viewimageresize2();
}
);
$(this).html("내용닫기 ");
}
});
});
댓글을 작성하려면 로그인이 필요합니다.
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인