Plumb in Matt's PHP template.

This commit is contained in:
Kim Taylor
2024-09-17 22:19:24 +10:00
parent 1412c268b5
commit 2e444113c8
3 changed files with 235 additions and 21 deletions

View File

@@ -1,6 +1,7 @@
<?php
require_once("parse_pledge_data.php");
require_once("page_renderer.php");
$options = getopt("", ["candidates-files:"]);
@@ -18,27 +19,14 @@ $pledgeCandidates = array_filter($candidate_data, function ($candidate) {
return $candidate['Pledge'] === 'y';
});
print_r($pledgeCandidates);
$renderer = new SPLPageRenderer();
//print_r($pledgeCandidates);
/* Select 9 random candidates */
//$pledgeKeys = array_rand($pledgeCandidates, 9);
//shuffle($pledgeKeys);
//
//$i = 0;
//foreach ($pledgeKeys as $key) {
// $image_url = $pledgeCandidates[$key]['image_url'];
// $image_id = $pledgeCandidates[$key]['image_id'];
//
// echo "s|pledge_img_".$i."|".$image_url."|\n";
// echo "s|pledge_id_".$i."|".$image_id."|\n";
//
// echo "s|pledge_string_".$i."|";
// echo $pledgeCandidates[$key]['Candidate Name'].
// " (".
// $pledgeCandidates[$key]['Council'].
// ") has taken the pledge!|\n";
//
// $i++;
//}
$pageContent = $renderer->renderPledgePage($councilData, $candidateData, $mediaData);
if ($pageContent === null) {
exit(2);
}
echo $pageContent;
exit(0);