<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="dbbackuplist.aspx.cs" Inherits="FangPage.Admin.dbbackuplist" %>

<%@ Register TagPrefix="cc2" Namespace="FangPage.Control" Assembly="FangPage.Control" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>数据库备份还原</title>
    <link href="styles/bmsmanager.css" type="text/css" rel="stylesheet">
    <link href="styles/datagrid.css" type="text/css" rel="stylesheet">

    <script type="text/javascript" src="js/common.js"></script>
    
        <script language="javascript" type="text/javascript">

        function Recovery(pathname)
	    {
	        if(confirm("本操作将覆盖当前的站点内容，您确定要还原此备份数据库吗？")) 
	        {
	            document.getElementById('success').style.display = 'block';
	            document.getElementById('Layer5').innerHTML='<BR /><table><tr><td valign=top><img border=0 src=images/ajax_loading.gif  /></td><td valign=middle style=font-size:14px;>正在解压文件, <BR />请稍等...<BR /></td></tr></table><BR />';
	            window.location="?dbback=" + pathname;
	        }
	    }
        
    </script>

</head>
<body>
    <form id="Form1" method="post" runat="server">
    <div class="Navbutton" style="width: 98%;">
        <table cellspacing="1" cellpadding="4" align="left">
            <tr>
                <td width="60">&nbsp;
                <input title="选中/取消选中" onclick="CheckAll(this.form)" type="checkbox" name="chkall"
                        id="chkall" />全选
                </td>
                <td align="left">
                    <cc2:Button ID="DelRec" runat="server" Text="删除选定备份" 
                        ButtonImgUrl="images/dell.gif" onclick="DelRec_Click"></cc2:Button>
                    <cc2:Button ID="DbBackup" runat="server" Text="备份数据库" 
                        ButtonImgUrl="images/backup.gif" onclick="DbBackup_Click"></cc2:Button>&nbsp;
                    <button type="button" class="ManagerButton" onclick="window.location='dbautoset.aspx';">
                        <img src="images/icon16/tasks.gif" />自动备份设置</button>
                </td>
            </tr>
        </table>
    </div>
    <cc2:DataGrid ID="Grid1" runat="server" ColumnSpan="4">
        <Columns>
            <asp:TemplateColumn HeaderText="选择">
                <HeaderStyle Width="5%" />
                <ItemTemplate>
                    <input id="id" onclick="javascript:SH_SelectOne(this)" type="checkbox" value="<%# DataBinder.Eval(Container, "DataItem.id").ToString() %>"
                        name="id" />
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="id" HeaderText="id [递增不重复]" Visible="false"></asp:BoundColumn>
            <asp:BoundColumn DataField="filename" HeaderText="备份文件名"></asp:BoundColumn>
            <asp:BoundColumn DataField="size" HeaderText="文件大小"></asp:BoundColumn>
            <asp:BoundColumn DataField="createtime" HeaderText="备份日期"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="操作">
                <ItemTemplate>
                    <a href="javascript:Recovery('<%# DataBinder.Eval(Container, "DataItem.filename").ToString()%>')">
                        还原</a>&nbsp;&nbsp; <a href="download.aspx?file=<%=webpath%><%# DataBinder.Eval(Container, "DataItem.fullname").ToString()%>">
                            下载</a>
                </ItemTemplate>
            </asp:TemplateColumn>
        </Columns>
    </cc2:DataGrid>
     <br />
    <div class="ManagerForm">
        <fieldset>
            <legend style="background: url(images/icon32/backupfile.gif) no-repeat 3px; padding-left:35px;">上传本地备份文件</legend>
            <table class="datagridStyles" cellspacing="0" cellpadding="3" rules="rows" border="0"
                width="100%" id="smilesgrid">
                <tr>
                    <td height="40" width="200" align="right">
                        本地备份文件：&nbsp;&nbsp;
                    </td>
                    <td width="300">
                        <asp:FileUpload ID="fileUpload" CssClass="uploadfile" runat="server" Width="253" />
                    </td>
                    <td>
                        <cc2:Button ID="btnUpLoadFile" runat="server" Text=" 上传文件" 
                            ButtonImgUrl="images/ico_up.gif" onclick="btnUpLoadFile_Click"></cc2:Button>
                    </td>
                </tr>
            </table>
        </fieldset>
    </div>
    <br />
    </form>
</body>
</html>
