?? infomation.php
字號(hào):
<?php
require_once("configs/Configs.php");//加載配置文件
require_once("functions/login_flag.php");//是否已經(jīng)登錄
require_once("functions/class_mysql.php");//加載數(shù)據(jù)庫(kù)類(lèi)文件
//處理武將等級(jí)、經(jīng)驗(yàn)、代兵數(shù)
require_once("all_processing.php");
//處理武將等級(jí)、經(jīng)驗(yàn)、代兵數(shù)
//require_once("update_gen_grade.php");
//資源增長(zhǎng)
//require("auto_grow_resource.php");
//加載數(shù)據(jù)....
require_once("load_player_info.php");
require_once("functions/update_grade.php");
//加載放棄分城
include_once("city_out.php");
//查詢是不是有加成道具;
$query_use_if_goods=$db->query("select * from add_goods_info where u_id='".$_COOKIE['UserId']."' and c_id='".$_COOKIE['CityId']."' and type='1';");
$io=$db->fetch_array($query_use_if_goods);
if ($io['golds_add']) $golds_img=1;else $golds_img=0;
if ($io['rices_add']) $rices_img=1;else $rices_img=0;
if ($io['woods_add']) $woods_img=1;else $woods_img=0;
if ($io['ores_add']) $ores_img=1;else $ores_img=0;
//我的城池列表
$city_query=$db->query("select * from city where `u_id`='".$_COOKIE['UserId']."' order by c_id");
$woods_add = $add_resource[1] * $resource_percent;
$irons_add = $add_resource[2] * $resource_percent;
$golds_add = $add_resource[3] * $resource_percent;
$rices_add = $add_resource[4] * $resource_percent;
if($woods_add<1) $woods_add=1;
if($irons_add<1) $irons_add=1;
if($golds_add<1) $golds_add=1;
if($rices_add<1) $rices_add=1;
$atime = (int)(3600000/$woods_add);
if($atime=="") $atime=99999999;
$btime = (int)(3600000/$irons_add);
if($btime=="") $btime=99999999;
$ctime = (int)(3600000/$golds_add);
if($ctime=="") $ctime=99999999;
$dtime = (int)(3600000/$rices_add);
if($dtime=="") $dtime=99999999;
//查詢是否使用免戰(zhàn)牌
$query_mi=$db->query("select id from add_goods_info where type='2' and u_id='".$_COOKIE['UserId']."' and m_gid='80';");
$mian_if=$db->num_rows($query_mi);
$db->close();
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="pragma"content="no-cache">
<meta http-equiv="cache-control"content="no-cache,must-revalidate">
<meta http-equiv="expires"content="wed,26feb199708:21:57gmt">
<title>三國(guó)</title>
<link href="css/id.css" rel="stylesheet" type="text/css">
<link href="css/css.css" rel="stylesheet" type="text/css">
<style>
body{
margin-left:auto; margin-right:auto;
}
a:link {color: #FF3300;text-decoration: none;}
a:visited {color: #FF3300;text-decoration: none;}
a:active {color: #FF3300;text-decoration: none;}
a:hover {color: #734921;text-decoration: underline;}
</style>
</head>
<body style="overflow-x:hidden;" oncontextmenu="return false" onselectstart="return false" ondragstart="return false">
<script language="javascript" type="text/javascript" src="js/xmlhttprequest.js"></script>
<script language="javascript" type="text/javascript" src="js/game_init.js"></script>
<script language="javascript" type="text/javascript" src="js/resource_auto_grow.js"></script>
<script language="javascript" type="text/javascript" src="js/number_format.js"></script>
<script>
function ResumeError() {
return true;
}
window.onerror = ResumeError;
function refresh_page(){
top.window.location = 'index.php';
}
function refresh_self(){
self.window.location = 'infomation.php';
}
var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var base64DecodeChars = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
//客戶端Base64編碼
function base64encode(str) {
var out, i, len;
var c1, c2, c3;
len = str.length;
i = 0;
out = "";
while(i < len) {
c1 = str.charCodeAt(i++) & 0xff;
if(i == len)
{
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt((c1 & 0x3) << 4);
out += "==";
break;
}
c2 = str.charCodeAt(i++);
if(i == len)
{
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
out += base64EncodeChars.charAt((c2 & 0xF) << 2);
out += "=";
break;
}
c3 = str.charCodeAt(i++);
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6));
out += base64EncodeChars.charAt(c3 & 0x3F);
}
//out=out.replace("+","%2B");//替換+,否則在服務(wù)器解碼的時(shí)候會(huì)出錯(cuò)
return out;
}
//客戶端Base64解碼
function base64decode(str) {
var c1, c2, c3, c4;
var i, len, out;
len = str.length;
i = 0;
out = "";
while(i < len) {
/* c1 */
do {
c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
} while(i < len && c1 == -1);
if(c1 == -1)
break;
/* c2 */
do {
c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
} while(i < len && c2 == -1);
if(c2 == -1)
break;
out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));
/* c3 */
do {
c3 = str.charCodeAt(i++) & 0xff;
if(c3 == 61)
return out;
c3 = base64DecodeChars[c3];
} while(i < len && c3 == -1);
if(c3 == -1)
break;
out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));
/* c4 */
do {
c4 = str.charCodeAt(i++) & 0xff;
if(c4 == 61)
return out;
c4 = base64DecodeChars[c4];
} while(i < len && c4 == -1);
if(c4 == -1)
break;
out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
}
out=out.replace("+","%2B");//替換+,否則在服務(wù)器解碼的時(shí)候會(huì)出錯(cuò)
return out;
}
var build_name;
build_name=new Array('伐木場(chǎng)','采礦場(chǎng)','金礦','農(nóng)田','民居','武器工房','牧場(chǎng)','軍營(yíng)','翰林院','酒館','倉(cāng)庫(kù)','城墻','督造司');
function refresh_resource(){
//更新資源////////////////////////////
var resource = new XMLHttpRequest();
if (resource) {
resource.onreadystatechange = function() {
if (resource.readyState == 4 && (resource.status == 200 || resource.status == 304)) {
//response.charset="utf8";
var s = unescape(resource.responseText);
//alert(s);
var ars = s.split('|');
var colors;
//糧食
if(parseInt(ars[31]) <= parseInt(ars[1])) colors='RED;';
document.getElementById("rices").innerHTML='<span style=\"cursor:hand; color:'+colors+'\" title=\"糧食\">'+ars[1]+'</span>';
document.resource_form.r_rices.value=ars[1];
document.resource_form.r_rices_uplimit.value=ars[45];
//木材
if(parseInt(ars[32]) <= parseInt(ars[2])) colors='RED;';
document.getElementById("woods").innerHTML='<span style=\"cursor:hand; color:'+colors+'\" title=\"木材\">'+ars[2]+'</span>';
document.resource_form.r_woods.value=ars[2];
//alert(ars[2]);
document.resource_form.r_woods_uplimit.value=ars[46];
//鐵礦
if(parseInt(ars[33]) <= parseInt(ars[3])) colors='RED;';
document.getElementById("irons").innerHTML='<span style=\"cursor:hand; color:'+colors+'\" title=\"鐵礦\">'+ars[3]+'</span>';
document.resource_form.r_irons.value=ars[3];
document.resource_form.r_irons_uplimit.value=ars[47];
//黃金
if(parseInt(ars[34]) <= parseInt(ars[4])) colors='RED;';
document.getElementById("golds").innerHTML='<span style=\"cursor:hand; color:'+colors+'\" title=\"黃金\">'+ars[4]+'</span>';
document.resource_form.r_golds.value=ars[4];
document.resource_form.r_golds_uplimit.value=ars[44];
//工作人口
document.getElementById("total_house").innerHTML='<span id=\"total_house\" style=\"cursor:hand;\" title=\"總?cè)丝赲">'+ars[9]+'</span>';
//剩余人口
if(parseInt(ars[28])<0) color='RED';
else color='#734921';
document.getElementById("free_house").innerHTML='<span id=\"free_house\" style=\"cursor:hand; color:'+color+';\" title=\"剩余人口\">'+ars[28]+'</span>';
//<span style=\"cursor:hand; color:'+color+'\" title=\"剩余人口\">'+ars[28]+'</span>';
//土地
document.getElementById("city_size").innerText = 200 - parseInt(ars[11]);
//當(dāng)前城市士兵數(shù)
/*
var current_city_soldiers=Math.floor(ars[15]/10000);
if(current_city_soldiers >=1) current_city_soldiers_value = (current_city_soldiers + '萬(wàn)');
else current_city_soldiers_value = ars[15];
*/
document.getElementById("soldier").innerHTML='<span id=\"soldier\" style=\"cursor:hand;\" title=\"士兵\">'+ars[15]+'</span>';
//document.getElementById("current_city_officers").innerText = ars[16];//武將數(shù)
document.getElementById("total_citys").innerText = ars[22];//總城池?cái)?shù)
document.getElementById("total_officers").innerText = ars[23];//總武將數(shù)
document.getElementById("union_name").innerText = ars[24];//聯(lián)盟
if(parseInt(ars[24])=="" || parseInt(ars[24])=="0") document.getElementById("union_name").innerText = '無(wú)';//聯(lián)盟
if(parseInt(ars[25])>100) ars[25]=100;
if(parseInt(ars[40])<1) ars[25]=0;
document.getElementById("citywall_status").innerHTML = "<a href=\"build.php?build_page=recovery#citywall\" target=\"main\">"+ars[25]+"%";//城墻狀態(tài)
document.getElementById("p_grade").innerText = parseInt(ars[26]);//玩家等級(jí)
var percent = Math.floor(ars[0]/ars[27]*100);
if(percent>100) percent=100;
document.getElementById("p_score").innerHTML = '<span id=\"p_score\">'+ars[0]+'/'+ars[27]+'</span>';
p_score2.style.width = percent+'%';
//在線人數(shù)
document.getElementById("online").innerText = ars[29];
//排名
document.getElementById("rank").innerText = ars[30];
//產(chǎn)量
document.getElementById("golds_produce").innerHTML = parseInt(ars[36]);
document.getElementById("rices_produce").innerHTML = parseInt(ars[37]);
document.getElementById("woods_produce").innerHTML = parseInt(ars[38]);
document.getElementById("irons_produce").innerHTML = parseInt(ars[39]);
//生產(chǎn)百分比
document.getElementById("produce").innerHTML = parseInt(ars[43]);
if(!ars[41] || ars[41]=='') document.getElementById("building").innerHTML = '建筑隊(duì)列空閑';
else document.getElementById("building").innerHTML = build_name[parseInt(ars[41])-1]+'正在升級(jí)中';
//document.getElementById("building").innerText = parseInt(ars[41]);
if(!ars[42] || ars[42]=='' || build_name[parseInt(ars[42])-1]=='') document.getElementById("complate_building").innerHTML = '無(wú)';
else document.getElementById("complate_building").innerHTML = '已完成'+build_name[parseInt(ars[42])-1]+'升級(jí)';
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -