<?php


include("../include/config.php");
include_once("../include/functions/import.php");
verify_login_admin();
        
		
if($_REQUEST['update'] == "success")
{
	$message = "Video Category Successfully Edited";
	Stemplate::assign('message',$message);
	STemplate::display("administrator/show_message.tpl");
}
        
if($_REQUEST['edit_category'])
{
	$name = escape($_REQUEST[name]);
	$details = escape($_REQUEST[message]);	
	$CATID = escape($_REQUEST[CATID]);
	$query = "update categories_videos set
	name = '".mysql_real_escape_string($name)."',
	details = '".mysql_real_escape_string($details)."'
	where CATID='".mysql_real_escape_string($CATID)."'";
	$conn->execute($query);
	header("Location: videocategoriesedit.php?update=success&CATID=$CATID");
}

if($_REQUEST['CATID']!="")
{
$CATID = escape($_REQUEST[CATID]);
$query = $conn->execute("select * from categories_videos where CATID='".mysql_real_escape_string($CATID)."' limit 1");
$category = $query->getrows();
Stemplate::assign('category', $category[0]);
}

Stemplate::assign('error',$error);
STemplate::display("administrator/videocategoriesedit.tpl");
?>