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

📄 system_task.php

📁 Download you own three BR
💻 PHP
字号:
<?php
require_once("configs/Configs.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 p_nickname,p_grade from player_info where `u_id`='".$_COOKIE['UserId']."' ");
	$nickname = $db->fetch_array($query);
	//用户等级查询;
	$user_grade=$nickname['p_grade'];
//	echo $user_grade;
	$db->query("update e_mail set `notice`='1' where `e_username`='".$nickname['p_nickname']."'");
	
include_once("system_task_processing.php");//加载任务处理过程	

if($_GET['from']=="welcome"){
	$db->query("update `player_info` set `status`='1' where `u_id`='".$_COOKIE['UserId']."'");
}
?>
<!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>
<script language="javascript">

   function gourl(str){
       location=str
}
</script>
</head>

<body>

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


<!--替换区域开始-->

<div id="all">
<a name="#task"></a>
   <div id="left"><!-- 左边开始 -->
       <div id="left_top">
	   <div class="zore"><strong><a href="?action=untask" onfocus="blur()">
	   <?php 
	   if ($_GET['action']=='untask') {
	   	  echo '<span style="color:#CE4118">未完成</span>';
	   }else {
	   	  echo '未完成';
	   }
	   ?>
	   </a></strong></div>
	   <div class="zore"><strong><a href="?action=task" onfocus="blur()">
	   <?php 
	   if ($_GET['action']=='task') {
	   	  echo '<span style="color:#CE4118">已完成</span>';
	   }else {
	   	  echo '已完成';
	   }
	   ?>
	   </a></strong></div>
	   </div>	   
	   <div class="left_con" >
	      <ul>
	      
	      <?php
	      //////////////////////////////////////////显示任务标题//////////////////////////////////////////////////////////////
	      //未完成的任务;
	      if ($_GET['action']=='untask') {
	      	  //任务基础表数据;
	      	  $query2=$db->query("select * from m_system_task where user_grade<='".$user_grade."' order by id asc"); 
	      	  $task_sum=$db->num_rows($query2);//计算任务总数量;	
	      	  //己完成任务表数据;
	      	  $query=$db->query("select m_task_id from task_end where u_id='".$_COOKIE['UserId']."' and p_in='0';");
			  while ($row=$db->fetch_array($query)) $taskend_list[]=$row;	//写入数组;     
		      $i=1;		      
//			  //输出所有任务;				 
		      while ($task_list=$db->fetch_array($query2)) {
		      	$to=0;      	    
//	      	    
	      	    if ($taskend_list) {
	      	    	//引用己完成数组;
	      	    	foreach ($taskend_list as $b=>$m)
		      		{
			      		if ($task_list['id']==$m['m_task_id']) {
			      			$to=1;
			      			break;
			      		}
		      		}
	      	    }
//		      	
////		      	echo $task_list['id'].'-';
////		      	echo $taskend_list['m_task_id'].'|';
////		      	echo $task_list['id'].'-'.$to.'|';
		      	if ($to==1) {
		      		continue;
		      	}
		      	echo '<li><a href="?id='.$task_list['id'].'&action=untask"';
		      	if ($_GET['id']>0 && $task_list['id']==$_GET['id']) {
		      		echo ' style="color:#CE4118;margin-left:60px;font-weight:bold" ';
		      	}else {
		      	    echo ' class="c" style="margin-left:60px;"';
		      	}
		      	echo 'onfocus="blur()">'.$i.'.'.$task_list['task_name'].'</a></li>';
		      	$i++;
		      	$task_sum=$i;
		      }
	      }elseif ($_GET['action']=='task'){
	      	  //己完成的任务;
	      	  //计算任务总数量;
		      $query=$db->query("select a.* from m_system_task a left join task_end b on (a.id=b.m_task_id) where b.u_id='".$_COOKIE['UserId']."' and p_in='0' order by a.id asc");
		      $task_sum=$db->num_rows($query);	      
		      //输出所有任务;
		      $i=1;
		      while ($task_list=$db->fetch_array($query)) {
		      	echo '<li><a href="?id='.$task_list['id'].'&action=task"';
		      	if ($_GET['id']>0 && $task_list['id']==$_GET['id']) {
		      		echo ' style="color:#CE4118;margin-left:60px;font-weight:bold" ';
		      	}else {
		      	    echo ' class="c" style="margin-left:60px;"';
		      	}
		      	echo 'onfocus="blur()">'.$i.'.'.$task_list['task_name'].'</a></li>';
		      	$i++;
		      }		  
	      }
	      if ($task_sum<12) {
		  	for (;$task_sum<12;$task_sum++)
		  	echo '<li></li>';
		  }
	      
	      ?>		    
		  </ul>
	   </div>
	   <div id="left_bottom"></div>
   <!-- 左边结束 --></div>

   <div id="right"><!-- 右边开始 -->
       <div id="right_top">系统任务</div>
       
       <?php
       /////////////////////////////////////////////没有点任务列表时//////////////////////////////////////////////////////////
       if (!$_GET['id']>0) {
       	   echo "<div id=\"right_top2\"  class=\"sited\"></div><div id=\"right_con\"><ul class=\"rw_00\">
	<li style=\"height:285px;line-height:26px;color:#423029;text-align:left;text-indent:25px;\">欢迎您来到<span style=\"color:#ce4118\">《".$webgamesitename."》</span>。《".$webgamesitename."》是一款以三国时期为背景网页战略游戏,作为一方诸侯的您,发挥您的智慧与谋略,在战火连天的三国时期,成就一番霸业。
     <br/>&nbsp;&nbsp;&nbsp;&nbsp;首先,您必须先了解《".$webgamesitename."》的<span style=\"color:#ce4118\">基本操作</span>。为此,我们将为您设置一系列的任务,来让您一步一步充分的了解《".$webgamesitename."》的各项操作。完成任务后,您也将获得<span style=\"color:#10560b\">丰厚的任务奖励</span>,对您的初期发展有个不小的帮助。祝您游戏愉快!</li></ul></div>
	   <div id=\"right_bottom\"></div>";
       }else {
       /////////////////////////////////////////////显示任务详细信息///////////////////////////////////////////////////////////
       $query=$db->query("select * from m_system_task where id='".$_GET['id']."';");
       $task_list=$db->fetch_array($query);
       ?>
	   <div id="right_top2"  class="sited"><?php echo $task_list['task_name'];?></div>
	   <div id="right_con">
	      <ul class="rw_00">	        
		    <li class="rw_01">任务内容:</li>
		    <li class="rw_02"><?php echo $task_list['task_con'];?></li>
		    <li class="rw_03">任务需求:</li>
		    <li class="rw_05">您的等级必须达到<?php echo $task_list['user_grade'];?>级</li>
			<li class="rw_03">完成条件:</li>
			<li class="rw_04"><?php echo $task_list['task_result'];?></li>			
			<li class="rw_03">任务奖励</li>
			<li class="rw_05"><?php echo $task_list['task_ech'];?></li>
			<li class="rw_06">
			<?php			
			if ($_GET['action']=='untask') {
				$query_up=$db->query("select id from task_end where m_task_id='".$task_list['id']."' and p_in=1 and u_id='".$_COOKIE['UserId']."';");
				$num_ls=$db->num_rows($query_up);
				if ($num_ls) {
					echo '<a onclick="gourl(\'?act=task_end&id='.$task_list['id'].'\')" style="cursor:hand"">提交任务</a>';
				}else {
					echo '<a onclick="gourl(\'?action=task_up&id='.$task_list['id'].'\')" style="cursor:hand"">接受任务</a>';
				}
			}else {
				echo '己完成';
			}
			?>
			</li>
		  </ul>
     </div>
	   <div id="right_bottom"></div>
	   <?php
       }
	   ?>
   <!-- 右边结束 --></div>
   
</div>
  <div  style="text-align:left;color:#ff3300;line-heigh:26px;padding-top:10px;">注:任务完成后,需在当前任务页提交任务才能拿到奖励。另外,所有任务不是必须完成的。</div>
<!--替换区域结束-->


</div>
</body>
</html>
<?php 
if($_GET['from']=="notice"){
	  echo "<script>";
   	  echo "parent.function_area.refresh_area_page();";
   	  echo "</script>";
}
$db->close();
?>

⌨️ 快捷键说明

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