<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SendArticleAll.aspx.cs" Inherits="TotCms.Web.Admin.SendArticleAll" %>

<!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 id="Head1" runat="server">
    <title>发布所有文章</title>
</head>
<body>
<%if (_id > 0)
  { %>
<div align="center"><table width="400" height="20" border="1" cellpadding="0" cellspacing="0" bordercolor="#D4D0C8" bgcolor="#FFFFFF">
  <tr>
    <td>
      <table id="stat_w" width="1%"  border="0" align="left" cellpadding="0" cellspacing="0" bgcolor="#003399">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table>
      <span class="style1" id="P_num"></span></td>
  </tr>
</table>
<Br>正在发布，共<%=Session["TOT_Reset_Total"]%>条&nbsp;&nbsp;第<%=Session["TOT_Reset_Robot"]%>条,文章ID:<%=_id%></div>
<script type="text/javascript" language="javascript">
var HTTP;
function CallServer(Url)
{
	if(window.ActiveXObject){
			HTTP=new ActiveXObject("Microsoft.XMLHTTP");		
		}
		else if(window.XMLHttpRequest){
			HTTP=new XMLHttpRequest();		
		}
	HTTP.onreadystatechange = doAction;
	var ReturnValue=HTTP.open("get", Url, false);
	HTTP.send("");
	return HTTP.responseText;
}
function doAction() {		
        if (HTTP.readyState == 4) // 收到完整的服务器响应
		{
			if (HTTP.status == 500) {//服务器错误				
				document.write("当发布栏目时服务器出现内部错误,栏目ID：<%=_id%>");
            }
            else if (HTTP.status == 200) {
				document.write('<meta http-equiv="refresh" content="0;URL=SendArticleAll.aspx?id=<%=_id%>">');
				document.getElementById('stat_w').width ="<%=_pertnum%>\%";
				document.getElementById('P_num').innerHTML ="<%=_pertnum%>\%";
            } 
			else {
                alert(HTTP.status);
            }
        }
}
function resetHtml()
{
	var ReturnValue;	
	ReturnValue=CallServer('Article_Reset.aspx?id=<%=_id%>&act=do');
}
resetHtml();
</script>
<p align="center"><a href="#">系统运行中...</a></p>

<%}
  else
  {%>
<p align="center">
发布完成！成功发布<%=Session["TOT_Reset_Total"]%>个栏目。<br /><a href="javascript:history.back();">点击返回</a>
</p>
<%} %>
</body>
</html>
