blob: bbc8eb27649d53a29b6368a1751157cca532ce48 [file] [log] [blame]
<?php
header('Content-type: text/plain');
?>
Number of committers by location:
<?php
include "/home/data/httpd/eclipse-php-classes/system/dbconnection_foundation_ro.class.php";
$_dbc = new DBConnectionFoundation();
$_dbh = $_dbc->connect();
$query = "select DISTINCT PeopleProjects.PersonID, City, ProvStateRegion, CCode
FROM PeopleProjects, PeopleAddresses
WHERE PeopleProjects.PersonID = PeopleAddresses.PersonID
AND PeopleProjects.Relation = 'CM'
AND PeopleProjects.InactiveDate IS NULL
";
$result = mysql_query($query,$_dbh);
$locations = array();
if (!$result) {
echo("MySQL Error: ".mysql_error());
} else {
while( $row = mysql_fetch_assoc($result) ) {
$loc = $row['ProvStateRegion'] . ',' . $row['CCode'];
if( isset($locations[$loc]) ) {
$locations[$loc] = $locations[$loc] + 1;
} else {
$locations[$loc] = 1;
}
}
ksort( $locations );
foreach( $locations as $key => $value ) {
echo "$key\t$value\n";
}
}
?>
EOD