<?php
include(dirname(__FILE__)."/require.php");
if($ppurview[9]!=1)
  jump("jump.php?id=25&jump=main.php");
$phpcolor->table="barmaudit";
$phpcolor->field="*";
$phpcolor->where="id = '".$_GET['id']."'";
if(isset($_GET['action']) and isset($_GET['id']) and $_GET['action'] == "yes")
{
  $barmaudit = $phpcolor->exist(1);
  $phpcolor->delete();
  $phpcolor->table="bar";
  $phpcolor->field="introduction='".$barmaudit['introduction']."',usernc='".$barmaudit['usernc']."',baruserp='".$barmaudit['baruserp']."',apply='".$barmaudit['apply']."',rankfw='".$barmaudit['rankfw']."',rankzt='".$barmaudit['rankzt']."',rankhf='".$barmaudit['rankhf']."',visitor='".$barmaudit['visitor']."',verify='".$barmaudit['verify']."',style='".$barmaudit['style']."'";
  $phpcolor->where="id = '".$barmaudit['bid']."'";
  $phpcolor->upgrade();
  jump("jump.php?id=24&jump=barmaudit.php");
}
if(isset($_GET['action']) and isset($_GET['id']) and $_GET['action'] == "no")
{
  $phpcolor->delete();
  jump("jump.php?id=24&jump=barmaudit.php");
}
if(isset($_GET['action']) and $_GET['action'] == "show")
{
  $phpcolor->where="id = '".$_GET['id']."'";
  $barmaudit = $phpcolor->exist(1);
  $phpcolor->table="bar";
  $phpcolor->field="barname,usernc,introduction,verify,rankfw,rankzt,rankhf,apply,style";
  $phpcolor->where="id = '".$barmaudit['bid']."'";
  $rs=$phpcolor->exist(1);
  if($rs['verify']=="9")
    $rs['verify']="默认";
  elseif($rs['verify']=="2")
    $rs['verify']="全部开启";
  elseif($rs['verify']=="1")
    $rs['verify']="游客开启";
  elseif($rs['verify']=="3")
    $rs['verify']="非会员开启";
  else
    $rs['verify']="不开启";
  if($rs['rankfw']=="0")
    $rs['rankfw']="允许所有人访问";
  elseif($rs['rankfw']=="1")
    $rs['rankfw']="允许注册会员访问";
  elseif($rs['rankfw']=="2")
    $rs['rankfw']="允许本吧会员访问";
  else
    $rs['rankfw']="允许管理团队访问";
  if($rs['rankzt']=="0")
    $rs['rankzt']="允许所有人发布";
  elseif($rs['rankzt']=="1")
    $rs['rankzt']="允许注册会员发布";
  elseif($rs['rankzt']=="2")
    $rs['rankzt']="允许本吧会员发布";
  else
    $rs['rankzt']="允许管理团队发布";
  if($rs['rankhf']=="0")
    $rs['rankhf']="允许所有人发布";
  elseif($rs['rankhf']=="1")
    $rs['rankhf']="允许注册会员发布";
  elseif($rs['rankhf']=="2")
    $rs['rankhf']="允许本吧会员发布";
  else
    $rs['rankhf']="允许管理团队发布";
  if($rs['apply']=="0")
    $rs['apply']="不需要";
  else
    $rs['apply']="需要";
  if($barmaudit['verify']=="9")
    $barmaudit['verify']="默认";
  elseif($barmaudit['verify']=="2")
    $barmaudit['verify']="全部开启";
  elseif($barmaudit['verify']=="1")
    $barmaudit['verify']="游客开启";
  elseif($barmaudit['verify']=="3")
    $barmaudit['verify']="非会员开启";
  else
    $barmaudit['verify']="不开启";
  if($barmaudit['rankfw']=="0")
    $barmaudit['rankfw']="允许所有人访问";
  elseif($barmaudit['rankfw']=="1")
    $barmaudit['rankfw']="允许注册会员访问";
  elseif($barmaudit['rankfw']=="2")
    $barmaudit['rankfw']="允许本吧会员访问";
  else
    $barmaudit['rankfw']="允许管理团队访问";
  if($barmaudit['rankzt']=="0")
    $barmaudit['rankzt']="允许所有人发布";
  elseif($barmaudit['rankzt']=="1")
    $barmaudit['rankzt']="允许注册会员发布";
  elseif($barmaudit['rankzt']=="2")
    $barmaudit['rankzt']="允许本吧会员发布";
  else
    $barmaudit['rankzt']="允许管理团队发布";
  if($barmaudit['rankhf']=="0")
    $barmaudit['rankhf']="允许所有人发布";
  elseif($barmaudit['rankhf']=="1")
    $barmaudit['rankhf']="允许注册会员发布";
  elseif($barmaudit['rankhf']=="2")
    $barmaudit['rankhf']="允许本吧会员发布";
  else
    $barmaudit['rankhf']="允许管理团队发布";
  if($barmaudit['apply']=="0")
    $barmaudit['apply']="不需要";
  else
    $barmaudit['apply']="需要";
  $tpl -> assign("barmaudit", $barmaudit);
  $tpl -> assign("rs", $rs);
  $tpl -> display("barmaudit_show.htm");
}
else
{
  if(!isset($_GET['page']))
    $_GET['page']=0;
  $phpcolor->where="1=1";
  $count = $phpcolor->exist(2);
  $phpcolor->where="1=1 limit ".($_GET['page']*20).",20";
  $barmaudit=$phpcolor->assignment();
  $phpcolor->table="bar";
  for($count=0;$count<count($barmaudit);$count++)
  {
    $phpcolor->field="barname";
    $phpcolor->where="id = '".$barmaudit[$count]['bid']."'";
	$rs=$phpcolor->exist(1);
    $barmaudit[$count]['barname']=$rs['barname'];
	if($barmaudit[$count]['rankfw']=="0")
	  $barmaudit[$count]['rankfw']="允许所有人访问";
	elseif($barmaudit[$count]['rankfw']=="1")
	  $barmaudit[$count]['rankfw']="允许注册会员访问";
	elseif($barmaudit[$count]['rankfw']=="2")
	  $barmaudit[$count]['rankfw']="允许本吧会员访问";
	else
	  $barmaudit[$count]['rankfw']="允许管理团队访问";
	if($barmaudit[$count]['rankzt']=="0")
	  $barmaudit[$count]['rankzt']="允许所有人发布";
	elseif($barmaudit[$count]['rankzt']=="1")
	  $barmaudit[$count]['rankzt']="允许注册会员发布";
	elseif($barmaudit[$count]['rankzt']=="2")
	  $barmaudit[$count]['rankzt']="允许本吧会员发布";
	else
	  $barmaudit[$count]['rankzt']="允许管理团队发布";
	if($barmaudit[$count]['rankhf']=="0")
	  $barmaudit[$count]['rankhf']="允许所有人发布";
	elseif($barmaudit[$count]['rankhf']=="1")
	  $barmaudit[$count]['rankhf']="允许注册会员发布";
	elseif($barmaudit[$count]['rankhf']=="2")
	  $barmaudit[$count]['rankhf']="允许本吧会员发布";
	else
	  $barmaudit[$count]['rankhf']="允许管理团队发布";
  }
  $page=pages($count,20,$_GET['page'],'barmaudit','','','0');
  $tpl -> assign("barmaudit", $barmaudit);
  $tpl -> assign("page", $page);
  $tpl -> display("barmaudit.htm");
}
?>