HEX
Server: Apache
System: Linux www3.pit.tblive.com 5.14.0-687.38.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 12 17:19:12 EDT 2026 x86_64
User: awaldron (1020)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //home/awaldron/public_html/archive/voting_data/2014.php
<?php
	
$dat14 = file('2014.dat');

$i=-1;
$dat = array();

foreach ($dat14 as $l) {
	if (strstr($l, "PENN HILLS WARD")) {
		if ($i >= 0) {
			$dat[$i]['turnout'] = number_format(($dat[$i]['ballots'] / $dat[$i]['voters'] * 100), 2);
			$dat[$i]['dem_pct'] = number_format(($dat[$i]['straight_dem'] / $dat[$i]['voters'] * 100), 2);
			$dat[$i]['rep_pct'] = number_format(($dat[$i]['straight_rep'] / $dat[$i]['voters'] * 100), 2);
		}
		$i++;
		$dat[$i]['ward'] = substr($l,26,13);
	}
	if (strstr($l, "REGISTERED VOTERS - TOTAL")) {
		$dat[$i]['voters'] = intval(substr($l,57,3));
	}
	if (strstr($l, "BALLOTS CAST - TOTAL")) {
		$dat[$i]['ballots'] = intval(substr($l,57,3));
	}
	if (strstr($l, "Democratic (DEM)")) {
		$dat[$i]['straight_dem'] = intval(substr($l,57,3));
	}
	if (strstr($l, "Republican (REP)")) {
		$dat[$i]['straight_rep'] = intval(substr($l,57,3));
	}
	
}

$totals = array();

foreach ($dat as $d) {
	$totals['voters'] += $d['voters'];
	$totals['ballots'] += $d['ballots'];
	$totals['straight_dem'] += $d['straight_dem'];
	$totals['straight_rep'] += $d['straight_rep'];
}

$totals['turnout'] = number_format(($totals['ballots'] / $totals['voters'] * 100), 2);
$totals['dem_pct'] = number_format(($totals['straight_dem'] / $totals['voters'] * 100), 2);
$totals['rep_pct'] = number_format(($totals['straight_rep'] / $totals['voters'] * 100), 2);
echo '<pre>', print_r($totals), '</pre>';

?>