2004-11-10 13:52:01 +00:00
|
|
|
<?
|
2005-01-24 18:00:03 +00:00
|
|
|
/*
|
|
|
|
This file is part of the 'Science Fair In A Box' project
|
|
|
|
SFIAB Website: http://www.sfiab.ca
|
|
|
|
|
|
|
|
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
|
2010-07-16 16:17:03 +00:00
|
|
|
Copyright (C) 2005-2010 James Grant <james@lightbox.org>
|
2005-01-24 18:00:03 +00:00
|
|
|
|
|
|
|
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, version 2.
|
|
|
|
|
|
|
|
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; see the file COPYING. If not, write to
|
|
|
|
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
?>
|
|
|
|
<?
|
2010-07-16 16:36:44 +00:00
|
|
|
//bootstrap sets up the session, loads config params, etc, etc.
|
2010-07-16 16:37:21 +00:00
|
|
|
require_once("common.inc.bootstrap.php");
|
2010-02-03 16:20:23 +00:00
|
|
|
|
2010-07-16 16:36:44 +00:00
|
|
|
//functions contains all the common functions besides the header/footer functions
|
2010-07-16 16:17:03 +00:00
|
|
|
require_once("common.inc.functions.php");
|
2010-07-15 21:24:10 +00:00
|
|
|
|
2004-11-30 22:59:27 +00:00
|
|
|
$HEADER_SENT=false;
|
2010-07-16 16:17:03 +00:00
|
|
|
function send_header($title="", $nav=null, $icon=null, $titletranslated=false) {
|
2004-11-30 22:59:27 +00:00
|
|
|
global $HEADER_SENT;
|
2004-11-30 18:34:25 +00:00
|
|
|
global $config;
|
2010-07-13 21:23:39 +00:00
|
|
|
global $roles;
|
2007-10-23 21:54:22 +00:00
|
|
|
global $prependdir;
|
2010-06-09 20:24:52 +00:00
|
|
|
global $conference;
|
2004-11-30 22:59:27 +00:00
|
|
|
|
|
|
|
//do this so we can use send_header() a little more loosly and not worry about it being sent more than once.
|
|
|
|
if($HEADER_SENT) return;
|
|
|
|
else $HEADER_SENT=true;
|
2004-11-30 18:34:25 +00:00
|
|
|
|
2004-11-10 13:52:01 +00:00
|
|
|
?>
|
2010-07-12 19:40:06 +00:00
|
|
|
<!doctype html>
|
|
|
|
<html>
|
2010-08-20 15:11:11 +00:00
|
|
|
<head>
|
|
|
|
<title><? if($title && !$titletranslated) echo i18n($title); else if($title) echo $title; else echo i18n($config['fairname']); ?></title>
|
|
|
|
<link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/theme/<?=$config['theme']?>/jquery-ui-1.7.2.custom.css" type="text/css" media="all" />
|
|
|
|
<link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/theme/<?=$config['theme']?>/sfiab.css" type="text/css" media="all" />
|
|
|
|
<link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/tableeditor.css" type="text/css" media="all" />
|
|
|
|
<meta charset="UTF-8">
|
2004-11-10 15:31:30 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2009-10-28 18:51:02 +00:00
|
|
|
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/jquery/1.3.2/jquery.min.js"></script>
|
|
|
|
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/jqueryui/1.7.2/jquery-ui.min.js"></script>
|
|
|
|
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/sfiab.js"></script>
|
2010-08-19 18:55:34 +00:00
|
|
|
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/nav.js"></script>
|
2010-03-30 21:59:04 +00:00
|
|
|
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/tablesorter/jquery.tablesorter.min.js"></script>
|
2010-07-15 09:18:08 +00:00
|
|
|
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/validate/jquery.validate.pack.js"></script>
|
2010-03-30 21:59:04 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function(){
|
|
|
|
$('.tableview').tablesorter();
|
2010-07-12 20:29:20 +00:00
|
|
|
if($("#importantdatesbox").length)
|
|
|
|
$("#importantdatesbox").load("important_dates.php?display=box");
|
2010-03-30 21:59:04 +00:00
|
|
|
});
|
2010-08-20 15:11:11 +00:00
|
|
|
//and dump the whole PHP configuration into a Javascript Object, so we can use it anywhere we need to refer to config variables in javascript
|
|
|
|
var config=<?=json_encode($config)?>;
|
2010-03-30 21:59:04 +00:00
|
|
|
</script>
|
2006-09-19 22:40:46 +00:00
|
|
|
<?
|
2010-08-20 15:11:11 +00:00
|
|
|
//if we're under /admin or /config or /super we also want the translation editor
|
|
|
|
if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-7)=="/config" || substr(getcwd(),-6)=="/super")
|
2009-09-11 05:33:41 +00:00
|
|
|
require_once("../translationseditor.inc.php");
|
2006-09-19 22:40:46 +00:00
|
|
|
?>
|
2010-08-19 18:55:34 +00:00
|
|
|
<div id="page-wrapper">
|
|
|
|
<div id="page">
|
|
|
|
<div id="page-inner">
|
|
|
|
<div id="upper-section" class="clear">
|
|
|
|
<div id="notice_area" class="notice_area"></div>
|
|
|
|
<div id="topnav" class="clear">
|
2010-07-09 19:04:25 +00:00
|
|
|
<?
|
2010-07-09 19:24:04 +00:00
|
|
|
echo "<form name=\"languageselect\" method=\"get\" action=\"".$_SERVER['PHP_SELF']."\">";
|
|
|
|
echo "<a href=\"{$config["SFIABDIRECTORY"]}/contact.php\">".i18n("Contact Us")."</a> | \n";
|
2010-07-09 19:04:25 +00:00
|
|
|
if(count($config['languages'])>1) {
|
|
|
|
echo i18n("Language").": ";
|
|
|
|
echo "<select name=\"switchlanguage\" onchange=\"document.forms.languageselect.submit()\">\n";
|
|
|
|
foreach($config['languages'] AS $key=>$val) {
|
|
|
|
if($_SESSION['lang']==$key) $selected="selected=\"selected\""; else $selected="";
|
|
|
|
|
|
|
|
echo "<option $selected value=\"$key\">$val</option>";
|
|
|
|
}
|
|
|
|
echo "</select>";
|
|
|
|
}
|
2010-07-09 19:24:04 +00:00
|
|
|
echo "</form>";
|
2010-07-09 19:04:25 +00:00
|
|
|
?>
|
2010-08-19 18:55:34 +00:00
|
|
|
</div>
|
|
|
|
<div id="header" class="clear">
|
|
|
|
<div id="header-logo">
|
2004-11-30 17:46:39 +00:00
|
|
|
<?
|
2010-07-09 19:24:04 +00:00
|
|
|
echo "<a href=\"{$config['SFIABDIRECTORY']}/index.php\">";
|
2010-07-09 19:04:25 +00:00
|
|
|
if(file_exists($prependdir."data/{$conference['id']}-logo-100.gif")) {
|
2010-07-09 19:24:04 +00:00
|
|
|
echo "<img style=\"border: 0px;\" height=\"70\" src=\"".$config['SFIABDIRECTORY']."/data/{$conference['id']}-logo-100.gif\">";
|
2010-07-09 19:04:25 +00:00
|
|
|
} else if(file_exists($prependdir."data/logo-100.gif")) {
|
2010-07-09 19:24:04 +00:00
|
|
|
echo "<img style=\"border: 0px;\" height=\"70\" src=\"".$config['SFIABDIRECTORY']."/data/logo-100.gif\">";
|
|
|
|
} else {
|
|
|
|
echo i18n("Home Page");
|
2010-07-09 19:04:25 +00:00
|
|
|
}
|
2010-07-09 19:24:04 +00:00
|
|
|
echo "</a>";
|
2010-07-09 19:04:25 +00:00
|
|
|
?>
|
2010-08-19 18:55:34 +00:00
|
|
|
</div>
|
|
|
|
<div id="header-title">
|
2010-07-09 19:04:25 +00:00
|
|
|
<?
|
2007-11-12 20:43:47 +00:00
|
|
|
|
2010-07-13 05:20:35 +00:00
|
|
|
if(!$_SESSION['conferences_id']) {
|
2010-06-03 19:21:27 +00:00
|
|
|
echo "<h1>".i18n($config['fairname'])."</h1>";
|
|
|
|
} else {
|
|
|
|
global $conference;
|
|
|
|
echo "<h1>".i18n($conference['name'])."</h1>";
|
|
|
|
|
|
|
|
}
|
2010-07-09 19:04:25 +00:00
|
|
|
?>
|
2010-08-19 18:55:34 +00:00
|
|
|
</div>
|
|
|
|
<div id="header-conferences">
|
2010-07-09 19:04:25 +00:00
|
|
|
<?
|
|
|
|
$q=mysql_query("SELECT * FROM conferences WHERE status='running' ORDER BY name");
|
|
|
|
if(mysql_num_rows($q)) {
|
|
|
|
echo "<ul class=\"conferencenav\">";
|
|
|
|
while($r=mysql_fetch_object($q)) {
|
2010-07-13 05:20:35 +00:00
|
|
|
if($_SESSION['conferences_id']==$r->id)
|
2010-07-09 19:04:25 +00:00
|
|
|
$cl="class=\"selected\"";
|
|
|
|
else
|
|
|
|
$cl="";
|
2010-08-19 18:55:34 +00:00
|
|
|
echo "<li $cl><a $cl href=\"{$config['SFIABDIRECTORY']}/user_login.php?action=switchconference&switchconference=$r->id\">$r->name</a></li>\n";
|
2010-07-09 19:04:25 +00:00
|
|
|
}
|
|
|
|
echo "</ul>\n";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
2010-08-19 18:55:34 +00:00
|
|
|
</div>
|
|
|
|
<div id="header-login">
|
2010-07-09 19:04:25 +00:00
|
|
|
<?
|
2010-07-13 21:23:39 +00:00
|
|
|
if(isset($_SESSION['roles']) && $_SESSION['username']) {
|
|
|
|
echo i18n("Logged in as %1",array($_SESSION['username']))."<br />";
|
2010-07-21 19:27:50 +00:00
|
|
|
echo "<div style=\"margin-top: 8px;\">\n";
|
2010-08-19 20:07:08 +00:00
|
|
|
echo "My: <a href=\"{$config['SFIABDIRECTORY']}/user_edit.php\">".i18n("Account Profile")."</a>";
|
2010-07-21 19:27:50 +00:00
|
|
|
echo " | ";
|
2010-08-19 20:07:08 +00:00
|
|
|
echo "<a href=\"{$config['SFIABDIRECTORY']}/user_main.php\">".i18n("Main Page")."</a>";
|
2010-07-21 19:27:50 +00:00
|
|
|
echo "</div>";
|
|
|
|
echo "<div style=\"margin-top: 5px;\">\n";
|
2010-07-13 21:23:39 +00:00
|
|
|
echo "<a href=\"{$config['SFIABDIRECTORY']}/user_login.php?action=logout\">".i18n("Logout")."</a>";
|
2010-07-21 19:27:50 +00:00
|
|
|
echo "</div>";
|
2007-11-13 21:00:58 +00:00
|
|
|
|
2007-11-12 20:43:47 +00:00
|
|
|
} else if(isset($_SESSION['email'])) {
|
|
|
|
/* Backwards compatible login settings */
|
2009-09-09 00:26:12 +00:00
|
|
|
if(isset($_SESSION['registration_id'])) {
|
2007-11-12 20:43:47 +00:00
|
|
|
echo i18n('Participant');
|
|
|
|
echo " {$_SESSION['email']}: ";
|
2007-11-13 14:47:01 +00:00
|
|
|
echo "<a href=\"{$config['SFIABDIRECTORY']}/register_participants.php?action=logout\">[".i18n("Logout")."]</a>";
|
2007-11-12 20:43:47 +00:00
|
|
|
} else {
|
|
|
|
echo " ";
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
2010-07-09 19:04:25 +00:00
|
|
|
?>
|
2010-07-13 03:30:11 +00:00
|
|
|
<form method="post" action="user_login.php">
|
2010-07-09 19:04:25 +00:00
|
|
|
<input type="hidden" name="action" value="login" />
|
2010-08-19 18:55:34 +00:00
|
|
|
<table><tr><td>
|
2010-07-13 04:33:42 +00:00
|
|
|
<?=i18n("Username")?>:</td><td><input type="text" size="14" name="username" />
|
2010-07-09 19:04:25 +00:00
|
|
|
</td></tr><tr><td>
|
2010-07-13 03:54:34 +00:00
|
|
|
<?=i18n("Password")?>:</td><td><input type="password" size="14" name="password" />
|
2010-07-09 19:04:25 +00:00
|
|
|
</td></tr>
|
2010-08-19 18:55:34 +00:00
|
|
|
<tr><td style="text-align: center;" colspan="2">
|
2010-07-09 19:24:04 +00:00
|
|
|
<a href="register.php"><?=i18n("Register")?></a>
|
|
|
|
|
2010-07-09 19:04:25 +00:00
|
|
|
<input type="submit" value=<?=i18n("Login")?> />
|
|
|
|
</td></tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
<?
|
2007-11-12 20:43:47 +00:00
|
|
|
}
|
2004-11-30 17:46:39 +00:00
|
|
|
?>
|
2010-08-19 18:55:34 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="navigation-section" class="clear">
|
|
|
|
<div id="primarymenu">
|
2007-03-08 21:33:22 +00:00
|
|
|
<?
|
2009-10-01 17:05:11 +00:00
|
|
|
if(is_array($nav)) {
|
|
|
|
$navkeys=array_keys($nav);
|
|
|
|
switch($navkeys[2]) {
|
|
|
|
case "Fundraising":
|
2010-07-13 21:23:39 +00:00
|
|
|
echo "<ul class=\"primarynav\">\n";
|
2009-10-01 17:05:11 +00:00
|
|
|
echo "<li><h4 style=\"text-align: center;\">".i18n("Fundraising")."</h4></li>\n";
|
2009-10-01 17:08:56 +00:00
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/admin/fundraising.php\">".i18n("Fundraising Dashboard").'</a></li>';
|
2009-10-02 19:21:43 +00:00
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/admin/fundraising_setup.php\">".i18n("Fundraising Setup").'</a></li>';
|
2009-10-14 19:53:09 +00:00
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/admin/fundraising_campaigns.php\">".i18n("Manage Appeals").'</a></li>';
|
2009-10-02 16:46:13 +00:00
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/admin/donors.php\">".i18n("Manage Donors/Sponsors").'</a></li>';
|
2009-10-16 15:43:26 +00:00
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/admin/fundraising_reports.php\">".i18n("Fundraising Reports").'</a></li>';
|
2009-10-01 17:05:11 +00:00
|
|
|
echo "</ul><br />\n";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
//no special menu
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
2010-07-13 21:23:39 +00:00
|
|
|
<ul class="primarynav">
|
2007-11-16 07:54:33 +00:00
|
|
|
<?
|
2010-07-11 14:46:44 +00:00
|
|
|
if ($config['website']) {
|
|
|
|
if ($config['website_name']) {
|
|
|
|
echo "<li><a href=\"{$config['website']}\">{$config['website_name']}</a></li>";
|
|
|
|
} else {
|
|
|
|
echo "<li><a href=\"{$config['website']}\">".i18n("Fair Home").'</a></li>';
|
|
|
|
}
|
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/index.php\">".i18n("Registration Home").'</a></li>';
|
|
|
|
} else {
|
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/index.php\">".i18n("Home").'</a></li>';
|
|
|
|
}
|
2010-07-12 20:29:20 +00:00
|
|
|
|
|
|
|
//if the date is greater than the date/time that the confirmed participants gets posted,
|
|
|
|
//then we will show the registration confirmation page as a link in the menu,
|
|
|
|
$registrationconfirmationlink="";
|
|
|
|
|
|
|
|
//only display it if a date is set to begin with.
|
|
|
|
if($config['dates']['postparticipants'] && $config['dates']['postparticipants']!="0000-00-00 00:00:00") {
|
|
|
|
$q=mysql_query("SELECT (NOW()>'".$config['dates']['regclose']."') AS test");
|
|
|
|
$r=mysql_fetch_object($q);
|
|
|
|
if($r->test==1) {
|
|
|
|
$registrationconfirmationlink="<li><a href=\"".$config['SFIABDIRECTORY']."/confirmed_participants.php\">".i18n("Confirmed Participants")."</a></li>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-16 07:54:33 +00:00
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/important_dates.php\">".i18n("Important Dates").'</a></li>';
|
|
|
|
echo $registrationconfirmationlink;
|
2009-09-09 00:26:12 +00:00
|
|
|
/*
|
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/register_participants.php\">".i18n("Participant Registration").'</a></li>';
|
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_login.php?type=judge\">".i18n("Judges Registration").'</a></li>';
|
2007-11-16 07:54:33 +00:00
|
|
|
if($config['volunteer_enable'] == 'yes') {
|
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_login.php?type=volunteer\">".i18n("Volunteer Registration").'</a></li>';
|
|
|
|
}
|
2009-09-09 00:26:12 +00:00
|
|
|
*/
|
2007-11-16 07:54:33 +00:00
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/committees.php\">".i18n("Committee").'</a></li>';
|
2010-07-13 20:18:50 +00:00
|
|
|
if($config['show_winners'] == "yes") {
|
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/winners.php\">".i18n("Winners").'</a></li>';
|
|
|
|
}
|
2010-07-12 20:29:20 +00:00
|
|
|
|
2010-07-13 21:23:39 +00:00
|
|
|
if(is_array($_SESSION['roles'])) {
|
|
|
|
foreach($_SESSION['roles'] AS $roletype) {
|
|
|
|
$roleid=$roles[$roletype]['id'];
|
|
|
|
$q=mysql_query("SELECT * FROM rolestasks WHERE roles_id='$roleid' AND pid=0 ORDER BY task");
|
|
|
|
if(mysql_num_rows($q)==1) {
|
|
|
|
$setPrimaryNav=true;
|
|
|
|
}
|
|
|
|
$cl="";
|
|
|
|
while($r=mysql_fetch_object($q)) {
|
|
|
|
if($setPrimarynav) {
|
|
|
|
$_SESSION['nav']['primary']=$r->id;
|
|
|
|
$cl="class=\"selected\"";
|
|
|
|
}
|
2010-07-21 18:37:03 +00:00
|
|
|
echo "<li id=\"primary_nav_{$r->id}\" $cl>";
|
2010-08-20 15:42:18 +00:00
|
|
|
if($r->link) $href=$config['SFIABDIRECTORY'].$r->link;
|
|
|
|
else $href="#";
|
|
|
|
echo "<a href=\"$href\" onclick=\"return taskNavLevel($r->id,0,0,0)\">".i18n($r->task)."</a>";
|
2010-07-21 18:37:03 +00:00
|
|
|
echo "</li>\n";
|
2010-07-13 21:23:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-16 07:54:33 +00:00
|
|
|
?>
|
2005-02-16 22:50:43 +00:00
|
|
|
<?
|
2010-07-13 03:30:11 +00:00
|
|
|
if(array_key_exists('users_id', $_SESSION)) {
|
2010-08-20 15:42:18 +00:00
|
|
|
/*
|
2010-07-13 03:30:11 +00:00
|
|
|
if(in_array('admin', $_SESSION['roles'])) {
|
2010-07-13 21:23:39 +00:00
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/admin/\">".i18n("Administration").' (old) </a></li>';
|
2007-12-12 04:15:17 +00:00
|
|
|
}
|
2010-07-13 03:30:11 +00:00
|
|
|
if(in_array('config', $_SESSION['roles'])) {
|
2010-07-13 21:23:39 +00:00
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/config/\">".i18n("Configuration").' (old) </a></li>';
|
2007-12-12 04:15:17 +00:00
|
|
|
}
|
2010-08-20 15:42:18 +00:00
|
|
|
*/
|
2010-07-13 03:30:11 +00:00
|
|
|
if($_SESSION['superuser'] == 'yes') {
|
2010-06-23 21:18:06 +00:00
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/super/\">".i18n("System Setup").'</a></li>';
|
2010-07-13 03:30:11 +00:00
|
|
|
}
|
|
|
|
if(in_array('volunteer', $_SESSION['roles'])) {
|
|
|
|
// echo "<li><a href=\"{$config['SFIABDIRECTORY']}/volunteer_main.php\">".i18n("Volunteer Home").'</a></li>';
|
|
|
|
}
|
|
|
|
if(in_array('sponsor', $_SESSION['roles'])) {
|
|
|
|
// echo "<li><a href=\"{$config['SFIABDIRECTORY']}/sponsor_main.php\">".i18n("Sponsor Home").'</a></li>';
|
|
|
|
}
|
|
|
|
/* FIXME: setting the schoolid should move to the user_login routine, so we can just test for
|
|
|
|
* the presence of the school/teacher/principal role here */
|
|
|
|
if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode']) {
|
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/schoolaccess.php\">".i18n("School Home").'</a></li>';
|
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/schoolaccess.php?action=logout\">".i18n("Logout").'</a></li>';
|
|
|
|
}
|
|
|
|
if(in_array('student', $_SESSION['roles'])) {
|
|
|
|
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/register_participants_main.php\">".i18n("Participant Home").'</a></li>';
|
|
|
|
}
|
2005-05-13 18:23:31 +00:00
|
|
|
}
|
2010-07-13 03:30:11 +00:00
|
|
|
?>
|
|
|
|
</ul>
|
2010-08-19 18:55:34 +00:00
|
|
|
</div>
|
|
|
|
<div id="secondarymenu">
|
|
|
|
</div>
|
|
|
|
<div id="tertiarymenu">
|
|
|
|
<div id="tertiarymenu_accordion">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2010-07-13 21:23:39 +00:00
|
|
|
|
2010-07-09 20:25:31 +00:00
|
|
|
<?
|
2010-07-15 21:24:10 +00:00
|
|
|
|
|
|
|
//take SFIABDIRECTORY off of the current URL
|
|
|
|
$pageurl=substr($_SERVER['PHP_SELF'],strlen($config['SFIABDIRECTORY']));
|
|
|
|
$q=mysql_query("SELECT * FROM rolestasks WHERE link='".mysql_real_escape_string($pageurl)."'");
|
|
|
|
if($r=mysql_fetch_object($q)) {
|
2010-07-21 20:14:05 +00:00
|
|
|
//okay we found it, now get its full tree above it
|
2010-07-15 21:24:10 +00:00
|
|
|
$navTree=array();
|
|
|
|
upTree($r->id,&$navTree);
|
2010-07-21 20:14:05 +00:00
|
|
|
|
|
|
|
//set things to 0 to start
|
2010-07-21 18:37:03 +00:00
|
|
|
$_SESSION['nav']['primary']=0;
|
|
|
|
$_SESSION['nav']['secondary']=0;
|
|
|
|
$_SESSION['nav']['tertiary']=0;
|
|
|
|
$_SESSION['nav']['tertiarylink']=0;
|
2010-07-21 15:14:32 +00:00
|
|
|
|
2010-07-21 20:14:05 +00:00
|
|
|
//go through each one, and set the SESSION vars
|
2010-07-15 21:24:10 +00:00
|
|
|
foreach($navTree AS $t) {
|
2010-07-21 15:14:32 +00:00
|
|
|
switch($t['level']) {
|
|
|
|
case 0: //primary nav
|
|
|
|
$_SESSION['nav']['primary']=$t['id'];
|
|
|
|
break;
|
|
|
|
case 1: //secondary nav
|
|
|
|
$_SESSION['nav']['secondary']=$t['id'];
|
|
|
|
break;
|
|
|
|
case 2: //tertiary nav heading
|
2010-07-21 18:37:03 +00:00
|
|
|
$_SESSION['nav']['tertiary']=$t['id'];
|
|
|
|
break;
|
2010-07-21 15:14:32 +00:00
|
|
|
case 3: //tertiary nav link
|
2010-07-21 18:37:03 +00:00
|
|
|
$_SESSION['nav']['tertiarylink']=$t['id'];
|
|
|
|
break;
|
2010-07-21 15:14:32 +00:00
|
|
|
}
|
2010-07-15 21:24:10 +00:00
|
|
|
}
|
2010-07-21 20:14:05 +00:00
|
|
|
echo "\n\n<script type=\"text/javascript\">";
|
|
|
|
//and once the page is ready, call the taskNavLevel function to fill everything out and select what needs to be selected
|
|
|
|
echo "$(document).ready(function(){\n";
|
|
|
|
$str = "taskNavLevel({$_SESSION['nav']['primary']}, {$_SESSION['nav']['secondary']}, {$_SESSION['nav']['tertiary']}, {$_SESSION['nav']['tertiarylink']});";
|
|
|
|
echo $str;
|
2010-07-21 18:37:03 +00:00
|
|
|
echo " });";
|
|
|
|
echo "</script>\n";
|
2010-07-15 21:24:10 +00:00
|
|
|
|
2010-07-21 20:14:05 +00:00
|
|
|
}
|
|
|
|
else {
|
2010-07-21 15:14:32 +00:00
|
|
|
}
|
2010-07-09 20:35:05 +00:00
|
|
|
/*
|
2007-11-16 06:47:53 +00:00
|
|
|
if(is_array($nav)) {
|
2007-11-23 20:56:59 +00:00
|
|
|
echo "<div id=\"mainwhere\">".i18n('You are here:').' ';
|
2007-11-16 06:47:53 +00:00
|
|
|
foreach($nav as $t=>$l) {
|
2008-02-04 23:40:26 +00:00
|
|
|
echo "<a href=\"{$config['SFIABDIRECTORY']}/$l\">".i18n($t).'</a> » ';
|
2007-11-16 06:47:53 +00:00
|
|
|
}
|
2009-09-09 00:26:12 +00:00
|
|
|
if(!$titletranslated)
|
|
|
|
echo i18n($title);
|
|
|
|
else
|
|
|
|
echo $title;
|
2007-11-16 06:47:53 +00:00
|
|
|
echo '</div>';
|
|
|
|
}
|
2010-07-09 20:35:05 +00:00
|
|
|
*/
|
2007-11-16 06:47:53 +00:00
|
|
|
?>
|
|
|
|
|
2010-08-19 18:55:34 +00:00
|
|
|
<div id="main" class="clear">
|
2004-11-10 13:52:01 +00:00
|
|
|
<?
|
2006-10-23 18:38:05 +00:00
|
|
|
|
2010-07-13 03:30:11 +00:00
|
|
|
if(is_array($_SESSION['roles'])) {
|
|
|
|
$has_config = array_key_exists('config', $_SESSION['roles']);
|
|
|
|
$has_admin = array_key_exists('admin', $_SESSION['roles']);
|
|
|
|
|
|
|
|
if($has_config || $has_admin)
|
|
|
|
committee_warnings();
|
|
|
|
if($has_config)
|
|
|
|
config_warnings();
|
|
|
|
if($has_admin)
|
|
|
|
admin_warnings();
|
|
|
|
}
|
2006-10-23 18:38:05 +00:00
|
|
|
|
2010-08-19 20:07:08 +00:00
|
|
|
/*
|
2010-07-12 19:40:06 +00:00
|
|
|
if(substr(getcwd(),-6)!="/admin" && substr(getcwd(),-7)!="/config" && substr(getcwd(),-6)!="/super") {
|
|
|
|
?>
|
|
|
|
<div id="importantdatesbox">
|
|
|
|
</div>
|
|
|
|
<?
|
|
|
|
}
|
2010-08-19 20:07:08 +00:00
|
|
|
*/
|
2010-08-20 15:11:11 +00:00
|
|
|
?>
|
|
|
|
<div id="work-area">
|
|
|
|
<div id="main-title">
|
|
|
|
<?
|
2008-08-22 20:35:08 +00:00
|
|
|
|
2008-09-24 21:56:11 +00:00
|
|
|
if($icon && theme_icon($icon)) {
|
2010-08-20 15:11:11 +00:00
|
|
|
echo " <div id=\"main-icon\" class=\"link-icon\">";
|
2010-07-12 19:40:06 +00:00
|
|
|
echo theme_icon($icon);
|
2010-08-20 15:11:11 +00:00
|
|
|
echo "</div>\n";
|
2008-08-22 20:35:08 +00:00
|
|
|
}
|
2006-10-18 17:32:14 +00:00
|
|
|
|
|
|
|
//if we're under /admin or /config then we want to show the ? help icon
|
2010-07-09 20:35:05 +00:00
|
|
|
if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-7)=="/config" || substr(getcwd(),-6)=="/super") {
|
2009-01-27 21:52:11 +00:00
|
|
|
if($_SERVER['REDIRECT_SCRIPT_URL'])
|
|
|
|
$fname=substr($_SERVER['REDIRECT_SCRIPT_URL'],strlen($config['SFIABDIRECTORY'])+1);
|
|
|
|
else
|
|
|
|
$fname=substr($_SERVER['PHP_SELF'],strlen($config['SFIABDIRECTORY'])+1);
|
2010-08-20 15:11:11 +00:00
|
|
|
|
|
|
|
echo " <div id=\"help-icon\" class=\"link-icon\"><a target=\"_sfiabhelp\" href=\"http://www.sfiab.ca/wiki/index.php/Help_$fname\"><img border=\"0\" src=\"".$config['SFIABDIRECTORY']."/images/32/help.".$config['icon_extension']."\"></a></div>\n";
|
2006-10-18 17:32:14 +00:00
|
|
|
}
|
2010-07-09 20:35:05 +00:00
|
|
|
|
2010-07-12 19:40:06 +00:00
|
|
|
if($title && !$titletranslated)
|
2010-08-20 15:11:11 +00:00
|
|
|
echo "<h2>".i18n($title)."</h2>\n";
|
2010-07-12 19:40:06 +00:00
|
|
|
else if($title)
|
2010-08-20 15:11:11 +00:00
|
|
|
echo "<h2>".$title."</h2>\n";
|
2009-09-09 00:26:12 +00:00
|
|
|
|
2010-07-09 20:35:05 +00:00
|
|
|
display_messages();
|
2010-07-13 03:30:11 +00:00
|
|
|
|
2010-08-20 15:11:11 +00:00
|
|
|
?>
|
|
|
|
</div><!-- main-title-->
|
|
|
|
<div id="main-content">
|
|
|
|
<?
|
2004-11-10 13:52:01 +00:00
|
|
|
}
|
2009-09-09 00:26:12 +00:00
|
|
|
/* END OF send_header */
|
2004-11-10 13:52:01 +00:00
|
|
|
|
2010-07-16 16:17:03 +00:00
|
|
|
function send_footer() {
|
2005-05-25 19:08:50 +00:00
|
|
|
global $config;
|
2004-11-10 13:52:01 +00:00
|
|
|
?>
|
2010-08-20 15:11:11 +00:00
|
|
|
</div><!--main-content-->
|
|
|
|
</div><!--work-area-->
|
|
|
|
</div><!--main-->
|
2010-08-19 18:55:34 +00:00
|
|
|
<div id="lower-section" class="clear">
|
|
|
|
<div id="footer">
|
2005-12-14 21:00:02 +00:00
|
|
|
<?
|
|
|
|
//we only show the debug session variables if we have an ODD numbered version.
|
2006-09-03 21:45:54 +00:00
|
|
|
if(substr($config['version'], -1) % 2 != 0)
|
2006-02-14 21:50:41 +00:00
|
|
|
{
|
2007-12-20 22:39:21 +00:00
|
|
|
$revision=exec("svn info |grep Revision");
|
|
|
|
$extra=" (Development $revision)";
|
|
|
|
if($_SESSION['debug']=="true")
|
|
|
|
$extra.=" DEBUG: ".print_r($_SESSION,true);
|
2006-02-14 21:50:41 +00:00
|
|
|
}
|
2007-12-20 22:39:21 +00:00
|
|
|
echo "<a target=\"blank\" href=\"http://www.sfiab.ca\">SFIAB Version ".$config['version']."{$extra}</a>";
|
2005-12-14 21:00:02 +00:00
|
|
|
?>
|
2010-08-19 18:55:34 +00:00
|
|
|
</div><!--footer-->
|
|
|
|
<div id="debug" style="display:<?=($_SESSION['debug']=='true')?'block':'none'?>; font-family:monospace; white-space:pre; " >Debug...</div>
|
2009-10-15 07:11:43 +00:00
|
|
|
<iframe id="content" src="" style="visibility:hidden; width:0px; height:0px"></iframe>
|
2010-08-19 18:55:34 +00:00
|
|
|
</div><!--lower-section-->
|
|
|
|
</div><!--page-inner-->
|
|
|
|
</div><!--page-->
|
|
|
|
</div><!--page-wrapper-->
|
2004-11-10 15:31:30 +00:00
|
|
|
</body>
|
|
|
|
</html>
|
2004-11-10 13:52:01 +00:00
|
|
|
|
|
|
|
<?
|
|
|
|
}
|
|
|
|
|
2010-07-16 16:17:03 +00:00
|
|
|
function send_popup_header($title="") {
|
2005-03-30 18:02:45 +00:00
|
|
|
global $HEADER_SENT;
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
//do this so we can use send_header() a little more loosly and not worry about it being sent more than once.
|
|
|
|
if($HEADER_SENT) return;
|
|
|
|
else $HEADER_SENT=true;
|
|
|
|
|
2010-06-04 20:23:59 +00:00
|
|
|
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
|
2005-03-30 18:02:45 +00:00
|
|
|
?>
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
|
|
|
|
<head><title><?=i18n($title)?></title>
|
2009-11-06 22:10:06 +00:00
|
|
|
<link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/theme/<?=$config['theme']?>/jquery-ui-1.7.2.custom.css" type="text/css" media="all" />
|
2009-09-09 00:26:12 +00:00
|
|
|
<link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/theme/<?=$config['theme']?>/sfiab.css" type="text/css" media="all" />
|
2006-10-11 00:28:58 +00:00
|
|
|
<link media=all href="<?=$config['SFIABDIRECTORY']?>/tableeditor.css" type=text/css rel=stylesheet>
|
2005-03-30 18:02:45 +00:00
|
|
|
</head>
|
2005-03-30 18:19:31 +00:00
|
|
|
<body onload="window.focus()">
|
2009-10-28 18:52:38 +00:00
|
|
|
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/jquery/1.3.2/jquery.min.js"></script>
|
|
|
|
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/jqueryui/1.7.2/jquery-ui.min.js"></script>
|
|
|
|
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/sfiab.js"></script>
|
2010-07-15 09:18:08 +00:00
|
|
|
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/validate/jquery.validate.pack.js"></script>
|
2009-09-23 16:42:24 +00:00
|
|
|
<div id="notice_area" class="notice_area"></div>
|
|
|
|
|
2005-03-30 18:02:45 +00:00
|
|
|
<?
|
2005-03-30 18:19:31 +00:00
|
|
|
if($title)
|
|
|
|
echo "<h2>".i18n($title)."</h2>";
|
2009-09-09 00:26:12 +00:00
|
|
|
|
2005-03-30 18:02:45 +00:00
|
|
|
}
|
|
|
|
|
2010-07-16 16:17:03 +00:00
|
|
|
function send_popup_footer() {
|
2005-03-30 18:02:45 +00:00
|
|
|
?>
|
2005-03-30 18:21:48 +00:00
|
|
|
<br />
|
|
|
|
<br />
|
2005-03-30 18:19:31 +00:00
|
|
|
<div id="footer">
|
2006-03-28 21:41:51 +00:00
|
|
|
<?
|
|
|
|
global $config;
|
|
|
|
$lastdigit=$config['version'][strlen($config['version'])-1];
|
|
|
|
if($lastdigit%2!=0)
|
|
|
|
{
|
|
|
|
echo "DEBUG:";
|
|
|
|
print_r($_SESSION);
|
|
|
|
}
|
|
|
|
echo "SFIAB Version ".$config['version'];
|
|
|
|
?>
|
2005-03-30 18:19:31 +00:00
|
|
|
</div>
|
2009-09-23 16:42:24 +00:00
|
|
|
<div id="debug" style="display:<?=($_SESSION['debug']=='true')?'block':'none'?>">Debug...</div>
|
2009-10-15 07:11:43 +00:00
|
|
|
<iframe id="content" src="" style="visibility:hidden; width:0px; height:0px"></iframe>
|
2005-03-30 18:19:31 +00:00
|
|
|
|
2005-03-30 18:02:45 +00:00
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
<?
|
|
|
|
}
|
|
|
|
|
2004-11-10 13:52:01 +00:00
|
|
|
|
|
|
|
?>
|