forked from science-ation/science-ation
Rebranding and SQL fixes
This commit is contained in:
parent
274e6ebda1
commit
2b687ebc2b
@ -36,7 +36,7 @@ switch (get_value_from_array($_GET, 'action')) {
|
||||
$q->execute([$fairs_id]);
|
||||
$fair = $q->fetch(PDO::FETCH_ASSOC);
|
||||
if (!($fair['username'] && $fair['password'])) {
|
||||
echo error(i18n("Username and Password are not set for source '%1'. Please set them in the SFIAB Configuration/External Award Sources editor first", array($r->name)));
|
||||
echo error(i18n("Username and Password are not set for source '%1'. Please set them in the Science-ation Configuration/External Award Sources editor first", array($r->name)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ function actionSubmit()
|
||||
// Edit
|
||||
var id = document.forms.memberaction.users_uid.options[document.forms.memberaction.users_uid.selectedIndex];
|
||||
openeditor(id.value);
|
||||
// alert("id="+id.value);
|
||||
alert("id="+id.value);
|
||||
return false;
|
||||
}
|
||||
if(document.forms.memberaction.action.selectedIndex==3) //remove
|
||||
@ -123,7 +123,7 @@ function actionSubmit()
|
||||
//-->
|
||||
</script>
|
||||
<?
|
||||
global $uid;
|
||||
|
||||
if (get_value_from_array($_POST, 'addcommittee')) {
|
||||
// add a new committee
|
||||
// re-order the committees
|
||||
|
@ -69,7 +69,7 @@ case 'dialog_choose':
|
||||
<select id="comm_dialog_choose_emails_id">
|
||||
<option value="-1">-- <?= i18n('Choose a Communication') ?> --</option>
|
||||
<?
|
||||
$type = $pdo->quote($_GET['type']);
|
||||
$type = $_GET['type'];
|
||||
$q = $pdo->prepare('SELECT * FROM emails WHERE type=?');
|
||||
$q->execute([$type]);
|
||||
while ($e = $q->fetch(PDO::FETCH_ASSOC)) {
|
||||
@ -161,15 +161,15 @@ case 'email_save':
|
||||
$subject = iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $subject);
|
||||
|
||||
// Now its safe to escape it for the db query
|
||||
$name = $pdo->quote(stripslashes($name));
|
||||
$description = $pdo->quote(stripslashes($description));
|
||||
$from = $pdo->quote(stripslashes($from));
|
||||
$subject = $pdo->quote(stripslashes($subject));
|
||||
$bodyhtml = $pdo->quote(stripslashes($bodyhtml));
|
||||
$name = stripslashes($name);
|
||||
$description = stripslashes($description);
|
||||
$from = stripslashes($from);
|
||||
$subject = stripslashes($subject);
|
||||
$bodyhtml = stripslashes($bodyhtml);
|
||||
|
||||
$type = $pdo->quote($_POST['type']);
|
||||
$key = $pdo->quote($_POST['key']);
|
||||
$fcid = $pdo->quote($_POST['fcid']);
|
||||
$type = $_POST['type'];
|
||||
$key = $_POST['key'];
|
||||
$fcid = $_POST['fcid'];
|
||||
|
||||
if ($id == 0) {
|
||||
if ($key && $name) {
|
||||
@ -969,7 +969,7 @@ if (get_value_from_array($_GET, 'action') == 'send' && get_value_from_array($_GE
|
||||
echo '<a href="communication_send_status.php">Click here to see the sending progress</a>';
|
||||
} else {
|
||||
if (!$config['fairmanageremail'])
|
||||
echo notice(i18n("Warning: The 'Fair Manager Email' has not been set in SFIAB Configuration / Configuration Variables / Global. Please set it. The 'Fair Manager Email' is the default 'From' address for all emails and without a 'From' address, no emails can be sent!"));
|
||||
echo notice(i18n("Warning: The 'Fair Manager Email' has not been set in Science-ation Configuration / Configuration Variables / Global. Please set it. The 'Fair Manager Email' is the default 'From' address for all emails and without a 'From' address, no emails can be sent!"));
|
||||
|
||||
echo '<a href="communication_send_status.php">' . i18n('Email Queue Status and History') . '</a><br />';
|
||||
echo '<a href="#" onclick="return opencommunicationeditor(null,null,null)">' . i18n('Add New Email') . '</a>';
|
||||
|
@ -32,7 +32,6 @@ send_header('Participant Registration',
|
||||
'Administration' => 'admin/index.php'),
|
||||
'participant_registration');
|
||||
echo '<br />';
|
||||
echo '<a href="registration_receivedforms.php">' . i18n("Input Received $plural_participationform") . '</a> <br />';
|
||||
echo '<a href="registration_list.php">' . i18n('Registration List and Student/Project Editor') . '</a> <br />';
|
||||
echo '<a href="registration_stats.php">' . i18n('Registration Statistics') . '</a> <br />';
|
||||
echo '<a href="registration_webconsent.php">' . i18n('Website Consent') . '</a> <br />';
|
||||
|
@ -385,9 +385,9 @@ foreach($report_stock as $n=>$v) {
|
||||
`field`,`value`,`x`, `y`, `w`, `h`,
|
||||
`lines`, `face`, `align`,`valign`,
|
||||
`fontname`,`fontstyle`,`fontsize`,`on_overflow`)
|
||||
VALUES ?");
|
||||
VALUES $q");
|
||||
|
||||
$stmt->execute([$q]);
|
||||
$stmt->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
|
||||
}
|
||||
|
@ -135,6 +135,7 @@ if (array_key_exists('username', $_GET)) {
|
||||
}
|
||||
|
||||
$u = user_load($id);
|
||||
print_r($u);
|
||||
|
||||
$selected = get_value_from_array($_GET, 'tab');
|
||||
if (!array_key_exists($selected, $tabs)) {
|
||||
|
@ -31,7 +31,7 @@ include_once ('helper.inc.php');
|
||||
// so we will set it in the code instead just to make sure
|
||||
error_reporting(E_ALL);
|
||||
ini_set('log_errors', 'On');
|
||||
ini_set('display_errors', 'Off');
|
||||
//ini_set('display_errors', 'Off');
|
||||
// error_reporting( E_ALL ^ E_WARNING );
|
||||
//error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE ^ E_DEPRECATED);
|
||||
|
||||
@ -672,7 +672,6 @@ function send_popup_header($title = '')
|
||||
else
|
||||
$HEADER_SENT = true;
|
||||
|
||||
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n";
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@ -1215,7 +1214,7 @@ function committee_warnings()
|
||||
|
||||
// FIXME Clear out Important Dates as part of rollover
|
||||
if ($r->rollovercheck) {
|
||||
echo error(i18n("It has been more than 4 months since your fair. In order to prepare the system for the next year's fair, you should go to the SFIAB Configuration page, and click on 'Rollover Fair Year'. Do not start updating the system with new information until the year has been properly rolled over."));
|
||||
echo error(i18n("It has been more than 4 months since your fair. In order to prepare the system for the next year's fair, you should go to the Science-ation Configuration page, and click on 'Rollover Fair Year'. Do not start updating the system with new information until the year has been properly rolled over."));
|
||||
}
|
||||
|
||||
$q = $pdo->prepare('SELECT * FROM award_prizes WHERE `external_identifier` IS NOT NULL
|
||||
|
@ -34,7 +34,7 @@ require ('../tableeditor.class.php');
|
||||
user_auth_required('committee', 'config');
|
||||
send_header('External Award Sources Manager',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'external_award_sources');
|
||||
|
||||
$editor = new TableEditor('award_sources',
|
||||
|
@ -87,7 +87,7 @@ if (get_value_from_array($_GET, 'action') == 'backup') {
|
||||
} 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'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'backup_restore');
|
||||
echo i18n('Processing file: %1', array($_FILES['restore']['name'])) . "<br />\n";
|
||||
echo "<br />\n";
|
||||
@ -164,7 +164,7 @@ if (get_value_from_array($_GET, 'action') == 'backup') {
|
||||
} 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'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'backup_restore');
|
||||
|
||||
// make sure the filename's good before we used it
|
||||
@ -248,7 +248,7 @@ if (get_value_from_array($_GET, 'action') == 'backup') {
|
||||
|
||||
echo send_header('Database Backup/Restore',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'backup_restore');
|
||||
|
||||
$stmt = $pdo->prepare('OPTIMIZE TABLE users, users_judge');
|
||||
@ -272,7 +272,7 @@ if (get_value_from_array($_GET, 'action') == 'backup') {
|
||||
|
||||
echo send_header('Database Backup/Restore',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'backup_restore');
|
||||
|
||||
$stmt = $pdo->prepare('OPTIMIZE TABLE users, users_parent');
|
||||
@ -286,7 +286,7 @@ if (get_value_from_array($_GET, 'action') == 'backup') {
|
||||
} else {
|
||||
echo send_header('Database Backup/Restore',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'backup_restore');
|
||||
|
||||
// we try to remove temp files every time we load this page, who knows, maybe they navigated away
|
||||
|
@ -31,12 +31,12 @@ user_auth_required('committee', 'config');
|
||||
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 Category' : 'New Category',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php',
|
||||
'Science-ation Configuration' => 'config/index.php',
|
||||
'Age Categories' => 'config/categories.php'), 'project_age_categories');
|
||||
} else {
|
||||
send_header('Age Categories',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'), 'project_age_categories');
|
||||
'Science-ation Configuration' => 'config/index.php'), 'project_age_categories');
|
||||
}
|
||||
|
||||
if (get_value_from_array($_POST, 'action') == 'edit') {
|
||||
|
@ -29,7 +29,7 @@ require_once ('../helper.inc.php');
|
||||
user_auth_required('committee', 'config');
|
||||
send_header('Dates',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'important_dates');
|
||||
|
||||
$q = $pdo->prepare("SELECT * FROM dates WHERE year='-1'");
|
||||
|
@ -33,13 +33,13 @@ $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',
|
||||
'SFIAB Configuration' => 'config/index.php',
|
||||
'Science-ation Configuration' => 'config/index.php',
|
||||
'Project Divisions' => 'config/divisions.php'),
|
||||
'project_divisions');
|
||||
} else {
|
||||
send_header('Project Divisions',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'project_divisions');
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ require_once ('../helper.inc.php');
|
||||
user_auth_required('committee', 'config');
|
||||
send_header('CWSF Project Divisions',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'cwsf_project_divisions');
|
||||
|
||||
// //// FIX ME!!!!!
|
||||
|
@ -28,7 +28,7 @@ require_once ('../user.inc.php');
|
||||
user_auth_required('committee', 'config');
|
||||
send_header('Fair Logo Image',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'images');
|
||||
|
||||
if (get_value_from_array($_POST, 'action') == 'addimage') {
|
||||
|
@ -29,7 +29,7 @@ require_once ('../user.inc.php');
|
||||
|
||||
user_auth_required('committee', 'config');
|
||||
|
||||
send_header('SFIAB Configuration',
|
||||
send_header('Science-ation Configuration',
|
||||
array('Committee Main' => 'committee_main.php'),
|
||||
'configuration');
|
||||
|
||||
|
@ -29,7 +29,7 @@ require_once ('../user.inc.php');
|
||||
user_auth_required('committee', 'config');
|
||||
send_header('Judge Registration Questions',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'judge_registration_questions');
|
||||
|
||||
questions_editor('judgereg', $config['FAIRYEAR'], 'question',
|
||||
|
@ -28,7 +28,7 @@ require_once ('../user.inc.php');
|
||||
user_auth_required('committee', 'config');
|
||||
send_header('Language Packs',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'language_pack_installer');
|
||||
|
||||
echo i18n("Checking for language packs will access a remote server, if you wish to continue click the 'Check for available language packs' link below");
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
send_header("Page Texts",
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php')
|
||||
'Science-ation Configuration' => 'config/index.php')
|
||||
,"page_texts"
|
||||
);
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
{
|
||||
foreach($config['languages'] AS $lang=>$langname) {
|
||||
$q_current = $pdo->prepare("SELECT * FROM pagetext WHERE year=? and textname=?");
|
||||
$q_current->execute([$pdo->quote($config['FAIRYEAR']),$pdo->quote($r->textname)]);
|
||||
$q_current->execute([$config['FAIRYEAR'],$r->textname]);
|
||||
|
||||
if ($q_current->rowCount() == 0) {
|
||||
$q1 = $pdo->prepare("INSERT INTO pagetext (`textname`,`textdescription`,`text`,`year`,`lang`) VALUES (
|
||||
@ -54,8 +54,8 @@
|
||||
?,
|
||||
?)");
|
||||
|
||||
$q1->execute([$pdo->quote($r->textname),$pdo->quote($r->textdescription),$pdo->quote($r->text),
|
||||
$pdo->quote($config['FAIRYEAR']),$pdo->quote($lang)]);
|
||||
$q1->execute([$r->textname,$r->textdescription,$r->text,
|
||||
$config['FAIRYEAR'],$lang]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -65,7 +65,7 @@
|
||||
{
|
||||
foreach($config['languages'] AS $lang=>$langname) {
|
||||
$textvar="text_$lang";
|
||||
$text=$pdo->quote(stripslashes($_POST[$textvar]));
|
||||
$text=stripslashes($_POST[$textvar]);
|
||||
|
||||
$stmt = $pdo->prepare("UPDATE pagetext
|
||||
SET
|
||||
@ -75,7 +75,7 @@
|
||||
textname=?
|
||||
AND year=?
|
||||
AND lang=?");
|
||||
$stmt->execute([$text,$pdo->quote($_POST['textname']),$config['FAIRYEAR'],$lang]);
|
||||
$stmt->execute([$text,$_POST['textname'],$config['FAIRYEAR'],$lang]);
|
||||
}
|
||||
echo happy(i18n("Page texts successfully saved"));
|
||||
|
||||
@ -101,7 +101,7 @@
|
||||
if(!$r)
|
||||
{
|
||||
$stmt = $pdo->prepare("INSERT INTO pagetext (textname,year,lang) VALUES (?,?,?)");
|
||||
$stmt->execute([$pdo->quote($_GET['textname']),$config['FAIRYEAR'],$lang]);
|
||||
$stmt->execute([$_GET['textname'],$config['FAIRYEAR'],$lang]);
|
||||
show_pdo_errors_if_any($pdo);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ require_once ('../config_editor.inc.php');
|
||||
user_auth_required('committee', 'config');
|
||||
send_header('Year Rollover',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'rollover_fair_year');
|
||||
?>
|
||||
|
||||
|
@ -28,7 +28,7 @@ if (array_key_exists('action', $_POST)) {
|
||||
|
||||
send_header('Fiscal Year Rollover',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'rollover_fiscal_year');
|
||||
draw_body();
|
||||
send_footer();
|
||||
|
@ -28,7 +28,7 @@ require_once ('../user.inc.php');
|
||||
user_auth_required('committee', 'config');
|
||||
send_header('Safety Questions',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'project_safety_questions');
|
||||
if (get_value_from_array($_POST, 'action') == 'save' && get_value_from_array($_POST, 'save')) {
|
||||
if ($_POST['question']) {
|
||||
|
@ -29,7 +29,7 @@ require_once ('../user.inc.php');
|
||||
user_auth_required('committee', 'config');
|
||||
send_header("$participationform",
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'exhibitor_signature_page');
|
||||
|
||||
if (get_value_from_array($_POST, 'action') == 'save') {
|
||||
|
@ -29,13 +29,13 @@ user_auth_required('committee', 'config');
|
||||
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 Sub-Division' : 'New Sub-Division',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php',
|
||||
'Science-ation Configuration' => 'config/index.php',
|
||||
'Project Sub-Divisions' => 'config/subdivisions.php'),
|
||||
'project_sub_divisions');
|
||||
} else {
|
||||
send_header('Project Sub-Divisions',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'project_sub_divisions');
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ if ($action == 'update') {
|
||||
|
||||
send_header('Configuration Variables',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'configuration_variables');
|
||||
|
||||
$q = $pdo->prepare('SELECT DISTINCT(category) AS cat FROM config ORDER BY cat');
|
||||
|
@ -28,7 +28,7 @@ require_once ('../user.inc.php');
|
||||
user_auth_required('committee', 'config');
|
||||
send_header('Version Checker',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php'),
|
||||
'Science-ation Configuration' => 'config/index.php'),
|
||||
'new_version_checker');
|
||||
|
||||
echo i18n("Checking for new versions will access a remote server, if you wish to continue click the 'Check for new versions' link below");
|
||||
|
@ -72,13 +72,13 @@ switch (get_value_from_array($_GET, 'action')) {
|
||||
$enable_awards = ($_POST['enable_awards'] == 'yes') ? 'yes' : 'no';
|
||||
$enable_winners = ($_POST['enable_winners'] == 'yes') ? 'yes' : 'no';
|
||||
|
||||
$q = $pdo->prepare("UPDATE contacts SET name =?, abbrv =?, url =?, website=?,
|
||||
type=? , username=?,
|
||||
password=?,
|
||||
enable_stats=?,
|
||||
enable_awards=?,
|
||||
enable_winners=? WHERE id =?");
|
||||
$q->execute([$name, $abbrv, $url, $website, $type, $username, $password, $enable_stats, $enable_awards, $enable_winners, $age, $email, $id]);
|
||||
$q = $pdo->prepare("UPDATE contacts SET name = $name, abbrv = '$abbrv', url = '$url', website='$website',
|
||||
type='$type' , username='$username',
|
||||
password='$password',
|
||||
enable_stats='$enable_stats',
|
||||
enable_awards='$enable_awards',
|
||||
enable_winners='$enable_winners' WHERE id = $id");
|
||||
$q->execute();
|
||||
|
||||
$u['fairs_id'] = $id;
|
||||
user_save($u);
|
||||
|
@ -20,7 +20,6 @@
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n";
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
@ -20,7 +20,6 @@
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n";
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
@ -20,7 +20,6 @@
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n";
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
@ -272,7 +272,7 @@ if (get_value_from_array($_POST, 'action') == 'login' && (get_value_from_array($
|
||||
} else if ($config['participant_registration_type'] == 'openorinvite') {
|
||||
// thats fine too, continue on and create them the account.
|
||||
} else {
|
||||
echo error(i18n('There is an error with the SFIAB configuration. participant_registration_type is not defined. Contact the fair organizers to get this fixed.'));
|
||||
echo error(i18n('There is an error with the Science-ation Configuration. participant_registration_type is not defined. Contact the fair organizers to get this fixed.'));
|
||||
$allownew = false;
|
||||
$showform = false;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ if (get_value_from_array($_POST, 'action') == 'save') {
|
||||
$safetyids = array_keys($_POST['safety']);
|
||||
foreach ($safetyids AS $key => $val) {
|
||||
$stmt = $pdo->prepare('INSERT INTO safety (registrations_id,safetyquestions_id,year,answer) VALUES (?,?,?,?) ');
|
||||
$stmt->execute([$pdo->quote($_SESSION['registration_id']),$pdo->quote($val),$pdo->quote($config['FAIRYEAR']),$pdo->quote(stripslashes($_POST['safety'][$val]))]);
|
||||
$stmt->execute([$_SESSION['registration_id'], $val, $config['FAIRYEAR'], stripslashes($_POST['safety'][$val])]);
|
||||
show_pdo_errors_if_any($pdo);
|
||||
}
|
||||
}
|
||||
|
@ -104,35 +104,29 @@ if (get_value_from_array($_POST, 'action') == 'save') {
|
||||
}
|
||||
// INSERT new record
|
||||
$dob = $_POST['year'][$x] . '-' . $_POST['month'][$x] . '-' . $_POST['day'][$x];
|
||||
$stmt = $pdo->prepare('INSERT INTO students
|
||||
(registrations_id, firstname, lastname, pronunciation, sex, email, address, city, county, province,
|
||||
postalcode, phone, dateofbirth, grade, schools_id, tshirt, medicalalert, foodreq,
|
||||
teachername, teacheremail, year)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
|
||||
$stmt->execute([
|
||||
$_SESSION['registration_id'],
|
||||
stripslashes($_POST['firstname'][$x]),
|
||||
stripslashes($_POST['lastname'][$x]),
|
||||
stripslashes($_POST['pronunciation'][$x]),
|
||||
stripslashes($_POST['sex'][$x]),
|
||||
stripslashes($_POST['email'][$x]),
|
||||
stripslashes($_POST['address'][$x]),
|
||||
stripslashes($_POST['city'][$x]),
|
||||
stripslashes($_POST['county'][$x]),
|
||||
stripslashes($_POST['province'][$x]),
|
||||
stripslashes($_POST['postalcode'][$x]),
|
||||
stripslashes($_POST['phone'][$x]),
|
||||
$dob,
|
||||
stripslashes($_POST['grade'][$x]),
|
||||
$schoolvalue,
|
||||
stripslashes($_POST['tshirt'][$x]),
|
||||
stripslashes($_POST['medicalalert'][$x]),
|
||||
stripslashes($_POST['foodreq'][$x]),
|
||||
stripslashes($_POST['teachername'][$x]),
|
||||
stripslashes($_POST['teacheremail'][$x]),
|
||||
$config['FAIRYEAR']
|
||||
]);
|
||||
|
||||
$stmt = $pdo->prepare('INSERT INTO students (registrations_id,firstname,lastname,pronunciation,sex,email,address,city,county,province,postalcode,phone,dateofbirth,grade,schools_id,tshirt,medicalalert,foodreq,teachername,teacheremail,year) VALUES ('
|
||||
. "'" . $_SESSION['registration_id'] . "', "
|
||||
. "'" . stripslashes($_POST['firstname'][$x]) . "', "
|
||||
. "'" . stripslashes($_POST['lastname'][$x]) . "', "
|
||||
. "'" . stripslashes($_POST['pronunciation'][$x]) . "', "
|
||||
. "'" . stripslashes($_POST['sex'][$x]) . "', "
|
||||
. "'" . stripslashes($_POST['email'][$x]) . "', "
|
||||
. "'" . stripslashes($_POST['address'][$x]) . "', "
|
||||
. "'" . stripslashes($_POST['city'][$x]) . "', "
|
||||
. "'" . stripslashes($_POST['county'][$x]) . "', "
|
||||
. "'" . stripslashes($_POST['province'][$x]) . "', "
|
||||
. "'" . stripslashes($_POST['postalcode'][$x]) . "', "
|
||||
. "'" . stripslashes($_POST['phone'][$x]) . "', "
|
||||
. "'$dob', "
|
||||
. "'" . stripslashes($_POST['grade'][$x]) . "', "
|
||||
. $schoolvalue
|
||||
. "'" . stripslashes($_POST['tshirt'][$x]) . "', "
|
||||
. "'" . stripslashes($_POST['medicalalert'][$x]) . "', "
|
||||
. "'" . stripslashes($_POST['foodreq'][$x]) . "', "
|
||||
. "'" . stripslashes($_POST['teachername'][$x]) . "', "
|
||||
. "'" . stripslashes($_POST['teacheremail'][$x]) . "', "
|
||||
. "'" . $config['FAIRYEAR'] . "')");
|
||||
$stmt->execute();
|
||||
$students_id = $pdo->lastInsertId();
|
||||
|
||||
echo notice(i18n('%1 %2 successfully added', array($_POST['firstname'][$x], $_POST['lastname'][$x])));
|
||||
@ -146,50 +140,28 @@ if (get_value_from_array($_POST, 'action') == 'save') {
|
||||
|
||||
// UPDATE existing record
|
||||
$dob = $_POST['year'][$x] . '-' . $_POST['month'][$x] . '-' . $_POST['day'][$x];
|
||||
$stmt = $pdo->prepare('UPDATE students SET
|
||||
firstname =?,
|
||||
lastname =?,
|
||||
pronunciation =?,
|
||||
sex =?,
|
||||
email =?,
|
||||
address =?,
|
||||
city =?,
|
||||
county =?,
|
||||
province=?,
|
||||
postalcode =?,
|
||||
phone =?,
|
||||
dateofbirth =?,
|
||||
grade =?,
|
||||
$schoolquery
|
||||
medicalalert =?,
|
||||
foodreq =?,
|
||||
teachername =?,
|
||||
teacheremail =?,
|
||||
tshirt =?
|
||||
WHERE id =?');
|
||||
|
||||
$stmt->execute([
|
||||
stripslashes($_POST['firstname'][$x]),
|
||||
stripslashes($_POST['lastname'][$x]),
|
||||
stripslashes($_POST['pronunciation'][$x]),
|
||||
stripslashes($_POST['sex'][$x]),
|
||||
stripslashes($_POST['email'][$x]),
|
||||
stripslashes($_POST['address'][$x]),
|
||||
stripslashes($_POST['city'][$x]),
|
||||
stripslashes($_POST['county'][$x]),
|
||||
stripslashes($_POST['province'][$x]),
|
||||
stripslashes($_POST['postalcode'][$x]),
|
||||
stripslashes($_POST['phone'][$x]),
|
||||
$dob,
|
||||
stripslashes($_POST['grade'][$x]),
|
||||
stripslashes($_POST['medicalalert'][$x]),
|
||||
stripslashes($_POST['foodreq'][$x]),
|
||||
stripslashes($_POST['teachername'][$x]),
|
||||
stripslashes($_POST['teacheremail'][$x]),
|
||||
stripslashes($_POST['tshirt'][$x]),
|
||||
$students_id
|
||||
]);
|
||||
|
||||
$stmt = $pdo->prepare('UPDATE students SET '
|
||||
. "firstname='" . stripslashes($_POST['firstname'][$x]) . "', "
|
||||
. "lastname='" . stripslashes($_POST['lastname'][$x]) . "', "
|
||||
. "pronunciation='" . stripslashes($_POST['pronunciation'][$x]) . "', "
|
||||
. "sex='" . stripslashes($_POST['sex'][$x]) . "', "
|
||||
. "email='" . stripslashes($_POST['email'][$x]) . "', "
|
||||
. "address='" . stripslashes($_POST['address'][$x]) . "', "
|
||||
. "city='" . stripslashes($_POST['city'][$x]) . "', "
|
||||
. "county='" . stripslashes($_POST['county'][$x]) . "', "
|
||||
. "province='" . stripslashes($_POST['province'][$x]) . "', "
|
||||
. "postalcode='" . stripslashes($_POST['postalcode'][$x]) . "', "
|
||||
. "phone='" . stripslashes($_POST['phone'][$x]) . "', "
|
||||
. "dateofbirth='$dob', "
|
||||
. "grade='" . stripslashes($_POST['grade'][$x]) . "', "
|
||||
. $schoolquery
|
||||
. "medicalalert='" . stripslashes($_POST['medicalalert'][$x]) . "', "
|
||||
. "foodreq='" . stripslashes($_POST['foodreq'][$x]) . "', "
|
||||
. "teachername='" . stripslashes($_POST['teachername'][$x]) . "', "
|
||||
. "teacheremail='" . stripslashes($_POST['teacheremail'][$x]) . "', "
|
||||
. "tshirt='" . stripslashes($_POST['tshirt'][$x]) . "' "
|
||||
. "WHERE id='$students_id'");
|
||||
|
||||
echo notice(i18n('%1 %2 successfully updated', array($_POST['firstname'][$x], $_POST['lastname'][$x])));
|
||||
}
|
||||
/* Update the regfee items link */
|
||||
|
@ -823,8 +823,8 @@ function user_create($type, $username, $u = NULL)
|
||||
* Since the user already has a type, user_save won't create this
|
||||
* entry for us, so do it here
|
||||
*/
|
||||
$stmt = $pdo->prepare('INSERT INTO users_? (users_id) VALUES(?)');
|
||||
$stmt->execute([$type, $uid]);
|
||||
$stmt = $pdo->prepare("INSERT INTO users_$type (users_id) VALUES(?)");
|
||||
$stmt->execute([$uid]);
|
||||
show_pdo_errors_if_any($pdo);
|
||||
/* Load the complete user */
|
||||
$u = user_load($uid);
|
||||
|
@ -87,7 +87,7 @@ $type = $_SESSION['users_type'];
|
||||
|
||||
$u = user_load($eid);
|
||||
|
||||
/* Load the fields the user can edit, and theones that are required */
|
||||
/* Load the fields the user can edit, and the ones that are required */
|
||||
$fields = array();
|
||||
$required = array();
|
||||
$errorfields = array();
|
||||
@ -104,6 +104,7 @@ switch (get_value_from_array($_GET, 'action')) {
|
||||
if ($users_id != $_SESSION['users_id']) {
|
||||
user_auth_required('committee', 'admin');
|
||||
}
|
||||
|
||||
$u = user_load($users_id);
|
||||
|
||||
$save = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user