\n"; exit; } mysql_select_db(BUGZILLA_DB); return $dbcon; } function closebugzilladb() { global $dbcon, $dbref; if(--$dbref) return; mysql_close($adbcon); } function make_bugzilla_version_list($varname, $cvalue) { $table = BUGZILLA_DB.".versions"; $where = "WHERE product_id=".BUGZILLA_PRODUCT_ID; $query = "SELECT value FROM $table $where ORDER BY value"; openbugzilladb(); $result = mysql_query($query); if(!$result) { closebugzilladb(); return; // Oops } echo "\n"; closebugzilladb(); } function make_maintainer_rating_list($varname, $cvalue) { echo "\n"; } /* get the number of applications in the appQueue table */ function getQueuedAppCount() { $qstring = "SELECT count(*) as queued_apps FROM appQueue"; $result = query_appdb($qstring); $ob = mysql_fetch_object($result); return $ob->queued_apps; } /* get the number of applications in the appQueue table */ function getQueuedAppDataCount() { $qstring = "SELECT count(*) as queued_appdata FROM appDataQueue"; $result = query_appdb($qstring); $ob = mysql_fetch_object($result); return $ob->queued_appdata; } /* get the number of applications in the appQueue table */ function getQueuedMaintainerCount() { $qstring = "SELECT count(*) as queued_maintainers FROM appMaintainerQueue"; $result = query_appdb($qstring); $ob = mysql_fetch_object($result); return $ob->queued_maintainers; } /* get the total number of maintainers and applications in the appMaintainers table */ function getMaintainerCount() { $qstring = "SELECT count(*) as maintainers FROM appMaintainers"; $result = query_appdb($qstring); $ob = mysql_fetch_object($result); return $ob->maintainers; } /* get the total number of vendors from the vendor table */ function getVendorCount() { $qstring = "SELECT count(*) as vendors FROM vendor"; $result = query_appdb($qstring); $ob = mysql_fetch_object($result); return $ob->vendors; } /* Get the number of users in the database */ function getNumberOfComments() { $result = query_appdb("SELECT count(*) as num_comments FROM appComments;"); $row = mysql_fetch_object($result); return $row->num_comments; } /* Get the number of versions in the database */ function getNumberOfVersions() { $result = query_appdb("SELECT count(versionId) as num_versions FROM appVersion WHERE versionName != 'NONAME';"); $row = mysql_fetch_object($result); return $row->num_versions; } /* Get the number of maintainers in the database */ function getNumberOfMaintainers() { $result = query_appdb("SELECT count(maintainerId ) as num_maintainers FROM appMaintainers;"); $row = mysql_fetch_object($result); return $row->num_maintainers; } /* Get the number of app familes in the database */ function getNumberOfAppFamilies() { $result = query_appdb("SELECT count(*) as num_appfamilies FROM appFamily;"); $row = mysql_fetch_object($result); return $row->num_appfamilies; } /* Get the number of images in the database */ function getNumberOfImages() { $result = query_appdb("SELECT count(*) as num_images FROM appData WHERE type='image';"); $row = mysql_fetch_object($result); return $row->num_images; } function lookupVendorName($vendorId) { $sResult = query_appdb("SELECT * FROM vendor ". "WHERE vendorId = ".$vendorId); if(!$sResult || mysql_num_rows($sResult) != 1) return "Unknown vendor"; $vendor = mysql_fetch_object($sResult); return $vendor->vendorName; } ?>