$cnt2 = $db2->f("cnt2"); if ($cnt2 > 0) { $url = "index.php"; $urlquery = array("by" => "filter", "class" => $category); stats_display($db1->f("category"), $cnt2, $url, $urlquery, $total_number_cat); } } } } } stats_end(); break; // Classifications // Classifications case "classifications": stats_title($t->translate("Contacts listed by Classifications")); $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";
} 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();
$db2->next_record(); $num = $db2->f("COUNT(*)"); $epsilon = 0.0001; // to avoid having division by zero if (100 * $num / ($total + $epsilon) > $MinimumSeccByEmail) { stats_display($domain_country[$i][1], $num, $url, $urlquery, $total); } } } } stats_end(); break; // Licenses by Email from Developer // Licenses by Email from Developer case "email_license": stats_title($t->translate("Applications listed by Licenses and Developer's Email Domain")); $url = "0"; // No URL in function stats_display $urlquery = "0"; // No URL query in function stats_display $db->query("SELECT license FROM licenses"); 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"));