Location: PHPKode > projects > Arab Cart > arabCart/files/products.php
<?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.
*/


$sql_pro=mysql_query("select pro.id , pro.name , thum.thumb_img  from products pro , img_thumb thum where pro.id = thum.product_id AND pro.cat_id = $cat ");

if(mysql_num_rows($sql_pro)!=0)

{

		$template -> setAttribute("catproduct", "visibility", "visible");

		$template ->AddVar("catproduct","PRODUCTS",product);

		$counter=0;		

		while($row_pro=mysql_fetch_object($sql_pro))

			{

				$counter++;

				$template ->AddVar("proimg","SID",$PHPSESSID);	

				$template ->AddVar("proimg","PRO-IMG",$row_pro->thumb_img);

				$template ->AddVar("proimg","PRO-ID",$row_pro->id);

				$template ->AddVar("proimg","PRO-NAME",$row_pro->name);

				if($counter==2)

				{

					$template ->AddVar("proimg","TR",'</tr><tr>');

					$counter=0;			

				}

				elseif($counter!=2)

				{

					$template ->AddVar("proimg","TR",'');			

				}	

				$template ->parseTemplate("proimg","a");		

			}

}

elseif(mysql_num_rows($sql_pro)==0)

{

		$template -> setAttribute("catproduct", "visibility", "hidden");

}

?>
Return current item: Arab Cart