<%@ Page Language="c#" Inherits="WebApp.operate" CodeBehind="operate.aspx.cs" %>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>网站数据备份恢复</title>
    <meta name="description" content="overview &amp; stats" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <!--#include file = "../assets/head.htm" -->

    <script lang="javascript" type="text/javascript">
        function openwin(name) {
            var arr = showModalDialog("../editor/Dialog/imgFile.htm?directory=banner&name=time&FileId=0", window, "dialogWidth:400px;dialogHeight:150px;help:no;scroll:no;status:no");
            if (arr != null) {
                var module = eval("document.system." + name);
                module.value = arr;
            }
        }
        function swf(name) {
            var arr = showModalDialog("../editor/Dialog/flashFile.htm?directory=banner&name=time&FileId=0", window, "dialogWidth:400px;dialogHeight:150px;help:no;scroll:no;status:no");
            if (arr != null) {
                var module = eval("document.system." + name);
                module.value = arr;
            }
        }
        //function showInfoZip(pkId) {
        //    arr = showModalDialog("showInfo.aspx?pkId=" + pkId, window, "dialogWidth:25.5em; dialogHeight:23.5em; status:0");
        //}

       
    </script>

</head>
<body class="no-skin">
    <form id="system" method="post" runat="server">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <div class="breadcrumbs" id="breadcrumbs">
                <script type="text/javascript">
                    try { ace.settings.check('breadcrumbs', 'fixed') } catch (e) { }
                </script>

                <ul class="breadcrumb">
                    <li>
                        <i class="ace-icon fa fa-home home-icon"></i>
                        主页
                    </li>
                    <li>系统操作</li>
                    <li class="active">系统备份</li>
                </ul>
                <!-- /.breadcrumb -->

                <!-- /section:basics/content.searchbox -->
            </div>
            <!-- /section:basics/content.breadcrumbs -->

            <div class="page-content">
                <!-- PAGE CONTENT BEGINS -->

                <div class="row">
                    <div class="col-xs-12">
                        <asp:DataGrid ID="pageGrid" runat="server" CssClass="table table-striped table-bordered" AutoGenerateColumns="False" OnItemCommand="pageGrid_ItemCommand">
                            <Columns>
                                <asp:BoundColumn DataField="pkId" HeaderText="ID" HeaderStyle-CssClass="title"></asp:BoundColumn>
                                <asp:BoundColumn DataField="backupName" HeaderText="名称" HeaderStyle-CssClass="title"></asp:BoundColumn>
                                <asp:BoundColumn DataField="updatetime" HeaderText="备份时间" HeaderStyle-CssClass="title"></asp:BoundColumn>
                                <asp:BoundColumn HeaderText="文件大小" HeaderStyle-CssClass="title"></asp:BoundColumn>
                                <asp:TemplateColumn HeaderText="执行" HeaderStyle-CssClass="title">
                                    <ItemTemplate>
                                        <div class="action-buttons">
                                        <asp:LinkButton ID="dell" runat="server" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.backupName") %>' CausesValidation="False" CommandName="del1"><i class="ace-icon fa fa-trash-o bigger-130 red" title="删除"></i></asp:LinkButton>
                                        &nbsp;
                                        <asp:LinkButton ID="copyy" runat="server" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.backupName") %>' CommandName="copy1" Visible="false" ><i class="ace-icon glyphicon glyphicon-repeat green" title="恢复"></i></asp:LinkButton>
                                        &nbsp;
                                        <asp:HyperLink ID="downBackup" runat="server" NavigateUrl='<%# "./down.aspx?pkId="+DataBinder.Eval(Container, "DataItem.pkId") %>' Target="_blank"><i class="ace-icon fa fa-download grey" title="下载"></i></asp:HyperLink>
                                        &nbsp;
                                        <asp:LinkButton ID="view" runat="server" CommandName="view1" CssClass="FBox" href='<%# Eval("pkId","showinfo.aspx?ID={0}")%>'><i class="ace-icon fa fa-search-plus bigger-130" title="查看信息" ></i></asp:LinkButton>
                                        </div>
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                                <asp:BoundColumn Visible="False" DataField="zipName" HeaderText="zipName" HeaderStyle-CssClass="title"></asp:BoundColumn>
                            </Columns>
                        </asp:DataGrid>
                        <div class="clearfix">
                            <div class="col-xs-12">
                                <asp:Label ID="lblPage" runat="server"></asp:Label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row form-horizontal">
                    <div class="col-xs-12">
                        <div class="hr hr-16 hr-dotted"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right" for="form-field-1">备份名称：</label>
                            <div class="col-sm-9">
                                <asp:TextBox ID="bannerName" runat="server" CssClass="col-xs-10 col-sm-3"></asp:TextBox>
                                &nbsp;&nbsp;
                                <asp:Button ID="add" runat="server" Text="备份" OnClick="add_Click" CssClass="btn btn-sm btn-primary"></asp:Button>
                                <span class="help-inline">
                                    <span class="middle">(由于站群系统特殊性，本版本不提供数据恢复功能。)</span>
                                </span>
                            </div>
                        </div>

                        <div class="hr hr22 hr-dotted"></div>
                        
                        <div class="form-group ">
                            <label class="col-sm-3 control-label no-padding-right" for="form-field-1" >上传备份文件：</label>
                            <div class="col-sm-3">
                            <input id="uploadfile" style="display: inline-block;" type="file" runat="server" />
                            </div>
                            &nbsp;
                            <asp:Button ID="upload" runat="server" Text="开始上传" OnClick="upload_Click" CssClass="btn btn-sm btn-primary" ></asp:Button>
                        </div>
                        
                        <div class="hr hr22 hr-dotted"></div>
                        
                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right" for="form-field-1">远程抓取备份URL：</label>
                            <div class="col-sm-9">
                                <asp:TextBox ID="url" runat="server" Visible="true" CssClass="col-xs-10 col-sm-3"></asp:TextBox>
                                &nbsp;
                                <asp:Button ID="downLoad" runat="server" Text="开始抓取" OnClick="downLoad_Click" CssClass="btn btn-sm btn-primary" ></asp:Button>
                            </div>
                        </div>
                        
                        <div class="hr hr22 hr-dotted"></div>
                        <div class="form-group ">
                            <label class="col-sm-3 control-label no-padding-right" for="form-field-1">本地备份目录检测</label>
                            <div class="col-sm-9">
                                <asp:Label ID="explain" runat="server" >暂未检测到备份文件</asp:Label>
                                &emsp;
                                <asp:Button ID="auto" runat="server" Text="自动添加" Visible="false" OnClick="auto_Click" CssClass="btn btn-sm btn-primary"></asp:Button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <!--#include file = "../assets/foot.htm" -->
    <script type="text/javascript">
        jQuery(function ($) {
            //编辑：打开弹出层
            $(".FBox").click().fancybox({
                autoSize:false,
                'width': 600,
                'height': 450,
                'hideOnOverlayClick': false,
                'type': 'iframe',
                'padding': '0'
            });
            
            $('#uploadfile').ace_file_input({
					no_file:'没有文件 ...',
					btn_choose:'请选择',
					btn_change:'选好了',
					droppable:false,
					onchange:null,
					thumbnail:false //| true | large
					//whitelist:'gif|png|jpg|jpeg'
					//blacklist:'exe|php'
					//onchange:''
			});
        });
    </script>
</body>
</html>
