forgot to include these 2 files in the previous regisration commit

This commit is contained in:
Muad Sakah 2025-02-07 03:57:54 +00:00
parent 2a8bb8209f
commit e3d16a4c57
2 changed files with 27 additions and 26 deletions

View File

@ -444,7 +444,9 @@ function list_query($year, $wherestatus, $reg_id)
$fair = "AND projects.fairs_id='{$_SESSION['fairs_id']}'"; $fair = "AND projects.fairs_id='{$_SESSION['fairs_id']}'";
} }
$q = $pdo->prepare("SELECT registrations.id AS reg_id, $q = $pdo->prepare("
SELECT
registrations.id AS reg_id,
registrations.num AS reg_num, registrations.num AS reg_num,
registrations.status, registrations.status,
registrations.email, registrations.email,
@ -456,18 +458,17 @@ function list_query($year, $wherestatus, $reg_id)
projects.flagged projects.flagged
FROM FROM
registrations registrations
left outer join projects on projects.registrations_id=registrations.id LEFT OUTER JOIN projects ON projects.registrations_id = registrations.id
WHERE WHERE
1 registrations.year = ?
AND registrations.year=? AND registrations.status = ?
? AND registrations.num = ?
? ? AND registrations.fair = ?
ORDER BY ORDER BY
registrations.status DESC, projects.title registrations.status DESC, projects.title ");
");
$q->execute([$year, $wherestatus, $reg, $fair]); $q->execute([$year, $wherestatus, $reg, $fair]);
// FIXME // FIXME
show_pdo_errors_if_any($pdo); show_pdo_errors_if_any($pdo);
return $q; return $q;

View File

@ -133,12 +133,12 @@ $q = $pdo->prepare("SELECT registrations.id AS reg_id,
left outer join projects on projects.registrations_id=registrations.id left outer join projects on projects.registrations_id=registrations.id
WHERE WHERE
1 1
AND registrations.year=? AND registrations.year=?,
? $wherestatus
ORDER BY ORDER BY
? $ORDERBY
"); ");
$q->execute([$year,$wherestatus,$ORDERBY]); $q->execute([$year]);
show_pdo_errors_if_any($pdo); show_pdo_errors_if_any($pdo);
$stats_totalprojects = 0; $stats_totalprojects = 0;