<%@ 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"></script>
    <script src="/Js/data.js"></script>
    <script src="/Js/bx.library.js"></script>
    <script src="<%path:%>js/web.js"></script>
</head>
<body>
    <!--head-->
    <%template:_head.html%>
    <!--body-->
    <div class="body main">
        <div class="split">&nbsp;</div>
        <div class="usercenter">
            <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>
                            </tr>
                        </thead>
                        <tbody>
                            <%
                            var p=Request["page"]!=null?Int32.Parse(Request["page"]):1;
                            var cRows=GetCollectList(page:p);
                            var t=GetCollectCount();
                            %>
                            <%foreach(var row in cRows){%>
                            <tr>
                                <td><%=row["Title"]%></td>
                                <td>
                                    <%=Convert.ToDateTime(row["CreateDate"]).ToString("yyyy-MM-dd")%>
                                </td>
                                <td>
                                    <a href='<%=row["Url"]%>' target="_blank">查看</a>
                                    <a href="javascript:" onclick="deleteInfo('<%=row["CollectID"]%>');">删除</a>&nbsp;
                                
                                </td>
                            </tr>
                            <%}%>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="3" class="pagination">
                                    <%=GetPaginationHtml(total:t,page:p,link:"?page=@page")%>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!--foot-->
    <%template:_foot.html%> 
    <script type="text/javascript">
        function deleteInfo(infoid) {
            Confirm("确认删除?",function(r){
                if(r==true){
                    CollectDelete(infoid,function(result){
                        if (result != null && result.status == "success") {
                            document.location.reload();
                        }
                        else {
                            alert("删除失败");
                        }
                    });
                }
            })
        }
      </script>

</body>
</html>

