Add and use vendor::objectOutputHeader() and vendor::objectGetEntries()
This commit is contained in:
committed by
WineHQ
parent
cbfc49f42f
commit
fa111ec39d
@@ -140,6 +140,34 @@ class Vendor {
|
||||
echo "</table>\n";
|
||||
}
|
||||
|
||||
function objectGetEntries($bQueued)
|
||||
{
|
||||
/* Vendor queueing is not implemented yet */
|
||||
if($bQueued)
|
||||
return NULL;
|
||||
|
||||
$hResult = query_parameters("SELECT * FROM vendor
|
||||
ORDER BY vendorName");
|
||||
|
||||
if(!$hResult)
|
||||
return FALSE;
|
||||
|
||||
return $hResult;
|
||||
}
|
||||
|
||||
function objectOutputHeader($sClass = "")
|
||||
{
|
||||
$sCells = array(
|
||||
"Name",
|
||||
"Website",
|
||||
array("Linked apps", "align=\"right\""));
|
||||
|
||||
if(vendor::canEdit())
|
||||
$sCells[sizeof($sCells)] = "Action";
|
||||
|
||||
echo html_tr($sCells, $sClass);
|
||||
}
|
||||
|
||||
function canEdit()
|
||||
{
|
||||
if($_SESSION['current']->hasPriv("admin"))
|
||||
|
||||
@@ -45,21 +45,13 @@ else
|
||||
apidb_header("View Vendors");
|
||||
|
||||
//get available vendors
|
||||
$hResult = query_parameters("SELECT vendorId FROM vendor ORDER BY vendorName, vendorId;");
|
||||
$hResult = vendor::objectGetEntries(false);
|
||||
|
||||
// show vendorlist
|
||||
echo "<table width='100%' border=0 cellpadding=3 cellspacing=0>\n\n";
|
||||
|
||||
echo '<tr class="color4">',"\n";
|
||||
echo '<td>Vendor name</td>',"\n";
|
||||
echo '<td>Vendor\'s Web Page</td>',"\n";
|
||||
echo '<td align="right">linked Apps</td>',"\n";
|
||||
if ($_SESSION['current']->hasPriv("admin"))
|
||||
{
|
||||
echo '<td align="center">Action</td>',"\n";
|
||||
}
|
||||
echo '</tr>',"\n";
|
||||
|
||||
vendor::objectOutputHeader("color4");
|
||||
|
||||
$c = 1;
|
||||
while($oRow = mysql_fetch_object($hResult))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user