Compare commits

..

No commits in common. "000826e093b77cfc6ec9c6160e711c3241b3cf51" and "9892d738d4ded2a3ff0fec1fcc811cbfd0338fb7" have entirely different histories.

19 changed files with 74 additions and 119 deletions

View File

@ -1,14 +1,12 @@
<? <?
include_once("helper.inc.php");
function committee_auth_has_access($access="") function committee_auth_has_access($access="")
{ {
switch($access) { switch($access) {
case 'config': return (get_value_from_array($_SESSION, 'access_config') == 'yes') ? true : false; case 'config': return ($_SESSION['access_config'] == 'yes') ? true : false;
case 'admin': return (get_value_from_array($_SESSION, 'access_admin') == 'yes') ? true : false; case 'admin': return ($_SESSION['access_admin'] == 'yes') ? true : false;
case 'super': return (get_value_from_array($_SESSION, 'access_super') == 'yes') ? true : false; case 'super': return ($_SESSION['access_super'] == 'yes') ? true : false;
} }
return false; return false;

View File

@ -22,14 +22,13 @@
*/ */
?> ?>
<? <?
include_once("helper.inc.php");
//////echo phpinfo(); //////echo phpinfo();
header("Content-Type: text/html; charset=utf8"); header("Content-Type: text/html; charset=utf8");
//set error reporting to not show notices, for some reason some people's installation dont set this by default //set error reporting to not show notices, for some reason some people's installation dont set this by default
//so we will set it in the code instead just to make sure //so we will set it in the code instead just to make sure
error_reporting(E_ALL); #error_reporting(E_ALL);
#error_reporting( E_ALL ^ E_WARNING ); error_reporting( E_ALL ^ E_WARNING );
#error_reporting( E_ALL ^ E_WARNING ^ E_NOTICE ^ E_DEPRECATED ); #error_reporting( E_ALL ^ E_WARNING ^ E_NOTICE ^ E_DEPRECATED );
define('REQUIREDFIELD','<span class="requiredfield">*</span>'); define('REQUIREDFIELD','<span class="requiredfield">*</span>');
@ -87,7 +86,7 @@ else
$dsn = "mysql:host=db;dbname=sfiab;charset=utf8mb4"; $dsn = "mysql:host=db;dbname=sfiab;charset=utf8mb4";
$pdo = new PDO($dsn,$DBUSER,$DBPASS); $pdo = new PDO($dsn,$DBUSER,$DBPASS,$dsn_options);
if(!$pdo) if(!$pdo)
{ {
@ -196,6 +195,8 @@ require_once("theme/{$config['theme_icons']}/icons.php");
require_once("committee.inc.php"); require_once("committee.inc.php");
session_start();
if($config['SFIABDIRECTORY'] == '') { if($config['SFIABDIRECTORY'] == '') {
session_name("SFIABSESSID"); session_name("SFIABSESSID");
session_set_cookie_params(0,'/'); session_set_cookie_params(0,'/');
@ -204,8 +205,6 @@ if($config['SFIABDIRECTORY'] == '') {
session_set_cookie_params(0,$config['SFIABDIRECTORY']); session_set_cookie_params(0,$config['SFIABDIRECTORY']);
} }
session_start();
//detect the browser first, so we know what icons to use - we store this in the config array as well //detect the browser first, so we know what icons to use - we store this in the config array as well
//even though its not configurable by the fair //even though its not configurable by the fair
if(stristr($_SERVER['HTTP_USER_AGENT'],"MSIE")) if(stristr($_SERVER['HTTP_USER_AGENT'],"MSIE"))
@ -231,7 +230,6 @@ else
} }
} }
//now if no language has been set yet, lets set it to the default language //now if no language has been set yet, lets set it to the default language
if(!$_SESSION['lang']) if(!$_SESSION['lang'])
{ {
//first try the default language, if that doesnt work, use "en" //first try the default language, if that doesnt work, use "en"
@ -243,10 +241,10 @@ if(!$_SESSION['lang'])
//only allow debug to get set if we're using a development version (odd numbered ending) //only allow debug to get set if we're using a development version (odd numbered ending)
if(substr($config['version'], -1) % 2 != 0) if(substr($config['version'], -1) % 2 != 0)
if(get_value_from_array($_GET, 'debug')) $_SESSION['debug']=$_GET['debug']; if($_GET['debug']) $_SESSION['debug']=$_GET['debug'];
//if the user has switched languages, go ahead and switch the session variable //if the user has switched languages, go ahead and switch the session variable
if(get_value_from_array($_GET, 'switchlanguage')) if($_GET['switchlanguage'])
{ {
//first, make sure its a valid language: //first, make sure its a valid language:
if($config['languages'][$_GET['switchlanguage']]) if($config['languages'][$_GET['switchlanguage']])
@ -392,12 +390,12 @@ function send_header($title="", $nav=null, $icon=null, $titletranslated=false)
//do this so we can use send_header() a little more loosly and not worry about it being sent more than once. //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; if($HEADER_SENT) return;
else $HEADER_SENT=true; else $HEADER_SENT=true;
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n";
?> ?>
<!DOCTYPE html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head> <head><title><? //if($title && !$titletranslated) echo i18n($title); else if($title) echo $title; else echo i18n($config['fairname']); ?></title>
<meta charset="utf-8" />
<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']?>/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']?>/theme/<?=$config['theme']?>/sfiab.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/tableeditor.css" type="text/css" media="all" /> <link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/tableeditor.css" type="text/css" media="all" />
@ -517,7 +515,7 @@ if(is_array($nav)) {
<br /> <br />
<ul class="mainnav"> <ul class="mainnav">
<? <?
if(get_value_from_session('users_type') == 'committee') { if($_SESSION['users_type'] == 'committee') {
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_personal.php\">".i18n("My Profile").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_personal.php\">".i18n("My Profile").'</a></li>';
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/committee_main.php\">".i18n("Committee Home").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/committee_main.php\">".i18n("Committee Home").'</a></li>';
if(committee_auth_has_access("admin")){ if(committee_auth_has_access("admin")){
@ -527,23 +525,23 @@ if(get_value_from_session('users_type') == 'committee') {
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/config/\">".i18n("Configuration").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/config/\">".i18n("Configuration").'</a></li>';
} }
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_login.php?action=logout\">".i18n("Logout").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_login.php?action=logout\">".i18n("Logout").'</a></li>';
} else if(get_value_from_session('users_type') == "judge") { } else if($_SESSION['users_type']=="judge") {
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_personal.php\">".i18n("My Profile").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_personal.php\">".i18n("My Profile").'</a></li>';
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/judge_main.php\">".i18n("Judge Home").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/judge_main.php\">".i18n("Judge Home").'</a></li>';
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_login.php?action=logout\">".i18n("Logout").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_login.php?action=logout\">".i18n("Logout").'</a></li>';
} else if(get_value_from_session('users_type') == "volunteer") { } else if($_SESSION['users_type']=="volunteer") {
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_personal.php\">".i18n("My Profile").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_personal.php\">".i18n("My Profile").'</a></li>';
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/volunteer_main.php\">".i18n("Volunteer Home").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/volunteer_main.php\">".i18n("Volunteer Home").'</a></li>';
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_login.php?action=logout\">".i18n("Logout").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_login.php?action=logout\">".i18n("Logout").'</a></li>';
} else if(get_value_from_session('users_type') == "sponsor") { } else if($_SESSION['users_type']=="sponsor") {
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_personal.php\">".i18n("My Profile").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_personal.php\">".i18n("My Profile").'</a></li>';
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/sponsor_main.php\">".i18n("Sponsor Home").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/sponsor_main.php\">".i18n("Sponsor Home").'</a></li>';
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_login.php?action=logout\">".i18n("Logout").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_login.php?action=logout\">".i18n("Logout").'</a></li>';
} else if(get_value_from_session('schoolid') && get_value_from_session('schoolaccesscode')) { } else 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\">".i18n("School Home").'</a></li>';
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/schoolaccess.php?action=logout\">".i18n("Logout").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/schoolaccess.php?action=logout\">".i18n("Logout").'</a></li>';
} }
else if(get_value_from_session('registration_number') && get_value_from_session('registration_id')) { else if($_SESSION['registration_number'] && $_SESSION['registration_id']) {
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/register_participants_main.php\">".i18n("Participant Home").'</a></li>'; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/register_participants_main.php\">".i18n("Participant Home").'</a></li>';
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/register_participants.php?action=logout\">".i18n("Logout")."</a></li>\n"; echo "<li><a href=\"{$config['SFIABDIRECTORY']}/register_participants.php?action=logout\">".i18n("Logout")."</a></li>\n";
} else { } else {
@ -650,15 +648,13 @@ if(substr($config['version'], -1) % 2 != 0)
$revision=exec("svn info |grep Revision"); $revision=exec("svn info |grep Revision");
} }
$extra=" (Development $revision)"; $extra=" (Development $revision)";
if(get_value_from_array($_SESSION, 'debug') == "true") if($_SESSION['debug']=="true")
$extra.=" DEBUG: ".print_r($_SESSION,true); $extra.=" DEBUG: ".print_r($_SESSION,true);
} }
echo "<a target=\"blank\" href=\"http://www.sfiab.ca\">SFIAB Version ".$config['version']."{$extra}</a>";
// FIX ME
echo "<a target=\"blank\" href=\"http://www.sfiab.ca\">SFIAB Version ".$config['version']."{$extra}</a>";
?> ?>
</div> </div>
<div id="debug" style="display:<?=(get_value_from_array($_SESSION, 'debug') == 'true')?'block':'none'?>; font-family:monospace; white-space:pre;">Debug...</div> <div id="debug" style="display:<?=($_SESSION['debug']=='true')?'block':'none'?>; font-family:monospace; white-space:pre; " >Debug...</div>
<iframe id="content" src="" style="visibility:hidden; width:0px; height:0px"></iframe> <iframe id="content" src="" style="visibility:hidden; width:0px; height:0px"></iframe>
</body> </body>
@ -678,11 +674,9 @@ function send_popup_header($title="")
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n"; echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n";
?> ?>
<!DOCTYPE html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head> <head><title><?=i18n($title)?></title>
<meta charset="utf-8" />
<title><?=i18n($title)?></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']?>/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']?>/theme/<?=$config['theme']?>/sfiab.css" type="text/css" media="all" />
<link media=all href="<?=$config['SFIABDIRECTORY']?>/tableeditor.css" type=text/css rel=stylesheet> <link media=all href="<?=$config['SFIABDIRECTORY']?>/tableeditor.css" type=text/css rel=stylesheet>
@ -1092,7 +1086,7 @@ function output_page_text($textname)
} }
//if it looks like we have HTML content, dont do a nl2br, if there's no html, then do the nl2br //if it looks like we have HTML content, dont do a nl2br, if there's no html, then do the nl2br
if($r->text !== null and strlen($r->text)==strlen(strip_tags($r->text))) if(strlen($r->text)==strlen(strip_tags($r->text)))
echo nl2br($r->text); echo nl2br($r->text);
else else
echo $r->text; echo $r->text;
@ -1108,16 +1102,16 @@ function output_page_cms($filename)
if($q->rowCount()) if($q->rowCount())
{ {
$r = $q->fetch(); $r = $q->fetch();
send_header($r['title'],null,null,true); send_header($r->title,null,null,true);
if(file_exists("data/logo-200.gif") && $r->showlogo==1) if(file_exists("data/logo-200.gif") && $r->showlogo==1)
echo "<img align=\"right\" src=\"".$config['SFIABDIRECTORY']."/data/logo-200.gif\" border=\"0\">"; echo "<img align=\"right\" src=\"".$config['SFIABDIRECTORY']."/data/logo-200.gif\" border=\"0\">";
//if it looks like we have HTML content, dont do a nl2br, if there's no html, then do the nl2br //if it looks like we have HTML content, dont do a nl2br, if there's no html, then do the nl2br
if($r['text'] !== null and strlen($r['text'])==strlen(strip_tags($r['text']))) if(strlen($r->text)==strlen(strip_tags($r->text)))
echo nl2br($r['text']); echo nl2br($r->text);
else else
echo $r['text']; echo $r->text;
} }
else { else {
send_header("Error: File not found"); send_header("Error: File not found");

View File

@ -50,7 +50,7 @@ while($tr=$tableq->fetch(PDO::FETCH_NUM)) {
$str="INSERT INTO `$table` ("; $str="INSERT INTO `$table` (";
unset($fields); unset($fields);
$fields=array(); $fields=array();
while($cr=$columnq->fetch(PDO:FETCH_OBJ)) { while($cr=$columnq->fetch(PDO:;FETCH_OBJ)) {
$str.="`".$cr->Field."`,"; $str.="`".$cr->Field."`,";
$fields[]=$cr->Field; $fields[]=$cr->Field;
} }

View File

@ -31,7 +31,7 @@
array('Committee Main' => 'committee_main.php', array('Committee Main' => 'committee_main.php',
'SFIAB Configuration' => 'config/index.php', 'SFIAB Configuration' => 'config/index.php',
'Age Categories' => 'config/categories.php'),"project_age_categories"); 'Age Categories' => 'config/categories.php'),"project_age_categories");
} else { } else
send_header("Age Categories", send_header("Age Categories",
array('Committee Main' => 'committee_main.php', array('Committee Main' => 'committee_main.php',
'SFIAB Configuration' => 'config/index.php'),"project_age_categories"); 'SFIAB Configuration' => 'config/index.php'),"project_age_categories");

View File

@ -74,7 +74,7 @@ $dates = array('fairdate' => array() ,
'regclose' => array(), 'regclose' => array(),
'postparticipants' => array(), 'postparticipants' => array(),
'postwinners' => array(), 'postwinners' => array(),
'judgeregopen' => datesarray(), 'judgeregopen' => array(),
'judgeregclose' => array(), 'judgeregclose' => array(),
'judgescheduleavailable' => array(), 'judgescheduleavailable' => array(),
'specawardregopen' => array(), 'specawardregopen' => array(),

View File

@ -218,7 +218,7 @@ if($_GET['action']=="edit" || $_GET['action']=="new") {
$tempcat="&nbsp;"; $tempcat="&nbsp;";
}else{ }else{
$tempcat=""; $tempcat="";
while($categoryr=$c->fetch(PDO::FETCH_OBJ)){ while($categoryr=$c->fetch(PDO::FETCH_OBJ){
$tempcat.=",".$categoryr->category; $tempcat.=",".$categoryr->category;
} }
$tempcat=substr($tempcat,1); $tempcat=substr($tempcat,1);

View File

@ -39,7 +39,6 @@
function loadLanguagePacks() function loadLanguagePacks()
{ {
$ret=array(); $ret=array();
//// FIXME Replace!
if($packs=file("http://www.sfiab.ca/languages/langpacklist.txt")) if($packs=file("http://www.sfiab.ca/languages/langpacklist.txt"))
{ {
$num=count($packs); $num=count($packs);

View File

@ -81,10 +81,10 @@ $q->execute();
$trclass = ($trclass == 'odd') ? 'even' : 'odd'; $trclass = ($trclass == 'odd') ? 'even' : 'odd';
echo "<tr class=\"$trclass\">"; echo "<tr class=\"$trclass\">";
echo "<td align=\"right\">"; echo "<td align=\"right\">";
if($r['cat']==$category) if($r->cat==$category)
echo "<b>".i18n($r['cat'])."</b>"; echo "<b>".i18n($r->cat)."</b>";
else else
echo "<a href=\"".$_SERVER['PHP_SELF']."?category=".urlencode($r['cat'])."\">".i18n($r['cat'])."</a>"; echo "<a href=\"".$_SERVER['PHP_SELF']."?category=".urlencode($r->cat)."\">".i18n($r->cat)."</a>";
echo "</td>"; echo "</td>";
echo "</tr>\n"; echo "</tr>\n";
} }

View File

@ -41,7 +41,6 @@
function loadVersions() function loadVersions()
{ {
$ret=array(); $ret=array();
// FIXME Replace
if($v=file("http://www.sfiab.ca/version.txt")) if($v=file("http://www.sfiab.ca/version.txt"))
{ {
list($version,$date)=split("\t",trim($v[0])); list($version,$date)=split("\t",trim($v[0]));

View File

@ -24,22 +24,19 @@
<? <?
function config_editor_load($category, $year) function config_editor_load($category, $year)
{ { global $pdo;
global $pdo;
$query = "SELECT * FROM config WHERE year='$year' AND category='$category' ORDER BY ord"; $query = "SELECT * FROM config WHERE year='$year' AND category='$category' ORDER BY ord";
$q = $pdo->prepare($query); $q = $pdo->prepare($query);
$q->execute(); print($pdo->errorInfo());
//print_r($pdo->errorInfo());
$var = array(); $var = array();
while($r=$q->fetch()) { while($r=$q->fetch()) {
$var[$r['var']]['val'] = $r['val']; $var[$r->var]['val'] = $r->val;
$var[$r['var']]['desc'] = $r['description']; $var[$r->var]['desc'] = $r->description;
$var[$r['var']]['category'] = $r['category']; $var[$r->var]['category'] = $r->category;
$var[$r['var']]['ord'] = $r['ord']; $var[$r->var]['ord'] = $r->ord;
$var[$r['var']]['type'] = $r['type']; $var[$r->var]['type'] = $r->type;
$var[$r['var']]['type_values'] = $r['type_values']; $var[$r->var]['type_values'] = $r->type_values;
} }
return $var; return $var;
} }
@ -203,7 +200,6 @@ function config_editor($category, $year, $array_name, $self)
if($biggest>30) $size=30; if($biggest>30) $size=30;
else $size=$biggest+1; else $size=$biggest+1;
//make sure size is at minimum 8, this way if all fields are empty you dont end up with 1 character long text boxes //make sure size is at minimum 8, this way if all fields are empty you dont end up with 1 character long text boxes
if($size<8) $size=8; if($size<8) $size=8;

View File

@ -30,9 +30,9 @@
return trim($lines[0]); return trim($lines[0]);
} }
if(get_value_from_array($_POST, 'action') == "send") { if($_POST['action']=="send") {
if(get_value_from_array($_POST, 'to') && get_value_from_array($_POST, 'subject') && get_value_from_array($_POST, 'message') && get_value_from_array($_POST, 'from') && get_value_from_array($_POST, 'fromemail')) { if($_POST['to'] && $_POST['subject'] && $_POST['message'] && $_POST['from'] && $_POST['fromemail']) {
if(isEmailAddress(get_value_from_array($_POST, 'fromemail'))) { if(isEmailAddress($_POST['fromemail'])) {
list($id,$md5email)=explode(":",$_POST['to']); list($id,$md5email)=explode(":",$_POST['to']);
$q=pdo->prepare("SELECT * FROM users WHERE uid=.?. ORDER BY year DESC LIMIT 1"); $q=pdo->prepare("SELECT * FROM users WHERE uid=.?. ORDER BY year DESC LIMIT 1");

View File

@ -1,18 +0,0 @@
<?
function get_value_from_session(string $key, mixed $default = null) : mixed
{
return isset($_SESSION[$key]) ? $_SESSION[$key] : $default;
}
function get_value_from_array(array $ar, string $key, mixed $default = null) : mixed
{
return isset($ar[$key]) ? $ar[$key] : $default;
}
function get_value(mixed $var) : mixed
{
return isset($var) ? $var : null;
}
?>

View File

@ -23,7 +23,6 @@
?> ?>
<? <?
include "common.inc.php"; include "common.inc.php";
send_header("Important Dates",null,"important_dates"); send_header("Important Dates",null,"important_dates");
echo "<table>"; echo "<table>";
@ -32,18 +31,14 @@
$q->execute([ $q->execute([
':year' => $config['FAIRYEAR'] ':year' => $config['FAIRYEAR']
]); ]);
$trclass = null;
while($r = $q->fetch(PDO::FETCH_OBJ)) while($r = $q->fetch(PDO::FETCH_OBJ))
{ {
$trclass = (get_value($trclass) == 'odd') ? 'even' : 'odd'; $trclass = ($trclass == 'odd') ? 'even' : 'odd';
if($r->date != '0000-00-00 00:00:00') { if($r->date != '0000-00-00 00:00:00') {
$d = format_datetime($r->udate); $d = format_datetime($r->udate);
echo "<tr class=\"$trclass\"><td>".i18n($r->description)."</td><td>$d</td></tr>"; echo "<tr class=\"$trclass\"><td>".i18n($r->description)."</td><td>$d</td></tr>";
} }
} }
echo "</table>"; echo "</table>";
send_footer(); send_footer();

View File

@ -22,11 +22,9 @@
*/ */
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n"; echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n";
?> ?>
<!DOCTYPE html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head> <head><title>SFIAB Installation</title>
<meta charset="utf-8" />
<title>SFIAB Installation</title>
<link rel="stylesheet" href="sfiab.css" type="text/css" /> <link rel="stylesheet" href="sfiab.css" type="text/css" />
</head> </head>
<body> <body>

View File

@ -22,11 +22,9 @@
*/ */
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n"; echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n";
?> ?>
<!DOCTYPE html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head> <head><title>SFIAB Installation</title>
<meta charset="utf-8" />
<title>SFIAB Installation</title>
<link rel="stylesheet" href="sfiab.css" type="text/css" /> <link rel="stylesheet" href="sfiab.css" type="text/css" />
</head> </head>
<body> <body>

View File

@ -22,11 +22,9 @@
*/ */
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n"; echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n";
?> ?>
<!DOCTYPE html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head> <head><title>SFIAB Installation</title>
<meta charset="utf-8" />
<title>SFIAB Installation</title>
<link rel="stylesheet" href="sfiab.css" type="text/css" /> <link rel="stylesheet" href="sfiab.css" type="text/css" />
</head> </head>
<body> <body>

View File

@ -174,7 +174,7 @@ function questions_update_question($qs)
`db_heading`='".$qs['db_heading']."', `db_heading`='".$qs['db_heading']."',
`required`='".$qs['required']."', `required`='".$qs['required']."',
`ord`=".intval($qs['ord']." `ord`=".intval($qs['ord']."
WHERE id='{$qs['id']}' ")); WHERE id='{$qs['id']}' ");
$stmt->execute(); $stmt->execute();
echo $pdo->errorInfo(); echo $pdo->errorInfo();
} }
@ -369,17 +369,17 @@ function questions_editor($section, $year, $array_name, $self)
echo error(i18n("Invalid question")); echo error(i18n("Invalid question"));
} }
} }
if($showform and headers_sent()) if($showform)
{ {
echo "<table class=\"summarytable\">"; echo "<table class=\"summarytable\">";
echo "<tr><td>".i18n("Question")."</td><td>"; echo "<tr><td>".i18n("Question")."</td><td>";
echo "<input size=\"60\" type=\"text\" name=\"{$array_name}[question]\" value=\"".htmlspecialchars($q['question'])."\">\n"; echo "<input size=\"60\" type=\"text\" name=\"${array_name}[question]\" value=\"".htmlspecialchars($q['question'])."\">\n";
echo "</td></tr>"; echo "</td></tr>";
echo "<tr><td>".i18n("Table Heading")."</td><td>"; echo "<tr><td>".i18n("Table Heading")."</td><td>";
echo "<input size=\"20\" type=\"text\" name=\"{$array_name}[db_heading]\" value=\"".htmlspecialchars($q['db_heading'])."\">\n"; echo "<input size=\"20\" type=\"text\" name=\"${array_name}[db_heading]\" value=\"".htmlspecialchars($q['db_heading'])."\">\n";
echo "</td></tr>"; echo "</td></tr>";
echo "<tr><td>".i18n("Type")."</td><td>"; echo "<tr><td>".i18n("Type")."</td><td>";
echo "<select name=\"{$array_name}[type]\">"; echo "<select name=\"${array_name}[type]\">";
if($q['type']=="check") $sel="selected=\"selected\""; else $sel=""; if($q['type']=="check") $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"check\">".i18n("Check box")."</option>\n"; echo "<option $sel value=\"check\">".i18n("Check box")."</option>\n";
if($q['type']=="yesno") $sel="selected=\"selected\""; else $sel=""; if($q['type']=="yesno") $sel="selected=\"selected\""; else $sel="";
@ -392,7 +392,7 @@ function questions_editor($section, $year, $array_name, $self)
echo "</select>"; echo "</select>";
echo "</td>"; echo "</td>";
echo "<tr><td>".i18n("Required?")."</td><td>"; echo "<tr><td>".i18n("Required?")."</td><td>";
echo "<select name=\"{$array_name}[required]\">"; echo "<select name=\"${array_name}[required]\">";
if($q['required']=="yes") $sel="selected=\"selected\""; else $sel=""; if($q['required']=="yes") $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"yes\">".i18n("Yes")."</option>\n"; echo "<option $sel value=\"yes\">".i18n("Yes")."</option>\n";
if($q['required']=="no") $sel="selected=\"selected\""; else $sel=""; if($q['required']=="no") $sel="selected=\"selected\""; else $sel="";

View File

@ -56,11 +56,9 @@ echo $pdo->errorInfo();
$authinfo=$q->fetch(PDO::FETCH_OBJ); $authinfo=$q->fetch(PDO::FETCH_OBJ);
?> ?>
<!DOCTYPE html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head> <head><title><?=i18n("Division Selector")?></title>
<meta charset="utf-8" />
<title><?=i18n("Division Selector")?></title>
<link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/sfiab.css" type="text/css" /> <link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/sfiab.css" type="text/css" />
</head>testi-bg.jpg </head>testi-bg.jpg
<body> <body>

View File

@ -27,13 +27,13 @@
send_header("Winners"); send_header("Winners");
if(get_value_from_array($_GET, 'edit')) $edit=$_GET['edit']; if($_GET['edit']) $edit=$_GET['edit'];
if(get_value_from_array($_POST, 'edit')) $edit=$_POST['edit']; if($_POST['edit']) $edit=$_POST['edit'];
if(get_value_from_array($_GET, 'action')) $action=$_GET['action']; if($_GET['action']) $action=$_GET['action'];
if(get_value_from_array($_POST, 'action')) $action=$_POST['action']; if($_POST['action']) $action=$_POST['action'];
if(get_value_from_array($_GET, 'year') && get_value_from_array($_GET, 'type')) { if($_GET['year'] && $_GET['type']) {
$show_unawarded_awards="no"; $show_unawarded_awards="no";
$show_unawarded_prizes="no"; $show_unawarded_prizes="no";
$year=intval($_GET['year']); $year=intval($_GET['year']);