<%@ Page Language="C#" AutoEventWireup="true" Inherits="Web.inherits.UserViewPage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>发布信息管理-<%=WebSiteConfig.SiteTitle%></title>
    <link href="<%path:%>Css/common.css" rel="stylesheet" />
    <link href="<%path:%>Css/user.css" rel="stylesheet" />
    <script src="/Js/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="/Js/data.js"></script>
    <script src="/Js/bx.library.js"></script>
    <script src="<%path:%>js/web.js" type="text/javascript"></script>
    <script src="<%path:%>js/user.js" type="text/javascript"></script>
</head>
<body>
    <!--head-->
    <%template:_head.html%>
    <!--body-->
    <div class="body main">
        <div class="usercenter bordershadow">
            <div class="left"><%template:_usermenu.html%></div>
            <div class="right">
              <div class="content">
                <div class="title"><h3>我的发布</h3></div>
                <table class="infolist" id="TableList" border="0" cellpadding="0" cellspacing="0">
                    <thead>
                        <tr>
                            <th>所属类别</th>
                            <th>标题</th>
                            <th>更新时间</th>
                            <th>发布时间</th>
                            <th>浏览量</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <%var p=Request["page"]!=null?Int32.Parse(Request["page"]):1;
                        var infoList=GetInfoListByUser(userId:UserIdentity.UserID,page:p);
                        var totalRow=GetInfoCountByUser(userId:UserIdentity.UserID);
                        %>
                        <%foreach(var row in infoList){%>
                        <tr>
                            <td><%=row["CategoryName"]%>
                            </td>
                            <td><%=row["Title"]%>
                            </td>
                            <td>
                                <%=Convert.ToDateTime(row["UpdateDate"]).ToString("yyyy-MM-dd")%>
                            </td>
                            <td>
                                <%=Convert.ToDateTime(row["CreateDate"]).ToString("yyyy-MM-dd")%>
                            </td>
                            <td><%=row["Views"]%>
                            </td>
                            <td>
                                <%=ValueToText(row["Views"],new Hashtable{{"1","已审核"},{"2","等待审核"},{"3","审核失败"}})%>
                            </td>
                            <td>
                                <a href="javascript:" onclick="deleteInfo('<%=row["_InfoID"]%>');" title="删除当前记录">删除</a>&nbsp;
                                <a href="javascript:" onclick="refreshInfo('<%=row["_InfoID"]%>');" title="刷新时间">刷新</a>
                            </td>
                        </tr>
                        <%}%>
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="7" class="pagination">
                                <%=GetPaginationHtml(total:totalRow,page:p,link:"?page=@page")%>
                            </td>
                        </tr>
                    </tfoot>
                </table>
               </div>
            </div>
        </div>
        <div class="split">&nbsp;</div>
    </div>
    <!--foot-->
    <%template:_foot.html%>
    <script type="text/javascript">
    function deleteInfo(infoid) {
        Confirm("确认删除?",function(r){
          if(r==true){
            Info.del(infoid,function(result){
                if (result != null && result.status == "success") {document.location.reload();}else { Alert("删除失败");}
            });
           }
        })
    }
    function refreshInfo(infoid) {
        Info.refresh(infoid,function(result){
            if (result != null && result.status == "success") {
                document.location.reload();
            }
            else {
                Alert("刷新失败");
            }
        });
    }
    window.onload = function () {
        //
    }
    </script>

</body>
</html>
