Location: PHPKode > projects > Multi-lingual E-Commerce System > admin/inc/submit_Product.inc
<?php
require_once('/home/httpd/html/gwenshop/classes/Product.class');

if (isset($_POST['Product']) && $_POST['Product_Code'] != '')
{

	$obj = new Product();
	$obj->Product_ID = $_POST['Product'];
	if (isset($_POST['delete']) && $_POST['delete'] !='' )
	{
		$obj->delete();
	}

	else {
		$obj->Product_Icon = $_POST['Product_Icon'];
		$obj->Product_Image = $_POST['Product_Image'];
		$obj->Product_Weight = $_POST['Product_Weight'];
		$obj->Product_Code = $_POST['Product_Code'];
		$obj->store();

		$obj->deleteDescriptions();
		$obj->deleteProductCategory();
		$obj->deletePrice();

		while (list($key,$value) = each($_POST))
		{
print "key - $key<p>";
		if (substr($key,0,4) =='Name')
			{
print "name<p>";
			$language_code = substr($key,5,2);
			$obj->storeDescription('Product_Name',$language_code,$value);
			}
		if (substr($key,0,4) =='Desc')
			{
print "desc<p>";
			$language_code = substr($key,5,2);
			$obj->storeDescription('Product_Desc',$language_code,$value);
			}
		if (substr($key,0,4) =='Cate')
			{
print "cate<p>";
			list ($null,$category) = explode("_",$key);
			$obj->setProductCategory($category);
			}
		if (substr($key,0,4) =='Pric')
			{
print "Pric<p>";
			$currency = substr($key,5,3);
			$obj->storePrice($currency,$value);
			}

		} # end while

} # end else

} # end if

?>
Return current item: Multi-lingual E-Commerce System