VAR['page']="mymp"; $this->PARAM['viewtype']="allproducts"; if (isset($_REQUEST['action'])) { if ($_REQUEST['action'] == "delete") { /** * Delete product from table product */ $productname = $this->DBCON->SelectSingle("SELECT productname FROM product WHERE username='".$_SESSION['username']."' AND productid='".$_REQUEST['deleteid']."' ", 'productname'); $res = $this->DBCON->ExecuteNonQuery("DELETE FROM product WHERE username='".$_SESSION['username']."' AND productid='".$_REQUEST['deleteid']."' "); $res = $this->DBCON->ExecuteNonQuery("DELETE FROM product_status WHERE productid='".$_REQUEST['deleteid']."' "); /** * Delete corresponding special offer */ $leadid = $this->DBCON->SelectSingle("SELECT leadid FROM sellinglead WHERE productid='".$_REQUEST['deleteid']."' ", 'leadid'); $res = $this->DBCON->ExecuteNonQuery("DELETE FROM sellinglead WHERE productid='".$_REQUEST['deleteid']."' "); $res = $this->DBCON->ExecuteNonQuery("DELETE FROM sellinglead_status WHERE leadid='".$leadid."' "); /** * Get image name for product from database and * unlink (Delete) from productimages and thumbnail folders * then delete row from database table */ $delimage = $this->DBCON->SelectSingle("SELECT imagename FROM productimage WHERE productid='".$_REQUEST['deleteid']."' ", 'imagename'); if (!empty($delimage)) { unlink("../".IMG_BASE.$delimage); unlink("../".IMG_SMALL.$delimage); unlink("../".IMG_THUMB.$delimage); $res = $this->DBCON->ExecuteNonQuery("DELETE FROM productimage WHERE productid='".$_REQUEST['deleteid']."' "); $_SESSION['actionresult'] = "Product \"{$productname}\" has been deleted."; } } //action delete } // isset action } // End Constructor function OnValidate() { } // End OnValidate function OnSubmit() { } // End OnSubmit function OnRender() { $breadcrumb=" >> My Marketplace >> Promote My Products >> Manage Products"; include (MD_BASE.'common/bodygen.php'); body($this->VAR['page'], "Members - Marketplace", "marketplace for business to business,offers company directory,catalog and trade leads to businesses,manufacturer,wholesaler,supplier.", $breadcrumb); $product = $this->DBCON->Select("SELECT * FROM product WHERE username='".$_SESSION['username']."' ORDER BY flag DESC, productid DESC "); $numRes=count($product); ?>
Manage Products
View all your products here.
{$_SESSION['actionresult']}If you still are having problems with posting your product, we recommend view our How To section for help.
Posting Product Tips.