📄 gen_recovery.php
字号:
<?php
require_once("configs/Configs.php");//加载配置文件
require_once("functions/login_flag.php");//是否已经登录
require_once("functions/func_common.php");//加载函数文件
require_once("functions/class_mysql.php");//加载数据库类文件
//当前拥有士兵数
$query=$db->query("select * from soldier where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$_COOKIE['CityId']."'");
$soldier_result=$db->fetch_array($query);
//读取士兵训练基础表
$query=$db->query("select * from soldier_attribute");
while($row=$db->fetch_array($query)) $soldier_list[]=$row;
//调用统一处理队列进程
require_once("all_processing.php");
$public_falg="my_gen_list";//我的武将列表
//我的武将列表
if($public_falg=="my_gen_list"){
$hero_query=$db->query("select * from gen g1,m_gen g2 where g1.`g_gid`=g2.`id` and g1.`g_uid`='".$_COOKIE['UserId']."' and g1.`g_cid`='".$_COOKIE['CityId']."' and g1.g_status<2;");
while($row=$db->fetch_array($hero_query)) $my_hero_list[]=$row;
}
//角色与城池相关信息
if($public_falg=="player_public_info"){
$query=$db->query("select c_area,c_area_x,c_area_y from city where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$_COOKIE['CityId']."'");
$player_public_result = $db->fetch_array($query);
}
////////////当前防御士兵队列和新队列提交//////////////
include("gen_recovery_processing.php");//调用担处理列表
$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">
<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">
<script>
function choice(val,val2,g_name){
var val,val2;
for(i=0;i<<?php echo count($my_hero_list);?>;i++){
if(i!=val){
eval("document.getElementById('gen_header"+i+"').className=\"img_style1\";");
}else{
eval("document.getElementById('gen_header"+val+"').className=\"img_style\";");
}
}
val2 = parseInt(val2);
document.getElementsByName("gen")[val].checked=true;
document.getElementById("gen_uplimit").innerHTML='<br /><span style=\"color:RED; font-weight:bold;\">'+g_name+'最大带兵数('+val2+')</span>';
document.attackForm.gen_max_soldier_num.value = val2;
}
function checkForm(obj){
var counter =<?php echo count($my_hero_list);?>;
for(i=0;i<<?php echo count($my_hero_list);?>;i++){
if(document.getElementsByName("gen")[i].checked==false)
{
counter = counter - 1;
}
}
if(counter < 1 && (my_gen_list.style.display=='block' || my_gen_list.style.display=='')){
alert("请选择武将!");
return false;
}
var a_type;
//a_type = obj.attack_type.value;
var army_1,army_2,army_3,army_4,army_5,army_6;
var num_1,num_2,num_3,num_4,num_5,num_6,total_num,gen_max_num;
army_1 = obj.army_1.value;
army_2 = obj.army_2.value;
army_3 = obj.army_3.value;
army_4 = obj.army_4.value;
army_5 = obj.army_5.value;
army_6 = obj.army_6.value;
num_1 = obj.soldier_num_one_1.value;
num_2 = obj.soldier_num_one_2.value;
num_3 = obj.soldier_num_one_3.value;
num_4 = obj.soldier_num_one_4.value;
num_5 = obj.soldier_num_one_5.value;
num_6 = obj.soldier_num_one_6.value;
if(a_type=='0' || a_type=='1' || a_type=='4'){
if(army_1=='0' && army_2=='0' && army_3=='0' && army_4=='0' && army_5=='0' && army_6=='0'){
alert("请至少选择一个兵种!");
return false;
}
if(num_1=='0' && num_2=='0' && num_3=='0' && num_4=='0' && num_5=='0' && num_6=='0'){
alert("请至少派出一个士兵!");
return false;
}
}
total_num = parseInt(num_1) + parseInt(num_2) + parseInt(num_3) + parseInt(num_4) + parseInt(num_5) + parseInt(num_6);
gen_max_num = obj.gen_max_soldier_num.value;
if(parseInt(total_num) > parseInt(gen_max_num)){
alert("当前派兵数超过武将最大带兵上限!");
return false;
}
}
function max_control(i){
var current_Num = eval("document.attackForm.soldier_num"+i+".value");
var max_Num = eval("document.attackForm.max_soldier_num"+i+".value");
if(parseInt(current_Num) > parseInt(max_Num)){
eval("document.attackForm.soldier_num"+i+".value="+parseInt(max_Num));
}
}
function soldier_max_select(val,s){
var sval;
sval = val.split("|");
if(sval[1]>0){
eval("document.attackForm.soldier_num_"+s+".value=0");
eval("document.attackForm.max_soldier_num_"+s+".value="+sval[1]);
eval("soldier_num_"+s+".style.display=\"\"");
//eval("document.attackForm.soldier_num_"+s+".type='text'");
}
else{
eval("document.attackForm.max_soldier_num_"+s+".value=0");
eval("document.attackForm.soldier_num_"+s+".value=0");
//eval("document.attackForm.soldier_num_"+s+".type='hidden'");
eval("soldier_num_"+s+".style.display=\"none\"");
}
}
function max_control2(s_type){
var s_val;
max_val = eval("document.attackForm.max_soldier_num_"+s_type+".value");
s_val = eval("document.attackForm.soldier_num_"+s_type+".value");
if(parseInt(s_val) > parseInt(max_val)){
eval("document.attackForm.soldier_num_"+s_type+".value="+parseInt(max_val));
}
}
</script>
<style>
body{
margin-top:0px;
}
a.info {
position:relative; z-index:0; color:#000; text-decoration:none;}
a.info:hover {
z-index:1; background-color:#DCB471;}
a.info span {
display: none;}
a.info:hover span { display:block; position:absolute; padding-left:5px; padding-right:5px; padding-top:5px; padding-bottom:5px;width:180px; border:2px solid #fff; line-height:16px; background-color:#E7CB94; color:#000000; text-align: left; text-decoration:none; margin-top:-138px;margin-left:-65px;}
.img_style { filter:Gray(enabled=tru); }
.img_style1 { filter:Gray(enabled=false);}
</style>
</head>
<body>
<!--导航-->
<?php require_once("gen_daohang.htm");?>
<div id="mb_01">
<div class="page_build_title">城池防御列表</div>
</div>
<div id="mb_04">
<!-- 替换区域 开始 -->
<div id="arm">
<table width="100%" border=1 cellpadding=5 cellspacing=0 style="border-collapse:collapse;border:1px solid threeddarkshadow;font-size:12px; " bordercolor="threeddarkshadow" align="center">
<form action="" method="post" name="attackForm" onSubmit="return checkForm(this);">
<input type="hidden" name="action" value="refer">
<tr id="my_gen_list" style="display:<?php if($_GET['action_type']<>"2") echo "block;";else echo "none;";?>;">
<td align="center" width="65">选择武将</td>
<td colspan="2" align="left" class="sub_subtitle">
<div class="gen">
<?php if($my_hero_list<>"") foreach ($my_hero_list as $k=>$gen){ ?>
<div class="gen_list">
<a class="info" href="javascript:choice('<?php echo $k;?>','<?php echo $gen['g_command'];?>','<?php echo $gen['ge_name'];?>');" >
<img id="gen_header<?php echo $k;?>" src="img/gen_header/<?php echo $gen['g_gid'];?>.jpg" width="85px" height="85px" border="0" />
<span>
武 力: <?php echo $gen['g_power'];?> 智 力: <?php echo $gen['g_intellect'];?><br/>
统 率: <?php echo $gen['g_commend'];?> 忠 诚: <?php echo $gen['g_fealty'];?><br/>
经验值: <?php echo $gen['g_exploit'];?> <br />
官 职: <?php echo $gen['g_name'];?><br/>
带兵上限: <?php echo $gen['g_command'];?><br/>
</span>
</a>
<?php echo $gen['ge_name'];?>(<?php echo $gen['g_grade'];?>级)<br>
<input type="radio" name="gen" value="<?php echo $gen['g_gid']."|".$gen['ge_name'];?>" style="cursor:hand;" onclick="javascript:choice('<?php echo $k;?>','<?php echo $gen['g_command'];?>','<?php echo $gen['ge_name'];?>');" />
</div>
<?php }else { ?>
<div class="gen" style="text-align:left;">当前防御需要选择武将,<a href="my_gen.php" target="_self">招募武将</a></div>
<?php } ?>
</div>
</td>
</tr>
<?php
if (!empty($recovery_list_now)) {
?>
<TR>
<TD align="center" class="sub_subtitle">现防御士兵</TD>
<TD align="left">
<?php
foreach ($recovery_list_now as $rn){
$soldier_class = explode('|',$rn['soldier_class']); //士兵类别;
$soldier_num = explode('|',$rn['soldier_num']); //士兵数量;
?>
<table id="war" style="font-size:12px;margin:0px; padding:0px;display:<?php if($_GET['action_type']=="0" or $_GET['action_type']=="1" or $_GET['action_type']=="4" or !$_GET['action_type']) echo "block;";else echo "none;";?>">
<tr>
<td rowspan="2" width="30%">前锋军</td>
<td width="30%">
<?php
if ($soldier_class['0']=='0') {
echo '无';
}else {
echo $soldier_type_name[$soldier_class['0']];
}?>
</td>
<td width="20%">
<?php
if ($soldier_num['0']=='0') {
echo '无';
}else {
echo $soldier_num['0'];
}?>
</td>
<td rowspan="6" align="center" valign="center" width="20%">
<span style="color:red;font-weight:bold;">防御武将:<?php echo $rn['g_name'];?></span>
</td>
</tr>
<tr>
<td>
<?php
if ($soldier_class['1']=='0') {
echo '无';
}else {
echo $soldier_type_name[$soldier_class['1']];
}?>
</td>
<td>
<?php
if ($soldier_num['1']=='0') {
echo '无';
}else {
echo $soldier_num['1'];
}?>
</td>
</tr>
<tr>
<td rowspan="2">中 军</td>
<td>
<?php
if ($soldier_class['2']=='0') {
echo '无';
}else {
echo $soldier_type_name[$soldier_class['2']];
}?>
</td>
<td>
<?php
if ($soldier_num['2']=='0') {
echo '无';
}else {
echo $soldier_num['2'];
}?>
</td>
</tr>
<tr>
<td>
<?php
if ($soldier_class['3']=='0') {
echo '无';
}else {
echo $soldier_type_name[$soldier_class['3']];
}?>
</td>
<td>
<?php
if ($soldier_num['3']=='0') {
echo '无';
}else {
echo $soldier_num['3'];
}?>
</td>
</tr>
<tr>
<td rowspan="2">后卫军</td>
<td>
<?php
if ($soldier_class['4']=='0') {
echo '无';
}else {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -