Let users browse vendors and remove some duplicate code

This commit is contained in:
Tony Lambregts
2005-10-25 00:47:32 +00:00
committed by WineHQ
parent 14a3d83d51
commit 40138af1a8
7 changed files with 149 additions and 193 deletions

View File

@@ -3,6 +3,7 @@
/* SideBar */
/***********/
require_once(BASE."include/distributions.php");
require_once(BASE."include/vendor.php");
function global_sidebar_menu() {
@@ -19,6 +20,7 @@ function global_sidebar_menu() {
$g->add("Help & Documentation", BASE."help/");
$g->add("AppDB Stats", BASE."appdbStats.php");
$g->add("View Distributions (".getNumberOfDistributions().")", BASE."distributionView.php");
$g->add("View Vendors (".getNumberOfvendors().")", BASE."vendorview.php");
$g->add("Email your suggestions for improving the AppDB", "mailto:appdb@winehq.org");
$g->done();

View File

@@ -10,7 +10,7 @@ function global_admin_menu() {
$g = new htmlmenu("Global Admin");
$g->add("Add Category", BASE."admin/addCategory.php");
$g->add("Add Vendor", BASE."admin/addVendor.php");
$g->add("Add Vendor", BASE."admin/editVendor.php");
$g->addmisc(" ");
$g->add("View App Queue (".$_SESSION['current']->getQueuedAppCount()."/".$_SESSION['current']->getQueuedVersionCount().")", BASE."admin/adminAppQueue.php");

View File

@@ -115,5 +115,36 @@ class Vendor {
addmsg("The vendor has been deleted.", "green");
}
}
function OutputEditor()
{
echo html_frame_start("Vendor Form", "90%", "", 0);
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
// Name
echo '<tr valign=top><td class="color1" width="20%"><b>Vendor Name</b></td>',"\n";
echo '<td class="color0"><input type=text name="sName" value="'.$this->sName.'" size="50"></td></tr>',"\n";
// Url
echo '<tr valign=top><td class="color1"><b>Vendor Url</b></td>',"\n";
echo '<td class="color0"><input type=text name="sWebpage" value="'.$this->sWebpage.'" size="50"></td></tr>',"\n";
echo '<input type="hidden" name="iVendorId" value="'.$this->iVendorId.'">',"\n";
echo "</table>\n";
echo html_frame_end();
}
}
/* Get the total number of Vendors in the database */
function getNumberOfVendors()
{
$hResult = query_appdb("SELECT count(*) as num_vendors FROM vendor");
if($hResult)
{
$row = mysql_fetch_object($hResult);
return $row->num_vendors;
}
return 0;
}
?>