<%@ Page language="c#" AutoEventWireup="false" EnableViewState="false" Inherits="WeiXinWebClient.index" %>
<%@ Import namespace="FangPage.MVC" %>
<%@ Import namespace="WeiXinWebClient" %>

<script runat="server">
override protected void OnInitComplete(EventArgs e)
{
	/*方配软件技术有限公司，官方网站：http://www.fangpage.com，站点版本：V1.0*/
	base.OnInitComplete(e);
	int loop__id=0;
	ViewBuilder.Append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n");
	ViewBuilder.Append("<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n");
	ViewBuilder.Append("<head>\r\n");
	ViewBuilder.Append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
	ViewBuilder.Append("<title>方配微信发送服务器配置</title>\r\n");
	ViewBuilder.Append("	" + meta.ToString() + "\r\n");
	ViewBuilder.Append("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge,chrome=1\">\r\n");
	ViewBuilder.Append("<script type=\"text/javascript\" src=\"/plugins/jquery/jquery.js\"></");
	ViewBuilder.Append("script>\r\n");
	ViewBuilder.Append("<link rel=\"stylesheet\" href=\"/plugins/layer/skin/layer.css\" type=\"text/css\" id=\"skinlayercss\">\r\n");
	ViewBuilder.Append("<script src=\"/plugins/layer/layer.js\" type=\"text/javascript\"></");
	ViewBuilder.Append("script>\r\n");
	ViewBuilder.Append("<style type=\"text/css\">\r\n");
	ViewBuilder.Append("body {\r\n");
	ViewBuilder.Append("	margin: 0;\r\n");
	ViewBuilder.Append("	text-align: center;\r\n");
	ViewBuilder.Append("	background: url(images/downloading_bg.gif) repeat-x #fff;\r\n");
	ViewBuilder.Append("	font-size: 14px;\r\n");
	ViewBuilder.Append("}\r\n");
	ViewBuilder.Append(".main {\r\n");
	ViewBuilder.Append("	width: 480px;\r\n");
	ViewBuilder.Append("	text-align: left;\r\n");
	ViewBuilder.Append("	height: 480px;\r\n");
	ViewBuilder.Append("	color: #999;\r\n");
	ViewBuilder.Append("	margin: 0 auto;\r\n");
	ViewBuilder.Append("	background: url(images/weixin.png) no-repeat;\r\n");
	ViewBuilder.Append("}\r\n");
	ViewBuilder.Append(".main a {\r\n");
	ViewBuilder.Append("	color: #669900;\r\n");
	ViewBuilder.Append("}\r\n");
	ViewBuilder.Append(".main a:hover {\r\n");
	ViewBuilder.Append("	color: #ff6600;\r\n");
	ViewBuilder.Append("}\r\n");
	ViewBuilder.Append(".footer {\r\n");
	ViewBuilder.Append("	color: #999;\r\n");
	ViewBuilder.Append("}\r\n");
	ViewBuilder.Append(".footer a {\r\n");
	ViewBuilder.Append("	color: #669900;\r\n");
	ViewBuilder.Append("}\r\n");
	ViewBuilder.Append(".footer a:hover {\r\n");
	ViewBuilder.Append("	color: #ff6600;\r\n");
	ViewBuilder.Append("}\r\n");
	ViewBuilder.Append("</style>\r\n");
	ViewBuilder.Append("</head>\r\n");
	ViewBuilder.Append("<body>\r\n");
	ViewBuilder.Append("<div style=\"font-size:18px;text-align:left;width:600px;margin: 0 auto; line-height:25px;\">\r\n");
	ViewBuilder.Append("<form id=\"frmpost\" name=\"frmpost\" action=\"\" method=\"post\">\r\n");
	ViewBuilder.Append("<table>\r\n");
	ViewBuilder.Append("  <tr>\r\n");
	ViewBuilder.Append("    <td colspan=\"2\" height=\"50\" align=\"center\">方配微信发送服务器配置</td>\r\n");
	ViewBuilder.Append("  </tr>\r\n");
	ViewBuilder.Append("  <tr>\r\n");
	ViewBuilder.Append("    <td align=\"right\">服务器地址:</td>\r\n");
	ViewBuilder.Append("    <td><input name=\"server\" id=\"server\" value=\"" + serverconfig.server.ToString().Trim() + "\" type=\"text\"></td>\r\n");
	ViewBuilder.Append("  </tr>\r\n");
	ViewBuilder.Append("  <tr>\r\n");
	ViewBuilder.Append("    <td align=\"right\">端口：</td>\r\n");
	ViewBuilder.Append("    <td><input name=\"port\" id=\"port\" value=\"" + serverconfig.port.ToString().Trim() + "\" type=\"text\"></td>\r\n");
	ViewBuilder.Append("  </tr>\r\n");
	ViewBuilder.Append("  <tr>\r\n");
	ViewBuilder.Append("    <td align=\"right\">帐号名称：</td>\r\n");
	ViewBuilder.Append("    <td><input name=\"uname\" id=\"uname\" value=\"" + serverconfig.uname.ToString().Trim() + "\" type=\"text\"></td>\r\n");
	ViewBuilder.Append("  </tr>\r\n");
	ViewBuilder.Append("  <tr>\r\n");
	ViewBuilder.Append("    <td align=\"right\">帐号密码：</td>\r\n");
	ViewBuilder.Append("    <td><input name=\"password\" id=\"password\" value=\"\" type=\"password\">留空不更改密码。\r\n");
	ViewBuilder.Append("        <input name=\"psd\" id=\"psd\" value=\"" + serverconfig.password.ToString().Trim() + "\" type=\"hidden\">\r\n");
	ViewBuilder.Append("    </td>\r\n");
	ViewBuilder.Append("  </tr>\r\n");
	ViewBuilder.Append("  <tr>\r\n");
	ViewBuilder.Append("    <td>&nbsp;</td>\r\n");
	ViewBuilder.Append("    <td>\r\n");
	ViewBuilder.Append("        <input name=\"btnok\" id=\"btnok\" value=\"确定\" type=\"submit\">\r\n");
	ViewBuilder.Append("        <input name=\"logout\" id=\"logout\" value=\"退出\" type=\"button\">\r\n");
	ViewBuilder.Append("    </td>\r\n");
	ViewBuilder.Append("  </tr>\r\n");
	ViewBuilder.Append("    <tr>\r\n");
	ViewBuilder.Append("    <td colspan=\"2\" height=\"50\" align=\"center\">测试发送</td>\r\n");
	ViewBuilder.Append("  </tr>\r\n");
	ViewBuilder.Append("  <tr>\r\n");
	ViewBuilder.Append("    <td align=\"right\">接收人:</td>\r\n");
	ViewBuilder.Append("    <td><input name=\"sendto\" id=\"sendto\" type=\"text\"></td>\r\n");
	ViewBuilder.Append("  </tr>\r\n");
	ViewBuilder.Append("  <tr>\r\n");
	ViewBuilder.Append("    <td align=\"right\">发送内容：</td>\r\n");
	ViewBuilder.Append("    <td><textarea name=\"content\" id=\"content\" cols=\"40\" rows=\"5\"></textarea></td>\r\n");
	ViewBuilder.Append("  </tr>\r\n");
	ViewBuilder.Append("  <tr>\r\n");
	ViewBuilder.Append("    <td>&nbsp;</td>\r\n");
	ViewBuilder.Append("    <td><input name=\"btnsend\" id=\"btnsend\" value=\"测试发送\" type=\"button\"></td>\r\n");
	ViewBuilder.Append("  </tr>\r\n");
	ViewBuilder.Append("  <tr>\r\n");
	ViewBuilder.Append("    <td align=\"right\" height=\"40\">在线技术支持：</td>\r\n");
	ViewBuilder.Append("    <td>\r\n");
	ViewBuilder.Append("        <a target=\"_blank\" href=\"http://wpa.qq.com/msgrd?v=3&uin=12677206&site=qq&menu=yes\"><img border=\"0\" src=\"http://fangpage.com/sites/fangpage/statics/images/qq.gif\" width=\"74\" height=\"22\" alt=\"点击这里给我发消息\" title=\"点击这里给我发消息\" align=\"absmiddle\"></a>，QQ:12677206，电话：13481092810\r\n");
	ViewBuilder.Append("    </td>\r\n");
	ViewBuilder.Append("  </tr>\r\n");
	ViewBuilder.Append("  <tr>\r\n");
	ViewBuilder.Append("      <td align=\"right\" height=\"40\">官方网站：</td>\r\n");
	ViewBuilder.Append("    <td>\r\n");
	ViewBuilder.Append("        <a target=\"_blank\" href=\"http://www.fangpage.com\">http://www.fangpage.com</a>\r\n");
	ViewBuilder.Append("    </td>\r\n");
	ViewBuilder.Append("  </tr>\r\n");
	ViewBuilder.Append("</table>\r\n");
	ViewBuilder.Append("</form>\r\n");
	ViewBuilder.Append("</div>\r\n");
	ViewBuilder.Append("<script type=\"text/javascript\">\r\n");
	ViewBuilder.Append("    $(function () {\r\n");
	ViewBuilder.Append("        $(\"#logout\").click(function () {\r\n");
	ViewBuilder.Append("            window.location.href = \"logout.aspx\";\r\n");
	ViewBuilder.Append("        })\r\n");
	ViewBuilder.Append("        $(\"#btnsend\").click(function () {\r\n");
	ViewBuilder.Append("            var index = layer.load('正在发送…', 0);\r\n");
	ViewBuilder.Append("            $.post(\"send.aspx\", {\r\n");
	ViewBuilder.Append("                uname: $(\"#uname\").val(),\r\n");
	ViewBuilder.Append("                password: $(\"#psd\").val(),\r\n");
	ViewBuilder.Append("                sendto: $(\"#sendto\").val(),\r\n");
	ViewBuilder.Append("                content: $(\"#content\").val()\r\n");
	ViewBuilder.Append("            }, function (data) {\r\n");
	ViewBuilder.Append("                layer.close(index);\r\n");
	ViewBuilder.Append("                if (data.status == '1000') {\r\n");
	ViewBuilder.Append("                    alert(\"发送成功，请检查微信是否收到信息。\");\r\n");
	ViewBuilder.Append("                }\r\n");
	ViewBuilder.Append("                else if (data.status == '1001') {\r\n");
	ViewBuilder.Append("                    alert(\"帐号不能为空。\");\r\n");
	ViewBuilder.Append("                }\r\n");
	ViewBuilder.Append("                else if (data.status == '1002') {\r\n");
	ViewBuilder.Append("                    alert(\"密码不能为空。\");\r\n");
	ViewBuilder.Append("                }\r\n");
	ViewBuilder.Append("                else if (data.status == '1003') {\r\n");
	ViewBuilder.Append("                    alert(\"帐号或密码错误。\");\r\n");
	ViewBuilder.Append("                }\r\n");
	ViewBuilder.Append("                else if (data.status == '1004') {\r\n");
	ViewBuilder.Append("                    alert(\"无法连接服务器。\");\r\n");
	ViewBuilder.Append("                }\r\n");
	ViewBuilder.Append("            }, \"json\");\r\n");
	ViewBuilder.Append("        })\r\n");
	ViewBuilder.Append("    })\r\n");
	ViewBuilder.Append("</");
	ViewBuilder.Append("script>\r\n");

	if (ispost)
	{

	ViewBuilder.Append("<script type=\"text/javascript\">\r\n");
	ViewBuilder.Append("layer.msg('配置更改成功！',0, 1);\r\n");
	ViewBuilder.Append("var bar = 0;\r\n");
	ViewBuilder.Append("count();\r\n");
	ViewBuilder.Append("function count() {\r\n");
	ViewBuilder.Append("    bar = bar + 4;\r\n");
	ViewBuilder.Append("    if (bar < 100) {\r\n");
	ViewBuilder.Append("        setTimeout(\"count()\", 100);\r\n");
	ViewBuilder.Append("    }\r\n");
	ViewBuilder.Append("    else {\r\n");
	ViewBuilder.Append("        window.location.href = \"index.aspx\";\r\n");
	ViewBuilder.Append("    }\r\n");
	ViewBuilder.Append("}\r\n");
	ViewBuilder.Append("</");
	ViewBuilder.Append("script>\r\n");

	}	//end if

	ViewBuilder.Append("</body>\r\n");
	ViewBuilder.Append("</html>\r\n");

	Response.Write(ViewBuilder.ToString());
}
</script>
