⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 armament_action_infomation.php

📁 Download you own three BR
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php
require_once("configs/Configs.php");//加载配置文件
require_once("functions/login_flag.php");//是否已经登录
require_once("functions/func_common.php");//加载函数文件
require_once("functions/class_mysql.php");//加载数据库类文件

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");

//获取军事行动任务队列
$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 war_result where `u_id`='".$_COOKIE['UserId']."' order by w_date desc limit 10");
while($row=$db->fetch_array($query)) $current_action_result[]=$row;


//取消军事行动任务
if($_GET['war_action']=="chanel_war_task"){

		//取得当前要取消的军事行动任务的信息
		$query=$db->query("select * from war_task where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$_COOKIE['CityId']."' and `w_id`='".$_GET['w_id']."'");
		$chanel_result=$db->fetch_array($query);
	
	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`='".$UserId."' and `c_id`='".$CityId."'");
	    //增加资源和仓库
  	    $db->query("update resource set `free_stores`=(`free_stores`+'".$chanel_result['w_eat_rices']."'),`rices`=(`rices`+'".$chanel_result['w_eat_rices']."') where `u_id`='".$_COOKIE['UserId']."'");
  		
		$query=$db->query("delete from war_task where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$CityId."' 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 `free_stores`=(`free_stores`+'".$chanel_result['w_eat_rices']."'),`rices`=(`rices`+'".$chanel_result['w_eat_rices']."') where `u_id`='".$_COOKIE['UserId']."'");
  		
		foreach ($soldier_list as $i2=>$m2){
  	   	  $db->query("update soldier as s,city as c set c.`free_barracks`=(`free_barracks`+'".$soldier_num[$i2]."'),s.`".$soldier_type_name_en[$soldier_type[$i2]]."`=(s.`".$soldier_type_name_en[$soldier_type[$i2]]."`+'".$soldier_num[$i2]."') where s.`u_id`=c.`u_id` and s.`c_id`=c.`c_id` and s.`u_id`='".$_COOKIE['UserId']."' and c.`c_id`='".$_COOKIE['CityId']."' ");	   	
  	    }
  	    
		$query=$db->query("delete from war_task where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$CityId."' and `w_id`='".$_GET['w_id']."'");
	
	}elseif($_GET['a_type']=="3"){//取消间谍任务//////////////////////////
 
		//还原间谍数量与资源
		$lurcher_need_golds = $chanel_result['w_soldier_num'] * $lurcher_need_golds;
  	   	$db->query("update lurcher as l,resource as r set l.`lurcher_num`=(l.`lurcher_num`+'".$chanel_result['w_soldier_num']."'),r.`free_stores`=(r.`free_stores`-'".$lurcher_need_golds."'),r.`golds`=(r.`golds`+'".$lurcher_need_golds."') where l.`u_id`=r.`u_id` and r.`u_id`='".$_COOKIE['UserId']."'");
  		
		$query=$db->query("delete from war_task where `u_id`='".$_COOKIE['UserId']."' and `c_id`='".$CityId."' and `w_id`='".$_GET['w_id']."'");
	
	}
    
	update_resource();
	if($query) echomsg("","?");
}


?>


<!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:280px; border:2px solid #fff; line-height:16px; background-color:#E7CB94; color:#000000; text-align: left;  text-decoration:none; margin-top:-50px;margin-left:-350px;}

.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>

<!--导航-->
<?php require_once("army_daohang.htm");?>

<div id="mb_01">
	<div class="page_build_title"><a href="armament_action_infomation.php" target="_self"><span style="color:RED;">查看攻击信息</span></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="armament_action.php" target="_self">开始军事行动</a></div>
</div>
<div id="mb_04">

<!--替换区域开始-->
<div id="arm">

	<table width="98%" border=1 cellpadding=1 cellspacing=0 style="margin-top:20px; border-collapse:collapse;border:1px solid threeddarkshadow" bordercolor="threeddarkshadow" align="center">
		<?php if($current_task_list<>"") { ?>
	    <tr align="center" bgcolor="darkslategray" height="20">
		<td colspan="8" class="HEADERSM" ><span style="color:#ffffff; font-weight:bold;">当前正在执行的军事任务</span></td>
		</tr>
		<?php }else { ?>
		<tr align="center" bgcolor="darkslategray" height="20">
		<td colspan="8" class="HEADERSM" ><span style="color:#ffffff; font-weight:bold;">您的军队目前还没有行动任务,<a href="armament_action.php" target="_self" style="color:WHITE;">开始行动</a></span></td>
		</tr>
		<?php } ?>
	   <tr align="center" style="font-weight:bold;" height="25">
		<td nowrap class="HEADERSM">防 御 方</td>
		<td nowrap class="HEADERSM">对方君主(地区)</td>
		<td class="HEADERSM">任务类型</td>
		<td class="HEADERSM">带兵武将</td>
		<td class="HEADERSM">军队状态</td>
		<td class="HEADERSM">到达时间</td>
		<td class="HEADERSM">操  作</td>
		</tr>
		<?php if($current_task_list<>"") foreach ($current_task_list as $i=>$m){ 
			$complate_time[$i]=$m['w_end_time'];
			$remain_hours[$i]=(floor(($complate_time[$i]-time())/3600)<1) ? 0 : floor(($complate_time[$i]-time())/3600);
			$remain_minutes[$i]=(floor(($complate_time[$i]-time()-($remain_hours[$i]*3600))/60)<1) ? 0 : floor(($complate_time[$i]-time()-($remain_hours[$i]*3600))/60);
		    $remain_seconds[$i]=($complate_time[$i]-time()) - (($remain_hours[$i]*3600)  + ($remain_minutes[$i]*60));
		    $m['id'] = $m['w_id'];
		    //武将信息
		    $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_gid`='".$m['w_gen']."'");
		    $gen_result=$db->fetch_array($hero_query);
		    //城池信息
		    if($m['w_type']<>"2") $area = explode(":",$m['w_to']);
		    else {
		    	$area1 = explode("|",$m['w_to']);
		    	$area = explode(":",$area1[1]);
		    	$m['w_to'] = $area1[1];
		    }
		    $query=$db->query("select c_name,u_id from city where `c_area`='".$area[0]."' and `c_area_x`='".$area[1]."' and `c_area_y`='".$area[2]."'");
		    $city_info=$db->fetch_array($query);
		    $query=$db->query("select p_nickname,p_country from player_info where `u_id`='".$city_info['u_id']."' ");
		    $player_info=$db->fetch_array($query);
		?>
		<script language="javascript">
		var hour<?php echo $m['id'];?>,min<?php echo $m['id'];?>,sec<?php echo $m['id'];?>;
		hour<?php echo $m['id'];?>=<?php echo $remain_hours[$i];?>;
		min<?php echo $m['id'];?>=<?php echo $remain_minutes[$i];?>;
		sec<?php echo $m['id'];?>=<?php echo $remain_seconds[$i];?>;
		function tick<?php echo $m['id'];?>() {
		sec<?php echo $m['id'];?>-=1;
		if (sec<?php echo $m['id'];?>==-1){
		min<?php echo $m['id'];?>-=1;
		sec<?php echo $m['id'];?>=59;
		}
		if (min<?php echo $m['id'];?>==-1){
		if (hour<?php echo $m['id'];?>!=0){
		hour<?php echo $m['id'];?>-=1;
		min<?php echo $m['id'];?>=59;
		}
		}
		if (sec<?php echo $m['id'];?><=0 && min<?php echo $m['id'];?><=0 && hour<?php echo $m['id'];?><=0){
		Clock<?php echo $m['id'];?>.innerHTML ="<a href=?>完成</a>";
		Clock_complate<?php echo $m['id'];?>.innerHTML ="完成";
		self.window.location='?';
		}else{
		Clock<?php echo $m['id'];?>.innerHTML =hour<?php echo $m['id'];?>+"小时"+min<?php echo $m['id'];?>+"分"+sec<?php echo $m['id'];?>+"秒";
		window.setTimeout("tick<?php echo $m['id'];?>();", 1000);
		}
		}
		window.setTimeout("tick<?php echo $m['id'];?>();", tick<?php echo $m['id'];?>);
		</script>
		
		<tr align="center" height="20">
		<td><?php echo $city_info['c_name']."(".$m['w_to'].")";?></td>
		<td>
		<?php if($player_info['p_nickname']<>"") echo $player_info['p_nickname']."(".$country_num[$player_info['p_country']].")"; else echo "无";?>
		</td>
		<td><?php echo $war_type[$m['w_type']];?></td>
		<td>
		<?php if($m['w_gen_name']<>"") { ?>
		<a href="#none" class="info"><?php echo $m['w_gen_name'];?>
		<span>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
          <td bgcolor="#FFFFCC"> 
          <table width="100%" border="0" cellspacing="1" cellpadding="2">
              <tr bgcolor="#FF6600"> 
                        <td colspan="2"> 
                          <table width="100%" border="0" cellspacing="0" cellpadding="2">
                            <tr> 
                              <td class=white colspan="2" align="center">军队信息</td>
                            </tr>
                          </table></td>
                      </tr>
                      <tr> 
                        <td colspan="2"> 
                          <div align="center"> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr> 
                                <td width="50%"><div align="center"> 
                                    
                                    <table width="100%" border="0" cellspacing="1" cellpadding="2">
                                      <tr> 
                                        <td width="50%">
                                        <div align="center"><img src="img/gen_header/<?php echo $m['w_gen'];?>.JPG" width="60" height="60" align="absmiddle"></div>
                                       </td>
                                      </tr>
                                    </table>
                                 </td>
                                <td> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -