📄 union.php
字号:
<?php
include("functions/login_flag.php");//是否已经登录
include("functions/class_mysql.php");//加载数据库类文件
include("configs/Configs.php");
include("union_mod.php");//加载程式过程;
include("union_mod_friend_message_demise.php");//加载程式过程;
include_once("all_processing.php");//加载所有进程;
////////////////////////
//翻页
////////////////////////
if( isset($_GET['page_safe_mygoods']) ){
$page_safe_mygoods = intval($_GET['page_safe_mygoods']);
}else{
$page_safe_mygoods = 1;
}
$page_size_safe_mygoods = 10;
$query_num=$db->query("select * from unions order by uintegral desc ;");
$all_num=$db->num_rows($query_num);
$amount_safe_mygoods=$all_num;
if( $amount_safe_mygoods ){
if( $amount_safe_mygoods < $page_size_safe_mygoods ){
$page_count_safe_mygoods = 1;
}
if( $amount_safe_mygoods % $page_size_safe_mygoods ){
$page_count_safe_mygoods = (int)($amount_safe_mygoods/$page_size_safe_mygoods) + 1;
}else{
$page_count_safe_mygoods = $amount_safe_mygoods/$page_size_safe_mygoods;
}
}else{
$page_count_safe_mygoods = 0;
}
?>
<!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 href="css/lm.css" rel="stylesheet" type="text/css">
<style>
body{
margin-top:0px;
}
</style>
<script type="text/javascript">
<!-- // 说明:Javascript 控制 CheckBox 的全选与取消全选 // -->
function checkAll(name)
{
var el = document.getElementsByTagName('input');
var len = el.length;
for(var i=0; i<len; i++)
{
if((el[i].type=="checkbox") && (el[i].name==name))
{
el[i].checked = true;
}
}
}
function clearAll(name)
{
var el = document.getElementsByTagName('input');
var len = el.length;
for(var i=0; i<len; i++)
{
if((el[i].type=="checkbox") && (el[i].name==name))
{
el[i].checked = false;
}
}
}
function isdemise()
{
if(window.confirm("请确认您是否要进行此操作!如不想进行,请点取消."))
{
return true;
}
return false;
}
function isdemisee()
{
if(window.confirm("是否要退出联盟!如不想退出,请点取消."))
{
return true;
}
return false;
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
<?php
//1:魏-country1,2:蜀-country2,3:吴-country3
$dir = "images/country".$_COOKIE['Country']."/";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
$counter = 0;
$counter2 = 0;
$ig=1;
while (($file = readdir($dh)) !== false) {
$f=explode(".",$file);
if ($f['1']=="gif") {
// echo "filename: $file ; filetype: " . filetype($dir . $file) ;
// echo '<br/>';
$query_im=$db->query("select id from union_img where name='".$f[0]."' and country='".$_COOKIE['Country']."';");
$num_im=$db->num_rows($query_im);
if (!$num_im){
$img_name[$ig]=$f[0];
$counter++;
$ig++;
}
$counter2++;
}
}
closedir($dh);
}
}
asort($img_name);
// echo $counter;
?>
var CivilPic = new Array(<?php echo $counter2;?>);
for(var i=1; i<=<?php echo $counter2;?>; i++)
{
CivilPic[i] = new Image();
CivilPic[i].src = "images/country<?php echo $_COOKIE['Country'];?>/" + i + ".gif";
}
function changeCivilizationPic(obj)
{
document.getElementById("imgCivil").src = CivilPic[obj.options[obj.selectedIndex].value].src;
document.getElementById("spanCivilHint").innerHTML = CivilHint[obj.options[obj.selectedIndex].value];
}
</script>
</head>
<body>
<!--导航-->
<?php require_once("diplomatism_daohang.htm");?>
<div id="mb_01">
<form id="form1" name="form1" method="POST" action="union_sou.php?action=sou">
<input type="hidden" name="select" value="select"/>
<table width="92%" height="30" border="0" cellpadding="0" cellspacing="0" style="margin-top:6px;font-size:12px; ">
<tr>
<td width="9%">联盟查询</td>
<td width="14%"><span class="wx_03">
<input type="text" name="sou" size="10" maxlength="10" value="" />
</span></td>
<td width="12%" align="left"><input type="image" src="images/wx_01.gif" width="46" height="18" border="0" /></td>
<?php
///////////////////查询是否己建立联盟////////////////////////////////
$query=$db->query("select * from player_info where u_id='".$_COOKIE['UserId']."';");
$uni_num=$db->fetch_array($query);
if ($uni_num['union_id']<'1') {
?>
<td width="13%"><div class="lm_02"><a href="?action=crea" class="lm_03">创建联盟</a></div></td>
<td width="13%"> </td>
<td width="13%"> </td>
<td width="14%"> </td>
<td width="12%"> </td>
<?php
} else {
?>
<td width="13%"><div class="lm_02"><a href="?action=myunion" class="lm_03">我的联盟</a></div></td>
<td width="13%"><div class="lm_02"><a href="?action=unionapply&id=<?php echo $uni_num['union_id'];?>" class="lm_03">新申请者</a></div></td>
<td width="13%"><div class="lm_02"><a href="?action=unionper&id=<?php echo $uni_num['union_id'];?>" class="lm_03">成员管理</a></div></td>
<td width="14%"><div class="lm_02"><a href="?action=myunionsetting&id=<?php echo $uni_num['union_id'];?>" class="lm_03">联盟设置</a></div></td>
<td width="12%"><div class="lm_02"><?php if ($uni_num['union_power']=='1') echo '<a href="?act=disband&id='.$uni_num['union_id'].'" class="lm_03" onclick="return isdemise()">解散联盟</a>'; else echo '<a href="?action=cancer_unions&id='.$uni_num['union_id'].'" class="lm_03" onclick="return isdemisee()">退出联盟</a>'?></div></td>
<?php
}
?>
</tr>
</table>
</form>
</div>
<div id="mb_04">
<!--替换区域开始-->
<?php
////创建联盟///////////////////////////////////////////////////////
if ($_GET['action']=='crea') {
///////////////////查询是否己建立联盟////////////////////////////////
$query=$db->query("select union_id from player_info where u_id='".$_COOKIE['UserId']."';");
$uni_num=$db->fetch_array($query);
if ($uni_num['union_id']>'1') {
echomsg("您己有联盟或己加入联盟!","union.php");
}
?>
<form id="form2" name="form2" method="POST">
<input type="hidden" name="act" value="insert"/>
<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"><input type="text" name="uname" maxlength="8"/></td>
<td width="86" align="left">联盟旗帜:</td>
<td width="69" align="left"><select name="u_ico" id="listCiv" onchange="changeCivilizationPic(this)">
<option value="0">--</option>
<?php
$na_i=1;
foreach ($img_name as $j){
echo '<option value="'.$j.'">'.$na_i.'</option>';
$na_i++;
}
?>
</select></td>
<td width="138" align="left"><img id="imgCivil" src="images/<?php echo $_COOKIE['Country'];?>.gif" width="27" height="20"></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="15%" height="26" align="left">联盟简介:</td>
<td width="85%" align="left"><textarea name="uintro" style="width:380px;height:70px;"></textarea></td>
</tr>
</table>
<div class="lmf">------------------------------------------------------------------------------</div>
<table width="20%" border="0" cellspacing="0" cellpadding="0" style="font-size:12px;">
<tr>
<td width="11%" height="40" valign="bottom"><input type="image" src="images/lm/lm_14.gif" width="63" height="18" border="0" /></td>
</tr>
</table>
</form>
<?php
}elseif ($_GET['action']=='listunion') {
///显示单个联盟信息///////////////////////////////////////////////////////////////
$query=$db->query("select * from unions where id='".$_GET['id']."';");
$list=$db->fetch_array($query);
//查询联盟称位;
$query=$db->query("select * from unions_name where union_id='".$_GET['id']."';");
while ($list_unions_name=$db->fetch_array($query)) $unions_name[]=$list_unions_name;
//查询联盟内部称位;
$query=$db->query("select * from unions_name where union_id='".$_GET['id']."';");
while ($list2=$db->fetch_array($query)) $unions_name_list[]=$list2;
?>
<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;font-size:12px; ">
<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'].' ';
}
}
}
?></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'].' ';
}
}
}
?></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;font-size:12px; ">
<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 ' ';
}
?></td>
</tr>
<tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -