Removed the warnings from judging scheduler log files.

This commit is contained in:
Armanveer Gill 2025-01-21 02:07:33 -05:00
parent 0b36f20e86
commit 6b2394d4e0
27 changed files with 88 additions and 56 deletions

View File

@ -482,32 +482,32 @@ while($r = $q->fetch(PDO::FETCH_OBJ)) {
$stmt = $pdo->prepare("DELETE FROM judges_teams_link WHERE judges_teams_id='$id' AND year={$config['FAIRYEAR']}");
$stmt->execute();
print $pdo->errorInfo();
show_pdo_errors_if_any($pdo);
/* Awards */
$stmt = $pdo->prepare("DELETE FROM judges_teams_awards_link WHERE judges_teams_id='$id' AND year={$config['FAIRYEAR']}");
$stmt->execute();
print $pdo->errorInfo();
show_pdo_errors_if_any($pdo);
/* Timeslots */
$stmt = $pdo->prepare("DELETE FROM judges_teams_timeslots_link WHERE judges_teams_id='$id' AND year={$config['FAIRYEAR']}");
$stmt->execute();
print $pdo->errorInfo();
show_pdo_errors_if_any($pdo);
/* Timeslots projects */
$stmt = $pdo->prepare("DELETE FROM judges_teams_timeslots_projects_link WHERE judges_teams_id='$id' AND year={$config['FAIRYEAR']}");
$stmt->execute();
print $pdo->errorInfo();
show_pdo_errors_if_any($pdo);
}
echo "\n";
/* Finally, delete all the autocreated judges teams */
$stmt = $pdo->prepare("DELETE FROM judges_teams WHERE autocreate_type_id=1 AND year={$config['FAIRYEAR']}");
$stmt->execute();
print $pdo->errorInfo();
show_pdo_errors_if_any($pdo);
/* Also delete any judges_teams_link that link to teams that dont exist, just
* in case */
@ -884,6 +884,7 @@ for($x=1;$x<count($jteam); $x++) {
print("Unused Judges:\n");
$ids = $a->bucket[0];
for($y=0; $y<count(get_value_or_default($ids, [])); $y++) {
pr_judge($jteam[0], $ids[$y]);
}

View File

@ -54,7 +54,7 @@ else{
//the argument does not get used by the script at all
exec("nice php judges_sa.php {$_SERVER['PHP_SELF']} >../data/logs/judge_scheduler_".date("YmdHis").".log 2>&1 &");
}
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
//usleep(1500000); // 1.5 second to allow the judges_sa to update the % status to 0% otherwise the status page will think its not running if it gets there too soon
header("Location: judges_scheduler_status.php");
exit;
?>

View File

@ -144,16 +144,14 @@ function judges_scheduler_check_judges()
$qp->execute();
$qr = $qp->fetch(PDO::FETCH_OBJ);
if (get_value_from_3d_array($jdiv, $r->jdiv_id, 'num_projects', 'total') !== null){
$jdiv[$r->jdiv_id][num_projects][total] += $qr->cnt;
}
//if (get_value_from_3d_array($jdiv, $r->jdiv_id, 'num_projects', 'total') !== null){
$jdiv[$r->jdiv_id]['num_projects']['total'] += $qr->cnt;
//}
if(get_value_from_3d_array($jdiv,$r->jdiv_id, 'num_projects', $l) !== null)
$jdiv[$r->jdiv_id]['num_projects'][$l] += $qr->cnt;
$jdiv[$r->jdiv_id]['num_projects'][$l] += $qr->cnt;
if(get_value_from_array($projectlanguagetotal, $l) !== null)
$projectlanguagetotal[$l]+=$qr->cnt;
$projectlanguagetotal[$l]+=$qr->cnt;
$projecttotal+=$qr->cnt;
}

View File

@ -101,7 +101,7 @@ exit;
function project_save()
{
global $registrations_id, $config;
global $registrations_id, $config, $pdo;
//first, lets make sure this project really does belong to them
$q=$pdo->prepare("SELECT * FROM projects WHERE registrations_id='{$registrations_id}' AND year='{$config['FAIRYEAR']}'");
@ -178,7 +178,7 @@ function project_save()
function project_load()
{
global $registrations_id, $config;
global $registrations_id, $config, $pdo;
//now lets find out their MAX grade, so we can pre-set the Age Category
$q=$pdo->prepare("SELECT MAX(grade) AS maxgrade FROM students WHERE registrations_id='".$registrations_id."'");
$q->execute();

View File

@ -29,6 +29,8 @@
require_once('../common.inc.php');
require_once('../user.inc.php');
$auth_type = user_auth_required(array('fair','committee'), 'admin');
//require_once('../register_participants.inc.php');
@ -104,6 +106,8 @@ if($auth_type == 'committee') {
?>
<div id="student_editor" title="Student/Project Editor" style="display: none">
<div id="editor_tabs" >
<ul>
@ -111,7 +115,8 @@ if($auth_type == 'committee') {
<li><a href="#editor_tab_students"><span><?=i18n('Students')?></span></a></li>
<li><a href="#editor_tab_project"><span><?=i18n('Project')?></span></a></li>
</ul>
<div id="editor_tab_reg">Loading...</div>
<div id="editor_tab_reg">Loading...
</div>
<div id="editor_tab_students">Loading...</div>
<div id="editor_tab_project">Loading...</div>
</div>
@ -142,6 +147,7 @@ function popup_editor(id, open_tab)
$('#editor_tabs').tabs('option', 'collapsible', true);
$('#editor_tabs').tabs('option', 'selected', -1);
/* Then we'll select a tab to force a reload */
switch(open_tab) {
case 'reg':
@ -306,8 +312,10 @@ $(document).ready(function() {
});
$("#editor_tabs").tabs({
show: function(event, ui) {
console.log('hi');
switch(ui.panel.id) {
case 'editor_tab_students':
update_students();
@ -325,10 +333,10 @@ $(document).ready(function() {
selected: -1
});
$("#newproject").click(function() {
$("#newproject").on("click", (function() {
popup_editor(-1);
}
);
));
});
</script>
@ -375,7 +383,7 @@ else $wherestatus="";
$q = list_query($year, $wherestatus, false);
echo "<table id=\"registration_list\" class=\"tableview\">";
echo "<thead><tr>";
echo "<thead><tr style='background: black';>";
if($showstatus) $stat="&showstatus=".$showstatus;
echo "<th>".i18n("Status")."</th>";
echo "<th>".i18n("Email Address")."</th>";
@ -460,15 +468,15 @@ function print_row($r)
$status_text=i18n($status_text);
$scl = "style=\"cursor:pointer;\" onclick=\"popup_editor('{" . get_value_property_or_default($r, 'reg_id') ."}','');\"";
$pcl = "style=\"cursor:pointer;\" onclick=\"popup_editor('{". get_value_property_or_default($r, 'reg_id') ."}','project');\"";
$scl = "style=\"cursor:pointer;\" onclick=\"popup_editor('" . get_value_property_or_default($r, 'reg_id') ."','');\"";
$pcl = "style=\"cursor:pointer;\" onclick=\"popup_editor('". get_value_property_or_default($r, 'reg_id') ."','project');\"";
echo "<td $scl>{$status_text}</td>";
echo "<td $scl>{".get_value_property_or_default($r, 'email') ."}</td>";
echo "<td $scl>{".get_value_property_or_default($r, 'reg_num') ."}</td>";
echo "<td $scl>".get_value_property_or_default($r, 'email') ."</td>";
echo "<td $scl>".get_value_property_or_default($r, 'reg_num') ."</td>";
$pn = str_replace(' ', '&nbsp;', get_value_property_or_default($r, 'projectnumber', ''));
echo "<td $scl>$pn</td>";
echo "<td $pcl>{" .get_value_property_or_default($r, 'title')."}</td>";
echo "<td $pcl>" .get_value_property_or_default($r, 'title')."</td>";
echo "<td $scl>".i18n(get_value_from_array($cats, get_value_property_or_default($r, 'projectcategories_id'), ''))."</td>";
echo "<td $scl>".i18n($divs[get_value_property_or_default($r, 'projectdivisions_id', '')])."</td>";
@ -487,7 +495,7 @@ function print_row($r)
students.schools_id=schools.id
");
$sq->execute();
show_pdo_errors_if_any($pdo);
show_pdo_errors_if_any($pdo);
$studnum=1;
$schools="";
@ -503,12 +511,12 @@ function print_row($r)
echo "<td align=\"center\" >";
if($r->flagged == false) {
echo "<a title=\"".i18n("Not flagged")."\" href=\"#\" onClick=\"popup_editor('{$r->reg_id}','project');\" >";
echo "<a title=\"".i18n("Not flagged")."\" href=\"#\" onClick=\"popup_editor('$r->reg_id','project');\" >";
echo "<img src=\"".$config['SFIABDIRECTORY']."/images/16/ok.".$config['icon_extension']."\" border=0>";
echo "</a>";
}
else {
echo "<a title=\"".i18n("Flagged")."\" href=\"#\" onClick=\"popup_editor('{$r->reg_id}','project');\" >";
echo "<a title=\"".i18n("Flagged")."\" href=\"#\" onClick=\"popup_editor('$r->reg_id','project');\" >";
echo "<img src=\"".$config['SFIABDIRECTORY']."/images/16/flagged.".$config['icon_extension']."\" border=0>";
echo "</a>";
}

View File

@ -132,7 +132,7 @@ exit;
//now do any data saves
function students_save()
{
global $registrations_id, $config;
global $registrations_id, $config, $pdo;
$x=1;
while($_POST["num"][$x]) {
@ -214,7 +214,7 @@ function students_save()
function students_load()
{
global $registrations_id, $config;
global $registrations_id, $config, $pdo;
//now query and display
$q=$pdo->prepare("SELECT * FROM students WHERE
@ -445,7 +445,7 @@ function students_load()
function registration_load()
{
global $registrations_id, $config, $auth_type;
global $registrations_id, $config, $auth_type, $pdo;
/* Load reg data */
if($registrations_id == -1) {
@ -541,7 +541,7 @@ else {
function registration_save()
{
global $registrations_id, $config, $auth_type;
global $registrations_id, $config, $auth_type, $pdo;
$registration_num = intval($_POST['registration_num']);
$registration_status = stripslashes($_POST['registration_status']);
$registration_email = stripslashes($_POST['registration_email']);

View File

@ -28,9 +28,9 @@ header("Content-Type: text/html; charset=utf8");
include_once("helper.inc.php");
//set error reporting to not show notices, for some reason some people's installation dont set this by default
//so we will set it in the code instead just to make sure
error_reporting(E_ALL);
#error_reporting(E_ALL);
#error_reporting( E_ALL ^ E_WARNING );
#error_reporting( E_ALL ^ E_WARNING ^ E_NOTICE ^ E_DEPRECATED );
error_reporting( E_ALL ^ E_WARNING ^ E_NOTICE ^ E_DEPRECATED );
define('REQUIREDFIELD','<span class="requiredfield">*</span>');
@ -208,7 +208,7 @@ session_start();
//detect the browser first, so we know what icons to use - we store this in the config array as well
//even though its not configurable by the fair
if(stristr($_SERVER['HTTP_USER_AGENT'],"MSIE"))
if(stristr(get_value_from_array($_SERVER, 'HTTP_USER_AGENT', ''),"MSIE"))
$config['icon_extension']="gif";
else
$config['icon_extension']="png";
@ -415,6 +415,7 @@ function send_header($title="", $nav=null, $icon=null, $titletranslated=false)
<!-- <script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/jqueryui/1.7.2/jquery-ui.min.js"></script> -->
<script src="https://code.jquery.com/ui/1.14.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/sfiab.js"></script>
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/theme/new_default/theme-script.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.tableview').tablesorter();
@ -633,7 +634,7 @@ if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-7)=="/config" || substr(get
$fname=substr($_SERVER['REDIRECT_SCRIPT_URL'],strlen($config['SFIABDIRECTORY'])+1);
else
$fname=substr($_SERVER['PHP_SELF'],strlen($config['SFIABDIRECTORY'])+1);
echo "</td><td align=\"right\"><a target=\"_sfiabhelp\" href=\"http://www.sfiab.ca/wiki/index.php/Help_$fname\"><img border=\"0\" src=\"".$config['SFIABDIRECTORY']."/images/32/help.".$config['icon_extension']."\"></a>";
echo "</td><td align=\"right\"><a target=\"_sfiabhelp\" href=\"http://www.sfiab.ca/wiki/index.php/Help_$fname\"><img border=\"0\" src=\"".$config['SFIABDIRECTORY']."/images/32/help_science_ation.".$config['icon_extension']."\"></a>";
}
"</td></tr>";
echo "</table>";
@ -706,8 +707,9 @@ function send_popup_header($title="")
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script src="https://code.jquery.com/jquery-migrate-3.5.2.js"></script>
<script src="https://code.jquery.com/ui/1.14.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/sfiab.js"></script>
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/theme/new_default/theme-script.js"></script>
<div id="notice_area" class="notice_area"></div>
<?

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -64,8 +64,8 @@
* it's less obvious below */
$q = $pdo->prepare("SELECT id FROM judges_teams_link WHERE
users_id='{$u['id']}' AND year='{$config['FAIRYEAR']}'");
$q2->execute();
if($q2->rowCount() > 0) {
$q->execute();
if($q->rowCount() > 0) {
echo '<span style="font-size: 1.2em; font-weight: bold;">';
echo i18n("You have been assigned to a judging team. %1Click here%2 to view the judging schedule",
array("<a href=\"judge_schedule.php\">","</a>"));

View File

@ -38,9 +38,9 @@
$_SESSION['registration_number']=$r->num;
$_SESSION['registration_id']=$r->id;
$stmt = $pdo->prepare("INSERT INTO students (registrations_id,email,schools_id,year) VALUES ('$r->id','".$_SESSION['email']."','".$r->schools_id."','".$config['FAIRYEAR']."')");
$stmt->execute();
$stmt = $pdo->prepare("UPDATE registrations SET status='open' WHERE id='$r->id'");
$stmt->execute();
$stmt->execute();
@ -203,12 +203,15 @@ $q->execute();
}
else if($config['participant_registration_type']=="singlepassword") {
$showsinglepasswordform=true;
if($_POST['singlepassword']) {
if(get_value_from_array($_POST, 'singlepassword')) {
if($_POST['singlepassword']==$config['participant_registration_singlepassword']) {
$allownew=true;
$showform=true;
$showsinglepasswordform=false;
}
else {
echo error(i18n("Invalid registration password, please try again"));
$allownew=false;

View File

@ -363,7 +363,7 @@ if($config['participant_student_personal']=="yes")
echo "<tr>\n";
echo " <td>".i18n("Date of Birth")."</td><td>\n";
$year = null;
list($year,$month,$day)=explode("-",get_value_property_or_default($studentinfo,'dateofbirth', ''));
echo "<table><tr><td>";
emit_day_selector("day[$x]",$day);

View File

@ -1,3 +1,7 @@
html{
overflow-x:hidden;
}
body
{
@ -9,6 +13,7 @@ body
background: #e0e0ff;
height:100%;
}
input, textarea, select
@ -17,6 +22,10 @@ input, textarea, select
font-size: small;
}
table{
overflow:scroll;
}
td {
@ -455,8 +464,13 @@ div.ui-tabs ul.ui-tabs-nav {
color: #c0c0c0;
}
.tablesorter-headerRow{
background:black;
}
#registration_list{
background:black;
}
#menu-toggle-button{
display: none;
}

View File

@ -93,11 +93,11 @@ function user_load_judge(&$u)
$u['years_national'] = intval($u['years_national']);
$u['willing_chair'] = ($u['willing_chair'] == 'yes') ? 'yes' : 'no';
$u['special_award_only'] = ($u['special_award_only'] == 'yes') ? 'yes' : 'no';
$u['cat_prefs'] = unserialize($u['cat_prefs']);
$u['div_prefs'] = unserialize($u['div_prefs']);
$u['divsub_prefs'] = unserialize($u['divsub_prefs']);
$u['cat_prefs'] = unserialize(get_value_from_array($u, 'cat_prefs', ''));
$u['div_prefs'] = unserialize(get_value_from_array($u, 'div_prefs', ''));
$u['divsub_prefs'] = unserialize(get_value_from_array($u, 'divsub_prefs', ''));
// $u['expertise_other'] = $u['expertise_other'];
$u['languages'] = unserialize($u['languages']);
$u['languages'] = unserialize(get_value_from_array($u, 'languages', ''));
// $u['highest_psd'] = $u['highest_psd'];
/* Sanity check the arrays, make sure they are arrays */
@ -683,7 +683,7 @@ function user_purge($u, $type=false)
/* Duplicate a row in the users table, or any one of the users_* tables. */
function user_dupe_row($db, $key, $val, $newval)
{
global $config;
global $config, $pdo;
$nullfields = array('deleteddatetime'); /* Fields that can be null */
$q = $pdo->prepare("SELECT * FROM $db WHERE $key='$val'");
$q->execute();
@ -735,15 +735,18 @@ function user_dupe($u, $new_year)
echo "Cannot duplicate user ID {$u['id']}, they are deleted. Undelete them first.\n";
exit;
}
print($r->year);
if($r->year == $new_year) {
echo "Cannot duplicate user ID {$u['id']}, they already exist in year $new_year\n";
exit;
}
$id = user_dupe_row('users', 'id', $u['id'], NULL);
$q = $pdo->prepare("UPDATE users SET year='$new_year' WHERE id='$id'");
$q->execute();
$q = $pdo->prepare("UPDATE users SET year = :new_year WHERE id = :id");
$q->execute([
':new_year' => $new_year,
':id' => $id
]);
/* Load the new user */
$u2 = user_load($id);

View File

@ -27,7 +27,7 @@
require_once("user.inc.php");
function try_login($user, $pass)
{
{ print('hi');
global $pdo;
/* Ensure sanity of inputs, user should be an email address, but it's stored
* in the username field */
@ -65,6 +65,7 @@
/* See if the password matches */
/////// FIXME Use hash passwords
if($r->password != $pass) return false;
/* Login successful */
@ -96,6 +97,7 @@
$redirect = get_value_from_array($_GET, 'redirect');
$redirect_data = get_value_from_array($_GET, 'redirectdata');
switch($redirect) {
case 'roleadd':
$redirect_url = "&redirect=$redirect&redirectdata=$redirectdata";

View File

@ -37,6 +37,7 @@
$action = get_value_from_array($_GET, 'action');
if($action == '') $action = get_value_from_array($_POST, 'action');
switch($type) {
case 'volunteer':
// returns "notopenyet", "closed", or "open"
@ -100,10 +101,10 @@
* this is the one time I wish php had a goto statement. */
switch($action) {
case 'new':
$data_fn = stripslashes($_POST['fn']);
$data_ln = stripslashes($_POST['ln']);
$data_fn = $pdo->quote(stripslashes($_POST['fn']));
$data_ln = $pdo->quote(stripslashes($_POST['ln']));
$data_email = stripslashes($_POST['email']);
$sql_email = $data_email;
$sql_email = $pdo->quote($data_email);
$registrationpassword = $_POST['registrationpassword'];
/* Check the registration singlepassword */

View File

@ -352,7 +352,7 @@ echo "</table>";
if(in_array('committee', $u['types'])) {
echo "<table class='user-info-table'>";
echo "<tr><td>".i18n("Email (Private)").":</td><td><input type=\"text\" name=\"emailprivate\" value=\"{$u['emailprivate']}\" /></td></tr>\n";
echo "<tr><td>".i18n("Email (Private)").":</td><td><input type=\"text\" name=\"emailprivate\" value=\"{$u['emailprivate']}\" /></td></tr>\n";
echo "<tr><td>".i18n("Display Emails").":</td><td>";
if($u['displayemail']=="no") $checked="checked=\"checked\""; else $checked="";
echo "<input type=\"radio\" name=\"displayemail\" value=\"no\" $checked />".i18n("No");