Index: trunk/extensions/CongressLookup/SpecialCongressLookup.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | |
31 | 31 | if ( $zip ) { |
32 | 32 | $zip = $this->trimZip( $zip ); |
33 | | - showMatches( $zip ); |
| 33 | + $this->showMatches( $zip ); |
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
— | — | @@ -43,8 +43,8 @@ |
44 | 44 | |
45 | 45 | $myRepresentative = array(); |
46 | 46 | $mySenators = array(); |
47 | | - $myRepresentative = CongressLookupDB->getRepresentative(); |
48 | | - $mySenators = CongressLookupDB->getSenators(); |
| 47 | + $myRepresentative = CongressLookupDB::getRepresentative( $zip ); |
| 48 | + $mySenators = CongressLookupDB::getSenators( $zip ); |
49 | 49 | |
50 | 50 | // TODO: stuffz. |
51 | 51 | } |
Index: trunk/extensions/CongressLookup/CongressLookup.db.php |
— | — | @@ -12,10 +12,10 @@ |
13 | 13 | public static function getRepresentative( $zip ) { |
14 | 14 | $dbr = wfGetDB( DB_SLAVE ); |
15 | 15 | |
16 | | - $zip = $this->trimZip( $zip, 5 ); // Trim it to 5 digit |
| 16 | + $zip = self::trimZip( $zip, 5 ); // Trim it to 5 digit |
17 | 17 | $zip = intval( $zip ); // Convert into an integer |
18 | 18 | |
19 | | - $row = $dbr->selectRow( 'cl_zip5', 'rep_id', array( 'zip' => $zip ) ); |
| 19 | + $row = $dbr->selectRow( 'cl_zip5', 'sz5_rep_id', array( 'sz5_zip' => $zip ) ); |
20 | 20 | if ( $row ) { |
21 | 21 | // TODO: stuffz. |
22 | 22 | } |
— | — | @@ -29,10 +29,10 @@ |
30 | 30 | public static function getSenators( $zip ) { |
31 | 31 | $dbr = wfGetDB( DB_SLAVE ); |
32 | 32 | |
33 | | - $zip = $this->trimZip( $zip, 3 ); // Trim it to 3 digit |
| 33 | + $zip = self::trimZip( $zip, 3 ); // Trim it to 3 digit |
34 | 34 | $zip = intval( $zip ); // Convert into an integer |
35 | 35 | |
36 | | - $row = $dbr->selectRow( 'cl_zip3', 'state', array( 'zip' => $zip ) ); |
| 36 | + $row = $dbr->selectRow( 'cl_zip3', 'sz3_state', array( 'sz3_zip' => $zip ) ); |
37 | 37 | if ( $row ) { |
38 | 38 | // TODO: stuffz. |
39 | 39 | } |