{include file="$template_path/html/header.html"}
<link href="{$template_data}css/custom/resource.css" rel="stylesheet" />
<link href="{$template_data}css/custom/mobile.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
{include file="$template_path/html/pagenav.html"}
<div class="pagetit pagetabs">
    <div class="navblock">
        <ul class="titnav clr">
            <li><a href="/" title="主页">主页</a></li>
            <li class="pipe">&gt;</li>
            <li><a href="/{$languageURL}categories/all/" title="文件">文件</a></li>
            <li class="pipe">&gt;</li>
            {foreach from=$item.categories item=e}
            {foreach from=$e item=c name=foo}
            <li><a href="/{$languageURL}categories/{$categories[$c].id}" title="{$categories[$c].name}">{$categories[$c].name}</a></li>
            {if !$smarty.foreach.foo.last}<li class="pipe">&gt;</li>{/if}
            {/foreach}
            {/foreach}
        </ul>
        <h2>{$item.name}</h2>
        <ul class="pagetab clr">
            <li><a href="/{$languageURL}items/{$item.id}" title="文件详情">作品详情</a></li>
            {if $faqs>0 || check_login_bool() && $item.user_id == $smarty.session.user.user_id}
            <li><a{if $smarty.get.controller == 'faq'} class="active"{/if} href="/{$languageURL}items/faq/{$item.id}" title="常见问题解答">常见问题解答</a></li>
            {/if}
            {if check_login_bool() && $item.user_id == $smarty.session.user.user_id}
            <li><a{if $smarty.get.controller == 'edit'} class="active"{/if} href="/{$languageURL}items/edit/{$item.id}" title="编辑">编辑</a></li>
            {/if}
            {if check_login_bool() && $item.user_id == $smarty.session.user.user_id}
            <li><a{if $smarty.get.controller == 'record'} class="active"{/if} href="/{$languageURL}items/record/{$item.id}" title="购买记录">购买记录</a></li>
            {/if}
            <li><a{if $smarty.get.controller == 'comments'} class="active"{/if} href="/{$languageURL}items/comments/{$item.id}" title="评论">评论</a></li>
        </ul>
    </div>
</div>
<div class="resourcebg">
    <div class="pageblock clr">
        {$errorMessage}
        {include file="$root_path/apps/items/views/purchase_panel.html"}
        <div class="leftdetail">
            {if $record}
            <div class="faqlist" id="faq-index">
                <table cellspacing="0" cellpadding="0" class="general_table" id="sales_table">
                <thead>
                    <tr>
                        <th>用户名</th>
                        <th>昵称</th>
                        <th>时间</th>
                        <th>金额</th>
                    </tr>
                </thead>
                <tbody>
                    {foreach from=$record item=f}
                    <tr>
                    <td>{$f.username}</td>
                    <td>{$f.nickname}</td>
                    <td>{$f.datetime}</td>
                    <td>{$f.price}</td>
                    </tr>
                    {/foreach}
                </tbody>
                </table>
            </div>
            {else}
            <div class="nofaqblock">尚无购买记录</div>
            {/if}
            <div class="otheritems clr">
                {if $otherItems}
                {foreach from=$otherItems item=i}
                <a href="/{$languageURL}items/{$i.id}"><img alt="{$i.name|escape}" border="0" class="landscape-image-magnifier preload no_preview" data-item-author="作者 {$item.user.username}" data-item-category="{foreach from=$i.categories item=e}{foreach from=$e item=c name=foo}{$categories[$c].name} {if !$smarty.foreach.foo.last} \ {/if}{/foreach}{/foreach}" data-item-cost="{if $i.free_file == 'true'}0{else}{$i.price}{/if}" data-item-name="{$i.name|escape}" data-preview-height="" data-preview-url="{$data_server}uploads/items/{$i.id}/{$i.theme_preview}" data-preview-width="" src="{$data_server}uploads/items/{$i.id}/{$i.thumbnail}" title="{$i.name|escape}" /></a>
                {/foreach}
                {/if}
                {if $otherItemsCount < 6}
                {section name=foo start=$otherItemsCount loop=6 step=1}
                <span class="emptyitem"></span>
                {/section}
                {/if}
            </div>
            <a class="otherlink" href="/{$languageURL}user/portfolio/{$item.user.username}">{$item.user.nickname}的其它作品</a>
        </div>
        {include file="$root_path/apps/items/views/rightside.html"}
    </div>
</div>
{include file="$template_path/html/footer.html"}
</body>
</html>