<?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 the products from the shoping cart database
$cart=mysql_query("select cart.product_id ,cart.id , cart.quantity , prod.name , prod.price , cart.session from products prod , cart_temp cart where prod.id = cart.product_id AND cart.session='".$PHPSESSID."' AND prod.avaliable <> 0 Order by cart.id DESC") or die(mysql_error());
$template -> setAttribute("shopping", "visibility", "visible");
if(mysql_num_rows($cart)!=0)
{
$template -> setAttribute("cartelem", "visibility", "visible");
while($row_cart=mysql_fetch_object($cart))
{
$total= bcmul( $row_cart->price , $row_cart->quantity , 4);
$bill= $bill + $total;
$template -> AddVar("cartelem","PRO-NAME",productname);
$template -> AddVar("cartelem","QUINTITY",quan);
$template -> AddVar("cartelem","TOTAL",totalprc);
$template -> AddVar("cartelem","DB-UPDATE",upd);
$template -> AddVar("cartelem","DB-DELETE",del);
$template -> AddVar("cartelem","PRICE",prc);
$template -> AddVar("cartelem","CART-ID",$row_cart->id);
$template -> AddVar("cartelem","DB-PRO-NAME",$row_cart->name);
$template -> AddVar("cartelem","DB-PRICE",$row_cart->price." ".currency." ");
$template -> AddVar("cartelem","DB-QUINTITY",$row_cart->quantity);
$template -> AddVar("cartelem","DB-TOTAL",$total." ".currency." ");
$template -> AddVar("cartelem","SID",$PHPSESSID);
$template -> AddVar("cartelem","FINALBILL",totalprc.$bill." ".currency." ");
$template -> AddVar("cartelem","ORDER",orders);
$template -> AddVar("cartelem","CONTINUE",continu);
$template -> parseTemplate("cartelem","a");
}
}
else
{
$template -> AddVar("shopping","SORRY",SorryC);
}
?>