format code

This commit is contained in:
arman 2025-02-10 19:54:20 +00:00
parent 5d410a023b
commit 996c3d5a0a
221 changed files with 10157 additions and 9007 deletions

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005-2008 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2008-2012 Youth Science Ontario <info@youthscienceontario.ca>
@ -46,9 +46,14 @@ class annealer
var $rate;
var $move_bucket_ids;
function annealer($num_buckets, $start_temp, $start_moves, $rate,
$cost_function_cb, $items)
{
function annealer(
$num_buckets,
$start_temp,
$start_moves,
$rate,
$cost_function_cb,
$items
) {
$this->num_buckets = $num_buckets;
$this->start_temp = $start_temp;
$this->start_moves = $start_moves;
@ -389,12 +394,12 @@ class annealer
function print_bucket($x)
{
$b = $this->bucket[$x];
print ("Bucket $x: (cost: {$this->bucket_cost[$x]})\n");
print (' ');
print("Bucket $x: (cost: {$this->bucket_cost[$x]})\n");
print(' ');
for ($y = 0; $y < count($b); $y++) {
print ("{$b[$y]} ");
print("{$b[$y]} ");
}
print ("\n");
print("\n");
}
function print_buckets()

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,14 +24,18 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
send_header('Create All Divisional Awards',
array('Committee Main' => 'committee_main.php',
send_header(
'Create All Divisional Awards',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Awards Main' => 'admin/awards.php'));
'Awards Main' => 'admin/awards.php'
)
);
if (get_value_from_array($_GET, 'sponsors_id'))
$sponsors_id = $_GET['sponsors_id'];
@ -72,8 +77,8 @@ if ($r->num) {
}
} else {
$divcat = array();
foreach ($dkeys AS $d) {
foreach ($ckeys AS $c) {
foreach ($dkeys as $d) {
foreach ($ckeys as $c) {
$divcat[] = array('c' => $c, 'd' => $d);
}
}
@ -101,7 +106,7 @@ if ($r->num) {
$ord = 1;
echo '<br />';
foreach ($divcat AS $dc) {
foreach ($divcat as $dc) {
$d_id = $dc['d'];
$c_id = $dc['c'];
$d_division = $div[$d_id];
@ -129,7 +134,7 @@ if ($r->num) {
$ord++;
echo '&nbsp;&nbsp;' . i18n('Prizes: ');
foreach ($prizes AS $prize) {
foreach ($prizes as $prize) {
$q = $pdo->prepare("INSERT INTO award_prizes (award_awards_id,cash,scholarship,value,prize,number,`order`,excludefromac,trophystudentkeeper,trophystudentreturn,trophyschoolkeeper,trophyschoolreturn,year) VALUES (
'$award_awards_id',
'{$prize['cash']}',
@ -235,7 +240,7 @@ if ($r->num) {
echo '<b>' . i18n('We will create the following awards with the prizes listed above') . ':</b>';
echo '<br />';
foreach ($divcat AS $dc) {
foreach ($divcat as $dc) {
$d_id = $dc['d'];
$c_id = $dc['c'];
$d_division = $div[$d_id];

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,23 +24,22 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require_once ('awards.inc.php');
require_once('awards.inc.php');
$_GET['action'] = $_GET['action'] ?? '';
switch ($_GET['action']) {
case 'awardinfo_load':
;
case 'awardinfo_load':;
$id = intval(get_value_from_array($_GET, 'id'));
$q = $pdo->prepare("SELECT * FROM award_awards WHERE id='$id'");
$q->execute();
$ret = $q->fetch(PDO::FETCH_ASSOC);
// json_encode NEEDS UTF8 DATA, but we store it in the database as ISO :(
foreach ($ret AS $k => $v) {
foreach ($ret as $k => $v) {
$ret[$k] = iconv('ISO-8859-1', 'UTF-8', $v);
}
// echo iconv("ISO-8859-1","UTF-8",json_encode($ret));
@ -56,6 +56,8 @@ switch ($_GET['action']) {
$id = intval($_POST['id']);
if ($id == -1) {
error_log("INSERT INTO award_awards (year,self_nominate,schedule_judges)
VALUES ('{$config['FAIRYEAR']}','yes','yes')");
$q = $pdo->prepare("INSERT INTO award_awards (year,self_nominate,schedule_judges)
VALUES ('{$config['FAIRYEAR']}','yes','yes')");
$q->execute();
@ -84,6 +86,7 @@ switch ($_GET['action']) {
sponsors_id='" . intval($_POST['sponsors_id']) . "' ";
}
$q .= "WHERE id='$id'";
error_log($q);
$q = $pdo->prepare($q);
$q->execute();
@ -124,7 +127,7 @@ switch ($_GET['action']) {
// wipe out any old award-category links
$q = $pdo->prepare("DELETE FROM award_awards_projectcategories WHERE award_awards_id='$id'");
$q->execute();
foreach ($_POST['categories'] AS $key => $cat) {
foreach ($_POST['categories'] as $key => $cat) {
$c = intval($cat);
$q = $pdo->prepare('INSERT INTO award_awards_projectcategories (award_awards_id, projectcategories_id, year)
VALUES (:id, :c, :year)');
@ -142,7 +145,7 @@ switch ($_GET['action']) {
$q->execute();
// now add the new ones
foreach ($_POST['divisions'] AS $key => $div) {
foreach ($_POST['divisions'] as $key => $div) {
$d = intval($div);
$q = $pdo->prepare('INSERT INTO award_awards_projectdivisions (award_awards_id, projectdivisions_id, year)
@ -195,7 +198,7 @@ switch ($_GET['action']) {
$q->execute();
}
while ($r = $q->fetch(PDO::FETCH_ASSOC)) {
foreach ($r AS $k => $v) {
foreach ($r as $k => $v) {
$r[$k] = iconv('ISO-8859-1', 'UTF-8', $v);
}
$ret[] = $r;
@ -208,7 +211,7 @@ switch ($_GET['action']) {
$q = $pdo->prepare("SELECT * FROM award_prizes WHERE id='$id'");
$q->execute();
$ret = $q->fetch(PDO::FETCH_ASSOC);
foreach ($ret AS $k => $v) {
foreach ($ret as $k => $v) {
$ret[$k] = iconv('ISO-8859-1', 'UTF-8', $v);
}
echo json_encode($ret);
@ -290,10 +293,10 @@ switch ($_GET['action']) {
$q = $pdo->prepare("SELECT * FROM award_awards WHERE id='$id'");
$q->execute();
$a = $q->fetch(PDO::FETCH_ASSOC);
?>
?>
<h4><?= i18n('Feeder Fairs') ?></h4>
<form id="feeder_form">
<input type="hidden" id="feeder_id" name="award_awards_id" value="<?= $a['id'] ?>"/>
<input type="hidden" id="feeder_id" name="award_awards_id" value="<?= $a['id'] ?>" />
<? $ch = $a['per_fair'] == 'yes' ? 'checked="checked"' : ''; ?>
<p><input type="checkbox" name="per_fair" value="yes" <?= $ch ?> />
@ -304,18 +307,25 @@ switch ($_GET['action']) {
<?= i18n('Allow feeder fairs to download this award.') ?></p>
<div id="feeder_en">
<table class="editor">
<tr><td><?= i18n('Unique Name') ?>:</td>
<td><input type="text" name="identifier" value="<?= $a['external_identifier'] ?>" size="40" maxlength="128" /></td></tr>
<tr>
<td><?= i18n('Unique Name') ?>:</td>
<td><input type="text" name="identifier" value="<?= $a['external_identifier'] ?>" size="40" maxlength="128" /></td>
</tr>
<? $ch = $a['external_additional_materials'] ? 'checked="checked"' : ''; ?>
<tr><td><input type="checkbox" name="register_winners" value="1" <?= $ch ?> /></td>
<td><?= i18n('Winners uploaded by a feeder fair should be registered as participants at this fair (both download award and upload winners should be turned on below)') ?></td></tr>
<tr>
<td><input type="checkbox" name="register_winners" value="1" <?= $ch ?> /></td>
<td><?= i18n('Winners uploaded by a feeder fair should be registered as participants at this fair (both download award and upload winners should be turned on below)') ?></td>
</tr>
<? $ch = $a['external_register_winners'] ? 'checked="checked"' : ''; ?>
<tr><td><input type="checkbox" name="additional_materials" value="1" <?= $ch ?> /></td>
<td><?= i18n('There is additional material for this award (e.g. forms, instructions). If a feeder fair assigns a winner to this award, they will be told they need to contact this fair to get the additional material.') ?></td></tr>
<tr>
<td><input type="checkbox" name="additional_materials" value="1" <?= $ch ?> /></td>
<td><?= i18n('There is additional material for this award (e.g. forms, instructions). If a feeder fair assigns a winner to this award, they will be told they need to contact this fair to get the additional material.') ?></td>
</tr>
</table>
<p><?= i18n('Select which feeder fairs can download this award and upload winners.') ?></p>
<table class="tableview">
<tr><th><?= i18n('Fair') ?></th>
<tr>
<th><?= i18n('Fair') ?></th>
<th style="width: 5em"><?= i18n('Download Award') ?></th>
<th style="width: 5em"><?= i18n('Upload Winners') ?></th>
</tr>
@ -337,7 +347,7 @@ switch ($_GET['action']) {
<br />
<button id="feeder_save"><?= i18n('Save') ?></button>
</form>
<?
<?
exit;
case 'feeder_save':
@ -347,9 +357,9 @@ switch ($_GET['action']) {
/* Prepare a fair-wise list */
$data = array();
foreach ($dl AS $fairs_id)
foreach ($dl as $fairs_id)
$data[$fairs_id]['dl'] = true;
foreach ($ul AS $fairs_id)
foreach ($ul as $fairs_id)
$data[$fairs_id]['ul'] = true;
/* Now save each one */
@ -382,27 +392,29 @@ switch ($_GET['action']) {
exit;
}
send_header('Awards Management',
array('Committee Main' => 'committee_main.php',
send_header(
'Awards Management',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Awards Main' => 'admin/awards.php'));
'Awards Main' => 'admin/awards.php'
)
);
?>
<!--<script type="text/javascript" src="../js/jquery.tablednd_0_5.js"></script>-->
<script type="text/javascript">
var award_id = 0;
var award_tab_update = new Array();
var award_id = 0;
var award_tab_update = new Array();
function update_awardinfo()
{
function update_awardinfo() {
if(award_tab_update['awardinfo'] == award_id) return;
if (award_tab_update['awardinfo'] == award_id) return;
award_tab_update['awardinfo'] = award_id;
// alert(award_id);
if(award_id == -1) {
// $("#awardinfo input:text").val('');
// alert(award_id);
if (award_id == -1) {
// $("#awardinfo input:text").val('');
/* New award, set defaults and clear everythign else */
$("#awardinfo_id").val(-1);
$("#awardinfo_name").val("");
@ -422,8 +434,8 @@ function update_awardinfo()
/* Enable all fields */
$("#awardinfo *").removeAttr('disabled');
$.getJSON("<?= $_SERVER['PHP_SELF'] ?>?action=awardinfo_load&id="+award_id,
function(json){
$.getJSON("<?= $_SERVER['PHP_SELF'] ?>?action=awardinfo_load&id=" + award_id,
function(json) {
$("#awardinfo_id").val(json.id);
$("#awardinfo_name").val(json.name);
$("#awardinfo_award_source_fairs_id").val(json.award_source_fairs_id);
@ -440,7 +452,7 @@ function update_awardinfo()
/* Disable fields we don't want the user to edit
* for downloaded awards */
if (json.award_source_fairs_id>0) {
if (json.award_source_fairs_id > 0) {
$("#awardinfo_name").attr('disabled', 'disabled');
$("#awardinfo_sponsors_id").attr('disabled', 'disabled');
$("#awardinfo_criteria").attr('disabled', 'disabled');
@ -456,91 +468,85 @@ function update_awardinfo()
}
});
}
}
function awardinfo_save()
{
function awardinfo_save() {
var reload = (award_id == -1) ? true : false;
/* This is sneaky, we're going to make the awardinfo_save possibly emit
* javascript to set a new award_id, so it will ALWAYS be correct
* after the .load finishes */
$("#debug").load("<? $_SERVER['PHP_SELF'] ?>?action=awardinfo_save", $("#awardinfo").serializeArray(),
function(responseText, textStatus, XMLHttpRequest)
{
function(responseText, textStatus, XMLHttpRequest) {
/* At this point, award_id has been updated by the load */
/* We want to do this AFTER the load completes.
* Somehow, the value of reload properly makes
* it into this function */
if(reload) {
if (reload) {
$("#popup_editor").dialog('close');
popup_editor(award_id, '');
}
});
return false;
}
}
function update_eligibility()
{
if(award_tab_update['eligibility'] == award_id) return;
function update_eligibility() {
if (award_tab_update['eligibility'] == award_id) return;
award_tab_update['eligibility'] = award_id;
$.getJSON("<?= $_SERVER['PHP_SELF'] ?>?action=eligibility_load&id="+award_id,
function(json){
$.getJSON("<?= $_SERVER['PHP_SELF'] ?>?action=eligibility_load&id=" + award_id,
function(json) {
$("[name=categories\\[\\]]").val(json.categories);
$("[name=divisions\\[\\]]").val(json.divisions);
});
}
}
function prizelist_refresh()
{
function prizelist_refresh() {
//FIXME Table DnD remove CANNOT reorder prizes now or open to edit, create new award not working either (test the rest of the software)
$("#prizelist").tableDnD({
onDrop: function(table, row) {
var order = $.tableDnD.serialize();
$("#prizeinfo_info").load("<?= $_SERVER['PHP_SELF'] ?>?action=prize_order&"+order);
$("#prizeinfo_info").load("<?= $_SERVER['PHP_SELF'] ?>?action=prize_order&" + order);
/* Change the order */
var rows = table.tBodies[0].rows;
for (var i=0; i<rows.length; i++) {
$("#prizelist_order_"+rows[i].id).html(i);
for (var i = 0; i < rows.length; i++) {
$("#prizelist_order_" + rows[i].id).html(i);
}
},
dragHandle: "drag_handle"
});
}
}
function update_prizeinfo()
{
function update_prizeinfo() {
/* We can't do this filtering here, sometimes we need to fiorce
* a prizeinfo reload */
// if(award_tab_update['prizeinfo'] == award_id) return;
// award_tab_update['prizeinfo'] = award_id;
// if(award_tab_update['prizeinfo'] == award_id) return;
// award_tab_update['prizeinfo'] = award_id;
/* This also works for the prize template, id=-1 */
$.getJSON("<?= $_SERVER['PHP_SELF'] ?>?action=prizeinfo_load&id="+award_id,
$.getJSON("<?= $_SERVER['PHP_SELF'] ?>?action=prizeinfo_load&id=" + award_id,
function(json) {
$(".prizelist_tr").remove();
for( var i in json ) {
for (var i in json) {
var p = json[i];
var oc = " onclick=\"edit_prize("+p.id+");\" ";
$("#prizelist").append("<tr class=\"prizelist_tr\" id=\""+p.id+"\"><td class=\"drag_handle\" style=\"cursor:move; text-align:center;\" id=\"prizelist_order_"+p.id+"\">"+p.order+"</td>"+
"<td style=\"cursor:pointer; text-align:center;\" "+oc+" >"+p.number+"</td>"+
"<td style=\"cursor:pointer;\" "+oc+" >"+p.prize+"</td>"+
"<td style=\"cursor:pointer; width:4em; text-align:right; padding-left:2em; padding-right:2em;\" "+oc+">"+p.cash+"</td>"+
"<td style=\"cursor:pointer; width:4em; text-align:right; padding-left:2em; padding-right:2em;\" "+oc+">"+p.scholarship+"</td>"+
"<td style=\"cursor:pointer; width:4em; text-align:right; padding-left:2em; padding-right:2em;\" "+oc+">"+p.value+"</td>"+
"<td style=\"text-align:center;\">"+
" <a onclick=\"edit_prize("+p.id+");\" href=\"#\"><img border=\"0\" src=\"<?= $config['SFIABDIRECTORY'] ?>/images/16/edit.<?= $config['icon_extension'] ?>\"></a>&nbsp;"+
"<a onclick=\"prize_delete("+p.id+");\" href=\"#\" ><img border=0 src=\"<?= $config['SFIABDIRECTORY'] ?>/images/16/button_cancel.<?= $config['icon_extension'] ?>\"></a>"+
var oc = " onclick=\"edit_prize(" + p.id + ");\" ";
$("#prizelist").append("<tr class=\"prizelist_tr\" id=\"" + p.id + "\"><td class=\"drag_handle\" style=\"cursor:move; text-align:center;\" id=\"prizelist_order_" + p.id + "\">" + p.order + "</td>" +
"<td style=\"cursor:pointer; text-align:center;\" " + oc + " >" + p.number + "</td>" +
"<td style=\"cursor:pointer;\" " + oc + " >" + p.prize + "</td>" +
"<td style=\"cursor:pointer; width:4em; text-align:right; padding-left:2em; padding-right:2em;\" " + oc + ">" + p.cash + "</td>" +
"<td style=\"cursor:pointer; width:4em; text-align:right; padding-left:2em; padding-right:2em;\" " + oc + ">" + p.scholarship + "</td>" +
"<td style=\"cursor:pointer; width:4em; text-align:right; padding-left:2em; padding-right:2em;\" " + oc + ">" + p.value + "</td>" +
"<td style=\"text-align:center;\">" +
" <a onclick=\"edit_prize(" + p.id + ");\" href=\"#\"><img border=\"0\" src=\"<?= $config['SFIABDIRECTORY'] ?>/images/16/edit.<?= $config['icon_extension'] ?>\"></a>&nbsp;" +
"<a onclick=\"prize_delete(" + p.id + ");\" href=\"#\" ><img border=0 src=\"<?= $config['SFIABDIRECTORY'] ?>/images/16/button_cancel.<?= $config['icon_extension'] ?>\"></a>" +
"</td></tr>");
}
prizelist_refresh();
});
}
}
function edit_prize(id)
{
$.getJSON("<?= $_SERVER['PHP_SELF'] ?>?action=prize_load&id="+id,
function(json){
function edit_prize(id) {
$.getJSON("<?= $_SERVER['PHP_SELF'] ?>?action=prize_load&id=" + id,
function(json) {
$("#prizeinfo_edit_header").html("<?= i18n('Edit Prize') ?>");
$("#prizeinfo_id").val(json.id);
$("#prizeinfo_prize").val(json.prize);
@ -556,44 +562,38 @@ function edit_prize(id)
$(".prizeinfo").removeAttr("disabled");
$("#prizeinfo_save").removeAttr("disabled");
});
}
}
function eligibility_save()
{
function eligibility_save() {
$("#eligibility_award_awards_id").val(award_id);
$("#debug").load("<? $_SERVER['PHP_SELF'] ?>?action=eligibility_save", $("#eligibility").serializeArray());
return false;
}
}
function prize_save()
{
function prize_save() {
$("#debug").load("<? $_SERVER['PHP_SELF'] ?>?action=prize_save", $("#prizeinfo").serializeArray(),
function(responseText, textStatus, XMLHttpRequest)
{
function(responseText, textStatus, XMLHttpRequest) {
update_prizeinfo();
});
return false;
}
}
function prize_delete(id)
{
function prize_delete(id) {
var confirm = confirmClick('Are you sure you want to delete this prize?');
if(confirm == true) {
$("#prizeinfo_info").load("<? $_SERVER['PHP_SELF'] ?>?action=prize_delete&id="+id,null,
function(responseText, textStatus, XMLHttpRequest)
{
$(".prizelist_tr#"+id).fadeTo('slow', 0);
$(".prizelist_tr#"+id).remove();
if (confirm == true) {
$("#prizeinfo_info").load("<? $_SERVER['PHP_SELF'] ?>?action=prize_delete&id=" + id, null,
function(responseText, textStatus, XMLHttpRequest) {
$(".prizelist_tr#" + id).fadeTo('slow', 0);
$(".prizelist_tr#" + id).remove();
prizelist_refresh();
});
}
return 0;
}
}
function prize_create()
{
$.getJSON("<?= $_SERVER['PHP_SELF'] ?>?action=prize_create&award_awards_id="+award_id,
function(json){
function prize_create() {
$.getJSON("<?= $_SERVER['PHP_SELF'] ?>?action=prize_create&award_awards_id=" + award_id,
function(json) {
$(".prizeinfo").val("");
$("#prizeinfo_id").val(json.id);
$("#prizeinfo_edit_header").html("<?= i18n('New Prize') ?>");
@ -601,14 +601,13 @@ function prize_create()
$("#prizeinfo_save").removeAttr("disabled");
update_prizeinfo();
});
}
}
function update_feeder()
{
if(award_tab_update['feeder'] == award_id) return;
function update_feeder() {
if (award_tab_update['feeder'] == award_id) return;
award_tab_update['feeder'] = award_id;
$("#editor_tab_feeder").load("<?= $_SERVER['PHP_SELF'] ?>?action=feeder_load&id="+award_id, '',
$("#editor_tab_feeder").load("<?= $_SERVER['PHP_SELF'] ?>?action=feeder_load&id=" + award_id, '',
function(responseText, textStatus, XMLHttpRequest) {
/* Register buttons and handlers */
$("#feeder_enable").change(function() {
@ -621,30 +620,31 @@ function update_feeder()
update_feeder_enable();
});
}
}
function update_feeder_enable()
{
function update_feeder_enable() {
var checked = $('#feeder_enable:checkbox').is(':checked');
if(checked==true) {
if (checked == true) {
$('#feeder_en *').removeAttr('disabled');
} else {
$("#feeder_en *").attr('disabled', 'disabled');
$('#feeder_enable').removeAttr('disabled');
}
}
}
/* Setup the popup window */
$(document).ready(function() {
/* Setup the popup window */
$(document).ready(function() {
$("#popup_editor").dialog({
bgiframe: true, autoOpen: false,
modal: true, resizable: false,
bgiframe: true,
autoOpen: false,
modal: true,
resizable: false,
draggable: false,
create: function() {
var $tabs = $('#editor_tabs').tabs();
var selected = $tabs.tabs('option', 'selected');
if(award_id == -1 && selected== 0) {
if (award_id == -1 && selected == 0) {
notice_("<?= i18n('New Award Cancelled') ?>");
}
}
@ -657,7 +657,7 @@ $(document).ready(function() {
update_prizeinfo();
update_feeder();
},
activate: function( event, ui ) {
activate: function(event, ui) {
update_awardinfo();
update_eligibility();
update_prizeinfo();
@ -687,24 +687,24 @@ $(document).ready(function() {
// collapsible: true,
// selected: -1 /* None selected */
// });
})
</script>
})
</script>
<?
/* Begin popup */
?>
<div id="popup_editor" title="Award Editor" style="display: none">
<div id="popup_status"></div>
<div id="editor_tabs">
<ul><li><a href="#editor_tab_awardinfo"><span><?= i18n('Award Info') ?></span></a></li>
<div id="popup_status"></div>
<div id="editor_tabs">
<ul>
<li><a href="#editor_tab_awardinfo"><span><?= i18n('Award Info') ?></span></a></li>
<li><a href="#editor_tab_eligibility"><span><?= i18n('Eligibility') ?></span></a></li>
<li><a href="#editor_tab_prizes"><span><?= i18n('Prizes') ?></span></a></li>
<li><a href="#editor_tab_feeder"><span><?= i18n('Feeder Fairs') ?></span></a></li>
</ul>
</ul>
<div id="editor_tab_awardinfo">
<div id="editor_tab_awardinfo">
<h4><?= i18n('Award Info') ?></h4>
<form>
<? /*
@ -717,110 +717,136 @@ $(document).ready(function() {
<form id="awardinfo">
<input type="hidden" name="id" id="awardinfo_id" value="0" />
<table class="editor">
<tr><td><?= i18n('Name') ?>:</td>
<tr>
<td><?= i18n('Name') ?>:</td>
<td><input class="translatable" type="text" id="awardinfo_name" name="name" value="Loading..." size="50" maxlength="128">
</td></tr>
<tr><td><?= i18n('Sponsor') ?>:</td><td>
<?
</td>
</tr>
<tr>
<td><?= i18n('Sponsor') ?>:</td>
<td>
<?
$sq = $pdo->prepare('SELECT id,organization FROM sponsors ORDER BY organization');
$sq->execute();
echo '<select id="awardinfo_sponsors_id" name="sponsors_id">';
echo '<option value="">' . i18n('Choose a sponsor') . "</option>\n";
while ($sr = $sq->fetch(PDO::FETCH_OBJ)) {
$sq = $pdo->prepare('SELECT id,organization FROM sponsors ORDER BY organization');
$sq->execute();
echo '<select id="awardinfo_sponsors_id" name="sponsors_id">';
echo '<option value="">' . i18n('Choose a sponsor') . "</option>\n";
while ($sr = $sq->fetch(PDO::FETCH_OBJ)) {
echo "<option value=\"$sr->id\">" . i18n($sr->organization) . '</option>';
}
?>
</select></td></tr>
<tr><td><?= i18n('Presenter') ?>:</td>
}
?>
</select></td>
</tr>
<tr>
<td><?= i18n('Presenter') ?>:</td>
<td><input type="text" id="awardinfo_presenter" name="presenter" value="Loading..." size="50" maxlength="128" />
</td></tr>
<tr><td><?= i18n('Type') ?>:</td><td>
<?
$tq = $pdo->prepare("SELECT id,type FROM award_types WHERE year='{$config['FAIRYEAR']}' ORDER BY type");
$tq->execute();
echo '<select id="awardinfo_award_types_id" name="award_types_id">';
// only show the "choose a type" option if we are adding,if we are editing, then they must have already chosen one.
echo $firsttype;
while ($tr = $tq->fetch(PDO::FETCH_OBJ)) {
</td>
</tr>
<tr>
<td><?= i18n('Type') ?>:</td>
<td>
<?
$tq = $pdo->prepare("SELECT id,type FROM award_types WHERE year='{$config['FAIRYEAR']}' ORDER BY type");
$tq->execute();
echo '<select id="awardinfo_award_types_id" name="award_types_id">';
// only show the "choose a type" option if we are adding,if we are editing, then they must have already chosen one.
echo $firsttype;
while ($tr = $tq->fetch(PDO::FETCH_OBJ)) {
echo "<option value=\"$tr->id\">" . i18n($tr->type) . '</option>';
}
?>
</select></td></tr>
<tr><td><label><?= i18n('Criteria') ?>:</label></td>
<td><textarea class="translatable" id="awardinfo_criteria" name="criteria" rows="3" cols="50">Loading...</textarea></td></tr>
<tr><td><?= i18n('Description') ?>:</td>
<td><textarea class="translatable" id="awardinfo_description" name="description" rows="3" cols="50">Loading...</textarea></td></tr>
}
?>
</select></td>
</tr>
<tr>
<td><label><?= i18n('Criteria') ?>:</label></td>
<td><textarea class="translatable" id="awardinfo_criteria" name="criteria" rows="3" cols="50">Loading...</textarea></td>
</tr>
<tr>
<td><?= i18n('Description') ?>:</td>
<td><textarea class="translatable" id="awardinfo_description" name="description" rows="3" cols="50">Loading...</textarea></td>
</tr>
</table>
<h4>Options</h4>
<table class="editor">
<tr> <td><input type="checkbox" id="awardinfo_excludefromac" name="excludefromac" value="1"></td>
<tr>
<td><input type="checkbox" id="awardinfo_excludefromac" name="excludefromac" value="1"></td>
<td><?= i18n('Exclude this award from the award ceremony script') ?></td>
</tr><tr>
</tr>
<tr>
<td><input type="checkbox" id="awardinfo_cwsfaward" name="cwsfaward" value="1"></td>
<td><?= i18n('This award identifies the students that will be attending the Canada-Wide Science Fair') ?></td>
</tr><tr>
</tr>
<tr>
<td><input type="checkbox" id="awardinfo_selfnominate" name="self_nominate" value="yes"></td>
<td><?= i18n('Students can self-nominate for this award (this is usually checked for special awards)') ?></td>
</tr><tr>
</tr>
<tr>
<td><input type="checkbox" id="awardinfo_schedulejudges" name="schedule_judges" value="yes"></td>
<td><?= i18n('Allow the Automatic Judge Scheduler to assign judges to this award (usually checked)') ?></td>
</tr></table>
</tr>
</table>
<input type="submit" onClick="awardinfo_save();return false;" value="Save" />
</form>
</div>
</div>
<? /* Next Tab */ ?>
<div id="editor_tab_eligibility">
<? /* Next Tab */ ?>
<div id="editor_tab_eligibility">
<h4><?= i18n('Eligibility') ?></h4>
<br />
<form id="eligibility">
<input type="hidden" id="eligibility_award_awards_id" name="award_awards_id" value="" />
<table class="editor">
<tr><td><?= i18n('Age Categories') ?>:</td><td>
<?
// if(count($currentcategories)==0) $class="class=\"error\""; else $class="";
<tr>
<td><?= i18n('Age Categories') ?>:</td>
<td>
<?
// if(count($currentcategories)==0) $class="class=\"error\""; else $class="";
// now select all the categories so we can list them all
// now select all the categories so we can list them all
$cq = $pdo->prepare('SELECT * FROM projectcategories WHERE year = :year ORDER BY mingrade');
$cq = $pdo->prepare('SELECT * FROM projectcategories WHERE year = :year ORDER BY mingrade');
$cq->bindParam(':year', $config['FAIRYEAR'], PDO::PARAM_INT);
$cq->bindParam(':year', $config['FAIRYEAR'], PDO::PARAM_INT);
$cq->execute();
$cq->execute();
show_pdo_errors_if_any($pdo);
while ($cr = $cq->fetch(PDO::FETCH_OBJ)) {
show_pdo_errors_if_any($pdo);
while ($cr = $cq->fetch(PDO::FETCH_OBJ)) {
echo "<input type=\"checkbox\" id=\"eligibility_categories_{$cr->id}\" name=\"categories[]\" value=\"$cr->id\" />" . i18n($cr->category) . '<br />';
}
?>
</td></tr>
}
?>
</td>
</tr>
<tr><td><?= i18n('Divisions') ?>:</td><td>
<?
<tr>
<td><?= i18n('Divisions') ?>:</td>
<td>
<?
$dq = $pdo->prepare('SELECT * FROM projectdivisions WHERE year = :year ORDER BY division');
$dq = $pdo->prepare('SELECT * FROM projectdivisions WHERE year = :year ORDER BY division');
$dq->bindParam(':year', $config['FAIRYEAR'], PDO::PARAM_INT);
$dq->bindParam(':year', $config['FAIRYEAR'], PDO::PARAM_INT);
$dq->execute();
$dq->execute();
while ($dr = $dq->fetch(PDO::FETCH_OBJ)) {
while ($dr = $dq->fetch(PDO::FETCH_OBJ)) {
echo "<input type=\"checkbox\" id=\"eligibility_divisions_{$dr->id}\" name=\"divisions[]\" value=\"$dr->id\" />" . i18n($dr->division) . '<br />';
}
// if(count($currentcategories)==0 || count($currentdivisions)==0)
// echo "<tr><td colspan=\"2\" class=\"error\">".i18n("At least one age category and one division must be selected")."</td></tr>";
}
// if(count($currentcategories)==0 || count($currentdivisions)==0)
// echo "<tr><td colspan=\"2\" class=\"error\">".i18n("At least one age category and one division must be selected")."</td></tr>";
?>
</td></tr></table>
?>
</td>
</tr>
</table>
<input type="submit" onClick="eligibility_save();return false;" value="Save" />
</form>
</div>
</div>
<? /* Next Tab */ ?>
<? /* Next Tab */ ?>
<div id="editor_tab_prizes">
<div id="editor_tab_prizes">
<h4><?= i18n('Prizes') ?></h4>
<br />
<table id="prizelist" class="tableview">
@ -832,47 +858,59 @@ while ($dr = $dq->fetch(PDO::FETCH_OBJ)) {
<th><?= i18n('Scholarship') ?></th>
<th><?= i18n('Value') ?></th>
<th><?= i18n('Actions') ?></th>
</tr></table>
<br >
</tr>
</table>
<br>
* <?= i18n('Click on the Script Order and drag to re-order the prizes') ?>
<br >
<br>
<hr>
<br /><h4 id="prizeinfo_edit_header">Click on a prize to edit</h4><br />
<br />
<h4 id="prizeinfo_edit_header">Click on a prize to edit</h4><br />
<form id="prizeinfo">
<input type="hidden" id="prizeinfo_id" name="id" value=""/>
<input type="hidden" id="prizeinfo_award_awards_id" name="award_awards_id" value=""/>
<input type="hidden" id="prizeinfo_id" name="id" value="" />
<input type="hidden" id="prizeinfo_award_awards_id" name="award_awards_id" value="" />
<table class="editor">
<tr>
<td><?= i18n('Number available') ?>:</td>
<td><input type="text" id="prizeinfo_number" class="prizeinfo" name="number" value="" size="3" maxlength="5" disabled="disabled" /></td>
</tr><tr>
</tr>
<tr>
<td><?= i18n('Prize Description') ?>:</td>
<td><input type="text" id="prizeinfo_prize" class="prizeinfo translatable" name="prize" value="" size="40" maxlength="128" disabled="disabled"/></td>
</tr><tr>
<td><input type="text" id="prizeinfo_prize" class="prizeinfo translatable" name="prize" value="" size="40" maxlength="128" disabled="disabled" /></td>
</tr>
<tr>
<td><?= i18n('Cash Amount') ?> ($):</td>
<td><input type="text" id="prizeinfo_cash" class="prizeinfo" name="cash" value="" size="10" maxlength="10" disabled="disabled" /></td>
</tr><tr>
</tr>
<tr>
<td><?= i18n('Scholarship Amount') ?> ($):</td>
<td><input type="text" id="prizeinfo_scholarship" class="prizeinfo" name="scholarship" value="" size="10" maxlength="10" disabled="disabled" /></td>
</tr><tr>
</tr>
<tr>
<td><?= i18n('Prize Value') ?> ($):</td>
<td><input type="text" id="prizeinfo_value" class="prizeinfo" name="value" value="" size="10" maxlength="10" disabled="disabled" /></td>
</tr><tr>
</tr>
<tr>
<td><?= i18n('Plaque/Trophy') ?>:</td>
<td>
<table>
<tr> <td style="width:5%;"><input type="checkbox" id="prizeinfo_trophystudentkeeper" class="prizeinfo" name="trophystudentkeeper" value="1" disabled="disabled"></td>
<tr>
<td style="width:5%;"><input type="checkbox" id="prizeinfo_trophystudentkeeper" class="prizeinfo" name="trophystudentkeeper" value="1" disabled="disabled"></td>
<td style="width:45%"><?= i18n('Student(s) keeper trophy') ?></td>
<td style="width:5%;"><input type="checkbox" id="prizeinfo_trophystudentreturn" class="prizeinfo" name="trophystudentreturn" value="1" disabled="disabled"></td>
<td style="width:45%"><?= i18n('Student(s) annual return/reuse trophy') ?></td>
</tr><tr>
</tr>
<tr>
<td style="width:5%;"><input type="checkbox" id="prizeinfo_trophyschoolkeeper" class="prizeinfo" name="trophyschoolkeeper" value="1" disabled="disabled"></td>
<td style="width:45%;"><?= i18n('School keeper trophy') ?></td>
<td style="width:5%;"><input type="checkbox" id="prizeinfo_trophyschoolreturn" class="prizeinfo" name="trophyschoolreturn" value="1" disabled="disabled"></td>
<td style="width:45%;"><?= i18n('School annual return/reuse trophy') ?></td>
</tr></table></td>
</tr><tr>
</tr>
</table>
</td>
</tr>
<tr>
<td><?= i18n('Awards Ceremony') ?>:</td>
<td><input type="checkbox" id="prizeinfo_excludefromac" class="prizeinfo" name="excludefromac" value="1" disabled="disabled"><?= i18n('Exclude this prize from the award ceremony script') ?></td>
</tr>
@ -883,14 +921,15 @@ while ($dr = $dq->fetch(PDO::FETCH_OBJ)) {
<input type="submit" onClick="prize_create();return false;" value="<?= i18n('Create New Prize') ?>" />
<input type="submit" id="prizeinfo_save" onClick="prize_save();return false;" value="<?= i18n('Save Prize') ?>" disabled="disabled" />
</form>
</div>
<? /* Next Tab */ ?>
<div id="editor_tab_feeder"></div>
<? /* End tabs, end popup */ ?>
</div>
</div>
<? /* Next Tab */ ?>
<div id="editor_tab_feeder"></div>
<? /* End tabs, end popup */ ?>
</div></div>
<?
/*
@ -900,9 +939,7 @@ while ($dr = $dq->fetch(PDO::FETCH_OBJ)) {
?>
<script type="text/javascript">
function popup_editor(id, mode)
{
function popup_editor(id, mode) {
var w = (document.documentElement.clientWidth * 0.8);
var h = (document.documentElement.clientHeight * 0.8);
@ -914,13 +951,13 @@ function popup_editor(id, mode)
/* Force no tabs to be selected, need to set collapsible
* to true first */
$('#editor_tabs').tabs('option', 'collapsible', true);
$('#editor_tabs').tabs('option', 'selected', -1);
$('#editor_tabs').tabs('option', 'active', -1);
/* Then we'll select a tab to force a reload */
switch(mode) {
switch (mode) {
case 'new':
$('#editor_tabs').tabs('option', 'disabled', [1, 2, 3]);
$('#editor_tabs').tabs('option','active', 0);
$('#editor_tabs').tabs('option', 'active', 0);
break;
case 'template':
$('#editor_tabs').tabs('option', 'disabled', [0, 1, 3]);
@ -928,7 +965,7 @@ function popup_editor(id, mode)
break;
default:
$('#editor_tabs').tabs('option', 'disabled', []);
$('#editor_tabs').tabs('option','active', 0);
$('#editor_tabs').tabs('option', 'active', 0);
break;
}
/* Don't let anything collapse */
@ -945,52 +982,49 @@ function popup_editor(id, mode)
return true;
}
}
function awardlist_refresh()
{
function awardlist_refresh() {
$("#awardlist").tableDnD({
onDrop: function(table, row) {
var order = $.tableDnD.serialize();
// $(row).fadeTo('fast',1);
$("#award_info").load("<?= $_SERVER['PHP_SELF'] ?>?action=award_order&"+order);
// $(row).fadeTo('fast',1);
$("#award_info").load("<?= $_SERVER['PHP_SELF'] ?>?action=award_order&" + order);
/* Change the order */
var rows = table.tBodies[0].rows;
for (var i=0; i<rows.length; i++) {
$("#awardlist_order_"+rows[i].id).html(i);
for (var i = 0; i < rows.length; i++) {
$("#awardlist_order_" + rows[i].id).html(i);
}
},
onDragStart: function(table, row) {
// $(row).fadeTo('fast',0.2);
// $(row).fadeTo('fast',0.2);
},
dragHandle: "drag_handle"
});
}
}
function award_delete(id)
{
function award_delete(id) {
var conf = confirmClick('<?= i18n('Are you sure you want to remove this award?') ?>');
if(conf == true) {
$("#info_info").load("<? $_SERVER['PHP_SELF'] ?>?action=award_delete&id="+id);
if (conf == true) {
$("#info_info").load("<? $_SERVER['PHP_SELF'] ?>?action=award_delete&id=" + id);
/* The TRs need to have just a numeric ID, which could conflict with other lists, so
* tag each TR with a class too, and select both the class and the ID */
$(".awardlist_tr#"+id).fadeTo('slow', 0);
$(".awardlist_tr#"+id).remove();
$(".awardlist_tr#" + id).fadeTo('slow', 0);
$(".awardlist_tr#" + id).remove();
/* Rows changed, need to refresh the drag list */
awardlist_refresh();
}
}
}
$(document).ready(function() {
$(document).ready(function() {
awardlist_refresh();
});
});
</script>
<div id="info_info"></div>
<div id="info_info"></div>
<?
@ -1079,8 +1113,8 @@ echo '</table>';
?>
<br />
<form>
<input type="button" onClick="popup_editor(-1, 'new');" value="<?= i18n('Create New Award') ?>" />
<input type="button" onClick="popup_editor(-1, 'template');" value="<?= i18n('Edit Generic Prize Template') ?>" />
<input type="button" onClick="popup_editor(-1, 'new');" value="<?= i18n('Create New Award') ?>" />
<input type="button" onClick="popup_editor(-1, 'template');" value="<?= i18n('Edit Generic Prize Template') ?>" />
</form>
<br /><br />
@ -1180,12 +1214,12 @@ echo '<br />';
// echo "<a href=\"award_prizes.php?award_awards_id=-1\">Edit prizes for the generic prize template</a>";
if ($_GET['action'] == 'edit_prize_template') {
?><script type="text/javascript">
?><script type="text/javascript">
$(document).ready(function() {
popup_editor(-1,'template');
popup_editor(-1, 'template');
});
</script>
<?
<?
}
send_footer();

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2007 James Grant <james@lightbox.org>
*
@ -22,11 +22,11 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require_once ('curl.inc.php');
require_once ('awards.inc.php');
require_once('curl.inc.php');
require_once('awards.inc.php');
switch (get_value_from_array($_GET, 'action')) {
case 'check':
@ -192,7 +192,7 @@ switch (get_value_from_array($_GET, 'action')) {
$existingprizes[$pr['prize']] = $pr;
/* Iterate over the downloaded pizes */
foreach ($prizes AS $prize) {
foreach ($prizes as $prize) {
// if it doesn't exist, add it
if (!array_key_exists($prize['prize_en'], $existingprizes)) {
/*
@ -240,7 +240,7 @@ switch (get_value_from_array($_GET, 'action')) {
}
/* Delete local entries that weren't downloaded */
foreach ($existingprizes AS $ep) {
foreach ($existingprizes as $ep) {
echo '&nbsp;' . i18n('Removing prize %1', array($ep['prize'])) . '<br />';
award_prize_delete($ep['id']);
}
@ -248,7 +248,7 @@ switch (get_value_from_array($_GET, 'action')) {
echo '<br />';
// remove any awards that are left in the $existingawards array, they must have been removed from the source
foreach ($existingawards AS $aid => $val) {
foreach ($existingawards as $aid => $val) {
echo i18n('Removing award id %1 that was removed from external source', array($aid)) . '<br />';
award_delete($aid);
}
@ -257,19 +257,21 @@ switch (get_value_from_array($_GET, 'action')) {
exit;
}
send_header('Download Awards',
array('Committee Main' => 'committee_main.php',
send_header(
'Download Awards',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Awards Main' => 'admin/awards.php'));
'Awards Main' => 'admin/awards.php'
)
);
?>
<script type="text/javascript">
function award_download(id)
{
if(id == -1) return false;
$("#award_download_status").load("<?= $_SERVER['PHP_SELF'] ?>?action=check&fairs_id="+id);
}
function award_download(id) {
if (id == -1) return false;
$("#award_download_status").load("<?= $_SERVER['PHP_SELF'] ?>?action=check&fairs_id=" + id);
}
</script>
<?
@ -283,16 +285,19 @@ if (!function_exists('curl_init')) {
}
?>
<table class="tableview"><thead>
<tr><th><?= i18n('Source Name') ?></th>
<th><?= i18n('Source Location URL') ?></th>
<th><?= i18n('Check') ?></th>
</tr></thead>
<?
<table class="tableview">
<thead>
<tr>
<th><?= i18n('Source Name') ?></th>
<th><?= i18n('Source Location URL') ?></th>
<th><?= i18n('Check') ?></th>
</tr>
</thead>
<?
$q = $pdo->prepare("SELECT * FROM fairs WHERE enable_awards='yes' ORDER BY name");
$q->execute();
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
$q = $pdo->prepare("SELECT * FROM fairs WHERE enable_awards='yes' ORDER BY name");
$q->execute();
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
echo '<tr>';
echo "<td>{$r->name}</td>\n";
echo "<td>{$r->url}</td>";
@ -304,16 +309,16 @@ while ($r = $q->fetch(PDO::FETCH_OBJ)) {
echo '</td>';
echo '</tr>';
// $checkurl.="&check[]={$r->id}";
}
}
/*
/*
* if($links)
* echo "<a href=\"award_download.php?action=check$checkurl\">".i18n("Check all sources")."</a>";
*/
?>
</table>
<br />
<div id="award_download_status"></div>
?>
</table>
<br />
<div id="award_download_status"></div>
<?
send_footer();

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2007 James Grant <james@lightbox.org>
*
@ -21,10 +21,10 @@
* Boston, MA 02111-1307, USA.
*/
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once ('../projects.inc.php');
require_once ('curl.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
require_once('../projects.inc.php');
require_once('curl.inc.php');
user_auth_required('committee', 'admin');
// function get_cwsf_award_winners()
@ -33,7 +33,8 @@ function get_winners($awardid, $fairs_id)
global $config, $pdo;
/* Mappings of the name we want => to the column name returned in MYSQL */
$school_fields = array('schoolname' => 'school',
$school_fields = array(
'schoolname' => 'school',
'schoollang' => 'schoollang',
'schoollevel' => 'schoollevel',
'board' => 'board',
@ -44,13 +45,15 @@ function get_winners($awardid, $fairs_id)
'city' => 'city',
'province_code' => 'province_code',
'postalcode' => 'postalcode',
'schoolemail' => 'schoolemail');
'schoolemail' => 'schoolemail'
);
/* 'principal'=>'principal',
'sciencehead'=>'sciencehead',
'scienceheademail'=>'scienceheademail',
'scienceheadphone'=>'scienceheadphone');*/
$student_fields = array('firstname' => 'firstname',
$student_fields = array(
'firstname' => 'firstname',
'lastname' => 'lastname',
'email' => 'email',
'gender' => 'sex',
@ -63,7 +66,8 @@ function get_winners($awardid, $fairs_id)
'postalcode' => 'postalcode',
'phone' => 'phone',
'teachername' => 'teachername',
'teacheremail' => 'teacheremail');
'teacheremail' => 'teacheremail'
);
$awards = array();
if ($awardid == -1) {
@ -100,11 +104,13 @@ function get_winners($awardid, $fairs_id)
$divmap = unserialize($fair['divmap']);
foreach ($awards as $award) {
$winners = array('id' => $award['id'],
$winners = array(
'id' => $award['id'],
'award_name' => $award['name'],
'external_identifier' => $award['external_identifier'],
'year' => $config['FAIRYEAR'],
'prizes' => array());
'prizes' => array()
);
if ($fair['type'] != 'sfiab') {
/* YSC Compatability */
@ -146,8 +152,10 @@ function get_winners($awardid, $fairs_id)
$school[$k] = $schoolr[$v];
/* Pack up the student data too */
$student = array('xml_type' => 'student', /* for ysc compatability */
'school' => $school);
$student = array(
'xml_type' => 'student', /* for ysc compatability */
'school' => $school
);
foreach ($student_fields as $k => $v)
$student[$k] = $s[$v];
@ -158,7 +166,8 @@ function get_winners($awardid, $fairs_id)
$div_id = $divmap[$project['projectdivisions_id']];
/* Save the project info => students */
$prizewinners[] = array('xml_type' => 'project', /* for ysc compatability */
$prizewinners[] = array(
'xml_type' => 'project', /* for ysc compatability */
'projectid' => $project['id'],
'projectnumber' => $project['projectnumber'],
'title' => $project['title'],
@ -167,7 +176,8 @@ function get_winners($awardid, $fairs_id)
'projectcategories_id' => $cat_id,
'projectdivisions_id' => $div_id,
'client_projectdivisions_id' => $project['projectdivisions_id'],
'students' => $students);
'students' => $students
);
}
/* Save the prize info => projects */
$winners['prizes'][$prize['prize']] = array(
@ -243,8 +253,10 @@ function load_server_cats_divs($fairs_id)
$q->execute();
$fair = $q->fetch(PDO::FETCH_ASSOC);
$req = array('get_categories' => array('year' => $config['FAIRYEAR']),
'get_divisions' => array('year' => $config['FAIRYEAR']));
$req = array(
'get_categories' => array('year' => $config['FAIRYEAR']),
'get_divisions' => array('year' => $config['FAIRYEAR'])
);
$data = curl_query($fair, $req);
/* If selected mappings don't exist, try to discover some */
@ -404,8 +416,11 @@ switch (get_value_from_array($_GET, 'action')) {
<input type="hidden" name="fairs_id" value="<?= $fairs_id ?>" />
<table class="editor">
<tr><th><?= i18n('Our Division') ?></th><th><?= i18n('%1 Division', array($fair['abbrv'])) ?></th></tr>
<?
<tr>
<th><?= i18n('Our Division') ?></th>
<th><?= i18n('%1 Division', array($fair['abbrv'])) ?></th>
</tr>
<?
foreach ($divs as $div) {
echo "<tr><td class=\"label\">{$div['division']}&nbsp;=> </td>";
@ -417,11 +432,11 @@ switch (get_value_from_array($_GET, 'action')) {
}
echo '</select></td></tr>';
}
?>
?>
</table>
</form>
<br />
<?
<?
exit;
case 'catdiv_save':
@ -432,7 +447,7 @@ switch (get_value_from_array($_GET, 'action')) {
// $cat[intval($key)] = intval($c);
// }
$div = array();
foreach ($_POST['div'] AS $key => $d) {
foreach ($_POST['div'] as $key => $d) {
$div[intval($key)] = intval($d);
}
@ -493,7 +508,7 @@ switch (get_value_from_array($_GET, 'action')) {
$division_disabled = false;
}
?>
?>
<br /><br />
<button onClick="popup_divmap(<?= $fairs_id ?>);return false;" <?= $division_disabled ? 'disabled="disabled' : '' ?>
title="<?= i18n('Edit Default Division Assignments') ?>"><?= i18n('Edit Default Division Assignments') ?></button>
@ -502,7 +517,7 @@ switch (get_value_from_array($_GET, 'action')) {
<input type="hidden" name="fairs_id" value="<?= $fairs_id ?>" />
<input type="hidden" name="award_awards_id" value="<?= $award_awards_id ?>" />
<table class="tableview">
<?
<?
foreach ($winners as &$w) {
echo '<tr><td style="border: 0px;" colspan="3">';
@ -516,9 +531,10 @@ switch (get_value_from_array($_GET, 'action')) {
continue;
}
foreach ($p['projects'] as &$pr) {
?> <tr><td style="border: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><b><?= $pr['projectnumber'] ?> - <?= $pr['title'] ?></b><br/>
<?
?> <tr>
<td style="border: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><b><?= $pr['projectnumber'] ?> - <?= $pr['title'] ?></b><br />
<?
$highest_grade = 0;
foreach ($pr['students'] as &$s) {
echo i18n('Name') . ': ';
@ -545,18 +561,20 @@ switch (get_value_from_array($_GET, 'action')) {
$server_cat = $c['id'];
}
}
?>
?>
</td>
<td>
<table class="default">
<tr> <td align="right" style="border: 0px;"><?= i18n('Our division') ?>:</td>
<tr>
<td align="right" style="border: 0px;"><?= i18n('Our division') ?>:</td>
<td><b><?= $divs[$pr['client_projectdivisions_id']]['division'] ?></td>
</tr>
<?
<?
if ($division_disabled == false) {
?> <tr> <td align="right"><?= i18n('%1 Division', array($fair['abbrv'])) ?>:</td>
?> <tr>
<td align="right"><?= i18n('%1 Division', array($fair['abbrv'])) ?>:</td>
<td><select name="div[<?= $w['id'] ?>][<?= $p['id'] ?>][<?= $pr['projectid'] ?>]">
<?
<?
$mapto = $divmap[$pr['client_projectdivisions_id']];
foreach ($server_divs as $d) {
$sel = ($mapto == $d['id']) ? 'selected="selected"' : '';
@ -566,48 +584,51 @@ switch (get_value_from_array($_GET, 'action')) {
<input type="hidden" name="cat[<?= $w['id'] ?>][<?= $p['id'] ?>][<?= $pr['projectid'] ?>]" value="<?= $server_cat ?>" />
</td>
</tr>
<tr> <td align="right"><?= i18n('%1 Category', array($fair['abbrv'])) ?>:</td>
<tr>
<td align="right"><?= i18n('%1 Category', array($fair['abbrv'])) ?>:</td>
<td><b><?= $server_cats[$server_cat]['category'] ?> (<?= i18n('Grade') ?> <?= $server_cats[$server_cat]['mingrade'] ?> - <?= $server_cats[$server_cat]['maxgrade'] ?>)</td>
</tr>
<?
<?
}
?> </table>
</td></tr>
<?
?>
</table>
</td>
</tr>
<?
}
}
}
echo '</table></form><br />';
exit;
}
}
send_header('Award Upload',
array('Committee Main' => 'committee_main.php',
send_header(
'Award Upload',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Awards Main' => 'admin/awards.php'));
echo '<br />';
'Awards Main' => 'admin/awards.php'
)
);
echo '<br />';
?>
<script type="text/javascript">
?>
<script type="text/javascript">
var fairs_id = -1;
var award_awards_id = -1;
var fairs_id = -1;
var award_awards_id = -1;
function catdiv_save()
{
function catdiv_save() {
$("#debug").load("<?= $_SERVER['PHP_SELF'] ?>?action=catdiv_save",
$('#catdiv_form').serializeArray());
return false;
}
}
function popup_upload_load()
{
var ids = "&id="+award_awards_id+"&fairs_id="+fairs_id;
$("#popup_upload").load("<?= $_SERVER['PHP_SELF'] ?>?action=load"+ids);
}
function popup_upload_load() {
var ids = "&id=" + award_awards_id + "&fairs_id=" + fairs_id;
$("#popup_upload").load("<?= $_SERVER['PHP_SELF'] ?>?action=load" + ids);
}
function popup_upload(fid,aaid)
{
function popup_upload(fid, aaid) {
var w = (document.documentElement.clientWidth * 0.8);
var h = (document.documentElement.clientHeight * 0.8);
@ -624,15 +645,14 @@ function popup_upload(fid,aaid)
$("#popup_upload").dialog('open');
return true;
}
}
function popup_divmap(fid)
{
function popup_divmap(fid) {
var w = (document.documentElement.clientWidth * 0.4);
var h = (document.documentElement.clientHeight * 0.6);
/* Load dialog content */
$("#popup_divmap").load("<?= $_SERVER['PHP_SELF'] ?>?action=catdiv_load&fairs_id="+fairs_id);
$("#popup_divmap").load("<?= $_SERVER['PHP_SELF'] ?>?action=catdiv_load&fairs_id=" + fairs_id);
/* Show the dialog */
$('#popup_divmap').dialog('option', 'width', w);
@ -640,14 +660,16 @@ function popup_divmap(fid)
$("#popup_divmap").dialog('open');
return true;
}
}
/* Setup the popup window */
$(document).ready(function() {
/* Setup the popup window */
$(document).ready(function() {
$("#popup_upload").dialog({
bgiframe: true, autoOpen: false,
modal: true, resizable: false,
bgiframe: true,
autoOpen: false,
modal: true,
resizable: false,
draggable: false,
buttons: {
"<?= i18n('Cancel') ?>": function() {
@ -663,8 +685,10 @@ $(document).ready(function() {
});
$("#popup_divmap").dialog({
bgiframe: true, autoOpen: false,
modal: true, resizable: false,
bgiframe: true,
autoOpen: false,
modal: true,
resizable: false,
draggable: false,
buttons: {
"<?= i18n('Cancel') ?>": function() {
@ -672,7 +696,8 @@ $(document).ready(function() {
},
"<?= i18n('Save Mappings') ?>": function() {
$("#debug").load("<?= $_SERVER['PHP_SELF'] ?>?action=catdiv_save",
$('#catdiv_form').serializeArray(), function() {
$('#catdiv_form').serializeArray(),
function() {
popup_upload_load();
}
);
@ -681,67 +706,71 @@ $(document).ready(function() {
}
}
});
});
</script>
});
</script>
<div id="popup_upload" title="Upload Award" style="display: none"></div>
<div id="popup_divmap" title="Edit Mappings" style="display: none"></div>
<div id="popup_upload" title="Upload Award" style="display: none"></div>
<div id="popup_divmap" title="Edit Mappings" style="display: none"></div>
<?
<?
if (!function_exists('curl_init')) {
if (!function_exists('curl_init')) {
echo error(i18n('CURL Support Missing'));
echo notice(i18n('Your PHP installation does not support CURL. You will need to have CURL support added by your system administrator before being able to access external award sources'));
send_footer();
exit;
}
}
/* Fairs first */
/* Fairs first */
$q = $pdo->prepare("SELECT fairs.id, fairs.name, fairs.type, COUNT(award_awards.id) as AWARD_COUNT FROM fairs
$q = $pdo->prepare("SELECT fairs.id, fairs.name, fairs.type, COUNT(award_awards.id) as AWARD_COUNT FROM fairs
LEFT JOIN award_awards ON award_awards.award_source_fairs_id=fairs.id
WHERE award_awards.award_source_fairs_id IS NOT NULL
AND award_awards.year='{$config['FAIRYEAR']}'
GROUP BY fairs.id
ORDER BY fairs.name ");
$q->execute();
show_pdo_errors_if_any($pdo);
$q->execute();
show_pdo_errors_if_any($pdo);
?>
<h4><?= i18n('Upload all winners to a source') ?>:</h4>
?>
<h4><?= i18n('Upload all winners to a source') ?>:</h4>
<table class="tableview"><thead>
<tr><th><?= i18n('Source Name') ?></th>
<th><?= i18n('Number of Awards') ?></th>
<th><?= i18n('Winners<br />Assigned') ?></th>
<th><?= i18n('Send All') ?></th>
</tr></thead>
<?
<table class="tableview">
<thead>
<tr>
<th><?= i18n('Source Name') ?></th>
<th><?= i18n('Number of Awards') ?></th>
<th><?= i18n('Winners<br />Assigned') ?></th>
<th><?= i18n('Send All') ?></th>
</tr>
</thead>
<?
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
$count = count_winners(-1, $r->id);
?>
<tr><td><?= $r->name ?></td>
<tr>
<td><?= $r->name ?></td>
<td align="center"><?= $r->AWARD_COUNT ?></td>
<td align="center"><?= $count ?></td>
<td align="center">
<?
<?
if ($r->type == 'sfiab')
echo "<a href=\"#\" onClick=\"popup_upload({$r->id},-1)\" >" . i18n('Send All') . '</a>';
else
echo "Not available yet, we're working on it!";
echo '</td></tr>';
}
?>
</table>
<br />
<br />
}
?>
</table>
<br />
<br />
<?
<?
$q = $pdo->prepare("SELECT award_awards.id, award_awards.name AS awardname,
$q = $pdo->prepare("SELECT award_awards.id, award_awards.name AS awardname,
\t fairs.name as fairname, award_source_fairs_id,
\t fairs.type as fairtype, award_awards.external_additional_materials
FROM award_awards
@ -749,50 +778,55 @@ $q = $pdo->prepare("SELECT award_awards.id, award_awards.name AS awardname,
WHERE award_awards.award_source_fairs_id IS NOT NULL
AND award_awards.year='{$config['FAIRYEAR']}'
ORDER BY fairs.name, award_awards.name");
$q->execute();
show_pdo_errors_if_any($pdo);
$q->execute();
show_pdo_errors_if_any($pdo);
?>
<h4><?= i18n('Upload individual winners to a source') ?>:</h4>
?>
<h4><?= i18n('Upload individual winners to a source') ?>:</h4>
<table class="tableview"><thead>
<tr><th><?= i18n('Award Name') ?></th>
<th><?= i18n('Source Name') ?></th>
<th><?= i18n('Winners<br />Assigned') ?></th>
<th><?= i18n('Send') ?></th>
<th><?= i18n('Additional<br />Info') ?></th>
</tr></thead>
<?
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
<table class="tableview">
<thead>
<tr>
<th><?= i18n('Award Name') ?></th>
<th><?= i18n('Source Name') ?></th>
<th><?= i18n('Winners<br />Assigned') ?></th>
<th><?= i18n('Send') ?></th>
<th><?= i18n('Additional<br />Info') ?></th>
</tr>
</thead>
<?
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
$count = count_winners($r->id, $r->award_source_fairs_id);
?>
<tr><td><?= $r->awardname ?></td>
<tr>
<td><?= $r->awardname ?></td>
<td><?= $r->fairname ?></td>
<td align="center"><?= $count ?></td>
<td align="center">
<?
<?
if ($count > 0)
$onclick = "popup_upload({$r->award_source_fairs_id},{$r->id});return false;";
else
$onclick = "alert('" . i18n('Assign a winner first') . "');return false;";
?>
<a href="#" onClick="<?= $onclick ?>"><?= i18n('send') ?></a>
</td><td>
</td>
<td>
<?
<?
if ($r->external_additional_materials) {
echo "<a href=\"{$_SERVER['PHP_SELF']}?action=additional_materials&award_awards_id={$r->id}\" target=\"_blank\">" . i18n('download') . '</a>';
}
echo '</td></tr>';
}
?>
</table>
<br />
}
?>
</table>
<br />
<div id="award_upload_status"></div>
<div id="award_upload_status"></div>
<?
/* <a href="award_upload.php?action=send<?=$sendurl?>"><?=i18n("Send all awards")?></a> */
send_footer();
?>
<?
/* <a href="award_upload.php?action=send<?=$sendurl?>"><?=i18n("Send all awards")?></a> */
send_footer();
?>

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2010 David Grant <dave@lightbox.org>
*
@ -24,7 +24,8 @@
<?
function award_delete($award_awards_id)
{ global $pdo;
{
global $pdo;
/* Delete all winners attached to this award */
$q = $pdo->prepare("SELECT id FROM award_prizes WHERE award_awards_id='$award_awards_id'");
@ -55,7 +56,8 @@ function award_delete($award_awards_id)
}
function award_prize_delete($award_prizes_id)
{ global $pdo;
{
global $pdo;
$q = $pdo->prepare("DELETE FROM winners WHERE awards_prizes_id='$award_prizes_id'");
$q->execute();

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,16 +24,20 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
send_header('Awards',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'awards_management');
send_header(
'Awards',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
),
'awards_management'
);
require_once ('rerollprizes.php');
require_once('rerollprizes.php');
echo '<br />';
echo '<a href="award_awards.php">' . i18n('Awards Management') . '</a><br />';

View File

@ -2,9 +2,9 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2008 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -22,26 +22,32 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
// make sure storage folder exists
if (!file_exists('../data/userfiles'))
mkdir('../data/userfiles');
send_header('Website Content Manager',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'website_content_management');
send_header(
'Website Content Manager',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
),
'website_content_management'
);
?>
<div class="element"></div>
<script type="module">
import { Editor } from 'https://esm.sh/@tiptap/core'
<script type="module">
import {
Editor
} from 'https://esm.sh/@tiptap/core'
import StarterKit from 'https://esm.sh/@tiptap/starter-kit'
new Editor({
new Editor({
element: document.querySelector('.element'),
extensions: [
StarterKit.configure({
@ -50,13 +56,13 @@ new Editor({
},
}),
],
})
</script>
})
</script>
<?
if (get_value_from_array($_POST, 'action') == 'save') {
$err = false;
foreach ($config['languages'] AS $lang => $langname) {
foreach ($config['languages'] as $lang => $langname) {
$filename = stripslashes(get_value_from_array($_POST, 'filename', ''));
// $filename=ereg_replace("[^A-Za-z0-9\.\_\/]","_",$_POST['filename']);
@ -99,7 +105,7 @@ if (get_value_from_array($_GET, 'filename', '') || get_value_from_array($_GET, '
echo '<table width="100%" cellpadding="3">';
echo '<tr><td valign="top">';
foreach ($config['languages'] AS $lang => $langname) {
foreach ($config['languages'] as $lang => $langname) {
echo '<table class="tableview" width="100%">';
echo '<tr><th colspan="2">';
@ -140,7 +146,7 @@ if (get_value_from_array($_GET, 'filename', '') || get_value_from_array($_GET, '
echo "</td></tr>\n";
echo '<tr><td colspan="2">';
require_once ('../fckeditor/fckeditor.php');
require_once('../fckeditor/fckeditor.php');
$oFCKeditor = new FCKeditor("text_$lang");
$oFCKeditor->BasePath = '../fckeditor/';

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,9 +24,9 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once ('../committee.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
require_once('../committee.inc.php');
user_auth_required('committee', 'admin');
@ -33,94 +34,89 @@ if (get_value_from_array($_POST, 'users_uid'))
$uid = intval($_POST['users_uid']);
/* Now, start the output for this page */
send_header('Committee Management',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'committee_management');
send_header(
'Committee Management',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
),
'committee_management'
);
$_SESSION['last_page'] = 'committee_management';
?>
<script type="text/javascript">
<!--
function openeditor(id)
{
window.open("user_editor_window.php?id="+id,"UserEditor","location=no,menubar=no,directories=no,toolbar=no,width=770,height=500,scrollbars=yes");
<!--
function openeditor(id) {
window.open("user_editor_window.php?id=" + id, "UserEditor", "location=no,menubar=no,directories=no,toolbar=no,width=770,height=500,scrollbars=yes");
return false;
}
}
function neweditor()
{
function neweditor() {
var username = document.forms.addmember.add_member.value;
window.open("user_editor_window.php?type=committee&username="+username,"UserEditor","location=no,menubar=no,directories=no,toolbar=no,width=770,height=500,scrollbars=yes");
window.open("user_editor_window.php?type=committee&username=" + username, "UserEditor", "location=no,menubar=no,directories=no,toolbar=no,width=770,height=500,scrollbars=yes");
document.forms.addmember.add_member.value = "";
return false;
}
}
function getElement(e,f)
{
if(document.layers)
{
f=(f)?f:self;
if(f.document.layers[e]) {
function getElement(e, f) {
if (document.layers) {
f = (f) ? f : self;
if (f.document.layers[e]) {
return f.document.layers[e];
}
for(W=0;i<f.document.layers.length;W++) {
return(getElement(e,fdocument.layers[W]));
for (W = 0; i < f.document.layers.length; W++) {
return (getElement(e, fdocument.layers[W]));
}
}
if(document.all) {
if (document.all) {
return document.all[e];
}
return document.getElementById(e);
}
}
function actionChanged()
{
if(document.forms.memberaction.action.selectedIndex==1) //assign
function actionChanged() {
if (document.forms.memberaction.action.selectedIndex == 1) //assign
{
getElement('assigndiv').style.display = 'block';
}
else // edit or delete
} else // edit or delete
{
getElement('assigndiv').style.display = 'none';
}
}
}
function actionSubmit()
{
if(document.forms.memberaction.action.selectedIndex==0)
{
function actionSubmit() {
if (document.forms.memberaction.action.selectedIndex == 0) {
alert('You must choose an action');
return false;
}
if(document.forms.memberaction.users_uid.selectedIndex==0)
{
if (document.forms.memberaction.users_uid.selectedIndex == 0) {
alert('You must choose a member');
return false;
}
if(document.forms.memberaction.action.selectedIndex == 2) {
if (document.forms.memberaction.action.selectedIndex == 2) {
// 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
if (document.forms.memberaction.action.selectedIndex == 3) //remove
{
return confirmClick('Are you sure you want to completely remove this member?');
}
return true;
}
//-->
}
//
-->
</script>
<?
global $uid;
@ -366,4 +362,3 @@ if ($q->rowCount()) {
send_footer();
?>

View File

@ -175,4 +175,3 @@ $mailqueries = array(
'volunteers_active_incomplete_thisyear' => array('name' => 'Volunteers active for this year but not complete', 'query' =>
"SELECT id, firstname, lastname, email FROM users LEFT JOIN users_volunteer ON users_volunteer.users_id=users.id WHERE users.year='{$config['FAIRYEAR']}' AND users_volunteer.volunteer_complete='no' AND users_volunteer.volunteer_active='yes' AND users.deleted='no' AND users.types LIKE '%volunteer%' ORDER BY email"),
);
?>

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,8 +24,8 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
include 'communication.inc.php';
user_auth_required('committee', 'admin');
@ -49,23 +50,38 @@ switch (get_value_from_array($_GET, 'action')) {
$q = $pdo->prepare("SELECT * FROM emails WHERE id='$emails_id'");
$q->execute();
$e = $q->fetch(PDO::FETCH_ASSOC);
?>
?>
<table class="editor">
<tr><td class="label" style="width:15%"><?= i18n('Name') ?>:</td><td class="input"><?= $e['name'] ?></td></tr>
<tr><td class="label"><?= i18n('Subject') ?>:</td><td class="input"><?= $e['subject'] ?></td></tr>
<tr><td class="label"><?= i18n('From Address') ?>:</td><td class="input"><?= $e['from'] ?></td></tr>
<tr><td></td><td>
<tr>
<td class="label" style="width:15%"><?= i18n('Name') ?>:</td>
<td class="input"><?= $e['name'] ?></td>
</tr>
<tr>
<td class="label"><?= i18n('Subject') ?>:</td>
<td class="input"><?= $e['subject'] ?></td>
</tr>
<tr>
<td class="label"><?= i18n('From Address') ?>:</td>
<td class="input"><?= $e['from'] ?></td>
</tr>
<tr>
<td></td>
<td>
<div style="border:1px solid black; overflow:auto; height=300px;"><?= $e['bodyhtml'] ?></div>
</td></tr></table>
</td>
</tr>
</table>
<?
exit;
case 'dialog_choose':
case 'dialog_choose':
?>
<div id="comm_dialog_choose" title="Select a Communication" style="display: none">
<h4><?= i18n('Select a Communication') ?>:</h4>
<form id="choose" onchange="dialog_choose_change()" onkeypress="dialog_choose_change()" >
<table style="width:100%"><tr><td>
<form id="choose" onchange="dialog_choose_change()" onkeypress="dialog_choose_change()">
<table style="width:100%">
<tr>
<td>
<select id="comm_dialog_choose_emails_id">
<option value="-1">-- <?= i18n('Choose a Communication') ?> --</option>
<?
@ -77,38 +93,40 @@ case 'dialog_choose':
}
?>
</select>
</td><td style="text-align:right">
<input class="comm_dialog_choose_email_button" disabled="disabled" type="submit" value="<?= i18n('Choose') ?>" >
<input class="comm_dialog_choose_cancel_button" type="submit" value="<?= i18n('Cancel') ?>" >
</td></tr></table>
</td>
<td style="text-align:right">
<input class="comm_dialog_choose_email_button" disabled="disabled" type="submit" value="<?= i18n('Choose') ?>">
<input class="comm_dialog_choose_cancel_button" type="submit" value="<?= i18n('Cancel') ?>">
</td>
</tr>
</table>
<hr />
<div id="comm_dialog_choose_info"></div>
<hr />
<input class="comm_dialog_choose_email_button" disabled="disabled" type="submit" value="<?= i18n('Choose') ?>" >
<input class="comm_dialog_choose_cancel_button" type="submit" value="<?= i18n('Cancel') ?>" >
<input class="comm_dialog_choose_email_button" disabled="disabled" type="submit" value="<?= i18n('Choose') ?>">
<input class="comm_dialog_choose_cancel_button" type="submit" value="<?= i18n('Cancel') ?>">
</form>
</div>
<script type="text/javascript">
var comm_dialog_choose_selected = -1;
$(".comm_dialog_choose_email_button").click(function () {
$(".comm_dialog_choose_email_button").click(function() {
var sel = $("#comm_dialog_choose_emails_id").val();
comm_dialog_choose_selected = sel;
$('#comm_dialog_choose').dialog("close");
return false;
});
$(".comm_dialog_choose_cancel_button").click(function () {
$(".comm_dialog_choose_cancel_button").click(function() {
$('#comm_dialog_choose').dialog("close");
return false;
});
function dialog_choose_change()
{
function dialog_choose_change() {
var sel = $("#comm_dialog_choose_emails_id").val();
$("#comm_dialog_choose_info").html("Loading...");
$("#comm_dialog_choose_info").load("<?= $config['SFIABDIRECTORY'] ?>/admin/communication.php?action=dialog_choose_load&emails_id="+sel);
if(sel == -1) {
$(".comm_dialog_choose_email_button").attr('disabled','disabled');
$("#comm_dialog_choose_info").load("<?= $config['SFIABDIRECTORY'] ?>/admin/communication.php?action=dialog_choose_load&emails_id=" + sel);
if (sel == -1) {
$(".comm_dialog_choose_email_button").attr('disabled', 'disabled');
} else {
$(".comm_dialog_choose_email_button").removeAttr('disabled');
}
@ -116,8 +134,10 @@ case 'dialog_choose':
}
$("#comm_dialog_choose").dialog({
bgiframe: true, autoOpen: true,
modal: true, resizable: false,
bgiframe: true,
autoOpen: true,
modal: true,
resizable: false,
draggable: false,
width: 700, //(document.documentElement.clientWidth * 0.8);
height: (document.documentElement.clientHeight * 0.8),
@ -125,23 +145,22 @@ case 'dialog_choose':
$(this).dialog('destroy');
$('#comm_dialog_choose').remove();
/* Run callbacks */
if(comm_dialog_choose_selected != -1) {
if(typeof(comm_dialog_choose_select) == 'function') {
if (comm_dialog_choose_selected != -1) {
if (typeof(comm_dialog_choose_select) == 'function') {
comm_dialog_choose_select(comm_dialog_choose_selected);
}
} else {
if(typeof(comm_dialog_choose_cancel) == 'function') {
if (typeof(comm_dialog_choose_cancel) == 'function') {
comm_dialog_choose_cancel();
}
}
}
});
</script>
<?
exit;
case 'email_save':
case 'email_save':
$id = intval($_POST['emails_id']);
// we need to character encode BEFORE we myql_real_escape_strintg
@ -201,7 +220,7 @@ case 'email_save':
happy_('Email Saved');
exit;
case 'dialog_edit':
case 'dialog_edit':
if (array_key_exists('id', $_GET)) {
$id = intval($_GET['id']);
$cloneid = 0;
@ -284,7 +303,7 @@ case 'dialog_edit':
<td class="label"><?= i18n('Email Key') ?>:</td>
<td class="input"><input type="text" name="key" size="60" value="" /></td>
</tr>
<?
<?
}
/* ="fcid=$fcid, key=$key, type=$type" */
?>
@ -296,22 +315,32 @@ case 'dialog_edit':
<tr>
<td class="label"><?= i18n('Description') ?>:</td>
<td class="input"><input type="text" name="description" size="60" value="<?= $description ?>" /></td>
</tr><tr>
<tr><td colspan="2"><hr /></td>
</tr><tr>
</tr>
<tr>
<tr>
<td colspan="2">
<hr />
</td>
</tr>
<tr>
<td class="label"><?= i18n('From Address') ?>:</td>
<td class="input"><input type="text" name="from" size="60" value="<?= $from ?>" /></td>
</tr><tr>
</tr>
<tr>
<td class="label"><?= i18n('Subject') ?>:</td>
<td class="input"><input type="text" name="subject" size="60" value="<?= $subject ?>" /></td>
</tr><tr>
</tr>
<tr>
<td colspan="2" class="input">
<table width="100%"><tr><td width="85%">
<table width="100%">
<tr>
<td width="85%">
<div id="fck">
<textarea id="bodyhtml" name="bodyhtml" rows=6 cols=80><?= $bodyhtml ?></textarea>
</div>
</td><td width="15%">
<select id="comm_dialog_insert_field" name="insert_field" size="20" style="height:300" >
</td>
<td width="15%">
<select id="comm_dialog_insert_field" name="insert_field" size="20" style="height:300">
<option value="EMAIL">[EMAIL]</option>
<option value="FAIRNAME">[FAIRNAME]</option>
<option value="FIRSTNAME">[FIRSTNAME]</option>
@ -324,9 +353,12 @@ case 'dialog_edit':
<option value="URLLOGIN">[URLLOGIN]</option>
<option value="ACCESSCODE" title="School Access Code">[ACCESSCODE]</option>
</select>
</td></tr></table>
</td>
</tr></table>
</tr>
</table>
</td>
</tr>
</table>
<hr />
<div align="right">
<input type="submit" id="comm_dialog_edit_save_button" value="<?= i18n('Save') ?>" />
@ -337,8 +369,8 @@ case 'dialog_edit':
<script type="text/javascript" src="<?= $config['SFIABDIRECTORY'] ?>/fckeditor/fckeditor.js"></script>
<script type="text/javascript">
var comm_dialog_edit_saved = false;
$("#comm_dialog_edit_save_button").click(function () {
var oFCKeditor = FCKeditorAPI.GetInstance('bodyhtml') ;
$("#comm_dialog_edit_save_button").click(function() {
var oFCKeditor = FCKeditorAPI.GetInstance('bodyhtml');
var value = oFCKeditor.GetHTML();
$('#bodyhtml').val(value);
$("#debug").load("<?= $config['SFIABDIRECTORY'] ?>/admin/communication.php?action=email_save", $("#comm_dialog_edit_form").serializeArray(),
@ -347,17 +379,17 @@ case 'dialog_edit':
$('#comm_dialog_edit').dialog("close");
});
return false;
}
);
$("#comm_dialog_edit_cancel_button").click(function () {
});
$("#comm_dialog_edit_cancel_button").click(function() {
$('#comm_dialog_edit').dialog("close");
return false;
}
);
});
$("#comm_dialog_edit").dialog({
bgiframe: true, autoOpen: true,
modal: true, resizable: false,
bgiframe: true,
autoOpen: true,
modal: true,
resizable: false,
draggable: false,
width: 800, //(document.documentElement.clientWidth * 0.8);
height: (document.documentElement.clientHeight * 0.8),
@ -365,43 +397,42 @@ case 'dialog_edit':
$(this).dialog('destroy');
$('#comm_dialog_edit').remove();
/* Run callbacks */
if(comm_dialog_edit_saved == true) {
if(typeof(comm_dialog_edit_save) == 'function') {
if (comm_dialog_edit_saved == true) {
if (typeof(comm_dialog_edit_save) == 'function') {
comm_dialog_edit_save(<?= $emails_id ?>);
}
} else {
if(typeof(comm_dialog_edit_cancel) == 'function') {
if (typeof(comm_dialog_edit_cancel) == 'function') {
comm_dialog_edit_cancel();
}
}
if(typeof(refreshEmailList) == 'function') {
if (typeof(refreshEmailList) == 'function') {
refreshEmailList();
}
}
});
$("#comm_dialog_insert_field").click(function () {
var oFCKeditor = FCKeditorAPI.GetInstance('bodyhtml') ;
$("#comm_dialog_insert_field").click(function() {
var oFCKeditor = FCKeditorAPI.GetInstance('bodyhtml');
var value = oFCKeditor.GetHTML();
oFCKeditor.InsertHtml("["+this.value+"]");
oFCKeditor.InsertHtml("[" + this.value + "]");
return false;
}
);
});
var oFCKeditor = new FCKeditor( 'bodyhtml' ) ;
oFCKeditor.BasePath = "../fckeditor/" ;
var oFCKeditor = new FCKeditor('bodyhtml');
oFCKeditor.BasePath = "../fckeditor/";
oFCKeditor.ToolbarSet = 'sfiab';
oFCKeditor.Width="100%";
oFCKeditor.Height=300;
// $('#fck').html(oFCKeditor.CreateHtml());
oFCKeditor.ReplaceTextarea() ;
oFCKeditor.Width = "100%";
oFCKeditor.Height = 300;
// $('#fck').html(oFCKeditor.CreateHtml());
oFCKeditor.ReplaceTextarea();
</script>
<?
exit;
case 'dialog_send':
case 'dialog_send':
?>
<div id="comm_dialog_send" title="Send Communication" style="display: none">
<?
@ -445,7 +476,7 @@ case 'dialog_send':
echo "<br />\n";
}
?>
<input class="comm_dialog_send_cancel_button" type="submit" value="<?= i18n('Cancel') ?>" >
<input class="comm_dialog_send_cancel_button" type="submit" value="<?= i18n('Cancel') ?>">
</div>
<div id="comm_dialog_send_processing" style="display: none;">
<?= i18n('Please wait while the email queue is initialized...') ?>
@ -454,17 +485,20 @@ case 'dialog_send':
</div>
<div id="comm_dialog_send_status" style="display: none;">
<?= i18n('The email has been queued to send'); ?>
<br /><br /><input class="comm_dialog_send_status_button" type="submit" value="<?= i18n('Close and view sending status') ?>" >
<input class="comm_dialog_send_close_button" type="submit" value="<?= i18n('Close and continue') ?>" >
<br /><br /><input class="comm_dialog_send_status_button" type="submit" value="<?= i18n('Close and view sending status') ?>">
<input class="comm_dialog_send_close_button" type="submit" value="<?= i18n('Close and continue') ?>">
</div>
</form>
</div>
<script type="text/javascript">
var comm_dialog_choose_selected = -1;
$(".comm_dialog_send_send_button").click(function () {
$(".comm_dialog_send_send_button").click(function() {
$("#comm_dialog_send_info").hide();
$("#comm_dialog_send_processing").show();
$.post("communication.php?action=sendqueue",{fundraising_campaigns_id: <?= $fcid ?>, emails_id: <?= $emailid ?>}, function() {
$.post("communication.php?action=sendqueue", {
fundraising_campaigns_id: <?= $fcid ?>,
emails_id: <?= $emailid ?>
}, function() {
$("#comm_dialog_send_processing").hide();
$("#comm_dialog_send_status").show();
});
@ -472,44 +506,45 @@ case 'dialog_send':
return false;
});
$(".comm_dialog_send_cancel_button").click(function () {
$(".comm_dialog_send_cancel_button").click(function() {
$('#comm_dialog_send').dialog("close");
return false;
});
$(".comm_dialog_send_close_button").click(function () {
$(".comm_dialog_send_close_button").click(function() {
$('#comm_dialog_send').dialog("close");
return false;
});
$(".comm_dialog_send_status_button").click(function () {
$(".comm_dialog_send_status_button").click(function() {
$('#comm_dialog_send').dialog("close");
window.location.href="communication_send_status.php";
window.location.href = "communication_send_status.php";
return false;
});
$("#comm_dialog_send").dialog({
bgiframe: true, autoOpen: true,
modal: true, resizable: false,
bgiframe: true,
autoOpen: true,
modal: true,
resizable: false,
draggable: false,
width: 600, //(document.documentElement.clientWidth * 0.8);
close: function() {
$(this).dialog('destroy');
$('#comm_dialog_send').remove();
/* Run callbacks */
if(typeof(update_tab_communications) == 'function') {
if (typeof(update_tab_communications) == 'function') {
update_tab_communications();
}
}
});
</script>
<?
exit;
// dialog_sender is used to send a one-off communication based on a given template to a given user
// receives 'uid' and an optional 'template'
case 'dialog_sender':
// dialog_sender is used to send a one-off communication based on a given template to a given user
// receives 'uid' and an optional 'template'
case 'dialog_sender':
$u = user_load_by_uid(intval($_GET['uid']));
if ($_GET['template']) {
@ -551,19 +586,23 @@ case 'dialog_sender':
<tr>
<td class="label"><?= i18n('From') ?>:</td>
<td class="input"><input type="text" name="from" size="60" value="<?= $from ?>" /></td>
</tr><tr>
</tr>
<tr>
<td class="label"><?= i18n('To') ?>:</td>
<td class="input"><input type="text" name="to" size="60" value="<?= $to ?>" /></td>
</tr><tr>
</tr>
<tr>
<td class="label"><?= i18n('Subject') ?>:</td>
<td class="input"><input type="text" name="subject" size="60" value="<?= $subject ?>" /></td>
</tr><tr>
</tr>
<tr>
<td colspan="2" class="input">
<div id="fck">
<textarea id="bodyhtml" name="bodyhtml" rows=6 cols=80><?= $bodyhtml ?></textarea>
</div>
</td>
</tr></table>
</tr>
</table>
<hr />
<div align="right">
<input type="submit" id="comm_dialog_sender_send_button" value="<?= i18n('Send') ?>" />
@ -573,8 +612,8 @@ case 'dialog_sender':
</div>
<script type="text/javascript" src="<?= $config['SFIABDIRECTORY'] ?>/fckeditor/fckeditor.js"></script>
<script type="text/javascript">
$("#comm_dialog_sender_send_button").click(function () {
var oFCKeditor = FCKeditorAPI.GetInstance('bodyhtml') ;
$("#comm_dialog_sender_send_button").click(function() {
var oFCKeditor = FCKeditorAPI.GetInstance('bodyhtml');
var value = oFCKeditor.GetHTML();
$('#bodyhtml').val(value);
$("#debug").load("<?= $config['SFIABDIRECTORY'] ?>/admin/communication.php?action=email_send", $("#comm_dialog_sender_form").serializeArray(),
@ -582,17 +621,17 @@ case 'dialog_sender':
$('#comm_dialog_sender').dialog("close");
});
return false;
}
);
$("#comm_dialog_sender_cancel_button").click(function () {
});
$("#comm_dialog_sender_cancel_button").click(function() {
$('#comm_dialog_sender').dialog("close");
return false;
}
);
});
$("#comm_dialog_sender").dialog({
bgiframe: true, autoOpen: true,
modal: true, resizable: false,
bgiframe: true,
autoOpen: true,
modal: true,
resizable: false,
draggable: false,
width: 800, //(document.documentElement.clientWidth * 0.8);
close: function() {
@ -602,15 +641,15 @@ case 'dialog_sender':
}
});
var oFCKeditor = new FCKeditor( 'bodyhtml' ) ;
oFCKeditor.BasePath = "../fckeditor/" ;
var oFCKeditor = new FCKeditor('bodyhtml');
oFCKeditor.BasePath = "../fckeditor/";
oFCKeditor.ToolbarSet = 'sfiab';
oFCKeditor.Width="100%";
oFCKeditor.Height=300;
// $('#fck').html(oFCKeditor.CreateHtml());
oFCKeditor.ReplaceTextarea() ;
oFCKeditor.Width = "100%";
oFCKeditor.Height = 300;
// $('#fck').html(oFCKeditor.CreateHtml());
oFCKeditor.ReplaceTextarea();
</script>
<?
<?
exit;
case 'email_send':
@ -762,15 +801,19 @@ if (get_value_from_array($_GET, 'action') == 'sendqueue') {
launchQueue();
exit;
}
send_header('Communication',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'communication');
send_header(
'Communication',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
),
'communication'
);
echo '<br />';
?>
<script type="text/javascript">
<script type="text/javascript">
function toggleAddresses() {
if($("#toaddresses").is(":visible")) {
if ($("#toaddresses").is(":visible")) {
$("#toaddresses").hide();
$("#toaddresses-view").html("Show Recipients");
} else {
@ -779,11 +822,12 @@ echo '<br />';
}
return false;
}
function loadAddresses() {
$("#toaddresses").load("communication.php?action=loadaddresses&query="+$("#to").val());
$("#toaddresses").load("communication.php?action=loadaddresses&query=" + $("#to").val());
}
</script>
<?
</script>
<?
if (get_value_from_array($_GET, 'action') == 'delete' && get_value_from_array($_GET, 'delete')) {
$q = $pdo->prepare("DELETE FROM emails WHERE id='" . $_GET['delete'] . "' AND `type`='user'");
@ -809,7 +853,7 @@ if (get_value_from_array($_GET, 'action') == 'send' && get_value_from_array($_GE
echo '<select name="to" id="to" onchange="loadAddresses();">';
echo ' <option value="">Choose Email Recipients</option>';
$str = '';
foreach ($mailqueries AS $k => $mq) {
foreach ($mailqueries as $k => $mq) {
$tq = $pdo->prepare($mq['query']);
$tq->execute();
@ -972,20 +1016,19 @@ if (get_value_from_array($_GET, 'action') == 'send' && get_value_from_array($_GE
echo "<br />\n";
echo "<br />\n";
echo '<div id="emaillist"></div>';
?>
?>
<script type="text/javascript">
function refreshEmailList() {
$("#emaillist").load("communication.php?action=email_get_list",null,function(){
$("#emaillist").load("communication.php?action=email_get_list", null, function() {
$('.tableview').tablesorter();
});
}
$(document).ready(function() {
refreshEmailList();
}
);
});
</script>
<?
<?
}
send_footer();

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,8 +24,8 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
if (get_value_from_array($_GET, 'action') == 'status') {
@ -82,11 +83,11 @@ if (get_value_from_array($_GET, 'action') == 'status') {
echo "<br /><br />\n";
} else {
echo notice('No Email Communications are currently being sent out');
?>
?>
<script type="text/javascript">
stopRefreshing();
</script>
<?
<?
}
$q = $pdo->prepare('SELECT * FROM emailqueue WHERE finished IS NOT NULL ORDER BY started DESC LIMIT 10');
@ -120,37 +121,43 @@ if (get_value_from_array($_GET, 'action') == 'status') {
exit;
}
send_header('Communication Sending Status',
array('Committee Main' => 'committee_main.php',
send_header(
'Communication Sending Status',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Communication' => 'admin/communication.php'));
'Communication' => 'admin/communication.php'
)
);
?>
<script type="text/javascript">
$(document).ready( function() {
<script type="text/javascript">
$(document).ready(function() {
refreshStatus();
});
var refreshTimeout;
function refreshStatus() {
$("#queuestatus").load("communication_send_status.php?action=status",null,function() {
$("#queuestatus").load("communication_send_status.php?action=status", null, function() {
<? if ($config['emailqueue_lock']) { ?>
refreshTimeout=setTimeout('refreshStatus()',1000);
refreshTimeout = setTimeout('refreshStatus()', 1000);
<? } ?>
});
}
function stopRefreshing() {
if(refreshTimeout) {
if (refreshTimeout) {
clearTimeout(refreshTimeout);
window.location.href="communication_send_status.php";
window.location.href = "communication_send_status.php";
}
}
function cancelQueue(id) {
$("#debug").load("communication.php?action=cancel&cancel="+id,null,function() { if(!refreshTimeout) refreshStatus(); });
$("#debug").load("communication.php?action=cancel&cancel=" + id, null, function() {
if (!refreshTimeout) refreshStatus();
});
}
</script>
<?
</script>
<?
echo '<br />';
echo '<div id="queuestatus" style="margin-left: 20px;">';
echo '</div>';

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2007 James Grant <james@lightbox.org>
* Copyright (C) 2009 David Grant <dave@lightbox.org>
@ -23,10 +23,10 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require_once ('xml.inc.php');
require_once('xml.inc.php');
function xml_dearray(&$array)
{
@ -66,8 +66,10 @@ function curl_query($fair, $data, $ysc_url = '')
$url = $fair['url'] . '/remote.php';
$var = 'json';
$d = array();
$d['auth'] = array('username' => $fair['username'],
'password' => $fair['password']);
$d['auth'] = array(
'username' => $fair['username'],
'password' => $fair['password']
);
$str = json_encode(array_merge($d, $data));
break;
case 'ysc':

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,7 +24,7 @@
*/
include 'xml.inc.php';
require_once ('../user.inc.php');
require_once('../user.inc.php');
function get_cwsf_award_winners()
{
@ -116,17 +117,21 @@ function get_cwsf_award_winners()
?>
<?
require ('../common.inc.php');
require ('../projects.inc.php');
require('../common.inc.php');
require('../projects.inc.php');
user_auth_required('committee', 'admin');
send_header('One-Click CWSF Registration',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'one-click_cwsf_registration');
send_header(
'One-Click CWSF Registration',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
),
'one-click_cwsf_registration'
);
echo '<br />';
if (count(get_value_from_array($_POST, 'cwsfdivision', []))) {
foreach ($_POST['cwsfdivision'] AS $p => $d) {
foreach ($_POST['cwsfdivision'] as $p => $d) {
$q = $pdo->prepare("UPDATE projects SET cwsfdivisionid=? WHERE id=?");
$q->execute([$d, $p]);
}
@ -207,13 +212,13 @@ if ($ok) {
echo '<th>' . i18n('Project Division / CWSF Project Division') . '</th>';
echo '</tr></thead>';
foreach ($winners AS $winner) {
foreach ($winners as $winner) {
echo '<tr><td>';
echo '<b>';
echo $winner['projectnumber'] . ' - ' . $winner['title'];
echo '</b>';
echo '<br />';
foreach ($winner['students'] AS $s) {
foreach ($winner['students'] as $s) {
echo '&nbsp;';
echo '&nbsp;';
echo '&nbsp;';
@ -261,7 +266,7 @@ if ($ok) {
echo '<select name="cwsfdivision[' . $winner['projectid'] . ']">';
echo '<option value="">' . i18n('No corresponding CWSF division') . "</option>\n";
foreach ($CWSFDivisions AS $k => $v) {
foreach ($CWSFDivisions as $k => $v) {
if ($winner['division_id']) {
if ($k == $winner['division_id'])
$sel = 'selected="selected"';

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2007 James Grant <james@lightbox.org>
*
@ -22,8 +22,8 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
$q = $pdo->prepare("SELECT * FROM documents WHERE id='" . $_GET['id'] . "'");
$q->execute();

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2007 James Grant <james@lightbox.org>
*
@ -22,9 +22,9 @@
*/
?>
<?
require ('../common.inc.php');
require ('../tableeditor.class.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require('../tableeditor.class.php');
require_once('../user.inc.php');
// make sure storage folder exists
if (!file_exists('../data/documents'))
@ -33,18 +33,24 @@ if (!file_exists('../data/documents/.htaccess'))
file_put_contents('../data/documents/.htaccess', "Order Deny,Allow\r\nDeny From All\r\n");
user_auth_required('committee', 'admin');
send_header('Internal Document Manager',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'internal_document_management');
send_header(
'Internal Document Manager',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
),
'internal_document_management'
);
$editor = new TableEditor('documents',
$editor = new TableEditor(
'documents',
array(
'date' => 'Date',
'title' => 'Document Title',
'sel_category' => 'Category',
'filename' => 'Filename',
));
)
);
$editor->setPrimaryKey('id');
$editor->setUploadPath('../data/documents');

View File

@ -2,9 +2,9 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2008 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -22,60 +22,74 @@
*/
?>
<?
require ('../common.inc.php');
require ('../tableeditor.class.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require('../tableeditor.class.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
include ('fundraising_sponsorship_handler.inc.php');
include ('fundraising_goals_handler.inc.php');
include ('fundraising_main.inc.php');
include('fundraising_sponsorship_handler.inc.php');
include('fundraising_goals_handler.inc.php');
include('fundraising_main.inc.php');
send_header('Donations',
array('Committee Main' => 'committee_main.php',
send_header(
'Donations',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Fundraising' => 'admin/fundraising.php'),
'fundraising');
'Fundraising' => 'admin/fundraising.php'
),
'fundraising'
);
?>
<script type="text/javascript">
$(document).ready(function() {
$(document).ready(function() {
//initialize the dialog
$("#sponsorship_editor").dialog({
bgiframe: true, autoOpen: false,
modal: true, resizable: false,
bgiframe: true,
autoOpen: false,
modal: true,
resizable: false,
draggable: false
});
$("#fund_editor").dialog({
bgiframe: true, autoOpen: false,
modal: true, resizable: falsefundraising,
bgiframe: true,
autoOpen: false,
modal: true,
resizable: falsefundraising,
draggable: false
});
refresh_fundraising_table();
refresh_fundraising_table();
});
});
function popup_sponsorship_editor(url) {
function popup_sponsorship_editor(url) {
var w = (document.documentElement.clientWidth * 0.6);
$('#sponsorship_editor').dialog('option','width',w);
$('#sponsorship_editor').dialog('option', 'width', w);
//let the height autocalculate
/*
/*
var h = (document.documentElement.clientHeight * 0.6);
$('#sponsorship_editor').dialog('option','height',h);
*/
$('#sponsorship_editor').dialog('option','buttons',{ "<?= i18n('Save') ?>": function() { save_sponsorship(); },
"<?= i18n('Cancel') ?>": function(){ $(this).dialog("close");}});
$('#sponsorship_editor').dialog('option', 'buttons', {
"<?= i18n('Save') ?>": function() {
save_sponsorship();
},
"<?= i18n('Cancel') ?>": function() {
$(this).dialog("close");
}
});
$('#sponsorship_editor').dialog('open');
$('#sponsorship_editor_content').load(url);
return false;
}
}
function save_sponsorship() {
function save_sponsorship() {
$('#debug').load("<?= $config['SFIABDIRECTORY'] ?>/admin/fundraising.php",
$("#fundraisingsponsorship").serializeArray(),
function() {
@ -83,26 +97,32 @@ function save_sponsorship() {
refresh_fundraising_table();
});
return false;
}
}
function popup_fund_editor(url) {
function popup_fund_editor(url) {
var w = (document.documentElement.clientWidth * 0.6);
$('#fund_editor').dialog('option','width',w);
$('#fund_editor').dialog('option', 'width', w);
//let the height autocalculate
/*
/*
var h = (document.documentElement.clientHeight * 0.6);
$('#fund_editor').dialog('option','height',h);
*/
$('#fund_editor').dialog('option','buttons',{ "<?= i18n('Save') ?>": function() { save_fund(); },
"<?= i18n('Cancel') ?>": function(){ $(this).dialog("close");}});
$('#fund_editor').dialog('option', 'buttons', {
"<?= i18n('Save') ?>": function() {
save_fund();
},
"<?= i18n('Cancel') ?>": function() {
$(this).dialog("close");
}
});
$('#fund_editor').dialog('open');
$('#fund_editor_content').load(url);
return false;
}
}
function save_fund() {
function save_fund() {
$("#debug").load("<?= $config['SFIABDIRECTORY'] ?>/admin/fundraising.php",
$("#fundraisingfundraising").serializeArray(),
function(data) {
@ -110,35 +130,39 @@ function save_fund() {
refresh_fundraising_table();
});
return false;
}
}
function delete_fund(id) {
if(confirmClick('Are you sure you want to remove this fund?')) {
$('#debug').load("<?= $config['SFIABDIRECTORY'] ?>/admin/fundraising.php",
{ action: 'funddelete', delete: id },
function delete_fund(id) {
if (confirmClick('Are you sure you want to remove this fund?')) {
$('#debug').load("<?= $config['SFIABDIRECTORY'] ?>/admin/fundraising.php", {
action: 'funddelete',
delete: id
},
function() {
refresh_fundraising_table();
}
);
}
return false;
}
}
function delete_sponsorship(id) {
if(confirmClick('Are you sure you want to remove this sponsorship?')) {
$('#debug').load("<?= $config['SFIABDIRECTORY'] ?>/admin/fundraising.php",
{ action: 'sponsorshipdelete', delete: id },
function delete_sponsorship(id) {
if (confirmClick('Are you sure you want to remove this sponsorship?')) {
$('#debug').load("<?= $config['SFIABDIRECTORY'] ?>/admin/fundraising.php", {
action: 'sponsorshipdelete',
delete: id
},
function() {
refresh_fundraising_table();
}
);
}
return false;
}
}
function refresh_fundraising_table() {
function refresh_fundraising_table() {
$("#fundraisingmain").load("fundraising.php?action=fundraisingmain");
}
}
</script>
<?
@ -167,12 +191,12 @@ echo "<br />\n";
?>
<div style="display: none" title="<?= i18n('Donation Editor') ?>" id="sponsorship_editor">
<div id="sponsorship_editor_content">
</div>
<div id="sponsorship_editor_content">
</div>
</div>
<div style="display: none" title="<?= i18n('Fund Editor') ?>" id="fund_editor">
<div id="fund_editor_content">
</div>
<div id="fund_editor_content">
</div>
</div>
<?
send_footer();

View File

@ -2,10 +2,10 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2008 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,10 +23,10 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require_once ('fundraising_common.inc.php');
require_once('fundraising_common.inc.php');
global $pdo;
@ -386,7 +386,7 @@ switch (get_value_from_array($_GET, 'action')) {
echo "<li><a href=\"#\" onclick=\"useexistingcontact($r->uid)\">$r->firstname $r->lastname $r->email $r->phonehome</a></li>\n";
echo '</ul>';
?>
?>
<script type="text/javascript">
$("#contactnewsave").attr("disabled", "disabled");
</script>
@ -820,7 +820,7 @@ function draw_activityinfo_form()
global $config, $pdo;
$sponsorid = $_GET['id'];
// we'll start by drawing the table header
?>
?>
<form id="activityinfo">
<table class="tableview" style="width:99%">
<thead>
@ -1388,7 +1388,7 @@ echo '<hr />';
<?
if (get_value_from_array($_GET, 'action') == 'add') {
?>
?>
<script type="text/javascript">
$(document).ready(function() {
open_editor(-1);

View File

@ -2,10 +2,10 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2008 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,8 +23,8 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
echo "<br />\n";
@ -37,7 +37,7 @@ if (get_value_from_array($_POST, 'search'))
// NEEDS AN ARRAY AS AN ARGUMENT INSTEAD OF A STRING
if (count(get_value_from_array($_POST, 'donortype', []))) {
$sql .= ' AND (0 ';
foreach ($_POST['donortype'] AS $d) {
foreach ($_POST['donortype'] as $d) {
$sql .= " OR donortype='$d'";
}
$sql .= ') ';
@ -69,7 +69,7 @@ while ($r = $q->fetch(PDO::FETCH_OBJ)) {
$thisyearsort = array();
if (!get_value_from_array($_POST, 'order')) {
// if order is not given, lets order by donation amount this year
foreach ($rows AS $key => $val) {
foreach ($rows as $key => $val) {
$thisyearsort[$key] = $val['thisyeartotal'];
}
array_multisort($thisyearsort, SORT_DESC, $rows);
@ -93,7 +93,7 @@ echo '</tr>';
echo "</thead>\n";
$x = 0;
foreach ($rows AS $r) {
foreach ($rows as $r) {
echo "<tr>\n";
$eh = "style=\"cursor:pointer;\" onclick=\"open_editor({$r['id']});\"";
echo " <td $eh>{$r['name']}</td>\n";

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2010 David Grant <dave@lightbox.org>
*
@ -22,9 +22,9 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('judges.inc.php'); /* for getJudgingEligibilityCode() */
require_once ('anneal.inc.php');
require_once('../common.inc.php');
require_once('judges.inc.php'); /* for getJudgingEligibilityCode() */
require_once('anneal.inc.php');
if ($_SERVER['SERVER_ADDR']) {
echo 'This script must be run from the command line';
@ -45,7 +45,7 @@ switch ($argv[1]) {
// function TRACE_R() { }
function TRACE($str)
{
print ($str);
print($str);
}
function TRACE_R($array)
@ -308,10 +308,14 @@ foreach ($exhibithall as &$i_eh) {
$i_eh['grid_h'] = $iy + 1;
/* Initialize element if required */
if (!is_array($i_eh[$ix][$iy])) {
$i_eh[$ix][$iy] = array('x' => $x, 'ix' => $ix,
'y' => $y, 'iy' => $iy,
$i_eh[$ix][$iy] = array(
'x' => $x,
'ix' => $ix,
'y' => $y,
'iy' => $iy,
'ids' => array(),
'project_front' => 0);
'project_front' => 0
);
}
/* Scan all objects */
@ -604,8 +608,14 @@ $project_ids = array_keys($projects);
// array_splice($project_ids, 20);
$a = new annealer(count($floor_objects), 125, $e, 0.9,
project_cost, $project_ids);
$a = new annealer(
count($floor_objects),
125,
$e,
0.9,
project_cost,
$project_ids
);
$a->set_max_items_per_bucket(1);
// $a->set_delta_cost_bucket_ids_callback(project_bucket_ids);
$a->anneal();

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,17 +24,19 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('../lpdf.php');
require('../lpdf.php');
$catq = $pdo->prepare("SELECT * FROM projectcategories WHERE year='" . $config['FAIRYEAR'] . "' AND id='" . $_GET['cat'] . "'");
$catq->execute();
if ($catr = $catq->fetch(PDO::FETCH_OBJ)) {
$pdf = new lpdf(i18n($config['fairname']),
$pdf = new lpdf(
i18n($config['fairname']),
i18n('Checkin List') . ' - ' . i18n($catr->category),
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif');
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif'
);
$pdf->newPage();
$pdf->setFontSize(11);

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2007 James Grant <james@lightbox.org>
* Copyright (C) 2009 David Grant <dave@lightbox.org>
@ -23,12 +23,12 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require_once ('xml.inc.php');
require_once ('stats.inc.php');
require_once ('curl.inc.php');
require_once('xml.inc.php');
require_once('stats.inc.php');
require_once('curl.inc.php');
/* Hack so we can jump right to YSC stats */
if (get_value_from_array($_GET, 'abbrv') == 'YSC') {
@ -65,10 +65,14 @@ function stats_to_ysc($fair, $stats)
return $stats;
}
send_header('Upload Fair Statistics and Information',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'fair_stats');
send_header(
'Upload Fair Statistics and Information',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
),
'fair_stats'
);
echo '<br />';
/* SFIAB config options server side */
@ -121,8 +125,11 @@ if ($action == 'sendstats') {
}
if (function_exists('curl_init')) {
$r = curl_query($fair, $req,
'https://secure.ysf-fsj.ca/registration/xmlaffiliation.php');
$r = curl_query(
$fair,
$req,
'https://secure.ysf-fsj.ca/registration/xmlaffiliation.php'
);
if ($r['error'] == 0)
echo happy(i18n('The %1 Server said:', array($fair['name'])) . ' ' . $r['message']);
else
@ -271,8 +278,21 @@ $stats['students_total'] = $q->rowCount();
$stats['students_public'] = 0;
$stats['students_private'] = 0;
$stats['students_atrisk'] = 0;
$grademap = array(1 => 1, 2 => 1, 3 => 1, 4 => 4, 5 => 4, 6 => 4, 7 => 7, 8 => 7,
9 => 9, 10 => 9, 11 => 11, 12 => 11, 13 => 11);
$grademap = array(
1 => 1,
2 => 1,
3 => 1,
4 => 4,
5 => 4,
6 => 4,
7 => 7,
8 => 7,
9 => 9,
10 => 9,
11 => 11,
12 => 11,
13 => 11
);
foreach ($grademap as $k => $g) {
$stats["male_$g"] = 0;
$stats["female_$g"] = 0;
@ -454,15 +474,18 @@ if ($server_config['schools_ext']) {
echo '<h3>' . i18n('%1 Extended School/Participant data', array($year)) . '</h3>';
echo '<br />';
echo i18n('Public schools: <b>%1</b> (<b>%2</b> students).', array(
$stats['schools_public'], $stats['students_public']
$stats['schools_public'],
$stats['students_public']
));
echo '<br />';
echo i18n('Private/Independent schools: <b>%1</b> (<b>%2</b> students).', array(
$stats['schools_private'], $stats['students_private']
$stats['schools_private'],
$stats['students_private']
));
echo '<br />';
echo i18n('At-risk/inner city schools: <b>%1</b> (<b>%2</b> students).', array(
$stats['schools_atrisk'], $stats['students_atrisk']
$stats['schools_atrisk'],
$stats['students_atrisk']
));
echo '<br />';
echo i18n('Number of school boards/distrcits: <b>%1</b>', array(

View File

@ -1,7 +1,7 @@
<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Science-ation Website: https://science-ation.ca/
Copyright (C) 2009 David Grant <dave@lightbox.org>
@ -21,12 +21,13 @@
*/
?>
<?
require_once('../common.inc.php');
require_once('../user.inc.php');
require_once('../fair.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
require_once('../fair.inc.php');
$fair_type = array('feeder' => 'Feeder Fair', 'sfiab' => 'SFIAB Upstream', 'ysc' => 'YSC/CWSF Upstream');
$stats = array('participation' => 'Particpation Numbers',
$fair_type = array('feeder' => 'Feeder Fair', 'sfiab' => 'SFIAB Upstream', 'ysc' => 'YSC/CWSF Upstream');
$stats = array(
'participation' => 'Particpation Numbers',
'schools_ext' => 'Extra school participation data, number of public/private school students',
'minorities' => 'Data on minority group participation',
'guests' => 'Number of student, public guests',
@ -35,18 +36,18 @@
'next_chair' => 'The chair of the regional fair next year',
'scholarships' => 'Information about scholarships available to be won',
'delegates' => 'Delegate information/jacket size for CWSF',
);
);
user_auth_required('committee', 'admin');
user_auth_required('committee', 'admin');
switch($_GET['action']) {
switch ($_GET['action']) {
case 'save':
print_r($_POST);
$id = intval($_POST['fairs_id']);
if(!is_array($_POST['stats'])) $_POST['stats'] = array();
foreach($_POST['stats'] as $k=>$s) {
if(!array_key_exists($s, $stats)) {
if (!is_array($_POST['stats'])) $_POST['stats'] = array();
foreach ($_POST['stats'] as $k => $s) {
if (!array_key_exists($s, $stats)) {
echo "Undefined stat $s, abort.\n";
exit;
}
@ -58,54 +59,47 @@
echo "UPDATE fairs SET gather_stats='$s' WHERE id='$id'";
happy_("Saved");
exit;
}
/* Load the user we're editting */
$u = user_load($_SESSION['embed_edit_id']);
/* Load the fair attached to the user */
$q = $pdo->prepare("SELECT * FROM fairs WHERE id={$u['fairs_id']}");
$q->execute();
$f = $q->fetch(PDO::FETCH_ASSOC);
}
/* Load the user we're editting */
$u = user_load($_SESSION['embed_edit_id']);
/* Load the fair attached to the user */
$q = $pdo->prepare("SELECT * FROM fairs WHERE id={$u['fairs_id']}");
$q->execute();
$f = $q->fetch(PDO::FETCH_ASSOC);
?>
<h4><?=i18n('Fair Stats Gathering')?></h3>
<h4><?= i18n('Fair Stats Gathering') ?></h3>
<script type="text/javascript">
function stats_save()
{
<script type="text/javascript">
function stats_save() {
$("#debug").load("fair_stats_select.php?action=save", $("#gather_stats").serializeArray());
return 0;
}
}
</script>
<?
if($f['type'] == 'feeder') {
echo '<p>'.i18n('Select which statistics to request from the feeder fair').'</p>';
<?
if ($f['type'] == 'feeder') {
echo '<p>' . i18n('Select which statistics to request from the feeder fair') . '</p>';
} else {
echo '<p>'.i18n('Not supported for upstream fairs').'</p>';
echo '<p>' . i18n('Not supported for upstream fairs') . '</p>';
exit;
}
?>
?>
<form id="gather_stats">
<input type="hidden" name="fairs_id" value="<?=$f['id']?>" />
<input type="hidden" name="fairs_id" value="<?= $f['id'] ?>" />
<table class="editor">
<?
<?
$selected_stats = split(',', $f['gather_stats']);
foreach($stats as $s=>$d) {
foreach ($stats as $s => $d) {
$ch = in_array($s, $selected_stats) ? 'checked="checked"' : '';
echo "<tr><td class=\"left\"><input type=\"checkbox\" id=\"stats_$s\" name=\"stats[]\" value=\"$s\" $ch /></td>";
echo "<td class=\"right\">".i18n($d)."</td></tr>";
echo "<td class=\"right\">" . i18n($d) . "</td></tr>";
}
?>
?>
</table>
<br />
<input type="submit" onClick="stats_save();return false;" value="Save" />
</form>

View File

@ -1,7 +1,7 @@
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
@ -22,5 +22,3 @@ while ($i = $q->fetch(PDO::FETCH_OBJ)) {
$stmt->execute([$id, $config['FAIRYEAR']]);
show_pdo_errors_if_any($pdo);
}
?>

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2009 James Grant <james@lightbox.org>
*
@ -22,20 +22,20 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
if (get_value_from_array($_GET, 'action') == 'refresh') {
?>
<h3><?= i18n('Fundraising Purposes and Progress Year to Date') ?></h3>
<?
<h3><?= i18n('Fundraising Purposes and Progress Year to Date') ?></h3>
<?
$q = $pdo->prepare("SELECT * FROM fundraising_goals WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY deadline");
$q->execute();
?>
<table class="tableview">
?>
<table class="tableview">
<thead>
<tr>
<th><?= i18n('Purpose') ?></th>
@ -65,12 +65,12 @@ if (get_value_from_array($_GET, 'action') == 'refresh') {
echo "<td style=\"text-align: center; background-color: $col;\">{$percent}%</td>";
echo '<td>' . format_date($r->deadline) . "</td></tr>\n";
}
?>
</table>
<br />
?>
</table>
<br />
<h3><?= i18n('Current Appeals') ?></h3>
<table class="tableview">
<h3><?= i18n('Current Appeals') ?></h3>
<table class="tableview">
<thead>
<tr>
<th><?= i18n('Name') ?></th>
@ -83,7 +83,7 @@ if (get_value_from_array($_GET, 'action') == 'refresh') {
<th><?= i18n('Purpose') ?></th>
</tr>
</thead>
<?
<?
$q = $pdo->prepare("SELECT * FROM fundraising_campaigns WHERE fiscalyear='{$config['FISCALYEAR']}'");
$q->execute();
@ -118,16 +118,18 @@ if (get_value_from_array($_GET, 'action') == 'refresh') {
echo " <td>$goalr->name</td>";
echo "</tr>\n";
}
?>
?>
</tr>
</table>
<script type="text/javascript"> $('.tableview').tablesorter();</script>
<br />
</table>
<script type="text/javascript">
$('.tableview').tablesorter();
</script>
<br />
<form id="thankyouform" method="post" action="fundraising.php">
<h3><?= i18n('To Do List') ?></h3>
<h4><?= i18n("Thank You's") ?></h4>
<?
<form id="thankyouform" method="post" action="fundraising.php">
<h3><?= i18n('To Do List') ?></h3>
<h4><?= i18n("Thank You's") ?></h4>
<?
$q = $pdo->prepare("SELECT id,value, thanked, status, sponsors_id, datereceived,
\tDATE_ADD(datereceived, INTERVAL 1 MONTH) < NOW() AS onemonth,
\tDATE_ADD(datereceived, INTERVAL 2 MONTH) < NOW() AS twomonth
@ -179,12 +181,12 @@ if (get_value_from_array($_GET, 'action') == 'refresh') {
echo i18n("No Thank You's pending");
echo "<br />\n";
}
?>
</form>
?>
</form>
<br />
<h4><?= i18n('Receipts to Issue') ?></h4>
<?
<br />
<h4><?= i18n('Receipts to Issue') ?></h4>
<?
$q = $pdo->prepare("SELECT value, receiptrequired, receiptsent, status, sponsors_id, datereceived,
\tDATE_ADD(datereceived, INTERVAL 1 MONTH) < NOW() AS onemonth,
\tDATE_ADD(datereceived, INTERVAL 2 MONTH) < NOW() AS twomonth
@ -227,11 +229,11 @@ if (get_value_from_array($_GET, 'action') == 'refresh') {
echo i18n('No Receipts pending');
echo "<br />\n";
}
?>
?>
<br />
<h4><?= i18n('Appeal Follow-Ups') ?></h4>
<?
<br />
<h4><?= i18n('Appeal Follow-Ups') ?></h4>
<?
$q = $pdo->prepare('SELECT * FROM fundraising_campaigns WHERE followupdate>=NOW() ORDER BY followupdate LIMIT 5');
$q->execute();
show_pdo_errors_if_any($pdo);
@ -251,9 +253,9 @@ if (get_value_from_array($_GET, 'action') == 'refresh') {
echo "<br />\n";
}
?>
<br />
<h4>Upcoming Proposals</h4>
?>
<br />
<h4>Upcoming Proposals</h4>
<?
$q = $pdo->prepare('SELECT * FROM sponsors WHERE fundingselectiondate>=NOW() OR proposalsubmissiondate>=NOW() ORDER BY fundingselectiondate LIMIT 5');
$q->execute();
@ -279,41 +281,43 @@ if (get_value_from_array($_GET, 'action') == 'refresh') {
exit;
} else if (get_value_from_array($_POST, 'thanked')) {
foreach ($_POST['thanked'] AS $t) {
foreach ($_POST['thanked'] as $t) {
$stmt = $pdo->prepare("UPDATE fundraising_donations SET thanked='yes' WHERE id='$t'");
$stmt->execute();
}
}
send_header('Fundraising',
array('Committee Main' => 'committee_main.php',
send_header(
'Fundraising',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Fundraising' => 'admin/fundraising.php'),
'fundraising');
'Fundraising' => 'admin/fundraising.php'
),
'fundraising'
);
?>
<script type="text/javascript">
$(document).ready(function() {
$(document).ready(function() {
refreshDashboard();
});
});
function refreshDashboard() {
function refreshDashboard() {
$("#dashboard").load("fundraising.php?action=refresh");
}
}
function thanked() {
$.post("fundraising.php",$("#thankyouform").serializeArray(),function() {
function thanked() {
$.post("fundraising.php", $("#thankyouform").serializeArray(), function() {
refreshDashboard();
});
}
}
//key is initial or followup
//start is either 'new' to start with a blank, or 'existing' to load an existing email to start from
function opencommunicationsender(uid,template) {
$("#debug").load("communication.php?action=dialog_sender&uid="+uid+"&template=fundraising_thankyou_template",null,function() {
});
//key is initial or followup
//start is either 'new' to start with a blank, or 'existing' to load an existing email to start from
function opencommunicationsender(uid, template) {
$("#debug").load("communication.php?action=dialog_sender&uid=" + uid + "&template=fundraising_thankyou_template", null, function() {});
return false;
}
}
</script>
<div id="dashboard"></div>

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2009 James Grant <james@lightbox.org>
*
@ -22,10 +22,10 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('fundraising_common.inc.php');
require('fundraising_common.inc.php');
switch (get_value_from_array($_GET, 'action')) {
case 'campaigninfo_save':
@ -44,10 +44,12 @@ switch (get_value_from_array($_GET, 'action')) {
echo "<input type=\"hidden\" name=\"campaign_id\" value=\"{$r->id}\" />\n";
echo "<table>\n";
display_campaign_form($r);
?>
<tr><td colspan="6" style="text-align: center;">
?>
<tr>
<td colspan="6" style="text-align: center;">
<br />
<input type="submit" value="<?= i18n('Save Appeal') ?>"></td>
<input type="submit" value="<?= i18n('Save Appeal') ?>">
</td>
</tr>
</table>
</form>
@ -60,12 +62,14 @@ switch (get_value_from_array($_GET, 'action')) {
<form id="campaigninfo_new" method="post" action="<?= $_SERVER['PHP_SELF'] ?>" onsubmit="return campaigninfo_save(-1)">
<input type="hidden" name="campaign_id" value="-1" />
<table>
<?
<?
display_campaign_form();
?>
<tr><td colspan="6" style="text-align: center;">
?>
<tr>
<td colspan="6" style="text-align: center;">
<br />
<input type="submit" value="<?= i18n('Create Appeal') ?>"></td>
<input type="submit" value="<?= i18n('Create Appeal') ?>">
</td>
</tr>
</table>
</form>
@ -75,10 +79,10 @@ switch (get_value_from_array($_GET, 'action')) {
exit;
break;
case 'managelist':
case 'managelist':
echo i18n('Select an appeal');
?>
<table class="tableview">
<table class="tableview">
<thead>
<tr>
<th><?= i18n('Name') ?></th>
@ -91,7 +95,7 @@ case 'managelist':
<th><?= i18n('Purpose') ?></th>
</tr>
</thead>
<?
<?
$q = $pdo->prepare("SELECT * FROM fundraising_campaigns WHERE fiscalyear='{$config['FISCALYEAR']}'");
$q->execute();
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
@ -125,11 +129,13 @@ case 'managelist':
echo " <td>$goalr->name</td>";
echo "</tr>\n";
}
?>
</table>
<script type="text/javascript"> $('.tableview').tablesorter();</script>
<br />
<?
?>
</table>
<script type="text/javascript">
$('.tableview').tablesorter();
</script>
<br />
<?
exit;
break;
@ -143,7 +149,7 @@ case 'managelist':
$q->execute();
$campaign = $q->fetch(PDO::FETCH_OBJ);
echo "<h3>$campaign->name</h3>\n";
?>
?>
<div id="campaign_tabs">
<ul>
<li><a href="#campaign_tab_overview"><span><?= i18n('Overview') ?></span></a></li>
@ -164,7 +170,7 @@ case 'managelist':
communications tab
</div>
</div>
<?
<?
exit;
break;
@ -268,7 +274,7 @@ case 'managelist':
echo '<tr><td>' . i18n('Donor Type') . '</td><td>' . i18n(ucfirst($params['donortype'])) . "</td></tr>\n";
if (is_array($params['donationhistory'])) {
echo '<tr><td>' . i18n('Donation History') . '</td><td>';
foreach ($params['donationhistory'] AS $d) {
foreach ($params['donationhistory'] as $d) {
echo i18n($donationhistorylist[$d]) . "<br />\n";
}
echo "</td></tr>\n";
@ -277,20 +283,20 @@ case 'managelist':
// echo "</td></tr>\n";
if (is_array($params['emailaddress'])) {
echo '<tr><td>' . i18n('Email Address') . '</td><td>';
foreach ($params['emailaddress'] AS $e) {
foreach ($params['emailaddress'] as $e) {
echo i18n($emailaddresslist[$e]) . "<br />\n";
}
echo "</td></tr>\n";
}
if ($params['donortype'] == 'individual' && is_array($params['individual_type'])) {
echo '<tr><td>' . i18n('Role') . '</td><td>';
foreach ($params['individual_type'] AS $e) {
foreach ($params['individual_type'] as $e) {
echo i18n($rolelist[$e]) . "<br />\n";
}
echo "</td></tr>\n";
} else if (is_array($params['contacttype'])) {
echo '<tr><td>' . i18n('Role') . '</td><td>';
foreach ($params['contacttype'] AS $e) {
foreach ($params['contacttype'] as $e) {
echo i18n(ucfirst($e)) . '<br />';
}
echo "</td></tr>\n";
@ -342,22 +348,30 @@ case 'managelist':
<form id="prospectform" onsubmit="return prospect_generatelist()">
<input type="hidden" name="fundraising_campaigns_id" value="<?= $campaign_id ?>" />
<table>
<tr><td style="width: 130px;"><?= i18n('Type') ?>:</td><td>
<label><input type="radio" name="donortype" value="organization" onchange="donortypechange()" ><?= i18n('Organization') ?></label><br />
<label><input type="radio" name="donortype" value="individual" onchange="donortypechange()" ><?= i18n('Individual') ?></label><br />
</td></tr>
<tr>
<td style="width: 130px;"><?= i18n('Type') ?>:</td>
<td>
<label><input type="radio" name="donortype" value="organization" onchange="donortypechange()"><?= i18n('Organization') ?></label><br />
<label><input type="radio" name="donortype" value="individual" onchange="donortypechange()"><?= i18n('Individual') ?></label><br />
</td>
</tr>
</table>
<div id="prospect_common" style="display: none;">
<hr />
<table>
<tr><td style="width: 130px;"><?= i18n('Donation History') ?>:</td><td>
<tr>
<td style="width: 130px;"><?= i18n('Donation History') ?>:</td>
<td>
<?
foreach ($donationhistorylist AS $k => $v) {
foreach ($donationhistorylist as $k => $v) {
echo "<label><input onchange=\"return prospect_search()\" type=\"checkbox\" name=\"donationhistory[]\" value=\"$k\">" . i18n($v) . "</label><br />\n";
}
?>
</td></tr>
<tr><td><?= i18n('Donation Level') ?>:</td><td>
</td>
</tr>
<tr>
<td><?= i18n('Donation Level') ?>:</td>
<td>
<?
$q = $pdo->prepare("SELECT * FROM fundraising_donor_levels WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY min");
$q->execute();
@ -366,42 +380,54 @@ case 'managelist':
}
echo '(disabled until the logic requirements can be established)';
?>
</td></tr>
<tr><td><?= i18n('Email Address') ?>:</td><td>
</td>
</tr>
<tr>
<td><?= i18n('Email Address') ?>:</td>
<td>
<?
foreach ($emailaddresslist AS $k => $v) {
foreach ($emailaddresslist as $k => $v) {
echo "<label><input onchange=\"return prospect_search()\" type=\"checkbox\" name=\"emailaddress[]\" value=\"$k\">" . i18n($v) . "</label><br />\n";
}
?>
</td></tr>
</td>
</tr>
</table>
</div>
<div id="prospect_individual" style="display: none;">
<table>
<tr><td style="width: 130px;"><?= i18n('Role') ?>:</td><td>
<tr>
<td style="width: 130px;"><?= i18n('Role') ?>:</td>
<td>
<?
foreach ($rolelist AS $k => $v) {
foreach ($rolelist as $k => $v) {
echo "<label><input onchange=\"return prospect_search()\" type=\"checkbox\" name=\"individual_type[]\" value=\"$k\">" . i18n($v) . "</label><br />\n";
}
?>
</td></tr></table>
</td>
</tr>
</table>
</div>
<div id="prospect_organization" style="display: none;">
<table>
<tr><td style="width: 130px;"><?= i18n('Role') ?>:</td><td>
<tr>
<td style="width: 130px;"><?= i18n('Role') ?>:</td>
<td>
<label><input onchange="return prospect_search()" type="checkbox" name="contacttype[]" value="primary"><?= i18n('Primary contacts') ?></label><br />
<label><input onchange="return prospect_search()" type="checkbox" name="contacttype[]" value="secondary"><?= i18n('Secondary contacts') ?></label><br />
</td></tr></table>
</td>
</tr>
</table>
</div>
<hr />
<div id="prospectsearchresults"></div>
</form>
<?
<?
}
exit;
break;
@ -412,8 +438,10 @@ case 'managelist':
$q->execute();
if ($r = $q->fetch(PDO::FETCH_OBJ)) {
}
$communications = array('initial' => 'Initial Communication',
'followup' => 'Follow-Up Communication');
$communications = array(
'initial' => 'Initial Communication',
'followup' => 'Follow-Up Communication'
);
foreach ($communications as $key => $name) {
echo '<h4>' . i18n($name) . "</h4>\n";
@ -545,15 +573,19 @@ function save_campaign_info()
$stmt->execute();
}
send_header('Appeal Management',
array('Committee Main' => 'committee_main.php',
send_header(
'Appeal Management',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Fundraising' => 'admin/fundraising.php'),
'fundraising');
'Fundraising' => 'admin/fundraising.php'
),
'fundraising'
);
?>
<script type="text/javascript">
$(document).ready(function() {
$(document).ready(function() {
<?
if (get_value_from_array($_GET, 'manage_campaign')) {
echo 'managecampaign(' . intval(get_value_from_array($_GET, 'manage_campaign')) . ");\n";
@ -561,36 +593,42 @@ $(document).ready(function() {
echo "managecampaigns();\n";
}
?>
});
});
function modifycampaigns() {
function modifycampaigns() {
$("#campaigndiv").show();
$("#campaigndiv").load("<? $_SERVER['PHP_SELF'] ?>?action=modify", null, function() {modifycampaignsfinish();});
}
$("#campaigndiv").load("<? $_SERVER['PHP_SELF'] ?>?action=modify", null, function() {
modifycampaignsfinish();
});
}
function managecampaigns() {
function managecampaigns() {
$("#campaigndiv").show();
$("#campaigndiv").load("<? $_SERVER['PHP_SELF'] ?>?action=managelist", null, function() {managecampaignsfinish();});
}
$("#campaigndiv").load("<? $_SERVER['PHP_SELF'] ?>?action=managelist", null, function() {
managecampaignsfinish();
});
}
var currentcampaignid;
var currentcampaignid;
function managecampaign(id) {
function managecampaign(id) {
$("#campaigndiv").show();
$("#campaigndiv").load("<? $_SERVER['PHP_SELF'] ?>?action=manage&id="+id, null, function() {managecampaignfinish();});
currentcampaignid=id;
}
$("#campaigndiv").load("<? $_SERVER['PHP_SELF'] ?>?action=manage&id=" + id, null, function() {
managecampaignfinish();
});
currentcampaignid = id;
}
function modifycampaignsfinish(){
function modifycampaignsfinish() {
$("#campaignaccordion").accordion();
// create the date pickers for our form
$(".date").datepicker({
dateFormat: 'yy-mm-dd'
});
}
}
function managecampaignfinish() {
function managecampaignfinish() {
$("#campaign_tabs").tabs({
create: function(event, ui) {
update_tab_overview();
@ -598,7 +636,7 @@ function managecampaignfinish() {
update_tab_prospects();
update_tab_communications();
},
activate: function( event, ui ) {
activate: function(event, ui) {
update_tab_overview();
update_tab_donations();
update_tab_prospects();
@ -606,159 +644,165 @@ function managecampaignfinish() {
},
selected: 0
});}
});
}
// function managecampaignfinish() {
// $("#campaign_tabs").tabs({
// show: function(event, ui) {
// switch(ui.panel.id) {
// case 'campaign_tab_overview':
// update_tab_overview();
// break;
// case 'campaign_tab_donations':
// update_tab_donations();
// break;
// case 'campaign_tab_prospects':
// update_tab_prospects();
// break;
// case 'campaign_tab_communications':
// update_tab_communications();
// break;
// }
// },
// selected: 0
// });}
// function managecampaignfinish() {
// $("#campaign_tabs").tabs({
// show: function(event, ui) {
// switch(ui.panel.id) {
// case 'campaign_tab_overview':
// update_tab_overview();
// break;
// case 'campaign_tab_donations':
// update_tab_donations();
// break;
// case 'campaign_tab_prospects':
// update_tab_prospects();
// break;
// case 'campaign_tab_communications':
// update_tab_communications();
// break;
// }
// },
// selected: 0
// });}
function campaigninfo_save(id) {
function campaigninfo_save(id) {
//if we're creating we need to do the post, and get the id it returns, so we can re-open the popup window with that id
if(id==-1) {
$("#debug").load("<? $_SERVER['PHP_SELF'] ?>?action=campaigninfo_save", $("#campaigninfo_new").serializeArray(), function() { modifycampaigns(); });
if (id == -1) {
$("#debug").load("<? $_SERVER['PHP_SELF'] ?>?action=campaigninfo_save", $("#campaigninfo_new").serializeArray(), function() {
modifycampaigns();
});
} else {
$("#debug").load("<? $_SERVER['PHP_SELF'] ?>?action=campaigninfo_save&id="+id, $("#campaigninfo_"+id).serializeArray(), function() { modifycampaigns(); });
$("#debug").load("<? $_SERVER['PHP_SELF'] ?>?action=campaigninfo_save&id=" + id, $("#campaigninfo_" + id).serializeArray(), function() {
modifycampaigns();
});
}
return false;
}
}
function update_tab_overview() {
$("#campaign_tab_overview").load("<? $_SERVER['PHP_SELF'] ?>?action=manage_tab_overview&id="+currentcampaignid);
}
function update_tab_donations() {
function update_tab_overview() {
$("#campaign_tab_overview").load("<? $_SERVER['PHP_SELF'] ?>?action=manage_tab_overview&id=" + currentcampaignid);
}
function update_tab_donations() {
$("#campaign_tab_donations").load(
"<? $_SERVER['PHP_SELF'] ?>?action=manage_tab_donations&id="+currentcampaignid,
"<? $_SERVER['PHP_SELF'] ?>?action=manage_tab_donations&id=" + currentcampaignid,
null,
function(){$('.tableview').tablesorter();}
function() {
$('.tableview').tablesorter();
}
);
}
function update_tab_prospects() {
$("#campaign_tab_prospects").load("<? $_SERVER['PHP_SELF'] ?>?action=manage_tab_prospects&id="+currentcampaignid);
}
function update_tab_communications() {
$("#campaign_tab_communications").load("<? $_SERVER['PHP_SELF'] ?>?action=manage_tab_communications&id="+currentcampaignid);
}
}
function donortypechange() {
if($("input[@name='donortype']:checked").val()=="organization") {
function update_tab_prospects() {
$("#campaign_tab_prospects").load("<? $_SERVER['PHP_SELF'] ?>?action=manage_tab_prospects&id=" + currentcampaignid);
}
function update_tab_communications() {
$("#campaign_tab_communications").load("<? $_SERVER['PHP_SELF'] ?>?action=manage_tab_communications&id=" + currentcampaignid);
}
function donortypechange() {
if ($("input[@name='donortype']:checked").val() == "organization") {
$("#prospect_common").show('slow');
$("#prospect_organization").show('slow');
$("#prospect_individual").hide('slow');
}
else if($("input[@name='donortype']:checked").val()=="individual") {
} else if ($("input[@name='donortype']:checked").val() == "individual") {
$("#prospect_common").show('slow');
$("#prospect_organization").hide('slow');
$("#prospect_individual").show('slow');
}
else {
} else {
$("#prospect_common").hide('slow');
}
prospect_search();
}
}
function prospect_search() {
$("#prospectsearchresults").load("fundraising_campaigns_prospecting.php",$("#prospectform").serializeArray());
function prospect_search() {
$("#prospectsearchresults").load("fundraising_campaigns_prospecting.php", $("#prospectform").serializeArray());
return false;
}
}
function prospect_generatelist() {
$("#prospectsearchresults").load("fundraising_campaigns_prospecting.php?generatelist=true",$("#prospectform").serializeArray(), function() {
function prospect_generatelist() {
$("#prospectsearchresults").load("fundraising_campaigns_prospecting.php?generatelist=true", $("#prospectform").serializeArray(), function() {
update_tab_prospects();
});
return false;
}
}
function prospect_removeselected() {
$("#debug").load("fundraising_campaigns.php?action=prospect_removeselected",$("#prospectremoveform").serializeArray(),function() {
function prospect_removeselected() {
$("#debug").load("fundraising_campaigns.php?action=prospect_removeselected", $("#prospectremoveform").serializeArray(), function() {
update_tab_prospects();
});
return false;
}
}
function prospect_removeall() {
$("#debug").load("fundraising_campaigns.php?action=prospect_removeall",$("#prospectremoveform").serializeArray(),function() {
function prospect_removeall() {
$("#debug").load("fundraising_campaigns.php?action=prospect_removeall", $("#prospectremoveform").serializeArray(), function() {
update_tab_prospects();
});
return false;
}
}
var comm_chooser_key = null;
function opencommunicationchooser(key) {
var comm_chooser_key = null;
function opencommunicationchooser(key) {
comm_chooser_key = key;
$("#dialog").empty();
$("#dialog").load("communication.php?action=dialog_choose&type=fundraising",null,function() {
});
}
$("#dialog").load("communication.php?action=dialog_choose&type=fundraising", null, function() {});
}
function removecommunication(id) {
$("#debug").load("fundraising_campaigns.php?action=communication_remove",{id:id},function() {
function removecommunication(id) {
$("#debug").load("fundraising_campaigns.php?action=communication_remove", {
id: id
}, function() {
update_tab_communications();
});
return false;
}
}
function comm_dialog_choose_select(id) {
// alert('im back with email id: '+id);
function comm_dialog_choose_select(id) {
// alert('im back with email id: '+id);
//get rid of hte html
var key = comm_chooser_key;
$("#dialog").empty();
$("#dialog").load("communication.php?action=dialog_edit&cloneid="+id+"&key="+key+"&fundraising_campaigns_id="+currentcampaignid,null,function() {
});
}
$("#dialog").load("communication.php?action=dialog_edit&cloneid=" + id + "&key=" + key + "&fundraising_campaigns_id=" + currentcampaignid, null, function() {});
}
function comm_dialog_choose_cancel() {
// alert('im cancelled');
}
function comm_dialog_choose_cancel() {
// alert('im cancelled');
}
function comm_dialog_edit_save(id) {
// alert("saved!");
function comm_dialog_edit_save(id) {
// alert("saved!");
update_tab_communications();
}
}
function comm_dialog_edit_cancel() {
// alert("cancelled!");
}
function comm_dialog_edit_cancel() {
// alert("cancelled!");
}
function opensendlabelsdialog(reports_id,fcid) {
function opensendlabelsdialog(reports_id, fcid) {
$("#dialog").empty();
var args = "action=dialog_gen&sid="+reports_id+"&filter[0][field]=fundraising_campaigns_id&filter[0][x]=0&filter[0][value]="+fcid;
$("#dialog").load("reports_gen.php?"+args,null,function() {
});
}
var args = "action=dialog_gen&sid=" + reports_id + "&filter[0][field]=fundraising_campaigns_id&filter[0][x]=0&filter[0][value]=" + fcid;
$("#dialog").load("reports_gen.php?" + args, null, function() {});
}
function opensendmaildialog(fcid,key) {
var dlargs = "fundraising_campaigns_id="+fcid+"&key="+key;
var dlurl = "<?= $config['SFIABDIRECTORY'] ?>/admin/reports_appeal_letters.php?"+dlargs;
function opensendmaildialog(fcid, key) {
var dlargs = "fundraising_campaigns_id=" + fcid + "&key=" + key;
var dlurl = "<?= $config['SFIABDIRECTORY'] ?>/admin/reports_appeal_letters.php?" + dlargs;
window.location.href = dlurl;
// $('#content').attr('src',dlurl);
// $('#content').attr('src',dlurl);
return false;
}
}
function opensendemaildialog(fcid,emails_id) {
function opensendemaildialog(fcid, emails_id) {
$("#dialog").empty();
$("#dialog").load("communication.php?action=dialog_send&type=fundraising&fundraising_campaigns_id="+fcid+"&emails_id="+emails_id,null,function() {
});
}
$("#dialog").load("communication.php?action=dialog_send&type=fundraising&fundraising_campaigns_id=" + fcid + "&emails_id=" + emails_id, null, function() {});
}
</script>
<?
@ -768,15 +812,16 @@ function display_campaign_form($r = null)
global $campaign_types;
global $pdo;
?>
?>
<tr>
<td><?= i18n('Name') ?></td>
<td colspan="3"><input size="40" type="text" name="name" value="<?= get_value_property_or_default($r, 'name') ?>"></td>
<td><?= i18n('Type') ?></td><td>
<td><?= i18n('Type') ?></td>
<td>
<select name="type">
<option value=""><?= i18n('Choose') ?></option>
<?
foreach ($campaign_types AS $ct) {
foreach ($campaign_types as $ct) {
if ($r->type == $ct)
$sel = 'selected="selected"';
else
@ -794,13 +839,18 @@ function display_campaign_form($r = null)
$sd = date('Y-m-d');
?>
<tr>
<td><?= i18n('Start Date') ?></td><td><input type="text" name="startdate" class="date" value="<?= $sd ?>" /></td>
<td><?= i18n('Follow-Up Date') ?></td><td><input type="text" name="followupdate" class="date" value="<?= get_value_property_or_default($r, 'followupdate') ?>" /></td>
<td><?= i18n('End Date') ?></td><td><input type="text" name="enddate" class="date" value="<?= get_value_property_or_default($r, 'enddate') ?>" /></td>
<td><?= i18n('Start Date') ?></td>
<td><input type="text" name="startdate" class="date" value="<?= $sd ?>" /></td>
<td><?= i18n('Follow-Up Date') ?></td>
<td><input type="text" name="followupdate" class="date" value="<?= get_value_property_or_default($r, 'followupdate') ?>" /></td>
<td><?= i18n('End Date') ?></td>
<td><input type="text" name="enddate" class="date" value="<?= get_value_property_or_default($r, 'enddate') ?>" /></td>
</tr>
<tr>
<td><?= i18n('Target') ?></td><td>$<input type="text" id="target" name="target" size="10" value="<?= get_value_property_or_default($r, 'target') ?>" /></td>
<td><?= i18n('Default Purpose') ?></td><td colspan="3">
<td><?= i18n('Target') ?></td>
<td>$<input type="text" id="target" name="target" size="10" value="<?= get_value_property_or_default($r, 'target') ?>" /></td>
<td><?= i18n('Default Purpose') ?></td>
<td colspan="3">
<?
$fgq = $pdo->prepare("SELECT * FROM fundraising_goals WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY name");
$fgq->execute();
@ -821,11 +871,15 @@ function display_campaign_form($r = null)
}
?>
<table cellspacing=2 width=740 border=0>
<tr><td>
<a href="#" onclick="modifycampaigns()">Create/Modify Appeals</a>
</td><td>
<a href="#" onclick="managecampaigns()">Appeal Management</a>
</td></tr></table>
<tr>
<td>
<a href="#" onclick="modifycampaigns()">Create/Modify Appeals</a>
</td>
<td>
<a href="#" onclick="managecampaigns()">Appeal Management</a>
</td>
</tr>
</table>
<hr />
<div id="campaigndiv" style="width: 780px; display: none;"></div>
<div id="dialog" style="width: 780px; display: none;"></div>

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2009 James Grant <james@lightbox.org>
*
@ -22,10 +22,10 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('fundraising_common.inc.php');
require('fundraising_common.inc.php');
$userslist = array();
$otherlist = array();
@ -43,7 +43,7 @@ if ($_POST['donortype'] == 'organization') {
$primary = '';
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
foreach ($contacttype AS $ct) {
foreach ($contacttype as $ct) {
switch ($ct) {
case 'primary':
$primary = 'yes';
@ -76,7 +76,7 @@ if ($_POST['donortype'] == 'organization') {
else
$individual_type = $_POST['individual_type'];
foreach ($individual_type AS $t) {
foreach ($individual_type as $t) {
$query = "SELECT *,MAX(year) FROM users WHERE types LIKE '%$t%' GROUP BY uid HAVING deleted='no' ORDER BY lastname,firstname";
$q = $pdo->prepare($query);
$q->execute();
@ -99,7 +99,7 @@ if (count($emailaddress) == 1) {
$emailavailablelist = array();
$emailnotavailablelist = array();
foreach ($userslist AS $uid => $u) {
foreach ($userslist as $uid => $u) {
if ($u['email'])
$emailavailablelist[$uid] = $u;
else
@ -138,7 +138,7 @@ $thisyearlist = $userslist;
// if they DO have a sponsors id, we need to check if tere is a donation record for them
// and if so, remove them if there is because tey have donated in the past
foreach ($neverlist AS $uid => $u) {
foreach ($neverlist as $uid => $u) {
if ($u['sponsors_id']) {
$q = $pdo->prepare("SELECT * FROM fundraising_donations WHERE status='received' AND sponsors_id='{$u['sponsors_id']}'");
$q->execute();
@ -153,7 +153,7 @@ foreach ($neverlist AS $uid => $u) {
// if they DO have a sponsors id, we need to check if tere is a donation record for them
// and if not remove them if there is because tey have not donated in the past
foreach ($pastlist AS $uid => $u) {
foreach ($pastlist as $uid => $u) {
if ($u['sponsors_id']) {
$q = $pdo->prepare("SELECT * FROM fundraising_donations WHERE status='received' AND sponsors_id='{$u['sponsors_id']}'");
$q->execute();
@ -169,7 +169,7 @@ foreach ($pastlist AS $uid => $u) {
$lastyear = $config['FISCALYEAR'] - 1;
foreach ($lastyearlist AS $uid => $u) {
foreach ($lastyearlist as $uid => $u) {
if ($u['sponsors_id']) {
$q = $pdo->prepare("SELECT * FROM fundraising_donations WHERE status='received' AND sponsors_id='{$u['sponsors_id']}' AND fiscalyear='$lastyear'");
$q->execute();
@ -183,7 +183,7 @@ foreach ($lastyearlist AS $uid => $u) {
}
}
foreach ($thisyearlist AS $uid => $u) {
foreach ($thisyearlist as $uid => $u) {
if ($u['sponsors_id']) {
$q = $pdo->prepare("SELECT * FROM fundraising_donations WHERE status='received' AND sponsors_id='{$u['sponsors_id']}' AND fiscalyear='{$config['FISCALYEAR']}'");
$q->execcute();
@ -205,9 +205,9 @@ foreach ($thisyearlist AS $uid => $u) {
*/
$userslist = array();
foreach ($donationhistory AS $dh) {
foreach ($donationhistory as $dh) {
$arr = $dh . 'list';
foreach ($$arr AS $uid => $u) {
foreach ($$arr as $uid => $u) {
$userslist[$uid] = $u;
}
}
@ -219,7 +219,7 @@ if ($_GET['generatelist']) {
$stmt = $pdo->prepare("UPDATE fundraising_campaigns SET filterparameters='{$params}' WHERE id='$campaignid'");
$stmt->execute();
$uids = array_keys($userslist);
foreach ($uids AS $u) {
foreach ($uids as $u) {
$stmt = $pdo->prepare("INSERT INTO fundraising_campaigns_users_link (fundraising_campaigns_id, users_uid) VALUES ('$campaignid','$u')");
$stmt->execute();
}

View File

@ -9,5 +9,3 @@ function getGoal($goal)
$q->execute();
return $q->fetch(PDO::FETCH_OBJ);
}
?>

View File

@ -64,5 +64,3 @@ if ($_POST['action'] == 'fundadd') {
error_('MySQL Error: %1', array($pdo->errorInfo()));
exit;
}
?>

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2009 James Grant <james@lightbox.org>
*
@ -22,88 +22,111 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('fundraising_common.inc.php');
require('fundraising_common.inc.php');
send_header('Fundraising Reports',
array('Committee Main' => 'committee_main.php',
send_header(
'Fundraising Reports',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Fundraising' => 'admin/fundraising.php'),
'fundraising');
'Fundraising' => 'admin/fundraising.php'
),
'fundraising'
);
?>
<script type="text/javascript">
$(document).ready( function(){
$(document).ready(function() {
$("#standardreportsaccordion").accordion();
});
});
</script>
<h3>Standard Reports</h3>
<div id="standardreportsaccordion" style="width: 600px;">
<h3><a a href="#">List of Prospects by Appeal</a></h3>
<div>
<table><tr><td>
<table>
<tr>
<td>
Choose an appeal:
</td><td>
</td>
<td>
<form method=get action="fundraising_reports_std.php">
<input type="hidden" name="id" value="1">
<select name="fundraising_campaigns_id">
<option value="">All appeals</option>
<?
$q = $pdo->prepare("SELECT * FROM fundraising_campaigns WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY name");
$q->execute();
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
$q = $pdo->prepare("SELECT * FROM fundraising_campaigns WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY name");
$q->execute();
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
echo "<option value=\"$r->id\">$r->name</option>\n";
}
?>
}
?>
</select>
</td></tr>
<tr><td>
</td>
</tr>
<tr>
<td>
Report Type:
</td><td>
</td>
<td>
<select name="type">
<!-- FIXME -->
<!--<option value="pdf">PDF</option>-->
<option value="csv">CSV</option>
</select>
</td></tr>
<tr><td colspan="2" style="text-align: center;">
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<input type="submit" value="Generate Report">
</td></tr></table>
</td>
</tr>
</table>
</form>
</div>
<h3><a href="#">Results of Appeal by Purpose</a></h3>
<div>
<form method=get action="fundraising_reports_std.php">
<input type="hidden" name="id" value="2">
<table><tr><td>
<table>
<tr>
<td>
Choose a Purpose:
</td><td>
</td>
<td>
<select name="goal">
<option value="">All purposes</option>
<?
$q = $pdo->prepare("SELECT * FROM fundraising_goals WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY name");
$q->execute();
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
$q = $pdo->prepare("SELECT * FROM fundraising_goals WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY name");
$q->execute();
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
echo "<option value=\"$r->goal\">$r->name</option>\n";
}
?>
}
?>
</select>
</td></tr>
<tr><td>
</td>
</tr>
<tr>
<td>
Report Type:
</td><td>
</td>
<td>
<select name="type">
<!-- FIXME -->
<!--<option value="pdf">PDF</option>-->
<option value="csv">CSV</option>
</select>
</td></tr>
<tr><td colspan="2" style="text-align: center;">
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<input type="submit" value="Generate Report">
</td></tr></table>
</td>
</tr>
</table>
</form>
</div>
</div>

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2009 James Grant <james@lightbox.org>
*
@ -22,12 +22,12 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('fundraising_common.inc.php');
require_once ('../lpdf.php');
require_once ('../lcsv.php');
require('fundraising_common.inc.php');
require_once('../lpdf.php');
require_once('../lcsv.php');
$id = intval($_GET['id']);
$type = $_GET['type'];
@ -38,9 +38,11 @@ if ($id && $type) {
if ($type == 'csv') {
$rep = new lcsv($config['FAIRNAME']);
} else if ($type == 'pdf') {
$rep = new lpdf(i18n($config['fairname']),
$rep = new lpdf(
i18n($config['fairname']),
i18n('List of Prospects By Appeal'),
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif');
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif'
);
$rep->newPage();
$rep->setFontSize(8);
}
@ -120,9 +122,11 @@ if ($id && $type) {
if ($type == 'csv') {
$rep = new lcsv($config['FAIRNAME'], 'Results of Appeal by Purpose', '');
} else if ($type == 'pdf') {
$rep = new lpdf(i18n($config['fairname']),
$rep = new lpdf(
i18n($config['fairname']),
i18n('Results of Appeal by Purpose'),
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif');
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif'
);
$rep->newPage();
$rep->setFontSize(8);
}

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2009 James Grant <james@lightbox.org>
*
@ -22,8 +22,8 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
@ -335,15 +335,19 @@ switch (get_value_from_array($_GET, 'action')) {
break;
}
send_header('Fundraising Setup',
array('Committee Main' => 'committee_main.php',
send_header(
'Fundraising Setup',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Fundraising' => 'admin/fundraising.php'));
'Fundraising' => 'admin/fundraising.php'
)
);
?>
<script type="text/javascript">
/* Setup the popup window */
$(document).ready(function() {
/* Setup the popup window */
$(document).ready(function() {
$("#editor_tabs").tabs({
create: function(event, ui) {
@ -351,7 +355,7 @@ $(document).ready(function() {
update_goals();
update_setup();
},
activate: function( event, ui ) {
activate: function(event, ui) {
update_levels();
update_goals();
update_setup();
@ -378,82 +382,94 @@ $(document).ready(function() {
// selected: 0
// });
// $("#organizationinfo_fundingselectiondate").datepicker({ dateFormat: 'yy-mm-dd', showOn: 'button', buttonText: "<?= i18n('calendar') ?>" });
// $("#organizationinfo_fundingselectiondate").datepicker({ dateFormat: 'yy-mm-dd', showOn: 'button', buttonText: "<?= i18n('calendar') ?>" });
});
});
function update_levels() {
$("#editor_tab_levels").load("fundraising_setup.php?gettab=levels",null,
function update_levels() {
$("#editor_tab_levels").load("fundraising_setup.php?gettab=levels", null,
function() {
$("#levelaccordion").accordion({
heightStyle: "content"
});
}
);
}
}
function level_save(id) {
if(id) var f=$("#level_form_"+id);
else var f=$("#level_form");
function level_save(id) {
if (id) var f = $("#level_form_" + id);
else var f = $("#level_form");
$("#debug").load("fundraising_setup.php?action=level_save",f.serializeArray(), function() { update_levels(); });
$("#debug").load("fundraising_setup.php?action=level_save", f.serializeArray(), function() {
update_levels();
});
return false;
}
}
function level_delete(id) {
if(confirmClick('Are you sure you want to delete this fundraising level?')) {
var f=$("#level_form_"+id);
$("#debug").load("fundraising_setup.php?action=level_delete",f.serializeArray(), function() { update_levels(); });
function level_delete(id) {
if (confirmClick('Are you sure you want to delete this fundraising level?')) {
var f = $("#level_form_" + id);
$("#debug").load("fundraising_setup.php?action=level_delete", f.serializeArray(), function() {
update_levels();
});
}
return false;
}
}
function update_goals() {
$("#editor_tab_goals").load("fundraising_setup.php?gettab=goals",null,
function update_goals() {
$("#editor_tab_goals").load("fundraising_setup.php?gettab=goals", null,
function() {
$("#goalaccordion").accordion({
heightStyle: "content"
});
$("[name=deadline]").datepicker({ dateFormat: 'yy-mm-dd'});
$("[name=deadline]").datepicker({
dateFormat: 'yy-mm-dd'
});
}
);
}
function update_setup() {
$("#editor_tab_setup").load("fundraising_setup.php?gettab=setup",null,function() { charitychange(); });
}
function setup_save() {
$("#debug").load("fundraising_setup.php?action=setup_save",$("#setup_form").serializeArray(), function() { update_setup(); });
return false;
}
function goal_save(id) {
if(id) var f=$("#goal_form_"+id);
else var f=$("#goal_form");
$("#debug").load("fundraising_setup.php?action=goal_save",f.serializeArray(), function() { update_goals(); });
return false;
}
function goal_delete(id) {
if(confirmClick('Are you sure you want to delete this fundraising goal?')) {
var f=$("#goal_form_"+id);
$("#debug").load("fundraising_setup.php?action=goal_delete",f.serializeArray(), function() { update_goals(); });
}
return false;
}
function charitychange() {
if($("input[name='registeredcharity']:checked").val()=="yes") {
$("#charitynumber").attr("disabled","");
}
else {
$("#charitynumber").attr("disabled","disabled");
}
}
function update_setup() {
$("#editor_tab_setup").load("fundraising_setup.php?gettab=setup", null, function() {
charitychange();
});
}
function setup_save() {
$("#debug").load("fundraising_setup.php?action=setup_save", $("#setup_form").serializeArray(), function() {
update_setup();
});
return false;
}
function goal_save(id) {
if (id) var f = $("#goal_form_" + id);
else var f = $("#goal_form");
$("#debug").load("fundraising_setup.php?action=goal_save", f.serializeArray(), function() {
update_goals();
});
return false;
}
function goal_delete(id) {
if (confirmClick('Are you sure you want to delete this fundraising goal?')) {
var f = $("#goal_form_" + id);
$("#debug").load("fundraising_setup.php?action=goal_delete", f.serializeArray(), function() {
update_goals();
});
}
return false;
}
function charitychange() {
if ($("input[name='registeredcharity']:checked").val() == "yes") {
$("#charitynumber").attr("disabled", "");
} else {
$("#charitynumber").attr("disabled", "disabled");
}
}
</script>
<div id="setup" style="width: 780px;">

View File

@ -2,9 +2,9 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2008 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -22,8 +22,8 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
@ -39,9 +39,9 @@ if ($_GET['id']) {
}
?>
<script type="text/javascript">
function typechange() {
var t=($("[name=sponsortype]:checked").val());
if(t=="organization") {
function typechange() {
var t = ($("[name=sponsortype]:checked").val());
if (t == "organization") {
$("#sponsor_type_organization").show();
$("#sponsor_type_individual").hide();
} else {
@ -50,7 +50,7 @@ function typechange() {
}
}
}
</script>
<?
echo '<form id="fundraisingsponsorship">';
@ -139,7 +139,7 @@ echo '<td>';
echo '<select name="status">';
echo '<option value="">' . i18n('Choose') . "</option>\n";
$statuses = array('pending', 'confirmed', 'received');
foreach ($statuses AS $status) {
foreach ($statuses as $status) {
if ($sponsorship->status == $status)
$sel = 'selected="selected"';
else
@ -154,7 +154,7 @@ echo '<td>';
echo '<select name="probability">';
echo '<option value="">' . i18n('Choose') . "</option>\n";
$probs = array('25', '50', '75', '90', '95', '99', '100');
foreach ($probs AS $prob) {
foreach ($probs as $prob) {
if ($sponsorship->probability == $prob)
$sel = 'selected="selected"';
else

View File

@ -45,7 +45,7 @@ if ($_POST['action'] == 'sponsorshipedit') {
if (count($log)) {
$stmt = $pdo->prepare("UPDATE fundraising_donations SET fundraising_type='$fundraising_type', value='$value', status='$status', probability='$probability' WHERE id='$fundraising_donations_id'");
$stmt->execute();
foreach ($log AS $l) {
foreach ($log as $l) {
$stmt = $pdo->prepare("INSERT INTO fundraising_donor_logs (sponsors_id,dt,users_id,log) VALUES (
'$current->sponsors_id',
NOW(),
@ -82,5 +82,3 @@ if ($_POST['action'] == 'sponsorshipadd') {
error_($pdo->errorInfo());
exit;
}
?>

View File

@ -2,9 +2,9 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2008 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -22,8 +22,8 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -24,10 +25,10 @@
?>
<?
include '../common.inc.php';
require_once ('../user.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
$ret = array();
foreach ($config['languages'] AS $l => $ln) {
foreach ($config['languages'] as $l => $ln) {
if ($l == $config['default_language'])
continue;
$q = $pdo->prepare("SELECT * FROM translations WHERE lang='$l' AND strmd5='" . md5(iconv('ISO-8859-1', 'UTF-8', $_GET['str'])) . "'");

View File

@ -1,7 +1,7 @@
<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Science-ation Website: https://science-ation.ca/
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
Copyright (C) 2005-2008 James Grant <james@lightbox.org>
@ -22,88 +22,90 @@
*/
?>
<?
require_once("../common.inc.php");
require_once("../user.inc.php");
require_once("../committee.inc.php");
require_once("../common.inc.php");
require_once("../user.inc.php");
require_once("../committee.inc.php");
user_auth_required('committee','admin');
user_auth_required('committee', 'admin');
send_header("Administration",
send_header(
"Administration",
array('Committee Main' => 'committee_main.php'),
"administration");
"administration"
);
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"registration.php\">".theme_icon("participant_registration")."<br />".i18n("Participant Registration")."</a></td>";
echo " <td><a href=\"committees.php\">".theme_icon("committee_management")."<br />".i18n("Committee Management")."</a></td>";
echo " <td><a href=\"judges.php\">".theme_icon("judging_management")."<br />".i18n("Judging Management")."</a></td>";
echo " <td>";
if($config['volunteer_enable'] == 'yes')
echo "<a href=\"volunteers.php\">".theme_icon("volunteer_management")."<br />".i18n("Volunteer Management")."</a>";
else
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"registration.php\">" . theme_icon("participant_registration") . "<br />" . i18n("Participant Registration") . "</a></td>";
echo " <td><a href=\"committees.php\">" . theme_icon("committee_management") . "<br />" . i18n("Committee Management") . "</a></td>";
echo " <td><a href=\"judges.php\">" . theme_icon("judging_management") . "<br />" . i18n("Judging Management") . "</a></td>";
echo " <td>";
if ($config['volunteer_enable'] == 'yes')
echo "<a href=\"volunteers.php\">" . theme_icon("volunteer_management") . "<br />" . i18n("Volunteer Management") . "</a>";
else
// {echo theme_icon("volunteer_management")."<br />".i18n("Volunteer Management")."<br /><i>(".i18n("disabled").")</i>"};
echo "</td></tr>";
echo "</table>\n";
echo "<hr />";
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"awards.php\">".theme_icon("awards_management")."<br />".i18n("Awards Management")."</a></td>";
echo " <td><a href=\"schools.php\">".theme_icon("schools_management")."<br />".i18n("Schools Management")."</a></td>";
echo " <td>";
if($config['tours_enable'] == 'yes')
echo "<a href=\"tours.php\">".theme_icon("tour_management")."<br />".i18n("Tour Management")."</a>";
else
echo "</table>\n";
echo "<hr />";
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"awards.php\">" . theme_icon("awards_management") . "<br />" . i18n("Awards Management") . "</a></td>";
echo " <td><a href=\"schools.php\">" . theme_icon("schools_management") . "<br />" . i18n("Schools Management") . "</a></td>";
echo " <td>";
if ($config['tours_enable'] == 'yes')
echo "<a href=\"tours.php\">" . theme_icon("tour_management") . "<br />" . i18n("Tour Management") . "</a>";
else
// {echo theme_icon("tour_management")."<br />".i18n("Tour Management")."<br /><i>(".i18n("disabled").")</i>";}
echo "</td>";
echo " <td>";
if($config['participant_regfee_items_enable'] == 'yes')
echo "<a href=\"regfee_items_manager.php\">".theme_icon("registration_fee_items_management")."<br />".i18n("Registration Fee Items Management")."</a>";
else
echo " <td>";
if ($config['participant_regfee_items_enable'] == 'yes')
echo "<a href=\"regfee_items_manager.php\">" . theme_icon("registration_fee_items_management") . "<br />" . i18n("Registration Fee Items Management") . "</a>";
else
// {echo theme_icon("registration_fee_items_management")."<br />".i18n("Registration Fee Items Management")."<br /><i>(".i18n("disabled").")</i>";}
echo "</td>";
echo " </tr>\n";
echo " </tr>\n";
echo " <tr>";
echo " <td><a href=\"reports.php\">".theme_icon("print/export_reports")."<br />".i18n("Print / Export Reports")."</a></td>";
echo " <td><a href=\"reports_ceremony.php\">".theme_icon("print_awards_ceremony_scripts")."<br />".i18n("Print Award Ceremony Scripts")."</a></td>";
echo " <td><a href=\"reports_editor.php\">".theme_icon("report_management")."<br />".i18n("Report Management")."</a></td>";
echo " <td><a href=\"translations.php\">".theme_icon("translations_management")."<br />".i18n("Translations Management")."</a></td>";
echo " <tr>";
echo " <td><a href=\"reports.php\">" . theme_icon("print/export_reports") . "<br />" . i18n("Print / Export Reports") . "</a></td>";
echo " <td><a href=\"reports_ceremony.php\">" . theme_icon("print_awards_ceremony_scripts") . "<br />" . i18n("Print Award Ceremony Scripts") . "</a></td>";
echo " <td><a href=\"reports_editor.php\">" . theme_icon("report_management") . "<br />" . i18n("Report Management") . "</a></td>";
echo " <td><a href=\"translations.php\">" . theme_icon("translations_management") . "<br />" . i18n("Translations Management") . "</a></td>";
echo "</td>";
echo " </tr>\n";
echo "</td>";
echo " </tr>\n";
echo " <tr>";
echo "<td></td><td></td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "<hr />";
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"winners.php\">".theme_icon("enter_winning_projects")."<br />".i18n("Enter Winning Projects")."</a></td>";
echo " <td><a href=\"cwsfregister.php\">".theme_icon("one-click_cwsf_registration")."<br />".i18n("One-Click CWSF Registration")."</a></td>";
echo " <td><a href=\"fair_stats.php\">".theme_icon("fair_stats")."<br />".i18n("Upload Fair Statistics")."</a></td>";
echo " <td><a href=\"user_list.php?show_types[]=fair\">".theme_icon("sciencefair_management")."<br />".i18n("Feeder/Upstream Fair Management")."</a></td>";
if(get_value_from_array($config, 'score_entry_enable') == 'yes') {
echo "<td><a href=\"judging_score_entry.php\">".theme_icon("judging_score_entry")."<br />".i18n("Judging Score Entry")."</a></td>";
}
echo " </tr>\n";
echo "</table>\n";
echo "<hr />";
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"communication.php\">".theme_icon("communication")."<br />".i18n("Communication (Send Emails)")."</a></td>";
echo " <td><a href=\"documents.php\">".theme_icon("internal_document_management")."<br />".i18n("Internal Document Management")."</a></td>";
echo " <td><a href=\"cms.php\">".theme_icon("website_content_management")."<br />".i18n("Website Content Management")."</a></td>";
echo " <td><a href=\"fundraising.php\">".theme_icon("fundraising")."<br />".i18n("Fundraising")."</a></td>";
if(get_value_from_array($config, 'score_entry_enable') == 'yes') {
echo "<td><a href=\"../plugins/evaluations/index.php\">".theme_icon("judging_score_entry")."<br />".i18n("Evaluations Plugin")."</a></td>";
}
//echo " <td><a href=\"../plugins/evaluations/index.php\">Go To Evaluations</a></td>";
echo " </tr>\n";
echo "</table>\n";
echo " <tr>";
echo "<td></td><td></td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "<hr />";
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"winners.php\">" . theme_icon("enter_winning_projects") . "<br />" . i18n("Enter Winning Projects") . "</a></td>";
echo " <td><a href=\"cwsfregister.php\">" . theme_icon("one-click_cwsf_registration") . "<br />" . i18n("One-Click CWSF Registration") . "</a></td>";
echo " <td><a href=\"fair_stats.php\">" . theme_icon("fair_stats") . "<br />" . i18n("Upload Fair Statistics") . "</a></td>";
echo " <td><a href=\"user_list.php?show_types[]=fair\">" . theme_icon("sciencefair_management") . "<br />" . i18n("Feeder/Upstream Fair Management") . "</a></td>";
if (get_value_from_array($config, 'score_entry_enable') == 'yes') {
echo "<td><a href=\"judging_score_entry.php\">" . theme_icon("judging_score_entry") . "<br />" . i18n("Judging Score Entry") . "</a></td>";
}
echo " </tr>\n";
echo "</table>\n";
echo "<hr />";
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"communication.php\">" . theme_icon("communication") . "<br />" . i18n("Communication (Send Emails)") . "</a></td>";
echo " <td><a href=\"documents.php\">" . theme_icon("internal_document_management") . "<br />" . i18n("Internal Document Management") . "</a></td>";
echo " <td><a href=\"cms.php\">" . theme_icon("website_content_management") . "<br />" . i18n("Website Content Management") . "</a></td>";
echo " <td><a href=\"fundraising.php\">" . theme_icon("fundraising") . "<br />" . i18n("Fundraising") . "</a></td>";
if (get_value_from_array($config, 'score_entry_enable') == 'yes') {
echo "<td><a href=\"../plugins/evaluations/index.php\">" . theme_icon("judging_score_entry") . "<br />" . i18n("Evaluations Plugin") . "</a></td>";
}
//echo " <td><a href=\"../plugins/evaluations/index.php\">Go To Evaluations</a></td>";
echo " </tr>\n";
echo "</table>\n";
send_footer();
send_footer();
?>

View File

@ -67,7 +67,7 @@ function getJudgingTeams()
while ($mr = $mq->fetch(PDO::FETCH_OBJ)) {
$u = user_load($mr->judges_id, false);
$judgelangs = join('/', $u['languages']);
foreach ($u['languages'] AS $l) {
foreach ($u['languages'] as $l) {
if (!in_array($l, $teamlangs))
$teamlangs[] = $l;
}
@ -264,5 +264,3 @@ function judges_load_all()
}
return $ret;
}
?>

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,14 +24,18 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
send_header('Judges',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'judging_management');
send_header(
'Judges',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
),
'judging_management'
);
echo '<br />';
echo '<b>' . i18n('Judges') . '</b><ul>';
echo '<li><a href="../user_invite.php?type=judge">' . i18n('Invite Judges') . '</a></li></li>';

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -26,10 +27,10 @@
// this file is meant to be used as a popup from the judging teams page to view the judge info
// it needs the judge ID passed into it.
// thus, we do not need the normal header and footer
require ('../questions.inc.php');
require('../questions.inc.php');
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
$preferencechoices = array(
@ -53,7 +54,7 @@ if ($id < 1) {
}
?>
<table class="tableview" style="margin:auto; width:100%; text-align:left">
<table class="tableview" style="margin:auto; width:100%; text-align:left">
<tr>
<th><?= i18n('First Name'); ?></th>
<th><?= i18n('Last Name'); ?></th>
@ -64,9 +65,9 @@ if ($id < 1) {
<td><?= $judgeinfo['lastname']; ?></td>
<td><?= $judgeinfo['organization']; ?></td>
</tr>
</table>
</table>
<table class="tableview" style="margin:auto; width:100%; margin-top: 5px; text-align:left">
<table class="tableview" style="margin:auto; width:100%; margin-top: 5px; text-align:left">
<tr>
<th><?= i18n('Email Address'); ?>:</th>
@ -98,7 +99,7 @@ if ($id < 1) {
<th><?= i18n($config['postalzip']); ?>:</th>
<td><?= $judgeinfo['postalcode']; ?></td>
</tr>
</table>
</table>
<?php
@ -155,8 +156,9 @@ $catPreferenceText .= '</ul>';
?>
<table class="tableview" style="margin:auto; width:100%; text-align:left; margin-top:5px;">
<tr><td>
<table class="tableview" style="margin:auto; width:100%; text-align:left; margin-top:5px;">
<tr>
<td>
<ul>
<li><strong><?= "Active for {$config['FAIRYEAR']}"; ?>: </strong>
@ -185,18 +187,18 @@ $catPreferenceText .= '</ul>';
<td>
<h3><?= i18n('Areas of Expertise'); ?></h3>
<table class="tableview" style="margin:auto;width:100%">
<?php
<?php
// grab the list of divisions, because the last fields of the table will be the sub-divisions
$q = $pdo->prepare("SELECT * FROM projectdivisions WHERE year='{$config['FAIRYEAR']}' ORDER BY id");
$q->execute();
$divs = array();
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
// grab the list of divisions, because the last fields of the table will be the sub-divisions
$q = $pdo->prepare("SELECT * FROM projectdivisions WHERE year='{$config['FAIRYEAR']}' ORDER BY id");
$q->execute();
$divs = array();
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
$divs[] = $r->id;
$divnames[$r->id] = $r->division;
}
}
foreach ($divs as $div) {
foreach ($divs as $div) {
$p = $judgeinfo['div_prefs'][$div];
echo '<tr><th align="right" >' . i18n($divnames[$div]) . ':</th>';
echo " <td>$p/5</td>";
@ -220,16 +222,17 @@ foreach ($divs as $div) {
echo '</td>';
echo '</tr>';
}
echo "<tr>\n";
echo ' <th align="right" valign="top">' . i18n('Other') . ':</th>';
echo " <td colspan=\"2\">{$judgeinfo['expertise_other']}<br />";
echo " </td>\n";
echo "</tr>\n";
?>
</table>
</td></tr>
}
echo "<tr>\n";
echo ' <th align="right" valign="top">' . i18n('Other') . ':</th>';
echo " <td colspan=\"2\">{$judgeinfo['expertise_other']}<br />";
echo " </td>\n";
echo "</tr>\n";
?>
</table>
</td>
</tr>
</table>
<?php
// get the judge's special award info

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,15 +24,19 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
include 'judges.inc.php';
send_header('Invite Judges',
array('Committee Main' => 'committee_main.php',
send_header(
'Invite Judges',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Judges' => 'admin/judges.php'));
'Judges' => 'admin/judges.php'
)
);
echo '<br />';
if ($_POST['action'] == 'invite' && $_POST['email']) {
$q = $pdo->prepare("SELECT id FROM judges WHERE email=?");

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,33 +24,34 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
include 'judges.inc.php';
send_header('Judging Division Groupings',
array('Committee Main' => 'committee_main.php',
send_header(
'Judging Division Groupings',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Judges' => 'admin/judges.php'));
'Judges' => 'admin/judges.php'
)
);
echo i18n('Instructions: The goal is to create groupings that have the least number of divisions/categories required to have at least %1 projects in the group. %1 is the number of projects that a single team can judge that you have specifed in the judge scheduler configuration. Judge division groupings indicate which divisions/categories can be judged together (by the same team of judges), so the divisons/categories should be somewhat similar to ensure there are judges that can handle judging all divisions assigned to a grouping.', array($config['max_projects_per_team']));
?>
<script language="javascript" type="text/javascript">
function addbuttonclicked(jdiv)
{
document.forms.jdivs.action.value="add";
document.forms.jdivs.jdiv_id.value=jdiv;
function addbuttonclicked(jdiv) {
document.forms.jdivs.action.value = "add";
document.forms.jdivs.jdiv_id.value = jdiv;
document.forms.jdivs.submit();
}
}
function newbuttonclicked(jdivs)
{
document.forms.jdivs.action.value="new";
document.forms.jdivs.jdivs.value=jdivs;
function newbuttonclicked(jdivs) {
document.forms.jdivs.action.value = "new";
document.forms.jdivs.jdivs.value = jdivs;
document.forms.jdivs.submit();
}
}
</script>
<?
@ -82,8 +84,8 @@ if ($config['filterdivisionbycategory'] == 'yes') {
}
} else {
$divcat = array();
foreach ($dkeys AS $d) {
foreach ($ckeys AS $c) {
foreach ($dkeys as $d) {
foreach ($ckeys as $c) {
$divcat[] = array('c' => $c, 'd' => $d);
}
}
@ -121,7 +123,7 @@ function get_all_divs()
$catkeys = array_keys($cat);
$lankeys = array_keys($langr);
foreach ($divcat AS $dc) {
foreach ($divcat as $dc) {
$y = $dc['d'];
$x = $dc['c'];
foreach ($lankeys as $z) {
@ -179,7 +181,7 @@ function get_all_divs()
}
if (get_value_from_array($_POST, 'action') == 'add' && get_value_from_array($_POST, 'jdiv_id') && count(get_value_from_array($_POST, 'cdllist', [])) > 0) {
foreach ($_POST['cdllist'] AS $selectedcdl) {
foreach ($_POST['cdllist'] as $selectedcdl) {
$q = $pdo->prepare("UPDATE judges_jdiv SET jdiv_id='{$_POST['jdiv_id']}' WHERE "
. " id='$selectedcdl' ");
$q->execute();

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005-2008 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2008-2012 Youth Science Ontario <info@youthscienceontario.ca>
@ -24,12 +24,12 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once ('../questions.inc.php');
require_once ('../projects.inc.php');
require_once ('judges.inc.php');
require_once ('anneal.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
require_once('../questions.inc.php');
require_once('../projects.inc.php');
require_once('judges.inc.php');
require_once('anneal.inc.php');
// INFO ONLY: Re Windows OS. I have not found a test that works for both methods of starting this
// SERVER_ADDR is Always null in Windows OS IIS server
@ -46,7 +46,7 @@ if (get_value_from_array($_SERVER, 'SERVER_ADDR')) {
// function TRACE_R() { }
function TRACE($str)
{
print ($str);
print($str);
}
function TRACE_R($array)
@ -302,9 +302,11 @@ function judge_available_for_round($j, $r)
return true;
foreach ($j['availability'] as $a) {
if ($a['start'] <= $r['starttime'] &&
if (
$a['start'] <= $r['starttime'] &&
$a['end'] >= $r['endtime'] &&
$a['date'] == $r['date']) {
$a['date'] == $r['date']
) {
return true;
}
}
@ -384,29 +386,29 @@ function pr_judge(&$jt, $jid)
{
global $judges;
$j = &$judges[$jid];
print (" - {$j['name']} (" . join(' ', $j['languages']) . ')');
print ('(');
print(" - {$j['name']} (" . join(' ', $j['languages']) . ')');
print('(');
foreach ($jt['cats'] as $c)
print ("c{$c}={$j['cat_prefs'][$c]} ");
print("c{$c}={$j['cat_prefs'][$c]} ");
echo ' / ';
foreach ($j['cat_prefs'] AS $k => $v) {
print ("c{$k}=$v ");
foreach ($j['cat_prefs'] as $k => $v) {
print("c{$k}=$v ");
}
echo ') (';
foreach ($jt['divs'] as $d)
print ("d{$d}={$j['div_prefs'][$d]} ");
print("d{$d}={$j['div_prefs'][$d]} ");
echo ' / ';
foreach ($j['div_prefs'] AS $k => $v) {
print ("d{$k}=$v ");
foreach ($j['div_prefs'] as $k => $v) {
print("d{$k}=$v ");
}
print (')');
print(')');
if ($j['willing_chair'] == 'yes')
print (' chair ');
print(' chair ');
print ("\n");
print("\n");
}
set_status('Loading Data From Database...');
@ -482,9 +484,11 @@ while ($r = $q->fetch(PDO::FETCH_OBJ)) {
if ($r->jdiv_id == 0)
continue;
$jdiv[$r->jdiv_id]['config'][] = array('div' => $r->projectdivisions_id,
$jdiv[$r->jdiv_id]['config'][] = array(
'div' => $r->projectdivisions_id,
'cat' => $r->projectcategories_id,
'lang' => $r->lang);
'lang' => $r->lang
);
}
$keys = array_keys($jdiv);
@ -528,7 +532,7 @@ $q = $pdo->prepare("SELECT * FROM judges_teams WHERE autocreate_type_id=1 AND ye
$q->execute();
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
$id = $r->id;
print (" $id");
print(" $id");
/* Clean out the judges_teams_link */
$stmt = $pdo->prepare("DELETE FROM judges_teams_link WHERE judges_teams_id='$id' AND year={$config['FAIRYEAR']}");
@ -575,7 +579,7 @@ while ($r = $q->fetch(PDO::FETCH_OBJ)) {
$n++;
}
}
print ("Deleted $n orphaned team linkings\n");
print("Deleted $n orphaned team linkings\n");
TRACE(" Done.\n");
set_status('Loading Judges');
@ -779,8 +783,14 @@ for ($k = 0; $k < count($keys); $k++) {
$current_jdiv = $jdiv[$jdiv_id];
$e = 100 + 10 * ($config['effort'] / 1000);
$a = new annealer($jdiv[$jdiv_id]['num_jteams'], 125, $e, 0.9,
'jdiv_compute_cost', $project_ids);
$a = new annealer(
$jdiv[$jdiv_id]['num_jteams'],
125,
$e,
0.9,
'jdiv_compute_cost',
$project_ids
);
$a->anneal();
$jdiv[$jdiv_id]['jteams'] = array();
@ -847,7 +857,7 @@ $a->anneal();
for ($x = 1; $x < count($jteam); $x++) {
$t = &$jteam[$x];
print ("Judging Team {$t['num']}: cost={$a->bucket_cost[$x]} ");
print("Judging Team {$t['num']}: cost={$a->bucket_cost[$x]} ");
$lang_array = $t['langs'];
asort($lang_array);
$langstr = implode(' ', $lang_array);
@ -856,33 +866,33 @@ for ($x = 1; $x < count($jteam); $x++) {
asort($t['cats']);
asort($t['divs']);
print ("langs=($langstr) ");
print ('cats=(');
print("langs=($langstr) ");
print('cats=(');
$catstr = '';
if (count($t['cats'])) {
$first = true;
foreach ($t['cats'] AS $cid) {
print ('c' . $cid . ' ');
foreach ($t['cats'] as $cid) {
print('c' . $cid . ' ');
if (!$first)
$catstr .= '+';
$catstr .= $cat[$cid];
$first = false;
}
}
print (') divs=(');
print(') divs=(');
$divstr = '';
if (count($t['divs'])) {
$first = true;
foreach ($t['divs'] AS $did) {
print ('d' . $did . ' ');
foreach ($t['divs'] as $did) {
print('d' . $did . ' ');
if (!$first)
$divstr .= '/';
$divstr .= $div[$did];
$first = false;
}
}
print (")\n");
print(")\n");
/* Add this judging team to the database */
$tn = "$catstr $divstr ($langstr) " . ($t['sub'] + 1);
@ -941,7 +951,7 @@ for ($x = 1; $x < count($jteam); $x++) {
}
}
print ("Unused Judges:\n");
print("Unused Judges:\n");
$ids = $a->bucket[0];
for ($y = 0; $y < count(get_value_or_default($ids, [])); $y++) {
@ -1142,7 +1152,7 @@ if ($config['scheduler_enable_sa_scheduling'] == 'yes') {
";
$r = $pdo->prepare($q);
$r->execute();
print ($pdo->errorInfo());
print($pdo->errorInfo());
/* sa_jteam for leftover judges, if any */
$sa_jteam = array();
$sa_jteam[0]['id'] = 0;
@ -1364,8 +1374,14 @@ if ($config['scheduler_enable_sa_scheduling'] == 'yes') {
$judge_ids = $r['available_judge_ids'];
$e = $config['effort'];
$a = new annealer(count($r['jteam_ids']), 25, $e, 0.98,
'judges_sa_cost_function', $judge_ids);
$a = new annealer(
count($r['jteam_ids']),
25,
$e,
0.98,
'judges_sa_cost_function',
$judge_ids
);
// $a->set_update_callback(judges_to_teams_update);
// $a->set_pick_move(judges_sa_pick_move);
$a->anneal();
@ -1383,7 +1399,7 @@ if ($config['scheduler_enable_sa_scheduling'] == 'yes') {
$t = &$sa_jteam[$tid];
print ("Judging Team {$t['id']} \"{$t['name']}\": cost={$a->bucket_cost[$x]} #=({$t['min_judges']},{$t['max_judges']}) ");
print("Judging Team {$t['id']} \"{$t['name']}\": cost={$a->bucket_cost[$x]} #=({$t['min_judges']},{$t['max_judges']}) ");
// print("langs=(");
/* $langstr="";
@ -1392,7 +1408,7 @@ if ($config['scheduler_enable_sa_scheduling'] == 'yes') {
$langstr .= $t['langs'][$y];
}
print("$langstr)");*/
print ("\n");
print("\n");
/* Do timeslot and project timeslot assignment */
$stmt = $pdo->prepare("INSERT INTO judges_teams_timeslots_link
@ -1414,7 +1430,7 @@ if ($config['scheduler_enable_sa_scheduling'] == 'yes') {
// pr_judge($t, $ids[$y]);
$j = &$judges[$jid];
print (" - {$j['name']}\n");
print(" - {$j['name']}\n");
/* Link Judges to the judging team we just inserted */
judge_team_add_judge($t['id'], $jid);
@ -1444,11 +1460,13 @@ $q = $pdo->prepare("SELECT * FROM judges_timeslots WHERE
$q->execute();
$x = 0;
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
$available_timeslots[] = array('id' => $r->id,
$available_timeslots[] = array(
'id' => $r->id,
'date' => $r->date,
'starttime' => substr($r->starttime, 0, -3),
'endtime' => substr($r->endtime, 0, -3));
print (' ' . $available_timeslots[$x]['starttime'] . ' -> '
'endtime' => substr($r->endtime, 0, -3)
);
print(' ' . $available_timeslots[$x]['starttime'] . ' -> '
. $available_timeslots[$x]['endtime'] . "\n");
$x++;
}
@ -1592,8 +1610,8 @@ for ($k = 0; $k < $keys_count; $k++) {
* printf("jteams_ids=\n");
* print_r($jteams_ids);
*/
print ('Jteams ids len=' . count($jteams_ids));
print ("n_timeslots=$n_timeslots\n");
print('Jteams ids len=' . count($jteams_ids));
print("n_timeslots=$n_timeslots\n");
set_percent(50 + ($k / $keys_count) * 50);

View File

@ -54,4 +54,3 @@ if ($pos === false) {
// usleep(1500000); // 1.5 second to allow the judges_sa to update the % status to 0% otherwise the status page will think its not running if it gets there too soon
header('Location: judges_scheduler_status.php');
exit;
?>

View File

@ -2,5 +2,3 @@
// In Windows OS with Apache server this exec call will start judges_sa.php as a separate process but the call to exec() does not return until the scheduler completes. Note the process runs at normal priority. Status can be checked with judges_scheduler_status.php. This is a temporary solution for Windows / Apache
exec('php judges_sa.php >../data/logs/judge_scheduler_' . date('YmdHis') . '.log 2>&1 &');
exit;
?>

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,105 +24,109 @@
*/
?>
<?
require ('../common.inc.php');
send_header('Scheduler Status',
array('Committee Main' => 'committee_main.php',
require('../common.inc.php');
send_header(
'Scheduler Status',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Judges' => 'admin/judges.php'));
'Judges' => 'admin/judges.php'
)
);
?>
<script type="text/javascript">
var starttime=0;
var startpercent=0;
var deltatime=0;
var deltapercent=0;
var avgtimeperpercent=0;
var remainingpercent=0;
var remainingtime=0;
var starttime = 0;
var startpercent = 0;
var deltatime = 0;
var deltapercent = 0;
var avgtimeperpercent = 0;
var remainingpercent = 0;
var remainingtime = 0;
$(document).ready(function() {
$(document).ready(function() {
updateStatus();
});
});
function updateStatus() {
var url="judges_scheduler_status_output.php";
function updateStatus() {
var url = "judges_scheduler_status_output.php";
$("#updatestatus").html("Updating...");
$.get(url,null,function(data) {
var obj=data.split(":");
$.get(url, null, function(data) {
var obj = data.split(":");
$("#schedulerstatus").html(obj[1]);
if(obj[0]=="-1") {
if (obj[0] == "-1") {
$("#schedulerpercent").html("100%");
$("#updatestatus").html("Scheduling Complete");
$("#schedulereta").html("Complete");
}
else {
$("#schedulerpercent").html(obj[0]+"%");
setTimeout('updateStatus()',5000);
} else {
$("#schedulerpercent").html(obj[0] + "%");
setTimeout('updateStatus()', 5000);
$("#updatestatus").html("Updating... Done!");
setTimeout('clearUpdatingMessage()',500);
setTimeout('clearUpdatingMessage()', 500);
var currentTime=new Date();
if(starttime==0) {
starttime=currentTime.getTime();
startpercent=obj[0];
var currentTime = new Date();
if (starttime == 0) {
starttime = currentTime.getTime();
startpercent = obj[0];
}
deltatime=currentTime.getTime()-starttime;
deltapercent=obj[0]-startpercent;
deltatime = currentTime.getTime() - starttime;
deltapercent = obj[0] - startpercent;
avgtimeperpercent=deltatime/deltapercent;
remainingpercent=100-obj[0];
remainingtime=remainingpercent*avgtimeperpercent;
if(remainingtime>0 && remainingtime!="Infinity" && obj[0]>0) {
$("#schedulereta").html(format_duration(Math.round(remainingtime/1000)));
}
else
avgtimeperpercent = deltatime / deltapercent;
remainingpercent = 100 - obj[0];
remainingtime = remainingpercent * avgtimeperpercent;
if (remainingtime > 0 && remainingtime != "Infinity" && obj[0] > 0) {
$("#schedulereta").html(format_duration(Math.round(remainingtime / 1000)));
} else
$("#schedulereta").html("Calculating...");
}
});
}
}
function clearUpdatingMessage() {
function clearUpdatingMessage() {
$("#updatestatus").html("Waiting...");
}
}
function format_duration(seconds) {
/*
function format_duration(seconds) {
/*
'1 year|:count years' => 31536000,
'1 week|:count weeks' => 604800,
'1 day|:count days' => 86400,
'1 hour|:count hours' => 3600,
'1 min|:count min' => 60,
'1 sec|:count sec' => 1);
*/
*/
var s=seconds;
var output='';
var pl='';
if(s>86400) {
var days=Math.floor(s/86400)
s-=days*86400;
if(days>1) pl='s'; else pl='';
output+=days+' day'+pl+' ';
var s = seconds;
var output = '';
var pl = '';
if (s > 86400) {
var days = Math.floor(s / 86400)
s -= days * 86400;
if (days > 1) pl = 's';
else pl = '';
output += days + ' day' + pl + ' ';
}
if(s>3600) {
var hours=Math.floor(s/3600)
s-=hours*3600;
if(hours>1) pl='s'; else pl='';
output+=hours+' hour'+pl+' ';
if (s > 3600) {
var hours = Math.floor(s / 3600)
s -= hours * 3600;
if (hours > 1) pl = 's';
else pl = '';
output += hours + ' hour' + pl + ' ';
}
if(s>60) {
var minutes=Math.floor(s/60)
s-=minutes*60;
if(minutes>1) pl='s'; else pl='';
output+=minutes+' minute'+pl+' ';
if (s > 60) {
var minutes = Math.floor(s / 60)
s -= minutes * 60;
if (minutes > 1) pl = 's';
else pl = '';
output += minutes + ' minute' + pl + ' ';
}
if(s>1) pl='s'; else pl='';
output+=s+' second'+pl
if (s > 1) pl = 's';
else pl = '';
output += s + ' second' + pl
return output;
}
}
</script>
<?

View File

@ -13,4 +13,3 @@ $r = $q->fetch(PDO::FETCH_OBJ);
$status = $r->val;
echo "$percent:$status\n";
?>

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -24,12 +25,12 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require ('../config_editor.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
require('../config_editor.inc.php');
user_auth_required('committee', 'admin');
require ('judges.inc.php');
require ('judges_schedulerconfig_check.inc.php');
require('judges.inc.php');
require('judges_schedulerconfig_check.inc.php');
$action = config_editor_handle_actions('Judge Scheduler', $config['FAIRYEAR'], 'var');
if ($action == 'update') {
@ -37,10 +38,14 @@ if ($action == 'update') {
exit;
}
send_header('Judge Scheduler Configuration',
array('Committee Main' => 'committee_main.php',
send_header(
'Judge Scheduler Configuration',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Judges' => 'admin/judges.php'));
'Judges' => 'admin/judges.php'
)
);
config_editor('Judge Scheduler', $config['FAIRYEAR'], 'var', $_SERVER['PHP_SELF']);
echo '<hr />';
@ -87,7 +92,7 @@ if ($config['judge_scheduler_percent'] == '-1') {
} else {
echo '<br />The following divisional awards problems were identified:<br /><ul>';
for ($x = 0; $x < count($missing_awards); $x++) {
print ($missing_awards[$x] . '<br />');
print($missing_awards[$x] . '<br />');
}
echo '</ul>';
echo error(i18n('There needs to be exactly one award for each division/category'));

View File

@ -62,15 +62,15 @@ function judges_scheduler_check_awards()
}
} else {
$divcat = array();
foreach ($dkeys AS $d) {
foreach ($ckeys AS $c) {
foreach ($dkeys as $d) {
foreach ($ckeys as $c) {
$divcat[] = array('c' => $c, 'd' => $d);
}
}
}
$missing_awards = array();
foreach ($divcat AS $dc) {
foreach ($divcat as $dc) {
$d = $dc['d'];
$c = $dc['c'];
$q = $pdo->prepare("SELECT award_awards.id FROM
@ -154,14 +154,14 @@ function judges_scheduler_check_judges()
echo '<tr>';
echo '<th></th><th>' . i18n('Total') . '</th>';
foreach ($config['languages'] AS $lkey => $lname)
foreach ($config['languages'] as $lkey => $lname)
echo "<th>$lkey</th>";
echo '<th>' . i18n('Total') . '</th>';
foreach ($config['languages'] AS $lkey => $lname)
foreach ($config['languages'] as $lkey => $lname)
echo "<th>$lkey</th>";
echo "</tr>\n";
foreach ($jdiv AS $jdiv_id => $jd) {
foreach ($jdiv as $jdiv_id => $jd) {
$c = $jd['num_projects']['total'];
// total judge teams calculation
@ -171,7 +171,7 @@ function judges_scheduler_check_judges()
$jdiv[$jdiv_id]['num_jteams']['total'] = $t['total'];
$totalteams['total'] += $t['total'];
// language teams calculation
foreach ($config['languages'] AS $lkey => $lname) {
foreach ($config['languages'] as $lkey => $lname) {
$c = $jd['num_projects'][$lkey];
$t['total_' . $lkey] = ceil($c / $config['max_projects_per_team'] * $config['times_judged']);
if ($t['total_' . $lkey] < $config['times_judged'] && $c > 0)
@ -183,15 +183,15 @@ function judges_scheduler_check_judges()
echo "<tr><td>Judging Division Group $jdiv_id</td>";
echo "<td align=\"center\">{$jd['num_projects']['total']}</td>";
$langstr = '';
foreach ($config['languages'] AS $lkey => $lname) {
foreach ($config['languages'] as $lkey => $lname) {
$clang = ($jd['num_projects'][$lkey] ? $jd['num_projects'][$lkey] : 0);
echo "<td align=\"center\">$clang</td>";
}
echo "<td align=\"center\">{$t['total']}</td>";
foreach ($config['languages'] AS $lkey => $lname) {
foreach ($config['languages'] as $lkey => $lname) {
$clang = ($jd['num_projects'][$lkey] ? $jd['num_projects'][$lkey] : 0);
// echo "<td align=\"center\">{$t['total']}</td>";
echo "<td align=\"center\">{$t['total_' . $lkey]}</td>";
echo "<td align=\"center\">{$t['total_' .$lkey]}</td>";
}
echo '</tr>';
@ -207,7 +207,7 @@ function judges_scheduler_check_judges()
$maxjudges['total'] = ($totalteams['total'] * $config['max_judges_per_team']);
echo i18n('Minimum number of judges required: %1', array($minjudges['total'])) . '<br />';
foreach ($config['languages'] AS $lkey => $lname) {
foreach ($config['languages'] as $lkey => $lname) {
if ($minjudges['total'] && $projecttotal)
$minjudges[$lkey] = round($totalteams['total_' . $lkey] * $config['min_judges_per_team']); // $projectlanguagetotal[$lkey]/$projecttotal*$minjudges['total']);
else
@ -234,10 +234,10 @@ function judges_scheduler_check_judges()
$ok = false;
}
foreach ($config['languages'] AS $lkey => $lname) {
foreach ($config['languages'] as $lkey => $lname) {
$lcount = 0;
foreach ($judges AS $j) {
foreach ($j['languages'] AS $jlang) {
foreach ($judges as $j) {
foreach ($j['languages'] as $jlang) {
if ($jlang == $lkey)
$lcount++;
}
@ -261,5 +261,3 @@ function judges_scheduler_check_judges()
// now check if we can find a divisional award for each division and category
return $ok;
}
?>

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,8 +24,8 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
include 'judges.inc.php';
$action = null;
@ -259,21 +260,22 @@ if (get_value_or_default($action) == 'add' && $_GET['num']) {
}
if (get_value_or_default($action) == 'edit' && $edit) {
send_header('Edit Judging Team',
array('Committee Main' => 'committee_main.php',
send_header(
'Edit Judging Team',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Judges' => 'admin/judges.php',
'Manage Judging Teams' => 'admin/judges_teams.php'));
'Manage Judging Teams' => 'admin/judges_teams.php'
)
);
?>
<script language="javascript" type="text/javascript">
function addclicked()
{
document.forms.judges.action.value="assign";
<script language="javascript" type="text/javascript">
function addclicked() {
document.forms.judges.action.value = "assign";
document.forms.judges.submit();
}
</script>
}
</script>
<?
@ -296,7 +298,7 @@ function addclicked()
echo '<tr><td>' . i18n('Awards') . ':</td><td>';
if (count(get_value_from_array($team, 'awards', []))) {
foreach ($team['awards'] AS $award) {
foreach ($team['awards'] as $award) {
echo '<a onclick="return confirmClick(\'Are you sure you want to unassign this award from this team?\')" href="judges_teams.php?action=unassign&unassign=' . $award['id'] . '&edit=' . $team['id'] . '"><img border=0 src="' . $config['SFIABDIRECTORY'] . '/images/16/button_cancel.' . $config['icon_extension'] . '"></a>';
echo ' (' . $award['award_type'] . ') ' . $award['name'] . ' <br />';
}
@ -373,17 +375,21 @@ function addclicked()
echo '<input type=submit value="' . i18n('Save Changes') . '">';
echo '</form>';
} else {
send_header('Manage Judging Teams',
array('Committee Main' => 'committee_main.php',
send_header(
'Manage Judging Teams',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Judges' => 'admin/judges.php'));
'Judges' => 'admin/judges.php'
)
);
echo '<br />';
$teams = getJudgingTeams();
$newteamnum = null;
if (count($teams)) {
// grab an array of all the current team numbers
foreach ($teams AS $team)
foreach ($teams as $team)
$teamnumbers[$team['num']] = 1;
// start at 1, and find the next available team number
@ -417,14 +423,14 @@ function addclicked()
echo '<th>Award(s)</th>';
echo '<th>Actions</th>';
echo '</tr></thead>';
foreach ($teams AS $team) {
foreach ($teams as $team) {
echo '<tr><td>#' . $team['num'] . '</td><td>';
echo $team['name'];
echo '</td>';
echo '<td>';
if (count(get_value_from_array($team, 'awards', []))) {
foreach ($team['awards'] AS $award) {
foreach ($team['awards'] as $award) {
echo $award['name'] . ' <br />';
}
} else {

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,67 +24,69 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require_once ('judges.inc.php');
require_once('judges.inc.php');
send_header('Judging Team Members',
array('Committee Main' => 'committee_main.php',
send_header(
'Judging Team Members',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Judges' => 'admin/judges.php'));
'Judges' => 'admin/judges.php'
)
);
?>
<script language="javascript" type="text/javascript">
function addbuttonclicked(team)
{
document.forms.judges.action.value="add";
document.forms.judges.team_num.value=team;
function addbuttonclicked(team) {
document.forms.judges.action.value = "add";
document.forms.judges.team_num.value = team;
document.forms.judges.submit();
}
function switchjudgeinfo()
{
if(document.forms.judges["judgelist[]"].selectedIndex != -1)
{
currentname=document.forms.judges["judgelist[]"].options[document.forms.judges["judgelist[]"].selectedIndex].text;
currentid=document.forms.judges["judgelist[]"].options[document.forms.judges["judgelist[]"].selectedIndex].value;
document.forms.judges.judgeinfobutton.disabled=false;
document.forms.judges.judgeinfobutton.value=currentname;
}
else
{
document.forms.judges.judgeinfobutton.disabled=true;
document.forms.judges.judgeinfobutton.value="<? echo i18n('Judge Info') ?>";
}
}
function switchjudgeinfo() {
if (document.forms.judges["judgelist[]"].selectedIndex != -1) {
currentname = document.forms.judges["judgelist[]"].options[document.forms.judges["judgelist[]"].selectedIndex].text;
currentid = document.forms.judges["judgelist[]"].options[document.forms.judges["judgelist[]"].selectedIndex].value;
var mousex = 0, mousey = 0;
var selectedMemberId;
document.forms.judges.judgeinfobutton.disabled = false;
document.forms.judges.judgeinfobutton.value = currentname;
function showMemberDetails(judgeId){
if(judgeId == undefined){
} else {
document.forms.judges.judgeinfobutton.disabled = true;
document.forms.judges.judgeinfobutton.value = "<? echo i18n('Judge Info') ?>";
}
}
var mousex = 0,
mousey = 0;
var selectedMemberId;
function showMemberDetails(judgeId) {
if (judgeId == undefined) {
judgeId = document.forms.judges["judgelist[]"].options[document.forms.judges["judgelist[]"].selectedIndex].value;
}
$('#infodiv').load("judges_info.php?id=" + judgeId,
function(){ eval('doShowMemberDetails(' + judgeId + ');'); }
function() {
eval('doShowMemberDetails(' + judgeId + ');');
}
);
}
}
function editMember(memberId){
if(memberId == undefined) memberId = selectedMemberId;
function editMember(memberId) {
if (memberId == undefined) memberId = selectedMemberId;
hideMemberDetails();
window.open("user_editor_window.php?id="+memberId,"UserEditor","location=no,menubar=no,directories=no,toolbar=no,width=770,height=500,scrollbars=yes");
}
window.open("user_editor_window.php?id=" + memberId, "UserEditor", "location=no,menubar=no,directories=no,toolbar=no,width=770,height=500,scrollbars=yes");
}
function hideMemberDetails(){
function hideMemberDetails() {
$('#infodiv').css("display", "none");
$('#infodivcover').css("display", "none");
}
}
function doShowMemberDetails(judgeId){
function doShowMemberDetails(judgeId) {
selectedMemberId = judgeId;
$('#infodiv').css("top", mousey + 5);
$('#infodiv').css("left", mousex + 20);
@ -93,16 +96,17 @@ function doShowMemberDetails(judgeId){
$('#infodivcover').css("display", "inline");
$('#infodivcover').css("width", $('#infodiv').width());
$('#infodivcover').css("height", $('#infodiv').height());
}
}
jQuery(document).ready(function(){
$('#infodivcover').click(function(){ editMember(); });
$(document).mousemove(function(e){
jQuery(document).ready(function() {
$('#infodivcover').click(function() {
editMember();
});
$(document).mousemove(function(e) {
mousex = e.pageX;
mousey = e.pageY;
});
});
});
</script>
<?
@ -124,7 +128,7 @@ if (get_value_from_array($_POST, 'action') == 'add' && get_value_from_array($_PO
}
$added = 0;
foreach ($_POST['judgelist'] AS $selectedjudge) {
foreach ($_POST['judgelist'] as $selectedjudge) {
// before we insert them, we need to make sure they dont already belong to this team. We can not have the same judge assigned to the same team multiple times.
$q = $pdo->prepare("SELECT * FROM judges_teams_link WHERE users_id='$selectedjudge' AND judges_teams_id='$team_id'");
@ -191,7 +195,7 @@ if (get_value_from_array($_GET, 'action') == 'empty' && get_value_from_array($_G
if (get_value_from_array($_POST, 'action') == 'saveteamnames') {
if (count($_POST['team_names'])) {
foreach ($_POST['team_names'] AS $team_id => $team_name) {
foreach ($_POST['team_names'] as $team_id => $team_name) {
$stmt = $pdo->prepare("UPDATE judges_teams SET name='" . stripslashes($team_name) . "' WHERE id='$team_id'");
$stmt->execute();
}
@ -247,11 +251,11 @@ if (get_value_from_array($_GET, 'action') == 'autoassignspecial') {
$jlist[] = $j['id'];
}
echo 'We have ' . count($jlist) . ' special awards judges to assign';
foreach ($jlist AS $jid) {
foreach ($jlist as $jid) {
$j = $judgelist[$jid];
if (is_array($j['special_award_selected']) && count($j['special_award_selected'])) {
// assing them to ALL teams for ALL awards
foreach ($j['special_award_selected'] AS $awardid) {
foreach ($j['special_award_selected'] as $awardid) {
echo "Looking for a team for award $awardid <br />";
// find the award id linked to a team
$q = $pdo->prepare("SELECT * FROM judges_teams_awards_link WHERE award_awards_id='{$awardid}' AND year='{$config['FAIRYEAR']}'");
@ -360,7 +364,7 @@ echo '<td valign="top">';
$teams = getJudgingTeams();
foreach ($teams AS $team) {
foreach ($teams as $team) {
echo '<hr>';
echo '<table width="100%">';
@ -379,7 +383,7 @@ foreach ($teams AS $team) {
echo '</td></tr>';
if (count(get_value_from_array($team, 'members', []))) {
foreach ($team['members'] AS $member) {
foreach ($team['members'] as $member) {
$j = &$judgelist[$member['id']];
echo '<tr><td>';
@ -394,7 +398,7 @@ foreach ($teams AS $team) {
$langerr = false;
$judgeerr = false;
foreach ($team['languages'] AS $teamlang) {
foreach ($team['languages'] as $teamlang) {
if (is_array($j['languages'])) {
if (!in_array($teamlang, $j['languages'])) {
$langerr = true;

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,38 +24,37 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('judges.inc.php');
require ('../projects.inc.php');
require('judges.inc.php');
require('../projects.inc.php');
send_header('Judging Teams Projects',
array('Committee Main' => 'committee_main.php',
send_header(
'Judging Teams Projects',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Judges' => 'admin/judges.php'));
'Judges' => 'admin/judges.php'
)
);
?>
<script language="javascript" type="text/javascript">
function assign(ts)
{
document.forms.teamsprojects.timeslot.value=ts;
function assign(ts) {
document.forms.teamsprojects.timeslot.value = ts;
document.forms.teamsprojects.submit();
}
}
function eligibleclick()
{
if(document.forms.teamsprojects.showeligible.checked)
{
window.location.href="judges_teams_projects.php?action=edit&edit="+document.forms.teamsprojects.edit.value+"&judges_projects_list_eligible=true";
function eligibleclick() {
if (document.forms.teamsprojects.showeligible.checked) {
window.location.href = "judges_teams_projects.php?action=edit&edit=" + document.forms.teamsprojects.edit.value + "&judges_projects_list_eligible=true";
} else {
window.location.href = "judges_teams_projects.php?action=edit&edit=" + document.forms.teamsprojects.edit.value + "&judges_projects_list_eligible=false";
}
else
{
window.location.href="judges_teams_projects.php?action=edit&edit="+document.forms.teamsprojects.edit.value+"&judges_projects_list_eligible=false";
}
}
</script>
<?
<?
echo '<br />';
$action = null;
@ -111,7 +111,7 @@ if (($action == 'edit' || $action == 'assign') && $edit) {
echo '<b>' . $team['name'] . ' (#' . $team['num'] . ')</b><br />';
if (count($team['members'])) {
$memberlist = '&nbsp;&nbsp;';
foreach ($team['members'] AS $member) {
foreach ($team['members'] as $member) {
if ($member['captain'] == 'yes')
$memberlist .= '<i>';
$memberlist .= $member['firstname'] . ' ' . $member['lastname'];
@ -132,7 +132,7 @@ if (($action == 'edit' || $action == 'assign') && $edit) {
$award_ids = array();
if (count($team['awards'])) {
$awardlist = '&nbsp;&nbsp;';
foreach ($team['awards'] AS $award) {
foreach ($team['awards'] as $award) {
$awardlist .= $award['name'];
$awardlist .= ', ';
$award_ids[] = $award['id'];
@ -318,16 +318,16 @@ if (($action == 'edit' || $action == 'assign') && $edit) {
echo '</tr></thead>';
$teams = getJudgingTeams();
foreach ($teams AS $team) {
foreach ($teams as $team) {
echo '<tr>';
echo '<td width="200">';
echo '<b>' . $team['name'] . ' (#' . $team['num'] . ')</b><br />';
$memberlist = '';
if (count(get_value_from_array($team, 'members', []))) {
foreach ($team['members'] AS $member) {
foreach ($team['members'] as $member) {
echo '&nbsp;&nbsp;';
$err = false;
foreach ($team['languages_projects'] AS $projectlang) {
foreach ($team['languages_projects'] as $projectlang) {
if (!in_array($projectlang, $member['languages_array'])) {
$err = true;
break;

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,18 +24,20 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require_once ('judges.inc.php');
require_once('judges.inc.php');
$action = null;
$round_str = array('timeslot' => 'Judging Timeslot',
$round_str = array(
'timeslot' => 'Judging Timeslot',
'divisional1' => 'Divisional Round 1',
'divisional2' => 'Divisional Round 2',
'grand' => 'Grand Awards',
'special' => 'Special Awards');
'special' => 'Special Awards'
);
if (array_key_exists('action', $_GET))
$action = $_GET['action'];
if (array_key_exists('action', $_POST))
@ -58,8 +61,8 @@ if ($action == 'assign') {
// the db handles the uniqueness (to ensure the same timeslot isnt assigned to the same team more than once)
// so all we'll do here is just mass insert without regards for whats already there.
if (count($_POST['teams']) && count($_POST['timeslots'])) {
foreach ($_POST['teams'] AS $tm) {
foreach ($_POST['timeslots'] AS $ts) {
foreach ($_POST['teams'] as $tm) {
foreach ($_POST['timeslots'] as $ts) {
$stmt = $pdo->prepare("INSERT INTO judges_teams_timeslots_link (judges_teams_id,judges_timeslots_id,year)
VALUES ('$tm','$ts','{$config['FAIRYEAR']}')");
$stmt->execute();
@ -71,48 +74,51 @@ if ($action == 'assign') {
}
}
send_header('Judging Teams Timeslots',
array('Committee Main' => 'committee_main.php',
send_header(
'Judging Teams Timeslots',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Judges' => 'admin/judges.php'));
'Judges' => 'admin/judges.php'
)
);
?>
<script language="javascript" type="text/javascript">
function checkall(what)
{
for(i=0;i<document.forms.teamstimeslots.elements.length;i++) {
if(document.forms.teamstimeslots.elements[i].name==what+"[]")
document.forms.teamstimeslots.elements[i].checked=true;
function checkall(what) {
for (i = 0; i < document.forms.teamstimeslots.elements.length; i++) {
if (document.forms.teamstimeslots.elements[i].name == what + "[]")
document.forms.teamstimeslots.elements[i].checked = true;
}
return false;
}
function checknone(what)
{
for(i=0;i<document.forms.teamstimeslots.elements.length;i++) {
if(document.forms.teamstimeslots.elements[i].name==what+"[]")
document.forms.teamstimeslots.elements[i].checked=false;
}
function checknone(what) {
for (i = 0; i < document.forms.teamstimeslots.elements.length; i++) {
if (document.forms.teamstimeslots.elements[i].name == what + "[]")
document.forms.teamstimeslots.elements[i].checked = false;
}
return false;
}
function checkinvert(what)
{
}
for(i=0;i<document.forms.teamstimeslots.elements.length;i++) {
if(document.forms.teamstimeslots.elements[i].name==what+"[]")
document.forms.teamstimeslots.elements[i].checked=!document.forms.teamstimeslots.elements[i].checked;
function checkinvert(what) {
for (i = 0; i < document.forms.teamstimeslots.elements.length; i++) {
if (document.forms.teamstimeslots.elements[i].name == what + "[]")
document.forms.teamstimeslots.elements[i].checked = !document.forms.teamstimeslots.elements[i].checked;
}
return false;
}
}
</script>
<?
<?
echo '<br />';
@ -184,14 +190,14 @@ echo '<th>' . i18n('Timeslots') . '</th>';
echo '</tr>';
$teams = getJudgingTeams();
foreach ($teams AS $team) {
foreach ($teams as $team) {
echo '<tr>';
echo '<td><input type="checkbox" name="teams[]" value="' . $team['id'] . '" /></td>';
echo '<td>';
echo '<b>' . $team['name'] . ' (#' . $team['num'] . ')</b><br />';
$memberlist = '';
if (count(get_value_from_array($team, 'members', []))) {
foreach ($team['members'] AS $member) {
foreach ($team['members'] as $member) {
echo '&nbsp;&nbsp;';
if ($member['captain'] == 'yes')
echo '<i>';

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,15 +24,17 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
$round_str = array('timeslot' => 'Judging Timeslot',
$round_str = array(
'timeslot' => 'Judging Timeslot',
'divisional1' => 'Divisional Round 1',
'divisional2' => 'Divisional Round 2',
'grand' => 'Grand Awards',
'special' => 'Special Awards');
'special' => 'Special Awards'
);
if (array_key_exists('action', $_POST))
$action = $_POST['action'];
@ -218,16 +221,24 @@ if ($action == 'savemultiple') {
}
if ($action == '') {
send_header('Judging Rounds and Timeslots',
array('Committee Main' => 'committee_main.php',
send_header(
'Judging Rounds and Timeslots',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Judges' => 'admin/judges.php'));
'Judges' => 'admin/judges.php'
)
);
} else {
send_header('Judging Rounds and Timeslots',
array('Committee Main' => 'committee_main.php',
send_header(
'Judging Rounds and Timeslots',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Judges' => 'admin/judges.php',
'Judging Rounds and Timeslots' => 'admin/judges_timeslots.php'));
'Judging Rounds and Timeslots' => 'admin/judges_timeslots.php'
)
);
}
echo '<br />';

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005-2006 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005-2006 James Grant <james@lightbox.org>
@ -23,14 +23,18 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require_once ('judges.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
require_once('judges.inc.php');
user_auth_required('committee', 'admin');
send_header('Judging Score Entry - Update',
array('Committee Main' => 'committee_main.php',
send_header(
'Judging Score Entry - Update',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Judging Score Entry' => 'admin/judging_score_entry.php'));
'Judging Score Entry' => 'admin/judging_score_entry.php'
)
);
$year = $config['FAIRYEAR'];
$project_id = NULL;

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005-2006 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005-2006 James Grant <james@lightbox.org>
@ -23,9 +23,9 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require_once ('judges.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
require_once('judges.inc.php');
user_auth_required('committee', 'admin');
if ($_GET['year'])
@ -38,9 +38,13 @@ if ($_GET['csv'] == 'yes') {
header('Cache-Control: no-cache');
header('Content-disposition: inline; filename=judging_scores.csv');
} else {
send_header('Judging Score Entry',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'));
send_header(
'Judging Score Entry',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
)
);
}
?>
<?

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005-2006 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005-2006 James Grant <james@lightbox.org>
@ -28,9 +28,9 @@
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once ('../register_participants.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
require_once('../register_participants.inc.php');
$auth_type = user_auth_required(array('fair', 'committee'), 'admin');
@ -241,28 +241,27 @@ function project_load()
}
// output the current status
?>
?>
<script language="javascript" type="text/javascript">
function countwords()
{
var wordmax=<?= $config['participant_project_summary_wordmax']; ?>;
var summaryobj=document.getElementById('summary');
var wordcountobj=document.getElementById('wordcount');
var wordcountmessageobj=document.getElementById('wordcountmessage');
<script language="javascript" type="text/javascript">
function countwords() {
var wordmax = <?= $config['participant_project_summary_wordmax']; ?>;
var summaryobj = document.getElementById('summary');
var wordcountobj = document.getElementById('wordcount');
var wordcountmessageobj = document.getElementById('wordcountmessage');
var wordarray=summaryobj.value.replace(/\s+/g," ").split(" ");
var wordcount=wordarray.length;
var wordarray = summaryobj.value.replace(/\s+/g, " ").split(" ");
var wordcount = wordarray.length;
if(wordcount>wordmax)
wordcountmessageobj.className="incomplete";
if (wordcount > wordmax)
wordcountmessageobj.className = "incomplete";
else
wordcountmessageobj.className="complete";
wordcountmessageobj.className = "complete";
wordcountobj.innerHTML=wordcount;
}
</script>
<?
wordcountobj.innerHTML = wordcount;
}
</script>
<?
if (!$projectinfo) {
echo error(i18n('Invalid project to edit'));
@ -273,23 +272,27 @@ function countwords()
<form id="project_form">
<input type="hidden" name="id" value="<?= $projectinfo->id ?>">
<table>
<tr> <td><?= i18n('Project Title') ?>: </td>
<tr>
<td><?= i18n('Project Title') ?>: </td>
<td><input type="text" name="title" size="50" value="<?= htmlspecialchars($projectinfo->title, null, 'ISO8859-1') ?>" /><?= REQUIREDFIELD ?>
<?
<?
if ($config['participant_project_title_charmax'])
echo i18n('(Max %1 characters)', array($config['participant_project_title_charmax']));
?>
</td>
</tr><tr>
</tr>
<tr>
<td><?= i18n('Project Number') ?>: </td>
<td><input type="text" name="projectnumber" size="10" value="<?= $projectinfo->projectnumber ?>" />
<input type="button" id="project_regenerate_number" value="<?= i18n('Re-Generate Project Number') ?>" />
</td>
</tr><tr>
</tr>
<tr>
<td><?= i18n('Project Sort') ?>: </td>
<td><input type="text" name="projectsort" size="10" value="<?= $projectinfo->projectsort ?>" /></td></tr>
<td><input type="text" name="projectsort" size="10" value="<?= $projectinfo->projectsort ?>" /></td>
</tr>
<?
<?
if ($config['project_type'] == 'yes') {
$q = $pdo->prepare('SELECT * FROM projecttypes ORDER BY type');
$q->execute();
@ -311,10 +314,11 @@ function countwords()
<tr>
<td><?= i18n('Age Category') ?>: </td>
<td><?= i18n($agecategories[$projectcategories_id]['category']) ?> (<?= i18n('Grades %1-%2', array($agecategories[$projectcategories_id]['mingrade'], $agecategories[$projectcategories_id]['maxgrade'])) ?>)</td>
</tr><tr>
</tr>
<tr>
<td><?= i18n('Division') ?>: </td>
<td>
<?
<?
// ###### Feature Specific - filtering divisions by category
if ($config['filterdivisionbycategory'] == 'yes') {
$q = $pdo->prepare('SELECT projectdivisions.* FROM projectdivisions,projectcategoriesdivisions_link WHERE projectdivisions.id=projectdivisions_id AND projectcategories_id=' . $projectcategories_id . " AND projectdivisions.year='" . $config['FAIRYEAR'] . "' AND projectcategoriesdivisions_link.year='" . $config['FAIRYEAR'] . "' ORDER BY division");
@ -340,11 +344,9 @@ function countwords()
if ($config['usedivisionselector'] == 'yes') {
?>
<script language="javascript" type="text/javascript">
function openDivSelWindow()
{
divselwin=window.open('register_participants_project_divisionselector.php','divsel','width=500,height=220,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no')
if(divselwin.opener==null) divselwin.opener=self;
function openDivSelWindow() {
divselwin = window.open('register_participants_project_divisionselector.php', 'divsel', 'width=500,height=220,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no')
if (divselwin.opener == null) divselwin.opener = self;
return false;
}
</script>
@ -363,7 +365,7 @@ function countwords()
else
$currentlang = $_SESSION['lang'];
foreach ($config['languages'] AS $key => $val) {
foreach ($config['languages'] as $key => $val) {
if ($currentlang == $key)
$selected = 'selected="selected"';
else
@ -478,7 +480,8 @@ function countwords()
echo '<tr><td>' . i18n('Feedback') . ': </td><td><textarea cols="60" rows="4" id="feedback" name="feedback">' . htmlspecialchars($projectinfo->feedback, null, 'ISO8859-1') . '</textarea><br />';
?>
</td></tr>
</td>
</tr>
</table>
<input type="button" id="project_save" value="<?= i18n('Save Project Information') ?>" />
</form>

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2007 James Grant <james@lightbox.org>
*
@ -22,30 +22,39 @@
*/
?>
<?
require ('../common.inc.php');
require ('../tableeditor.class.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require('../tableeditor.class.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
send_header('Registration Fee Items Manager',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'registration_fee_items_management');
send_header(
'Registration Fee Items Manager',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
),
'registration_fee_items_management'
);
$editor = new TableEditor('regfee_items',
$editor = new TableEditor(
'regfee_items',
array(
'name' => 'Name (for regfee line)',
'description' => 'Description',
'cost' => 'Cost',
'per' => 'Cost Per',
), null,
array('year' => $config['FAIRYEAR']));
),
null,
array('year' => $config['FAIRYEAR'])
);
$editor->setPrimaryKey('id');
$editor->setDefaultSortField('description');
$editor->setRecordType('Registration Fee Item');
$editor->setFieldOptions('per', array(array('key' => 'student', 'val' => 'Student'),
array('key' => 'project', 'val' => 'Project')));
$editor->setFieldOptions('per', array(
array('key' => 'student', 'val' => 'Student'),
array('key' => 'project', 'val' => 'Project')
));
$editor->setFieldInputType('per', 'select');
$editor->filterList('year', $config['FAIRYEAR']);

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,14 +24,18 @@
*/
?>
<?
require ('../common.inc.php');
require('../common.inc.php');
include '../config/signaturepage_or_permissionform.php';
require_once ('../user.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
send_header('Participant Registration',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'participant_registration');
send_header(
'Participant Registration',
array(
'Committee Main' => 'committee_main.php',
'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 />';

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005-2006 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005-2006 James Grant <james@lightbox.org>
@ -27,8 +27,8 @@
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
$auth_type = user_auth_required(array('fair', 'committee'), 'admin');
@ -95,13 +95,19 @@ switch ($action) {
}
if ($auth_type == 'committee') {
send_header('Registration Management',
array('Committee Main' => 'committee_main.php',
send_header(
'Registration Management',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Participant Registration' => 'admin/registration.php'));
'Participant Registration' => 'admin/registration.php'
)
);
} else {
send_header('Student/Project Management',
array('Fair Main' => 'fair_main.php'));
send_header(
'Student/Project Management',
array('Fair Main' => 'fair_main.php')
);
}
?>
@ -109,7 +115,7 @@ if ($auth_type == 'committee') {
<div id="student_editor" title="Student/Project Editor" style="display: none">
<div id="editor_tabs" >
<div id="editor_tabs">
<ul>
<li><a href="#editor_tab_reg"><span><?= i18n('Registration') ?></span></a></li>
<li><a href="#editor_tab_students"><span><?= i18n('Students') ?></span></a></li>
@ -124,12 +130,10 @@ if ($auth_type == 'committee') {
<script language="javascript" type="text/javascript">
var registrations_id = 0;
var registrations_new = 0;
var registrations_id = 0;
var registrations_new = 0;
function popup_editor(id, open_tab)
{
function popup_editor(id, open_tab) {
var w = (document.documentElement.clientWidth * 0.9);
var h = (document.documentElement.clientHeight * 0.9);
@ -137,7 +141,7 @@ function popup_editor(id, open_tab)
registrations_new = 0;
if(id == -1) {
if (id == -1) {
open_tab = 'reg';
registrations_new = 1;
}
@ -149,10 +153,10 @@ function popup_editor(id, open_tab)
/* Then we'll select a tab to force a reload */
switch(open_tab) {
switch (open_tab) {
case 'reg':
/* If we open on the reg tab, disable the others until a save */
$('#editor_tabs').tabs('option', 'disabled', [1,2]);
$('#editor_tabs').tabs('option', 'disabled', [1, 2]);
$('#editor_tabs').tabs('option', 'active', 0);
break;
@ -174,16 +178,15 @@ function popup_editor(id, open_tab)
$("#student_editor").dialog('open');
return true;
}
}
function update_students(numstudents)
{
function update_students(numstudents) {
var id = registrations_id;
var req = "action=students_load&id="+id;
if(numstudents != 0 && numstudents != undefined) req = req+"&numstudents="+numstudents;
var req = "action=students_load&id=" + id;
if (numstudents != 0 && numstudents != undefined) req = req + "&numstudents=" + numstudents;
$("#editor_tab_students").load("student_editor.php?"+req, '',
$("#editor_tab_students").load("student_editor.php?" + req, '',
function(responseText, textStatus, XMLHttpRequest) {
/* Attach to events we care about */
$("#students_num").change(function() {
@ -193,17 +196,17 @@ function update_students(numstudents)
$("#students_save").click(function() {
var id = registrations_id;
$("#debug").load("student_editor.php?action=students_save&id="+id, $("#students_form").serializeArray());
$("#debug").load("student_editor.php?action=students_save&id=" + id, $("#students_form").serializeArray());
});
$(".students_remove_button").click(function() {
var id = registrations_id;
var sid = $("#"+this.id +"_students_id").val();
var sid = $("#" + this.id + "_students_id").val();
var conf = confirmClick('<?= i18n('Are you sure you want to remove this student from the project?') ?>');
if(conf == false) return false;
if (conf == false) return false;
$("#debug").load("student_editor.php?action=student_remove&id="+id+"&students_id="+sid, '',
$("#debug").load("student_editor.php?action=student_remove&id=" + id + "&students_id=" + sid, '',
function(responseText, textStatus, XMLHttpRequest) {
update_students();
});
@ -213,19 +216,18 @@ function update_students(numstudents)
}
);
return false;
}
}
function update_project()
{
function update_project() {
var id = registrations_id;
$("#editor_tab_project").load("project_editor.php?action=project_load&id="+id, '',
$("#editor_tab_project").load("project_editor.php?action=project_load&id=" + id, '',
function(responseText, textStatus, XMLHttpRequest) {
/* Attach to regenerate button */
$("#project_regenerate_number").click(function() {
var id = registrations_id;
/* Call for regen, and when that's done reload the project screen (and rebind everything),
* pass all the form data in, because regen does a save first */
$("#debug").load("project_editor.php?action=project_regenerate_number&id="+id,$("#project_form").serializeArray(),
$("#debug").load("project_editor.php?action=project_regenerate_number&id=" + id, $("#project_form").serializeArray(),
function(responseText, textStatus, XMLHttpRequest) {
update_project();
});
@ -234,37 +236,35 @@ function update_project()
/* Attach to save button */
$("#project_save").click(function() {
var id = registrations_id;
$("#debug").load("project_editor.php?action=project_save&id="+id, $("#project_form").serializeArray());
$("#debug").load("project_editor.php?action=project_save&id=" + id, $("#project_form").serializeArray());
});
}
);
return false;
}
}
function delete_registration(id)
{
registrations_id=id;
function delete_registration(id) {
registrations_id = id;
var conf = confirmClick('<?= i18n('Are you sure you want to completely delete this registration?') ?>');
if(conf == false) return false;
if (conf == false) return false;
$("#debug").load("<?= $_SERVER['PHP_SELF'] ?>?action=delete&id="+id,{},
$("#debug").load("<?= $_SERVER['PHP_SELF'] ?>?action=delete&id=" + id, {},
function(responseText, textStatus, XMLHttpRequest) {
var id = registrations_id;
$("#row_"+id).remove();
$("#row_" + id).remove();
});
}
}
function update_reg()
{
function update_reg() {
var id = registrations_id;
$("#editor_tab_reg").load("student_editor.php?action=registration_load&id="+id, '',
$("#editor_tab_reg").load("student_editor.php?action=registration_load&id=" + id, '',
function(responseText, textStatus, XMLHttpRequest) {
/* Attach to save button */
$("#registration_save").click(function() {
var id = registrations_id;
$('#debug').load("student_editor.php?action=registration_save&id="+id, $("#registration_form").serializeArray());
$('#debug').load("student_editor.php?action=registration_save&id=" + id, $("#registration_form").serializeArray());
/* Enable the other tabs now after a save, FIXME: should be
* after a successful save, but we should use on-the-fly form
* validation to disable the save button, so the extra callback/error
@ -277,37 +277,39 @@ function update_reg()
}
);
return false;
}
}
$(document).ready(function() {
$(document).ready(function() {
$("#student_editor").dialog({
bgiframe: true, autoOpen: false,
modal: true, resizable: false,
bgiframe: true,
autoOpen: false,
modal: true,
resizable: false,
draggable: false,
buttons: {
/* "<?= i18n('Cancel') ?>": function() {
/* "<?= i18n('Cancel') ?>": function() {
$(this).dialog("close");
},
"<?= i18n('Save') ?>": function() {
save_report();
$(this).dialog("close"); */
"<?= i18n('Close') ?>": function() {
// save_report();
// save_report();
$(this).dialog("close");
}
},
close: function() {
/* Reload the row after the dialog close in case the info has changed */
var id = registrations_id;
if(registrations_new == true) {
if (registrations_new == true) {
/* Create a row before loading it */
$("#registration_list").append("<tr id=\"row_"+id+"\"></tr>");
$("#registration_list").append("<tr id=\"row_" + id + "\"></tr>");
}
$("#" + $.escapeSelector("row_" + id)).load("<? $_SERVER['PHP_SELF'] ?>?action=load_row&id="+id);
$("#" + $.escapeSelector("row_" + id)).effect('highlight',{},500);
$("#" + $.escapeSelector("row_" + id)).load("<? $_SERVER['PHP_SELF'] ?>?action=load_row&id=" + id);
$("#" + $.escapeSelector("row_" + id)).effect('highlight', {}, 500);
}
});
@ -319,7 +321,7 @@ $(document).ready(function() {
update_reg();
},
activate: function( event, ui ) {
activate: function(event, ui) {
update_students();
update_project();
update_reg();
@ -349,38 +351,45 @@ $(document).ready(function() {
$("#newproject").on("click", (function() {
popup_editor(-1);
}
));
});
}));
});
</script>
<br />
<table width="100%">
<tr><td>
<tr>
<td>
<?= i18n('Choose Status') ?>:
<form name="statuschangerform" method="get" action="registration_list.php">
<select name="showstatus" onchange="document.forms.statuschangerform.submit()">
<?
// if there is no reg fee, then we dont need to show this status, because nobody will ever be in this status
$status_str = array('' => 'Any Status', 'complete' => 'Complete',
<?
// if there is no reg fee, then we dont need to show this status, because nobody will ever be in this status
$status_str = array(
'' => 'Any Status',
'complete' => 'Complete',
'paymentpending' => ($config['regfee'] > 0) ? 'Payment Pending' : '',
'completeorpaymentpending' => ($config['regfee'] > 0) ? 'Complete or Payment Pending' : '',
'open' => 'Open', 'new' => 'New');
'open' => 'Open',
'new' => 'New'
);
$showstatus = $_GET['showstatus'];
$showstatus = $_GET['showstatus'];
foreach ($status_str as $s => $str) {
foreach ($status_str as $s => $str) {
if ($str == '')
continue;
$sel = ($showstatus == $s) ? 'selected="selected"' : '';
echo "<option $sel value=\"$s\">" . i18n($str) . "</option>\n";
}
?>
</select></form></td>
}
?>
</select>
</form>
</td>
<td align="right"><button id="newproject"><?= i18n('Create New Project') ?></button></td>
</tr></table>
</tr>
</table>
<?
if ($showstatus) {
@ -519,8 +528,8 @@ function print_row($r)
echo "<td $scl>$pn</td>";
echo "<td $pcl>{$r->title}</td>";
echo "<td $scl>".i18n($cats[$r->projectcategories_id])."</td>";
echo "<td $scl>".i18n($divs[$r->projectdivisions_id])."</td>";
echo "<td $scl>" . i18n($cats[$r->projectcategories_id]) . "</td>";
echo "<td $scl>" . i18n($divs[$r->projectdivisions_id]) . "</td>";

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -27,16 +28,20 @@
?>
<?
require ('../common.inc.php');
require('../common.inc.php');
include '../config/signaturepage_or_permissionform.php';
require_once ('../user.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('../register_participants.inc.php');
require('../register_participants.inc.php');
send_header("Input Received $plural_participationform",
array('Committee Main' => 'committee_main.php',
send_header(
"Input Received $plural_participationform",
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Participant Registration' => 'admin/registration.php'));
'Participant Registration' => 'admin/registration.php'
)
);
echo '<br />';
$showformatbottom = true;
@ -221,7 +226,7 @@ if (get_value_from_array($_POST, 'action') == 'received' && get_value_from_array
// actually set it to 'complete'
$stmt = $pdo->prepare("UPDATE registrations SET status='complete' WHERE num='$regnum' AND year='{$config['FAIRYEAR']}'");
$stmt->execute();
foreach ($recipients AS $recip) {
foreach ($recipients as $recip) {
$to = $recip['to'];
$subsub = array();
$subbod = array(
@ -241,7 +246,7 @@ if (get_value_from_array($_POST, 'action') == 'received' && get_value_from_array
// actually set it to 'paymentpending'
$stmt = $pdo->prepare("UPDATE registrations SET status='paymentpending' WHERE num='$regnum' AND year='{$config['FAIRYEAR']}'");
$stmt->execute();
foreach ($recipients AS $recip) {
foreach ($recipients as $recip) {
$to = $recip['to'];
$subsub = array();
$subbod = array(
@ -281,11 +286,11 @@ if ($showformatbottom) {
echo '<input id="registration_number" type="text" size="15" name="registration_number" />';
echo '<input type="submit" value="' . i18n('Lookup Registration Number') . '" />';
echo '</form>';
?>
?>
<script type="text/javascript">
document.forms.inputform.registration_number.focus();
</script>
<?
<?
echo '<br/><br/>';
echo '</td></tr><tr><td>';

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005-2006 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005-2006 James Grant <james@lightbox.org>
@ -23,20 +23,24 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('../register_participants.inc.php');
require('../register_participants.inc.php');
if (get_value_from_array($_GET, 'year'))
$year = $_GET['year'];
else
$year = $config['FAIRYEAR'];
send_header('Registration Statistics',
array('Committee Main' => 'committee_main.php',
send_header(
'Registration Statistics',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Participant Registration' => 'admin/registration.php'));
'Participant Registration' => 'admin/registration.php'
)
);
echo '<br />';
echo i18n('Choose Status') . ':';
@ -215,18 +219,18 @@ echo "<tr><td colspan=\"2\"><h3>{$status_str[$showstatus]} - " . i18n('Students
echo '<tr><td colspan="2">';
echo '<table class="tableview" width="100%">';
echo '<thead><tr><td width="50%"></td>';
foreach ($cats AS $c => $cn) {
foreach ($cats as $c => $cn) {
echo "<th>$cn<br /><nobr>" . i18n('Stud | Proj') . '</nobr></th>';
}
echo '<th>' . i18n('Total') . '<br /><nobr>' . i18n('Stud | Proj') . '</th>';
echo '</tr></thead>';
foreach ($divs AS $d => $dn) {
foreach ($divs as $d => $dn) {
echo "<tr><td>$dn</td>";
$tstud = 0;
$tstudcat = array();
$tproj = 0;
$tprojcat = array();
foreach ($cats AS $c => $cn) {
foreach ($cats as $c => $cn) {
echo '<td align="center">';
echo ($stats_students_catdiv[$c][$d] ?? 0);
@ -250,7 +254,7 @@ foreach ($divs AS $d => $dn) {
echo '<tr><td><b>' . i18n('Total') . '</b></td>';
$tstud = 0;
$tproj = 0;
foreach ($cats AS $c => $cn) {
foreach ($cats as $c => $cn) {
echo '<td align="center"><b>';
echo ($tstudcat[$c] ? $tstudcat[$c] : 0);
echo '&nbsp;&nbsp;&nbsp;&nbsp;';
@ -274,18 +278,18 @@ echo "<tr><td colspan=\"2\"><h3>{$status_str[$showstatus]} - " . i18n('Students
echo '<tr><td colspan="2">';
echo '<table class="tableview" width="100%">';
echo '<thead><tr><td width="50%"></td>';
foreach ($cats AS $c => $cn) {
foreach ($cats as $c => $cn) {
echo "<th>$cn<br /><nobr>" . i18n('Stud | Proj') . '</nobr></th>';
}
echo '<th>' . i18n('Total') . '<br /><nobr>' . i18n('Stud | Proj') . '</nobr></th>';
echo '</tr></thead>';
asort($schools_names);
foreach ($schools_names AS $id => $sn) {
foreach ($schools_names as $id => $sn) {
echo "<tr><td>$sn</td>";
$tstud = 0;
$tproj = 0;
foreach ($cats AS $c => $cn) {
foreach ($cats as $c => $cn) {
echo '<td align="center">' . ($stats_students_schools[$c][$id] ? $stats_students_schools[$c][$id] : 0);
echo '&nbsp;&nbsp;&nbsp;&nbsp;';
echo ($stats_projects_schools[$c][$id] ? $stats_projects_schools[$c][$id] : 0) . '</td>';
@ -306,27 +310,27 @@ echo "<tr><td colspan=\"2\"><h3>{$status_str[$showstatus]} - " . i18n('Projects
echo '<tr><td colspan="2">';
echo '<table class="tableview" width="100%">';
echo '<thead><tr><td rowspan=\'2\' width="50%"></td>';
foreach ($cats AS $c => $cn) {
foreach ($cats as $c => $cn) {
echo "<th colspan='" . count($languages) . "'>$cn</th>";
}
echo "<th colspan='" . count($languages) . "'>" . i18n('Total') . '</nobr></th>';
echo '</tr><tr>';
ksort($languages);
$tprojcat = array();
foreach ($cats AS $c => $cn) {
foreach ($languages AS $l => $ln) {
foreach ($cats as $c => $cn) {
foreach ($languages as $l => $ln) {
echo "<th>$l</th>";
}
}
foreach ($languages AS $l => $ln) {
foreach ($languages as $l => $ln) {
echo "<th>$l</th>";
}
echo '</tr></thead>';
foreach ($divs AS $d => $dn) {
foreach ($divs as $d => $dn) {
echo "<tr><td>$dn</td>";
$tproj = array();
foreach ($cats AS $c => $cn) {
foreach ($languages AS $l => $ln) {
foreach ($cats as $c => $cn) {
foreach ($languages as $l => $ln) {
echo '<td align="center">';
echo ($stats_projects_lang[$c][$d][$l] ?? 0);
echo '</td>';
@ -334,7 +338,7 @@ foreach ($divs AS $d => $dn) {
$tprojcat[$c][$l] = add_or_initialize_multi_2($tprojcat, $c, $l, $stats_projects_lang[$c][$d][$l] ?? 0);
}
}
foreach ($tproj AS $l => $ln) {
foreach ($tproj as $l => $ln) {
echo '<td align="center"><b>';
echo ($ln ? $ln : 0);
echo '</b></td>';
@ -343,15 +347,15 @@ foreach ($divs AS $d => $dn) {
}
echo '<tr><td><b>' . i18n('Total') . '</b></td>';
$tproj = array();
foreach ($cats AS $c => $cn) {
foreach ($languages AS $l => $ln) {
foreach ($cats as $c => $cn) {
foreach ($languages as $l => $ln) {
echo '<td align="center"><b>';
echo ($tprojcat[$c][$l] ? $tprojcat[$c][$l] : 0);
echo '</b></td>';
$tproj[$l] = add_or_initialize($tproj, $l, $tprojcat[$c][$l] ?? 0);
}
}
foreach ($tproj AS $l => $ln) {
foreach ($tproj as $l => $ln) {
echo '<td align="center"><b>';
echo ($ln);
echo '</b></td>';

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005-2006 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005-2006 James Grant <james@lightbox.org>
@ -23,20 +23,24 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
send_header('Web Consent',
array('Committee Main' => 'committee_main.php',
send_header(
'Web Consent',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Participant Registration' => 'admin/registration.php'));
'Participant Registration' => 'admin/registration.php'
)
);
echo '<br />';
if (get_value_from_array($_POST, 'changed')) {
$numchanged = 0;
foreach ($_POST['changed'] AS $id => $val) {
foreach ($_POST['changed'] as $id => $val) {
if ($val == 1) {
$numchanged++;
$webfirst = get_value_from_2d_array($_POST, 'webfirst', $id) == 'yes' ? 'yes' : 'no';
@ -62,15 +66,14 @@ if (get_value_from_array($_POST, 'changed')) {
}
}
?>
<script type="text/javascript">
function changed(id)
{
var o=document.getElementById('changed_'+id);
o.value=1;
<script type="text/javascript">
function changed(id) {
var o = document.getElementById('changed_' + id);
o.value = 1;
}
</script>
</script>
<?
<?
$sq = $pdo->prepare("SELECT students.firstname,
students.lastname,

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -27,9 +28,9 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once ('reports.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
require_once('reports.inc.php');
user_auth_required('committee');
@ -135,9 +136,11 @@ switch (get_value_from_array($_GET, 'action')) {
}
// send the header
send_header('My Reports',
send_header(
'My Reports',
array('Committee Main' => 'committee_main.php'),
'print/export_reports');
'print/export_reports'
);
/* Send a greeting */
echo i18n('Welcome to the new report interface. You can select and save specific reports under specific categories so you can always find the report you need without having to go through the list each time. To begin customizing this list, click on the "Edit This List" button at the bottom of this page.');
@ -145,24 +148,21 @@ echo i18n('Welcome to the new report interface. You can select and save specifi
<br /><br />
<script type="text/javascript">
function remove_report(id)
{
$('#debug').load("<? $_SERVER['PHP_SELF'] ?>?action=remove_report&id="+id);
$("#report_tr_"+id).remove();
}
function edit_report(id,reports_id)
{
var r = (id == -1) ? '&reports_id='+reports_id : '';
$.getJSON("<?= $_SERVER['PHP_SELF'] ?>?action=load_report&id="+id+r,
function(json){
$("#report_category_exist").html("<option value=\"\">-- <?= i18n('Use New Category') ?> --</option>");
for(var i in json.cat ) {
var c = json.cat[i];
$("#report_category_exist").append("<option value=\""+c+"\">"+c+"</option>");
function remove_report(id) {
$('#debug').load("<? $_SERVER['PHP_SELF'] ?>?action=remove_report&id=" + id);
$("#report_tr_" + id).remove();
}
$("#report_id").val( (id == -1) ? -1 : json.id);
function edit_report(id, reports_id) {
var r = (id == -1) ? '&reports_id=' + reports_id : '';
$.getJSON("<?= $_SERVER['PHP_SELF'] ?>?action=load_report&id=" + id + r,
function(json) {
$("#report_category_exist").html("<option value=\"\">-- <?= i18n('Use New Category') ?> --</option>");
for (var i in json.cat) {
var c = json.cat[i];
$("#report_category_exist").append("<option value=\"" + c + "\">" + c + "</option>");
}
$("#report_id").val((id == -1) ? -1 : json.id);
$("#report_reports_id").val(json.reports_id);
$("#report_category").val(json.category);
$("#report_stock").val(json.stock);
@ -173,29 +173,27 @@ function edit_report(id,reports_id)
popup_editor(id);
});
}
}
function save_report()
{
function save_report() {
$('#debug').load("<? $_SERVER['PHP_SELF'] ?>?action=save", $('#report_form').serializeArray(), function() {
window.location.reload();
});
}
}
function add_report()
{
function add_report() {
edit_report(-1, $('#report').val());
}
}
function gen_report() {
function gen_report() {
report_gen($('#report').val());
return false;
}
}
var edit=false;
function edit_toggle()
{
if(edit == false) {
var edit = false;
function edit_toggle() {
if (edit == false) {
$('#edit_toggle').val("<?= i18n('Done Editing') ?>");
$('#edit_info').show();
$('.edit_buttons').show();
@ -206,10 +204,9 @@ function edit_toggle()
$('.edit_buttons').hide();
edit = false;
}
}
}
function popup_editor(id)
{
function popup_editor(id) {
var w = (document.documentElement.clientWidth * 0.6);
var h = (document.documentElement.clientHeight * 0.4);
@ -220,13 +217,15 @@ function popup_editor(id)
$('#popup_editor').dialog('option', 'height', h);
$("#popup_editor").dialog('open');
return true;
}
}
/* Setup the popup window */
$(document).ready(function() {
/* Setup the popup window */
$(document).ready(function() {
$("#popup_editor").dialog({
bgiframe: true, autoOpen: false,
modal: true, resizable: false,
bgiframe: true,
autoOpen: false,
modal: true,
resizable: false,
draggable: false,
buttons: {
"<?= i18n('Cancel') ?>": function() {
@ -238,8 +237,7 @@ $(document).ready(function() {
}
}
});
});
});
</script>
<?
@ -276,7 +274,7 @@ if ($q->rowCount() == 0) {
$name = "<a href=\"{$config['SFIABDIRECTORY']}/{$report_custom[-$i->reports_id]['custom_url']}\">
{$report_custom[-$i->reports_id]['name']}</a>";
}
?>
?>
<tr id="report_tr_<?= $i->id ?>">
<td style="border:0px;"><?= $name ?></td>
<td style="border:0px;"><?= $i->comment ?></td>
@ -311,8 +309,8 @@ if ($q->rowCount() == 0) {
?>
<div id="edit_info" style="display:none;">
<p>* <?= i18n('Deleting all the reports from a category will also delete the category.') ?></p>
<p>* <?= i18n("Deleting a report only unlinks it from your list, it doesn't delete it from the system.") ?></p>
<p>* <?= i18n('Deleting all the reports from a category will also delete the category.') ?></p>
<p>* <?= i18n("Deleting a report only unlinks it from your list, it doesn't delete it from the system.") ?></p>
</div>
<br />
<input id="edit_toggle" type="submit" onclick="edit_toggle();return false;" value="<?= i18n('Edit This List') ?>">
@ -331,39 +329,39 @@ foreach ($report_custom as $id => $r) {
<hr />
<h4><?= i18n('All Reports') ?></h3>
<form name="reportgen" >
<select name="id" id="report">
<option value="0"><?= i18n('Select a Report') ?></option>
<?
foreach ($reports as $r) {
<form name="reportgen">
<select name="id" id="report">
<option value="0"><?= i18n('Select a Report') ?></option>
<?
foreach ($reports as $r) {
echo "<option value=\"{$r['id']}\">{$r['name']}</option>\n";
}
?>
</select><br />
<input type="submit" onclick="gen_report();return false;" value="<?= i18n('Generate Report') ?>">
<input type="submit" onclick="add_report();return false;" value="<?= i18n('Add this Report to my list') ?>">
</form>
<br />
<?
/* Create an add report box */
?>
<div id="popup_editor" title="Report" style="display: none">
<form id="report_form">
<input type="hidden" id="report_id" name="id" value="" />
<input type="hidden" id="report_reports_id" name="reports_id" value="" />
<br />
<table class="tableedit">
<tr>
<td><?= i18n('Category') ?>:</td>
<td><?= i18n('Existing Category') ?>: <select name="category_exist" id="report_category_exist" onchange="$('#report_category').val('')" >
}
?>
</select><br />
<?= i18n('OR New Category') ?>: <input type="text" id="report_category" name="category" onkeypress="$('#report_category_exist').val('')" >
<input type="submit" onclick="gen_report();return false;" value="<?= i18n('Generate Report') ?>">
<input type="submit" onclick="add_report();return false;" value="<?= i18n('Add this Report to my list') ?>">
</form>
<br />
<?
/* Create an add report box */
?>
<div id="popup_editor" title="Report" style="display: none">
<form id="report_form">
<input type="hidden" id="report_id" name="id" value="" />
<input type="hidden" id="report_reports_id" name="reports_id" value="" />
<br />
<table class="tableedit">
<tr>
<td><?= i18n('Category') ?>:</td>
<td><?= i18n('Existing Category') ?>: <select name="category_exist" id="report_category_exist" onchange="$('#report_category').val('')">
</select><br />
<?= i18n('OR New Category') ?>: <input type="text" id="report_category" name="category" onkeypress="$('#report_category_exist').val('')">
</td>
</tr>
<?
foreach ($report_options as $ok => $o) {
</tr>
<?
foreach ($report_options as $ok => $o) {
if (!in_array($ok, $option_keys))
continue;
echo "<tr><td>{$o['desc']}:</td>";
@ -372,17 +370,17 @@ foreach ($report_options as $ok => $o) {
echo "<option value=\"$k\">$v</option>\n";
}
echo "</select><span id=\"report{$ok}custom\" style=\"display: none;\">" . i18n('Custom') . '</span></td></tr>';
}
?>
<tr>
}
?>
<tr>
<td><?= i18n('Comments') ?>:</td>
<td><textarea rows="3" cols="40" name="comment" id="report_comment"></textarea></td>
</tr>
</table>
</form>
</div>
</tr>
</table>
</form>
</div>
<?
<?
send_footer();
?>
send_footer();
?>

View File

@ -1,9 +1,9 @@
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('../lpdf.php');
require ('../lcsv.php');
require('../lpdf.php');
require('../lcsv.php');
if ($_GET['year'])
$foryear = $_GET['year'];
@ -54,9 +54,11 @@ if (!$scriptformat)
$scriptformat = 'default';
if ($type == 'pdf') {
$rep = new lpdf(i18n($config['fairname']),
$rep = new lpdf(
i18n($config['fairname']),
i18n('Awards Ceremony Script'),
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif');
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif'
);
$rep->newPage();
if ($scriptformat == 'default')
@ -307,4 +309,3 @@ foreach ($awards as $r) {
}
$rep->output();
?>

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,12 +24,12 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require_once ('../tcpdf/tcpdf_sfiab_config.php');
require_once ('../tcpdf/tcpdf.php');
require_once('../tcpdf/tcpdf_sfiab_config.php');
require_once('../tcpdf/tcpdf.php');
$fcid = intval($_GET['fundraising_campaigns_id']);
$key = $_GET['key'];
@ -47,8 +48,8 @@ $pdf->SetKeywords('');
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -149,7 +150,8 @@ $report_awards_fields = array(
'header' => 'Sp. Status',
'width' => 0.5,
'table' => 'sponsorships.status',
'value_map' => array('pending' => 'Pending', 'confirmed' => 'Confirmed'), 'received' => 'Received'
'value_map' => array('pending' => 'Pending', 'confirmed' => 'Confirmed'),
'received' => 'Received'
),
'pcontact_salutation' => array(
'start_option_group' => 'Sponsor Primary Contact',
@ -448,5 +450,3 @@ function report_awards_fromwhere($report, $components)
return $q;
}
?>

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,14 +24,18 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require_once ('reports.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
require_once('reports.inc.php');
user_auth_required('committee', 'admin');
send_header('Award Ceremony Scripts',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'print_awards_ceremony_scripts');
send_header(
'Award Ceremony Scripts',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
),
'print_awards_ceremony_scripts'
);
echo '<br />';
echo '<form action="reports_acscript.php" method="get">';
echo '<table class="tableedit">';

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -169,5 +170,3 @@ function report_committees_fromwhere($report, $components)
return $q;
}
?>

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -24,21 +25,21 @@
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require_once ('reports_students.inc.php');
require_once ('reports_judges.inc.php');
require_once ('reports_awards.inc.php');
require_once ('reports_committees.inc.php');
require_once ('reports_schools.inc.php');
require_once ('reports_volunteers.inc.php');
require_once ('reports_tours.inc.php');
require_once ('reports_fairs.inc.php');
require_once ('reports_fundraising.inc.php');
require_once ('reports.inc.php');
require_once ('../tcpdf.inc.php');
require_once('reports_students.inc.php');
require_once('reports_judges.inc.php');
require_once('reports_awards.inc.php');
require_once('reports_committees.inc.php');
require_once('reports_schools.inc.php');
require_once('reports_volunteers.inc.php');
require_once('reports_tours.inc.php');
require_once('reports_fairs.inc.php');
require_once('reports_fundraising.inc.php');
require_once('reports.inc.php');
require_once('../tcpdf.inc.php');
$fields = array();
$locs = array('X' => 'x', 'Y' => 'y', 'W' => 'w', 'H' => 'h', 'Lines' => 'lines');
@ -192,82 +193,85 @@ if ($repaction == 'try') {
exit;
}
send_header('Reports Editor',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'report_management');
send_header(
'Reports Editor',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
),
'report_management'
);
?>
<script type="text/javascript">
function reportReload()
{
function reportReload() {
document.forms.report.reloadaction.value = 'reload';
document.forms.report.submit();
}
}
var canvasWidth=0;
var canvasHeight=0;
var canvasObjectIndex=0;
var labelWidth=0;
var labelHeight=0;
var canvasWidth = 0;
var canvasHeight = 0;
var canvasObjectIndex = 0;
var labelWidth = 0;
var labelHeight = 0;
function initCanvas(w,h,lw,lh) {
canvasWidth=w;
canvasHeight=h;
labelWidth=lw;
labelHeight=lh;
}
function initCanvas(w, h, lw, lh) {
canvasWidth = w;
canvasHeight = h;
labelWidth = lw;
labelHeight = lh;
}
function createData(x,y,w,h,l,face,align,valign,value) {
var canvas=document.getElementById('layoutcanvas');
var newdiv=document.createElement('div');
if(valign=="vcenter") verticalAlign="middle";
else if(valign=="vtop") verticalAlign="top";
else if(valign=="vbottom") verticalAlign="bottom";
else verticalAlign="top";
// alert(verticalAlign);
function createData(x, y, w, h, l, face, align, valign, value) {
var canvas = document.getElementById('layoutcanvas');
var newdiv = document.createElement('div');
if (valign == "vcenter") verticalAlign = "middle";
else if (valign == "vtop") verticalAlign = "top";
else if (valign == "vbottom") verticalAlign = "bottom";
else verticalAlign = "top";
// alert(verticalAlign);
//convert x,y,w,h from % to absolute
var dx=Math.round(x*canvasWidth/100);
var dy=Math.round(y*canvasHeight/100);
var dw=Math.round(w*canvasWidth/100);
var dh=Math.round(h*canvasHeight/100);
// alert(dx+','+dy+','+dw+','+dh);
var dx = Math.round(x * canvasWidth / 100);
var dy = Math.round(y * canvasHeight / 100);
var dw = Math.round(w * canvasWidth / 100);
var dh = Math.round(h * canvasHeight / 100);
// alert(dx+','+dy+','+dw+','+dh);
var fontheight=Math.round(dh/l);
var fontheight = Math.round(dh / l);
newdiv.setAttribute('id','o_'+canvasObjectIndex);
newdiv.style.display="table-cell";
newdiv.style.position="absolute";
newdiv.style.width=dw+"px";
newdiv.style.height=dh+"px";
newdiv.style.left=dx+"px";
newdiv.style.top=dy+"px";
newdiv.style.textAlign=align;
newdiv.style.verticalAlign=verticalAlign;
newdiv.style.padding="0 0 0 0";
newdiv.style.margin="0 0 0 0";
// newdiv.style.vertical-align=valign;
newdiv.style.border="1px solid blue";
newdiv.style.fontSize=fontheight+"px";
newdiv.style.lineHeight=fontheight+"px";
newdiv.style.fontFamily="Verdana";
newdiv.style.fontSizeAdjust=0.65;
newdiv.setAttribute('id', 'o_' + canvasObjectIndex);
newdiv.style.display = "table-cell";
newdiv.style.position = "absolute";
newdiv.style.width = dw + "px";
newdiv.style.height = dh + "px";
newdiv.style.left = dx + "px";
newdiv.style.top = dy + "px";
newdiv.style.textAlign = align;
newdiv.style.verticalAlign = verticalAlign;
newdiv.style.padding = "0 0 0 0";
newdiv.style.margin = "0 0 0 0";
// newdiv.style.vertical-align=valign;
newdiv.style.border = "1px solid blue";
newdiv.style.fontSize = fontheight + "px";
newdiv.style.lineHeight = fontheight + "px";
newdiv.style.fontFamily = "Verdana";
newdiv.style.fontSizeAdjust = 0.65;
var maxlength=Math.floor(dw/(fontheight*0.7))*l;
if(value.length>maxlength) value=value.substring(0,maxlength);
newdiv.innerHTML=value; //"Maple Test xxxx"; //value;
var maxlength = Math.floor(dw / (fontheight * 0.7)) * l;
if (value.length > maxlength) value = value.substring(0, maxlength);
newdiv.innerHTML = value; //"Maple Test xxxx"; //value;
canvas.appendChild(newdiv);
canvasObjectIndex++;
}
}
function createDataTCPDF(x,y,w,h,align,valign,fontname,fontstyle,fontsize,value) {
function createDataTCPDF(x, y, w, h, align, valign, fontname, fontstyle, fontsize, value) {
var canvas=document.getElementById('layoutcanvas');
var newdiv=document.createElement('div');
var canvas = document.getElementById('layoutcanvas');
var newdiv = document.createElement('div');
var dx = Math.round(x * canvasWidth / labelWidth);
var dy = Math.round(y * canvasHeight / labelHeight);
@ -275,41 +279,40 @@ function createDataTCPDF(x,y,w,h,align,valign,fontname,fontstyle,fontsize,value)
var dh = Math.round(h * canvasHeight / labelHeight);
var fontheight=(fontsize * 25.4 / 72) * canvasHeight / labelHeight;
var l = Math.floor(h/fontheight);
if(fontheight == 0) fontheight=10;
if(l==0) l=1;
var fontheight = (fontsize * 25.4 / 72) * canvasHeight / labelHeight;
var l = Math.floor(h / fontheight);
if (fontheight == 0) fontheight = 10;
if (l == 0) l = 1;
// alert(dh + ", fh="+fontheight);
// alert(dh + ", fh="+fontheight);
newdiv.setAttribute('id','o_'+canvasObjectIndex);
newdiv.style.display="table-cell";
newdiv.style.position="absolute";
newdiv.style.width=dw+"px";
newdiv.style.height=dh+"px";
newdiv.style.left=dx+"px";
newdiv.style.top=dy+"px";
newdiv.style.textAlign=align;
newdiv.style.verticalAlign=valign;
newdiv.style.padding="0 0 0 0";
newdiv.style.margin="0 0 0 0";
// newdiv.style.vertical-align=valign;
newdiv.style.border="1px solid blue";
newdiv.style.fontSize=fontheight+"px";
newdiv.style.lineHeight=fontheight+"px";
newdiv.style.fontFamily=fontname;
newdiv.style.fontSizeAdjust=0.65;
newdiv.setAttribute('id', 'o_' + canvasObjectIndex);
newdiv.style.display = "table-cell";
newdiv.style.position = "absolute";
newdiv.style.width = dw + "px";
newdiv.style.height = dh + "px";
newdiv.style.left = dx + "px";
newdiv.style.top = dy + "px";
newdiv.style.textAlign = align;
newdiv.style.verticalAlign = valign;
newdiv.style.padding = "0 0 0 0";
newdiv.style.margin = "0 0 0 0";
// newdiv.style.vertical-align=valign;
newdiv.style.border = "1px solid blue";
newdiv.style.fontSize = fontheight + "px";
newdiv.style.lineHeight = fontheight + "px";
newdiv.style.fontFamily = fontname;
newdiv.style.fontSizeAdjust = 0.65;
var maxlength=Math.floor(dw/(fontheight*0.7))*l;
if(value.length>maxlength) value=value.substring(0,maxlength);
var maxlength = Math.floor(dw / (fontheight * 0.7)) * l;
if (value.length > maxlength) value = value.substring(0, maxlength);
newdiv.innerHTML=value;
newdiv.innerHTML = value;
canvas.appendChild(newdiv);
canvasObjectIndex++;
}
}
</script>
<?
@ -425,13 +428,22 @@ echo "<td><textarea name=\"desc\" rows=\"3\" cols=\"60\">{$report['desc']}</text
echo '</tr>';
echo '<tr><td>Type: </td>';
echo '<td>';
selector('type', array('student' => 'Student Report', 'judge' => 'Judge Report',
'award' => 'Award Report', 'committee' => 'Committee Member Report',
'school' => 'School Report', 'volunteer' => 'Volunteer Report',
'tour' => 'Tour Report', 'fair' => 'Feeder Fair Report',
'fundraising' => 'Fundraising Report'),
selector(
'type',
array(
'student' => 'Student Report',
'judge' => 'Judge Report',
'award' => 'Award Report',
'committee' => 'Committee Member Report',
'school' => 'School Report',
'volunteer' => 'Volunteer Report',
'tour' => 'Tour Report',
'fair' => 'Feeder Fair Report',
'fundraising' => 'Fundraising Report'
),
$report['type'],
'onChange="reportReload();"');
'onChange="reportReload();"'
);
echo '<input type="hidden" name="reloadaction" value="">';
echo '</td>';
echo '</tr></table>';
@ -524,15 +536,24 @@ if (get_value_from_2d_array($report, 'option', 'type') == 'label' || get_value_f
selector("col[$x][face]", array('' => '', 'bold' => 'Bold'), $d['face']);
}
echo 'Align';
selector("col[$x][align]", array('center' => 'Center', 'left' => 'Left', 'right' => 'Right'),
$d['align']);
selector(
"col[$x][align]",
array('center' => 'Center', 'left' => 'Left', 'right' => 'Right'),
$d['align']
);
echo 'vAlign';
if ($report['option']['type'] == 'label') {
selector("col[$x][valign]", array('vcenter' => 'Center', 'vtop' => 'Top', 'vbottom' => 'Bottom'),
$d['valign']);
selector(
"col[$x][valign]",
array('vcenter' => 'Center', 'vtop' => 'Top', 'vbottom' => 'Bottom'),
$d['valign']
);
} else {
selector("col[$x][valign]", array('middle' => 'Middle', 'top' => 'Top', 'bottom' => 'Bottom'),
$d['valign']);
selector(
"col[$x][valign]",
array('middle' => 'Middle', 'top' => 'Top', 'bottom' => 'Bottom'),
$d['valign']
);
echo 'Font=';
selector("col[$x][fontname]", $fontlist, $d['fontname']);
@ -569,12 +590,18 @@ if (get_value_from_2d_array($report, 'option', 'type') == 'label' || get_value_f
}
echo 'Align';
selector("col[$x][align]", array('center' => 'Center', 'left' => 'Left', 'right' => 'Right'),
'center');
selector(
"col[$x][align]",
array('center' => 'Center', 'left' => 'Left', 'right' => 'Right'),
'center'
);
echo 'vAlign';
if ($report['option']['type'] == 'label') {
selector("col[$x][valign]", array('vcenter' => 'Center', 'vtop' => 'Top', 'vbottom' => 'Bottom'),
'top');
selector(
"col[$x][valign]",
array('vcenter' => 'Center', 'vtop' => 'Top', 'vbottom' => 'Bottom'),
'top'
);
} else {
selector("col[$x][valign]", array('middle' => 'Middle', 'top' => 'Top', 'bottom' => 'Bottom'), 'middle');

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 David Grant <dave@lightbox.org>
*
@ -470,5 +470,3 @@ function report_fairs_fromwhere($report, $components)
return $q;
}
?>

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -202,5 +203,3 @@ function report_fundraisings_fromwhere($report, $components)
return $q;
}
?>

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,10 +24,10 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require_once ('reports.inc.php');
require_once('reports.inc.php');
$id = intval($_GET['id']);
$type = stripslashes($_GET['type']);
@ -60,9 +61,9 @@ switch ($_GET['action']) {
case 'dialog_gen':
if ($id < 0) {
$u = "{$config['SFIABDIRECTORY']}/{$report_custom[-$id]['custom_url']}";
?>
?>
<script type="text/javascript">
window.location.href="<?= $u ?>";
window.location.href = "<?= $u ?>";
</script>
<?
exit;
@ -70,24 +71,32 @@ switch ($_GET['action']) {
?>
<div id="report_dialog_gen" title="Generate Report" style="display: none">
<div id="report_gen_tabs">
<ul><li><a href="#report_gen_tab_info"><span><?= i18n('Report Information') ?></span></a></li>
<ul>
<li><a href="#report_gen_tab_info"><span><?= i18n('Report Information') ?></span></a></li>
<li><a href="#report_gen_tab_advanced"><span><?= i18n('Advanced Options') ?></span></a></li>
</ul>
<form id="report_dialog_form" >
<form id="report_dialog_form">
<div id="report_gen_tab_info">
<input type="hidden" name="id" value="<?= $id ?>" />
<table class="editor" style="width:95%"><tr>
<td colspan="2"><br /><h3><?= i18n('Report Information') ?></h3><br /></td>
</tr><tr>
<table class="editor" style="width:95%">
<tr>
<td colspan="2"><br />
<h3><?= i18n('Report Information') ?></h3><br />
</td>
</tr>
<tr>
<td class="label"><b><?= i18n('Report Name') ?></b>:</td>
<td class="input"><?= $report['name'] ?></b></td>
</tr><tr>
</tr>
<tr>
<td class="label"><b><?= i18n('Description') ?></b>:</td>
<td class="input"><?= $report['desc'] ?></b></td>
</tr><tr>
</tr>
<tr>
<td class="label"><b><?= i18n('Created By') ?></b>:</td>
<td class="input"><?= $report['creator'] ?></td>
</tr><tr>
</tr>
<tr>
<?
/* See if the report is in this committee member's list */
$q = $pd->prepare("SELECT * FROM reports_committee
@ -97,17 +106,26 @@ switch ($_GET['action']) {
if ($q->rowCount() > 0) {
$i = $q->fetch(PDO::FETCH_ASSOC);
?>
<td colspan="2"><hr /><h3><?= i18n('My Reports Info') ?></h3></td>
</tr><tr>
<td colspan="2">
<hr />
<h3><?= i18n('My Reports Info') ?></h3>
</td>
</tr>
<tr>
<td class="label"><b><?= i18n('Category') ?></b>:</td>
<td class="input"><?= $i['category'] ?></b></td>
</tr><tr>
</tr>
<tr>
<td class="label"><b><?= i18n('Comment') ?></b>:</td>
<td class="input"><?= $i['comment'] ?></b></td>
</tr><tr>
</tr>
<tr>
<? } ?>
<td colspan="2"><br /><hr /><h3><?= i18n('Report Options') ?></h3><br /></td>
<td colspan="2"><br />
<hr />
<h3><?= i18n('Report Options') ?></h3><br />
</td>
</tr>
<?
$format = $report['options']['type'];
@ -143,21 +161,28 @@ switch ($_GET['action']) {
</table>
</div>
<div id="report_gen_tab_advanced">
<table class="editor" style="width:95%"><tr>
<td colspan="2"><br /><h4><?= i18n('Advanced Options') ?></h4><br /></td>
</tr><tr>
<table class="editor" style="width:95%">
<tr>
<td colspan="2"><br />
<h4><?= i18n('Advanced Options') ?></h4><br />
</td>
</tr>
<tr>
<td class="label"><input type="checkbox" name="include_incomplete_registrations" value="yes" /></td>
<td class="input"><?= i18n('Include student and project data from incomplete registrations. The registration only needs to have a division and category selected.') ?></td>
</table>
</div>
</form>
</div></div>
</div>
</div>
<script type="text/javascript">
$("#report_gen_tabs").tabs();
$("#report_dialog_gen").dialog({
bgiframe: true, autoOpen: true,
modal: true, resizable: false,
bgiframe: true,
autoOpen: true,
modal: true,
resizable: false,
draggable: false,
width: 800, //(document.documentElement.clientWidth * 0.8);
height: 600, //(document.documentElement.clientHeight * 0.7),
@ -165,25 +190,25 @@ switch ($_GET['action']) {
$(this).dialog('destroy');
$('#report_dialog_gen').remove();
},
buttons: { "<?= i18n('Cancel') ?>": function() {
buttons: {
"<?= i18n('Cancel') ?>": function() {
$('#report_dialog_gen').dialog("close");
return false;
},
"<?= i18n('Download Report') ?>": function() {
var dlargs = $('#report_dialog_form').serialize()+"<?= $filter_args ?>";
var dlurl = "<?= $config['SFIABDIRECTORY'] ?>/admin/reports_gen.php?"+dlargs;
var dlargs = $('#report_dialog_form').serialize() + "<?= $filter_args ?>";
var dlurl = "<?= $config['SFIABDIRECTORY'] ?>/admin/reports_gen.php?" + dlargs;
$('#debug').html(dlurl);
// alert(dlurl);
// $('#content').attr('src',dlurl);
window.location.href=dlurl;
window.location.href = dlurl;
$('#report_dialog_gen').dialog("close");
return false;
}
}
});
</script>
<?
<?
exit;
}

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -22,7 +23,7 @@
* Boston, MA 02111-1307, USA.
*/
require_once ('../questions.inc.php');
require_once('../questions.inc.php');
/*
* Take the language array in users_judge, unserialize it, and join it
@ -172,9 +173,13 @@ function report_judges_div_exp($report, $field, $text)
function report_judges_cat_pref($report, $field, $text)
{
$prefs = array(-2 => 'Lowest', -1 => 'Low',
$prefs = array(
-2 => 'Lowest',
-1 => 'Low',
0 => '--',
'1' => 'High', 2 => 'Highest');
'1' => 'High',
2 => 'Highest'
);
/* Field is 'div_pref_x', users_id is passed in $text */
$cat_id = substr($field, 9);
$year = $report['year'];
@ -288,9 +293,11 @@ function report_judges_time_availability($report, $field, $text)
$q->execute();
// echo mysql_error();
while (($r = $q->fetch(PDO::FETCH_ASSOC))) {
if ($r['start'] <= $round['starttime'] &&
if (
$r['start'] <= $round['starttime'] &&
$r['end'] >= $round['endtime'] &&
$r['date'] == $round['date']) {
$r['date'] == $round['date']
) {
return 'Yes';
}
}
@ -1093,5 +1100,3 @@ function report_judges_fromwhere($report, $components)
return $q;
}
?>

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,12 +24,12 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('../lpdf.php');
require ('../lcsv.php');
require ('../questions.inc.php');
require('../lpdf.php');
require('../lcsv.php');
require('../questions.inc.php');
if (!$_GET['type'])
$type = 'csv';
@ -36,9 +37,11 @@ else
$type = $_GET['type'];
if ($type == 'pdf') {
$rep = new lpdf(i18n($config['fairname']),
$rep = new lpdf(
i18n($config['fairname']),
i18n('Judge List'),
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif');
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif'
);
$rep->newPage();
$rep->setFontSize(11);
@ -115,10 +118,12 @@ while ($r = $q->fetch(PDO::FETCH_OBJ)) {
}
}
if (!$found) {
$times[$x] = array('date' => $r->date,
$times[$x] = array(
'date' => $r->date,
'starttime' => $r->starttime,
'endtime' => $r->endtime,
'name' => $r->name);
'name' => $r->name
);
$datetimeheadings[] = $r->name;
$x++;
}
@ -160,17 +165,17 @@ while ($r = $q->fetch(PDO::FETCH_OBJ)) {
$catdata = array();
$languages = '';
foreach ($u['cat_prefs'] AS $c) {
foreach ($u['cat_prefs'] as $c) {
$catdata[] = $c + 2;
}
foreach ($u['div_prefs'] AS $d) {
foreach ($u['div_prefs'] as $d) {
$divdata[] = $d;
// FIXME: 2010-01-22 - James - get the sub divisions for now we use a placeholder
$divdata[] = '';
}
foreach ($u['languages'] AS $k => $v) {
foreach ($u['languages'] as $k => $v) {
$languages .= "$v/";
}
$languages = substr($languages, 0, -1);

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,12 +24,12 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('../lpdf.php');
require ('../lcsv.php');
require ('../questions.inc.php');
require('../lpdf.php');
require('../lcsv.php');
require('../questions.inc.php');
if (!$_GET['type'])
$type = 'csv';
@ -36,9 +37,11 @@ else
$type = $_GET['type'];
if ($type == 'pdf') {
$rep = new lpdf(i18n($config['fairname']),
$rep = new lpdf(
i18n($config['fairname']),
i18n('Judge List'),
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif');
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif'
);
$rep->newPage();
$rep->setFontSize(11);
@ -132,17 +135,17 @@ while ($r = $q->fetch(PDO::FETCH_OBJ)) {
$catdata = array();
$languages = '';
foreach ($u['cat_prefs'] AS $c) {
foreach ($u['cat_prefs'] as $c) {
$catdata[] = $c + 2;
}
foreach ($u['div_prefs'] AS $d) {
foreach ($u['div_prefs'] as $d) {
$divdata[] = $d;
// FIXME: 2010-01-22 - James - get the sub divisions for now we use a placeholder
$divdata[] = '';
}
foreach ($u['languages'] AS $k => $v) {
foreach ($u['languages'] as $k => $v) {
$languages .= "$v/";
}
$languages = substr($languages, 0, -1);

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,19 +24,21 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('../lpdf.php');
require ('../lcsv.php');
require ('judges.inc.php');
require('../lpdf.php');
require('../lcsv.php');
require('judges.inc.php');
$type = $_GET['type'];
if ($type == 'pdf') {
$rep = new lpdf(i18n($config['fairname']),
$rep = new lpdf(
i18n($config['fairname']),
i18n('Judging Team Project Assignments'),
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif');
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif'
);
$rep->newPage();
$rep->setFontSize(11);
@ -52,7 +55,7 @@ if ($q->rowCount() > 1)
else
$show_date = false;
foreach ($teams AS $team) {
foreach ($teams as $team) {
$table = array();
$table['header'] = array(i18n('Timeslot'), i18n('Proj #'), i18n('Project Title'));
if ($show_date)
@ -66,7 +69,7 @@ foreach ($teams AS $team) {
$memberlist = '';
if (count(get_value_from_array($team, 'members', []))) {
foreach ($team['members'] AS $member) {
foreach ($team['members'] as $member) {
$memberlist .= $member['firstname'] . ' ' . $member['lastname'];
if ($member['captain'] == 'yes')
$memberlist .= '*';
@ -78,7 +81,7 @@ foreach ($teams AS $team) {
if (count($team['awards'])) {
$rep->heading(i18n('Awards that this team judges') . ':');
foreach ($team['awards'] AS $award) {
foreach ($team['awards'] as $award) {
$rep->addText($award['name']);
$rep->addText(i18n('Criteria') . ': ' . $award['criteria']);

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,38 +24,40 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
send_header('Mailing Label Generator',
array('Committee Main' => 'committee_main.php',
send_header(
'Mailing Label Generator',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Reports' => 'admin/reports.php'));
'Reports' => 'admin/reports.php'
)
);
?>
<script type="text/javascript">
function stockChange()
{
var val=document.forms.mailinglabels.stock.options[document.forms.mailinglabels.stock.selectedIndex].value;
var v=val.split(":");
function stockChange() {
var val = document.forms.mailinglabels.stock.options[document.forms.mailinglabels.stock.selectedIndex].value;
var v = val.split(":");
document.forms.mailinglabels.height.value=v[1];
document.forms.mailinglabels.width.value=v[2];
document.forms.mailinglabels.yspacer.value=v[3];
document.forms.mailinglabels.xspacer.value=v[4];
document.forms.mailinglabels.fontsize.value=v[5];
document.forms.mailinglabels.toppadding.value=v[6];
document.forms.mailinglabels.type.value=v[7];
}
document.forms.mailinglabels.height.value = v[1];
document.forms.mailinglabels.width.value = v[2];
document.forms.mailinglabels.yspacer.value = v[3];
document.forms.mailinglabels.xspacer.value = v[4];
document.forms.mailinglabels.fontsize.value = v[5];
document.forms.mailinglabels.toppadding.value = v[6];
document.forms.mailinglabels.type.value = v[7];
}
function reportChange()
{
var val=document.forms.mailinglabels.reportselect.options[document.forms.mailinglabels.reportselect.selectedIndex].value;
var v=val.split(":");
document.forms.mailinglabels.report.value=v[0];
document.forms.mailinglabels.reportname.value=v[1];
}
function reportChange() {
var val = document.forms.mailinglabels.reportselect.options[document.forms.mailinglabels.reportselect.selectedIndex].value;
var v = val.split(":");
document.forms.mailinglabels.report.value = v[0];
document.forms.mailinglabels.reportname.value = v[1];
}
</script>
<?

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,11 +24,11 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('../lpdf.php');
require ('../lcsv.php');
require('../lpdf.php');
require('../lcsv.php');
if ($_GET['report'])
$report = $_GET['report'];
@ -57,9 +58,11 @@ if ($report) {
if ($_GET['toppadding'])
$toppadding = $_GET['toppadding'];
$rep = new lpdf(i18n($config['fairname']),
$rep = new lpdf(
i18n($config['fairname']),
"$reportname Mailing Labels",
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif');
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif'
);
$rep->setPageStyle('labels');
$rep->newPage(8.5, 11);

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,13 +24,17 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require_once ('reports.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
require_once('reports.inc.php');
user_auth_required('committee', 'admin');
send_header('Reports',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'));
send_header(
'Reports',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
)
);
echo '<br />';
echo error("This page will no longer be available after Summer 2008. Please use the new 'My Reports' interface. ");

View File

@ -1,18 +1,20 @@
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('../lpdf.php');
require ('../lcsv.php');
require('../lpdf.php');
require('../lcsv.php');
$type = $_GET['type'];
if (!$type)
$type = 'pdf';
if ($type == 'pdf') {
$rep = new lpdf(i18n($config['fairname']),
$rep = new lpdf(
i18n($config['fairname']),
i18n('Program Awards'),
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif');
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif'
);
$rep->newPage();
$rep->setFontSize(11);
@ -103,4 +105,3 @@ if ($q->rowCount()) {
}
}
$rep->output();
?>

View File

@ -2,10 +2,11 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -23,19 +24,21 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('../lpdf.php');
require ('../lcsv.php');
require ('judges.inc.php');
require('../lpdf.php');
require('../lcsv.php');
require('judges.inc.php');
$type = $_GET['type'];
if ($type == 'pdf') {
$rep = new lpdf(i18n($config['fairname']),
$rep = new lpdf(
i18n($config['fairname']),
i18n('Project Details'),
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif');
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif'
);
$rep->newPage();
$rep->setFontSize(11);

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -27,19 +28,21 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('../lpdf.php');
require ('../lcsv.php');
require ('judges.inc.php');
require('../lpdf.php');
require('../lcsv.php');
require('judges.inc.php');
$type = $_GET['type'];
if ($type == 'pdf') {
$rep = new lpdf(i18n($config['fairname']),
$rep = new lpdf(
i18n($config['fairname']),
i18n('Project Judging Team Assignments'),
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif');
$_SERVER['DOCUMENT_ROOT'] . $config['SFIABDIRECTORY'] . '/data/logo-200.gif'
);
$rep->newPage();
$rep->setFontSize(11);

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -220,5 +221,3 @@ function report_schools_fromwhere($report, $components)
return $q;
}
?>

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -374,8 +375,14 @@ $report_students_fields = array(
'header' => 'T-Shirt',
'width' => 0.7,
'table' => 'students.tshirt',
'value_map' => array('none' => '', 'xsmall' => 'X-Small', 'small' => 'Small', 'medium' => 'Medium',
'large' => 'Large', 'xlarge' => 'X-Large')
'value_map' => array(
'none' => '',
'xsmall' => 'X-Small',
'small' => 'Small',
'medium' => 'Medium',
'large' => 'Large',
'xlarge' => 'X-Large'
)
),
'medicalalert' => array(
'name' => 'Student -- Medical Alert Info',
@ -1253,5 +1260,3 @@ function report_students_fromwhere($report, $components)
return $q;
}
?>

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -98,5 +99,3 @@ function report_tours_fromwhere($report, $components)
return $q;
}
?>

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -160,5 +161,3 @@ function report_volunteers_fromwhere($report, $components)
return $q;
}
?>

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -159,4 +160,3 @@ if ($config['FAIRYEAR'] == 2008) {
}
}
}
?>

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -27,8 +28,8 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
if (get_value_from_array($_POST, 'save') == 'edit' || get_value_from_array($_POST, 'save') == 'add') {
@ -210,11 +211,15 @@ if (get_value_from_array($_GET, 'action') == 'makeaccesscodes') {
}
if (get_value_from_array($_GET, 'action') == 'edit' || get_value_from_array($_GET, 'action') == 'add') {
send_header(get_value_from_array($_GET, 'action') == 'edit' ? 'Edit School' : 'Add New School',
array('Committee Main' => 'committee_main.php',
send_header(
get_value_from_array($_GET, 'action') == 'edit' ? 'Edit School' : 'Add New School',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'School Management' => 'admin/schools.php'),
'schools_management');
'School Management' => 'admin/schools.php'
),
'schools_management'
);
if (get_value_from_array($_GET, 'action') == 'edit') {
$buttontext = 'Save School';
$q = $pdo->prepare("SELECT * FROM schools WHERE id='" . get_value_from_array($_GET, 'edit', '') . "'");
@ -238,16 +243,19 @@ if (get_value_from_array($_GET, 'action') == 'edit' || get_value_from_array($_GE
echo '<select name="schoollang">';
echo '<option value="">' . i18n('Choose') . "</option>\n";
foreach ($config['languages'] AS $k => $l) {
foreach ($config['languages'] as $k => $l) {
echo "<option $sel value=\"$k\">" . i18n($l) . "</option>\n";
}
echo '</select>';
echo "</td></tr>\n";
echo '<tr><td>' . i18n('School Designation') . '</td><td>';
$des = array('' => 'Choose', 'public' => 'Public',
$des = array(
'' => 'Choose',
'public' => 'Public',
'independent' => 'Independent/Private',
'home' => 'Home School');
'home' => 'Home School'
);
echo '<select name="schooldesignate">';
foreach ($des as $k => $v) {
$sel = ($r->designate == $k) ? 'selected="selected"' : '';
@ -327,10 +335,14 @@ if (get_value_from_array($_GET, 'action') == 'edit' || get_value_from_array($_GE
echo "</table>\n";
echo "</form>\n";
} else {
send_header('School Management',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'schools_management');
send_header(
'School Management',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
),
'schools_management'
);
global $notice;
switch ($notice) {

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -27,16 +28,20 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require ('../csvimport.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
require('../csvimport.inc.php');
user_auth_required('committee', 'admin');
send_header('Schools Import',
array('Committee Main' => 'committee_main.php',
send_header(
'Schools Import',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'School Management' => 'admin/schools.php'));
'School Management' => 'admin/schools.php'
)
);
$showform = true;
@ -54,7 +59,7 @@ if (get_value_from_array($_POST, 'action') == 'import') {
}
$loaded = 0;
foreach ($CSVP->data AS $row) {
foreach ($CSVP->data as $row) {
for ($n = 0; $n < count($row); $n++) {
$row[$n] = trim($row[$n]);
}

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -27,14 +28,18 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
send_header('Science Fair Management',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'sciencefair_management');
send_header(
'Science Fair Management',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
),
'sciencefair_management'
);
echo '<br />';
echo '<a href="user_list.php?show_types[]=fair">' . i18n('Science Fair Manager') . '</a><br />';

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -28,9 +29,9 @@
?>
<?
include '../common.inc.php';
require_once ('../user.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
foreach ($config['languages'] AS $l => $ln) {
foreach ($config['languages'] as $l => $ln) {
if ($l == $config['default_language'])
continue;

View File

@ -2,7 +2,7 @@
/*
* This file is part of the 'Science Fair In A Box' project
* SFIAB Website: http://www.sfiab.ca
* Science-ation Website: https://science-ation.ca/
*
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005-2008 James Grant <james@lightbox.org>
@ -23,14 +23,18 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
send_header('Donor Contacts',
array('Committee Main' => 'committee_main.php',
send_header(
'Donor Contacts',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Donor' => 'admin/donors.php'));
'Donor' => 'admin/donors.php'
)
);
if ($_GET['sponsors_id'])
$sponsors_id = $_GET['sponsors_id'];

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -85,4 +86,3 @@ $stats_data = array(
'delegate3_size' => array('manual' => true),
'delegate4_size' => array('manual' => true),
);
?>

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -27,8 +28,8 @@
*/
?>
<?
require_once ('../common.inc.php');
require_once ('../user.inc.php');
require_once('../common.inc.php');
require_once('../user.inc.php');
$auth_type = user_auth_required(array('fair', 'committee'), 'admin');
$registrations_id = intval($_GET['id']);
@ -511,48 +512,51 @@ function registration_load()
/* Print form */
$status = array('new' => 'New', 'open' => 'Open', 'paymentpending' => 'Payment Pending', 'complete' => 'Complete');
?>
?>
<form id="registration_form">
<table>
<tr>
<td><?= i18n('Registration Number') ?>:</td>
<td><input type="text" name="registration_num" value="<?= get_value_from_array($r, 'num') ?>"></td>
</tr><tr>
</tr>
<tr>
<td><?= i18n('Registration Email') ?>:</td>
<td><input type="text" name="registration_email" value="<?= get_value_from_array($r, 'email') ?>"></td>
</tr><tr>
</tr>
<tr>
<td><?= i18n('Status') ?>:</td>
<td><select name="registration_status">
<?
<?
foreach ($status as $k => $v) {
$sel = ($k == $r['status']) ? 'selected="selected"' : '';
echo "<option $sel value=\"$k\">$v</option>";
}
?> </select></td>
</tr>
<?
<?
if (count($fairs) > 0) {
?>
?>
<tr>
<td><?= i18n('Fair') ?>:</td>
<td>
<?
<?
if ($auth_type == 'fair') {
echo $fairs[$_SESSION['fairs_id']]['name'];
} else {
?> <select name="registration_fair">
<option value="0"><?= i18n('Independent/None') ?></option>
<?
<?
foreach ($fairs as $fid => $f) {
$sel = ($fid == $r['fairs_id']) ? 'selected="selected"' : '';
echo "<option $sel value=\"$fid\">{$f['name']}</option>";
}
?> </select>
<?
?>
</select>
<?
}
?> </td>
</tr>
<?
<?
} else {
echo "<input type=\"hidden\" name=\"registration_fair\" value=\"0\" />\n";
}

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -27,14 +28,18 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
send_header('Tours',
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'),
'tour_management');
send_header(
'Tours',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php'
),
'tour_management'
);
echo '<a href="tours_manager.php">' . i18n('Manage Tours') . '</a> ' . i18n('- Add, Delete, Edit, and List tours') . '<br />';
echo '<a href="tours_assignments.php">' . i18n('Edit Student-Tour Assignments') . '</a><br />';
echo '<hr />';

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -27,8 +28,8 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
/* Load Tours */
@ -51,8 +52,10 @@ if (get_value_from_array($_GET, 'action') == 'info') {
$r->execute();
$i = $r->fetch(PDO::FETCH_OBJ);
send_popup_header(i18n('Student Tour Rank Information - %1 %2',
array($i->firstname, $i->lastname)));
send_popup_header(i18n(
'Student Tour Rank Information - %1 %2',
array($i->firstname, $i->lastname)
));
$query = "SELECT * FROM tours_choice
WHERE students_id='$sid'
AND year='{$config['FAIRYEAR']}'
@ -70,8 +73,10 @@ if (get_value_from_array($_GET, 'action') == 'info') {
echo '<br /><br />';
$count--;
} else {
echo '<b>' . i18n('Tour Preference %1',
array($i->rank)) . ':</b>';
echo '<b>' . i18n(
'Tour Preference %1',
array($i->rank)
) . ':</b>';
echo '</td><td>';
echo "#{$tours[$i->tour_id]['num']}: {$tours[$i->tour_id]['name']}";
echo '</td><td>';
@ -88,54 +93,52 @@ if (get_value_from_array($_GET, 'action') == 'info') {
exit;
}
send_header('Tour Assignments',
array('Committee Main' => 'committee_main.php',
send_header(
'Tour Assignments',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Tours' => 'admin/tours.php'));
'Tours' => 'admin/tours.php'
)
);
?>
<script language="javascript" type="text/javascript">
var infowindow = '';
function addbuttonclicked(id)
{
document.forms.tours.action.value="add";
document.forms.tours.tours_id.value=id;
var infowindow = '';
function addbuttonclicked(id) {
document.forms.tours.action.value = "add";
document.forms.tours.tours_id.value = id;
document.forms.tours.submit();
}
}
function openinfo(id)
{
if(id)
currentid=id;
function openinfo(id) {
if (id)
currentid = id;
else
currentid=document.forms.tours["studentlist[]"].options[document.forms.tours["studentlist[]"].selectedIndex].value;
currentid = document.forms.tours["studentlist[]"].options[document.forms.tours["studentlist[]"].selectedIndex].value;
infowindow = window.open("tours_assignments.php?action=info&id="+currentid,"StudentTourRankInformation","location=no,menubar=no,directories=no,toolbar=no,width=770,height=300,scrollbars=yes");
infowindow = window.open("tours_assignments.php?action=info&id=" + currentid, "StudentTourRankInformation", "location=no,menubar=no,directories=no,toolbar=no,width=770,height=300,scrollbars=yes");
return false;
}
}
function switchinfo()
{
if(document.forms.tours["studentlist[]"].selectedIndex != -1)
{
currentname=document.forms.tours["studentlist[]"].options[document.forms.tours["studentlist[]"].selectedIndex].text;
currentid=document.forms.tours["studentlist[]"].options[document.forms.tours["studentlist[]"].selectedIndex].value;
function switchinfo() {
if (document.forms.tours["studentlist[]"].selectedIndex != -1) {
currentname = document.forms.tours["studentlist[]"].options[document.forms.tours["studentlist[]"].selectedIndex].text;
currentid = document.forms.tours["studentlist[]"].options[document.forms.tours["studentlist[]"].selectedIndex].value;
document.forms.tours.studentinfobutton.disabled=false;
document.forms.tours.studentinfobutton.value=currentname;
document.forms.tours.studentinfobutton.disabled = false;
document.forms.tours.studentinfobutton.value = currentname;
if(!infowindow.closed && infowindow.location) {
if (!infowindow.closed && infowindow.location) {
openinfo();
}
}
else
{
document.forms.tours.studentinfobutton.disabled=true;
document.forms.tours.studentinfobutton.value="<? echo i18n('Student Tour Rank Info') ?>";
} else {
document.forms.tours.studentinfobutton.disabled = true;
document.forms.tours.studentinfobutton.value = "<? echo i18n('Student Tour Rank Info') ?>";
}
}
}
</script>
<?
@ -152,7 +155,7 @@ if (get_value_from_array($_POST, 'action') == 'add' && $tours_id != 0 && count($
}
$added = 0;
foreach ($student_list AS $sid) {
foreach ($student_list as $sid) {
/* Make sure the student exists */
$sid = intval($sid);
@ -184,7 +187,10 @@ if (get_value_from_array($_POST, 'action') == 'add' && $tours_id != 0 && count($
$j = i18n('students');
echo happy(i18n('%1 %2 added to tour #%3 (%4)', array(
$added, $j, $tours[$tours_id]['num'], $tours[$tours_id]['name']
$added,
$j,
$tours[$tours_id]['num'],
$tours[$tours_id]['name']
)));
}
@ -295,7 +301,7 @@ foreach ($tours as $tid => $t) {
echo '</td></tr>';
$x = 0;
if (is_array($t['students'])) {
foreach ($t['students'] AS $sid) {
foreach ($t['students'] as $sid) {
$s = $student[$sid];
if ($x == 0)
echo '<tr>';

View File

@ -10,6 +10,7 @@
* Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
* Copyright (C) 2005 James Grant <james@lightbox.org>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
* Copyright (C) 2024 AlgoLibre Inc. <science-ation@algolibre.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@ -27,16 +28,20 @@
*/
?>
<?
require ('../common.inc.php');
require_once ('../user.inc.php');
require('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'admin');
require ('../tours.class.php');
require ('../tableeditor.class.php');
require('../tours.class.php');
require('../tableeditor.class.php');
send_header('Tour Management',
array('Committee Main' => 'committee_main.php',
send_header(
'Tour Management',
array(
'Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Tours' => 'admin/tours.php'));
'Tours' => 'admin/tours.php'
)
);
if ($_GET['action'] == 'renumber') {
$q = $pdo->prepare("SELECT id FROM tours WHERE year='{$config['FAIRYEAR']}'");
@ -52,18 +57,16 @@ if ($_GET['action'] == 'renumber') {
?>
<script language="javascript" type="text/javascript">
function opentoursinfo(id)
{
if(id)
currentid=id;
function opentoursinfo(id) {
if (id)
currentid = id;
else
currentid=document.forms.tours["tourslist[]"].options[document.forms.tours["tourslist[]"].selectedIndex].value;
currentid = document.forms.tours["tourslist[]"].options[document.forms.tours["tourslist[]"].selectedIndex].value;
window.open("tours_info.php?id="+currentid,"JudgeInfo","location=no,menubar=no,directories=no,toolbar=no,width=770,height=500,scrollbars=yes");
window.open("tours_info.php?id=" + currentid, "JudgeInfo", "location=no,menubar=no,directories=no,toolbar=no,width=770,height=500,scrollbars=yes");
return false;
}
}
</script>
<?

Some files were not shown because too many files have changed in this diff Show More