Add and use vendor::objectGetEntriesCount()
This commit is contained in:
committed by
WineHQ
parent
8b1271b185
commit
2e6ddd24c9
@@ -29,7 +29,7 @@ function global_sidebar_menu()
|
|||||||
$g->add("Help & Documentation", BASE."help/");
|
$g->add("Help & Documentation", BASE."help/");
|
||||||
$g->add("AppDB Stats", BASE."appdbStats.php");
|
$g->add("AppDB Stats", BASE."appdbStats.php");
|
||||||
$g->add("View Distributions (".distribution::objectGetEntriesCount(false, false).")", BASE."objectManager.php?sClass=distribution&bIsQueue=false&sTitle=View%20Distributions");
|
$g->add("View Distributions (".distribution::objectGetEntriesCount(false, false).")", BASE."objectManager.php?sClass=distribution&bIsQueue=false&sTitle=View%20Distributions");
|
||||||
$g->add("View Vendors (".getNumberOfvendors().")", BASE."objectManager.php?sClass=vendor&bIsQueue=false&sTitle=View%20Vendors");
|
$g->add("View Vendors (".vendor::objectGetEntriesCount(false, false).")", BASE."objectManager.php?sClass=vendor&bIsQueue=false&sTitle=View%20Vendors");
|
||||||
$g->add("Email your suggestions for improving the AppDB", "mailto:appdb@winehq.org");
|
$g->add("Email your suggestions for improving the AppDB", "mailto:appdb@winehq.org");
|
||||||
$g->done();
|
$g->done();
|
||||||
|
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ class Vendor {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if(!$iRows)
|
if(!$iRows)
|
||||||
$iRows = getNumberOfVendors();
|
$iRows = objectGetEntriesCount($bQueued, $bRejected);
|
||||||
|
|
||||||
$hResult = query_parameters("SELECT * FROM vendor
|
$hResult = query_parameters("SELECT * FROM vendor
|
||||||
ORDER BY vendorName LIMIT ?,?",
|
ORDER BY vendorName LIMIT ?,?",
|
||||||
@@ -263,17 +263,27 @@ class Vendor {
|
|||||||
{
|
{
|
||||||
return "<a href=\"".$this->objectMakeUrl()."\">$this->sName</a>";
|
return "<a href=\"".$this->objectMakeUrl()."\">$this->sName</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function objectGetEntriesCount($bQueued, $bRejected)
|
||||||
|
{
|
||||||
|
/* Not implemented */
|
||||||
|
if($bQueued)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/* Not implemented */
|
||||||
|
if($bRejected)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
$hResult = query_parameters("SELECT COUNT(vendorId) as count FROM vendor");
|
||||||
|
|
||||||
|
if(!$hResult)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if(!$oRow = mysql_fetch_object($hResult))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return $oRow->count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the total number of Vendors in the database */
|
|
||||||
function getNumberOfVendors()
|
|
||||||
{
|
|
||||||
$hResult = query_parameters("SELECT count(*) as num_vendors FROM vendor");
|
|
||||||
if($hResult)
|
|
||||||
{
|
|
||||||
$oRow = mysql_fetch_object($hResult);
|
|
||||||
return $oRow->num_vendors;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user