diff --git a/admin/award_awards.php b/admin/award_awards.php
index 8489dcc7..7b5fca89 100644
--- a/admin/award_awards.php
+++ b/admin/award_awards.php
@@ -1050,8 +1050,8 @@ if(!$orderby) $orderby="order";
$q->execute();
-echo $pdo->errorInfo();
-
+show_do_errros_if_any($pdo);
+print_r($q->rowCount());
if($q->rowCount())
{
echo "* ".i18n("Click on the Script Order and drag to re-order the awards");
diff --git a/common.inc.php b/common.inc.php
index b647df43..a9221286 100644
--- a/common.inc.php
+++ b/common.inc.php
@@ -276,7 +276,7 @@ function i18n($str,$args=array(),$argsdesc=array(),$forcelang="")
{
for($x=1;$x<=count($args);$x++)
{
- $str=str_replace("%$x",$args[$x-1],$str);
+ $str=str_replace("%$x",get_value_from_array($args,$x-1, ''),$str);
}
if($forcelang) $_SESSION['lang']=$savelang;
return $str;
diff --git a/config/backuprestore.php b/config/backuprestore.php
index edbe9394..57b5b031 100644
--- a/config/backuprestore.php
+++ b/config/backuprestore.php
@@ -88,7 +88,7 @@ echo $dump;
}
-else if($_POST['action']=="restore") {
+else if(get_value_from_array($_POST, 'action')=="restore") {
echo send_header("Database Backup/Restore",
array('Committee Main' => 'committee_main.php',
'SFIAB Configuration' => 'config/index.php')
@@ -150,7 +150,7 @@ else if($_POST['action']=="restore") {
send_footer();
}
-else if($_POST['action']=="restoreproceed") {
+else if(get_value_from_array($_POST,'action')=="restoreproceed") {
echo send_header("Database Backup/Restore",
array('Committee Main' => 'committee_main.php',
'SFIAB Configuration' => 'config/index.php')
@@ -207,7 +207,7 @@ else if($_POST['action']=="restoreproceed") {
}
-else if ($_POST['action'] == 'clean_judges') {
+else if (get_value_from_array($_POST, 'action') == 'clean_judges') {
//select all judges
$query = $pdo->prepare('SELECT * FROM users WHERE types LIKE "judge"');
@@ -273,7 +273,7 @@ else if ($_POST['action'] == 'clean_judges') {
error(i18n($str));}
}
-else if ($_POST['action'] == 'clean_parents') {
+else if (get_value_from_array($_POST, 'action') == 'clean_parents') {
$query_parents = $pdo->prepare('SELECT * FROM users WHERE types LIKE "parent" AND year !='.$config['FAIRYEAR']);
$query_parents->execute();
diff --git a/config/categories.php b/config/categories.php
index bdb8b233..456ed586 100644
--- a/config/categories.php
+++ b/config/categories.php
@@ -73,7 +73,7 @@
{
//ues isset($_POST['mingrade']) instead of just $_POST['mingrade'] to allow entering 0 for kindergarden
if(get_value_from_array($_POST, 'id') && $_POST['category'] && isset($_POST['mingrade']) && $_POST['maxgrade'])
- {
+ {
$q=$pdo->prepare("SELECT id FROM projectcategories WHERE id='".$_POST['id']."' AND year='".$config['FAIRYEAR']."'");
$q->execute();
if($q->rowCount())
@@ -81,15 +81,15 @@
echo error(i18n("Category ID %1 already exists",array($_POST['id']),array("category ID")));
}
else
- {
- $pdo->prepare("INSERT INTO projectcategories (id,category,category_shortform,mingrade,maxgrade,year) VALUES ( ".
+ {
+ $stmt = $pdo->prepare("INSERT INTO projectcategories (id,category,category_shortform,mingrade,maxgrade,year) VALUES ( ".
"'".$_POST['id']."', ".
"'".stripslashes($_POST['category'])."', ".
"'".stripslashes($_POST['category_shortform'])."', ".
"'".$_POST['mingrade']."', ".
"'".$_POST['maxgrade']."', ".
"'".$config['FAIRYEAR']."')");
- $pdo->execute();
+ $stmt->execute();
echo happy(i18n("Category successfully added"));
}
@@ -127,6 +127,8 @@
echo "
".i18n("Actions")." | \n";
echo "";
+ $categoryr = null;
+
if(get_value_from_array($_GET, 'action') == "edit" || get_value_from_array($_GET, 'action') == "new")
{
echo "\n";
@@ -145,10 +147,10 @@
echo "";
echo " | ";
- echo " category\"> | ";
- echo " category_shortform\"> | ";
- echo " mingrade\"> | ";
- echo " maxgrade\"> | ";
+ echo " | ";
+ echo " | ";
+ echo " | ";
+ echo " | ";
echo " | ";
echo "
";
}
diff --git a/config/divisions.php b/config/divisions.php
index b2023e09..1ab78031 100644
--- a/config/divisions.php
+++ b/config/divisions.php
@@ -27,6 +27,8 @@
require_once('../helper.inc.php');
user_auth_required('committee', 'config');
+ $divisionr = null;
+
if(get_value_from_array($_GET, 'action') == "edit" || get_value_from_array($_GET,'action') == "new") {
send_header(get_value_from_array($_GET,'action') == "edit" ? "Edit Division" : "New Division",
array('Committee Main' => 'committee_main.php',
@@ -154,6 +156,7 @@ if(get_value_from_array($_GET, 'action') == "edit" || get_value_from_array($_GET
echo "".i18n("Actions")." | \n";
echo "";
+
if(get_value_from_array($_GET, 'action') == "edit" ||get_value_from_array( $_GET,'action') == "new")
{
echo "\n";
@@ -171,9 +174,9 @@ if(get_value_from_array($_GET, 'action') == "edit" || get_value_from_array($_GET
$buttontext="Add";
}
echo "";
- echo " id\" /> | ";
- echo " division\" /> | ";
- echo " division_shortform\" /> | ";
+ echo " | ";
+ echo " | ";
+ echo " | ";
//###### Feature Specific - filtering divisions by category
if($config['filterdivisionbycategory']=="yes"){
diff --git a/config/images.php b/config/images.php
index 272d6ab2..7c851012 100644
--- a/config/images.php
+++ b/config/images.php
@@ -34,7 +34,7 @@ if(get_value_from_array($_POST,'action') == "addimage") {
if($_FILES['image']['error']==UPLOAD_ERR_OK) {
//make sure its a JPEG
$imagesize=getimagesize($_FILES['image']['tmp_name']);
- if($imagesize[2]==1 || $imagesize[2]==2 || $imagesize[2]==3) // GIF or JPG or PNG
+ if(get_value_from_array($imagesize, 2)==1 || get_value_from_array($imagesize, 2)==2 || get_value_from_array($imagesize, 2)==3) // GIF or JPG or PNG
{
/* Here's how to do it with GD, if GD didn't absolutely suck at
diff --git a/config/pagetexts.php b/config/pagetexts.php
index d1dac2ee..bf1c4766 100644
--- a/config/pagetexts.php
+++ b/config/pagetexts.php
@@ -48,6 +48,7 @@
'".$r->text."',
'".$config['FAIRYEAR']."',
'".$lang."')");
+ echo $r->textname;
$q->execute();
}
}
diff --git a/config/versionchecker.php b/config/versionchecker.php
index 2d7bac13..68c43118 100644
--- a/config/versionchecker.php
+++ b/config/versionchecker.php
@@ -57,10 +57,10 @@
if(get_value_from_array($_GET, 'action') == "check")
{
$v=loadVersions();
- echo i18n("Newest version available: %1 (%2)",array($v['version'],$v['date']));
+ echo i18n("Newest version available: %1 (%2)",array(get_value_from_array($v,'version'),get_value_from_array($v, 'date')));
echo "
";
echo "
";
- $val=version_compare($config['version'],$v['version']);
+ $val=version_compare(get_value_from_array($config,'version',''),get_value_from_array($v, 'version', ' '));
if($val==0)
{
echo happy(i18n("Your current version (%1) is up-to-date",array($config['version'])));
@@ -72,7 +72,7 @@
}
else if($val>0)
{
- echo happy(i18n("You are running a newer (probably a development) version (%1) that is newer than the most recent release (%2)",array($config['version'],$v['version'])));
+ echo happy(i18n("You are running a newer (probably a development) version (%1) that is newer than the most recent release (%2)",array(get_value_from_array($config,'version'),get_value_from_array($v,'version'))));
}
}
diff --git a/data/logo-100.png b/data/logo-100.png
index 3141a0a7..ce6964de 100644
Binary files a/data/logo-100.png and b/data/logo-100.png differ
diff --git a/data/logo-200.png b/data/logo-200.png
index 8526b523..d5f97d9d 100644
Binary files a/data/logo-200.png and b/data/logo-200.png differ
diff --git a/data/logo-500.png b/data/logo-500.png
index 8e0d1606..ba72de39 100644
Binary files a/data/logo-500.png and b/data/logo-500.png differ
diff --git a/data/logo.png b/data/logo.png
index 504f5e4b..70665c40 100644
Binary files a/data/logo.png and b/data/logo.png differ
diff --git a/questions.inc.php b/questions.inc.php
index 9abbb7e2..59e207e6 100644
--- a/questions.inc.php
+++ b/questions.inc.php
@@ -31,6 +31,7 @@ function questions_load_answers($section, $users_id)
$yearq->execute();
$yearr=$yearq->fetch(PDO::FETCH_OBJ);
$ans=array();
+
$qs=questions_load_questions($section,$yearr->year);
foreach($qs AS $id=>$question) {
$q=$pdo->prepare("SELECT * FROM question_answers WHERE users_id='$users_id' AND questions_id='$id'");
@@ -180,7 +181,7 @@ function questions_update_question($qs)
}
function questions_save_new_question($qs, $year)
-{
+{ global $pdo;
$stmt = $pdo->prepare("INSERT INTO questions ".
"(question,type,section,db_heading,required,ord,year) VALUES (".
"'".$qs['question']."',".
@@ -347,7 +348,7 @@ function questions_editor($section, $year, $array_name, $self)
if((get_value_from_array($_GET, 'action') == "edit" && get_value_from_array($_GET, 'edit')) || get_value_from_array($_GET, 'action') == "new") {
-
+ $q = null;
$showform=true;
echo "