쇼핑몰: #233 사용후기 마크업 및 스타일

This commit is contained in:
whitedot
2013-06-17 11:21:04 +09:00
parent 97d9e2e097
commit c042e9b77e
4 changed files with 140 additions and 139 deletions

View File

@ -10,77 +10,74 @@ $itemuse_list = "./itemuselist.php";
include_once(G4_PATH.'/head.sub.php');
?>
<table id="sit_use_tbl" class="basic_tbl">
<thead>
<tr>
<th scope="col">번호</th>
<th scope="col">제목</th>
<th scope="col">작성자</th>
<th scope="col">작성일</th>
<th scope="col">평점</th>
</tr>
</thead>
<tbody>
<?php
/*
여분필드 용도
wr_1 : 상품코드
wr_2 : 상품명
wr_3 : 평점 1~5
wr_4 : 관리자확인
*/
//$sql_common = " from `{$g4['write_prefix']}itemuse` where wr_is_comment = 0 and wr_1 = '{$it['it_id']}' and wr_4 = '1' ";
$sql_common = " from `{$g4['shop_item_use_table']}` where it_id = '{$it_id}' and is_confirm = '1' ";
<section id="sit_use_list">
<h3>등록된 사용후기</h3>
// 테이블의 전체 레코드수만 얻음
$sql = " select COUNT(*) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
<?php
/*
여분필드 용도
wr_1 : 상품코드
wr_2 : 상품명
wr_3 : 평점 1~5
wr_4 : 관리자확인
*/
//$sql_common = " from `{$g4['write_prefix']}itemuse` where wr_is_comment = 0 and wr_1 = '{$it['it_id']}' and wr_4 = '1' ";
$sql_common = " from `{$g4['shop_item_use_table']}` where it_id = '{$it_id}' and is_confirm = '1' ";
$rows = 5;
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page == "") $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 레코드 구함
// 테이블의 전체 레코드수만 얻음
$sql = " select COUNT(*) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$sql = "select * $sql_common order by is_id desc limit $from_record, $rows ";
$result = sql_query($sql);
$rows = 5;
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page == "") $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 레코드 구함
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$is_num = $total_count - ($page - 1) * $rows - $i;
$is_star = get_star($row['is_score']);
$is_name = get_text($row['is_name']);
$is_subject = conv_subject($row['is_subject'],50,"…");
//$is_content = ($row['wr_content']);
$is_content = get_view_thumbnail($row['is_content'], 300);
$is_time = substr($row['is_time'], 2, 8);
$is_href = './itemuselist.php?bo_table=itemuse&amp;wr_id='.$row['wr_id'];
$sql = "select * $sql_common order by is_id desc limit $from_record, $rows ";
$result = sql_query($sql);
// http://stackoverflow.com/questions/6967081/show-hide-multiple-divs-with-jquery?answertab=votes#tab-top
?>
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$is_num = $total_count - ($page - 1) * $rows - $i;
$is_star = get_star($row['is_score']);
$is_name = get_text($row['is_name']);
$is_subject = conv_subject($row['is_subject'],50,"…");
//$is_content = ($row['wr_content']);
$is_content = get_view_thumbnail($row['is_content'], 300);
$is_time = substr($row['is_time'], 2, 8);
$is_href = './itemuselist.php?bo_table=itemuse&amp;wr_id='.$row['wr_id'];
<tr>
<td class="td_num"><?php echo $is_num; ?><span class="sound_only">번</span></td>
<td>
<a href="#sit_use" class="use_href" onclick="return false;" target="<?php echo $i; ?>"><?php echo $is_subject; ?></a>
<div id="use_div<?php echo $i; ?>" class="use_div" style="display:none;">
<?php echo $is_content; ?>
</div>
</td>
<td><?php echo $is_name; ?></td>
<td><?php echo $is_time; ?></td>
<td><img src="<?php echo G4_URL; ?>/img/shop/s_star<?php echo $is_star; ?>.png" alt="별<?php echo $is_star; ?>개"></td>
</tr>
// http://stackoverflow.com/questions/6967081/show-hide-multiple-divs-with-jquery?answertab=votes#tab-top
<?php
}
if ($i == 0) echo '<ol id="sit_use_ol">';
?>
if (!$i) {
echo '<tr><td colspan="5" class="empty_table">등록된 사용후기가 없습니다.</td></tr>';
}
?>
</tbody>
</table>
<li class="sit_use_li">
<button type="button" class="sit_use_li_title" onclick="javascript:qa_menu('sit_use_con_<?php echo $i; ?>')"><b><?php echo $is_num; ?>.</b> <?php echo $is_subject; ?></button>
<dl class="sit_use_dl">
<dt>작성자</dt>
<dd><?php echo $is_name; ?></dd>
<dt>작성일</dt>
<dd><?php echo $is_time; ?></dd>
<dt>선호도<dt>
<dd class="sit_use_star"><img src="<?php echo G4_URL; ?>/img/shop/s_star<?php echo $is_star; ?>.png" alt="별<?php echo $is_star; ?>개"></dd>
</dl>
<div id="sit_use_con_<?php echo $i; ?>" class="sit_use_con">
<p>
<?php echo $is_content; // 사용후기 내용 ?>
</p>
</div>
</li>
<?php }
if ($i >= 0) echo '</ol>';
if (!$i) echo '<p class="sit_empty">사용후기가 없습니다.</p>';
?>
</section>
<?php
// 현재페이지, 총페이지수, 한페이지에 보여줄 행, URL
@ -124,7 +121,7 @@ function itemuse_page($write_pages, $cur_page, $total_page, $url, $add="")
echo itemuse_page(10, $page, $total_page, "./itemuse.php?it_id=$it_id&amp;page=", "");
?>
<div class="sit_use_btn">
<div id="sit_use_wbtn">
<!-- <a href="javascript:itemusewin('it_id=<?php echo $it_id; ?>');">사용후기 쓰기<span class="sound_only"> 새 창</span></a> -->
<a href="<?php echo $itemuse_form; ?>" id="itemuse_form" onclick="return false;" class="btn02">사용후기 쓰기<span class="sound_only"> 새 창</span></a>
<a href="<?php echo $itemuse_list; ?>" id="itemuse_list" class="btn01">더보기</a>