<?php

require 'header.php';

if ( !isset($_REQUEST['newfreq']) ) exit();
$newfreq = intval($_REQUEST['newfreq']);
if ( ($newfreq < 1) || ($newfreq > 5) ) exit();

$query = "UPDATE " . SETTINGSTABLE . " SET value=:value WHERE parameter='CHRISTMASFREQ'";
$fields = array();
$fields[':value'] = $newfreq;
$sth = $globaldbh->prepare($query);
$sth->execute($fields);

exit();

?>
