Prev | Current Page 436 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

'/product_images/' .
$_FILES['ThumbnailUpload']['name']);
// Update the product's information in the database
Catalog::SetThumbnail($this->_mProductId,
$_FILES['ThumbnailUpload']['name']);
}
}
// If updating product info ...
if (isset ($_POST['UpdateProductInfo']))
{
$product_name = $_POST['name'];
$product_description = $_POST['description'];
$product_price = $_POST['price'];
$product_discounted_price = $_POST['discounted_price'];
if ($product_name == null)
$this->mErrorMessage = 'Product name is empty';
if ($product_description == null)
$this->mErrorMessage = 'Product description is empty';
if ($product_price == null || !is_numeric($product_price))
$this->mErrorMessage = 'Product price must be a number!';
if ($product_discounted_price == null ||
!is_numeric($product_discounted_price))
$this->mErrorMessage = 'Product discounted price must be a number!';
CHAPTER 11 ?–  CATALOG ADMINISTRATION: PRODUCTS AND ATTRIBUTES 335
if ($this->mErrorMessage == null)
Catalog::UpdateProduct($this->_mProductId, $product_name,
$product_description, $product_price, $product_discounted_price);
}
// If removing the product from a category ...
if (isset ($_POST['RemoveFromCategory']))
{
$target_category_id = $_POST['TargetCategoryIdRemove'];
$still_exists = Catalog::RemoveProductFromCategory(
$this->_mProductId, $target_category_id);
if ($still_exists == 0)
{
header('Location: ' .


Pages:
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448
ABBA brak ławki Porównywarka A*Teens