diff --git a/TODO b/TODO index 9559d1c..e880e2e 100644 --- a/TODO +++ b/TODO @@ -39,8 +39,6 @@ In particular globally registered vars should be replaced by superglobals (nearl # add distro table and administration screens for it. (Chris) -# We need an administration screen for vendors. - # add wineversion, distro, source/package fields to the user_list table. # add wineversion, distro, source/package fields to the appComments table. diff --git a/admin/adminVendors.php b/admin/adminVendors.php new file mode 100644 index 0000000..39b6682 --- /dev/null +++ b/admin/adminVendors.php @@ -0,0 +1,85 @@ +',"\n"; + +if ($_REQUEST['sub']) +{ + if($_REQUEST['sub'] == 'delete') + { + $sQuery = "DELETE FROM vendor WHERE vendorId = ".$_REQUEST['vendorId'].";"; + echo "$sQuery"; + $hResult = query_appdb($sQuery); + echo html_frame_start("Delete vendor: ".$_REQUEST['vendorId'],400,"",0); + if($hResult) + { + //success + echo "
Vendor was successfully deleted
\n"; + } + echo html_frame_end(" "); + echo html_back_link(1,'adminVendors.php'); + } +} else +{ + //get available vendors + $sQuery = "SELECT * from vendor;"; + $hResult = query_appdb($sQuery); + + if(!$hResult || !mysql_num_rows($hResult)) + { + // no vendors + echo html_frame_start("","90%"); + echo 'There are no application vendors.
',"\n"; + echo html_frame_end(" "); + } + else + { + // show vendorlist + echo html_frame_start("","90%","",0); + echo "| Vendor name | \n"; + echo "Vendor url | \n"; + echo "\n"; + echo " |
| ".$ob->vendorName." | \n"; + echo "vendorURL."\">".$ob->vendorURL." | \n"; + echo "[delete] | \n"; + echo "