diff --git a/admin/registration_stats.php b/admin/registration_stats.php index 9477767..2f20fa7 100644 --- a/admin/registration_stats.php +++ b/admin/registration_stats.php @@ -97,7 +97,8 @@ else $wherestatus=""; projects.title, projects.projectnumber, projects.projectcategories_id, - projects.projectdivisions_id + projects.projectdivisions_id, + projects.language FROM registrations left outer join projects on projects.registrations_id=registrations.id @@ -118,7 +119,9 @@ else $wherestatus=""; $stats_projects_catdiv=array(); $stats_students_schools=array(); $stats_projects_schools=array(); + $stats_projects_lang=array(); $schools_names=array(); + $languages=array(); while($r=mysql_fetch_object($q)) { @@ -126,6 +129,8 @@ else $wherestatus=""; $stats_divisions[$r->projectdivisions_id]++; $stats_categories[$r->projectcategories_id]++; $stats_projects_catdiv[$r->projectcategories_id][$r->projectdivisions_id]++; + $stats_projects_lang[$r->projectcategories_id][$r->projectdivisions_id][$r->language]++; + $languages[$r->language]++; switch($r->status) { @@ -257,6 +262,70 @@ else $wherestatus=""; echo i18n("%1 schools total",array(count($schools_names))); echo ""; + echo "
"; + echo "

{$status_str[$showstatus]} - ".i18n("Projects per age category / division / language")."

"; + echo ""; + echo ""; + echo ""; + foreach($cats AS $c=>$cn) { + echo ""; + } + echo ""; + echo ""; + ksort($languages); + $tprojcat = array(); + foreach($cats AS $c=>$cn) { + foreach($languages AS $l=>$ln) { + echo ""; + } + } + foreach($languages AS $l=>$ln) { + echo ""; + } + echo ""; + foreach($divs AS $d=>$dn) { + echo ""; + $tproj=array(); + foreach($cats AS $c=>$cn) + { + foreach($languages AS $l=>$ln) { + echo ""; + $tproj[$l]+=$stats_projects_lang[$c][$d][$l]; + + $tprojcat[$c][$l]+=$stats_projects_lang[$c][$d][$l]; + } + } + foreach($tproj AS $l=>$ln) { + echo ""; + } + echo ""; + } + echo ""; + $tproj=array(); + foreach($cats AS $c=>$cn) { + foreach($languages AS $l=>$ln) { + echo ""; + $tproj[$l]+=$tprojcat[$c][$l]; + } + } + foreach($tproj AS $l=>$ln) { + echo ""; + } + echo ""; + + + echo "
$cn".i18n("Total")."
$l$l
$dn"; + echo ($stats_projects_lang[$c][$d][$l]?$stats_projects_lang[$c][$d][$l]:0); + echo ""; + echo ($ln?$ln:0); + echo "
".i18n("Total").""; + echo ($tprojcat[$c][$l]?$tprojcat[$c][$l]:0); + echo ""; + echo ($ln); + echo "
"; + + echo ""; + echo ""; echo "
";