Index: trunk/extensions/CongressLookup/SpecialCongressLookup.php |
— | — | @@ -46,6 +46,10 @@ |
47 | 47 | $myRepresentative = CongressLookupDB::getRepresentative( $zip ); |
48 | 48 | $mySenators = CongressLookupDB::getSenators( $zip ); |
49 | 49 | |
| 50 | + //TODO: Change this so it looks like... anything. |
| 51 | + $wgOut->addHTML( '<pre>' . print_r( $myRepresentative, true ) . '</pre>' ); |
| 52 | + $wgOut->addHTML( '<pre>' . print_r( $mySenators, true ) . '</pre>' ); |
| 53 | + |
50 | 54 | // TODO: stuffz. |
51 | 55 | } |
52 | 56 | |
Index: trunk/extensions/CongressLookup/CongressLookup.db.php |
— | — | @@ -18,7 +18,40 @@ |
19 | 19 | |
20 | 20 | $row = $dbr->selectRow( 'cl_zip5', 'sz5_rep_id', array( 'sz5_zip' => $zip ) ); |
21 | 21 | if ( $row ) { |
22 | | - // TODO: stuffz. |
| 22 | + $rep_id = $row->sz5_rep_id; |
| 23 | + $res = $dbr->select( |
| 24 | + 'cl_house', |
| 25 | + array( |
| 26 | + 'sh_bioguideid', |
| 27 | + 'sh_gender', |
| 28 | + 'sh_name', |
| 29 | + 'sh_title', |
| 30 | + 'sh_state', |
| 31 | + 'sh_district', |
| 32 | + 'sh_phone', |
| 33 | + 'sh_fax', |
| 34 | + 'sh_contactform' |
| 35 | + ), |
| 36 | + array( |
| 37 | + 'sh_id' => $rep_id, |
| 38 | + ), |
| 39 | + __METHOD__ |
| 40 | + ); |
| 41 | + foreach ( $res as $row ) { |
| 42 | + $oneHouseRep = array( |
| 43 | + 'bioguideid' => $row->sh_bioguideid, |
| 44 | + 'gender' => $row->sh_gender, |
| 45 | + 'name' => $row->sh_name, |
| 46 | + 'title' => $row->sh_title, |
| 47 | + 'state' => $row->sh_state, |
| 48 | + 'district' => $row->sh_district, |
| 49 | + 'phone' => $row->sh_phone, |
| 50 | + 'fax' => $row->sh_fax, |
| 51 | + 'contactform' => $row->sh_contactform |
| 52 | + ); |
| 53 | + $repData[] = $oneHouseRep; |
| 54 | + } |
| 55 | + //$repData = $row; |
23 | 56 | } |
24 | 57 | return $repData; |
25 | 58 | } |
— | — | @@ -37,7 +70,7 @@ |
38 | 71 | |
39 | 72 | $row = $dbr->selectRow( 'cl_zip3', 'sz3_state', array( 'sz3_zip' => $zip ) ); |
40 | 73 | if ( $row ) { |
41 | | - $state = $row->state; |
| 74 | + $state = $row->sz3_state; |
42 | 75 | $res = $dbr->select( |
43 | 76 | 'cl_senate', |
44 | 77 | array( |