<?php include("sql/conn.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
	 $result = mysql_query("SELECT * FROM paty where amd ='".$_SESSION['name']."'");
	 if (mysql_num_rows($result) != 0)//检查库里是否有这个用户名
	 {
     echo "<script>alert('每个ID只能登记一个公会，您已经成功登记公会，现在为您转入公会管理界面！');</script>";
	 echo "<meta http-equiv=refresh content=0;url=paty2.php >";
	 exit;
	 }
?>


<?php
if ($_GET['cj']=='cj')
{
      $result = mysql_query("SELECT * FROM paty where amd ='".$_SESSION['name']."'");
      if (mysql_num_rows($result) != 0)//检查库里是否有这个用户名
      {
      echo "<script>alert('这个公会名称被占用了！');</script>";
	  echo "<meta http-equiv=refresh content=0;url=paty1.php >";
      }
      else
      {
$result=mysql_query("INSERT INTO paty (name, amd, lasttime) VALUES ('".$_POST['name']."', '".$_SESSION['name']."','".time()."')");
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."', '建[".$_POST['name']."]', '-".$_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="wznr">
<div id="waiwai">


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




<style>
td{font-size:9pt;word-break: break-all}
.corner{font-size:0;}
.corner_bo{background:blue}
.corner_bg{background:#6699ff}
#tit{height:22px;color:white;}
#txt{line-height:150%;background:white;border:1px solid blue}
#tl,#tr,#bl,#br,#corner_tl,#corner_tr,#corner_bl,#corner_br{width:3px;height:3px}
#t,#b,#corner_t,#corner_b{height:3px}
#l,#r,#corner_l,#corner_r{width:3px}
</style>
<script src=corner.js></script>
<table cellpadding=0 cellspacing=0 width=400 align=center>
<tr><td id=tl></td><td id=t></td><td id=tr></td></tr>
<tr><td id=l></td>
<td id=box>
<table cellpadding=3 cellspacing=0 width=100%>
<tr id=tit><td>
<b>TTPK.NET免费发布 祝愿您的公会日渐壮大！</b>
</td></tr>
<tr><td height=200 id=txt>





<p align="center">
<form action="paty1.php?cj=cj" method="post">
公会名称: <input type="text" name="name" />
<input type="submit"  <?php
if ($_SESSION['jf'] < $_SESSION['hf'])
{
echo "disabled"; 
}
 ?>  value="提交<?php echo $_SESSION['jf']; ?>" />
</form>
</p>

<?php
  echo "<p>注意：创建公会内容需要消耗".$_SESSION['hf']."积分！</p>";
?>


</td></tr></table>
</td>
<td id=r></td>
</tr>
<tr><td id=bl></td><td id=b></td><td id=br></td></tr>
</table>
<script>
function setcorner(id)
{
var html;
if(id=="t")
{
html="<table class=corner id=corner_t cellpadding=0 cellspacing=0>"
html+="<tr><td class=corner_bo></td></tr><tr><td class=corner_bg></td></tr><tr><td class=corner_bg></td></tr>"
html+="</table>"
}
if(id=="b")
{
html="<table class=corner id=corner_b cellpadding=0 cellspacing=0>"
html+="<tr><td class=corner_bg></td></tr><tr><td class=corner_bg></td></tr><tr><td class=corner_bo></td></tr>"
html+="</table>"
}
if(id=="l")
{
html="<table class=corner id=corner_l cellpadding=0 cellspacing=0>"
html+="<tr><td class=corner_bo></td><td class=corner_bg></td><td class=corner_bg></td></tr>"
html+="</table>"
}
if(id=="r")
{
html="<table class=corner id=corner_r cellpadding=0 cellspacing=0>"
html+="<tr><td class=corner_bg></td><td class=corner_bg></td><td class=corner_bo></td></tr>"
html+="</table>"
}
if(id=="tl")
{
html="<table class=corner id=corner_tl cellpadding=0 cellspacing=0>"
html+="<tr><td bgcolor=white></td><td bgcolor=white></td><td class=corner_bo></td></tr>"
html+="<tr><td bgcolor=white></td><td class=corner_bo></td><td class=corner_bg></td></tr>"
html+="<tr><td class=corner_bo></td><td class=corner_bg></td><td class=corner_bg></td></tr>"
html+="</table>"
}
if(id=="tr")
{
html="<table class=corner id=corner_tr cellpadding=0 cellspacing=0>"
html+="<tr><td class=corner_bo></td><td bgcolor=white></td><td bgcolor=white></td></tr>"
html+="<tr><td class=corner_bg></td><td class=corner_bo></td><td bgcolor=white></td></tr>"
html+="<tr><td class=corner_bg></td><td class=corner_bg></td><td class=corner_bo></td></tr>"
html+="</table>"
}
if(id=="bl")
{
html="<table class=corner id=corner_bl cellpadding=0 cellspacing=0>"
html+="<tr><td class=corner_bo></td><td class=corner_bg></td><td class=corner_bg><td class=corner_bg></tr>"
html+="<tr><td bgcolor=white></td><td class=corner_bo></td><td class=corner_bg></td></tr>"
html+="<tr><td bgcolor=white></td><td bgcolor=white></td><td class=corner_bo></td></tr>"
html+="</table>"
}
if(id=="br")
{
html="<table class=corner id=corner_br cellpadding=0 cellspacing=0>"
html+="<tr><td class=corner_bg></td><td class=corner_bg></td><td class=corner_bo></td></tr>"
html+="<tr><td class=corner_bg></td><td class=corner_bo></td><td bgcolor=white></td></tr>"
html+="<tr><td class=corner_bo></td><td bgcolor=white></td><td bgcolor=white></td></tr>"
html+="</table>"
}
eval(id+".innerHTML=html")
}
function corner(border,bgcolor)
{
setcorner("tl")
setcorner("tr")
setcorner("bl")
setcorner("br")
setcorner("t")
setcorner("b")
setcorner("l")
setcorner("r")
corner_t.style.width=box.offsetWidth
corner_b.style.width=box.offsetWidth
corner_l.style.height=box.offsetHeight
corner_r.style.height=box.offsetHeight
box.style.background=bgcolor
}
corner("blue","#6699ff");
</script>
<br />
<p align="left">注意，一个ID只能注册一个公会，公会名称不得重复, 不可修改！
注册之后，请及时充实公会资料以加强公会吸引力！。</p><br />
<br /><br />







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


<?php include("sql/close.php"); ?>
