forked from science-ation/science-ation
commiting all judging files with database line changes/fixes
This commit is contained in:
parent
8f05b7e4cb
commit
5776e10151
@ -105,8 +105,8 @@ if ($id < 1) {
|
|||||||
// get their availability
|
// get their availability
|
||||||
$availabilityText = '';
|
$availabilityText = '';
|
||||||
if ($config['judges_availability_enable'] == 'yes') {
|
if ($config['judges_availability_enable'] == 'yes') {
|
||||||
$q = $pdo->prepare("SELECT * FROM judges_availability WHERE users_id=\"?\" ORDER BY `start`");
|
$q = $pdo->prepare("SELECT * FROM judges_availability WHERE users_id=? ORDER BY `start`");
|
||||||
$q->execute([$judgeinfo['id']]);
|
$q->execute([$judgeinfo['id']]);
|
||||||
$sel = array();
|
$sel = array();
|
||||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||||
$st = substr($r->start, 0, 5);
|
$st = substr($r->start, 0, 5);
|
||||||
@ -131,9 +131,9 @@ if ($judgeinfo['special_award_only'] == 'yes') {
|
|||||||
$query = 'SELECT aa.name AS awardname FROM judges_specialaward_sel jss'
|
$query = 'SELECT aa.name AS awardname FROM judges_specialaward_sel jss'
|
||||||
. ' JOIN users ON jss.users_id = users.id'
|
. ' JOIN users ON jss.users_id = users.id'
|
||||||
. ' JOIN award_awards aa ON aa.id = jss.award_awards_id'
|
. ' JOIN award_awards aa ON aa.id = jss.award_awards_id'
|
||||||
. ' WHERE users.id=' . $id;
|
. ' WHERE users.id=?';
|
||||||
$results = $pdo->prepare($query);
|
$results = $pdo->prepare($query);
|
||||||
$results->execute();
|
$results->execute([$id]);
|
||||||
while ($record = $results . fetch()) {
|
while ($record = $results . fetch()) {
|
||||||
$awardList[] = $record['awardname'];
|
$awardList[] = $record['awardname'];
|
||||||
}
|
}
|
||||||
|
@ -725,11 +725,9 @@ function judge_team_create($num, $name)
|
|||||||
function judge_team_add_judge($team_id, $users_id)
|
function judge_team_add_judge($team_id, $users_id)
|
||||||
{
|
{
|
||||||
global $config, $judges;
|
global $config, $judges;
|
||||||
$stmt = $pdo->prepare("INSERT INTO judges_teams_link
|
$stmt = $pdo->prepare("INSERT INTO judges_teams_link (users_id, judges_teams_id, captain, year) VALUES (?, ?, ?, ?)");
|
||||||
\t (users_id,judges_teams_id,captain,year)
|
$stmt->execute([$users_id, $team_id, $judges[$users_id]['willing_chair'], $config['FAIRYEAR']]);
|
||||||
\t VALUES (?,?,?,
|
|
||||||
?)");
|
|
||||||
$stmt->execute([$users_id,$team_id,$judges[$users_id]['willing_chair'],$config['FAIRYEAR']]);
|
|
||||||
show_pdo_errors_if_any($pdo);
|
show_pdo_errors_if_any($pdo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1620,18 +1618,10 @@ for ($k = 0; $k < $keys_count; $k++) {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* if jteam_id isn't 0, instert it into the db */
|
/* if jteam_id isn't 0, instert it into the db */
|
||||||
$stmt = $pdo->prepare('INSERT INTO judges_teams_timeslots_link '
|
$stmt = $pdo->prepare('INSERT INTO judges_teams_timeslots_link (judges_teams_id,judges_timeslots_id,year) VALUES (?,?,?)');
|
||||||
. ' (judges_teams_id,judges_timeslots_id,year)'
|
|
||||||
. " VALUES (?, "
|
|
||||||
. " ?, "
|
|
||||||
. " ?)");
|
|
||||||
$stmt->execute([$jteam[$jteam_id]['team_id'],$available_timeslots[$y]['id'],$config['FAIRYEAR']]);
|
$stmt->execute([$jteam[$jteam_id]['team_id'],$available_timeslots[$y]['id'],$config['FAIRYEAR']]);
|
||||||
|
|
||||||
$stmt = $pdo->prepare('INSERT INTO judges_teams_timeslots_projects_link '
|
$stmt = $pdo->prepare('INSERT INTO judges_teams_timeslots_projects_link (judges_teams_id,judges_timeslots_id,projects_id,year) VALUES (?,?,?,?)');
|
||||||
. ' (judges_teams_id,judges_timeslots_id,projects_id,year) '
|
|
||||||
. " VALUES (?, "
|
|
||||||
. " ?, "
|
|
||||||
. " ?,?)");
|
|
||||||
$stmt->execute([$jteam[$jteam_id]['team_id'],$available_timeslots[$y]['id'],$pid,$config['FAIRYEAR']]);
|
$stmt->execute([$jteam[$jteam_id]['team_id'],$available_timeslots[$y]['id'],$pid,$config['FAIRYEAR']]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
@ -188,9 +188,15 @@ if ($action == 'savemultiple') {
|
|||||||
$tt = $duration + $break;
|
$tt = $duration + $break;
|
||||||
|
|
||||||
for ($x = 0; $x < $addnum; $x++) {
|
for ($x = 0; $x < $addnum; $x++) {
|
||||||
$q = $pdo->prepare("SELECT \tDATE_ADD(? ?:?:00', INTERVAL ? MINUTE) AS endtime,
|
$q = $pdo->prepare("SELECT
|
||||||
DATE_ADD(? ?:?:00', INTERVAL ? MINUTE) AS startnext ");
|
DATE_ADD(?, INTERVAL ? MINUTE) AS endtime,
|
||||||
$q->execute([$date,$hr,$min,$duration,$date,$hr,$min,$tt]);
|
DATE_ADD(?, INTERVAL ? MINUTE) AS startnext");
|
||||||
|
|
||||||
|
$q->execute([
|
||||||
|
"$date $hr:$min:00", $duration,
|
||||||
|
"$date $hr:$min:00", $tt
|
||||||
|
]);
|
||||||
|
|
||||||
show_pdo_errors_if_any($pdo);
|
show_pdo_errors_if_any($pdo);
|
||||||
$r = $q->fetch(PDO::FETCH_OBJ);
|
$r = $q->fetch(PDO::FETCH_OBJ);
|
||||||
list($ed, $et) = split(' ', $r->endtime);
|
list($ed, $et) = split(' ', $r->endtime);
|
||||||
|
@ -51,9 +51,9 @@ if ($_GET['projectid']) {
|
|||||||
$score_error = '*** ERROR **** You entered a value greater than 100.00';
|
$score_error = '*** ERROR **** You entered a value greater than 100.00';
|
||||||
}
|
}
|
||||||
$stmt = $pdo->prepare("UPDATE judges_teams_timeslots_projects_link
|
$stmt = $pdo->prepare("UPDATE judges_teams_timeslots_projects_link
|
||||||
\t \t\t\t\t\tSET score=?"
|
SET score=?
|
||||||
. ' WHERE judges_teams_id =?'
|
WHERE judges_teams_id =?
|
||||||
. " and projects_id =? and year=?");
|
and projects_id =? and year=?");
|
||||||
$stmt->execute([$score,$_POST['team_' . $curr_team . '_id'],$project_id,$year]);
|
$stmt->execute([$score,$_POST['team_' . $curr_team . '_id'],$project_id,$year]);
|
||||||
show_pdo_errors_if_any($pdo);
|
show_pdo_errors_if_any($pdo);
|
||||||
}
|
}
|
||||||
|
@ -102,14 +102,14 @@ if ($_GET['csv'] != 'yes') {
|
|||||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||||
if ($_GET['csv'] == 'yes') {
|
if ($_GET['csv'] == 'yes') {
|
||||||
echo "$r->projectnumber \t ? \t ? \t ? \t ? \t ? ";
|
echo "$r->projectnumber \t ? \t ? \t ? \t ? \t ? ";
|
||||||
$p = $pdo->prepare("SELECT judges_teams_timeslots_projects_link.judges_teams_id,
|
$p = $pdo->prepare("SELECT judges_teams_timeslots_projects_link.judges_teams_id, score, judges_teams.num
|
||||||
\t \t\t\t\t score,
|
FROM judges_teams_timeslots_projects_link, judges_teams
|
||||||
\t judges_teams.num
|
WHERE judges_teams_timeslots_projects_link.judges_teams_id = judges_teams.id
|
||||||
\t FROM judges_teams_timeslots_projects_link,
|
AND projects_id = ?
|
||||||
\t judges_teams
|
ORDER BY judges_teams_id");
|
||||||
\t WHERE judges_teams_timeslots_projects_link.judges_teams_id = judges_teams.id
|
|
||||||
\t AND projects_id =? ORDER BY judges_teams_id");
|
$p->execute([$r->title, $cats[$r->projectcategories_id], $divs[$r->projectdivisions_id], $r->score, $r->norm_score, $r->projectid]);
|
||||||
$p->execute([$r->title,$cats[$r->projectcategories_id] ,$divs[$r->projectdivisions_id],$r->score,$r->norm_score,$r->projectid]);
|
|
||||||
show_pdo_errors_if_any($pdo);
|
show_pdo_errors_if_any($pdo);
|
||||||
while ($s = $p->fetch(PDO::FETCH_OBJ)) {
|
while ($s = $p->fetch(PDO::FETCH_OBJ)) {
|
||||||
$team = getJudgingTeam($s->judges_teams_id);
|
$team = getJudgingTeam($s->judges_teams_id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user