<?php
include(dirname(__FILE__)."/require.php");
if($ppurview[9]!=1)
{
  Header("Location: jump.php?id=25&jump=main.php");
  exit();
}
$phpcolor->table=$core_mysql_prefix."bar";
$phpcolor->where="id = '".$_GET['id']."'";
if(isset($_GET['action']) and isset($_GET['id']) and $_GET['action'] == "yes")
{
  $phpcolor->field="state='1'";
  $phpcolor->upgrade();
  Header("Location: jump.php?id=24&jump=baraudit.php");
}
elseif(isset($_GET['action']) and isset($_GET['id']) and $_GET['action'] == "no")
{
  $phpcolor->delete();
  Header("Location: jump.php?id=24&jump=baraudit.php");
}
else
{
  if(!isset($_GET['page']))
    $_GET['page']=0;
  $phpcolor->field="*";
  $phpcolor->where="state = '2'";
  $count = $phpcolor->exist(2);
  $phpcolor->field="id,barname,introduction";
  $phpcolor->where="state = '2' limit ".($_GET['page']*20).",20";
  $bar=$phpcolor->assignment();
  $page=pages($count,20,$_GET['page'],'baraudit','','','0');
  $tpl -> assign("bar", $bar);
  $tpl -> assign("page", $page);
  $tpl -> display("baraudit.htm");
}
?>