<?php
/*
ArabCart, Free E-Commerce Solutions
http://www.arabcart.info
Copyright (c) 2005 Mhd Zaher Ghaibeh
Released under the GNU General Public License
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.
*/
//brings information about particulare product form the database
if ( ($id<0) || (!is_numeric($id)) || ($id==0) )
{
$template -> setAttribute("showproduct", "visibility", "visible");
$template -> AddVar("showproduct","BACK",backp);
$template -> AddVar("showproduct","ERROR",not_allowed_op);
}
else
{
$showProduct=mysql_query("select pro.id , pro.name , pro.full_desc , pro.avaliable , pro.price , thu.thumb_img from products pro, img_thumb thu where pro.id=thu.product_id AND pro.id=".$id." ") or die(mysql_error());
if(mysql_num_rows($showProduct)!=0)
{
$template -> setAttribute("showproduct", "visibility", "visible");
$template -> AddVar("showproduct","BACK",backp);
while($row_pro=mysql_fetch_object($showProduct))
{
$template -> AddVar("showproduct","PRO-NAME",$row_pro->name);
$template -> AddVar("showproduct","PRODUCTS",$row_pro->name);
$template -> AddVar("showproduct","IMAGE",'<a href="javascript:openWindow(\'showimg.php?id='.$row_pro->id.'\',\'ZShop\',\'toolbar=no\')">
<img src="admincp/images/'.$row_pro->thumb_img.'" border="0" alt="'.$row_pro->name.'"></a>');
$template -> AddVar("showproduct","PRICE",$row_pro->price ." ".currency." ");
$template -> AddVar("showproduct","PRO-FULL-DESC",stripslashes($row_pro->full_desc));
$template -> AddVar("showproduct","PRO-ID",$row_pro->id);
if($row_pro->avaliable ==0)
{
$template -> AddVar("showproduct","OUT-OF-STOCK",ofs);
}
else
{
$template -> AddVar("showproduct","OUT-OF-STOCK","");
$template -> AddVar("showproduct","ADD2CART",add2);
}
}
}
}
?>