diff --git a/deploy/generate-menu.php b/deploy/generate-menu.php new file mode 100644 index 00000000..40d15886 --- /dev/null +++ b/deploy/generate-menu.php @@ -0,0 +1,59 @@ +connect_mysqli(); + +/* + * Get a list of all legislators. + */ +$sql = 'SELECT name_formatted, shortname, chamber + FROM representatives + WHERE date_ended IS NOT NULL OR date_ended >= now() + ORDER BY chamber ASC, name ASC'; +$result = mysqli_query($db, $sql); + +$legislators = array('house' => array(), 'senate' => array()); + +/* + * Build up an HTML-formatted array of legislators by chamber. + */ +while ($legislator = mysqli_fetch_assoc($result)) +{ + + $legislator = array_map('stripslashes', $legislator); + $legislators[$legislator{'chamber'}][] = '