<%@ Page Language="C#" AutoEventWireup="true" Codebehind="upIndex.aspx.cs" Inherits="ZYDN.Web.system.upSys.upIndex" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>升级网站</title>
    <link rel="stylesheet" type="text/css" href="../skins/css/main.css" />
    <link rel="stylesheet" type="text/css" href="../skins/css/Sys.css" />

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

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

    <script type="text/javascript" language="javascript">
    
    var objAjax=new JAjax();
    function start1(){
	    var out=objAjax.getText("post","upIndex.aspx?type=upFile",null,null);
	   // alert(out);
	    if (out=="0"){
	        alert("没有发现升级包,请上传升级包");
	    }else{
	        $("div1").style.display="none";
	        $("div2").innerHTML=out;
	        $("div2").style.display="";
	        setTimeout("upDB()",5000);
	    }
	}
	
	function upDB(){
	    var out=objAjax.getText("post","upIndex.aspx?type=upDB",null,null);
	    if (out==""){
	        alert("升级数据库失败");
	    }else{
	         $("div1").style.display="none";
	        $("div2").innerHTML=out;
	        $("div2").style.display="";
	        setTimeout("upP()",3000);
	    }
    }
    
   function upP(){
	    var out=objAjax.getText("post","upIndex.aspx?type=upP",null,null);
	    if (out==""){
	        alert("升级存储过程失败");
	    }else{
	         $("div1").style.display="none";
	        $("div2").innerHTML=out;
	        $("div2").style.display="";
	        setTimeout("inputTab()",3000);
	    }
    }
    
    function inputTab(){
        var out=objAjax.getText("post","upIndex.aspx?type=inputTab",null,null);
	    if (out==""){
	        alert("升级标签类和系统软件失败");
	    }else{
	         $("div1").style.display="none";
	        $("div2").innerHTML=out;
	        $("div2").style.display="";
	        setTimeout("delFile()",3000);
	    }
    }
    
    function delFile(){
      var out=objAjax.getText("post","upIndex.aspx?type=delFile",null,null);
	    if (out==""){
	        alert("清理升级临时文件失败");
	    }else{
	         $("div1").style.display="none";
	        $("div2").innerHTML=out;
	        $("div2").style.display="";
	         alert("系统升级完成");
	    }
    }
    
    
    </script>

</head>
<body>
    <div style="padding: 10px;" id="div1">
        系统准备开始升级, 在升级前请把升级包用FTP上传到网站的 upfile\upSysDB\ 目录下<br />
        请注意,升级包的文件名为 upSys.mdb<br />
        <input type="button" value="开始升级网站" onclick="start1()" />
    </div>
    <div id="div2" style="padding: 10px; width: 100%; height: 250; overflow: scroll;
        display: none;">
    </div>
</body>
</html>
