<?php


include("../include/config.php");
include_once("../include/functions/import.php");
verify_login_admin();
        
		
if($_REQUEST['update'] == "success")
{
	$message = "Series Successfully Edited";
	Stemplate::assign('message',$message);
	STemplate::display("administrator/show_message.tpl");
}
        
if($_REQUEST['edit_series'])
{
	$name = escape($_REQUEST['name']);
	$description = escape($_REQUEST['description']);
	$featured = escape($_REQUEST['featured']);	
	$SID = escape($_REQUEST['SID']);
	
	$query = "update videos_series set
	name = '".mysql_real_escape_string($name)."',
	description = '".mysql_real_escape_string($description)."',
	featured = '".mysql_real_escape_string($featured)."'
	where SID='".mysql_real_escape_string($SID)."'";
	$conn->execute($query);
	header("Location: listseriesedit.php?update=success&SID=$SID");
}

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

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