query($sql); $row = $d->fetch_array(); return $row; } function remove_product($pid,$size,$mau){ $pid=intval($pid); $max=count($_SESSION['cart']); for($i=0;$i<$max;$i++){ if($pid==$_SESSION['cart'][$i]['productid'] && $size==$_SESSION['cart'][$i]['size'] && $mau==$_SESSION['cart'][$i]['mau']){ unset($_SESSION['cart'][$i]); break; } } $_SESSION['cart']=array_values($_SESSION['cart']); if(count($_SESSION['cart'])==0) { $redirect=true; } else { $redirect=false; } } function get_order_total(){ global $d; $max=count($_SESSION['cart']); $sum=0; for($i=0;$i<$max;$i++){ $pid=$_SESSION['cart'][$i]['productid']; $q=$_SESSION['cart'][$i]['qty']; $price=get_product($pid); $sum+=$price['gia']*$q; } return $sum; } function get_total(){ $max=count($_SESSION['cart']); $sum=0; for($i=0;$i<$max;$i++){ $q=$_SESSION['cart'][$i]['qty']; $sum+=$q; } return $sum; } function addtocart($pid,$q,$size,$mau){ if($pid<1 or $q<1) return; if(is_array($_SESSION['cart'])){ $ck=product_exists($pid,$size,$mau); if($ck==-1) { ## Sản phẩm chưa có => thêm vào giỏ hàng $max=count($_SESSION['cart']); $_SESSION['cart'][$max]['productid']=$pid; $_SESSION['cart'][$max]['qty']=$q; $_SESSION['cart'][$max]['size']=$size; $_SESSION['cart'][$max]['mau']=$mau; } else { ## Sản phẩm đã có => cộng dồn số lượng $_SESSION['cart'][$ck]['qty']=$q+$_SESSION['cart'][$ck]['qty']; } } else{ $_SESSION['cart']=array(); $_SESSION['cart'][0]['productid']=$pid; $_SESSION['cart'][0]['qty']=$q; $_SESSION['cart'][0]['size']=$size; $_SESSION['cart'][0]['mau']=$mau; } } function product_exists($pid,$size,$mau){ $pid=intval($pid); $max=count($_SESSION['cart']); $flag=-1; for($i=0;$i<$max;$i++){ if($pid==$_SESSION['cart'][$i]['productid'] && $size==$_SESSION['cart'][$i]['size'] && $mau==$_SESSION['cart'][$i]['mau']){ $flag=$i; break; } } return $flag; } ?> News - LOGI VIETNAM

News - LOGI VIETNAM

News - LOGI VIETNAM

News - LOGI VIETNAM

News - LOGI VIETNAM

News - LOGI VIETNAM
News - LOGI VIETNAM
Menu

News

Unilever intends to build a global foods innovation centre in Wageningen, The Netherlands

Today Unilever has announced its intention to build a new global Foods Innovation Centre in Wageningen, the Netherlands. The Foods R&D organizations, currently based in Vlaardingen (the Netherlands), Heilbronn (Germany) and Poznan (Poland) will be co-located in the new centre.

Continued competitive growth in challenging markets

Consumer demand remained weak and in the markets in which we operate volumes have slowed further and are flat in aggregate. This is particularly the case in Latin America where currency devaluation has pushed up the cost of living of...

Unilever joins coalition for “Girls, Women and the Global Goals”

Today, at the 12th and final Clinton Global Initiative (CGI) Annual Meeting, Unilever joined No Ceilings: The Full Participation Project, an initiative of the Clinton Foundation, Vital Voices Global Partnership, WEConnect International and a coalition of over 30 core partners...

Unilever boss says Tesco Marmite row will be 'resolved soon' as Brexit pound slump dents sales

Graeme Pitkethly, Unilever's chief financial officer, has defended the company in its dispute with Tesco over the price hikes for dozens of popular brand from Marmite to PG Tips tea. Unilever has demanded a 10 per cents hike in prices for...

Better Buy: Procter & Gamble Co vs. Unilever

Procter & Gamble (NYSE:PG) and Unilever (NYSE:UL) have moved in lockstep over the past few years, with each stock rising roughly 40% since 2011, for about half the return of the broader market. And why not? At a glance, they seem...
Close
Sản phẩm
Đơn giá
Số lượng
Thành tiền
Thành tiền: