\n";
exit;
}
mysql_select_db($apidb_db);
return $dbcon;
}
function closedb()
{
global $dbcon, $dbref;
if(--$dbref)
return;
mysql_close($dbcon);
}
function querydb($query)
{
$result = mysql_query($query);
if(!$result)
{
echo "
$query
\n";
echo "A QUERY error occurred: ".
"".mysql_error()."
\n";
}
return $result;
}
function mysql_field_is_null($result, $row, $field)
{
if(mysql_result($result, $row, $field) == null)
return 1;
return 0;
}
function read_string($filename)
{
return join("", file($filename));
}
function build_urlarg($vars)
{
$arr = array();
while(list($key, $val) = each($vars))
{
if(is_array($val))
{
while(list($idx, $value) = each($val))
{
//echo "Encoding $key / $value
";
$arr[] = rawurlencode($key."[]")."=".rawurlencode($value);
}
}
else
$arr[] = $key."=".rawurlencode($val);
}
return implode("&", $arr);
}
function add_option_menu($options, $label, $id)
{
echo "
\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) { global $bugzilla_db, $bugzilla_product_id; $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(); } /* get the number of applications in the appQueue table */ function getQueuedAppCount() { $qstring = "SELECT count(*) as queued_apps FROM appQueue"; $result = mysql_query($qstring); $ob = mysql_fetch_object($result); return $ob->queued_apps; } /* get the number of applications in the appQueue table */ function getQueuedMaintainerCount() { $qstring = "SELECT count(*) as queued_maintainers FROM appMaintainerQueue"; $result = mysql_query($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 = mysql_query($qstring); $ob = mysql_fetch_object($result); return $ob->maintainers; } /* Get the number of users in the database */ function getNumberOfComments() { $result = mysql_query("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 = mysql_query("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 = mysql_query("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 = mysql_query("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 = mysql_query("SELECT count(*) as num_images FROM appData WHERE type='image';"); $row = mysql_fetch_object($result); return $row->num_images; } ?>