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

📄 union.php

📁 Download you own three BR
💻 PHP
📖 第 1 页 / 共 3 页
字号:
					       <td height="24" align="left">&nbsp;</td>
					       <td align="left" style="line-height:20px;"><?php 
					       //根据联盟号和权限找到对应的用户;
        			$query_lis=$db->query("select * from player_info where union_id='".$list['id']."' and union_genreic='".$un['id']."' and union_power<>'3';");
        			while ($lishi=$db->fetch_array($query_lis))
        			{
	        			echo $lishi['p_nickname'];
	        			if ($lishi['union_power']=='4') {
	        				echo '(精英)';
	        			}
			   			echo '&nbsp;';
        			}
					       ?></td>
					     </tr>
					  </table>
		   			<?php
		   			if ($i<>$num_ls) echo '<div class="lmf">------------------------------------------------------------------------------</div>';
		   		}
		   		$i++;
		   	}
		   }
		  ?>  
   <table width="80%" border="0" cellspacing="0" cellpadding="0" style="font-size:12px;">
     <?php
		  if ($list['ustate']=='1') {		  	
		  ?>
		  <tr>
		    <td height="25" colspan="2" bgcolor="#EBEBEB" align="left" valign="middle">&nbsp;&nbsp;<span style="color:red">申请加入联盟</span></td>
		  </tr>
		  <form id="applyform" name="applyform" method="POST">
		  <input type="hidden" name="id" value="<?php echo $_GET['id'];?>"/>
		  <input type="hidden" name="act" value="apply"/>
		  <tr>
		    <td height="25" bgcolor="#EBEBEB" align="left" valign="middle">&nbsp;&nbsp;选择队伍:</td>
		    <td height="25" bgcolor="#EBEBEB" align="left" valign="middle">&nbsp;&nbsp;<select name="union_genreic_id" style="margin-top:3px;">
            <?php
            if (!empty($unions_name_list)) {
            	foreach ($unions_name_list as $ul)
            	{
            		if ($ul['purview']>2) {
            			echo '<option value="'.$ul['id'].'">'.$ul['name'].'</option>';
            		}
            	}
            }
            ?>		    
				 </select></td>
		  </tr>
		  <tr>
		  <tr>
		    <td height="25" bgcolor="#EBEBEB" align="left" valign="middle">&nbsp;&nbsp;申请信息:</td>
		    <td height="25" bgcolor="#EBEBEB" align="left" valign="middle">&nbsp;&nbsp;<textarea name="applytext"  style="width:300px;height:50px;margin:5px 0px"></textarea>&nbsp;&nbsp;最大50个字,100个英文;</td>
		  </tr>
		  <tr>
		    <td height="25" colspan="2" bgcolor="#EBEBEB" align="center" valign="middle"><input type="submit" name="applyup"  value="提交申请" /></td>
		  </tr>
		  </form>
		  <?php		  
		  }
		  ?>
   </table>
	<?php
   }elseif ($_GET['action']=='myunion') {
/////我的联盟///////////////////////////////////////////////////////////////
    //查询玩家表时里联盟ID号;
    $query=$db->query("select * from player_info where u_id = '".$_COOKIE['UserId']."';");
    $myunion_num=$db->fetch_array($query);
    //查询联盟称位;
    $query=$db->query("select * from unions_name where union_id='".$myunion_num['union_id']."';");
    while ($list_unions_name=$db->fetch_array($query)) $unions_name[]=$list_unions_name;    
    //显示我的联盟信息
   	$query=$db->query("select * from unions where id='".$myunion_num['union_id']."';");
   	$qu_num=$db->num_rows($query);
   	if ($qu_num<1) {
   		echomsg("您还没有创建或是加入联盟!","union.ph");
   	}else {
   		$list=$db->fetch_array($query);
   	}
   	?>
   	
   	<table width="80%" height="40" border="0" cellpadding="0" cellspacing="0" style="padding-top:5px;font-size:12px; ">
       <tr>
         <td width="86" height="25" align="left">联盟名称:</td>
         <td width="196" align="left" class="sx"><?php echo $list['uname'];?></td>
         <td width="86" align="left">联盟旗帜:</td>
         <td align="left">           <img alt="" src="images/country<?php echo $list['country'];?>/<?php echo $list['u_ico'];?>.gif" width="30" height="22" /></td>
       </tr>
     </table>
     <div class="lmf">------------------------------------------------------------------------------</div>


  <table width="80%" border="0" cellspacing="0" cellpadding="0" style="padding-top:5px;font-size:12px; ">
  <tr>
    <td width="86" height="20" align="left">联盟积分:</td>
    <td width="206" align="left" class="rw_05"><?php echo $list['uintegral'];?></td>
    <td width="77" align="left"> 联盟人数:</td>
    <td width="206" align="left" class="rw_05"><?php echo $list['umember'].'/'.$list['umaxmember'];?></td>
    </tr>
</table>
  <div class="lmf">------------------------------------------------------------------------------</div>

   <table width="80%" border="0" cellspacing="0" cellpadding="0" style="padding-top:5px ">
     <tr>
       <td width="86" align="left"><?php
        				if (!empty($unions_name)) {
        					foreach ($unions_name as $un)
        					{
        						if ($un['purview']=='1') {
        							echo $un['name'].':';        							
        						}
        					}
        				}
        				?></td>
       <td width="208" align="left"><span class="sx"><?php
        				if (!empty($unions_name)) {
        					foreach ($unions_name as $un)
        					{
        						if ($un['purview']=='1') {        							
        							//根据联盟号和权限找到对应的用户;
        							$query_lis=$db->query("select p_nickname from player_info where union_id='".$list['id']."' and union_genreic='".$un['id']."';");
        							while ($lishi=$db->fetch_array($query_lis))
        							echo $lishi['p_nickname'].'&nbsp;';
        						}
        					}
        				}
        				?></span></td>
       <td width="75" align="left"><?php
        				if (!empty($unions_name)) {
        					foreach ($unions_name as $un)
        					{
        						if ($un['purview']=='2') {
        							echo $un['name'].':';        							
        						}
        					}
        				}
        				?> </td>
       <td width="206" align="left"><span class="sx"><?php
        				if (!empty($unions_name)) {
        					foreach ($unions_name as $un)
        					{
        						if ($un['purview']=='2') {        							
        							//根据联盟号和权限找到对应的用户;
        							$query_lis=$db->query("select p_nickname from player_info where union_id='".$list['id']."' and union_genreic='".$un['id']."';");
        							while ($lishi=$db->fetch_array($query_lis))
        							echo $lishi['p_nickname'].'&nbsp;';
        						}
        					}
        				}
        				?></td>
     </tr>
   </table>
   <div class="lmf">------------------------------------------------------------------------------</div>
   <table width="80%" border="0" cellspacing="0" cellpadding="0" style="padding-top:5px;font-size:12px; ">
     <tr>
       <td width="86" height="24" align="left">联盟简介:</td>
       <td align="left" class="lm_01"><?php echo $list['uintro'];?></td>
     </tr>
   </table>
   <div class="lmf">------------------------------------------------------------------------------</div>
    <?php
		   if (!empty($unions_name)) {
		   	$num_ls=count($unions_name);
		   	$i=1;
		   	foreach ($unions_name as $un)
		   	{
		   		if ($un['purview']>'2') {
		   			?>
		   			<table width="80%" border="0" cellspacing="0" cellpadding="0" style="padding-top:5px ">
					     <tr>
					       <td width="86" height="24" align="left"><?php echo $un['name'];?></td>
					       <td align="left" class="sx"><?php
					       //查询player_info表里权限是3并且属于unions_name的名称;
		   			$t_query=$db->query("select * from player_info where union_id='".$list['id']."' and union_power='3' and union_genreic='".$un['id']."';");
		   			while ($t_list=$db->fetch_array($t_query)) {
		   				echo $t_list['p_nickname'];
		   				if ($t_list['union_power']=='4') {
        				    echo '(精英)';
        			    }
        			    echo '&nbsp;';
		   			}
					       ?></td>
					     </tr>
					     <tr>
					       <td height="24" align="left">&nbsp;</td>
					       <td align="left" style="line-height:20px;"><?php 
					       //根据联盟号和权限找到对应的用户;
        			$query_lis=$db->query("select * from player_info where union_id='".$list['id']."' and union_genreic='".$un['id']."' and union_power<>'3';");
        			while ($lishi=$db->fetch_array($query_lis))
        			{
	        			echo $lishi['p_nickname'];
	        			if ($lishi['union_power']=='4') {
	        				echo '(精英)';
	        			}
			   			echo '&nbsp;';
        			}
					       ?></td>
					     </tr>
					  </table>
		   			<?php
		   			if ($i<>$num_ls) echo '<div class="lmf">------------------------------------------------------------------------------</div>';
		   		}
		   		$i++;
		   	}
		   }
		  ?>  
   <table width="20%" border="0" cellspacing="0" cellpadding="0" style="font-size:12px;">
     <tr>
       <td width="11%" height="40" valign="bottom">&nbsp;</td>
     </tr>
   </table>
  
	<?php
   }elseif ($_GET['action']=='unionapply'){
    /////申请批准///////////////////////////////////////////////////////////////
   	//查询你的权限是否为盟主级别;
   	$power_query=$db->query("select union_power from player_info where union_id='".$_GET['id']."' and u_id='".$_COOKIE['UserId']."';");
   	$power_list=$db->fetch_array($power_query);
   	if ($power_list['union_power']>1) {
   		echomsg("您的级别不够!","?action=myunion");
   	}
   	
    $query=$db->query("select a.*,b.p_nickname from unions_apply a left join player_info b on (a.u_id=b.u_id) where a.union_id='".$_GET['id']."';");   	
   ?>
   <table width="85%" height="40" border="0" cellpadding="0" cellspacing="0" style="padding-top:5px;font-size:12px; ">
       <tr>
         <td width="37" align="left">&nbsp;</td>
         <td width="110" align="left"><strong>姓  名</strong></td>
         <td width="289" align="left"><strong>申请信息</strong><br />         </td>
         <td width="92" align="left"><strong>申请队伍</strong></td>
         <td width="83" align="left"><strong>申请时间</strong></td>
       </tr>
     </table>
     <div class="lmf">------------------------------------------------------------------------------</div>
     <form id="checkapply" name="checkapply" method="POST">
		  <input type="hidden" name="act" value="modapply"/>
		  <input type="hidden" name="id" value="<?php echo $_GET['id'];?>"/>
<?php
		  while ($app_list=$db->fetch_array($query))
		  { 
		  	if ($power_list['union_power']<3) {
		  ?>
     <table width="85%" border="0" cellspacing="0" cellpadding="0" style="padding-top:5px;font-size:12px; ">
       <tr>
         <td width="37" align="left"><input type="checkbox" name="checkbox[]" value="<?php echo $app_list['id']?>" /></td>
         <td width="110" class="sx" align="left"><?php echo $app_list['p_nickname'];?></td>
         <td width="289" align="left"><?php echo $app_list['applytext'];?>
         </td>
         <td width="92" align="left"class="rw_05"><?php $od=$db->query("select name from unions_name where id='".$app_list['genreic']."';");
		    $od_an=$db->fetch_array($od);
		    echo $od_an['name'];?></td>
         <td width="83" align="left"><?php echo date('Y-m-d',$app_list['date']);?></td>
       </tr>
     </table>
     <div class="lmf">------------------------------------------------------------------------------</div>
<?php
		  	} }
		        ?>
  
   <table width="50%" border="0" cellspacing="0" cellpadding="0" style="font-size:12px;">
     <tr>
       <td width="25%" align="left"height="40" valign="bottom"><div align="right"><input type="button" name="all"  value="全选" onclick="checkAll('checkbox[]');" style="width:80px;"/></div></td>
       <td width="25%" align="left"valign="bottom"><div align="right"><input type="button" name="unall"  value="取消全选" onclick="clearAll('checkbox[]');" style="width:80px;"/></div></td>
       <td width="25%" align="left"valign="bottom" align="left"><div align="right"><input type="submit" name="okall"  value="批准" onclick="checkapply.action='union_mod.php';checkapply.okall();" style="width:80px;"/></div></td>
       <td width="25%" align="left" valign="bottom" class="d"><div align="right"><input type="submit" name="delall" value="删除" onclick="checkapply.action='union_mod.php';checkapply.delall();" style="width:80px;"/></div></td>
     </tr>
   </table>
    </form>
   
   <?php
   }elseif ($_GET['action']=='unionper'){
////联盟成员管理///////////////////////////////////////////////////////////////
   	//查询联盟内的权限;
$power_query=$db->query("select * from player_info where union_id='".$_GET['id']."' and u_id='".$_COOKIE['UserId']."';");
$power_list=$db->fetch_array($power_query);
//联盟的名称;
$query=$db->query("select * from unions_name where union_id='".$_GET['id']."' order by purview asc;");
while ($forlist=$db->fetch_array($query)) $per_union_name[]=$forlist;
if( isset($_GET['page']) ){ 
	$page = intval( $_GET['page'] ); 
	} 
	else{ 
	$page = 1; 
	} 
	$page_size = 10; 
	$pquery=$db->query("select * from player_info where union_id ='".$_GET['id']."';");
	$p_num=$db->num_rows($pquery);
	$amount=$p_num;
	if( $amount )
	{ 
		if( $amount < $page_size )
			{ 
				$page_count = 1;		
		    } 
		if( $amount % $page_size )
		    {
		    	$page_count = (int)($amount/$page_size) + 1;
		    }else
		    { 
		    	$page_count = $amount/$page_size;
		    } 
	}else
	{ 
		$page_count = 0; 
	} 
   ?>     
   <table width="85%" height="40" border="0" cellpadding="0" cellspacing="0" style="padding-top:5px;font-size:12px; ">
       <tr>
         <td width="37" align="left">&nbsp;</td>
         <td width="110" align="left"><strong>姓  名</strong></td>
         <td width="145" align="left"><strong>称  号</strong><br />         </td>
         <td align="left"><strong>操  作</strong></td>
       </tr>
     </table>
     <div class="lmf">------------------------------------------------------------------------------</div>
 <form id="un_name_type" name="un_name_type" method="POST">
 <input type="hidden" name="act" value="update_name_type"/>
 <input type="hidden" name="id" value="<?php echo $_GET['id'];?>"/> 
<?php
		  $i=1;
		  //查询联盟称号;
		  $union_name_query=$db->query("select * from unions_name where union_id='".$_GET['id']."' order by purview asc;");
		  while ($union_name_list=$db->fetch_array($union_name_query))
		  {		
//		  	$union_mail_name=$union_name_list['name'];//unions_name表内的联盟名称;
		  	//查询该名称所属下的人;
		  	$nickname_query=$db->query("select * from player_info where union_genreic='".$union_name_list['id']."';");
		  	while ($n=$db->fetch_array($nickname_query))
		  	{  
		  		$un_num[$i]     =$i;                        //联盟人总数记数器;
		  		$union_names[$i]=$union_name_list['name'];  //unions_name表内的联盟名称;
		  		$player_id[$i]  =$n['p_id'];                //player_info表内的索引id;
		  		$player_uid[$i] =$n['u_id'];                //player_info表内的u_id;
		  		$nicknames[$i]  =$n['p_nickname'];          //player_info表内的玩家昵称;
		  		$union_power[$i]=$n['union_power'];         //player_info表内的玩家权限;
		  		$i++;
		  	}
		  }
		  $page_i=($page-1)*10+1;
		  for (;$page_i<=$page*10;$page_i++)
		  {
		  	if ($amount<$page_i) {
		  		break;
		  	}
		  ?> 
  <table width="85%" border="0" cellspacing="0" cellpadding="0" style="padding-top:5px;font-size:12px; ">
  <tr>
    <td width="37" align="left">
    <?php		
		      
		    switch ($power_list['union_power'])
		    {
		    	case 1:	
		    	    //查询联明名称;

⌨️ 快捷键说明

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