<?php


include("../include/config.php");
include_once("../include/functions/import.php");
verify_login_admin();

if($_REQUEST['update'] == "success")
{
	$message = "Rating Settings Updated Successfully";
	Stemplate::assign('message',$message);
	STemplate::display("administrator/show_message.tpl");
}

if($_REQUEST['submit'])
{
	$sql = "update config set value='".mysql_real_escape_string($_REQUEST[onlyvoteonce])."' where setting='only_vote_once'";
		$conn->execute($sql);
	
	header("location: ratingsettings.php?update=success");
}

// ALLOW VIDEO LIMITS BEGIN
$only_vote_once = $config['only_vote_once'];

if ($only_vote_once == "1")
{
	$onlyvoteoncesyes = "checked";
}
else
{
	$onlyvoteoncesyes = "";
}
Stemplate::assign('onlyvoteoncesyes',$onlyvoteoncesyes);
if ($only_vote_once == "0")
{
	$onlyvoteoncesno = "checked";
}
else
{
	$onlyvoteoncesno = "";
}
Stemplate::assign('onlyvoteoncesno',$onlyvoteoncesno);
// ALLOW VIDEO LIMITS END

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