<?php

#############################################################################
#                              Site@School
# Site@School is a website management system designed for schools.
#
# About Site@School:
# Original Idea: Mark de Haan (mark@starwave.nl)
# PHP coding & Design: Mark de Haan (mark@starwave.nl)
# Comissioned by: Stadsdeel de Baarsjes, Amsterdam, Netherlands
############################################################################
# checker.php: last changed 07/09/2005  , version: 2.4.10                                      
#              by Fred Stuurman (fc.stuurman@hccnet.nl)
#$Id: checker.php,v 1.2 2006/10/15 19:08:54 fstuurman Exp $
############################################################################
#                        LICENSE INFORMATION
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
##############################################################################
$loc_id = 0;
$id = 0;

if (IsSet ($_GET['loc_id']))
{
	$loc_id = intval($_GET['loc_id']);
}

if (IsSet ($_GET['id']))
{
	$id = intval($_GET['id']);
}

print "<html>
		<head>
		<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">
		<meta http-equiv=\"refresh\" content=\"5;url=checker.php?loc_id=$loc_id&id=$id\">
		</head>
		<body>";

include ("../configuration/database.inc.php");
mysql_connect("$db_server", "$db_username", "$db_password");
mysql_select_db("$db_name");

$table_scripts = $dbprefix . "m_scripts";

$query = "SELECT id FROM $table_scripts WHERE active=1 AND loc_id = '" . $loc_id . "'";
$result = mysql_query($query);
$script_active_id = mysql_result($result, 0, 0);
unset ($query);
unset ($result);

if ($script_active_id != $_GET[id])
{

	echo '<script language="Javascript">
	   window.parent.location.reload();
	</script>';
}

print "</body>
</html>";
?>
