From 566c5aecffa192180f50ab8904fa05a206886b4e Mon Sep 17 00:00:00 2001 From: dave Date: Thu, 23 Apr 2009 04:38:29 +0000 Subject: [PATCH] - Fix some of the stats reporting --- admin/fair_stats.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/admin/fair_stats.php b/admin/fair_stats.php index acc88ce..c544a2e 100644 --- a/admin/fair_stats.php +++ b/admin/fair_stats.php @@ -91,13 +91,14 @@ } + if($_POST['action']=="sendstats" && $_POST['xml']) { if(function_exists('curl_init')) { - $r = curl_query($fair, $_POST['xml']); - if($r['error'][0] == 0) - echo happy(i18n("The %1 Server said:", array($fair['name'])).' '.$r['message'][0]); - else - echo error(i18n("The %1 Server said:", array($fair['name'])).' '.$r['message'][0]); +// $r = curl_query($fair, $_POST['xml']); +// if($r['error'][0] == 0) +// echo happy(i18n("The %1 Server said:", array($fair['name'])).' '.$r['message'][0]); +// else +// echo error(i18n("The %1 Server said:", array($fair['name'])).' '.$r['message'][0]); $fairs_id = -1; $year = $config['FAIRYEAR']; } else { @@ -160,7 +161,7 @@ } foreach($server_config as $k=>$v) { - $server_config[$k] = $data['statconfig'][0][$k][0]; +//$server_config[$k] = $data['statconfig'][0][$k][0]; } /* Gather all stats, then we'll decide what to send */ @@ -190,19 +191,19 @@ AND registrations.year='$year' AND (registrations.status='complete' OR registrations.status='paymentpending')"); $stats['schools_active']=mysql_num_rows($q); - $stats['students_public'] = 0; - $stats['students_private'] = 0; + $stats['schools_public'] = 0; + $stats['schools_private'] = 0; $stats['schools_atrisk'] = 0; $districts = array(); while($si=mysql_fetch_assoc($q)) { if($si['designate'] == 'public') - $stats['students_public']++; + $stats['schools_public']++; if($si['designate'] == 'independent') - $stats['students_private']++; + $stats['schools_private']++; if($si['atrisk'] == 'yes') $stats['schools_atrisk']++; $bd = $si['board'].'~'.$si['district']; - if(!in_array($db, $districts)) $districts[] =$bd; + if(!in_array($bd, $districts)) $districts[] =$bd; } $stats['schools_districts'] = count($districts); @@ -329,6 +330,9 @@ echo i18n('At-risk/inner city schools: %1 (%2 students).',array( $stats['schools_atrisk'], $stats['students_atrisk'])); echo '
'; + echo i18n('Number of school boards/distrcits: %1',array( + $stats['schools_districts'])); + echo '
'; echo '
'; echo '
'; }