<%@ 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);
	    //return;
	    if (out=="0"){
	        alert("没有发现升级包,请上传升级包");
	    }else{
	        $("b2").style.display="";
	        $("div1").style.display="none";
	        $("div2").innerHTML=out;
	        $("div3").innerHTML=out;
	        $("div2").style.display="";
	        setTimeout("upDB()",5000);
	    }
	}
	
	function upDB(){
	    var out=objAjax.getText("post","upIndex.aspx?type=upDB",null,null);
	    if (out=="" ){
	        alert("升级数据库失败");
	        return;
	    }else if (out=="您没有这权限完成此操作")  {
	      setTimeout("upDB()",5000);
	    }else
	    {
	        $("div1").style.display="none";
	        $("div2").innerHTML=out;
	        $("div3").innerHTML= $("div3").innerHTML+"<br/>"+out;
	        $("div2").style.display="";
	        setTimeout("upP()",3000);
	    }
    }
    
   function upP(){
	    var out=objAjax.getText("post","upIndex.aspx?type=upP",null,null);
	    if (out==""){
	        alert("升级存储过程失败");
	        return;
	    }else{
	         $("div1").style.display="none";
	        $("div2").innerHTML=out;
	        $("div3").innerHTML= $("div3").innerHTML+"<br/>"+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;
	        $("div3").innerHTML= $("div3").innerHTML+"<br/>"+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="";
	        $("div3").innerHTML= $("div3").innerHTML+"<br/>"+out;
	         alert("系统升级完成");
	    }
    }
    
    function onlineUpsys(){
        $("div1").innerHTML="系统正在下载升级包,请稍后.....";
        setTimeout("downFile()",1000);
    }
    
    function downFile(){
         var out=objAjax.getText("post","upIndex.aspx?type=downFile",null,null);
         if (out=="1"){
            setTimeout("start1()",1000);
         }else{
             alert("系统升级包下载失败:<br>"+erStr(out));
         }
         
    }
    
    
    </script>

</head>
<body>
    <div style="padding: 10px;" id="div1">
        系统准备开始升级, 在升级前请把升级包用FTP上传到网站的 upfile\upSysDB\ 目录下 &nbsp; [<a href="http://www.zydn.net/html/tab_softdown/4/18954.htm" target="_blank" style="color:#ff0000">下载</a>]<br />
        请注意,升级包的文件名为 upSys.mdb<br />
        <input type="button" id="startButton" value="开始升级网站" onclick="start1()" />
        
       <br> 
        <% wjs();%>
    </div>
    <div id="div2" style="padding: 10px; width: 100%; height: 180; overflow: scroll;
        display: none;">
    </div>
    <div id="div3" style="display:none;padding: 10px; width: 100%; height: 250; overflow: scroll;
        display: none;">
    </div>
    <input id="b2" style="display:none;" type="button" value="显示全部提示" onclick="$('div3').style.display='';$('div2').style.display='none';"/>
</body>
</html>
