forked from science-ation/science-ation
format code
This commit is contained in:
parent
5d410a023b
commit
996c3d5a0a
@ -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()
|
||||
|
@ -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 ' ' . 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];
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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 ' ' . 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,38 +285,41 @@ 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)) {
|
||||
echo '<tr>';
|
||||
echo "<td>{$r->name}</td>\n";
|
||||
echo "<td>{$r->url}</td>";
|
||||
echo '<td align="center">';
|
||||
if ($links)
|
||||
echo "<a href=\"#\" onclick=\"award_download({$r->id})\">" . i18n('check') . '</a>';
|
||||
else
|
||||
echo 'n/a';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
// $checkurl.="&check[]={$r->id}";
|
||||
}
|
||||
$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>";
|
||||
echo '<td align="center">';
|
||||
if ($links)
|
||||
echo "<a href=\"#\" onclick=\"award_download({$r->id})\">" . i18n('check') . '</a>';
|
||||
else
|
||||
echo 'n/a';
|
||||
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();
|
||||
?>
|
||||
?>
|
@ -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 */
|
||||
@ -397,31 +409,34 @@ switch (get_value_from_array($_GET, 'action')) {
|
||||
$q->execute();
|
||||
$fair = $q->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
?> <h4><?= i18n('Division Mapping') ?></h4>
|
||||
<br />
|
||||
?> <h4><?= i18n('Division Mapping') ?></h4>
|
||||
<br />
|
||||
|
||||
<form id="catdiv_form">
|
||||
<input type="hidden" name="fairs_id" value="<?= $fairs_id ?>" />
|
||||
<form id="catdiv_form">
|
||||
<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>
|
||||
<?
|
||||
<table class="editor">
|
||||
<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']} => </td>";
|
||||
echo "<td><select name=\"div[{$div['id']}]\" class=\"upload_div\">";
|
||||
$mapto = $dm[$div['id']];
|
||||
foreach ($d as $sdiv) {
|
||||
$sel = ($sdiv['id'] == $mapto) ? 'selected="selected"' : '';
|
||||
echo "<option $sel value=\"{$sdiv['id']}\">{$sdiv['division']}</option>";
|
||||
}
|
||||
echo '</select></td></tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</form>
|
||||
<br />
|
||||
<?
|
||||
foreach ($divs as $div) {
|
||||
echo "<tr><td class=\"label\">{$div['division']} => </td>";
|
||||
echo "<td><select name=\"div[{$div['id']}]\" class=\"upload_div\">";
|
||||
$mapto = $dm[$div['id']];
|
||||
foreach ($d as $sdiv) {
|
||||
$sel = ($sdiv['id'] == $mapto) ? 'selected="selected"' : '';
|
||||
echo "<option $sel value=\"{$sdiv['id']}\">{$sdiv['division']}</option>";
|
||||
}
|
||||
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,255 +508,269 @@ switch (get_value_from_array($_GET, 'action')) {
|
||||
$division_disabled = false;
|
||||
}
|
||||
|
||||
?>
|
||||
<br /><br />
|
||||
<button onClick="popup_divmap(<?= $fairs_id ?>);return false;" <?= $division_disabled ? 'disabled="disabled' : '' ?>
|
||||
?>
|
||||
<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>
|
||||
|
||||
<form id="winner_divs_form">
|
||||
<input type="hidden" name="fairs_id" value="<?= $fairs_id ?>" />
|
||||
<input type="hidden" name="award_awards_id" value="<?= $award_awards_id ?>" />
|
||||
<table class="tableview">
|
||||
<?
|
||||
<form id="winner_divs_form">
|
||||
<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">';
|
||||
echo "<br /><h3>{$w['award_name']}</h3>";
|
||||
foreach ($w['prizes'] as &$p) {
|
||||
echo '<tr><td style="border: 0px;" colspan="3">';
|
||||
echo "<h4>{$p['name']}</h4>";
|
||||
echo '</td></tr>';
|
||||
if (count($p['projects']) == 0) {
|
||||
echo i18n('No winners to upload');
|
||||
continue;
|
||||
}
|
||||
foreach ($p['projects'] as &$pr) {
|
||||
?> <tr><td style="border: 0px;"> </td>
|
||||
<td><b><?= $pr['projectnumber'] ?> - <?= $pr['title'] ?></b><br/>
|
||||
<?
|
||||
$highest_grade = 0;
|
||||
foreach ($pr['students'] as &$s) {
|
||||
echo i18n('Name') . ': ';
|
||||
echo $s['firstname'] . ' ' . $s['lastname'];
|
||||
echo '<br />';
|
||||
echo ' ';
|
||||
echo ' ';
|
||||
echo ' ';
|
||||
echo ' ';
|
||||
echo i18n('Grade') . ': ' . $s['grade'];
|
||||
echo '<br />';
|
||||
echo ' ';
|
||||
echo ' ';
|
||||
echo ' ';
|
||||
echo ' ';
|
||||
echo i18n('School') . ': ' . $s['school']['schoolname'];
|
||||
echo '<br />';
|
||||
if ($s['grade'] > $highest_grade)
|
||||
$highest_grade = $s['grade'];
|
||||
}
|
||||
$server_cat = '';
|
||||
foreach ($server_cats as $c) {
|
||||
if ($highest_grade >= $c['mingrade'] && $highest_grade <= $c['maxgrade']) {
|
||||
$server_cat = $c['id'];
|
||||
foreach ($winners as &$w) {
|
||||
echo '<tr><td style="border: 0px;" colspan="3">';
|
||||
echo "<br /><h3>{$w['award_name']}</h3>";
|
||||
foreach ($w['prizes'] as &$p) {
|
||||
echo '<tr><td style="border: 0px;" colspan="3">';
|
||||
echo "<h4>{$p['name']}</h4>";
|
||||
echo '</td></tr>';
|
||||
if (count($p['projects']) == 0) {
|
||||
echo i18n('No winners to upload');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<table class="default">
|
||||
<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>
|
||||
<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"' : '';
|
||||
echo "<option $sel value=\"{$d['id']}\">{$d['division']}</option>";
|
||||
}
|
||||
?> </select>
|
||||
<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>
|
||||
<td><b><?= $server_cats[$server_cat]['category'] ?> (<?= i18n('Grade') ?> <?= $server_cats[$server_cat]['mingrade'] ?> - <?= $server_cats[$server_cat]['maxgrade'] ?>)</td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
?> </table>
|
||||
</td></tr>
|
||||
<?
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '</table></form><br />';
|
||||
exit;
|
||||
}
|
||||
|
||||
send_header('Award Upload',
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'Administration' => 'admin/index.php',
|
||||
'Awards Main' => 'admin/awards.php'));
|
||||
echo '<br />';
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
var fairs_id = -1;
|
||||
var award_awards_id = -1;
|
||||
|
||||
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(fid,aaid)
|
||||
{
|
||||
var w = (document.documentElement.clientWidth * 0.8);
|
||||
var h = (document.documentElement.clientHeight * 0.8);
|
||||
|
||||
fairs_id = fid;
|
||||
award_awards_id = aaid;
|
||||
|
||||
/* Load dialog content (it's in a function because we use it when
|
||||
* the div editor closes too, to reload the content */
|
||||
popup_upload_load();
|
||||
|
||||
/* Show the dialog */
|
||||
$('#popup_upload').dialog('option', 'width', w);
|
||||
$('#popup_upload').dialog('option', 'height', h);
|
||||
$("#popup_upload").dialog('open');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
/* Show the dialog */
|
||||
$('#popup_divmap').dialog('option', 'width', w);
|
||||
$('#popup_divmap').dialog('option', 'height', h);
|
||||
$("#popup_divmap").dialog('open');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Setup the popup window */
|
||||
$(document).ready(function() {
|
||||
$("#popup_upload").dialog({
|
||||
bgiframe: true, autoOpen: false,
|
||||
modal: true, resizable: false,
|
||||
draggable: false,
|
||||
buttons: {
|
||||
"<?= i18n('Cancel') ?>": function() {
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"<?= i18n('Upload Winners') ?>": function() {
|
||||
$("#award_upload_status").load("<?= $_SERVER['PHP_SELF'] ?>?action=award_upload",
|
||||
$('#winner_divs_form').serializeArray());
|
||||
/* Don't need to wait for the .load to complete before closing */
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#popup_divmap").dialog({
|
||||
bgiframe: true, autoOpen: false,
|
||||
modal: true, resizable: false,
|
||||
draggable: false,
|
||||
buttons: {
|
||||
"<?= i18n('Cancel') ?>": function() {
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"<?= i18n('Save Mappings') ?>": function() {
|
||||
$("#debug").load("<?= $_SERVER['PHP_SELF'] ?>?action=catdiv_save",
|
||||
$('#catdiv_form').serializeArray(), function() {
|
||||
popup_upload_load();
|
||||
foreach ($p['projects'] as &$pr) {
|
||||
?> <tr>
|
||||
<td style="border: 0px;"> </td>
|
||||
<td><b><?= $pr['projectnumber'] ?> - <?= $pr['title'] ?></b><br />
|
||||
<?
|
||||
$highest_grade = 0;
|
||||
foreach ($pr['students'] as &$s) {
|
||||
echo i18n('Name') . ': ';
|
||||
echo $s['firstname'] . ' ' . $s['lastname'];
|
||||
echo '<br />';
|
||||
echo ' ';
|
||||
echo ' ';
|
||||
echo ' ';
|
||||
echo ' ';
|
||||
echo i18n('Grade') . ': ' . $s['grade'];
|
||||
echo '<br />';
|
||||
echo ' ';
|
||||
echo ' ';
|
||||
echo ' ';
|
||||
echo ' ';
|
||||
echo i18n('School') . ': ' . $s['school']['schoolname'];
|
||||
echo '<br />';
|
||||
if ($s['grade'] > $highest_grade)
|
||||
$highest_grade = $s['grade'];
|
||||
}
|
||||
);
|
||||
/* Don't need to wait for the .load to complete before closing */
|
||||
$(this).dialog("close");
|
||||
$server_cat = '';
|
||||
foreach ($server_cats as $c) {
|
||||
if ($highest_grade >= $c['mingrade'] && $highest_grade <= $c['maxgrade']) {
|
||||
$server_cat = $c['id'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<table class="default">
|
||||
<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>
|
||||
<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"' : '';
|
||||
echo "<option $sel value=\"{$d['id']}\">{$d['division']}</option>";
|
||||
}
|
||||
?> </select>
|
||||
<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>
|
||||
<td><b><?= $server_cats[$server_cat]['category'] ?> (<?= i18n('Grade') ?> <?= $server_cats[$server_cat]['mingrade'] ?> - <?= $server_cats[$server_cat]['maxgrade'] ?>)</td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
echo '</table></form><br />';
|
||||
exit;
|
||||
}
|
||||
|
||||
<div id="popup_upload" title="Upload Award" style="display: none"></div>
|
||||
<div id="popup_divmap" title="Edit Mappings" style="display: none"></div>
|
||||
send_header(
|
||||
'Award Upload',
|
||||
array(
|
||||
'Committee Main' => 'committee_main.php',
|
||||
'Administration' => 'admin/index.php',
|
||||
'Awards Main' => 'admin/awards.php'
|
||||
)
|
||||
);
|
||||
echo '<br />';
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var fairs_id = -1;
|
||||
var award_awards_id = -1;
|
||||
|
||||
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(fid, aaid) {
|
||||
var w = (document.documentElement.clientWidth * 0.8);
|
||||
var h = (document.documentElement.clientHeight * 0.8);
|
||||
|
||||
fairs_id = fid;
|
||||
award_awards_id = aaid;
|
||||
|
||||
/* Load dialog content (it's in a function because we use it when
|
||||
* the div editor closes too, to reload the content */
|
||||
popup_upload_load();
|
||||
|
||||
/* Show the dialog */
|
||||
$('#popup_upload').dialog('option', 'width', w);
|
||||
$('#popup_upload').dialog('option', 'height', h);
|
||||
$("#popup_upload").dialog('open');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
/* Show the dialog */
|
||||
$('#popup_divmap').dialog('option', 'width', w);
|
||||
$('#popup_divmap').dialog('option', 'height', h);
|
||||
$("#popup_divmap").dialog('open');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
<?
|
||||
/* Setup the popup window */
|
||||
$(document).ready(function() {
|
||||
$("#popup_upload").dialog({
|
||||
bgiframe: true,
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
draggable: false,
|
||||
buttons: {
|
||||
"<?= i18n('Cancel') ?>": function() {
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"<?= i18n('Upload Winners') ?>": function() {
|
||||
$("#award_upload_status").load("<?= $_SERVER['PHP_SELF'] ?>?action=award_upload",
|
||||
$('#winner_divs_form').serializeArray());
|
||||
/* Don't need to wait for the .load to complete before closing */
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
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;
|
||||
}
|
||||
$("#popup_divmap").dialog({
|
||||
bgiframe: true,
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
draggable: false,
|
||||
buttons: {
|
||||
"<?= i18n('Cancel') ?>": function() {
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"<?= i18n('Save Mappings') ?>": function() {
|
||||
$("#debug").load("<?= $_SERVER['PHP_SELF'] ?>?action=catdiv_save",
|
||||
$('#catdiv_form').serializeArray(),
|
||||
function() {
|
||||
popup_upload_load();
|
||||
}
|
||||
);
|
||||
/* Don't need to wait for the .load to complete before closing */
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
/* Fairs first */
|
||||
<div id="popup_upload" title="Upload Award" style="display: none"></div>
|
||||
<div id="popup_divmap" title="Edit Mappings" style="display: none"></div>
|
||||
|
||||
$q = $pdo->prepare("SELECT fairs.id, fairs.name, fairs.type, COUNT(award_awards.id) as AWARD_COUNT FROM fairs
|
||||
|
||||
<?
|
||||
|
||||
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 */
|
||||
|
||||
$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)) {
|
||||
$count = count_winners(-1, $r->id);
|
||||
?>
|
||||
<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 />
|
||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||
$count = count_winners(-1, $r->id);
|
||||
?>
|
||||
<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 />
|
||||
|
||||
|
||||
<?
|
||||
<?
|
||||
|
||||
$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)) {
|
||||
$count = count_winners($r->id, $r->award_source_fairs_id);
|
||||
?>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<?
|
||||
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 />
|
||||
<?
|
||||
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 />
|
||||
|
||||
<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();
|
||||
?>
|
@ -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,14 +24,15 @@
|
||||
<?
|
||||
|
||||
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'");
|
||||
$q->execute();
|
||||
|
||||
while (($p = $q->fetch(PDO::FETCH_ASSOC))) {
|
||||
|
||||
|
||||
$q = $pdo->prepare("DELETE FROM winners WHERE awards_prizes_id='{$p['id']}'");
|
||||
$q->execute();
|
||||
}
|
||||
@ -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();
|
||||
|
||||
|
@ -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 />';
|
||||
|
@ -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,41 +22,47 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
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'
|
||||
import StarterKit from 'https://esm.sh/@tiptap/starter-kit'
|
||||
<script type="module">
|
||||
import {
|
||||
Editor
|
||||
} from 'https://esm.sh/@tiptap/core'
|
||||
import StarterKit from 'https://esm.sh/@tiptap/starter-kit'
|
||||
|
||||
new Editor({
|
||||
element: document.querySelector('.element'),
|
||||
extensions: [
|
||||
StarterKit.configure({
|
||||
heading: {
|
||||
levels: [1, 2, 3],
|
||||
},
|
||||
}),
|
||||
],
|
||||
})
|
||||
</script>
|
||||
new Editor({
|
||||
element: document.querySelector('.element'),
|
||||
extensions: [
|
||||
StarterKit.configure({
|
||||
heading: {
|
||||
levels: [1, 2, 3],
|
||||
},
|
||||
}),
|
||||
],
|
||||
})
|
||||
</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/';
|
||||
@ -221,4 +227,4 @@ if (get_value_from_array($_GET, 'filename', '') || get_value_from_array($_GET, '
|
||||
}
|
||||
|
||||
send_footer();
|
||||
?>
|
||||
?>
|
@ -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");
|
||||
return false;
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
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");
|
||||
document.forms.addmember.add_member.value = "";
|
||||
return false;
|
||||
}
|
||||
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");
|
||||
document.forms.addmember.add_member.value = "";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function getElement(e,f)
|
||||
{
|
||||
if(document.layers)
|
||||
{
|
||||
f=(f)?f:self;
|
||||
if(f.document.layers[e]) {
|
||||
return 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) {
|
||||
return document.all[e];
|
||||
}
|
||||
}
|
||||
if(document.all) {
|
||||
return document.all[e];
|
||||
}
|
||||
return document.getElementById(e);
|
||||
}
|
||||
|
||||
|
||||
function actionChanged()
|
||||
{
|
||||
if(document.forms.memberaction.action.selectedIndex==1) //assign
|
||||
{
|
||||
getElement('assigndiv').style.display = 'block';
|
||||
|
||||
}
|
||||
else // edit or delete
|
||||
{
|
||||
getElement('assigndiv').style.display = 'none';
|
||||
return document.getElementById(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
alert('You must choose a member');
|
||||
return false;
|
||||
function actionChanged() {
|
||||
if (document.forms.memberaction.action.selectedIndex == 1) //assign
|
||||
{
|
||||
getElement('assigndiv').style.display = 'block';
|
||||
|
||||
} else // edit or delete
|
||||
{
|
||||
getElement('assigndiv').style.display = 'none';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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);
|
||||
return false;
|
||||
}
|
||||
if(document.forms.memberaction.action.selectedIndex==3) //remove
|
||||
{
|
||||
return confirmClick('Are you sure you want to completely remove this member?');
|
||||
}
|
||||
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) {
|
||||
alert('You must choose a member');
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
//-->
|
||||
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);
|
||||
return false;
|
||||
}
|
||||
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;
|
||||
@ -365,5 +361,4 @@ if ($q->rowCount()) {
|
||||
}
|
||||
|
||||
send_footer();
|
||||
?>
|
||||
|
||||
?>
|
@ -4,7 +4,7 @@
|
||||
|
||||
$mailqueries = array(
|
||||
'committee_all' => array('name' => 'Committee members (all)', 'query' =>
|
||||
"SELECT u.firstname, u.lastname, u.organization, u.email, u.deleted, q.year FROM users AS u INNER JOIN (SELECT uid, max(year) AS year FROM users GROUP BY uid) AS q ON u.uid = q.uid AND u.year = q.year WHERE u.types LIKE '%committee%' AND u.deleted='no' GROUP BY `u`.`id` ASC"),
|
||||
"SELECT u.firstname, u.lastname, u.organization, u.email, u.deleted, q.year FROM users AS u INNER JOIN (SELECT uid, max(year) AS year FROM users GROUP BY uid) AS q ON u.uid = q.uid AND u.year = q.year WHERE u.types LIKE '%committee%' AND u.deleted='no' GROUP BY `u`.`id` ASC"),
|
||||
/* The WHERE clause evaluates which rows to add to the GROUP
|
||||
BY, the HAVING clase evaluates which grouped rows show up. We
|
||||
want to to evaluate 'deleted' AFTER the grouping, so we catch
|
||||
@ -13,35 +13,35 @@ $mailqueries = array(
|
||||
end up picking up a user active in, say 2007 and 2008, but
|
||||
deleted in 2009. */
|
||||
'judges_all' => array('name' => 'Judges from all years (except deleted judges)', 'query' =>
|
||||
"SELECT u.firstname, u.lastname, u.email, u.deleted, q.year FROM users AS u INNER JOIN (SELECT uid, max(year) AS year FROM users GROUP BY uid ) AS q ON u.uid = q.uid AND u.year = q.year WHERE u.types LIKE '%judge%' AND u.deleted='no' ORDER BY `u`.`email` ASC"),
|
||||
"SELECT u.firstname, u.lastname, u.email, u.deleted, q.year FROM users AS u INNER JOIN (SELECT uid, max(year) AS year FROM users GROUP BY uid ) AS q ON u.uid = q.uid AND u.year = q.year WHERE u.types LIKE '%judge%' AND u.deleted='no' ORDER BY `u`.`email` ASC"),
|
||||
'judges_active_lastyear' => array('name' => 'Judges (all) active from last year', 'query' =>
|
||||
"SELECT firstname, lastname, email FROM users LEFT JOIN users_judge ON users_judge.users_id=users.id WHERE types LIKE '%judge%' AND year='" . ($config['FAIRYEAR'] - 1) . "' AND deleted='no' AND users_judge.judge_active='yes' ORDER BY email"),
|
||||
"SELECT firstname, lastname, email FROM users LEFT JOIN users_judge ON users_judge.users_id=users.id WHERE types LIKE '%judge%' AND year='" . ($config['FAIRYEAR'] - 1) . "' AND deleted='no' AND users_judge.judge_active='yes' ORDER BY email"),
|
||||
'judges_active_thisyear' => array('name' => 'Judges (all) active for this year', 'query' =>
|
||||
"SELECT firstname, lastname, email FROM users LEFT JOIN users_judge ON users_judge.users_id=users.id WHERE types LIKE '%judge%' AND year='{$config['FAIRYEAR']}' AND deleted='no' AND users_judge.judge_active='yes' ORDER BY email"),
|
||||
"SELECT firstname, lastname, email FROM users LEFT JOIN users_judge ON users_judge.users_id=users.id WHERE types LIKE '%judge%' AND year='{$config['FAIRYEAR']}' AND deleted='no' AND users_judge.judge_active='yes' ORDER BY email"),
|
||||
'judges_div_active_thisyear' => array('name' => 'Judges (regular judges only) active for this year', 'query' =>
|
||||
"SELECT firstname, lastname, email FROM users LEFT JOIN users_judge ON users_judge.users_id=users.id WHERE types LIKE '%judge%' AND year='{$config['FAIRYEAR']}' AND deleted='no' AND users_judge.judge_active='yes' AND (users_judge.special_award_only='no' OR users_judge.special_award_only='' OR users_judge.special_award_only IS NULL) ORDER BY email"),
|
||||
"SELECT firstname, lastname, email FROM users LEFT JOIN users_judge ON users_judge.users_id=users.id WHERE types LIKE '%judge%' AND year='{$config['FAIRYEAR']}' AND deleted='no' AND users_judge.judge_active='yes' AND (users_judge.special_award_only='no' OR users_judge.special_award_only='' OR users_judge.special_award_only IS NULL) ORDER BY email"),
|
||||
'judges_spec_active_thisyear' => array('name' => 'Judges (special award judges only) active for this year', 'query' =>
|
||||
"SELECT firstname, lastname, email FROM users LEFT JOIN users_judge ON users_judge.users_id=users.id WHERE types LIKE '%judge%' AND year='{$config['FAIRYEAR']}' AND deleted='no' AND users_judge.judge_active='yes' AND users_judge.special_award_only='yes' ORDER BY email"),
|
||||
"SELECT firstname, lastname, email FROM users LEFT JOIN users_judge ON users_judge.users_id=users.id WHERE types LIKE '%judge%' AND year='{$config['FAIRYEAR']}' AND deleted='no' AND users_judge.judge_active='yes' AND users_judge.special_award_only='yes' ORDER BY email"),
|
||||
'judges_inactive' => array('name' => 'Judges (all) not active for this year', 'query' =>
|
||||
"SELECT firstname, lastname, email, judge_active, deleted, MAX(year)
|
||||
"SELECT firstname, lastname, email, judge_active, deleted, MAX(year)
|
||||
FROM users LEFT JOIN users_judge ON users_judge.users_id=users.id
|
||||
WHERE types LIKE '%judge%'
|
||||
GROUP BY uid HAVING deleted='no' AND ((max(year)='{$config['FAIRYEAR']}' AND judge_active='no') OR max(year)<'{$config['FAIRYEAR']}')
|
||||
ORDER BY email"),
|
||||
'judges_active_complete_thisyear' => array('name' => 'Judges (all) active for this year and complete', 'query' =>
|
||||
"SELECT firstname, lastname, email FROM users LEFT JOIN users_judge ON users_judge.users_id=users.id WHERE types LIKE '%judge%' AND year='{$config['FAIRYEAR']}' AND users_judge.judge_complete='yes' AND deleted='no' AND users_judge.judge_active='yes' ORDER BY email"),
|
||||
"SELECT firstname, lastname, email FROM users LEFT JOIN users_judge ON users_judge.users_id=users.id WHERE types LIKE '%judge%' AND year='{$config['FAIRYEAR']}' AND users_judge.judge_complete='yes' AND deleted='no' AND users_judge.judge_active='yes' ORDER BY email"),
|
||||
'judges_active_incomplete_thisyear' => array('name' => 'Judges (all) active for this year but not complete', 'query' =>
|
||||
"SELECT firstname, lastname, email FROM users LEFT JOIN users_judge ON users_judge.users_id=users.id WHERE types LIKE '%judge%' AND year='{$config['FAIRYEAR']}' AND (users_judge.judge_complete!='yes' OR users_judge.judge_complete IS NULL) AND deleted='no' AND users_judge.judge_active='yes' ORDER BY email"),
|
||||
"SELECT firstname, lastname, email FROM users LEFT JOIN users_judge ON users_judge.users_id=users.id WHERE types LIKE '%judge%' AND year='{$config['FAIRYEAR']}' AND (users_judge.judge_complete!='yes' OR users_judge.judge_complete IS NULL) AND deleted='no' AND users_judge.judge_active='yes' ORDER BY email"),
|
||||
'participants_complete_thisyear' => array('name' => 'Participants complete this year', 'query' =>
|
||||
"SELECT firstname, lastname, students.email FROM students,registrations WHERE students.registrations_id=registrations.id AND registrations.year='" . $config['FAIRYEAR'] . "' AND ( registrations.status='complete' OR registrations.status='paymentpending') ORDER BY students.email"),
|
||||
"SELECT firstname, lastname, students.email FROM students,registrations WHERE students.registrations_id=registrations.id AND registrations.year='" . $config['FAIRYEAR'] . "' AND ( registrations.status='complete' OR registrations.status='paymentpending') ORDER BY students.email"),
|
||||
'participants_complete_paymentpending_thisyear' => array('name' => 'Participants complete this year but payment pending', 'query' =>
|
||||
"SELECT firstname, lastname, students.email FROM students,registrations WHERE students.registrations_id=registrations.id AND registrations.year='" . $config['FAIRYEAR'] . "' AND registrations.status!='complete' AND registrations.status='paymentpending' ORDER BY students.email"),
|
||||
"SELECT firstname, lastname, students.email FROM students,registrations WHERE students.registrations_id=registrations.id AND registrations.year='" . $config['FAIRYEAR'] . "' AND registrations.status!='complete' AND registrations.status='paymentpending' ORDER BY students.email"),
|
||||
'participants_notcomplete_thisyear' => array('name' => 'Participants not complete this year', 'query' =>
|
||||
"SELECT firstname, lastname, students.email FROM students,registrations WHERE students.registrations_id=registrations.id AND registrations.year='" . $config['FAIRYEAR'] . "' AND registrations.status!='complete' AND registrations.status!='new' ORDER BY students.email"),
|
||||
"SELECT firstname, lastname, students.email FROM students,registrations WHERE students.registrations_id=registrations.id AND registrations.year='" . $config['FAIRYEAR'] . "' AND registrations.status!='complete' AND registrations.status!='new' ORDER BY students.email"),
|
||||
'participants_complete_lastyear' => array('name' => 'Participants complete last year', 'query' =>
|
||||
"SELECT firstname, lastname, students.email FROM students,registrations WHERE students.registrations_id=registrations.id AND registrations.year='" . ($config['FAIRYEAR'] - 1) . "' AND ( registrations.status='complete' OR registrations.status='paymentpending') ORDER BY students.email"),
|
||||
"SELECT firstname, lastname, students.email FROM students,registrations WHERE students.registrations_id=registrations.id AND registrations.year='" . ($config['FAIRYEAR'] - 1) . "' AND ( registrations.status='complete' OR registrations.status='paymentpending') ORDER BY students.email"),
|
||||
'participants_complete_allyears' => array('name' => 'Participants complete all years', 'query' =>
|
||||
"SELECT DISTINCT firstname, lastname, students.email FROM students,registrations WHERE students.registrations_id=registrations.id AND ( registrations.status='complete' OR registrations.status='paymentpending') ORDER BY students.email"),
|
||||
"SELECT DISTINCT firstname, lastname, students.email FROM students,registrations WHERE students.registrations_id=registrations.id AND ( registrations.status='complete' OR registrations.status='paymentpending') ORDER BY students.email"),
|
||||
'participants_cwsf_thisyear' => array('name' => 'CWSF Winners for this year', 'query' => "
|
||||
SELECT DISTINCT students.firstname, students.lastname, students.email
|
||||
FROM award_awards
|
||||
@ -73,9 +73,9 @@ $mailqueries = array(
|
||||
WHERE award_awards.cwsfaward='1'
|
||||
ORDER BY students.email"),
|
||||
'sponsors' => array('name' => 'Organization sponsors', 'query' =>
|
||||
"SELECT id, organization, email FROM sponsors WHERE email!='' ORDER BY email"),
|
||||
"SELECT id, organization, email FROM sponsors WHERE email!='' ORDER BY email"),
|
||||
'sponsors_primarycontacts' => array('name' => 'Organization sponsors (primary contacts)', 'query' =>
|
||||
"SELECT uid, MAX(users.year) AS year, sponsors.organization, users.firstname, users.lastname, users.email, deleted, users_sponsor.primary
|
||||
"SELECT uid, MAX(users.year) AS year, sponsors.organization, users.firstname, users.lastname, users.email, deleted, users_sponsor.primary
|
||||
FROM sponsors,
|
||||
users_sponsor,
|
||||
users
|
||||
@ -89,7 +89,7 @@ $mailqueries = array(
|
||||
ORDER BY users.email
|
||||
"),
|
||||
'sponsors_allcontacts' => array('name' => 'Organization sponsors (all contacts)', 'query' =>
|
||||
"SELECT DISTINCT(users.email), sponsors.organization, users.firstname, users.lastname, users.email
|
||||
"SELECT DISTINCT(users.email), sponsors.organization, users.firstname, users.lastname, users.email
|
||||
FROM sponsors,
|
||||
users_sponsor,
|
||||
users
|
||||
@ -102,7 +102,7 @@ $mailqueries = array(
|
||||
ORDER BY users.email
|
||||
"),
|
||||
'sponsors_specialawards' => array('name' => 'Organization sponsors for Special Awards', 'query' =>
|
||||
"SELECT DISTINCT sponsors.id, organization, email
|
||||
"SELECT DISTINCT sponsors.id, organization, email
|
||||
FROM sponsors
|
||||
JOIN award_awards ON sponsors.id=award_awards.sponsors_id
|
||||
WHERE
|
||||
@ -110,7 +110,7 @@ $mailqueries = array(
|
||||
AND award_awards.award_types_id=2
|
||||
ORDER BY email"),
|
||||
'sponsors_primarycontacts_specialawards' => array('name' => 'Organization sponsors for Special Awards (primary contacts)', 'query' =>
|
||||
"SELECT DISTINCT uid, MAX(users.year) AS year, sponsors.organization, users.firstname, users.lastname, users.email, deleted, users_sponsor.primary
|
||||
"SELECT DISTINCT uid, MAX(users.year) AS year, sponsors.organization, users.firstname, users.lastname, users.email, deleted, users_sponsor.primary
|
||||
FROM sponsors,
|
||||
users_sponsor,
|
||||
users,
|
||||
@ -127,7 +127,7 @@ $mailqueries = array(
|
||||
ORDER BY users.email
|
||||
"),
|
||||
'sponsors_allcontacts_specialawards' => array('name' => 'Organization sponsors for Special Awards (all contacts)', 'query' =>
|
||||
"SELECT DISTINCT(users.email), sponsors.organization, users.firstname, users.lastname, users.email
|
||||
"SELECT DISTINCT(users.email), sponsors.organization, users.firstname, users.lastname, users.email
|
||||
FROM sponsors,
|
||||
users_sponsor,
|
||||
users,
|
||||
@ -151,28 +151,27 @@ $mailqueries = array(
|
||||
* "SELECT DISTINCT(award_sponsors.id), organization, firstname, lastname, award_contacts.email FROM award_sponsors, award_awards, award_contacts WHERE award_awards.sponsors_id=award_sponsors.id AND award_contacts.award_sponsors_id=award_sponsors.id AND award_awards.award_types_id='2' AND award_contacts.year='".$config['FAIRYEAR']."'"),
|
||||
*/
|
||||
'school_principals' => array('name' => 'School principals', 'query' =>
|
||||
"SELECT schools.principal_uid AS uid, schools.school, users.firstname AS firstname, users.lastname AS lastname, users.email AS email FROM schools
|
||||
"SELECT schools.principal_uid AS uid, schools.school, users.firstname AS firstname, users.lastname AS lastname, users.email AS email FROM schools
|
||||
JOIN users ON schools.principal_uid=users.uid AND users.id=(SELECT id FROM users WHERE users.uid=schools.principal_uid ORDER BY `year` DESC LIMIT 1)
|
||||
WHERE schools.year='" . $config['FAIRYEAR'] . "' AND users.email!=''"),
|
||||
'school_scienceheads' => array('name' => 'School science heads', 'query' =>
|
||||
"SELECT schools.sciencehead_uid AS uid, schools.school, users.firstname AS firstname, users.lastname AS lastname, users.email AS email FROM schools
|
||||
"SELECT schools.sciencehead_uid AS uid, schools.school, users.firstname AS firstname, users.lastname AS lastname, users.email AS email FROM schools
|
||||
JOIN users ON schools.sciencehead_uid=users.uid AND users.id=(SELECT id FROM users WHERE users.uid=schools.sciencehead_uid ORDER BY `year` DESC LIMIT 1)
|
||||
WHERE schools.year='" . $config['FAIRYEAR'] . "' AND users.email!=''"),
|
||||
'school_with_project_thisyear' => array('name' => 'Schools with projects this year', 'query' =>
|
||||
'SELECT DISTINCT(sc.schoolemail) AS email, sc.school AS firstname FROM students AS st LEFT JOIN schools AS sc ON sc.id = st.schools_id WHERE st.year = ' . $config['FAIRYEAR'] . ' AND LENGTH( sc.schoolemail ) !=0 ORDER BY email
|
||||
'SELECT DISTINCT(sc.schoolemail) AS email, sc.school AS firstname FROM students AS st LEFT JOIN schools AS sc ON sc.id = st.schools_id WHERE st.year = ' . $config['FAIRYEAR'] . ' AND LENGTH( sc.schoolemail ) !=0 ORDER BY email
|
||||
'),
|
||||
'school_thisyear' => array('name' => 'Schools this year', 'query' =>
|
||||
"SELECT school AS firstname, schoolemail AS email FROM `schools` WHERE `year` ='" . $config['FAIRYEAR'] . "' GROUP BY schoolemail"),
|
||||
"SELECT school AS firstname, schoolemail AS email FROM `schools` WHERE `year` ='" . $config['FAIRYEAR'] . "' GROUP BY schoolemail"),
|
||||
'school_teachers_thisyear' => array('name' => 'Teachers (as entered by students) this year', 'query' =>
|
||||
"SELECT teachername AS firstname, teacheremail AS email FROM students WHERE year = '" . $config['FAIRYEAR'] . "' GROUP BY teacheremail"),
|
||||
"SELECT teachername AS firstname, teacheremail AS email FROM students WHERE year = '" . $config['FAIRYEAR'] . "' GROUP BY teacheremail"),
|
||||
'school_teachers_lastyear' => array('name' => 'Teachers (as entered by students) last year', 'query' =>
|
||||
"SELECT teachername AS firstname, teacheremail AS email FROM students WHERE year = '" . ($config['FAIRYEAR'] - 1) . "' GROUP BY teacheremail"),
|
||||
"SELECT teachername AS firstname, teacheremail AS email FROM students WHERE year = '" . ($config['FAIRYEAR'] - 1) . "' GROUP BY teacheremail"),
|
||||
'school_teachers_allyears' => array('name' => 'Teachers (as entered by students) all years', 'query' =>
|
||||
'SELECT teachername AS firstname, teacheremail AS email FROM students GROUP BY teacheremail'),
|
||||
'SELECT teachername AS firstname, teacheremail AS email FROM students GROUP BY teacheremail'),
|
||||
/* Volunteers */
|
||||
'volunteers_active_complete_thisyear' => array('name' => 'Volunteers active for this year and 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='yes' AND users_volunteer.volunteer_active='yes' AND users.deleted='no' AND types LIKE '%volunteer%' ORDER BY email"),
|
||||
"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='yes' AND users_volunteer.volunteer_active='yes' AND users.deleted='no' AND types LIKE '%volunteer%' ORDER BY email"),
|
||||
'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"),
|
||||
"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"),
|
||||
);
|
||||
?>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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,41 +121,47 @@ 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() {
|
||||
<? if ($config['emailqueue_lock']) { ?>
|
||||
refreshTimeout=setTimeout('refreshStatus()',1000);
|
||||
<? } ?>
|
||||
});
|
||||
}
|
||||
var refreshTimeout;
|
||||
|
||||
function stopRefreshing() {
|
||||
if(refreshTimeout) {
|
||||
clearTimeout(refreshTimeout);
|
||||
window.location.href="communication_send_status.php";
|
||||
}
|
||||
}
|
||||
function refreshStatus() {
|
||||
$("#queuestatus").load("communication_send_status.php?action=status", null, function() {
|
||||
<? if ($config['emailqueue_lock']) { ?>
|
||||
refreshTimeout = setTimeout('refreshStatus()', 1000);
|
||||
<? } ?>
|
||||
});
|
||||
}
|
||||
|
||||
function cancelQueue(id) {
|
||||
$("#debug").load("communication.php?action=cancel&cancel="+id,null,function() { if(!refreshTimeout) refreshStatus(); });
|
||||
}
|
||||
function stopRefreshing() {
|
||||
if (refreshTimeout) {
|
||||
clearTimeout(refreshTimeout);
|
||||
window.location.href = "communication_send_status.php";
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<?
|
||||
function cancelQueue(id) {
|
||||
$("#debug").load("communication.php?action=cancel&cancel=" + id, null, function() {
|
||||
if (!refreshTimeout) refreshStatus();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<?
|
||||
echo '<br />';
|
||||
echo '<div id="queuestatus" style="margin-left: 20px;">';
|
||||
echo '</div>';
|
||||
echo '<br />';
|
||||
|
||||
send_footer();
|
||||
?>
|
||||
?>
|
@ -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':
|
||||
|
@ -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 ' ';
|
||||
echo ' ';
|
||||
echo ' ';
|
||||
@ -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"';
|
||||
|
@ -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();
|
||||
|
@ -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');
|
||||
|
@ -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,123 +22,147 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
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() {
|
||||
//initialize the dialog
|
||||
$("#sponsorship_editor").dialog({
|
||||
bgiframe: true, autoOpen: false,
|
||||
modal: true, resizable: false,
|
||||
draggable: false
|
||||
});
|
||||
$(document).ready(function() {
|
||||
//initialize the dialog
|
||||
$("#sponsorship_editor").dialog({
|
||||
bgiframe: true,
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
draggable: false
|
||||
});
|
||||
|
||||
$("#fund_editor").dialog({
|
||||
bgiframe: true, autoOpen: false,
|
||||
modal: true, resizable: falsefundraising,
|
||||
draggable: false
|
||||
});
|
||||
$("#fund_editor").dialog({
|
||||
bgiframe: true,
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
resizable: falsefundraising,
|
||||
draggable: false
|
||||
});
|
||||
|
||||
refresh_fundraising_table();
|
||||
|
||||
});
|
||||
|
||||
function popup_sponsorship_editor(url) {
|
||||
var w = (document.documentElement.clientWidth * 0.6);
|
||||
$('#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('open');
|
||||
|
||||
$('#sponsorship_editor_content').load(url);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function save_sponsorship() {
|
||||
$('#debug').load("<?= $config['SFIABDIRECTORY'] ?>/admin/fundraising.php",
|
||||
$("#fundraisingsponsorship").serializeArray(),
|
||||
function() {
|
||||
$('#sponsorship_editor').dialog('close');
|
||||
refresh_fundraising_table();
|
||||
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function popup_fund_editor(url) {
|
||||
var w = (document.documentElement.clientWidth * 0.6);
|
||||
$('#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('open');
|
||||
function popup_sponsorship_editor(url) {
|
||||
var w = (document.documentElement.clientWidth * 0.6);
|
||||
$('#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('open');
|
||||
|
||||
$('#fund_editor_content').load(url);
|
||||
$('#sponsorship_editor_content').load(url);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function save_fund() {
|
||||
$("#debug").load("<?= $config['SFIABDIRECTORY'] ?>/admin/fundraising.php",
|
||||
$("#fundraisingfundraising").serializeArray(),
|
||||
function(data) {
|
||||
$('#fund_editor').dialog('close');
|
||||
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() {
|
||||
refresh_fundraising_table();
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function delete_sponsorship(id) {
|
||||
if(confirmClick('Are you sure you want to remove this sponsorship?')) {
|
||||
function save_sponsorship() {
|
||||
$('#debug').load("<?= $config['SFIABDIRECTORY'] ?>/admin/fundraising.php",
|
||||
{ action: 'sponsorshipdelete', delete: id },
|
||||
function() {
|
||||
refresh_fundraising_table();
|
||||
}
|
||||
);
|
||||
$("#fundraisingsponsorship").serializeArray(),
|
||||
function() {
|
||||
$('#sponsorship_editor').dialog('close');
|
||||
refresh_fundraising_table();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function refresh_fundraising_table() {
|
||||
$("#fundraisingmain").load("fundraising.php?action=fundraisingmain");
|
||||
}
|
||||
function popup_fund_editor(url) {
|
||||
var w = (document.documentElement.clientWidth * 0.6);
|
||||
$('#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('open');
|
||||
|
||||
$('#fund_editor_content').load(url);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function save_fund() {
|
||||
$("#debug").load("<?= $config['SFIABDIRECTORY'] ?>/admin/fundraising.php",
|
||||
$("#fundraisingfundraising").serializeArray(),
|
||||
function(data) {
|
||||
$('#fund_editor').dialog('close');
|
||||
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() {
|
||||
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() {
|
||||
refresh_fundraising_table();
|
||||
}
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function refresh_fundraising_table() {
|
||||
$("#fundraisingmain").load("fundraising.php?action=fundraisingmain");
|
||||
}
|
||||
</script>
|
||||
<?
|
||||
|
||||
@ -167,13 +191,13 @@ 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();
|
||||
?>
|
||||
?>
|
@ -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,13 +386,13 @@ 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>
|
||||
<?
|
||||
} else {
|
||||
?>
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$("#contactnewsave").attr("disabled", "");
|
||||
</script>
|
||||
@ -639,7 +639,7 @@ function draw_contactsinfo_form($contact = null)
|
||||
echo "<div id=\"contactaccordion\" style=\"width: 740px;\">\n";
|
||||
|
||||
// loop through each contact and draw a form with their data in it.
|
||||
|
||||
|
||||
$query = $pdo->prepare("SELECT *,MAX(year) FROM users LEFT JOIN users_sponsor ON users_sponsor.users_id=users.id
|
||||
WHERE
|
||||
sponsors_id='" . $sponsor_id . "'
|
||||
@ -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);
|
||||
|
@ -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";
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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(
|
||||
|
@ -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,91 +21,85 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
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',
|
||||
'schools_ext' => 'Extra school participation data, number of public/private school students',
|
||||
'minorities' => 'Data on minority group participation',
|
||||
'guests' => 'Number of student, public guests',
|
||||
'sffbc_misc' => 'Number of teachers supporting science, number of students interested in careers in science',
|
||||
'info' => 'Fair address, dates, budget, charity info',
|
||||
'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',
|
||||
);
|
||||
$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',
|
||||
'sffbc_misc' => 'Number of teachers supporting science, number of students interested in careers in science',
|
||||
'info' => 'Fair address, dates, budget, charity info',
|
||||
'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']) {
|
||||
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)) {
|
||||
echo "Undefined stat $s, abort.\n";
|
||||
exit;
|
||||
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)) {
|
||||
echo "Undefined stat $s, abort.\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
$s = join(',', $_POST['stats']);
|
||||
$q = $pdo->prepare("UPDATE fairs SET gather_stats='$s' WHERE id='$id'");
|
||||
$q->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
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);
|
||||
|
||||
?>
|
||||
|
||||
<h4><?=i18n('Fair Stats Gathering')?></h3>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function stats_save()
|
||||
{
|
||||
$("#debug").load("fair_stats_select.php?action=save", $("#gather_stats").serializeArray());
|
||||
return 0;
|
||||
$s = join(',', $_POST['stats']);
|
||||
$q = $pdo->prepare("UPDATE fairs SET gather_stats='$s' WHERE id='$id'");
|
||||
$q->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
echo "UPDATE fairs SET gather_stats='$s' WHERE id='$id'";
|
||||
happy_("Saved");
|
||||
exit;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<?
|
||||
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>';
|
||||
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);
|
||||
|
||||
?>
|
||||
<form id="gather_stats">
|
||||
<input type="hidden" name="fairs_id" value="<?=$f['id']?>" />
|
||||
<table class="editor">
|
||||
<?
|
||||
$selected_stats = split(',', $f['gather_stats']);
|
||||
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>";
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
<br />
|
||||
<input type="submit" onClick="stats_save();return false;" value="Save" />
|
||||
</form>
|
||||
|
||||
<h4><?= i18n('Fair Stats Gathering') ?></h3>
|
||||
|
||||
<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>';
|
||||
} else {
|
||||
echo '<p>' . i18n('Not supported for upstream fairs') . '</p>';
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<form id="gather_stats">
|
||||
<input type="hidden" name="fairs_id" value="<?= $f['id'] ?>" />
|
||||
<table class="editor">
|
||||
<?
|
||||
$selected_stats = split(',', $f['gather_stats']);
|
||||
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>";
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
<br />
|
||||
<input type="submit" onClick="stats_save();return false;" value="Save" />
|
||||
</form>
|
@ -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);
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -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,113 +22,115 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
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">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= i18n('Purpose') ?></th>
|
||||
<th><?= i18n('Goal') ?></th>
|
||||
<th><?= i18n('Amount Received') ?></th>
|
||||
<th><?= i18n('% to Budget') ?></th>
|
||||
<th><?= i18n('Deadline') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?
|
||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||
// lookup all donations made towards this goal
|
||||
$recq = $pdo->prepare("SELECT SUM(value) AS received FROM fundraising_donations WHERE fundraising_goal='$r->goal' AND fiscalyear='{$config['FISCALYEAR']}' AND status='received'");
|
||||
$recq->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
$recr = $recq->fetch(PDO::FETCH_OBJ);
|
||||
$received = $recr->received;
|
||||
if ($r->budget)
|
||||
$percent = round($received / $r->budget * 100, 1);
|
||||
else
|
||||
$percent = 0;
|
||||
?>
|
||||
<table class="tableview">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= i18n('Purpose') ?></th>
|
||||
<th><?= i18n('Goal') ?></th>
|
||||
<th><?= i18n('Amount Received') ?></th>
|
||||
<th><?= i18n('% to Budget') ?></th>
|
||||
<th><?= i18n('Deadline') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?
|
||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||
// lookup all donations made towards this goal
|
||||
$recq = $pdo->prepare("SELECT SUM(value) AS received FROM fundraising_donations WHERE fundraising_goal='$r->goal' AND fiscalyear='{$config['FISCALYEAR']}' AND status='received'");
|
||||
$recq->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
$recr = $recq->fetch(PDO::FETCH_OBJ);
|
||||
$received = $recr->received;
|
||||
if ($r->budget)
|
||||
$percent = round($received / $r->budget * 100, 1);
|
||||
else
|
||||
$percent = 0;
|
||||
|
||||
echo "<tr><td>$r->name</td>";
|
||||
echo '<td style="text-align: right;">' . format_money($r->budget, false) . '</td>';
|
||||
echo '<td style="text-align: right;">' . format_money($received, false) . '</td>';
|
||||
$col = colour_to_percent($percent);
|
||||
echo "<td style=\"text-align: center; background-color: $col;\">{$percent}%</td>";
|
||||
echo '<td>' . format_date($r->deadline) . "</td></tr>\n";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<br />
|
||||
|
||||
<h3><?= i18n('Current Appeals') ?></h3>
|
||||
<table class="tableview">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= i18n('Name') ?></th>
|
||||
<th><?= i18n('Type') ?></th>
|
||||
<th><?= i18n('Start Date') ?></th>
|
||||
<th><?= i18n('End Date') ?></th>
|
||||
<th><?= i18n('Target($)') ?></th>
|
||||
<th><?= i18n('Received') ?></th>
|
||||
<th><?= i18n('% to Budget') ?></th>
|
||||
<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)) {
|
||||
$goalq = $pdo->prepare("SELECT * FROM fundraising_goals WHERE goal='{$r->fundraising_goal}' AND fiscalyear='{$config['FISCALYEAR']}'");
|
||||
$goalq->execute();
|
||||
$goalr = $goalq->fetch(PDO::FETCH_OBJ);
|
||||
$recq = $pdo->prepare("SELECT SUM(value) AS received FROM fundraising_donations WHERE fundraising_campaigns_id='$r->id' AND fiscalyear='{$config['FISCALYEAR']}' AND status='received'");
|
||||
$recq->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
$recr = $recq->fetch(PDO::FETCH_OBJ);
|
||||
$received = $recr->received;
|
||||
if ($r->target)
|
||||
$percent = round($received / $r->target * 100, 1);
|
||||
else
|
||||
$percent = 0;
|
||||
$col = colour_to_percent($percent);
|
||||
|
||||
if (!$goalr) {
|
||||
$goalr = new stdClass();
|
||||
$goalr->name = '';
|
||||
echo "<tr><td>$r->name</td>";
|
||||
echo '<td style="text-align: right;">' . format_money($r->budget, false) . '</td>';
|
||||
echo '<td style="text-align: right;">' . format_money($received, false) . '</td>';
|
||||
$col = colour_to_percent($percent);
|
||||
echo "<td style=\"text-align: center; background-color: $col;\">{$percent}%</td>";
|
||||
echo '<td>' . format_date($r->deadline) . "</td></tr>\n";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<br />
|
||||
|
||||
echo "<tr style=\"cursor:pointer;\" onclick=\"window.location.href='fundraising_campaigns.php?manage_campaign=$r->id'\">\n";
|
||||
echo " <td>$r->name</td>\n";
|
||||
echo " <td>$r->type</td>\n";
|
||||
echo ' <td>' . format_date($r->startdate) . "</td>\n";
|
||||
echo ' <td>' . format_date($r->enddate) . '</td>';
|
||||
echo ' <td style="text-align: right;">' . format_money($r->target, false) . "</td>\n";
|
||||
echo ' <td style="text-align: right;">' . format_money($received, false) . "</td>\n";
|
||||
echo " <td style=\"text-align: center; background-color: $col;\">{$percent}%</td>\n";
|
||||
echo " <td>$goalr->name</td>";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript"> $('.tableview').tablesorter();</script>
|
||||
<br />
|
||||
<h3><?= i18n('Current Appeals') ?></h3>
|
||||
<table class="tableview">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= i18n('Name') ?></th>
|
||||
<th><?= i18n('Type') ?></th>
|
||||
<th><?= i18n('Start Date') ?></th>
|
||||
<th><?= i18n('End Date') ?></th>
|
||||
<th><?= i18n('Target($)') ?></th>
|
||||
<th><?= i18n('Received') ?></th>
|
||||
<th><?= i18n('% to Budget') ?></th>
|
||||
<th><?= i18n('Purpose') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?
|
||||
$q = $pdo->prepare("SELECT * FROM fundraising_campaigns WHERE fiscalyear='{$config['FISCALYEAR']}'");
|
||||
$q->execute();
|
||||
|
||||
<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,
|
||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||
$goalq = $pdo->prepare("SELECT * FROM fundraising_goals WHERE goal='{$r->fundraising_goal}' AND fiscalyear='{$config['FISCALYEAR']}'");
|
||||
$goalq->execute();
|
||||
$goalr = $goalq->fetch(PDO::FETCH_OBJ);
|
||||
$recq = $pdo->prepare("SELECT SUM(value) AS received FROM fundraising_donations WHERE fundraising_campaigns_id='$r->id' AND fiscalyear='{$config['FISCALYEAR']}' AND status='received'");
|
||||
$recq->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
$recr = $recq->fetch(PDO::FETCH_OBJ);
|
||||
$received = $recr->received;
|
||||
if ($r->target)
|
||||
$percent = round($received / $r->target * 100, 1);
|
||||
else
|
||||
$percent = 0;
|
||||
$col = colour_to_percent($percent);
|
||||
|
||||
if (!$goalr) {
|
||||
$goalr = new stdClass();
|
||||
$goalr->name = '';
|
||||
}
|
||||
|
||||
echo "<tr style=\"cursor:pointer;\" onclick=\"window.location.href='fundraising_campaigns.php?manage_campaign=$r->id'\">\n";
|
||||
echo " <td>$r->name</td>\n";
|
||||
echo " <td>$r->type</td>\n";
|
||||
echo ' <td>' . format_date($r->startdate) . "</td>\n";
|
||||
echo ' <td>' . format_date($r->enddate) . '</td>';
|
||||
echo ' <td style="text-align: right;">' . format_money($r->target, false) . "</td>\n";
|
||||
echo ' <td style="text-align: right;">' . format_money($received, false) . "</td>\n";
|
||||
echo " <td style=\"text-align: center; background-color: $col;\">{$percent}%</td>\n";
|
||||
echo " <td>$goalr->name</td>";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</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>
|
||||
<?
|
||||
$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
|
||||
FROM fundraising_donations
|
||||
@ -136,55 +138,55 @@ if (get_value_from_array($_GET, 'action') == 'refresh') {
|
||||
AND fiscalyear='{$config['FISCALYEAR']}'
|
||||
ORDER BY datereceived
|
||||
");
|
||||
$q->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
$q->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
|
||||
if ($q->rowCount()) {
|
||||
echo '<table class="tableview">';
|
||||
echo '<thead><tr><th>' . i18n('Name') . "</th>\n";
|
||||
echo '<th>' . i18n('Date Received') . "</th>\n";
|
||||
echo '<th>' . i18n('Amount') . "</th>\n";
|
||||
echo '<th>' . i18n('Generate Thank You') . "</th>\n";
|
||||
echo '<th>' . i18n('Thanked') . "</th>\n";
|
||||
echo "</tr></thead>\n";
|
||||
if ($q->rowCount()) {
|
||||
echo '<table class="tableview">';
|
||||
echo '<thead><tr><th>' . i18n('Name') . "</th>\n";
|
||||
echo '<th>' . i18n('Date Received') . "</th>\n";
|
||||
echo '<th>' . i18n('Amount') . "</th>\n";
|
||||
echo '<th>' . i18n('Generate Thank You') . "</th>\n";
|
||||
echo '<th>' . i18n('Thanked') . "</th>\n";
|
||||
echo "</tr></thead>\n";
|
||||
|
||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||
$dq = $pdo->prepare("SELECT organization AS name FROM sponsors WHERE id='$r->sponsors_id'");
|
||||
$dq->execute();
|
||||
$dr = $dq->fetch(PDO::FETCH_OBJ);
|
||||
if ($r->twomonth)
|
||||
$s = 'style="background-color: ' . colour_to_percent(0) . ';"';
|
||||
else if ($r->onemonth)
|
||||
$s = 'style="background-color: ' . colour_to_percent(50) . ';"';
|
||||
else
|
||||
$s = '';
|
||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||
$dq = $pdo->prepare("SELECT organization AS name FROM sponsors WHERE id='$r->sponsors_id'");
|
||||
$dq->execute();
|
||||
$dr = $dq->fetch(PDO::FETCH_OBJ);
|
||||
if ($r->twomonth)
|
||||
$s = 'style="background-color: ' . colour_to_percent(0) . ';"';
|
||||
else if ($r->onemonth)
|
||||
$s = 'style="background-color: ' . colour_to_percent(50) . ';"';
|
||||
else
|
||||
$s = '';
|
||||
|
||||
$u = getUserForSponsor($r->sponsors_id);
|
||||
$u = getUserForSponsor($r->sponsors_id);
|
||||
|
||||
echo "<tr $s>";
|
||||
echo " <td>$dr->name</td>";
|
||||
echo ' <td>' . format_date($r->datereceived) . '</td>';
|
||||
echo ' <td style="text-align: right;">' . format_money($r->value) . '</td>';
|
||||
echo ' <td style="text-align: center;">';
|
||||
if ($u) {
|
||||
echo "<a href=\"#\" onclick=\"return opencommunicationsender('{$u['uid']}','fundraising_thankyou_template');\">" . i18n('Generate Thank You') . '</a></td>';
|
||||
} else {
|
||||
echo i18n('No contact');
|
||||
echo "<tr $s>";
|
||||
echo " <td>$dr->name</td>";
|
||||
echo ' <td>' . format_date($r->datereceived) . '</td>';
|
||||
echo ' <td style="text-align: right;">' . format_money($r->value) . '</td>';
|
||||
echo ' <td style="text-align: center;">';
|
||||
if ($u) {
|
||||
echo "<a href=\"#\" onclick=\"return opencommunicationsender('{$u['uid']}','fundraising_thankyou_template');\">" . i18n('Generate Thank You') . '</a></td>';
|
||||
} else {
|
||||
echo i18n('No contact');
|
||||
}
|
||||
echo "<td align=\"center\"><input style=\"padding: 0px; margin: 0px;\" type=\"checkbox\" name=\"thanked[]\" value=\"$r->id\" onclick=\"return thanked($r->id)\"></td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "<td align=\"center\"><input style=\"padding: 0px; margin: 0px;\" type=\"checkbox\" name=\"thanked[]\" value=\"$r->id\" onclick=\"return thanked($r->id)\"></td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
} else {
|
||||
echo i18n("No Thank You's pending");
|
||||
echo "<br />\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
} else {
|
||||
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,45 +281,47 @@ 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() {
|
||||
refreshDashboard();
|
||||
});
|
||||
$(document).ready(function() {
|
||||
refreshDashboard();
|
||||
});
|
||||
|
||||
function refreshDashboard() {
|
||||
$("#dashboard").load("fundraising.php?action=refresh");
|
||||
}
|
||||
function refreshDashboard() {
|
||||
$("#dashboard").load("fundraising.php?action=refresh");
|
||||
}
|
||||
|
||||
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() {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
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() {});
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="dashboard"></div>
|
||||
|
||||
<?
|
||||
send_footer();
|
||||
?>
|
||||
?>
|
@ -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,92 +44,98 @@ 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;">
|
||||
<br />
|
||||
<input type="submit" value="<?= i18n('Save Appeal') ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="6" style="text-align: center;">
|
||||
<br />
|
||||
<input type="submit" value="<?= i18n('Save Appeal') ?>">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
<h3><a href="#"><?= i18n('Create New Appeal') ?></a></h3>
|
||||
<div id="campaign_new">
|
||||
<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;">
|
||||
<br />
|
||||
<input type="submit" value="<?= i18n('Create Appeal') ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<h3><a href="#"><?= i18n('Create New Appeal') ?></a></h3>
|
||||
<div id="campaign_new">
|
||||
<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;">
|
||||
<br />
|
||||
<input type="submit" value="<?= i18n('Create Appeal') ?>">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
exit;
|
||||
break;
|
||||
exit;
|
||||
break;
|
||||
|
||||
case 'managelist':
|
||||
echo i18n('Select an appeal');
|
||||
case 'managelist':
|
||||
echo i18n('Select an appeal');
|
||||
?>
|
||||
<table class="tableview">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= i18n('Name') ?></th>
|
||||
<th><?= i18n('Type') ?></th>
|
||||
<th><?= i18n('Start Date') ?></th>
|
||||
<th><?= i18n('End Date') ?></th>
|
||||
<th><?= i18n('Target($)') ?></th>
|
||||
<th><?= i18n('Received') ?></th>
|
||||
<th><?= i18n('% to Budget') ?></th>
|
||||
<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)) {
|
||||
$goalq = $pdo->prepare("SELECT * FROM fundraising_goals WHERE goal='{$r->fundraising_goal}' AND fiscalyear='{$config['FISCALYEAR']}'");
|
||||
$goalq->execute();
|
||||
$goalr = $goalq->fetch(PDO::FETCH_OBJ);
|
||||
$recq = $pdo->prepare("SELECT SUM(value) AS received FROM fundraising_donations WHERE fundraising_campaigns_id='$r->id' AND fiscalyear='{$config['FISCALYEAR']}' AND status='received'");
|
||||
$recq->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
$recr = $recq->fetch(PDO::FETCH_OBJ);
|
||||
$received = $recr->received;
|
||||
if ($r->target)
|
||||
$percent = round($received / $r->target * 100, 1);
|
||||
else
|
||||
$percent = 0;
|
||||
$col = colour_to_percent($percent);
|
||||
<table class="tableview">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= i18n('Name') ?></th>
|
||||
<th><?= i18n('Type') ?></th>
|
||||
<th><?= i18n('Start Date') ?></th>
|
||||
<th><?= i18n('End Date') ?></th>
|
||||
<th><?= i18n('Target($)') ?></th>
|
||||
<th><?= i18n('Received') ?></th>
|
||||
<th><?= i18n('% to Budget') ?></th>
|
||||
<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)) {
|
||||
$goalq = $pdo->prepare("SELECT * FROM fundraising_goals WHERE goal='{$r->fundraising_goal}' AND fiscalyear='{$config['FISCALYEAR']}'");
|
||||
$goalq->execute();
|
||||
$goalr = $goalq->fetch(PDO::FETCH_OBJ);
|
||||
$recq = $pdo->prepare("SELECT SUM(value) AS received FROM fundraising_donations WHERE fundraising_campaigns_id='$r->id' AND fiscalyear='{$config['FISCALYEAR']}' AND status='received'");
|
||||
$recq->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
$recr = $recq->fetch(PDO::FETCH_OBJ);
|
||||
$received = $recr->received;
|
||||
if ($r->target)
|
||||
$percent = round($received / $r->target * 100, 1);
|
||||
else
|
||||
$percent = 0;
|
||||
$col = colour_to_percent($percent);
|
||||
|
||||
if (!$goalr) {
|
||||
$goalr = new stdClass();
|
||||
$goalr->name = '';
|
||||
if (!$goalr) {
|
||||
$goalr = new stdClass();
|
||||
$goalr->name = '';
|
||||
}
|
||||
|
||||
echo "<tr style=\"cursor:pointer;\" onclick=\"return managecampaign($r->id)\">\n";
|
||||
echo " <td>$r->name</td>\n";
|
||||
echo " <td>$r->type</td>\n";
|
||||
echo ' <td>' . format_date($r->startdate) . "</td>\n";
|
||||
echo ' <td>' . format_date($r->enddate) . '</td>';
|
||||
echo ' <td style="text-align: right;">' . format_money($r->target, false) . "</td>\n";
|
||||
echo ' <td style="text-align: right;">' . format_money($received, false) . "</td>\n";
|
||||
echo " <td style=\"text-align: center; background-color: $col;\">{$percent}%</td>\n";
|
||||
echo " <td>$goalr->name</td>";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
echo "<tr style=\"cursor:pointer;\" onclick=\"return managecampaign($r->id)\">\n";
|
||||
echo " <td>$r->name</td>\n";
|
||||
echo " <td>$r->type</td>\n";
|
||||
echo ' <td>' . format_date($r->startdate) . "</td>\n";
|
||||
echo ' <td>' . format_date($r->enddate) . '</td>';
|
||||
echo ' <td style="text-align: right;">' . format_money($r->target, false) . "</td>\n";
|
||||
echo ' <td style="text-align: right;">' . format_money($received, false) . "</td>\n";
|
||||
echo " <td style=\"text-align: center; background-color: $col;\">{$percent}%</td>\n";
|
||||
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,28 +149,28 @@ 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>
|
||||
<li><a href="#campaign_tab_donations"><span><?= i18n('Donations/Sponsorships') ?></span></a></li>
|
||||
<li><a href="#campaign_tab_prospects"><span><?= i18n('Prospects') ?></span></a></li>
|
||||
<li><a href="#campaign_tab_communications"><span><?= i18n('Communications') ?></span></a></li>
|
||||
</ul>
|
||||
<div id="campaign_tab_overview">
|
||||
overview tab
|
||||
?>
|
||||
<div id="campaign_tabs">
|
||||
<ul>
|
||||
<li><a href="#campaign_tab_overview"><span><?= i18n('Overview') ?></span></a></li>
|
||||
<li><a href="#campaign_tab_donations"><span><?= i18n('Donations/Sponsorships') ?></span></a></li>
|
||||
<li><a href="#campaign_tab_prospects"><span><?= i18n('Prospects') ?></span></a></li>
|
||||
<li><a href="#campaign_tab_communications"><span><?= i18n('Communications') ?></span></a></li>
|
||||
</ul>
|
||||
<div id="campaign_tab_overview">
|
||||
overview tab
|
||||
</div>
|
||||
<div id="campaign_tab_donations">
|
||||
donations tab
|
||||
</div>
|
||||
<div id="campaign_tab_prospects">
|
||||
prospects tab
|
||||
</div>
|
||||
<div id="campaign_tab_communications">
|
||||
communications tab
|
||||
</div>
|
||||
</div>
|
||||
<div id="campaign_tab_donations">
|
||||
donations tab
|
||||
</div>
|
||||
<div id="campaign_tab_prospects">
|
||||
prospects tab
|
||||
</div>
|
||||
<div id="campaign_tab_communications">
|
||||
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";
|
||||
@ -337,71 +343,91 @@ case 'managelist':
|
||||
// echo "<input type=\"button\" value=\"".i18n("Finalize prospect list")."\">\n";
|
||||
echo "</td></tr></table>\n";
|
||||
} else {
|
||||
?>
|
||||
<h4><?= i18n('Choose Prospects') ?></h4>
|
||||
<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>
|
||||
</table>
|
||||
<div id="prospect_common" style="display: none;">
|
||||
<hr />
|
||||
<table>
|
||||
<tr><td style="width: 130px;"><?= i18n('Donation History') ?>:</td><td>
|
||||
<?
|
||||
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>
|
||||
<?
|
||||
$q = $pdo->prepare("SELECT * FROM fundraising_donor_levels WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY min");
|
||||
$q->execute();
|
||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||
echo "<label><input onchange=\"return prospect_search()\" disabled=\"disabled\" type=\"checkbox\" name=\"donationlevel[]\" value=\"$r->level\" >" . i18n($r->level) . ' (' . format_money($r->min, false) . ' - ' . format_money($r->max, false) . ")</label><br />\n";
|
||||
}
|
||||
echo '(disabled until the logic requirements can be established)';
|
||||
?>
|
||||
</td></tr>
|
||||
<tr><td><?= i18n('Email Address') ?>:</td><td>
|
||||
<?
|
||||
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>
|
||||
</table>
|
||||
</div>
|
||||
<h4><?= i18n('Choose Prospects') ?></h4>
|
||||
<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>
|
||||
</table>
|
||||
<div id="prospect_common" style="display: none;">
|
||||
<hr />
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 130px;"><?= i18n('Donation History') ?>:</td>
|
||||
<td>
|
||||
<?
|
||||
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>
|
||||
<?
|
||||
$q = $pdo->prepare("SELECT * FROM fundraising_donor_levels WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY min");
|
||||
$q->execute();
|
||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||
echo "<label><input onchange=\"return prospect_search()\" disabled=\"disabled\" type=\"checkbox\" name=\"donationlevel[]\" value=\"$r->level\" >" . i18n($r->level) . ' (' . format_money($r->min, false) . ' - ' . format_money($r->max, false) . ")</label><br />\n";
|
||||
}
|
||||
echo '(disabled until the logic requirements can be established)';
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= i18n('Email Address') ?>:</td>
|
||||
<td>
|
||||
<?
|
||||
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>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="prospect_individual" style="display: none;">
|
||||
<table>
|
||||
<tr><td style="width: 130px;"><?= i18n('Role') ?>:</td><td>
|
||||
<?
|
||||
foreach ($rolelist AS $k => $v) {
|
||||
echo "<label><input onchange=\"return prospect_search()\" type=\"checkbox\" name=\"individual_type[]\" value=\"$k\">" . i18n($v) . "</label><br />\n";
|
||||
}
|
||||
?>
|
||||
<div id="prospect_individual" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 130px;"><?= i18n('Role') ?>:</td>
|
||||
<td>
|
||||
<?
|
||||
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>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="prospect_organization" style="display: none;">
|
||||
<table>
|
||||
<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>
|
||||
|
||||
</div>
|
||||
<div id="prospect_organization" style="display: none;">
|
||||
<table>
|
||||
<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>
|
||||
|
||||
<hr />
|
||||
<div id="prospectsearchresults"></div>
|
||||
</form>
|
||||
<?
|
||||
</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,220 +573,236 @@ 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() {
|
||||
<?
|
||||
if (get_value_from_array($_GET, 'manage_campaign')) {
|
||||
echo 'managecampaign(' . intval(get_value_from_array($_GET, 'manage_campaign')) . ");\n";
|
||||
} else {
|
||||
echo "managecampaigns();\n";
|
||||
$(document).ready(function() {
|
||||
<?
|
||||
if (get_value_from_array($_GET, 'manage_campaign')) {
|
||||
echo 'managecampaign(' . intval(get_value_from_array($_GET, 'manage_campaign')) . ");\n";
|
||||
} else {
|
||||
echo "managecampaigns();\n";
|
||||
}
|
||||
?>
|
||||
});
|
||||
|
||||
function modifycampaigns() {
|
||||
$("#campaigndiv").show();
|
||||
$("#campaigndiv").load("<? $_SERVER['PHP_SELF'] ?>?action=modify", null, function() {
|
||||
modifycampaignsfinish();
|
||||
});
|
||||
}
|
||||
?>
|
||||
});
|
||||
|
||||
function modifycampaigns() {
|
||||
$("#campaigndiv").show();
|
||||
$("#campaigndiv").load("<? $_SERVER['PHP_SELF'] ?>?action=modify", null, function() {modifycampaignsfinish();});
|
||||
}
|
||||
function managecampaigns() {
|
||||
$("#campaigndiv").show();
|
||||
$("#campaigndiv").load("<? $_SERVER['PHP_SELF'] ?>?action=managelist", null, function() {
|
||||
managecampaignsfinish();
|
||||
});
|
||||
}
|
||||
|
||||
function managecampaigns() {
|
||||
$("#campaigndiv").show();
|
||||
$("#campaigndiv").load("<? $_SERVER['PHP_SELF'] ?>?action=managelist", null, function() {managecampaignsfinish();});
|
||||
}
|
||||
var currentcampaignid;
|
||||
|
||||
var currentcampaignid;
|
||||
|
||||
function managecampaign(id) {
|
||||
$("#campaigndiv").show();
|
||||
$("#campaigndiv").load("<? $_SERVER['PHP_SELF'] ?>?action=manage&id="+id, null, function() {managecampaignfinish();});
|
||||
currentcampaignid=id;
|
||||
}
|
||||
function managecampaign(id) {
|
||||
$("#campaigndiv").show();
|
||||
$("#campaigndiv").load("<? $_SERVER['PHP_SELF'] ?>?action=manage&id=" + id, null, function() {
|
||||
managecampaignfinish();
|
||||
});
|
||||
currentcampaignid = id;
|
||||
}
|
||||
|
||||
|
||||
function modifycampaignsfinish(){
|
||||
$("#campaignaccordion").accordion();
|
||||
// create the date pickers for our form
|
||||
$(".date").datepicker({
|
||||
dateFormat: 'yy-mm-dd'
|
||||
});
|
||||
}
|
||||
function modifycampaignsfinish() {
|
||||
$("#campaignaccordion").accordion();
|
||||
// create the date pickers for our form
|
||||
$(".date").datepicker({
|
||||
dateFormat: 'yy-mm-dd'
|
||||
});
|
||||
}
|
||||
|
||||
function managecampaignfinish() {
|
||||
$("#campaign_tabs").tabs({
|
||||
create: function(event, ui) {
|
||||
update_tab_overview();
|
||||
update_tab_donations();
|
||||
function managecampaignfinish() {
|
||||
$("#campaign_tabs").tabs({
|
||||
create: function(event, ui) {
|
||||
update_tab_overview();
|
||||
update_tab_donations();
|
||||
update_tab_prospects();
|
||||
update_tab_communications();
|
||||
},
|
||||
activate: function(event, ui) {
|
||||
update_tab_overview();
|
||||
update_tab_donations();
|
||||
update_tab_prospects();
|
||||
update_tab_communications();
|
||||
},
|
||||
|
||||
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) {
|
||||
//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();
|
||||
});
|
||||
} else {
|
||||
$("#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() {
|
||||
$("#campaign_tab_donations").load(
|
||||
"<? $_SERVER['PHP_SELF'] ?>?action=manage_tab_donations&id=" + currentcampaignid,
|
||||
null,
|
||||
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") {
|
||||
$("#prospect_common").show('slow');
|
||||
$("#prospect_organization").show('slow');
|
||||
$("#prospect_individual").hide('slow');
|
||||
} else if ($("input[@name='donortype']:checked").val() == "individual") {
|
||||
$("#prospect_common").show('slow');
|
||||
$("#prospect_organization").hide('slow');
|
||||
$("#prospect_individual").show('slow');
|
||||
} else {
|
||||
$("#prospect_common").hide('slow');
|
||||
}
|
||||
prospect_search();
|
||||
}
|
||||
|
||||
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() {
|
||||
update_tab_prospects();
|
||||
update_tab_communications();
|
||||
},
|
||||
activate: function( event, ui ) {
|
||||
update_tab_overview();
|
||||
update_tab_donations();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function prospect_removeselected() {
|
||||
$("#debug").load("fundraising_campaigns.php?action=prospect_removeselected", $("#prospectremoveform").serializeArray(), function() {
|
||||
update_tab_prospects();
|
||||
update_tab_communications();
|
||||
},
|
||||
|
||||
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) {
|
||||
//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(); });
|
||||
} else {
|
||||
$("#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() {
|
||||
$("#campaign_tab_donations").load(
|
||||
"<? $_SERVER['PHP_SELF'] ?>?action=manage_tab_donations&id="+currentcampaignid,
|
||||
null,
|
||||
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") {
|
||||
$("#prospect_common").show('slow');
|
||||
$("#prospect_organization").show('slow');
|
||||
$("#prospect_individual").hide('slow');
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else if($("input[@name='donortype']:checked").val()=="individual") {
|
||||
$("#prospect_common").show('slow');
|
||||
$("#prospect_organization").hide('slow');
|
||||
$("#prospect_individual").show('slow');
|
||||
|
||||
function prospect_removeall() {
|
||||
$("#debug").load("fundraising_campaigns.php?action=prospect_removeall", $("#prospectremoveform").serializeArray(), function() {
|
||||
update_tab_prospects();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
$("#prospect_common").hide('slow');
|
||||
|
||||
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() {});
|
||||
}
|
||||
prospect_search();
|
||||
}
|
||||
|
||||
function prospect_search() {
|
||||
$("#prospectsearchresults").load("fundraising_campaigns_prospecting.php",$("#prospectform").serializeArray());
|
||||
return false;
|
||||
}
|
||||
function removecommunication(id) {
|
||||
$("#debug").load("fundraising_campaigns.php?action=communication_remove", {
|
||||
id: id
|
||||
}, function() {
|
||||
update_tab_communications();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function prospect_generatelist() {
|
||||
$("#prospectsearchresults").load("fundraising_campaigns_prospecting.php?generatelist=true",$("#prospectform").serializeArray(), function() {
|
||||
update_tab_prospects();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
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() {});
|
||||
}
|
||||
|
||||
function prospect_removeselected() {
|
||||
$("#debug").load("fundraising_campaigns.php?action=prospect_removeselected",$("#prospectremoveform").serializeArray(),function() {
|
||||
update_tab_prospects();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
function comm_dialog_choose_cancel() {
|
||||
// alert('im cancelled');
|
||||
}
|
||||
|
||||
function prospect_removeall() {
|
||||
$("#debug").load("fundraising_campaigns.php?action=prospect_removeall",$("#prospectremoveform").serializeArray(),function() {
|
||||
update_tab_prospects();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
function comm_dialog_edit_save(id) {
|
||||
// alert("saved!");
|
||||
update_tab_communications();
|
||||
}
|
||||
|
||||
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() {
|
||||
});
|
||||
}
|
||||
function comm_dialog_edit_cancel() {
|
||||
// alert("cancelled!");
|
||||
}
|
||||
|
||||
function removecommunication(id) {
|
||||
$("#debug").load("fundraising_campaigns.php?action=communication_remove",{id:id},function() {
|
||||
update_tab_communications();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
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() {});
|
||||
}
|
||||
|
||||
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() {
|
||||
});
|
||||
}
|
||||
|
||||
function comm_dialog_choose_cancel() {
|
||||
// alert('im cancelled');
|
||||
}
|
||||
|
||||
function comm_dialog_edit_save(id) {
|
||||
// alert("saved!");
|
||||
update_tab_communications();
|
||||
}
|
||||
|
||||
function comm_dialog_edit_cancel() {
|
||||
// alert("cancelled!");
|
||||
}
|
||||
|
||||
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() {
|
||||
});
|
||||
}
|
||||
|
||||
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);
|
||||
return false;
|
||||
}
|
||||
|
||||
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() {
|
||||
});
|
||||
}
|
||||
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);
|
||||
return false;
|
||||
}
|
||||
|
||||
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() {});
|
||||
}
|
||||
</script>
|
||||
|
||||
<?
|
||||
@ -768,39 +812,45 @@ 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>
|
||||
?>
|
||||
<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>
|
||||
<select name="type">
|
||||
<option value=""><?= i18n('Choose') ?></option>
|
||||
<?
|
||||
foreach ($campaign_types AS $ct) {
|
||||
if ($r->type == $ct)
|
||||
$sel = 'selected="selected"';
|
||||
else
|
||||
$sel = '';
|
||||
echo "<option $sel value=\"$ct\">" . i18n($ct) . "</option>\n";
|
||||
}
|
||||
?>
|
||||
<option value=""><?= i18n('Choose') ?></option>
|
||||
<?
|
||||
foreach ($campaign_types as $ct) {
|
||||
if ($r->type == $ct)
|
||||
$sel = 'selected="selected"';
|
||||
else
|
||||
$sel = '';
|
||||
echo "<option $sel value=\"$ct\">" . i18n($ct) . "</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
if (get_value_property_or_default($r, 'startdate'))
|
||||
$sd = $r->startdate;
|
||||
else
|
||||
$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>
|
||||
</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>
|
||||
</tr>
|
||||
<?
|
||||
if (get_value_property_or_default($r, 'startdate'))
|
||||
$sd = $r->startdate;
|
||||
else
|
||||
$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>
|
||||
</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">
|
||||
<?
|
||||
$fgq = $pdo->prepare("SELECT * FROM fundraising_goals WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY name");
|
||||
$fgq->execute();
|
||||
@ -815,21 +865,25 @@ function display_campaign_form($r = null)
|
||||
}
|
||||
echo "</select>\n";
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
<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>
|
||||
|
||||
<?
|
||||
send_footer();
|
||||
?>
|
||||
?>
|
@ -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();
|
||||
}
|
||||
|
@ -9,5 +9,3 @@ function getGoal($goal)
|
||||
$q->execute();
|
||||
return $q->fetch(PDO::FETCH_OBJ);
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -64,5 +64,3 @@ if ($_POST['action'] == 'fundadd') {
|
||||
error_('MySQL Error: %1', array($pdo->errorInfo()));
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -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,98 +22,121 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
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',
|
||||
'Administration' => 'admin/index.php',
|
||||
'Fundraising' => 'admin/fundraising.php'),
|
||||
'fundraising');
|
||||
send_header(
|
||||
'Fundraising Reports',
|
||||
array(
|
||||
'Committee Main' => 'committee_main.php',
|
||||
'Administration' => 'admin/index.php',
|
||||
'Fundraising' => 'admin/fundraising.php'
|
||||
),
|
||||
'fundraising'
|
||||
);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready( function(){
|
||||
$("#standardreportsaccordion").accordion();
|
||||
|
||||
});
|
||||
$(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>
|
||||
Choose an appeal:
|
||||
</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)) {
|
||||
echo "<option value=\"$r->id\">$r->name</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
Report Type:
|
||||
</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;">
|
||||
<input type="submit" value="Generate Report">
|
||||
</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>
|
||||
Choose a Purpose:
|
||||
</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)) {
|
||||
echo "<option value=\"$r->goal\">$r->name</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
Report Type:
|
||||
</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;">
|
||||
<input type="submit" value="Generate Report">
|
||||
</td></tr></table>
|
||||
</form>
|
||||
</div>
|
||||
<h3><a a href="#">List of Prospects by Appeal</a></h3>
|
||||
<div>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Choose an appeal:
|
||||
</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)) {
|
||||
echo "<option value=\"$r->id\">$r->name</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Report Type:
|
||||
</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;">
|
||||
<input type="submit" value="Generate Report">
|
||||
</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>
|
||||
Choose a Purpose:
|
||||
</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)) {
|
||||
echo "<option value=\"$r->goal\">$r->name</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Report Type:
|
||||
</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;">
|
||||
<input type="submit" value="Generate Report">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<h3>Custom Reports</h3>
|
||||
<ul>
|
||||
<li><a href="#">(custom reports will be here)</a></li>
|
||||
<li><a href="#">(custom reports will be here)</a></li>
|
||||
</ul>
|
||||
<?
|
||||
send_footer();
|
||||
?>
|
||||
?>
|
@ -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);
|
||||
}
|
||||
|
@ -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,125 +335,141 @@ 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) {
|
||||
$("#editor_tabs").tabs({
|
||||
create: function(event, ui) {
|
||||
update_levels();
|
||||
update_goals();
|
||||
update_setup();
|
||||
},
|
||||
activate: function(event, ui) {
|
||||
update_levels();
|
||||
update_goals();
|
||||
update_setup();
|
||||
},
|
||||
selected: 1
|
||||
});
|
||||
|
||||
// $("#editor_tabs").tabs({
|
||||
// show: function(event, ui) {
|
||||
// switch(ui.panel.id) {
|
||||
// case 'editor_tab_levels':
|
||||
// update_levels();
|
||||
// break;
|
||||
// case 'editor_tab_goals':
|
||||
// update_goals();
|
||||
// break;
|
||||
// break;
|
||||
// case 'editor_tab_setup':
|
||||
// update_setup();
|
||||
// break;
|
||||
// break;
|
||||
// }
|
||||
// },
|
||||
// selected: 0
|
||||
// });
|
||||
|
||||
// $("#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() {
|
||||
$("#levelaccordion").accordion({
|
||||
heightStyle: "content"
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
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();
|
||||
update_goals();
|
||||
});
|
||||
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();
|
||||
});
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
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'
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
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();
|
||||
},
|
||||
activate: function( event, ui ) {
|
||||
update_levels();
|
||||
update_goals();
|
||||
update_setup();
|
||||
},
|
||||
selected: 1
|
||||
});
|
||||
|
||||
// $("#editor_tabs").tabs({
|
||||
// show: function(event, ui) {
|
||||
// switch(ui.panel.id) {
|
||||
// case 'editor_tab_levels':
|
||||
// update_levels();
|
||||
// break;
|
||||
// case 'editor_tab_goals':
|
||||
// update_goals();
|
||||
// break;
|
||||
// break;
|
||||
// case 'editor_tab_setup':
|
||||
// update_setup();
|
||||
// break;
|
||||
// break;
|
||||
// }
|
||||
// },
|
||||
// selected: 0
|
||||
// });
|
||||
|
||||
// $("#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() {
|
||||
$("#levelaccordion").accordion({
|
||||
heightStyle: "content"
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
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(); });
|
||||
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(); });
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
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'});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
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");
|
||||
});
|
||||
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;">
|
||||
@ -475,4 +491,4 @@ function charitychange() {
|
||||
|
||||
<?
|
||||
send_footer();
|
||||
?>
|
||||
?>
|
@ -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,18 +39,18 @@ if ($_GET['id']) {
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function typechange() {
|
||||
var t=($("[name=sponsortype]:checked").val());
|
||||
if(t=="organization") {
|
||||
$("#sponsor_type_organization").show();
|
||||
$("#sponsor_type_individual").hide();
|
||||
} else {
|
||||
$("#sponsor_type_organization").hide();
|
||||
$("#sponsor_type_individual").show();
|
||||
}
|
||||
function typechange() {
|
||||
var t = ($("[name=sponsortype]:checked").val());
|
||||
if (t == "organization") {
|
||||
$("#sponsor_type_organization").show();
|
||||
$("#sponsor_type_individual").hide();
|
||||
} else {
|
||||
$("#sponsor_type_organization").hide();
|
||||
$("#sponsor_type_individual").show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</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
|
||||
@ -167,4 +167,4 @@ echo "</td></tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "</form>\n";
|
||||
|
||||
?>
|
||||
?>
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -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');
|
||||
|
||||
|
@ -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'])) . "'");
|
||||
|
154
admin/index.php
154
admin/index.php
@ -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",
|
||||
array('Committee Main' => 'committee_main.php'),
|
||||
"administration");
|
||||
send_header(
|
||||
"Administration",
|
||||
array('Committee Main' => 'committee_main.php'),
|
||||
"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 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 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 theme_icon("registration_fee_items_management")."<br />".i18n("Registration Fee Items Management")."<br /><i>(".i18n("disabled").")</i>";}
|
||||
echo "</td>";
|
||||
echo " </tr>\n";
|
||||
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 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 theme_icon("registration_fee_items_management")."<br />".i18n("Registration Fee Items Management")."<br /><i>(".i18n("disabled").")</i>";}
|
||||
echo "</td>";
|
||||
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 "</td>";
|
||||
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></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 "</td>";
|
||||
echo " </tr>\n";
|
||||
|
||||
send_footer();
|
||||
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();
|
||||
?>
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -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>';
|
||||
|
@ -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,52 +54,52 @@ if ($id < 1) {
|
||||
}
|
||||
|
||||
?>
|
||||
<table class="tableview" style="margin:auto; width:100%; text-align:left">
|
||||
<tr>
|
||||
<th><?= i18n('First Name'); ?></th>
|
||||
<th><?= i18n('Last Name'); ?></th>
|
||||
<th><?= i18n('Organization'); ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $judgeinfo['firstname']; ?></td>
|
||||
<td><?= $judgeinfo['lastname']; ?></td>
|
||||
<td><?= $judgeinfo['organization']; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="tableview" style="margin:auto; width:100%; text-align:left">
|
||||
<tr>
|
||||
<th><?= i18n('First Name'); ?></th>
|
||||
<th><?= i18n('Last Name'); ?></th>
|
||||
<th><?= i18n('Organization'); ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $judgeinfo['firstname']; ?></td>
|
||||
<td><?= $judgeinfo['lastname']; ?></td>
|
||||
<td><?= $judgeinfo['organization']; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="tableview" style="margin:auto; width:100%; margin-top: 5px; text-align:left">
|
||||
|
||||
<tr>
|
||||
<th><?= i18n('Email Address'); ?>:</th>
|
||||
<td><?= $judgeinfo['email']; ?></td>
|
||||
<th><?= i18n('City'); ?>:</th>
|
||||
<td><?= $judgeinfo['city']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= i18n('Phone (Home)'); ?>:</th>
|
||||
<td><?= $judgeinfo['phonehome']; ?></td>
|
||||
<th><?= i18n('Address 1'); ?>:</th>
|
||||
<td><?= $judgeinfo['address']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= i18n('Phone (Work)'); ?>:</th>
|
||||
<td><?= $judgeinfo['phonework']; ?></td>
|
||||
<th><?= i18n('Address 2'); ?>:</th>
|
||||
<td><?= $judgeinfo['address2']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= i18n('Phone (Cell)'); ?>:</th>
|
||||
<td><?= $judgeinfo['phonecell']; ?></td>
|
||||
<th><?= i18n($config['provincestate']); ?>:</th>
|
||||
<td><?= $judgeinfo['province']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= i18n('Languages'); ?>:</th>
|
||||
<td><?= join(', ', $judgeinfo['languages']); ?></td>
|
||||
<th><?= i18n($config['postalzip']); ?>:</th>
|
||||
<td><?= $judgeinfo['postalcode']; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="tableview" style="margin:auto; width:100%; margin-top: 5px; text-align:left">
|
||||
|
||||
<tr>
|
||||
<th><?= i18n('Email Address'); ?>:</th>
|
||||
<td><?= $judgeinfo['email']; ?></td>
|
||||
<th><?= i18n('City'); ?>:</th>
|
||||
<td><?= $judgeinfo['city']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= i18n('Phone (Home)'); ?>:</th>
|
||||
<td><?= $judgeinfo['phonehome']; ?></td>
|
||||
<th><?= i18n('Address 1'); ?>:</th>
|
||||
<td><?= $judgeinfo['address']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= i18n('Phone (Work)'); ?>:</th>
|
||||
<td><?= $judgeinfo['phonework']; ?></td>
|
||||
<th><?= i18n('Address 2'); ?>:</th>
|
||||
<td><?= $judgeinfo['address2']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= i18n('Phone (Cell)'); ?>:</th>
|
||||
<td><?= $judgeinfo['phonecell']; ?></td>
|
||||
<th><?= i18n($config['provincestate']); ?>:</th>
|
||||
<td><?= $judgeinfo['province']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= i18n('Languages'); ?>:</th>
|
||||
<td><?= join(', ', $judgeinfo['languages']); ?></td>
|
||||
<th><?= i18n($config['postalzip']); ?>:</th>
|
||||
<td><?= $judgeinfo['postalcode']; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
@ -155,81 +156,83 @@ $catPreferenceText .= '</ul>';
|
||||
|
||||
?>
|
||||
|
||||
<table class="tableview" style="margin:auto; width:100%; text-align:left; margin-top:5px;">
|
||||
<tr><td>
|
||||
<ul>
|
||||
<table class="tableview" style="margin:auto; width:100%; text-align:left; margin-top:5px;">
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
|
||||
<li><strong><?= "Active for {$config['FAIRYEAR']}"; ?>: </strong>
|
||||
<?= $activeText; ?></li>
|
||||
<li><strong><?= "Active for {$config['FAIRYEAR']}"; ?>: </strong>
|
||||
<?= $activeText; ?></li>
|
||||
|
||||
<li><strong><?= "Complete for {$config['FAIRYEAR']}"; ?>: </strong>
|
||||
<?= $completeText; ?></li>
|
||||
<li><strong><?= "Complete for {$config['FAIRYEAR']}"; ?>: </strong>
|
||||
<?= $completeText; ?></li>
|
||||
|
||||
<li><strong><?= i18n('Special awards'); ?>: </strong>
|
||||
<?= $specialAwardsText; ?></li>
|
||||
<li><strong><?= i18n('Special awards'); ?>: </strong>
|
||||
<?= $specialAwardsText; ?></li>
|
||||
|
||||
<li><strong><?= i18n('Highest post-secondary degree'); ?>: </strong>
|
||||
<?= $judgeinfo['highest_psd']; ?></li>
|
||||
<li><strong><?= i18n('Highest post-secondary degree'); ?>: </strong>
|
||||
<?= $judgeinfo['highest_psd']; ?></li>
|
||||
|
||||
<li><strong><?= i18n('Age category preference'); ?>: </strong>
|
||||
<?= $catPreferenceText; ?></li>
|
||||
<li><strong><?= i18n('Age category preference'); ?>: </strong>
|
||||
<?= $catPreferenceText; ?></li>
|
||||
|
||||
<?php
|
||||
if ($availabilityText != '') {
|
||||
echo '<li><strong>' . i18n('Time Availability') . ': </strong>';
|
||||
echo $availabilityText . '</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<h3><?= i18n('Areas of Expertise'); ?></h3>
|
||||
<table class="tableview" style="margin:auto;width:100%">
|
||||
<?php
|
||||
<?php
|
||||
if ($availabilityText != '') {
|
||||
echo '<li><strong>' . i18n('Time Availability') . ': </strong>';
|
||||
echo $availabilityText . '</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<h3><?= i18n('Areas of Expertise'); ?></h3>
|
||||
<table class="tableview" style="margin:auto;width:100%">
|
||||
<?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)) {
|
||||
$divs[] = $r->id;
|
||||
$divnames[$r->id] = $r->division;
|
||||
}
|
||||
// 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) {
|
||||
$p = $judgeinfo['div_prefs'][$div];
|
||||
echo '<tr><th align="right" >' . i18n($divnames[$div]) . ':</th>';
|
||||
echo " <td>$p/5</td>";
|
||||
foreach ($divs as $div) {
|
||||
$p = $judgeinfo['div_prefs'][$div];
|
||||
echo '<tr><th align="right" >' . i18n($divnames[$div]) . ':</th>';
|
||||
echo " <td>$p/5</td>";
|
||||
|
||||
echo '<td>';
|
||||
$subq = $pdo->prepare("SELECT * FROM projectsubdivisions WHERE
|
||||
echo '<td>';
|
||||
$subq = $pdo->prepare("SELECT * FROM projectsubdivisions WHERE
|
||||
projectdivisions_id='$div' AND year='{$config['FAIRYEAR']}' ORDER BY subdivision");
|
||||
$subq->execute();
|
||||
$sd = array();
|
||||
while ($subr = $subq->fetch(PDO::FETCH_OBJ)) {
|
||||
if ($u['div_prefs_sub'][$subr->id] == 1) {
|
||||
$sd[] = $subdivr->subdivision;
|
||||
}
|
||||
}
|
||||
$subq->execute();
|
||||
$sd = array();
|
||||
while ($subr = $subq->fetch(PDO::FETCH_OBJ)) {
|
||||
if ($u['div_prefs_sub'][$subr->id] == 1) {
|
||||
$sd[] = $subdivr->subdivision;
|
||||
}
|
||||
}
|
||||
|
||||
// Only show subdiv if main div >=3
|
||||
if ($p >= 3)
|
||||
echo implode(', ', $sd);
|
||||
else
|
||||
echo ' ';
|
||||
// Only show subdiv if main div >=3
|
||||
if ($p >= 3)
|
||||
echo implode(', ', $sd);
|
||||
else
|
||||
echo ' ';
|
||||
|
||||
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>
|
||||
</table>
|
||||
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>
|
||||
</table>
|
||||
<?php
|
||||
|
||||
// get the judge's special award info
|
||||
@ -255,4 +258,4 @@ echo '</div></div>';
|
||||
*/
|
||||
|
||||
// send_popup_footer();
|
||||
?>
|
||||
?>
|
@ -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=?");
|
||||
|
@ -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;
|
||||
document.forms.jdivs.submit();
|
||||
}
|
||||
|
||||
function newbuttonclicked(jdivs)
|
||||
{
|
||||
document.forms.jdivs.action.value="new";
|
||||
document.forms.jdivs.jdivs.value=jdivs;
|
||||
document.forms.jdivs.submit();
|
||||
}
|
||||
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;
|
||||
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();
|
||||
@ -341,4 +343,4 @@ echo '<br />';
|
||||
|
||||
send_footer();
|
||||
|
||||
?>
|
||||
?>
|
@ -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'] &&
|
||||
$a['end'] >= $r['endtime'] &&
|
||||
$a['date'] == $r['date']) {
|
||||
if (
|
||||
$a['start'] <= $r['starttime'] &&
|
||||
$a['end'] >= $r['endtime'] &&
|
||||
$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);
|
||||
|
||||
|
@ -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;
|
||||
?>
|
||||
|
@ -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;
|
||||
?>
|
||||
|
||||
|
@ -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() {
|
||||
updateStatus();
|
||||
});
|
||||
$(document).ready(function() {
|
||||
updateStatus();
|
||||
});
|
||||
|
||||
function updateStatus() {
|
||||
var url="judges_scheduler_status_output.php";
|
||||
$("#updatestatus").html("Updating...");
|
||||
$.get(url,null,function(data) {
|
||||
var obj=data.split(":");
|
||||
function updateStatus() {
|
||||
var url = "judges_scheduler_status_output.php";
|
||||
$("#updatestatus").html("Updating...");
|
||||
$.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() {
|
||||
$("#updatestatus").html("Waiting...");
|
||||
}
|
||||
|
||||
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+' ';
|
||||
});
|
||||
}
|
||||
if(s>3600) {
|
||||
var hours=Math.floor(s/3600)
|
||||
s-=hours*3600;
|
||||
if(hours>1) pl='s'; else pl='';
|
||||
output+=hours+' hour'+pl+' ';
|
||||
|
||||
function clearUpdatingMessage() {
|
||||
$("#updatestatus").html("Waiting...");
|
||||
}
|
||||
if(s>60) {
|
||||
var minutes=Math.floor(s/60)
|
||||
s-=minutes*60;
|
||||
if(minutes>1) pl='s'; else pl='';
|
||||
output+=minutes+' minute'+pl+' ';
|
||||
|
||||
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 + ' ';
|
||||
}
|
||||
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 > 1) pl = 's';
|
||||
else pl = '';
|
||||
output += s + ' second' + pl
|
||||
|
||||
return output;
|
||||
}
|
||||
if(s>1) pl='s'; else pl='';
|
||||
output+=s+' second'+pl
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<?
|
||||
@ -152,4 +157,4 @@ if ($config['judge_scheduler_percent'] == '-1') {
|
||||
}
|
||||
send_footer();
|
||||
|
||||
?>
|
||||
?>
|
@ -13,4 +13,3 @@ $r = $q->fetch(PDO::FETCH_OBJ);
|
||||
$status = $r->val;
|
||||
|
||||
echo "$percent:$status\n";
|
||||
?>
|
||||
|
@ -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'));
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -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";
|
||||
document.forms.judges.submit();
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
function addclicked() {
|
||||
document.forms.judges.action.value = "assign";
|
||||
document.forms.judges.submit();
|
||||
}
|
||||
</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 {
|
||||
@ -449,4 +455,4 @@ function addclicked()
|
||||
}
|
||||
send_footer();
|
||||
|
||||
?>
|
||||
?>
|
@ -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,86 +24,89 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
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;
|
||||
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 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;
|
||||
|
||||
var mousex = 0, mousey = 0;
|
||||
var selectedMemberId;
|
||||
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 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 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");
|
||||
}
|
||||
var mousex = 0,
|
||||
mousey = 0;
|
||||
var selectedMemberId;
|
||||
|
||||
function hideMemberDetails(){
|
||||
$('#infodiv').css("display", "none");
|
||||
$('#infodivcover').css("display", "none");
|
||||
}
|
||||
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 doShowMemberDetails(judgeId){
|
||||
selectedMemberId = judgeId;
|
||||
$('#infodiv').css("top", mousey + 5);
|
||||
$('#infodiv').css("left", mousex + 20);
|
||||
$('#infodiv').css("display", "inline");
|
||||
$('#infodivcover').css("top", mousey + 5);
|
||||
$('#infodivcover').css("left", mousex + 20);
|
||||
$('#infodivcover').css("display", "inline");
|
||||
$('#infodivcover').css("width", $('#infodiv').width());
|
||||
$('#infodivcover').css("height", $('#infodiv').height());
|
||||
}
|
||||
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");
|
||||
}
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
$('#infodivcover').click(function(){ editMember(); });
|
||||
$(document).mousemove(function(e){
|
||||
mousex = e.pageX;
|
||||
mousey = e.pageY;
|
||||
});
|
||||
});
|
||||
function hideMemberDetails() {
|
||||
$('#infodiv').css("display", "none");
|
||||
$('#infodivcover').css("display", "none");
|
||||
}
|
||||
|
||||
function doShowMemberDetails(judgeId) {
|
||||
selectedMemberId = judgeId;
|
||||
$('#infodiv').css("top", mousey + 5);
|
||||
$('#infodiv').css("left", mousex + 20);
|
||||
$('#infodiv').css("display", "inline");
|
||||
$('#infodivcover').css("top", mousey + 5);
|
||||
$('#infodivcover').css("left", mousex + 20);
|
||||
$('#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) {
|
||||
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;
|
||||
@ -474,4 +478,4 @@ echo '<div id="infodivcover" style="'
|
||||
|
||||
send_footer();
|
||||
|
||||
?>
|
||||
?>
|
@ -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;
|
||||
document.forms.teamsprojects.submit();
|
||||
}
|
||||
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 = ' ';
|
||||
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 = ' ';
|
||||
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 ' ';
|
||||
$err = false;
|
||||
foreach ($team['languages_projects'] AS $projectlang) {
|
||||
foreach ($team['languages_projects'] as $projectlang) {
|
||||
if (!in_array($projectlang, $member['languages_array'])) {
|
||||
$err = true;
|
||||
break;
|
||||
@ -423,4 +423,4 @@ if (($action == 'edit' || $action == 'assign') && $edit) {
|
||||
}
|
||||
|
||||
send_footer();
|
||||
?>
|
||||
?>
|
@ -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;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
function checkinvert(what)
|
||||
{
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
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 ' ';
|
||||
if ($member['captain'] == 'yes')
|
||||
echo '<i>';
|
||||
@ -248,4 +254,4 @@ echo '<input type="submit" value="' . i18n('Assign selected timeslots to selecte
|
||||
echo '</form>';
|
||||
|
||||
send_footer();
|
||||
?>
|
||||
?>
|
@ -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 />';
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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'
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
||||
<?
|
||||
|
@ -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";
|
||||
else
|
||||
wordcountmessageobj.className="complete";
|
||||
|
||||
wordcountobj.innerHTML=wordcount;
|
||||
}
|
||||
</script>
|
||||
<?
|
||||
if (wordcount > wordmax)
|
||||
wordcountmessageobj.className = "incomplete";
|
||||
else
|
||||
wordcountmessageobj.className = "complete";
|
||||
|
||||
wordcountobj.innerHTML = wordcount;
|
||||
}
|
||||
</script>
|
||||
<?
|
||||
|
||||
if (!$projectinfo) {
|
||||
echo error(i18n('Invalid project to edit'));
|
||||
@ -271,217 +270,221 @@ function countwords()
|
||||
|
||||
?>
|
||||
<form id="project_form">
|
||||
<input type="hidden" name="id" value="<?= $projectinfo->id ?>">
|
||||
<table>
|
||||
<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>
|
||||
<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>
|
||||
<td><?= i18n('Project Sort') ?>: </td>
|
||||
<td><input type="text" name="projectsort" size="10" value="<?= $projectinfo->projectsort ?>" /></td></tr>
|
||||
<input type="hidden" name="id" value="<?= $projectinfo->id ?>">
|
||||
<table>
|
||||
<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>
|
||||
<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>
|
||||
<td><?= i18n('Project Sort') ?>: </td>
|
||||
<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();
|
||||
echo '<tr><td>' . i18n('Project Type') . ': </td><td>';
|
||||
echo "<select name=\"projecttype\">\n";
|
||||
echo '<option value="">' . i18n('Select a project type') . "</option>\n";
|
||||
// FIXME: need to fix the loading glitch
|
||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||
if ($r->type == $projectinfo->projecttype) {
|
||||
$sel = 'selected="selected"';
|
||||
} else {
|
||||
$sel = '';
|
||||
<?
|
||||
if ($config['project_type'] == 'yes') {
|
||||
$q = $pdo->prepare('SELECT * FROM projecttypes ORDER BY type');
|
||||
$q->execute();
|
||||
echo '<tr><td>' . i18n('Project Type') . ': </td><td>';
|
||||
echo "<select name=\"projecttype\">\n";
|
||||
echo '<option value="">' . i18n('Select a project type') . "</option>\n";
|
||||
// FIXME: need to fix the loading glitch
|
||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||
if ($r->type == $projectinfo->projecttype) {
|
||||
$sel = 'selected="selected"';
|
||||
} else {
|
||||
$sel = '';
|
||||
}
|
||||
echo "<option $sel value=\"$r->type\">" . htmlspecialchars(i18n($r->type), null, 'ISO8859-1') . "</option>\n";
|
||||
}
|
||||
echo '</select>' . REQUIREDFIELD . '</td></tr>';
|
||||
}
|
||||
echo "<option $sel value=\"$r->type\">" . htmlspecialchars(i18n($r->type), null, 'ISO8859-1') . "</option>\n";
|
||||
}
|
||||
echo '</select>' . REQUIREDFIELD . '</td></tr>';
|
||||
}
|
||||
?>
|
||||
<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>
|
||||
<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");
|
||||
$q->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
// ###
|
||||
} else {
|
||||
$q = $pdo->prepare("SELECT * FROM projectdivisions WHERE year='" . $config['FAIRYEAR'] . "' ORDER BY division");
|
||||
$q->execute();
|
||||
}
|
||||
?>
|
||||
<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>
|
||||
<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");
|
||||
$q->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
// ###
|
||||
} else {
|
||||
$q = $pdo->prepare("SELECT * FROM projectdivisions WHERE year='" . $config['FAIRYEAR'] . "' ORDER BY division");
|
||||
$q->execute();
|
||||
}
|
||||
|
||||
echo '<select name="projectdivisions_id">';
|
||||
echo '<option value="">' . i18n('Select a division') . "</option>\n";
|
||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||
if ($r->id == $projectinfo->projectdivisions_id)
|
||||
$sel = 'selected="selected"';
|
||||
else
|
||||
$sel = '';
|
||||
echo "<option $sel value=\"$r->id\">" . htmlspecialchars(i18n($r->division), null, 'ISO8859-1') . "</option>\n";
|
||||
}
|
||||
echo '</select>' . REQUIREDFIELD;
|
||||
echo '<select name="projectdivisions_id">';
|
||||
echo '<option value="">' . i18n('Select a division') . "</option>\n";
|
||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||
if ($r->id == $projectinfo->projectdivisions_id)
|
||||
$sel = 'selected="selected"';
|
||||
else
|
||||
$sel = '';
|
||||
echo "<option $sel value=\"$r->id\">" . htmlspecialchars(i18n($r->division), null, 'ISO8859-1') . "</option>\n";
|
||||
}
|
||||
echo '</select>' . REQUIREDFIELD;
|
||||
|
||||
if ($config['usedivisionselector'] == 'yes') {
|
||||
?>
|
||||
<script language="javascript" type="text/javascript">
|
||||
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;
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<?
|
||||
}
|
||||
|
||||
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>
|
||||
<?
|
||||
}
|
||||
echo '<br />';
|
||||
echo i18n('WARNING! If you change the division you must manually change the project number too! It will NOT be assigned a new number automatically');
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<br />';
|
||||
echo i18n('WARNING! If you change the division you must manually change the project number too! It will NOT be assigned a new number automatically');
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td>' . i18n('Language') . ': </td><td>';
|
||||
echo "<select name=\"language\">\n";
|
||||
|
||||
echo '<tr><td>' . i18n('Language') . ': </td><td>';
|
||||
echo "<select name=\"language\">\n";
|
||||
if ($projectinfo->language)
|
||||
$currentlang = $projectinfo->language;
|
||||
else
|
||||
$currentlang = $_SESSION['lang'];
|
||||
|
||||
if ($projectinfo->language)
|
||||
$currentlang = $projectinfo->language;
|
||||
else
|
||||
$currentlang = $_SESSION['lang'];
|
||||
foreach ($config['languages'] as $key => $val) {
|
||||
if ($currentlang == $key)
|
||||
$selected = 'selected="selected"';
|
||||
else
|
||||
$selected = '';
|
||||
|
||||
foreach ($config['languages'] AS $key => $val) {
|
||||
if ($currentlang == $key)
|
||||
$selected = 'selected="selected"';
|
||||
else
|
||||
$selected = '';
|
||||
echo "<option $selected value=\"$key\">$val</option>";
|
||||
}
|
||||
echo '</select>' . REQUIREDFIELD;
|
||||
echo '</td></tr>';
|
||||
|
||||
echo "<option $selected value=\"$key\">$val</option>";
|
||||
}
|
||||
echo '</select>' . REQUIREDFIELD;
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td>' . i18n('Requirements') . ': </td><td>';
|
||||
echo '<table>';
|
||||
|
||||
echo '<tr><td>' . i18n('Requirements') . ': </td><td>';
|
||||
echo '<table>';
|
||||
if ($config['participant_project_table'] == 'no') {
|
||||
// if we arent asking them if they want a table or not, then we set it to 'yes' assuming everyone will get a table
|
||||
echo ' <input type="hidden" name="req_table" value="yes" />';
|
||||
} else {
|
||||
echo '<tr>';
|
||||
echo ' <td>' . i18n('Table') . REQUIREDFIELD . '</td>';
|
||||
if ($projectinfo->req_table == 'yes')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"req_table\" value=\"yes\" />Yes</td>";
|
||||
echo ' <td width="20"> </td>';
|
||||
if ($projectinfo->req_table == 'no')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"req_table\" value=\"no\" />No</td>";
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
if ($config['participant_project_table'] == 'no') {
|
||||
// if we arent asking them if they want a table or not, then we set it to 'yes' assuming everyone will get a table
|
||||
echo ' <input type="hidden" name="req_table" value="yes" />';
|
||||
} else {
|
||||
echo '<tr>';
|
||||
echo ' <td>' . i18n('Table') . REQUIREDFIELD . '</td>';
|
||||
if ($projectinfo->req_table == 'yes')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"req_table\" value=\"yes\" />Yes</td>";
|
||||
echo ' <td width="20"> </td>';
|
||||
if ($projectinfo->req_table == 'no')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"req_table\" value=\"no\" />No</td>";
|
||||
echo '</tr>';
|
||||
}
|
||||
if ($config['participant_project_electricity'] == 'no') {
|
||||
// if we arent asking them if they want electricity or not, then we set it to 'yes' assuming everyone will get electricity
|
||||
echo ' <input type="hidden" name="req_electricity" value="yes" />';
|
||||
} else {
|
||||
echo '<tr>';
|
||||
echo ' <td>' . i18n('Electricity') . REQUIREDFIELD . '</td>';
|
||||
if ($projectinfo->req_electricity == 'yes')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"req_electricity\" value=\"yes\" />Yes</td>";
|
||||
echo ' <td width="20"> </td>';
|
||||
if ($projectinfo->req_electricity == 'no')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"req_electricity\" value=\"no\" />No</td>";
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
if ($config['participant_project_electricity'] == 'no') {
|
||||
// if we arent asking them if they want electricity or not, then we set it to 'yes' assuming everyone will get electricity
|
||||
echo ' <input type="hidden" name="req_electricity" value="yes" />';
|
||||
} else {
|
||||
echo '<tr>';
|
||||
echo ' <td>' . i18n('Electricity') . REQUIREDFIELD . '</td>';
|
||||
if ($projectinfo->req_electricity == 'yes')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"req_electricity\" value=\"yes\" />Yes</td>";
|
||||
echo ' <td width="20"> </td>';
|
||||
if ($projectinfo->req_electricity == 'no')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"req_electricity\" value=\"no\" />No</td>";
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '<tr>';
|
||||
echo ' <td>' . i18n('Special') . '</td>';
|
||||
echo " <td colspan=\"3\"><input type=\"text\" name=\"req_special\" value=\"$projectinfo->req_special\" /></td>";
|
||||
echo '</tr>';
|
||||
|
||||
echo '<tr>';
|
||||
echo ' <td>' . i18n('Special') . '</td>';
|
||||
echo " <td colspan=\"3\"><input type=\"text\" name=\"req_special\" value=\"$projectinfo->req_special\" /></td>";
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
|
||||
echo '</table>';
|
||||
if ($config['ethics_questions'] == 'yes')
|
||||
// If we have set ethics questions to yes then ask the ethics questions!
|
||||
{
|
||||
echo '<tr><td>' . i18n('Ethics Questions') . ':</td><td>';
|
||||
echo '<table>';
|
||||
echo '<tr>';
|
||||
echo ' <td>' . i18n('My project involves human participants') . REQUIREDFIELD . '</td>';
|
||||
if ($projectinfo->human_participants == 'yes')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"human_participants\" value=\"yes\" />Yes</td>";
|
||||
echo ' <td width="20"> </td>';
|
||||
if ($projectinfo->human_participants == 'no')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"human_participants\" value=\"no\" />No</td>";
|
||||
echo '</tr>';
|
||||
|
||||
if ($config['ethics_questions'] == 'yes')
|
||||
// If we have set ethics questions to yes then ask the ethics questions!
|
||||
{
|
||||
echo '<tr><td>' . i18n('Ethics Questions') . ':</td><td>';
|
||||
echo '<table>';
|
||||
echo '<tr>';
|
||||
echo ' <td>' . i18n('My project involves human participants') . REQUIREDFIELD . '</td>';
|
||||
if ($projectinfo->human_participants == 'yes')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"human_participants\" value=\"yes\" />Yes</td>";
|
||||
echo ' <td width="20"> </td>';
|
||||
if ($projectinfo->human_participants == 'no')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"human_participants\" value=\"no\" />No</td>";
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo ' <td>' . i18n('My project involves animals') . REQUIREDFIELD . '</td>';
|
||||
if ($projectinfo->animal_participants == 'yes')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"animal_participants\" value=\"yes\" />Yes</td>";
|
||||
echo ' <td width="20"> </td>';
|
||||
if ($projectinfo->animal_participants == 'no')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"animal_participants\" value=\"no\" />No</td>";
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
}
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr>';
|
||||
echo ' <td>' . i18n('My project involves animals') . REQUIREDFIELD . '</td>';
|
||||
if ($projectinfo->animal_participants == 'yes')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"animal_participants\" value=\"yes\" />Yes</td>";
|
||||
echo ' <td width="20"> </td>';
|
||||
if ($projectinfo->animal_participants == 'no')
|
||||
$check = 'checked="checked"';
|
||||
else
|
||||
$check = '';
|
||||
echo " <td><input $check type=\"radio\" name=\"animal_participants\" value=\"no\" />No</td>";
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
}
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td>' . i18n('Summary') . ': </td><td><textarea onchange=\'countwords()\' onkeypress=\'countwords()\' cols="60" rows="12" id="summary" name="summary">' . htmlspecialchars($projectinfo->summary, ENT_NOQUOTES, 'ISO8859-1') . '</textarea>' . REQUIREDFIELD . '<br />';
|
||||
|
||||
echo '<tr><td>' . i18n('Summary') . ': </td><td><textarea onchange=\'countwords()\' onkeypress=\'countwords()\' cols="60" rows="12" id="summary" name="summary">' . htmlspecialchars($projectinfo->summary, ENT_NOQUOTES, 'ISO8859-1') . '</textarea>' . REQUIREDFIELD . '<br />';
|
||||
$summarywords = preg_split('/[\s,]+/', $projectinfo->summary);
|
||||
$summarywordcount = count($summarywords);
|
||||
if ($summarywordcount > $config['participant_project_summary_wordmax'])
|
||||
echo '<div id="wordcountmessage" class="incomplete">';
|
||||
else
|
||||
echo '<div id="wordcountmessage" class="complete">';
|
||||
|
||||
$summarywords = preg_split('/[\s,]+/', $projectinfo->summary);
|
||||
$summarywordcount = count($summarywords);
|
||||
if ($summarywordcount > $config['participant_project_summary_wordmax'])
|
||||
echo '<div id="wordcountmessage" class="incomplete">';
|
||||
else
|
||||
echo '<div id="wordcountmessage" class="complete">';
|
||||
echo "<span id=\"wordcount\">$summarywordcount</span>/";
|
||||
echo i18n('%1 words maximum', array($config['participant_project_summary_wordmax']));
|
||||
echo '</div>';
|
||||
|
||||
echo "<span id=\"wordcount\">$summarywordcount</span>/";
|
||||
echo i18n('%1 words maximum', array($config['participant_project_summary_wordmax']));
|
||||
echo '</div>';
|
||||
echo '<tr><td>' . i18n('Feedback') . ': </td><td><textarea cols="60" rows="4" id="feedback" name="feedback">' . htmlspecialchars($projectinfo->feedback, null, 'ISO8859-1') . '</textarea><br />';
|
||||
|
||||
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>
|
||||
</table>
|
||||
<input type="button" id="project_save" value="<?= i18n('Save Project Information') ?>" />
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="button" id="project_save" value="<?= i18n('Save Project Information') ?>" />
|
||||
</form>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
?>
|
@ -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']);
|
||||
|
||||
|
@ -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 />';
|
||||
|
@ -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,21 +95,27 @@ 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')
|
||||
);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<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,263 +130,266 @@ 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) {
|
||||
var w = (document.documentElement.clientWidth * 0.9);
|
||||
var h = (document.documentElement.clientHeight * 0.9);
|
||||
|
||||
function popup_editor(id, open_tab)
|
||||
{
|
||||
var w = (document.documentElement.clientWidth * 0.9);
|
||||
var h = (document.documentElement.clientHeight * 0.9);
|
||||
registrations_id = id;
|
||||
|
||||
registrations_id = id;
|
||||
|
||||
registrations_new = 0;
|
||||
registrations_new = 0;
|
||||
|
||||
if(id == -1) {
|
||||
open_tab = 'reg';
|
||||
registrations_new = 1;
|
||||
if (id == -1) {
|
||||
open_tab = 'reg';
|
||||
registrations_new = 1;
|
||||
}
|
||||
|
||||
/* Force no tabs to be selected, need to set collapsible
|
||||
* to true first */
|
||||
$('#editor_tabs').tabs('option', 'collapsible', true);
|
||||
$('#editor_tabs').tabs('option', 'active', -1);
|
||||
|
||||
|
||||
/* Then we'll select a tab to force a reload */
|
||||
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', 'active', 0);
|
||||
break;
|
||||
|
||||
case 'project':
|
||||
$('#editor_tabs').tabs('option', 'disabled', []);
|
||||
$('#editor_tabs').tabs('option', 'active', 2);
|
||||
break;
|
||||
default:
|
||||
$('#editor_tabs').tabs('option', 'disabled', []);
|
||||
$('#editor_tabs').tabs('option', 'active', 1);
|
||||
break;
|
||||
}
|
||||
/* Don't let anything collapse */
|
||||
$('#editor_tabs').tabs('option', 'collapsible', false);
|
||||
|
||||
/* Show the dialog */
|
||||
$('#student_editor').dialog('option', 'width', w);
|
||||
$('#student_editor').dialog('option', 'height', h);
|
||||
$("#student_editor").dialog('open');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Force no tabs to be selected, need to set collapsible
|
||||
* to true first */
|
||||
$('#editor_tabs').tabs('option', 'collapsible', true);
|
||||
$('#editor_tabs').tabs('option', 'active', -1);
|
||||
function update_students(numstudents) {
|
||||
var id = registrations_id;
|
||||
|
||||
var req = "action=students_load&id=" + id;
|
||||
if (numstudents != 0 && numstudents != undefined) req = req + "&numstudents=" + numstudents;
|
||||
|
||||
/* Then we'll select a tab to force a reload */
|
||||
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', 'active', 0);
|
||||
break;
|
||||
$("#editor_tab_students").load("student_editor.php?" + req, '',
|
||||
function(responseText, textStatus, XMLHttpRequest) {
|
||||
/* Attach to events we care about */
|
||||
$("#students_num").change(function() {
|
||||
var num = $("#students_num").val();
|
||||
update_students(num);
|
||||
});
|
||||
|
||||
case 'project':
|
||||
$('#editor_tabs').tabs('option', 'disabled', []);
|
||||
$('#editor_tabs').tabs('option', 'active', 2);
|
||||
break;
|
||||
default:
|
||||
$('#editor_tabs').tabs('option', 'disabled', []);
|
||||
$('#editor_tabs').tabs('option', 'active', 1);
|
||||
break;
|
||||
$("#students_save").click(function() {
|
||||
var id = registrations_id;
|
||||
$("#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 conf = confirmClick('<?= i18n('Are you sure you want to remove this student from the project?') ?>');
|
||||
|
||||
if (conf == false) return false;
|
||||
|
||||
$("#debug").load("student_editor.php?action=student_remove&id=" + id + "&students_id=" + sid, '',
|
||||
function(responseText, textStatus, XMLHttpRequest) {
|
||||
update_students();
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
/* Don't let anything collapse */
|
||||
$('#editor_tabs').tabs('option', 'collapsible', false);
|
||||
|
||||
/* Show the dialog */
|
||||
$('#student_editor').dialog('option', 'width', w);
|
||||
$('#student_editor').dialog('option', 'height', h);
|
||||
$("#student_editor").dialog('open');
|
||||
function update_project() {
|
||||
var id = registrations_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(),
|
||||
function(responseText, textStatus, XMLHttpRequest) {
|
||||
update_project();
|
||||
});
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
/* 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());
|
||||
});
|
||||
|
||||
function update_students(numstudents)
|
||||
{
|
||||
var id = registrations_id;
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
var req = "action=students_load&id="+id;
|
||||
if(numstudents != 0 && numstudents != undefined) req = req+"&numstudents="+numstudents;
|
||||
|
||||
$("#editor_tab_students").load("student_editor.php?"+req, '',
|
||||
function(responseText, textStatus, XMLHttpRequest) {
|
||||
/* Attach to events we care about */
|
||||
$("#students_num").change(function() {
|
||||
var num = $("#students_num").val();
|
||||
update_students(num);
|
||||
});
|
||||
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;
|
||||
|
||||
$("#students_save").click(function() {
|
||||
var id = registrations_id;
|
||||
$("#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 conf = confirmClick('<?= i18n('Are you sure you want to remove this student from the project?') ?>');
|
||||
|
||||
if(conf == false) return false;
|
||||
|
||||
$("#debug").load("student_editor.php?action=student_remove&id="+id+"&students_id="+sid, '',
|
||||
function(responseText, textStatus, XMLHttpRequest) {
|
||||
update_students();
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
function update_project()
|
||||
{
|
||||
var id = registrations_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(),
|
||||
function(responseText, textStatus, XMLHttpRequest) {
|
||||
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());
|
||||
});
|
||||
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
$("#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()
|
||||
{
|
||||
var id = registrations_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());
|
||||
/* 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
|
||||
* check isn't needed */
|
||||
$('#editor_tabs').tabs('option', 'disabled', []);
|
||||
function update_reg() {
|
||||
var id = registrations_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());
|
||||
/* 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
|
||||
* check isn't needed */
|
||||
$('#editor_tabs').tabs('option', 'disabled', []);
|
||||
|
||||
return false;
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#student_editor").dialog({
|
||||
bgiframe: true, autoOpen: false,
|
||||
modal: true, resizable: false,
|
||||
draggable: false,
|
||||
buttons: {
|
||||
/* "<?= i18n('Cancel') ?>": function() {
|
||||
$(this).dialog("close");
|
||||
$("#student_editor").dialog({
|
||||
bgiframe: true,
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
draggable: false,
|
||||
buttons: {
|
||||
/* "<?= i18n('Cancel') ?>": function() {
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"<?= i18n('Save') ?>": function() {
|
||||
save_report();
|
||||
$(this).dialog("close"); */
|
||||
"<?= i18n('Close') ?>": function() {
|
||||
// save_report();
|
||||
$(this).dialog("close");
|
||||
}
|
||||
},
|
||||
"<?= i18n('Save') ?>": function() {
|
||||
save_report();
|
||||
$(this).dialog("close"); */
|
||||
"<?= i18n('Close') ?>": function() {
|
||||
// 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) {
|
||||
/* Create a row before loading it */
|
||||
$("#registration_list").append("<tr id=\"row_"+id+"\"></tr>");
|
||||
close: function() {
|
||||
/* Reload the row after the dialog close in case the info has changed */
|
||||
var id = registrations_id;
|
||||
if (registrations_new == true) {
|
||||
/* Create a row before loading it */
|
||||
$("#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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#editor_tabs").tabs({
|
||||
create: function(event, ui) {
|
||||
update_students();
|
||||
update_project();
|
||||
update_reg();
|
||||
},
|
||||
|
||||
activate: function( event, ui ) {
|
||||
update_students();
|
||||
update_project();
|
||||
update_reg();
|
||||
},
|
||||
selected: -1
|
||||
});
|
||||
|
||||
/*$("#editor_tabs").tabs({
|
||||
show: function(event, ui) {
|
||||
console.log('hi');
|
||||
switch(ui.panel.id) {
|
||||
case 'editor_tab_students':
|
||||
$("#editor_tabs").tabs({
|
||||
create: function(event, ui) {
|
||||
update_students();
|
||||
break;
|
||||
case 'editor_tab_project':
|
||||
update_project();
|
||||
break;
|
||||
case 'editor_tab_reg':
|
||||
update_reg();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
selected: -1
|
||||
});*/
|
||||
},
|
||||
|
||||
$("#newproject").on("click", (function() {
|
||||
activate: function(event, ui) {
|
||||
update_students();
|
||||
update_project();
|
||||
update_reg();
|
||||
},
|
||||
selected: -1
|
||||
});
|
||||
|
||||
/*$("#editor_tabs").tabs({
|
||||
show: function(event, ui) {
|
||||
console.log('hi');
|
||||
switch(ui.panel.id) {
|
||||
case 'editor_tab_students':
|
||||
update_students();
|
||||
break;
|
||||
case 'editor_tab_project':
|
||||
update_project();
|
||||
break;
|
||||
case 'editor_tab_reg':
|
||||
update_reg();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
selected: -1
|
||||
});*/
|
||||
|
||||
$("#newproject").on("click", (function() {
|
||||
popup_editor(-1);
|
||||
}
|
||||
));
|
||||
});
|
||||
}));
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<br />
|
||||
<table width="100%">
|
||||
<tr><td>
|
||||
<?= i18n('Choose Status') ?>:
|
||||
<form name="statuschangerform" method="get" action="registration_list.php">
|
||||
<select name="showstatus" onchange="document.forms.statuschangerform.submit()">
|
||||
<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',
|
||||
'paymentpending' => ($config['regfee'] > 0) ? 'Payment Pending' : '',
|
||||
'completeorpaymentpending' => ($config['regfee'] > 0) ? 'Complete or Payment Pending' : '',
|
||||
'open' => 'Open', 'new' => 'New');
|
||||
<?
|
||||
// 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'
|
||||
);
|
||||
|
||||
$showstatus = $_GET['showstatus'];
|
||||
$showstatus = $_GET['showstatus'];
|
||||
|
||||
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>
|
||||
<td align="right"><button id="newproject"><?= i18n('Create New Project') ?></button></td>
|
||||
</tr></table>
|
||||
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>
|
||||
<td align="right"><button id="newproject"><?= i18n('Create New Project') ?></button></td>
|
||||
</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>";
|
||||
|
||||
|
||||
|
||||
@ -577,4 +586,4 @@ function print_row($r)
|
||||
}
|
||||
echo '</td>';
|
||||
}
|
||||
?>
|
||||
?>
|
@ -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>
|
||||
<?
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
document.forms.inputform.registration_number.focus();
|
||||
</script>
|
||||
<?
|
||||
|
||||
echo '<br/><br/>';
|
||||
echo '</td></tr><tr><td>';
|
||||
|
@ -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 ' ';
|
||||
@ -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 ' ';
|
||||
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>';
|
||||
|
@ -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>
|
||||
<script type="text/javascript">
|
||||
function changed(id) {
|
||||
var o = document.getElementById('changed_' + id);
|
||||
o.value = 1;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?
|
||||
<?
|
||||
|
||||
$sq = $pdo->prepare("SELECT students.firstname,
|
||||
students.lastname,
|
||||
@ -122,4 +125,4 @@ echo '<input type="submit" value="' . i18n('Save Changes') . '">';
|
||||
echo '</form>';
|
||||
|
||||
send_footer();
|
||||
?>
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
@ -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,101 +148,96 @@ 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>");
|
||||
}
|
||||
$("#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);
|
||||
$("#report_format").val(json.format);
|
||||
$("#report_comment").val(json.comment);
|
||||
/* Update the dialog title */
|
||||
$('#popup_editor').dialog('option', 'title', "<?= i18n('Report') ?>: " + json.name);
|
||||
|
||||
popup_editor(id);
|
||||
});
|
||||
}
|
||||
|
||||
function save_report()
|
||||
{
|
||||
$('#debug').load("<? $_SERVER['PHP_SELF'] ?>?action=save", $('#report_form').serializeArray(), function() {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
function add_report()
|
||||
{
|
||||
edit_report(-1, $('#report').val());
|
||||
}
|
||||
|
||||
function gen_report() {
|
||||
report_gen($('#report').val());
|
||||
return false;
|
||||
}
|
||||
|
||||
var edit=false;
|
||||
function edit_toggle()
|
||||
{
|
||||
if(edit == false) {
|
||||
$('#edit_toggle').val("<?= i18n('Done Editing') ?>");
|
||||
$('#edit_info').show();
|
||||
$('.edit_buttons').show();
|
||||
edit = true;
|
||||
} else {
|
||||
$('#edit_toggle').val("<?= i18n('Edit This List') ?>");
|
||||
$('#edit_info').hide();
|
||||
$('.edit_buttons').hide();
|
||||
edit = false;
|
||||
function remove_report(id) {
|
||||
$('#debug').load("<? $_SERVER['PHP_SELF'] ?>?action=remove_report&id=" + id);
|
||||
$("#report_tr_" + id).remove();
|
||||
}
|
||||
}
|
||||
|
||||
function popup_editor(id)
|
||||
{
|
||||
var w = (document.documentElement.clientWidth * 0.6);
|
||||
var h = (document.documentElement.clientHeight * 0.4);
|
||||
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);
|
||||
$("#report_format").val(json.format);
|
||||
$("#report_comment").val(json.comment);
|
||||
/* Update the dialog title */
|
||||
$('#popup_editor').dialog('option', 'title', "<?= i18n('Report') ?>: " + json.name);
|
||||
|
||||
report_id = id;
|
||||
popup_editor(id);
|
||||
});
|
||||
}
|
||||
|
||||
/* Show the dialog */
|
||||
$('#popup_editor').dialog('option', 'width', w);
|
||||
$('#popup_editor').dialog('option', 'height', h);
|
||||
$("#popup_editor").dialog('open');
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Setup the popup window */
|
||||
$(document).ready(function() {
|
||||
$("#popup_editor").dialog({
|
||||
bgiframe: true, autoOpen: false,
|
||||
modal: true, resizable: false,
|
||||
draggable: false,
|
||||
buttons: {
|
||||
"<?= i18n('Cancel') ?>": function() {
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"<?= i18n('Save') ?>": function() {
|
||||
save_report();
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
function save_report() {
|
||||
$('#debug').load("<? $_SERVER['PHP_SELF'] ?>?action=save", $('#report_form').serializeArray(), function() {
|
||||
window.location.reload();
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function add_report() {
|
||||
edit_report(-1, $('#report').val());
|
||||
}
|
||||
|
||||
function gen_report() {
|
||||
report_gen($('#report').val());
|
||||
return false;
|
||||
}
|
||||
|
||||
var edit = false;
|
||||
|
||||
function edit_toggle() {
|
||||
if (edit == false) {
|
||||
$('#edit_toggle').val("<?= i18n('Done Editing') ?>");
|
||||
$('#edit_info').show();
|
||||
$('.edit_buttons').show();
|
||||
edit = true;
|
||||
} else {
|
||||
$('#edit_toggle').val("<?= i18n('Edit This List') ?>");
|
||||
$('#edit_info').hide();
|
||||
$('.edit_buttons').hide();
|
||||
edit = false;
|
||||
}
|
||||
}
|
||||
|
||||
function popup_editor(id) {
|
||||
var w = (document.documentElement.clientWidth * 0.6);
|
||||
var h = (document.documentElement.clientHeight * 0.4);
|
||||
|
||||
report_id = id;
|
||||
|
||||
/* Show the dialog */
|
||||
$('#popup_editor').dialog('option', 'width', w);
|
||||
$('#popup_editor').dialog('option', 'height', h);
|
||||
$("#popup_editor").dialog('open');
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Setup the popup window */
|
||||
$(document).ready(function() {
|
||||
$("#popup_editor").dialog({
|
||||
bgiframe: true,
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
draggable: false,
|
||||
buttons: {
|
||||
"<?= i18n('Cancel') ?>": function() {
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"<?= i18n('Save') ?>": function() {
|
||||
save_report();
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?
|
||||
|
||||
@ -276,21 +274,21 @@ 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>
|
||||
<td style="border:0px;">
|
||||
<div class="edit_buttons" style="display:none">
|
||||
<a title="Edit Report" onclick="edit_report(<?= $i->id ?>,0);return false;" href="#">
|
||||
<img border="0" src="<?= $config['SFIABDIRECTORY'] ?>/images/16/edit.<?= $config['icon_extension'] ?>" />
|
||||
</a>
|
||||
<a title="Remove Report" onclick="remove_report(<?= $i->id ?>);return false;" href="#">
|
||||
<img src="<?= $config['SFIABDIRECTORY'] ?>/images/16/button_cancel.<?= $config['icon_extension'] ?>" border="0" alt="Remove Report" />
|
||||
</a>
|
||||
</div>
|
||||
<td style="border:0px;"><?= $name ?></td>
|
||||
<td style="border:0px;"><?= $i->comment ?></td>
|
||||
<td style="border:0px;">
|
||||
<div class="edit_buttons" style="display:none">
|
||||
<a title="Edit Report" onclick="edit_report(<?= $i->id ?>,0);return false;" href="#">
|
||||
<img border="0" src="<?= $config['SFIABDIRECTORY'] ?>/images/16/edit.<?= $config['icon_extension'] ?>" />
|
||||
</a>
|
||||
<a title="Remove Report" onclick="remove_report(<?= $i->id ?>);return false;" href="#">
|
||||
<img src="<?= $config['SFIABDIRECTORY'] ?>/images/16/button_cancel.<?= $config['icon_extension'] ?>" border="0" alt="Remove Report" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<?
|
||||
|
||||
/*
|
||||
@ -310,9 +308,9 @@ 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>
|
||||
<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>
|
||||
</div>
|
||||
<br />
|
||||
<input id="edit_toggle" type="submit" onclick="edit_toggle();return false;" value="<?= i18n('Edit This List') ?>">
|
||||
@ -331,58 +329,58 @@ 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) {
|
||||
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 />
|
||||
<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">
|
||||
<?
|
||||
/* 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) {
|
||||
if (!in_array($ok, $option_keys))
|
||||
continue;
|
||||
echo "<tr><td>{$o['desc']}:</td>";
|
||||
echo "<td><select name=\"$ok\" id=\"report_$ok\">";
|
||||
foreach ($o['values'] as $k => $v) {
|
||||
echo "<option value=\"$k\">$v</option>\n";
|
||||
}
|
||||
echo "</select><span id=\"report{$ok}custom\" style=\"display: none;\">" . i18n('Custom') . '</span></td></tr>';
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?= i18n('Comments') ?>:</td>
|
||||
<td><textarea rows="3" cols="40" name="comment" id="report_comment"></textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<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) {
|
||||
if (!in_array($ok, $option_keys))
|
||||
continue;
|
||||
echo "<tr><td>{$o['desc']}:</td>";
|
||||
echo "<td><select name=\"$ok\" id=\"report_$ok\">";
|
||||
foreach ($o['values'] as $k => $v) {
|
||||
echo "<option value=\"$k\">$v</option>\n";
|
||||
}
|
||||
echo "</select><span id=\"report{$ok}custom\" style=\"display: none;\">" . i18n('Custom') . '</span></td></tr>';
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?= i18n('Comments') ?>:</td>
|
||||
<td><textarea rows="3" cols="40" name="comment" id="report_comment"></textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?
|
||||
<?
|
||||
|
||||
send_footer();
|
||||
?>
|
||||
send_footer();
|
||||
?>
|
@ -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();
|
||||
?>
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -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">';
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -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,124 +193,126 @@ 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()
|
||||
{
|
||||
document.forms.report.reloadaction.value = 'reload';
|
||||
document.forms.report.submit();
|
||||
}
|
||||
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
|
||||
//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);
|
||||
canvas.appendChild(newdiv);
|
||||
|
||||
canvasObjectIndex++;
|
||||
}
|
||||
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);
|
||||
var dw = Math.round(w * canvasWidth / labelWidth);
|
||||
var dh = Math.round(h * canvasHeight / labelHeight);
|
||||
var dx = Math.round(x * canvasWidth / labelWidth);
|
||||
var dy = Math.round(y * canvasHeight / labelHeight);
|
||||
var dw = Math.round(w * canvasWidth / labelWidth);
|
||||
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;
|
||||
|
||||
// alert(dh + ", fh="+fontheight);
|
||||
var fontheight = (fontsize * 25.4 / 72) * canvasHeight / labelHeight;
|
||||
var l = Math.floor(h / fontheight);
|
||||
if (fontheight == 0) fontheight = 10;
|
||||
if (l == 0) l = 1;
|
||||
|
||||
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;
|
||||
// alert(dh + ", fh="+fontheight);
|
||||
|
||||
var maxlength=Math.floor(dw/(fontheight*0.7))*l;
|
||||
if(value.length>maxlength) value=value.substring(0,maxlength);
|
||||
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.innerHTML=value;
|
||||
var maxlength = Math.floor(dw / (fontheight * 0.7)) * l;
|
||||
if (value.length > maxlength) value = value.substring(0, maxlength);
|
||||
|
||||
canvas.appendChild(newdiv);
|
||||
newdiv.innerHTML = value;
|
||||
|
||||
canvasObjectIndex++;
|
||||
}
|
||||
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');
|
||||
|
||||
@ -662,4 +689,4 @@ echo '<input type="submit" value="Go">';
|
||||
echo '</form>';
|
||||
|
||||
send_footer();
|
||||
?>
|
||||
?>
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -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,130 +61,154 @@ 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 ?>";
|
||||
</script>
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
window.location.href = "<?= $u ?>";
|
||||
</script>
|
||||
<?
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<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>
|
||||
<li><a href="#report_gen_tab_advanced"><span><?= i18n('Advanced Options') ?></span></a></li>
|
||||
</ul>
|
||||
<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>
|
||||
<td class="label"><b><?= i18n('Report Name') ?></b>:</td>
|
||||
<td class="input"><?= $report['name'] ?></b></td>
|
||||
</tr><tr>
|
||||
<td class="label"><b><?= i18n('Description') ?></b>:</td>
|
||||
<td class="input"><?= $report['desc'] ?></b></td>
|
||||
</tr><tr>
|
||||
<td class="label"><b><?= i18n('Created By') ?></b>:</td>
|
||||
<td class="input"><?= $report['creator'] ?></td>
|
||||
</tr><tr>
|
||||
<?
|
||||
/* See if the report is in this committee member's list */
|
||||
$q = $pd->prepare("SELECT * FROM reports_committee
|
||||
<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>
|
||||
<li><a href="#report_gen_tab_advanced"><span><?= i18n('Advanced Options') ?></span></a></li>
|
||||
</ul>
|
||||
<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>
|
||||
<td class="label"><b><?= i18n('Report Name') ?></b>:</td>
|
||||
<td class="input"><?= $report['name'] ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><b><?= i18n('Description') ?></b>:</td>
|
||||
<td class="input"><?= $report['desc'] ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><b><?= i18n('Created By') ?></b>:</td>
|
||||
<td class="input"><?= $report['creator'] ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?
|
||||
/* See if the report is in this committee member's list */
|
||||
$q = $pd->prepare("SELECT * FROM reports_committee
|
||||
\t\t\t\tWHERE users_id='{$_SESSION['users_uid']}'
|
||||
AND reports_id='{$report['id']}'");
|
||||
$q->execute();
|
||||
if ($q->rowCount() > 0) {
|
||||
$i = $q->fetch(PDO::FETCH_ASSOC);
|
||||
?>
|
||||
<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>
|
||||
<td class="label"><b><?= i18n('Comment') ?></b>:</td>
|
||||
<td class="input"><?= $i['comment'] ?></b></td>
|
||||
</tr><tr>
|
||||
<? } ?>
|
||||
$q->execute();
|
||||
if ($q->rowCount() > 0) {
|
||||
$i = $q->fetch(PDO::FETCH_ASSOC);
|
||||
?>
|
||||
<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>
|
||||
<td class="label"><b><?= i18n('Comment') ?></b>:</td>
|
||||
<td class="input"><?= $i['comment'] ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? } ?>
|
||||
|
||||
<td colspan="2"><br /><hr /><h3><?= i18n('Report Options') ?></h3><br /></td>
|
||||
</tr>
|
||||
<?
|
||||
$format = $report['options']['type'];
|
||||
$stock = $report['options']['stock'];
|
||||
$year = $config['FAIRYEAR'];
|
||||
<td colspan="2"><br />
|
||||
<hr />
|
||||
<h3><?= i18n('Report Options') ?></h3><br />
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
$format = $report['options']['type'];
|
||||
$stock = $report['options']['stock'];
|
||||
$year = $config['FAIRYEAR'];
|
||||
|
||||
/* Out of all the report optins, we really only want these ones */
|
||||
$option_keys = array('type', 'stock');
|
||||
foreach ($report_options as $ok => $o) {
|
||||
if (!in_array($ok, $option_keys))
|
||||
continue;
|
||||
/* Out of all the report optins, we really only want these ones */
|
||||
$option_keys = array('type', 'stock');
|
||||
foreach ($report_options as $ok => $o) {
|
||||
if (!in_array($ok, $option_keys))
|
||||
continue;
|
||||
|
||||
echo "<tr><td class=\"label\"><b>{$o['desc']}</b>:</td>";
|
||||
echo "<td class=\"input\"><select name=\"$ok\" id=\"$ok\">";
|
||||
foreach ($o['values'] as $k => $v) {
|
||||
$sel = ($report['option'][$ok] == $k) ? 'selected="selected"' : '';
|
||||
echo "<option value=\"$k\" $sel>" . htmlspecialchars($v) . '</option>';
|
||||
}
|
||||
echo "</select></td></tr>\n";
|
||||
}
|
||||
/* Find all the years */
|
||||
$q = $pdo->prepare('SELECT DISTINCT year FROM config WHERE year>1000 ORDER BY year DESC');
|
||||
$q->execute();
|
||||
echo '<tr><td class="label"><b>' . i18n('Year') . '</b>:</td>';
|
||||
echo '<td class="input"><select name="year" id="year">';
|
||||
while ($i = $q->fetch(PDO::FETCH_ASSOC)) {
|
||||
$y = $i['year'];
|
||||
$sel = ($config['FAIRYEAR'] == $y) ? 'selected="selected"' : '';
|
||||
echo "<option value=\"$y\" $sel>$y</option>";
|
||||
}
|
||||
echo "</select></td></tr>\n";
|
||||
?>
|
||||
</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>
|
||||
<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>
|
||||
<script type="text/javascript">
|
||||
$("#report_gen_tabs").tabs();
|
||||
echo "<tr><td class=\"label\"><b>{$o['desc']}</b>:</td>";
|
||||
echo "<td class=\"input\"><select name=\"$ok\" id=\"$ok\">";
|
||||
foreach ($o['values'] as $k => $v) {
|
||||
$sel = ($report['option'][$ok] == $k) ? 'selected="selected"' : '';
|
||||
echo "<option value=\"$k\" $sel>" . htmlspecialchars($v) . '</option>';
|
||||
}
|
||||
echo "</select></td></tr>\n";
|
||||
}
|
||||
/* Find all the years */
|
||||
$q = $pdo->prepare('SELECT DISTINCT year FROM config WHERE year>1000 ORDER BY year DESC');
|
||||
$q->execute();
|
||||
echo '<tr><td class="label"><b>' . i18n('Year') . '</b>:</td>';
|
||||
echo '<td class="input"><select name="year" id="year">';
|
||||
while ($i = $q->fetch(PDO::FETCH_ASSOC)) {
|
||||
$y = $i['year'];
|
||||
$sel = ($config['FAIRYEAR'] == $y) ? 'selected="selected"' : '';
|
||||
echo "<option value=\"$y\" $sel>$y</option>";
|
||||
}
|
||||
echo "</select></td></tr>\n";
|
||||
?>
|
||||
</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>
|
||||
<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>
|
||||
<script type="text/javascript">
|
||||
$("#report_gen_tabs").tabs();
|
||||
|
||||
$("#report_dialog_gen").dialog({
|
||||
bgiframe: true, autoOpen: true,
|
||||
modal: true, resizable: false,
|
||||
$("#report_dialog_gen").dialog({
|
||||
bgiframe: true,
|
||||
autoOpen: true,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
draggable: false,
|
||||
width: 800, //(document.documentElement.clientWidth * 0.8);
|
||||
height: 600, //(document.documentElement.clientHeight * 0.7),
|
||||
close: function() {
|
||||
$(this).dialog('destroy');
|
||||
$('#report_dialog_gen').remove();
|
||||
$(this).dialog('destroy');
|
||||
$('#report_dialog_gen').remove();
|
||||
},
|
||||
buttons: {
|
||||
"<?= i18n('Cancel') ?>": function() {
|
||||
$('#report_dialog_gen').dialog("close");
|
||||
return false;
|
||||
},
|
||||
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;
|
||||
$('#debug').html(dlurl);
|
||||
// alert(dlurl);
|
||||
// $('#content').attr('src',dlurl);
|
||||
window.location.href=dlurl;
|
||||
$('#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;
|
||||
$('#debug').html(dlurl);
|
||||
// alert(dlurl);
|
||||
// $('#content').attr('src',dlurl);
|
||||
window.location.href = dlurl;
|
||||
$('#report_dialog_gen').dialog("close");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<?
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<?
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -277,4 +302,4 @@ echo '</form>';
|
||||
|
||||
send_footer();
|
||||
|
||||
?>
|
||||
?>
|
@ -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'] &&
|
||||
$r['end'] >= $round['endtime'] &&
|
||||
$r['date'] == $round['date']) {
|
||||
if (
|
||||
$r['start'] <= $round['starttime'] &&
|
||||
$r['end'] >= $round['endtime'] &&
|
||||
$r['date'] == $round['date']
|
||||
) {
|
||||
return 'Yes';
|
||||
}
|
||||
}
|
||||
@ -1093,5 +1100,3 @@ function report_judges_fromwhere($report, $components)
|
||||
|
||||
return $q;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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']);
|
||||
|
||||
|
@ -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>
|
||||
|
||||
<?
|
||||
@ -95,4 +98,4 @@ echo '<input type="submit" value="Generate Mailing Labels">';
|
||||
echo '</form>';
|
||||
|
||||
send_footer();
|
||||
?>
|
||||
?>
|
@ -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);
|
||||
@ -69,7 +72,7 @@ if ($report) {
|
||||
}
|
||||
|
||||
switch ($report) {
|
||||
// IF(schools.sciencehead=\"\",\"Science Department Head\",schools.sciencehead) AS co,
|
||||
// IF(schools.sciencehead=\"\",\"Science Department Head\",schools.sciencehead) AS co,
|
||||
case 'schools':
|
||||
$q = $pdo->prepare("SELECT
|
||||
schools.school AS name,
|
||||
|
@ -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. ");
|
||||
|
||||
|
@ -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();
|
||||
?>
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -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') {
|
||||
@ -153,7 +154,7 @@ if (get_value_from_array($_POST, 'save') == 'edit' || get_value_from_array($_POS
|
||||
$sh['username'] = $em;
|
||||
user_save($sh);
|
||||
}
|
||||
|
||||
|
||||
$exec = 'UPDATE schools SET '
|
||||
. "school='" . get_value_from_array($_POST, 'school') . "', "
|
||||
. "schoollang='" . get_value_from_array($_POST, 'schoollang') . "', "
|
||||
@ -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', '') . "'");
|
||||
@ -237,17 +242,20 @@ if (get_value_from_array($_GET, 'action') == 'edit' || get_value_from_array($_GE
|
||||
echo '<tr><td>' . i18n('School Language') . '</td><td>';
|
||||
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) {
|
||||
|
@ -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]);
|
||||
}
|
||||
|
@ -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 />';
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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'];
|
||||
|
@ -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),
|
||||
);
|
||||
?>
|
||||
|
@ -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,55 +512,58 @@ 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>
|
||||
<td><?= i18n('Registration Email') ?>:</td>
|
||||
<td><input type="text" name="registration_email" value="<?= get_value_from_array($r, 'email') ?>"></td>
|
||||
</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>";
|
||||
<table>
|
||||
<tr>
|
||||
<td><?= i18n('Registration Number') ?>:</td>
|
||||
<td><input type="text" name="registration_num" value="<?= get_value_from_array($r, 'num') ?>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= i18n('Registration Email') ?>:</td>
|
||||
<td><input type="text" name="registration_email" value="<?= get_value_from_array($r, 'email') ?>"></td>
|
||||
</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>
|
||||
<?
|
||||
}
|
||||
?> </td>
|
||||
</tr>
|
||||
<?
|
||||
} else {
|
||||
echo "<input type=\"hidden\" name=\"registration_fair\" value=\"0\" />\n";
|
||||
}
|
||||
?> </select>
|
||||
<?
|
||||
}
|
||||
?> </td>
|
||||
</tr>
|
||||
<?
|
||||
} else {
|
||||
echo "<input type=\"hidden\" name=\"registration_fair\" value=\"0\" />\n";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<br /><br />
|
||||
<button id="registration_save"><?= i18n('Save Registration Information') ?></button>
|
||||
?>
|
||||
</table>
|
||||
<br /><br />
|
||||
<button id="registration_save"><?= i18n('Save Registration Information') ?></button>
|
||||
</form>
|
||||
<?
|
||||
}
|
||||
@ -618,4 +622,4 @@ function registration_save()
|
||||
echo '</script>';
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@ -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 />';
|
||||
|
@ -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;
|
||||
document.forms.tours.submit();
|
||||
}
|
||||
var infowindow = '';
|
||||
|
||||
function openinfo(id)
|
||||
{
|
||||
if(id)
|
||||
currentid=id;
|
||||
else
|
||||
currentid=document.forms.tours["studentlist[]"].options[document.forms.tours["studentlist[]"].selectedIndex].value;
|
||||
function addbuttonclicked(id) {
|
||||
document.forms.tours.action.value = "add";
|
||||
document.forms.tours.tours_id.value = id;
|
||||
document.forms.tours.submit();
|
||||
}
|
||||
|
||||
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 openinfo(id) {
|
||||
if (id)
|
||||
currentid = id;
|
||||
else
|
||||
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");
|
||||
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;
|
||||
}
|
||||
|
||||
document.forms.tours.studentinfobutton.disabled=false;
|
||||
document.forms.tours.studentinfobutton.value=currentname;
|
||||
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;
|
||||
|
||||
if(!infowindow.closed && infowindow.location) {
|
||||
openinfo();
|
||||
document.forms.tours.studentinfobutton.disabled = false;
|
||||
document.forms.tours.studentinfobutton.value = currentname;
|
||||
|
||||
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>';
|
||||
@ -336,4 +342,4 @@ echo '</form>';
|
||||
|
||||
send_footer();
|
||||
|
||||
?>
|
||||
?>
|
@ -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;
|
||||
else
|
||||
currentid = document.forms.tours["tourslist[]"].options[document.forms.tours["tourslist[]"].selectedIndex].value;
|
||||
|
||||
function opentoursinfo(id)
|
||||
{
|
||||
if(id)
|
||||
currentid=id;
|
||||
else
|
||||
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");
|
||||
return false;
|
||||
|
||||
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>
|
||||
|
||||
<?
|
||||
@ -93,4 +96,4 @@ if ($_GET['TableEditorAction'] == '') {
|
||||
}
|
||||
|
||||
send_footer();
|
||||
?>
|
||||
?>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user