forked from science-ation/science-ation
Resolved errors on the judge scheduler configuration page
This commit is contained in:
parent
ba00a86a41
commit
b60bcd9909
@ -1079,6 +1079,7 @@ function update_contactsinfo()
|
|||||||
|
|
||||||
function contactsinfo_save(uid) {
|
function contactsinfo_save(uid) {
|
||||||
var id=sponsor_id;
|
var id=sponsor_id;
|
||||||
|
print(id);
|
||||||
$("#debug").load("<?$_SERVER['PHP_SELF']?>?action=contactsinfo_save&id="+id, $("#contact_" + uid).serializeArray(),
|
$("#debug").load("<?$_SERVER['PHP_SELF']?>?action=contactsinfo_save&id="+id, $("#contact_" + uid).serializeArray(),
|
||||||
function() {
|
function() {
|
||||||
$("#contactaccordion").accordion();
|
$("#contactaccordion").accordion();
|
||||||
|
@ -144,11 +144,15 @@ function judges_scheduler_check_judges()
|
|||||||
$qp->execute();
|
$qp->execute();
|
||||||
$qr = $qp->fetch(PDO::FETCH_OBJ);
|
$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;
|
||||||
|
}
|
||||||
|
|
||||||
$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;
|
$projecttotal+=$qr->cnt;
|
||||||
|
|
||||||
|
@ -359,17 +359,17 @@ foreach($report_stock as $n=>$v) {
|
|||||||
foreach($report[$type] as $k=>$v) {
|
foreach($report[$type] as $k=>$v) {
|
||||||
if($type == 'option') {
|
if($type == 'option') {
|
||||||
/* field, value, x, y, w, h, lines, face, align, valign, fn, fs, fsize, overflow */
|
/* field, value, x, y, w, h, lines, face, align, valign, fn, fs, fsize, overflow */
|
||||||
$vals = "'".$k."','".$v."','0','0','0','0','0','','','','','','0','truncate'";
|
$vals = "'".$pdo->quote($k)."','".$pdo->quote($v)."','0','0','0','0','0','','','','','','0','truncate'";
|
||||||
} else {
|
} else {
|
||||||
if(get_value_from_array($v, 'lines') == 0) $v['lines'] =1;
|
if(get_value_from_array($v, 'lines') == 0) $v['lines'] =1;
|
||||||
$fs = is_array(get_value_from_array($v,'fontstyle')) ? implode(',',$v['fontstyle']) : '';
|
$fs = is_array(get_value_from_array($v,'fontstyle')) ? implode(',',$v['fontstyle']) : '';
|
||||||
$opts = "{".get_value_from_array($v,'align')."} {". get_value_from_array($v, 'valign') ."}";
|
$opts = get_value_from_array($v, 'align') . " " .$pdo->quote(get_value_from_array($v, 'valign'));
|
||||||
$vals = "'{'".get_value_from_array($v, 'field')."'}','".get_value_from_array($v, 'value')."',
|
$vals = "'{$v['field']}','{$v['value']}',
|
||||||
'{".get_value_from_array($v, 'x')."}','{".get_value_from_array($v,'y')."}','{".get_value_from_array($v, 'w')."}',
|
'{$v['x']}','{$v['y']}','{$v['w']}',
|
||||||
'{".get_value_from_array($v, 'h')."}','{".get_value_from_array($v, 'lines')."}','{".get_value_from_array($v,'face')."}',
|
'{$v['h']}','{$v['lines']}','{$v['face']}',
|
||||||
'$opts','{".get_value_from_array($v,'valign')."}',
|
'$opts','{$v['valign']}',
|
||||||
'{".get_value_from_array($v, 'fontname')."}','$fs','{".get_value_from_array($v, 'fontsize')."}',
|
'{$v['fontname']}','$fs','{$v['fontsize']}',
|
||||||
'{".get_value_from_array($v, 'on_overflow')."}'";
|
'{$v['on_overflow']}'";
|
||||||
}
|
}
|
||||||
if($q != '') $q .= ',';
|
if($q != '') $q .= ',';
|
||||||
$q .= "({$report['id']}, '$type','$x',$vals)";
|
$q .= "({$report['id']}, '$type','$x',$vals)";
|
||||||
@ -396,17 +396,19 @@ foreach($report_stock as $n=>$v) {
|
|||||||
global $report_tours_fields, $report_fairs_fields;
|
global $report_tours_fields, $report_fairs_fields;
|
||||||
global $report_fundraisings_fields;
|
global $report_fundraisings_fields;
|
||||||
|
|
||||||
|
global $pdo;
|
||||||
|
|
||||||
$report = array();
|
$report = array();
|
||||||
|
|
||||||
$q = $pdo->prepare("SELECT * FROM reports WHERE id='$report_id'");
|
$q = $pdo->prepare("SELECT * FROM reports WHERE id='$report_id'");
|
||||||
$q->execute();
|
$q->execute();
|
||||||
$r = $q->fetch(PDO::FETCH_ASSOC);
|
$r = $q->fetch(PDO::FETCH_ASSOC);
|
||||||
$report['name'] = $r['name'];
|
$report['name'] = get_value_from_array($r, 'name');
|
||||||
$report['id'] = $r['id'];
|
$report['id'] = get_value_from_array($r, 'id');
|
||||||
$report['system_report_id'] = $r['system_report_id'];
|
$report['system_report_id'] = get_value_from_array($r, 'system_report_id');
|
||||||
$report['desc'] = $r['desc'];
|
$report['desc'] = get_value_from_array($r,'desc');
|
||||||
$report['creator'] = $r['creator'];
|
$report['creator'] = get_value_from_array($r,'creator');
|
||||||
$report['type'] = $r['type'];
|
$report['type'] = get_value_from_array($r, 'type');
|
||||||
|
|
||||||
$report['col'] = array();
|
$report['col'] = array();
|
||||||
$report['sort'] = array();
|
$report['sort'] = array();
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
$tours[$i->id]['num'] = $i->num;
|
$tours[$i->id]['num'] = $i->num;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_GET['action']=='info') {
|
if(get_value_from_array($_GET, 'action')=='info') {
|
||||||
$sid = intval($_GET['id']);
|
$sid = intval($_GET['id']);
|
||||||
|
|
||||||
$query="SELECT * FROM students WHERE id='$sid'
|
$query="SELECT * FROM students WHERE id='$sid'
|
||||||
@ -139,10 +139,10 @@ function switchinfo()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$tours_id = intval($_POST['tours_id']);
|
$tours_id = intval(get_value_from_array($_POST, 'tours_id'));
|
||||||
$student_list = is_array($_POST['studentlist']) ? $_POST['studentlist'] : array();
|
$student_list = is_array(get_value_from_array($_POST, 'studentlist')) ? $_POST['studentlist'] : array();
|
||||||
|
|
||||||
if($_POST['action']=='add' && $tours_id != 0 && count($student_list)>0) {
|
if(get_value_from_array($_POST, 'action')=='add' && $tours_id != 0 && count($student_list)>0) {
|
||||||
// make sure the tour is valid
|
// make sure the tour is valid
|
||||||
if(!array_key_exists($tours_id, $tours)) {
|
if(!array_key_exists($tours_id, $tours)) {
|
||||||
/* Someone is hacking the POST */
|
/* Someone is hacking the POST */
|
||||||
@ -184,10 +184,10 @@ function switchinfo()
|
|||||||
$added,$j,$tours[$tours_id]['num'],$tours[$tours_id]['name'])));
|
$added,$j,$tours[$tours_id]['num'],$tours[$tours_id]['name'])));
|
||||||
}
|
}
|
||||||
|
|
||||||
$tours_id = intval($_GET['tours_id']);
|
$tours_id = intval(get_value_from_array($_GET, 'tours_id'));
|
||||||
$students_id = intval($_GET['students_id']);
|
$students_id = intval(get_value_from_array($_GET, 'students_id'));
|
||||||
|
|
||||||
if($_GET['action']=='del' && $tours_id>0 && $students_id>0) {
|
if(get_value_from_array($_GET, 'action')=='del' && $tours_id>0 && $students_id>0) {
|
||||||
$stmt = $pdo->prepare("DELETE FROM tours_choice
|
$stmt = $pdo->prepare("DELETE FROM tours_choice
|
||||||
WHERE students_id='$students_id'
|
WHERE students_id='$students_id'
|
||||||
AND year='{$config['FAIRYEAR']}'
|
AND year='{$config['FAIRYEAR']}'
|
||||||
@ -198,7 +198,7 @@ function switchinfo()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_GET['action']=="empty" && $tours_id>0)
|
if(get_value_from_array($_GET, 'action')=="empty" && $tours_id>0)
|
||||||
{
|
{
|
||||||
$stmt=$po->prepare("DELETE FROM tours_choice WHERE
|
$stmt=$po->prepare("DELETE FROM tours_choice WHERE
|
||||||
tour_id='$tours_id'
|
tour_id='$tours_id'
|
||||||
@ -212,7 +212,7 @@ function switchinfo()
|
|||||||
if(!$_SESSION['viewstate']['students_teams_list_show'])
|
if(!$_SESSION['viewstate']['students_teams_list_show'])
|
||||||
$_SESSION['viewstate']['students_teams_list_show']='unassigned';
|
$_SESSION['viewstate']['students_teams_list_show']='unassigned';
|
||||||
//now update the students_teams_list_show viewstate
|
//now update the students_teams_list_show viewstate
|
||||||
if($_GET['students_teams_list_show'])
|
if(get_value_from_array($_GET, 'students_teams_list_show'))
|
||||||
$_SESSION['viewstate']['students_teams_list_show']=$_GET['students_teams_list_show'];
|
$_SESSION['viewstate']['students_teams_list_show']=$_GET['students_teams_list_show'];
|
||||||
|
|
||||||
echo "<form name=\"tours\" method=\"post\" action=\"tours_assignments.php\">";
|
echo "<form name=\"tours\" method=\"post\" action=\"tours_assignments.php\">";
|
||||||
|
@ -28,7 +28,7 @@ ogram; see the file COPYING. If not, write to
|
|||||||
require_once("../config_editor.inc.php");
|
require_once("../config_editor.inc.php");
|
||||||
user_auth_required('committee', 'admin');
|
user_auth_required('committee', 'admin');
|
||||||
|
|
||||||
if($_GET['action']=="launch") {
|
if(get_value_from_array($_GET, 'action')=="launch") {
|
||||||
exec("nice php tours_sa.php >/dev/null 2>&1 &");
|
exec("nice php tours_sa.php >/dev/null 2>&1 &");
|
||||||
usleep(1000000); // 1 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(1000000); // 1 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: tours_sa_status.php");
|
header("Location: tours_sa_status.php");
|
||||||
@ -54,6 +54,7 @@ ogram; see the file COPYING. If not, write to
|
|||||||
function tours_check_tours()
|
function tours_check_tours()
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
global $pdo;
|
||||||
$q = $pdo->prepare("SELECT * FROM tours WHERE year='{$config['FAIRYEAR']}'");
|
$q = $pdo->prepare("SELECT * FROM tours WHERE year='{$config['FAIRYEAR']}'");
|
||||||
$q->execute();
|
$q->execute();
|
||||||
return $q->rowCount();
|
return $q->rowCount();
|
||||||
@ -62,6 +63,7 @@ ogram; see the file COPYING. If not, write to
|
|||||||
function tours_check_students()
|
function tours_check_students()
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
global $pdo;
|
||||||
$q=$pdo->prepare("SELECT students.id
|
$q=$pdo->prepare("SELECT students.id
|
||||||
FROM students
|
FROM students
|
||||||
LEFT JOIN tours_choice ON (tours_choice.students_id=students.id)
|
LEFT JOIN tours_choice ON (tours_choice.students_id=students.id)
|
||||||
@ -77,7 +79,7 @@ ogram; see the file COPYING. If not, write to
|
|||||||
return $q->rowCount();
|
return $q->rowCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_GET['action']=="reset") {
|
if(get_value_from_array($_GET, 'action')=="reset") {
|
||||||
$stmt = $pdo->prepare("UPDATE config SET `val`='-1' WHERE `var`='tours_assigner_percent' AND `year`=0");
|
$stmt = $pdo->prepare("UPDATE config SET `val`='-1' WHERE `var`='tours_assigner_percent' AND `year`=0");
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$config['tours_assigner_percent']=="-1";
|
$config['tours_assigner_percent']=="-1";
|
||||||
|
@ -403,7 +403,7 @@ function send_header($title="", $nav=null, $icon=null, $titletranslated=false)
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!-- <? if($title && !$titletranslated) echo i18n($title); else if($title) echo $title; else echo i18n($config['fairname']); ?> -->
|
<!-- <? if($title && !$titletranslated) echo i18n($title); else if($title) echo $title; else echo i18n($config['fairname']); ?> -->
|
||||||
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/jquery/1.3.2/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
|
||||||
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/jqueryui/1.7.2/jquery-ui.min.js"></script>
|
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/jqueryui/1.7.2/jquery-ui.min.js"></script>
|
||||||
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/sfiab.js"></script>
|
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/sfiab.js"></script>
|
||||||
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/tablesorter/jquery.tablesorter.min.js"></script>
|
<script type="text/javascript" src="<?=$config['SFIABDIRECTORY']?>/js/tablesorter/jquery.tablesorter.min.js"></script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user