{layout:default} {class:Shop.Admin.product.Comment}
<lbhead>
    <title><%=Tag("商品评价")%>-<%=site.title%></title>
</lbhead>
<lbpath>
    <div class="tools">
    <ul>
    <%if (PageReturnMsg == ""){%>
    <li class="submit"><a href="javascript:void(0);" onclick="Update();"><b></b><span><%=Tag("保存")%></span></a></li>
    <li class="del"><a href="javascript:void(0);" onclick="Del();"><b></b><span><%=Tag("删除")%></span></a></li>
    <%}%>
    <li class="name"><span id="navIgation"><%=Tag("当前位置")%>：<a href="<%=site.AdminPath %>/Ajax/ajax_admin.aspx?__Action=MenuJump&pid=0"><%=Tag("管理首页")%></a> > <%=Tag("商品评价")%></span></li>
    </ul>
    </div>
</lbpath>
<lbbody>
    <div class="searchbox">
        <select id="lang">
            <option value="">┌<%=Tag("语言")%></option>
            <%=Shop.Bussiness.Language.LanguageOption(lang)%>
        </select>
        <select name="status" id="status">
            <option value="0">┌<%=Tag("状态")%></option>
            <%=Shop.Bussiness.EX_Type.TypeOption("CommentStatus", status, CurrentLanguage.Code)%>
        </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_();}" /><input type="button" id="btnSou" class="btn-query" onclick="search_();" />
    </div>
    <table class="datalist">
        <tr class="title">
            <th style="width: 40px" class="selectAll">
                <a href="javascript:void(0);" onclick="$('input[name=\'Delid\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));"><%=Tag("全选")%></a>
            </th>
            <th style="width: 40px">
                <%=Tag("图片")%>
            </th>
            <th style="width: 300px;">
                <%=Tag("商品名称")%>
            </th>
            <th>
                <%=Tag("内容")%>
            </th>
            <th style="width: 120px">
                <%=Tag("会员账号")%>
            </th>
            <th style="width: 80px">
                <%=Tag("状态")%>
            </th>
            <th style="width: 80px">
                <%=Tag("操作")%>
            </th>
        </tr>
        <%foreach (DB.LebiShop.Lebi_Comment model in models)
          {%>

        <tr class="list" ondblclick="Edit(<%=model.id %>);" >
            <td style="text-align:center">
                <input type="checkbox" name="Delid" del="true" value="<%=model.id %>" />
                <input type="hidden" name="IDS" shop="true" value="<%=model.id %>" />
            </td>
            <td>
                <div class="piclist<%=model.id %>"><% if (GetProduct(model.Keyid).ImageSmall == "")
                   { %>
                &nbsp;
                <%}else
                   { %>
                <a href="<%=Image(GetProduct(model.Keyid).ImageOriginal,"big") %>" data-lightbox="image<%=model.id %>" ><img style="height: 30px;width: 30px;vertical-align:middle" src="<%=Image(GetProduct(model.Keyid).ImageOriginal,50,50) %>" /></a>
                <%} %></div>
            </td>
            <td style="width:300px;word-break:break-all;word-wrap:break-word;">
                <%=Lang(GetProduct(model.Keyid).Name)%>&nbsp;<a target="_blank" href="<%=Shop.Bussiness.ThemeUrl.GetURL("P_Product",model.Keyid.ToString(),"",CurrentLanguage.Code)%>"><img src="<%=AdminImage("icon/newWindow.png")%>" /></a>
            </td>
            <td>
            <%=model.Content.Replace("\r\n", "<br/>")%><em>(<%=FormatTime(model.Time_Add)%>)</em>
            <ul class="sharepiclist<%=model.id %> clearfix">
                <%
                    string[] images = model.ImagesSmall.Split('@');
                    string[] bigs = model.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<%=model.id %>"><img src="<%=WebPath+images[i] %>" /></a></span>
                </li>
                    <%} %>
            </ul>
            </td>
            <td>
                <%=model.User_UserName %>
            </td>
            <td>
                <select name="status<%=model.id %>" shop="true">
                    <%=Shop.Bussiness.EX_Type.TypeOption("CommentStatus", model.Status, CurrentLanguage.Code)%>
                </select>
            </td>
            <td>
                <a href="javascript:void(0)" onclick="Edit(<%=model.id %>);"><%=Tag("编辑")%></a>
            </td>
        </tr>
        <%} %>
    </table>
    <script type="text/javascript">
        function search_() {
            var status = $("#status").val();
            var lang = $("#lang").val();
            var key = $("#key").val();
            var dateFrom = $("#dateFrom").val();
            var dateTo = $("#dateTo").val();
            window.location = "?key=" + escape(key) + "&lang=" + lang + "&status=" + status + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo;
        }
        function Edit(id) {
            var title_ = "<%=Tag("回复商品评价")%>";
            var url_ = "comment_edit_window.aspx?id=" + id;
            var width_ = 600;
            var height_ = "auto";
            var modal_ = true;
            EditWindow(title_, url_, width_, height_, modal_);
        }
        function Del() {
            if (!confirm("<%=Tag("确认要删除吗？")%>"))
                return false;
            var postData = GetFormJsonData("del");
            var url = "<%=site.AdminPath %>/ajax/ajax_product.aspx?__Action=Comment_Del";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "?")});
        }
        function Update() {
            var postData = GetFormJsonData("shop");
            var url = "<%=site.AdminPath %>/ajax/ajax_product.aspx?__Action=Comment_Update";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "?")});
        }
    </script>
</lbbody>
<lbbottom>
<div class="bottom" id="body_bottom">
    <%=PageString%>
</div>
</lbbottom>