<?php
include("require.php");
submitfilter(1,$_GET['id']);
$phpcolor->table=$core_mysql_prefix."class";
$phpcolor->field="*";
$phpcolor->where="id = ".$_GET['id']." order by queue";
if(!($sort=$phpcolor->exist(1)))
  Header("Location: index.php");
elseif($sort['base']=="0")
{
  $phpcolor->field="id,classname";
  $phpcolor->where="belong = ".$_GET['id']." order by queue";
  $smallsort=$phpcolor->assignment();
  for ($count=0;$count<count($smallsort);$count++)
  { 
    $phpcolor->table=$core_mysql_prefix."bar";
    $phpcolor->field="id,barname";
    $phpcolor->where="barclass = ".$smallsort[$count]['id']." limit 100";
    $bar1[$count]=$phpcolor->assignment();
  }
  $tpl -> assign("smallsort", $smallsort);
}
else
{
  if(!isset($_GET['page']))
    $_GET['page']=0;
  $phpcolor->table=$core_mysql_prefix."bar";
  $phpcolor->field="*";
  $phpcolor->where="barclass = ".$_GET['id']."";
  $count=$phpcolor->exist(2);
  $phpcolor->field="id,barname";
  $phpcolor->where="barclass = ".$_GET['id']." limit ".($_GET['page']*400).",400";
  $bar1=$phpcolor->assignment();
  $page=pages($count,400,$_GET['page'],'class','&id=',$_GET['id'],$core_rewrite);
  $tpl -> assign("count", $count);
  $tpl -> assign("page", $page);
}
$tpl -> assign("bar", $bar1);
$tpl -> assign("sort", $sort);
$tpl -> assign("core_header_title", $sort['classname']." - ");
$tpl -> display("$core_style/class.htm");
?>