<#if !startVisitDate?has_content>
    <#assign startVisitDate=(.now?long-7*24*3600*1000)?number_to_date/>
</#if>
<@visit.itemList startVisitDate=startVisitDate endVisitDate=endVisitDate dayAnalytics=dayAnalytics itemType=itemType itemId=itemId pageIndex=pageNum pageSize=numPerPage>
<div class="pageHeader card">
    <form class="pagerForm"  action="visit/item.html" autocomplete="off" onsubmit="return divSearch(this,'visitBox');" method="post">
        <#include "../include_page/parameters.html"/>
        <div class="searchBar">
            <ul class="searchContent">
                <li>
                    <label><@t.page 'visit.visit_date'/>:</label>
                    <input type="text" name="startVisitDate" class="date" size="10" dateFmt="yyyy-MM-dd" maxDate="{%y}-%M-{%d}" value="${startVisitDate!}"/>
                    <a class="inputDateButton" href="javascript:void(0);"></a>
                    <span>-</span>
                    <input type="text" name="endVisitDate" class="date" size="10" dateFmt="yyyy-MM-dd" maxDate="{%y}-%M-{%d+1}" value="${endVisitDate!}"/>
                    <a class="inputDateButton" href="javascript:void(0);"></a>
                </li>
                <li>
                    <select class="combox" name="dayAnalytics">
                        <option value><@t.page 'analytics.type'/></option>
                        <option value="true"${(!(dayAnalytics?has_content)||"true"=dayAnalytics)?then(' selected="true"','')?no_esc}><@t.page 'visit.hour_analytics.day'/></option>
                        <option value="false"${(dayAnalytics?has_content&&"false"=dayAnalytics)?then(' selected="true"','')?no_esc}><@t.page 'total'/></option>
                    </select>
                </li>
                <li>
                    <label><@t.page 'item_type'/>:</label>
                    <input type="text" name="itemType" value="${itemType!}"/>
                </li>
                <li>
                    <label><@t.page 'item'/>:</label>
                    <input type="text" name="itemId" value="${itemId!}"/>
                </li>
            </ul>
            <div class="subBar">
                <ul>
                    <li>
                        <button type="submit" class="buttonActive"><@t.page 'button.search'/></button>
                    </li>
                    <li>
                        <a class="button" href="visit/exportItem?_csrf=<@tools.csrfToken admin=true/>" target="dwzExport" targetType="navTab"><i class="bi bi-cloud-download"></i><@t.page "button.export"/></a>
                    </li>
                </ul>
            </div>
        </div>
    </form>
</div>
<div class="card">
    <div class="panelBar">
        <ul class="toolBar">
        </ul>
    </div>
    <table class="table" width="100%" layoutH>
        <thead>
            <tr>
                <th><@t.page 'visit.visit_date'/></th>
                <th><@t.page 'item_type'/></th>
                <th><@t.page 'item'/></th>
                <th>PV</th>
                <th>UV</th>
                <th>IP Views</th>
            </tr>
        </thead>
        <tbody>
            <#list page.list as a>
            <tr>
                <td><#if a.id.visitDate?has_content><a href="visit/history.html?startCreateDate=${a.id.visitDate!}" target="navTab" rel="visit/history" title="<@t.page 'visit.history'/>">${(a.id.visitDate?date)!}</a></#if></td>
                <td>${a.id.itemType!}</td>
                <td>
                    ${a.id.itemId!}
                    <#if a.id.itemType?has_content>
                        <#if a.id.itemType="category">
                            :<@cms.category id=a.id.itemId><a href="${object.url}" target="_blank">${object.name}</a></@cms.category>
                        <#elseif a.id.itemType="content">
                            :<@cms.content id=a.id.itemId><a href="${object.url}" target="_blank">${object.title}</a></@cms.content>
                        <#elseif a.id.itemType="user">
                            :<@sys.user id=a.id.itemId>${object.nickname}</@sys.user>
                        </#if>
                    </#if>
                </td>
                <td class="center">${a.pv!}</td>
                <td class="center">${a.uv!}</td>
                <td class="center">${a.ipviews!}</td>
            </tr>
            </#list>
        </tbody>
    </table>
    <#assign rel='visitBox'/>
    <#include "../include_page/page.html"/>
</div>
</@visit.itemList>