<?php include("sql/conn.php"); 
session_start(); //开着身份验证，以后写
$noww = time();
$iipp = $_SERVER["REMOTE_ADDR"];
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>公会入驻 <?php include("adm/all/gjz.txt"); ?> </title>
<meta name="description" content="公会入驻 <?php include("adm/all/description.txt"); ?> " />
<meta name="keywords" content="公会入驻 <?php include("adm/all/gjz.txt"); ?> " />
<link  href="css/css<?php include("adm/all/css.txt"); ?>.css" rel="stylesheet" type="text/css">
</head>

<?php
if (empty($_SESSION['name'])){
	echo "<script>alert('您尚未登陆，呵呵！');</script>";
    $_GET['cj'] = "";
	echo "<meta http-equiv=refresh content=0;url=index.php >";
	exit;
}
?>


<?php
if($_GET['xg']=='xg')
{

$result = mysql_query("SELECT * FROM paty WHERE amd='".$_SESSION['name']."' and id='".$_GET['id']."'");
while($row = mysql_fetch_array($result))
  {
$one = strip_tags ($_POST['one']); 
$js = strip_tags ($_POST['js']); 
$amdqq = strip_tags ($_POST['amdqq']); 
$qq = strip_tags ($_POST['qq']); 
$amdyy = strip_tags ($_POST['amdyy']); 
$yy = strip_tags ($_POST['yy']); 
$kh = strip_tags ($_POST['kh']); 
$hd = strip_tags ($_POST['hd']); 
$tjname = strip_tags ($_POST['tjname']); 
$tjurl = strip_tags ($_POST['tjurl']); 
$tjname1 = strip_tags ($_POST['tjname1']); 
$tjurl1 = strip_tags ($_POST['tjurl1']); 

///////////////////////判断域名是否被过滤
	 $urlymz =  parse_url($tjurl);
	 $urlym = $urlymz[host];
	 $result = mysql_query("SELECT * FROM glurl where url ='".$urlym."'");
	 if (mysql_num_rows($result) != 0)//检查库里是否有这个用户名
	 {
	 $tjurl = "域名过滤！";
	 }
///////////////////////判断域名是否被过滤
	 $urlymz =  parse_url($tjurl1);
	 $urlym = $urlymz[host];
	 $result = mysql_query("SELECT * FROM glurl where url ='".$urlym."'");
	 if (mysql_num_rows($result) != 0)//检查库里是否有这个用户名
	 {
	 $tjurl1 = "域名过滤！";
	 }
////////////////////////判断域名是否被过滤
if($_POST['bj']=="")
$_POST['bj']="1";

if($_POST['zr']=="")
$_POST['zr']="1";



$result=mysql_query("UPDATE paty SET
 lasttime = '".time()."',
 one = '".$one."',
 js='".$js."',
 amdqq = '".$amdqq."',
 qq='".$qq."',
 amdyy = '".$amdyy."',
 yy='".$yy."',
 kh = '".$kh."',
 hd='".$hd."',
 tjname = '".$tjname."',
 tjurl='".$tjurl."',
 tjname1 = '".$tjname1."',
 tjurl1='".$tjurl1."',
 bj = '".$_POST['bj']."',
 zr = '".$_POST['zr']."' 
 WHERE id = '".$_GET['id']."'");



if($result) 
{
$_SESSION['jf'] = $_SESSION['jf'] - $_SESSION['hf'];
mysql_query("UPDATE user SET jf = '".$_SESSION['jf']."' WHERE name = '".$_SESSION['name']."'");
mysql_query("INSERT INTO text (name, time, ip, ing, f) 
VALUES ('".$_SESSION['name']."', '".$noww."', '".$iipp."', '[成功]修改工会', '-".$_SESSION['hf']."')");
echo "<meta http-equiv=refresh content=0;url=paty2.php >";
}
else 
{
mysql_query("INSERT INTO text (name, time, ip, ing, f) 
VALUES ('".$_SESSION['name']."', '".$noww."', '".$iipp."', '[出错]修改工会', '0')");
echo "<meta http-equiv=refresh content=0;url=rz.php >";
}	  



  
  }

}
?>


<body >
<div id="top">
<?php include("user.php");  ?>
</div>
<?php include("gh.php");  ?>
<div align="center">

<?php include("logo.php");  ?>

<div id="dh" ><?php 
 if(file_exists("dh1.php"))
 {
include("dh1.php"); 
 }
 else
 {
include("action/dh1.php"); 
 }
?></div>

</div>



<?php 
 if(file_exists("top.php"))
 {
include("top.php"); 
 }
 else
 {
include("action/top.php"); 
 }
?><div class="clear"></div>



<div align="center">
<div id="nr">

<div class="RoundedCorner">
<b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b>



<h2 align="center">★公会管理★</h2>
<p align="right">
◇<a href="paty.php" title="公会列表" >公会列表</a>◇
◇<a href="paty1.php" title="创建公会" >创建公会</a>◇
◇<a href="paty2.php" title="公会管理" >公会管理</a>◇
</p>


<?php

$result = mysql_query("SELECT * FROM paty WHERE amd='".$_SESSION['name']."'");
$num = mysql_num_rows($result);
if ($num==0)
{
echo "<h2>您还没有建立自己的公会，快去招兵买马吧！！</h2>";
}


while($row = mysql_fetch_array($result))
  {
  echo "<table border='0' align='center' ><form action='paty2.php?xg=xg&id=".$row['id']."' method='post'>";
  echo "<tr><td colspan='4'><h2 align='center'>----</h2></td></tr>";
  echo "<tr><td>公 会 名:</td><td><textarea rows='1' disabled >".$row['name']."</textarea></td>";
  echo "<td>管 理 员:</td><td><textarea rows='1' disabled >".$row['amd']."</textarea></td></tr>";
  
  echo "<tr><td>创 始 人:</td><td  colspan='3' ><textarea name='one' rows='1' >".$row['one']."</textarea></td></tr>";
  
  echo "<tr><td>介　　绍:</td><td  colspan='3' ><textarea name='js' rows='5' cols='50' >".$row['js']."</textarea></td></tr>";
  
  echo "<tr><td>管　　理 QQ:</td><td><textarea name='amdqq' rows='1' >".$row['amdqq']."</textarea></td>";
  echo "<td>Q Q   群:</td><td><textarea name='qq' rows='1' >".$row['qq']."</textarea></td></tr>";
  
  echo "<tr><td>管　　理 YY:</td><td><textarea name='amdyy' rows='1' >".$row['amdyy']."</textarea></td>";
  echo "<td>YY 房 间:</td><td><textarea name='yy' rows='1' >".$row['yy']."</textarea></td></tr>";
  
  echo "<tr><td>口　　号:</td><td colspan='3' ><textarea name='kh' rows='2' cols='50' >".$row['kh']."</textarea></td></tr>";
  echo "<tr><td>活　　动:</td><td colspan='3' ><textarea name='hd' rows='2' cols='50' >".$row['hd']."</textarea></td></tr>";
  echo "<tr><td>入驻游戏:</td><td><textarea name='tjname' rows='1' >".$row['tjname']."</textarea></td>";
  echo "<td>游戏网址:</td><td><textarea name='tjurl' rows='1' >".$row['tjurl']."</textarea></td></tr>";
  
  echo "<tr><td>入驻游戏2</td><td><textarea name='tjname1' rows='1' >".$row['tjname1']."</textarea></td>";
  echo "<td>游戏网址2</td><td><textarea name='tjurl1' rows='1'>".$row['tjurl1']."</textarea></td></tr>";


  echo "<tr><td>宣传背景</td><td><select name=bj>
<option value=".$row['bj'].">".$row['bj']."</option>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
</select></td>";
  echo "<td>招人标制</td><td><select name=zr>
<option value=".$row['zr'].">".$row['zr']."</option>
<option value=1>1</option>
<option value=2>2</option>
</select></td></tr>";

  
  echo "<tr><td></td><td colspan='3'> <input type='submit' ";

if ($_SESSION['jf'] < $_SESSION['hf'])
{
echo "disabled"; 
}

  echo " value='修改".$_SESSION['jf']."' /> </td></tr>";
  echo "<tr><td colspan='2'>注意：修改公会内容需要消耗".$_SESSION['hf']."积分！</td>";
  echo "<td colspan='2'>";
  echo "<a  href=http://www.ttpk.net/z.php?n=".$row['name']." target=_blank >公会宣传</a><br>";
  echo "</td></tr>";
  echo "</form></table>";
  }

?>

<br />
<br />


<b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b>
</div>



</div></div>
<div class="clear"></div>


<?php include("ad/ad1.txt"); ?>


<div class="clear"></div>

<div align="center"><div id="nr">


<div class="RoundedCorner">
<b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b>
<div id="nr2">

<?php 
 if(file_exists("12.php"))
 {
include("12.php"); 
 }
 else
 {
include("action/12.php"); 
 }
?>



</div>
<b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b>
</div>


</div></div>


<div class="clear"></div>


<?php 
 if(file_exists("foot.php"))
 {
include("foot.php"); 
 }
 else
 {
include("action/foot.php"); 
 }
?>
</body>


