$db->query("SELECT DISTINCT type, COUNT(*) AS cnt FROM categories GROUP BY type"); while ($db->next_record()) { $type = $db->f("type"); if ($db->f("cnt") > 0 && $type != "Contact") { stats_subtitle($t->translate("Contact Category") . " " . $type); $dbtot = new DB_SourceContact(); $dbtot->query("SELECT COUNT(*) FROM contact WHERE category='{$type}'"); $dbtot->next_record(); $total_number_cat = $dbtot->f("COUNT(*)"); $db2 = new DB_SourceContact(); $db2->query("SELECT class, COUNT(*) AS cnt2 FROM classifications WHERE type='{$type}' GROUP BY class"); while ($db2->next_record()) { $cnt2 = $db2->f("cnt2"); if ($cnt2 > 0) { $url = "index.php"; $urlquery = array("by" => "filter", "class" => $db2->f("class")); stats_display($db2->f("class"), $cnt2, $url, $urlquery, $total_number_cat); } } } } stats_end(); break; } } ?> <!-- end content --> <?php require "./include/footer.inc"; page_close();
} stats_end(); break; // Developers by Countries currently live in // Developers by Countries currently live in case "lives_in": stats_title($t->translate("Developers listed by Countries currently live in")); $db->query("SELECT *,COUNT(*) AS nat_cnt FROM developers GROUP BY developers.actual_country ORDER BY nat_cnt DESC"); while ($db->next_record()) { stats_display(get_country($db->f("actual_country")), $db->f("nat_cnt"), "", "", $total_number_dev); } stats_end(); break; // Developers by Mother Tonque // Developers by Mother Tonque case "mother_tonque": stats_title($t->translate("Developers listed by Mother Tongue")); $db->query("SELECT *,COUNT(*) AS nat_cnt FROM developers GROUP BY developers.mother_tongue ORDER BY nat_cnt DESC"); while ($db->next_record()) { stats_display(get_lang($db->f("mother_tongue")), $db->f("nat_cnt"), "", "", $total_number_dev); } stats_end(); break; } } ?> <!-- end content --> <?php require "./include/footer.inc"; page_close();
while ($db->next_record()) { // We need a second database connection $db2 = new DB_SourceWell(); // Total number of apps with that License $license = $db->f("license"); $db2->query("SELECT COUNT(*) FROM software WHERE license='{$license}'"); $db2->next_record(); $total = $db2->f("COUNT(*)"); if ($total > $Minimum_apps_in_license) { stats_subtitle($db->f("license")); for ($i = 1; $i < sizeof($domain_country); $i++) { $like = "%." . $domain_country[$i][0]; $db2->query("SELECT COUNT(*) FROM software WHERE license='{$license}' AND email LIKE '{$like}'"); $db2->next_record(); $num = $db2->f("COUNT(*)"); if (100 * $num / $total > $MinimumLicByEmail) { stats_display($domain_country[$i][1], $num, $url, $urlquery, $total); } } } } stats_end(); break; } } ?> <!-- end content --> <?php require "./include/footer.inc"; @page_close();