2006-01-03 02:08:23 +00:00
< ?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website : http :// www . sfiab . ca
Copyright ( C ) 2005 Sci - Tech Ontario Inc < info @ scitechontario . org >
Copyright ( C ) 2005 James Grant < james @ lightbox . org >
This program is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation , version 2.
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU
General Public License for more details .
You should have received a copy of the GNU General Public License
2006-08-01 19:43:15 +00:00
along with this pr < input type = \ " submit \" value= \" " . i18n ( " Save Configuration " ) . " \" /> \n " ;
ogram ; see the file COPYING . If not , write to
2006-01-03 02:08:23 +00:00
the Free Software Foundation , Inc . , 59 Temple Place - Suite 330 ,
Boston , MA 02111 - 1307 , USA .
*/
?>
< ?
require ( " ../common.inc.php " );
2007-11-21 17:02:09 +00:00
require_once ( " ../user.inc.php " );
2006-08-01 19:43:15 +00:00
require ( " ../config_editor.inc.php " );
2007-11-18 23:50:23 +00:00
user_auth_required ( 'committee' , 'admin' );
2006-01-31 22:34:04 +00:00
require ( " judges.inc.php " );
require ( " judges_schedulerconfig_check.inc.php " );
2006-01-03 02:08:23 +00:00
2008-01-28 21:48:44 +00:00
$action = config_editor_handle_actions ( " Judge Scheduler " , $config [ 'FAIRYEAR' ], " var " );
2007-12-20 08:20:29 +00:00
if ( $action == 'update' ) {
header ( " Location: judges_schedulerconfig.php " );
exit ;
}
2007-11-18 23:50:23 +00:00
send_header ( " Judge Scheduler Configuration " ,
array ( 'Committee Main' => 'committee_main.php' ,
'Administration' => 'admin/index.php' ,
'Judges' => 'admin/judges.php' )
);
2006-01-03 02:08:23 +00:00
2007-12-20 08:20:29 +00:00
config_editor ( " Judge Scheduler " , $config [ 'FAIRYEAR' ], " var " , $_SERVER [ 'PHP_SELF' ]);
2006-08-01 19:43:15 +00:00
echo " <hr /> " ;
2006-10-25 03:19:54 +00:00
2006-12-15 21:18:27 +00:00
if ( $_GET [ 'action' ] == " reset " )
{
mysql_query ( " UPDATE config SET `val`='-1' WHERE `var`='judge_scheduler_percent' AND `year`=0 " );
2008-02-28 19:30:19 +00:00
$config [ 'judge_scheduler_percent' ] = " -1 " ;
2006-12-15 21:18:27 +00:00
echo happy ( i18n ( " Judge scheduler status forcibly reset " ));
}
2006-10-25 03:19:54 +00:00
if ( $config [ 'judge_scheduler_percent' ] == " -1 " )
{
2006-08-01 19:43:15 +00:00
$ok = 1 ;
echo " <table class='headertable'><tr><td><h3>Timeslots</h3></td> " ;
echo " <td> - <a href= \" judges_timeslots.php \" > " . i18n ( " Timeslot Manager " ) . " </a> " ;
echo " </td></tr></table> " ;
$timeslots = judges_scheduler_check_timeslots ();
if ( $timeslots > 0 ) {
echo happy ( i18n ( " There are %1 timeslot(s) defined for divisional judging, good " , array ( $timeslots )));
} else {
echo error ( i18n ( " There are no timeslots defined for divisional judging " ));
$ok = 0 ;
}
2006-01-03 02:08:23 +00:00
2006-08-01 19:43:15 +00:00
echo " <table class='headertable'><tr><td><h3>Awards</h3></td> " ;
echo " <td> - <a href= \" awards.php \" > " . i18n ( " Awards Manager " ) . " </a> " ;
echo " </td></tr></table> " ;
$missing_awards = judges_scheduler_check_awards ();
if ( count ( $missing_awards ) == 0 ) {
2007-12-10 19:21:21 +00:00
echo happy ( i18n ( " There is a single divisional award for each division/category, good " ));
2006-08-01 19:43:15 +00:00
} else {
2007-12-10 19:21:21 +00:00
echo " <br />The following divisional awards problems were identified:<br /><ul> " ;
2006-08-01 19:43:15 +00:00
for ( $x = 0 ; $x < count ( $missing_awards ); $x ++ ) {
print ( $missing_awards [ $x ] . " <br /> " );
}
echo " </ul> " ;
2007-12-10 19:21:21 +00:00
echo error ( i18n ( " There needs to be exactly one award for each division/category " ));
2006-08-01 19:43:15 +00:00
$ok = 0 ;
}
2006-01-03 02:08:23 +00:00
2006-08-01 19:43:15 +00:00
echo " <table class='headertable'><tr><td><h3>Divisional Judging Groupings</h3></td> " ;
echo " <td> - <a href= \" judges_jdiv.php \" > " . i18n ( " Divisional Judging Groupings Manager " ) . " </a> " ;
echo " </td></tr></table> " ;
2006-01-03 02:08:23 +00:00
2006-08-01 19:43:15 +00:00
$jdivs = judges_scheduler_check_jdivs ();
2007-03-29 20:33:45 +00:00
if ( $jdivs > 1 ) {
2006-08-01 19:43:15 +00:00
echo happy ( i18n ( " There are %1 divisional groups defined for divisional judging, good " , array ( $jdivs )));
} else {
2007-03-29 20:33:45 +00:00
echo error ( i18n ( " There is not more than 1 divisional groups defined for divisional judging. Please assign ALL categories/divisions/languages to judging groupings before continuing " ));
2006-08-01 19:43:15 +00:00
$ok = 0 ;
}
2006-01-03 02:08:23 +00:00
2006-08-01 19:43:15 +00:00
echo " <h3>Projects and Judges</h3><br /> " ;
$k = judges_scheduler_check_judges ();
2006-01-26 23:06:47 +00:00
2006-08-01 19:43:15 +00:00
if ( ! $k ) $ok = 0 ;
2006-01-26 23:06:47 +00:00
2006-01-03 02:08:23 +00:00
if ( $ok )
{
2006-08-01 19:43:15 +00:00
echo i18n ( " Everything looks in order, we're ready to create the
2006-10-25 02:41:41 +00:00
divisional awards judging teams . Click link below to start the scheduler .
Please be patient as it may take several minutes find an good solution to
the judging team assignments . " );
2006-08-01 19:43:15 +00:00
2006-01-03 02:08:23 +00:00
echo " <br /> " ;
2006-01-16 05:04:45 +00:00
echo " <br /> " ;
2007-12-27 00:43:40 +00:00
echo " <a href= \" judges_sa_launcher.php \" > " . i18n ( " Start the judging scheduler to create judging teams and judging schedule " ) . " </a> " ;
2006-01-03 02:08:23 +00:00
}
2006-10-25 03:19:54 +00:00
}
else
{
echo " <br /> " ;
echo " <b> " ;
echo i18n ( " The scheduler is currently running " );
echo " </b> " ;
echo " <br /> " ;
echo " <br /> " ;
echo " <a href= \" judges_scheduler_status.php \" > " . i18n ( " Click here to check the judging scheduler progress " ) . " </a> " ;
2006-12-15 21:18:27 +00:00
echo " <br /> " ;
echo " <br /> " ;
echo " <br /> " ;
echo i18n ( " If the scheduler is not running (and you are 100% sure that it is not!) click the link below to reset the scheduler status " );
echo " <br /> " ;
echo " <a href= \" judges_schedulerconfig.php?action=reset \" > " . i18n ( " Reset judge scheduler status " ) . " </a> " ;;
2006-10-25 03:19:54 +00:00
}
2006-01-03 02:08:23 +00:00
echo " <br /> " ;
echo " <br /> " ;
echo " <br /> " ;
send_footer ();
?>