<!--
Name:用户中心-评论
Page:All
-->
<link rel="stylesheet" type="text/css" href="{/js}lightbox/lightbox.min.css" />
<div class="nbbox clearfix">
<div class="user">
    <ul class="tablist">
        <li <%if (type == 0){Response.Write("class=\"selected\"");} %>><a href="<%=URL("P_UserComment","0","")%>"><span>{tag:已评价商品}</span></a></li>
        <li <%if (type == 1){Response.Write("class=\"selected\"");} %>><a href="<%=URL("P_UserComment","1","")%>"><span>{tag:待评价商品}<em>(<%=Count_Comment(0) %>)</em></span></a></li>
    </ul>
    <div class="searchbox clearfix">
        <select id="status">
            <option value="">┌ {tag:状态}</option>
            <option value="0" <%if (status == 0){%>selected<%} %>>{tag:全部}</option>
            <%foreach (DB.LebiShop.Lebi_Type t in types){%>
            <option value="<%=t.id %>" <%if (status == t.id){%>selected<%} %>><%=Tag(t.Name)%></option>
            <%} %>
        </select>
        <input type="text" name="dateFrom" id="dateFrom" size="12" class="input-calendar" value="<%=dateFrom %>" /> - <input type="text" name="dateTo" id="dateTo" size="12" class="input-calendar" value="<%=dateTo %>" />
        <input type="text" id="key" name="key" class="input-query" value="<%=key %>" onkeydown="if(event.keyCode==13){search_();}" />
        <a href="javascript:void(0)" onclick="search_();" class="btn btn-12"><s></s>{tag:查询}</a>
    </div>
    <%if (type == 0){ %>
    <table cellpadding="0" cellspacing="0" width="100%" class="tablemenu">
        <tr>
            <th style="width:40px;">
                {tag:图片}
            </th>
            <th>
                {tag:商品名称}
            </th>
            <th style="width:100px;">
                {tag:状态}
            </th>
            <th style="width:120px;">
                {tag:时间}
            </th>
        </tr>
    </table>
    <%foreach (DB.LebiShop.Lebi_Comment c in comments)
    {%>
    <table cellpadding="0" cellspacing="0" width="100%" class="tablelist box">
    <tr>
        <th style="width:40px;height:40px;"><% if (GetProduct(c.Keyid).ImageOriginal == ""){ %>&nbsp;<%}else{ %><a href="<%=URL("P_Product",c.Keyid) %>" target="_blank"><img style="height: 30px;width: 30px;vertical-align:middle" src="<%=Image(GetProduct(c.Keyid).ImageOriginal,50,50) %>" /></a><%} %></th>
        <th><a href="<%=URL("P_Product",c.Keyid) %>" target="_blank"><%=Lang(GetProduct(c.Keyid).Name)%></a></th>
        <th style="width:100px;"><%=TypeName(c.Status) %></th>
        <th style="width:120px;"><%=FormatTime(c.Time_Add) %></th>
    </tr>
    <tr><td colspan="5"><ul class="comment_star"><li><em class="comments_bg stars_<%=c.Star%>"></em></li></ul></td></tr>
    <tr><td colspan="5">
    {tag:内容}：<%=c.Content.Replace("\r\n", "<br/>")%>
    <ul class="piclist<%=c.id %>">
        <%
            string[] images = c.ImagesSmall.Split('@');
            string[] bigs = c.Images.Split('@');
            for (int i = 0; i < images.Count();i++)
            {
                if (images[i] == "")
                    continue;
        %>
        <li class="imagespreviewlist">
            <span class="image"><a href="<%=WebPath+bigs[i] %>" data-lightbox="image<%=c.id %>"><img src="<%=WebPath+images[i] %>" /></a></span>
        </li>
            <%} %>
    </ul>
    </td></tr>
    <%
    List<DB.LebiShop.Lebi_Comment> cr = DB.LebiShop.B_Lebi_Comment.GetList("Parentid = "+ c.id +"", "id desc");
    foreach (DB.LebiShop.Lebi_Comment creply in cr)
    {
    %>
    <tr><td colspan="5">{tag:客服回复}：<%=creply.Content%><em><%=creply.Time_Add%></em></td></tr>
    <%} %>
    </table>
    <%} %>
    <%}else{ %>
    <table cellpadding="0" cellspacing="0" width="100%" class="tablelist box">
        <tr>
            <th style="width:40px;">
                {tag:图片}
            </th>
            <th>
                {tag:商品名称}
            </th>
            <th style="width:100px;">
                {tag:状态}
            </th>
            <th style="width:120px;">
                {tag:时间}
            </th>
        </tr>
        <%foreach (DB.LebiShop.Lebi_Order_Product op in order_products)
        {%>
        <tr>
            <td style="width:40px;"><% if (op.ImageSmall == ""){ %>&nbsp;<%}else{ %><a href="<%=URL("P_Product",op.Product_id) %>" target="_blank">
            <img style="height: 30px;width: 30px;vertical-align:middle" src="<%=Image(op.ImageSmall) %>" /></a><%} %></td>
            <td><a href="<%=URL("P_Product",op.Product_id) %>" target="_blank"><%=Lang(op.Product_Name)%></a></td>
            <td style="width:100px;"><a href="<%=URL("P_UserCommentWrite",op.id) %>">{tag:发表评价}</a></td>
            <td style="width:120px;"><%=FormatTime(op.Time_Add) %></td>
        </tr>
        <%} %>
    </table>
    <%} %>
    <div class="bottom clearfix"><div class="left"></div><div class="right"><%=PageString%></div></div>
</div>
</div>
<script type="text/javascript" src="{/js}lightbox/lightbox.min.js"></script>
<script type="text/javascript">
    function search_() {
        var key = $("#key").val();
        var dateFrom = $("#dateFrom").val();
        var dateTo = $("#dateTo").val();
        var status = $("#status").val();
        window.location = "?type=<%=type %>&key=" + escape(key) + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "&status=" + status;
    }
    function Delete() {
        if (!confirm("{tag:确认要删除吗？}}"))
            return false;
        var ids = GetChkCheckedValues("id");
        var postData = { "ids": ids };
        var url = path+"/ajax/ajax_user.aspx?__Action=Comment_Delete";
        RequestAjax(url, postData, function () { MsgBox(1, "{tag:操作成功}", "?") });
    }
</script>