示例#1
0
<?php

$roll = $this->objRollInfo;
//Get Politician IDs pertaining to user to display how their politicians voted
if (Session::get('user_logged_in') == true) {
    $user_politician_obj = new Leaders($_SESSION["user_state"], $_SESSION["user_district"]);
    //Find which chamber to determine which politician_ids to search for
    switch ($roll->chamber) {
        case 'senate':
            $user_politician_ids = $user_politician_obj->get_senator_ids();
            break;
        case 'house':
            $user_politician_ids = $user_politician_obj->get_representative_id();
            break;
    }
}
echo "<h2>" . ucfirst($roll->chamber) . " Vote " . $roll->roll_type . "</h2>";
echo "<hr>";
echo $roll->vote_type_description;
//If this vote is associated with a bill display the bill
if (!empty($roll->bill_id)) {
    $assoc_bill_info = new Bill($roll->bill_id);
    echo "<div class='associatedBillBox'>";
    echo "<h2>Associated Bill</h2>";
    echo "<span class='helpText'>This vote is associated with the following bill:</span><br />";
    echo "<a href='" . URL . "congress/bill/" . $assoc_bill_info->bill_id . "'>" . $assoc_bill_info->bill_type_display . $assoc_bill_info->number . " " . $assoc_bill_info->short_title . "</a>";
    echo "</div>";
}
echo "<div id='rollVote_info_myPoliticians_wrapper'>";
echo "<div id='rollVote_info'>";
echo "<h2>Important Information</h2><hr>";
 function get_senators_by_state($new_state)
 {
     $leaders = new Leaders($new_state);
     $arr_reps = $leaders->display_senators_state();
     return $arr_reps;
 }