diff --git a/include/vendor.php b/include/vendor.php index d87b0e6..486ae75 100644 --- a/include/vendor.php +++ b/include/vendor.php @@ -140,6 +140,34 @@ class Vendor { echo "\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")) diff --git a/vendorview.php b/vendorview.php index b085106..05a674d 100644 --- a/vendorview.php +++ b/vendorview.php @@ -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 "\n\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - if ($_SESSION['current']->hasPriv("admin")) - { - echo '',"\n"; - } - echo '',"\n"; - + vendor::objectOutputHeader("color4"); + $c = 1; while($oRow = mysql_fetch_object($hResult)) {
Vendor nameVendor\'s Web Pagelinked AppsAction