모바일 쇼핑몰 메인에 이벤트 출력 추가

This commit is contained in:
chicpro
2013-10-15 17:30:20 +09:00
parent 8959bda0af
commit e817960c5c
4 changed files with 163 additions and 6 deletions

99
mobile/shop/event.php Normal file
View File

@ -0,0 +1,99 @@
<?php
include_once('./_common.php');
$sql = " select * from {$g5['g5_shop_event_table']}
where ev_id = '$ev_id'
and ev_use = 1 ";
$ev = sql_fetch($sql);
if (!$ev['ev_id'])
alert('등록된 이벤트가 없습니다.');
$g5['title'] = $ev['ev_subject'];
include_once(G5_MSHOP_PATH.'/_head.php');
if ($is_admin)
echo '<div class="sev_admin"><a href="'.G5_ADMIN_URL.'/shop_admin/itemeventform.php?w=u&amp;ev_id='.$ev['ev_id'].'" class="btn_admin">이벤트 관리</a></div>';
?>
<script>
var itemlist_ca_id = "<?php echo $ev_id; ?>";
</script>
<script src="<?php echo G5_JS_URL; ?>/shop.list.js"></script>
<!-- 이벤트 시작 { -->
<?php
// 상단 HTML
echo '<div id="sev_hhtml">'.stripslashes($ev['ev_head_html']).'</div>';
// 상품 출력순서가 있다면
if ($sort != "")
$order_by = $sort.' '.$sortodr.' , b.it_order, b.it_id desc';
$error = "<img src='".G5_SHOP_URL."/img/no_item.gif' border=0>";
if ($skin)
$ev['ev_skin'] = $skin;
// 리스트 유형별로 출력
$list_file = G5_SHOP_SKIN_PATH."/{$ev['ev_skin']}";
if (file_exists($list_file))
{
include G5_MSHOP_SKIN_PATH.'/list.sort.skin.php';
// 상품 보기 타입 변경 버튼
include G5_MSHOP_SKIN_PATH.'/list.sub.skin.php';
// 총몇개 = 한줄에 몇개 * 몇줄
$items = $ev['ev_list_mod'] * $ev['ev_list_row'];
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page == "") $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $items;
$list = new item_list($ev['ev_skin'], $items, 1, $ev['ev_img_width'], $ev['ev_img_height']);
$list->set_event($ev['ev_id']);
$list->set_is_page(true);
$list->set_mobile(true);
$list->set_order_by($order_by);
$list->set_from_record($from_record);
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
$list->set_view('sns', true);
echo $list->run();
// where 된 전체 상품수
$total_count = $list->total_count;
// 전체 페이지 계산
$total_page = ceil($total_count / $items);
}
else
{
$i = 0;
$error = "<p>{$ev['ev_skin']} 파일을 찾을 수 없습니다.<p>관리자에게 알려주시면 감사하겠습니다.";
}
if ($i==0)
{
echo "<br>";
echo "<div align=center>$error</div>";
}
?>
<?php
$qstr .= 'skin='.$skin.'&amp;ev_id='.$ev_id.'&amp;sort='.$sort.'&amp;sortodr='.$sortodr;
echo get_paging($config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&amp;page=");
?>
<?php
// 하단 HTML
echo '<div id="sev_thtml">'.stripslashes($ev['ev_tail_html']).'</div>';
?>
<!-- } 이벤트 끝 -->
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

View File

@ -30,7 +30,7 @@ include_once(G5_MSHOP_PATH.'/shop.head.php');
$list->set_view('sns', true);
echo $list->run();
?>
<div><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=3">더 보기</a></div>
<div><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=1">더 보기</a></div>
</section>
<section class="sct_wrap">
@ -50,12 +50,12 @@ include_once(G5_MSHOP_PATH.'/shop.head.php');
$list->set_view('sns', true);
echo $list->run();
?>
<div><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=1">더 보기</a></div>
<div><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=2">더 보기</a></div>
</section>
<section class="sct_wrap">
<header>
<h2><a href="<?php echo G4_SHOP_URL; ?>/listtype.php?type=2">추천상품</a></h2>
<h2>추천상품</h2>
<p class="sct_wrap_hdesc"><?php echo $config['cf_title']; ?> 추천상품 모음</p>
</header>
<?php
@ -70,11 +70,12 @@ include_once(G5_MSHOP_PATH.'/shop.head.php');
$list->set_view('sns', true);
echo $list->run();
?>
<div><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=3">더 보기</a></div>
</section>
<section class="sct_wrap">
<header>
<h2><a href="<?php echo G4_SHOP_URL; ?>/listtype.php?type=4">인기상품</a></h2>
<h2>인기상품</h2>
<p class="sct_wrap_hdesc"><?php echo $config['cf_title']; ?> 인기상품 모음</p>
</header>
<?php
@ -89,11 +90,12 @@ include_once(G5_MSHOP_PATH.'/shop.head.php');
$list->set_view('sns', true);
echo $list->run();
?>
<div><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=4">더 보기</a></div>
</section>
<section class="sct_wrap">
<header>
<h2><a href="<?php echo G4_SHOP_URL; ?>/listtype.php?type=5">할인상품</a></h2>
<h2>할인상품</h2>
<p class="sct_wrap_hdesc"><?php echo $config['cf_title']; ?> 할인상품 모음</p>
</header>
<?php
@ -108,8 +110,26 @@ include_once(G5_MSHOP_PATH.'/shop.head.php');
$list->set_view('sns', true);
echo $list->run();
?>
<div><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=5">더 보기</a></div>
</section>
<?php
$hsql = " select ev_id, ev_subject, ev_subject_strong from {$g5['g5_shop_event_table']} where ev_use = '1' order by ev_id desc ";
$hresult = sql_query($hsql);
if(mysql_num_rows($hresult)) {
?>
<section class="sct_wrap">
<header>
<h2>이벤트</h2>
<p class="sct_wrap_hdesc"><?php echo $config['cf_title']; ?> 이벤트 모음</p>
</header>
<?php include_once(G5_MSHOP_SKIN_PATH.'/main.event.skin.php'); ?>
</section>
<?php
}
?>
</div>
</div>

View File

@ -0,0 +1,33 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<!-- 쇼핑몰 이벤트 시작 { -->
<ul>
<?php
for ($i=0; $row=sql_fetch_array($hresult); $i++)
{
echo '<li>';
$href = G5_SHOP_URL.'/event.php?ev_id='.$row['ev_id'];
$event_img = G5_DATA_PATH.'/event/'.$row['ev_id'].'_m'; // 이벤트 이미지
if (file_exists($event_img)) { // 이벤트 이미지가 있다면 이미지 출력
echo '<a href="'.$href.'" class="sev_img"><img src="'.G5_DATA_URL.'/event/'.$row['ev_id'].'_m" alt="'.$row['ev_subject'].'"></a>'.PHP_EOL;
} else { // 없다면 텍스트 출력
echo '<a href="'.$href.'" class="sev_text">';
if ($row['ev_subject_strong']) echo '<strong>';
echo $row['ev_subject'];
if ($row['ev_subject_strong']) echo '</strong>';
echo '</a>'.PHP_EOL;
}
echo '</li>'.PHP_EOL;
}
if ($i==0)
echo '<li id="sev_empty">이벤트 없음</li>'.PHP_EOL;
?>
</ul>
<!-- } 쇼핑몰 이벤트 끝 -->

View File

@ -1,6 +1,11 @@
<?php
include_once('./_common.php');
if (G5_IS_MOBILE) {
include_once(G5_MSHOP_PATH.'/event.php');
return;
}
$sql = " select * from {$g5['g5_shop_event_table']}
where ev_id = '$ev_id'
and ev_use = 1 ";
@ -16,7 +21,7 @@ if ($is_admin)
?>
<script>
var itemlist_ca_id = "<?php echo $ca_id; ?>";
var itemlist_ca_id = "<?php echo $ev_id; ?>";
</script>
<script src="<?php echo G5_JS_URL; ?>/shop.list.js"></script>