diff --git a/include/vendor.php b/include/vendor.php index 2cc43b6..569146f 100644 --- a/include/vendor.php +++ b/include/vendor.php @@ -61,12 +61,10 @@ class Vendor { */ function create() { - if(!$this->canEdit()) - return FALSE; - - $hResult = query_parameters("INSERT INTO vendor (vendorName, vendorURL) ". - "VALUES ('?', '?')", - $this->sName, $this->sWebpage); + $hResult = query_parameters("INSERT INTO vendor (vendorName, vendorURL, queued) ". + "VALUES ('?', '?', '?')", + $this->sName, $this->sWebpage, + $this->mustBeQueued() ? "true" : "false"); if($hResult) { $this->iVendorId = mysql_insert_id(); @@ -80,6 +78,23 @@ class Vendor { } } + /** + * Un-queue vendor + * Returns TRUE or FALSE + */ + function unQueue() + { + if(!$this->canEdit()) + return FALSE; + + $hResult = query_parameters("UPDATE vendor SET queued = '?' WHERE vendorId = '?'", + 'false', $this->iVendorId); + + if(!$hResult) + return FALSE; + + return TRUE; + } /** * Update vendor. diff --git a/tables/appdb_tables.sql b/tables/appdb_tables.sql index 23bc806..699a0b7 100644 --- a/tables/appdb_tables.sql +++ b/tables/appdb_tables.sql @@ -20,9 +20,10 @@ drop table if exists sessionMessages; * vendor information */ create table vendor ( - vendorId int not null auto_increment, - vendorName varchar(100) not null, - vendorURL varchar(200), + vendorId int not null auto_increment, + vendorName varchar(100) not null, + vendorURL varchar(200), + queued enum('true','false') NOT NULL default 'false', key(vendorId) ); @@ -31,7 +32,7 @@ create table vendor ( * application */ create table appFamily ( - appId int not null auto_increment, + appId int not null auto_increment, appName varchar(100) not null, vendorId int not null, keywords text,