📄 armament_unite.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");//加载数据库类文件
//调用所有进程
require_once("all_processing.php");
//我的武将列表
$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`='0' and g1.`g_fy`='0'");
while($row=$db->fetch_array($hero_query)) $my_hero_list[]=$row;
//当前拥有士兵数
$query=$db->query("select * from soldier where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$_COOKIE['CityId']."'");
$soldier_result=$db->fetch_array($query);
//读取士兵训练基础表
$query2=$db->query("select * from soldier_attribute");
while($row2=$db->fetch_array($query2)) $soldier_list[]=$row2;
$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">
<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:#E7CBA5;}
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:-8px;margin-left:-65px;}
/*.img_style { filter:Gray(enabled=true); }*/
.img_style { filter:Gray(enabled=false);}
.img_style1 { filter:Gray(enabled=false);}
.img_style0 { filter:Gray(enabled=true);}
</style>
<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<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='<span style=\"color:RED; font-weight:bold;\" id="\"gen_uplimit\">'+val2+'</span>';
//document.attackForm.gen_max_soldier_num.value = val2;
}
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 input_num(){
if(document.attackForm.lurcher_num.value > document.attackForm.max_num.value){
document.attackForm.lurcher_num.value = document.attackForm.max_num.value;
}
}
</script>
</head>
<body>
<!--导航-->
<div id="tc_02">
<div id="mb_0">
<div id="mc_01"><a href="soldier_educate.php" target="main">军事训练</a></div>
</div>
<div id="mb_2">
<div id="mc_01"><a href="armament_action.php" target="main">军事行动</a></div>
</div>
<div id="mb_2">
<div id="mc_01"><a href="armament_union_action.php" target="main">联合进攻</a></div>
</div>
</div>
<div id="mb_01">
<div class="page_build_title">军事行动</div>
</div>
<div id="mb_04">
<?php
if ($armament_if) {
echo '<br/><br/>战争系统正在改进,暂时关闭,请大家原谅!';
}else {
?>
<!--替换区域开始-->
<div id="arm">
<div style="padding-bottom:10px;padding-top:20px;"><a href="war_info.php" target="_self" class="d">【查看当前正在执行的军事行动任务】</a><br>
<?php
$query = $db->query("select * from player_info where `u_id`='".$_COOKIE['UserId']."'");
$me_player_info_result = $db->fetch_array($query);
if(time() < $me_player_info_result['create_date']+$me_player_info_result['protect_date']*60) {
echo $me_player_info_result['protect_date']."<font color:RED>您当前处于保护期内,无法对其他玩有发起军事行动!</font>";
}
?>
</div>
<table width="100%" border=1 cellpadding=3 cellspacing=0 style="margin-bottom:15px; border-collapse:collapse;font-size:12px;border:1px solid threeddarkshadow; margin-top:15px; " bordercolor="threeddarkshadow" align="center">
<TR height="28">
<TD align="center" class="sub_subtitle" height="40" width="65">行动类型</TD>
<TD align="left">
<form name="html_form1" id="html_form1">
<select name="menu1" onchange="MM_jumpMenu('self',this,0)">
<option value="armament_action.php?action_type=0" <?php if($_GET['action_type']=="" or $_GET['action_type']=="0") echo "selected";?>>掠夺</option>
<option value="armament_action.php?action_type=7" <?php if($_GET['action_type']=="7") echo "selected";?>>讨伐 </option>
<option value="armament_action.php?action_type=3" <?php if($_GET['action_type']=="3") echo "selected";?>>侦察</option>
<option value="armament_action.php?action_type=5" <?php if($_GET['action_type']=="5") echo "selected";?>>筑城</option>
<option value="armament_action.php?action_type=2" <?php if($_GET['action_type']=="2") echo "selected";?>>输送</option>
<option value="?action_type=6" <?php if($_GET['action_type']=="6") echo "selected";?>>联合进攻</option>
</select>
</form>
</TD>
</tr>
<form action="armament_unite_do.php" method="post" name="attackForm" >
<input type="hidden" name="form_action" value="form_up">
<input type="hidden" name="attack_type" value="<?php if($_GET['action_type']=="") echo '0' ;else echo $_GET['action_type'];?>"/>
<TR>
<TD align="center" class="sub_subtitle" height="40"><span id="text2">目标城池</span></TD>
<TD align="left">
<input name="area" type="text" size="6" value="<?php echo $_GET['x'];?>">
<input name="area_x" type="text" size="3" value="<?php echo $_GET['y'];?>">
<input name="button" type="button" class="submit" id="button" value="查看地图" onclick="javascript:self.window.location='world_map.php';">
</TD>
</TR>
<tr id="my_gen_list">
<td align="center" style="margin-top:20px;margin-bottom:20px;">选择武将</td>
<td colspan="2" align="left" class="sub_subtitle">
<div class="gen" style="padding-left:10px; margin-top:0px;margin-bottom:20px;">
<?php
if($my_hero_list<>"") foreach ($my_hero_list as $k=>$gen){
?>
<div class="gen_list" style="margin-top:20px;">
<a class="info" href="javascript:choice('<?php echo $k;?>','<?php echo $gen['g_command']+$gen['bf_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']+$gen['bf_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']+$gen['bf_command'];?>','<?php echo $gen['ge_name'];?>');" />
</div>
<?php }else{ ?>
<div class="gen" style="text-align:left;padding-top:20px;">当前还没有招募武将,<a href="gen_conscribe.php" target="_self" class="d">【招募武将】</a></div>
<?php } ?>
</div>
</td>
</tr>
<?php
}
?>
<tr id="max_soldier_info">
<td colspan="2" align="center">当前武将最多可派(<span id="gen_uplimit">0</span>)个兵出征
<input type="hidden" name="gen_max_soldier_num" value="0" maxlength="10" size="8" />
</td>
</tr>
<TR id="show_02">
<TD align="center" class="sub_subtitle">派 兵</TD>
<TD align="left">
<?php if($soldier_list <> "") foreach ($soldier_list as $i=>$m) {
if($m['s_type']<>"2" and $m['s_type']<>"8"){
$current_soldier=$soldier_result[$soldier_type_name_en[$m['s_type']]];
$total_soldier_num2 += $current_soldier;
if($current_soldier>0) {
?>
<input type="Text" name="soldier_num<?php echo ($i+1);?>" value="" maxlength="10" size="8" onchange="max_control('<?php echo ($i+1);?>');" />
<input type="hidden" name="soldier_type<?php echo ($i+1);?>" value="<?php echo $m['s_type'];?>" maxlength="10" size="8">
<input type="hidden" name="max_soldier_num<?php echo ($i+1);?>" value="<?php echo $current_soldier;?>" maxlength="10" size="8">
<input type="Button" class="button" value="最大" onclick="document.attackForm.soldier_num<?php echo ($i+1);?>.value='<?php if($current_soldier>0) echo $current_soldier;else echo "0";?>'">
<?php echo $soldier_type_name[$m['s_type']];?> (您拥有<span style="color:RED;"> <?php if($current_soldier>0) echo $current_soldier;else echo "0";?></span>)<br>
<?php }else { ?>
<input type="hidden" name="soldier_num<?php echo ($i+1);?>" value="" maxlength="10" size="8" onchange="max_control('<?php echo ($i+1);?>');" />
<input type="hidden" name="soldier_type<?php echo ($i+1);?>" value="<?php echo $m['s_type'];?>" maxlength="10" size="8">
<?php }}
}?>
<?php if($total_soldier_num2<1) { ?>
<div class="gen" style="text-align:left;padding-left:17px;padding-top:5px;">当前还没有训练士兵,<a href="soldier_educate.php" target="_self" class="d">【军事训练】</a></div>
<?php
}
?>
</TD>
</TR>
</TABLE>
</td>
</tr>
<tr><td align="center">
<input type="Submit" class="button" value=" 出征 " name="submit_name" /></td></tr>
</form>
</table>
</div>
<!--替换区域结束-->
</div>
</div>
<div id="mb_03"></div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -