<?
include "../CheckUser.php";
include_once("../comm/db_sql.php");
include_once("../comm/config.php");
include_once("../comm/connect.php");
include_once("../comm/Function.php");
include_once("function.php");
include_once("../../Smarty/Smarty.class.php");

$page_show = new Smarty(); 
$page_show->template_dir = "./template";
$page_show->compile_dir = "./templates_c"; 
$page_show->left_delimiter = "<{";      
$page_show->right_delimiter = "}>";

$check=$_GET['action'];
$id=$_GET['id'];
if ($check=="edit"){
	$category_record=category_query_one($id,$db);	
	$action="edit&id=".$id;
}else if ($check=="copy"){
	$category_record=category_query_one($id,$db);
	$action="add";
}else
{	
	$action="add";
}
$channel_all_record=channel_query_category($db);

$page_show->assign("action", $action);
$page_show->assign("channel", $category_record['channel']);
$page_show->assign("name", $category_record['name']);
$page_show->assign("channel_name", $category_record['channel_name']);
$page_show->assign("channel_all_record_array", $channel_all_record);
$page_show->assign("check", $check);
$page_show->display("add_category.html"); 
?>