- Mr Tuấn
- Holine: 0909 291 063
- Email: rinto1063@gmail.com
- Đang online :3
- Ngày :109
- Tuần : 297
- Tháng :1539
- Tổng truy cập :127528
Sản Phẩm
- Trang 6 of 8
- ‹ Trang sau
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- Trang tiếp ›
- Trang cuối ››
function get_product_name($pid){ global $d, $row,$lang; $sql = "select ten_$lang from table_product where id='".$pid."'"; $d->query($sql); $row = $d->fetch_array(); return $row['ten_'.$lang]; } function get_product($pid,$loai,$loaigia){ global $d, $row,$lang; $sql = "select ten_$lang as ten,id_cat,giaban from table_product where id='".$pid."'"; $d->query($sql); $row = $d->fetch_array(); if($loai==0) { $sql = "select $loaigia as giaban from table_product_cat where id='".$row['id_cat']."'"; $d->query($sql); $tmp = $d->fetch_array(); $row['giaban']=$tmp['giaban']; } return $row; } function get_price($pid){ global $d, $row; $sql = "select giaban from table_product where id='".$pid."'"; $d->query($sql); $row = $d->fetch_array(); return $row['giaban']; } function get_color($color_id){ global $d, $row; $sql = "select ten_$lang as ten from table_baiviet where id='".$color_id."'"; $d->query($sql); $row = $d->fetch_array(); return $row['ten']; // dump($row['thumb']); } function get_thumb($pid){ global $d, $row; $sql = "select thumb from table_product where id='".$pid."' "; $d->query($sql); $row = $d->fetch_array(); return $row['thumb']; } function get_thumb_color($pid){ global $d, $row; $sql = "select thumb from table_product_photo where id='".$pid."' "; $d->query($sql); $row = $d->fetch_array(); return $row['thumb']; } function remove_product($pid,$thongtin){ $pid=intval($pid); $max=count($_SESSION['cart']); for($i=0;$i<$max;$i++){ if($pid==$_SESSION['cart'][$i]['productid'] && $thongtin==$_SESSION['cart'][$i]['thongtin']){ unset($_SESSION['cart'][$i]); break; } } $_SESSION['cart']=array_values($_SESSION['cart']); } function remove_pro_thanh($pid){ $pid=intval($pid); $max=count($_SESSION['cart']); for($i=0;$i<$max;$i++){ if($pid==$_SESSION['cart'][$i]['productid']){ unset($_SESSION['cart'][$i]); break; } } $_SESSION['cart']=array_values($_SESSION['cart']); redirect('thanh-toan.html'); } function get_order_total(){ $max=count($_SESSION['cart']); $sum=0; for($i=0;$i<$max;$i++){ $pid=$_SESSION['cart'][$i]['productid']; $q=$_SESSION['cart'][$i]['qty']; $price=get_price($pid); $sum+=$price*$q; } return $sum; } function addtocart($pid,$q,$color_id){ if($pid<1 or $q<1) return; if(is_array($_SESSION['cart'])){ if(product_exists($pid,$q,$color_id)) return 0; $max=count($_SESSION['cart']); $_SESSION['cart'][$max]['productid']=$pid; $_SESSION['cart'][$max]['qty']=$q; $_SESSION['cart'][$max]['mausp']=$color_id; return count($_SESSION['cart']); } else{ $_SESSION['cart']=array(); $_SESSION['cart'][0]['productid']=$pid; $_SESSION['cart'][0]['qty']=$q; $_SESSION['cart'][0]['mausp']=$color_id; return count($_SESSION['cart']); } } function product_exists($pid,$q,$color_id){ $pid=intval($pid); $max=count($_SESSION['cart']); $flag=0; for($i=0;$i<$max;$i++){ if($pid==$_SESSION['cart'][$i]['productid'] && $color_id==$_SESSION['cart'][$i]['mausp']){ $_SESSION['cart'][$i]['qty'] = $_SESSION['cart'][$i]['qty'] + $q; $flag=1; break; } } return $flag; } ?>
79 Nguyễn Văn Yến, P. Tân Thới Hòa,Q.Tân Phú, Tp. HCM
0909 291 063
rinto1063@gmail.com
www.senvoirinto.com
79 Nguyễn Văn Yến, P. Tân Thới Hòa,Q.Tân Phú, Tp. HCM
0909 291 063
rinto1063@gmail.com
www.senvoirinto.com
78 Nguyễn Văn Yến, P. Tân Thới Hòa,Q.Tân Phú, Tp. HCM
0909 291 063
rinto1063@gmail.com
www.senvoirinto.com
Từ lâu phòng tắm đã không chỉ là không gian dành cho việc tắm rửa, vệ sinh đơn thuần đối với mỗi người. Đặc biệt...
Mỗi khung hình về ngôi nhà của Do Min Joon đều khiến khán giả trầm trồ về sự sang trọng, thanh lịch.