📄 gen_mansion.php
字号:
<?php
require_once("functions/login_flag.php");//是否已经登录
require_once("functions/class_mysql.php");//加载数据库类文件
?>
<!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">
<title>武将官邸</title>
<link href="css/id.css" rel="stylesheet" type="text/css">
<link href="css/css.css" rel="stylesheet" type="text/css">
<link type="text/css" href="css/build.css" rel="stylesheet">
<style>
body{
margin-top:0px;
}
</style>
</head>
<body>
<script language="javascript" type="text/javascript">
//查找所属玩家的角色
var num;
num=<?php
$query=$db->query("select count(id) as num from gen where `g_uid`='".$_COOKIE['UserId']."';");
$num=$db->fetch_array($query);
echo $num['num'];
?>
//查找对应武将角色在本机的图片
var CivilPic = new Array(num);
CivilPic[0] = new Image();
CivilPic[0].src = "img/gen_header/" + 0 + ".gif";
<?php
$query=$db->query("select * from gen where `g_uid` = '".$_COOKIE['UserId']."';");
while ($list=$db->fetch_array($query)) {
?>
CivilPic[<?php echo $list['id'];?>] = new Image();
CivilPic[<?php echo $list['id'];?>].src = "img/gen_header/" + <?php echo $list['g_gid'];?> + ".gif";
<?php
}
?>
//文明提示
var CivilHint = new Array(num);
CivilHint[0] = "请选择武将。";
CivilHint[1] = "具有优秀兵种: 帕拉丁。极好的防御个体。每个城市中心只能有一个。"; //法兰克 帕拉丁
CivilHint[2] = "具有优秀兵种: 骆驼骑兵。极好的攻击个体. 每个城市中心只能有一个。"; //埃及 骆驼骑兵
CivilHint[3] = "具有优秀兵种: 古罗马军人。极好的防御和攻击个体。每个城市中心只能有一个。"; //拜占庭 古罗马军人
CivilHint[4] = "具有优秀兵种: 骑射手。极好的攻击个体。每个城市中心只能有一个。"; //匈奴 马上弓箭手
CivilHint[5] = "具有优秀兵种: 巫师。不是好的军事上的个体,但是战争后他们占领大量的陆地。每个城市中心只能有一个。"; //印加 巫师
CivilHint[6] = "具有优秀兵种: 功夫勇士。强大的防御和攻击勇士。不需要任何武器。每个城市中心只能有一个。"; //中国 功夫勇士
CivilHint[7] = "具有优秀兵种: 巨人勇士。非常好的攻击个体,易于训练。每个城市中心只能有一个。"; //野蛮 巨人勇士
CivilHint[8] = "具有优秀兵种: 骆驼骑兵。非常好的攻击个体。每个城市中心只能有一个。"; //土耳其 骆驼骑兵
CivilHint[9] = "具有优秀兵种: 祖鲁勇士。极好的攻击个体。每个城市中心只能有五个。"; //祖鲁族 祖鲁勇士
function changeCivilizationPic(obj)
{
document.getElementById("imgCivil").src = CivilPic[obj.options[obj.selectedIndex].value].src;
document.getElementById("spanCivilHint").innerHTML = CivilHint[obj.options[obj.selectedIndex].value];
}
function del()
{
if(window.confirm("你确定要解雇该武将吗?"))
{
return true;
}
return false;
}
</script>
<!--导航-->
<?php require_once("gen_daohang.htm");?>
<div id="mb_01">
<div class="page_build_title">武将官邸</div>
</div>
<div id="mb_04">
<!--替换区域开始-->
<form id="form1" name="form1" method="post" action="gen_mansion_process.php">
<input type="hidden" name="action" value="gen_mansion" />
<table width="95%" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;">
<tr>
<td>选择移动将领</td>
<td>选择移动城池</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><select name="select" onchange="changeCivilizationPic(this)">
<option value="0">请选择武将</option>
<?php
$query=$db->query("select a.id,b.ge_name from gen a left join m_gen b on (a.g_gid=b.id) where a.`g_uid` ='".$_COOKIE['UserId']."' and a.`g_cid`='".$_COOKIE['CityId']."' and a.g_status='0' and a.g_fy='0';");
while ($list=$db->fetch_array($query)) {
?>
<option value="<?php echo $list['id'];?>"><?php echo $list['ge_name'];?></option>
<?php
}
?>
</select>
<img id="imgCivil" src="img/gen_header/0.gif" width="71" height="60"><span id="spanCivilHint" class="notice1">请选武将。</span></td>
<td><select name="select2">
<option value="0" selected="selected">请选择城市名称</option>
<?php
$query=$db->query("select * from city where `u_id`='".$_COOKIE['UserId']."' and c_id <> '".$_COOKIE['CityId']."';");
while ($list=$db->fetch_array($query))
{
?>
<option value="<?php echo $list['c_id'];?>"><?php echo $list['c_name'].'('.$list['c_area'].':'.$list['c_area_x'].':'.$list['c_area_y'].')';?></option>
<?php
}
?>
</select>
</td>
<td><input type="submit" name="submit" value="移动" /></td>
<td><input type="submit" name="submit2" onclick="return del()" value="下野" /></td>
</tr>
</table>
</form>
<!--替换区域结束-->
</div>
</div>
<div id="mb_03"></div>
<?php $db->close();?>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -