SITE MAP   /   TEAM LOGIN  

 
"; } } function dbcon() { require_once('bills/config.php'); //DB connect mysql_connect($DBHost, $DBUser, $DBPass) or die("Database Connection Error: Please Contact the CCSReg Web Administrator."); mysql_select_db($DBName); } ?>

  State CCS Policy

  navigation

"Alabama", 'AK'=>"Alaska", 'AZ'=>"Arizona", 'AR'=>"Arkansas", 'CA'=>"California", 'CO'=>"Colorado", 'CT'=>"Connecticut", 'DE'=>"Delaware", 'FL'=>"Florida", 'GA'=>"Georgia", 'HI'=>"Hawaii", 'ID'=>"Idaho", 'IL'=>"Illinois", 'IN'=>"Indiana", 'IA'=>"Iowa", 'KS'=>"Kansas", 'KY'=>"Kentucky", 'LA'=>"Louisiana", 'ME'=>"Maine", 'MD'=>"Maryland", 'MA'=>"Massachusetts", 'MI'=>"Michigan", 'MN'=>"Minnesota", 'MS'=>"Mississippi", 'MO'=>"Missouri", 'MT'=>"Montana", 'NE'=>"Nebraska", 'NV'=>"Nevada", 'NH'=>"New Hampshire", 'NJ'=>"New Jersey", 'NM'=>"New Mexico", 'NY'=>"New York", 'NC'=>"North Carolina", 'ND'=>"North Dakota", 'OH'=>"Ohio", 'OK'=>"Oklahoma", 'OR'=>"Oregon", 'PA'=>"Pennsylvania", 'RI'=>"Rhode Island", 'SC'=>"South Carolina", 'SD'=>"South Dakota", 'TN'=>"Tennessee", 'TX'=>"Texas", 'UT'=>"Utah", 'VT'=>"Vermont", 'VA'=>"Virginia", 'WA'=>"Washington", 'WV'=>"West Virginia", 'WI'=>"Wisconsin", 'WY'=>"Wyoming" ); $policy_types = array( //Main array of components/policy types 'Sequestration' => array( 'S_SSP' => 'Sequestration Site Permitting', 'S_PR' => 'Property Rights', 'S_LTS' => 'Long Term Stewardship', 'S_EOR' => 'EOR Status', 'S_GGA' => 'Greenhouse Gas Accounting', 'S_TI' => 'Tax Incentive', 'S_RI' => 'Regulatory Incentive', 'S_PSM' => 'Portfolio Standard or Mandate', 'S_STU' => 'Study' ), 'Transportation' => array( 'T_RA' => 'Regulatory Authority', 'T_FR' => 'Form of Regulation', 'T_I' => 'Incentive' ), 'Capture' => array( 'C_TI' => 'Tax Incentive', 'C_RI' => 'Regulatory Incentive', 'C_PSM' => 'Portfolio Standard or Mandate' ) ); $policy_t = array( //single letter abbreviations for policy types 'S' => 'Sequestration', 'T' => 'Transportation', 'C' => 'Capture' ); function list_query($inState = '',$inComponent = '',$inPolicy = '',$inOrder = 'policy_title') { //Constructs select query based on given search arguments for various criteria. $out = 'SELECT policy_title, id, state FROM bills WHERE '; if($inState) { //If state is specified... $search[] = "state = '$inState'"; } if($inComponent) { //if component is specified... switch($inComponent) { case 's' : { $search[] = "s_component = 1"; break; } case 't' : { $search[] = "t_component = 1"; break; } case 'c' : { $search[] = "t_component = 1"; break; } } } if($inPolicy) { //if component is specified.... $search[] = "(c_policy_type LIKE '%$inPolicy%' OR s_policy_type LIKE '%$inPolicy%' OR t_policy_type LIKE '%$inPolicy%')"; } $out .= implode(' AND ',$search) . " AND pending=0 ORDER by $inOrder"; //concat all search criteria and append order //echo $out; return $out; } function db_query($tableName,$edit = 0) { //Pulls list of columns from specified table, updates each one global $insert_id; $result = mysql_query("DESCRIBE $tableName"); while ($row = mysql_fetch_row($result)) { //Create array of fields names with exception of ID and last_updated (must not be specified, or even null value, to autoudpate) if ($row[0] != 'id' && $row[0] != 'last_updated') { $fields[] = $row[0]; } } if ($edit) { //If edit flag set, use UPDATE query $query = "UPDATE $tableName SET "; foreach($fields as $f) { //through all fields, add to query $query_arr[] = "$f = '$_POST[$f]'"; } $query .= implode(', ',$query_arr) . " WHERE id = '$insert_id' LIMIT 1"; } else { //otherwise, use INSERT query $query = "INSERT INTO $tableName VALUES ('$insert_id'"; foreach($fields as $f) { //through all fields, add to query $query .= ", '$_POST[$f]'"; } if ($tableName == 'bills') { //Add DEFAULT for timestamp field at end $query .= ', DEFAULT'; } $query .= ')'; } // echo "
Query: $query
"; mysql_query($query); if (mysql_error()) echo "
Error:" . mysql_error() . "
"; if ($tableName == 'bills' && !$edit) { //If inserting into bills (new bill) then retail insert_id for use as primary/foreign key on sub tables $insert_id = mysql_insert_id(); } } function nbsp($in) //Fills in   for empty table cells or X's. I'm sure there was some logic to this. { if($in == 1) { return 'X'; } else { return ($in) ? $in : ' '; } } function clean_input($in) //sanitizes input for mysql { return trim(mysql_real_escape_string($in)); } $table_exceptions = array( //Columns to leave out of table display 'S_GGA', 'S_STU', 'S_PSM' ); function displayfield($fname,$class='style13') { //outputs table row if input field name has data global $bill,$fields; if ($bill[$fname]) { if (strpos($fname,'_website')) $bill[$fname] = 'Link'; echo "
$fields[$fname]:$bill[$fname]