<!--{eval
    $_HEAD['title'] = ($subject ? ($subject[name]  . ',' . $subject[subname] . ',') : '') . (isset($catid)?$category[$catid][name]:'') . $MOD[name] . $_CFG['titlesplit'] . $MOD[subtitle];
}-->
{template modoer_header}
<div id="body">

    <div class="link_path">
        <em>现有<span class="font_2">$total</span>个有效的优惠券</em>
        <a href="{url modoer/index}">{lang global_index}</a>&nbsp;&raquo;&nbsp;{print implode('&nbsp;&raquo;&nbsp;', $urlpath)}
    </div>

    <div id="coupon_left">

		<div class="g-list-category">
			<div class="g-list-category-type">
                <h3>分类:</h3>
                <ul class="g-list-category-class">
                    {get:coupon val=category()}
                    <li$active[catid][$val[catid]]><a href="{url coupon/index/catid/$val[catid]}">$val[name]</a></li>
                    {/get}
                </ul>
                <div class="clear"></div>
            </div>
        </div>
		<div class="subrail">
			排序:
            <span$active[order][dateline]><a href="{url coupon/list/sid/$sid/catid/$catid/order/dateline}">最新发布</a></span>
            <span$active[order][pageview]><a href="{url coupon/list/sid/$sid/catid/$catid/order/pageview}">浏览量</a></span>
            <span$active[order][effect1]><a href="{url coupon/list/sid/$sid/catid/$catid/order/effect1}">最有用的</a></span>
            <span$active[order][comments]><a href="{url coupon/list/sid/$sid/catid/$catid/order/comments}">最多评论</a></span>
		</div>
        <div class="mainrail coupon-view">
            {dbres $list $val}
            <div class="il_coupon">
                <h2>[<a href="{url coupon/index/catid/$val[catid]}">$category[$val[catid]][name]</a>]&nbsp;<a href="{url coupon/detail/id/$val[couponid]}">$val[subject]</a></h2>
                <div class="thumb"><a href="{url coupon/detail/id/$val[couponid]}"><img src="{URLROOT}/$val[thumb]" alt="$val[subject]" /></a></div>
                <ul class="info">
                    <li class="full">商户：<a href="{url item/detail/id/$val[sid]}">$val[name]{if $val[subname]}($val[subname]){/if}</a></li>
                    <li>开始日期：{date $val[starttime], 'Y-m-d'}</li>
                    <li>截止日期：{date $val[endtime], 'Y-m-d'}</li>
                    <li class="full">现有<span class="font_2">$val[pageview]</span>次浏览，<span class="font_2">$val[comments]</span>个评论，其中有<span class="font_2">$val[effect1]</span>人认为有用</li>
                    <li class="full">优惠：$val[des]</li>
                </ul>
                <div class="clear"></div>
            </div>
            {/dbres}
            <!--{if $multipage}--><div class="multipage">$multipage</div><!--{/if}-->
            <!--{if !$total}-->
            <div class="messageborder">暂无数据</a>。</div>
            <!--{/if}-->
        </div>

    </div>

    <div id="coupon_right">

            <script type="text/javascript">loadscript('item');</script>
            <div class="mainrail rail-border-3">
                <h2 class="rail-h-2"><b><a href="{url item/detail/id/$subject[sid]}"><span class="font_2">$subject[name]&nbsp;$subject[subname]</span></a></b></h2>
                <div class="subject">
                    <!--{eval $reviewcfg = $_G['loader']->variable('config','review');}-->
                    <p class="start start{print get_star($subject[avgsort],$reviewcfg[scoretype])}"></p>
                    <table class="subject_field_list" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td colspan="2"><span class="font_2">$subject[reviews]</span>点评,
                            <span class="font_2">$subject[guestbooks]</span>留言,
                            <span class="font_2">$subject[pageviews]</span>浏览</td>
                        </tr>
                        $subject_field_table_tr
                    </table>
                    <a class="abtn1" href="{url review/member/ac/add/type/item_subject/id/$subject[sid]}"><span>我要点评</span></a>
                    <a class="abtn2" href="javascript:add_favorite($subject[sid]);"><span>收藏</span></a>
                    <a class="abtn2" href="{url item/detail/id/$subject[sid]/view/guestbook}#guestbook"><span>留言</span></a>
                    <div class="clear"></div>
                </div>
                <div style="border-bottom:1px dashed #ccc;margin:5px;"></div>
                <!--{eval $model=$I->get_model($subject[catid],1);}-->
                <!--{if $model[usearea]}-->
                <div class="mainrail">
                    <!--{eval $mapparam = array(
                        'width' => '290',
                        'height' => '245',
                        'title' => $subject[name] . $subject[subname],
                        'p' => $subject[mappoint],
                        'show' => $subject[mappoint]?1:0,
                    );}-->
                    <iframe src="{URLROOT}/index.php?act=map&{print url_implode($mapparam)}" frameborder="0" scrolling="no" height="245" width="290"></iframe>
                    <div style="text-align:center;margin:5px 0;">
                        <!--{if !$subject['mappoint']}-->
                        <a href="javascript:post_map($subject[sid], $subject[pid]);">地图未标注，我来标注</a>
                        <!--{else}-->
                        <a href="javascript:show_bigmap();">查看大图</a>&nbsp;
                        <a href="javascript:post_map($subject[sid], $subject[pid]);">报错</a>
                        <!--{/if}-->
                    </div>
                </div>
                <script type="text/javascript">
                    function show_bigmap() {
                        <!--{eval $mapparam = array(
                            'width' => '600',
                            'height' => '400',
                            'title' => $subject[name] . $subject[subname],
                            'p' => $subject[mappoint],
                            'show' => $subject[mappoint]?1:0,
                        );}-->
                        var src = "{URLROOT}/index.php?act=map&{print url_implode($mapparam)}";
                        var html = '<iframe src="' + src + '" frameborder="0" scrolling="no" width="100%" height="400" id="ifupmap_map"></iframe>';
                        dlgOpen('查看大图', html, 600, 450);
                    }
                </script>
                <!--{/if}-->
            </div>
    </div>

</div>
<!--{eval footer();}-->