📄 war_info.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");//加载数据库类文件
//更新消息通知
$db->query("update war_task set `notice`='1' where `to_u_id`='".$_COOKIE['UserId']."'");
if($_GET['ac']=="del_result"){
$db->query("delete from war_result where `w_id`='".$_GET['w_id']."' and `u_id`='".$_COOKIE['UserId']."'");
echomsg("","?");
}
//读取士兵训练基础表
$query=$db->query("select * from soldier_attribute");
while($row=$db->fetch_array($query)) $soldier_list[]=$row;
//调用战争:筑城处理进程
require_once("armament_action_processing_task.php");
//取消军事行动任务
if($_GET['war_action']=="chanel_war_task"){
require_once("armament_action_processing_task.php");
//取得当前要取消的军事行动任务的信息
$query=$db->query("select * from war_task where `u_id`='".$_COOKIE['UserId']."' and `w_id`='".$_GET['w_id']."'");
$chanel_result=$db->fetch_array($query);
if ($chanel_result['is_complate']=='1') echomsg("","?");
$rices = $chanel_result['w_eat_rices'] + $chanel_result['w_take_rices'];
$golds = $chanel_result['w_take_golds'];
$woods = $chanel_result['w_eat_woods'] + $chanel_result['w_take_woods'];
$irons = $chanel_result['w_eat_irons'] + $chanel_result['w_take_irons'];
//if(!is_numeric($_GET['a_type']) or $_GET['a_type']<0 or $_GET['a_type']>5) echomsg("");
//if($_GET['a_type']<>$chanel_result['w_type'] or $_GET['w_id']<>$chanel_result['w_id']) echomsg("");
if($_GET['a_type']=="5"){//取消筑城任务////////////////////////////
$gen_id= $chanel_result['w_gen'];
$query=$db->query("update gen set `g_status`='0' where `g_uid`='".$UserId."' and `g_cid`='".$CityId."' and `g_gid`='".$gen_id."'");
if($query) $db->query("update soldier set `zc_dui`=(`zc_dui`+'1') where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$_COOKIE['CityId']."'");
//增加资源和仓库
$db->query("update resource set `rices`=(`rices`+'".$chanel_result['w_take_rices']."'),`woods`=(`woods`+'".$chanel_result['w_take_woods']."'),`golds`=(`golds`+'".$golds."'),`ores`=(`ores`+'".$chanel_result['w_take_irons']."') where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$_COOKIE['CityId']."'");
$db->query("delete from war_task where `u_id`='".$_COOKIE['UserId']."' and `w_id`='".$_GET['w_id']."';");
//增加当前城池的士兵数总数
// $db->query("update city set `free_barracks`=(`free_barracks`+1) where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$_COOKIE['CityId']."'");
}elseif($_GET['a_type']=="2"){//取消输送士兵任务//////////////////////////
$gen_id= $chanel_result['w_gen'];
$soldier_type = explode("|",$chanel_result['w_soldier_type']);
$soldier_num = explode("|",$chanel_result['w_soldier_num']);
//增加资源和仓库
$db->query("update resource set `rices`=(`rices`+'".$chanel_result['w_take_rices']."'),`woods`=(`woods`+'".$chanel_result['w_take_woods']."'),`golds`=(`golds`+'".$golds."'),`ores`=(`ores`+'".$chanel_result['w_take_irons']."') where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$_COOKIE['CityId']."'");
//
// foreach ($soldier_list as $i2=>$m2){
// $db->query("update soldier set `".$soldier_type_name_en[$soldier_type[$i2]]."`=`".$soldier_type_name_en[$soldier_type[$i2]]."`+'".$soldier_num[$i2]."' where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$_COOKIE['CityId']."' ");
// }
}elseif($_GET['a_type']=="3"){//取消间谍任务//////////////////////////
//还原间谍数量与资源
//$lurcher_need_golds = $chanel_result['w_soldier_num'] * $lurcher_need_golds;
// $db->query("update soldier set `tan_zhi`=(`tan_zhi`+'".$chanel_result['w_soldier_num']."') where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$_COOKIE['CityId']."'");
// $db->query("update resource set `rices`=(`rices`+'".$rices."'),`woods`=(`woods`+'".$woods."'),`golds`=(`golds`+'".$golds."'),`ores`=(`ores`+'".$irons."') where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$_COOKIE['CityId']."'");
}else{//取消掠夺、袭击、占领任务//////////////////////////
$gen_id= $chanel_result['w_gen'];
$soldier_type = explode("|",$chanel_result['w_soldier_type']);
$soldier_num = explode("|",$chanel_result['w_soldier_num']);
//更新武将工作状态
// $query=$db->query("update gen set `g_status`='0' where `g_uid`='".$_COOKIE['UserId']."' and `g_cid`='".$_COOKIE['CityId']."' and `g_gid`='".$gen_id."'");
//还原资源和仓库
// $db->query("update resource set `rices`=(`rices`+'".$rices."'),`woods`=(`woods`+'".$woods."'),`golds`=(`golds`+'".$golds."'),`ores`=(`ores`+'".$irons."') where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$_COOKIE['CityId']."'");
//还原士兵数量
// foreach ($soldier_list as $i2=>$m2){
// $db->query("update soldier set `".$soldier_type_name_en[$soldier_type[$i2]]."`=`".$soldier_type_name_en[$soldier_type[$i2]]."`+'".$soldier_num[$i2]."' where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$_COOKIE['CityId']."' ");
// }
//删除记录攻击次数表
$w_id=$_GET['w_id'];
$db->query("delete from user_a_num where u_id='".$_COOKIE['UserId']."' and t_id='".$w_id."';");
}
if($_GET['a_type']<>"5"){
$n_times=time();
$user_old_times=$n_times-$chanel_result['w_start_time'];
$user_old_times=$user_old_times+$n_times;
$db->query("update war_task set w_start_time='".$n_times."',w_end_time='".$user_old_times."',w_gen_ni='0',w_task_type='0',is_complate='1' where `u_id`='".$_COOKIE['UserId']."' and `w_id`='".$_GET['w_id']."'");
}
// echomsg($n_times.'|'.$user_old_times);
//update_resource();
refresh();
echomsg("","?");
}
//获取我方对敌方的军事行动任务队列
$query=$db->query("select * from war_task where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$_COOKIE['CityId']."' order by w_id");
while($row=$db->fetch_array($query)) $current_task_list[]=$row;
/////////////////////////////////////获取我方联合进攻军事行动集结///////////////////////////////////
$query=$db->query("select * from union_action where (`u_id`='".$_COOKIE['UserId']."' or `group_uid1`='".$_COOKIE['UserId']."' or `group_uid2`='".$_COOKIE['UserId']."' or `group_uid3`='".$_COOKIE['UserId']."' or `group_uid4`='".$_COOKIE['UserId']."' ) and title='1'");
$row=$db->fetch_array($query);
$query=$db->query("select * from war_task where (`u_id`='".$row['u_id']."' or `u_id`='".$row['group_uid1']."' or`u_id`='".$row['group_uid2']."' or`u_id`='".$row['group_uid3']."' or`u_id`='".$row['group_uid4']."') and w_type='6' and w_task_type='1'");
while($row1=$db->fetch_array($query)) $union_task_list[]=$row1;
if($union_task_list[0]['u_id']){
$num=$db->num_rows($query);
for($i=0;$i<$num;$i++)
{
$soon_time[$i]=$union_task_list[$i]['w_end_time'];
}
asort($soon_time);
$n=1;
foreach ($soon_time as $a)
{
if($n==1)$times=$a;
$n++;
}
}
////////////////////////////////////////////////////////////////////////
//获取敌方对多方的军事行动任务队列
$query=$db->query("select * from war_task where `to_u_id`='".$_COOKIE['UserId']."' and `to_c_id`='".$_COOKIE['CityId']."' and `w_type`<>'2' and `w_type`<>'5' and `is_complate`='0' order by w_start_time");
while($row=$db->fetch_array($query)) $defang_task_list[]=$row;
//获取三国军事行动任务结果
$query=$db->query("select * from war_result where `w_type`='0' or `w_type`='1' or `w_type`='4' or (`w_type`='6' and `to_u_id`<>'0') order by w_date desc limit 10");
while($row=$db->fetch_array($query)) $world_action_result[]=$row;
$query_r=$db->query("select * from war_result where `w_type`<>'3' and ((`u_id`='".$_COOKIE['UserId']."' and `wo_del_flag`='0' and `w_read`='0') or (`to_u_id`='".$_COOKIE['UserId']."' and `de_del_flag`='0' and `w_read2`='0')) order by w_date desc ");
$num_r=$db->num_rows($query_r);
?>
<!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:#000000;}
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:220px; border:2px solid #fff; line-height:16px; background-color:#E7CB94; color:#000000; text-align: left; text-decoration:none; margin-top:20px;margin-left:-220px;}
.img_style { filter:Gray(enabled=tru); }
.img_style1 { filter:Gray(enabled=false);}
</style>
</head>
<body>
<script language="JavaScript">
<!--
function disp_confirm(){
var name=confirm("确定要取消吗?")
if (name==true)
{
return true;
}
else
{
return false;
}
}
function del_confirm(){
var name=confirm("确定要删除吗?")
if (name==true)
{
return true;
}
else
{
return false;
}
}
//-->
</script>
<script language="JavaScript">
<!--
javascript:window.history.forward(1);
//-->
</script>
<!--导航-->
<?php require_once("system_daohang.htm");?>
<div id="mb_01">
<div class="page_build_title">战争信息<a name="#war"></a></div>
</div>
<div id="mb_04">
<!--替换区域开始-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -