["img/shape/round.png","img/shape/large-RND-Side.png"], "PRINCESS" => ["img/shape/princess.png","img/shape/large-PC-Side.png"], "CUSHION" => ["img/shape/cushion.png","img/shape/large-CU-Side.png"], "OVAL" => ["img/shape/oval.png","img/shape/large-OV-Side.png"], "PEAR" => ["img/shape/pear.png","img/shape/large-PS-Side.png"], "EMERALD" => ["img/shape/emerald.png","img/shape/large-EM-Side.png"], "HEART" => ["img/shape/heart.png","img/shape/large-HS-Side.png"], "RADIANT" => ["img/shape/radiant.png","img/shape/large-RAD-Side.png"], "ASSCHER" => ["img/shape/asscher.png","img/shape/large-AC-Side.png"], "MARQUISE" => ["img/shape/marquise.png","img/shape/large-MQ-Side.png"] ]; $fshape1 = ["","Pear", "Round", "Princess", "Marquise", "Emerald", "Heart", "Oval", "Cushion", "Radiant", "Asscher"]; //$fshape["Cushion Mo"] = $fshape["Cushion"]; $filtr['shape'] = ''; $arrcolor = ['D','E','F','G','H','I','J','K','L','M']; $arrcut = ['EX','VG','G','G']; $arrclarity =['FL','IF','VVS1','VVS2','VS1','VS2','SI1','SI2','I1','I2']; $arrfluorescent =['VS','S','M','F','N']; $filtr['color'] = [ 'value' => ['D','E','F','G','H','I','J','K','L','M'], 'range' => "[0,9]", 'view' => 'D - M' ]; $filtr['cut'] = [ 'value' => ['EX','VG','G','F'], 'range' => "[0,3]", 'view' => 'Excellent - Fair' ]; $filtr['clarity'] = [ 'value' => ['FL','IF','VVS1','VVS2','VS1','VS2','SI1','SI2','I1','I2'], 'range' => "[0,9]", 'view' => 'FL - I2' ]; // Filter data $wh = '';//lw(); $shape = ''; if(!empty($_GET['shape'])) { $shape = safe($_GET['shape']); $filtr['shape'] = explode(',',$shape); $list_shape = explode(',',$shape); $wh .= ($wh==''?'':'AND')."(shape IN ('".join("','",$list_shape)."'))"; } if(!empty($_GET['li'])) { $li = safe($_GET['li']); list($min, $max) = explode(',',$li); $min = min(explode(',',$li)); $max = max(explode(',',$li)); if($shape=='Round') { $wh .= ($wh==''?'':'AND')."(minLi>'$min' AND maxLi<'$max')"; }elseif(count(explode(',',$li)) == 1){ $wh .= ($wh==''?'':'AND')."(minLi>='$min')"; } else { $wh .= ($wh==''?'':'AND')."(maxLi BETWEEN '$min' AND '$max')"; } } $filtr['li']['view'] = '['.$filtr['li']['min'].','.$filtr['li']['max'].']'; if(!empty($_GET['carat'])) { $carat = safe($_GET['carat']); list($min, $max) = explode(',',$carat); $min = min(explode(',',$carat)); $max = max(explode(',',$carat)); if(count(explode(',',$carat)) == 1){ $wh .= ($wh==''?'':'AND')."(carat>='$min')"; } else { $wh .= ($wh==''?'':'AND')."(carat BETWEEN '$min' AND '$max')"; } } $filtr['carat']['view'] = '['.$filtr['carat']['min'].','.$filtr['carat']['max'].']'; if(!empty($_GET['color'])) { $color = safe($_GET['color']); $list = explode(',',$color); $wh .= ($wh==''?'':'AND')."(color IN ('".join("','",$list)."'))"; $fcolor = $filtr['color']['value']; $min = array_search($list[0], $fcolor); $max = array_search($list[count($list)-1], $fcolor); $filtr['color'] = [ 'value' => $list, 'range' => "[$min,$max]", 'view' => $list[0].' - '.$list[count($list)-1] ]; } if(!empty($_GET['cut'])) { $cut = safe($_GET['cut']); $list = explode(',',$cut); $wh .= ($wh==''?'':'AND')."(cut IN ('','".join("','",$list)."'))"; $fcut = $filtr['cut']['value']; $min = array_search($list[0], $fcut); $max = array_search($list[count($list)-1], $fcut); $filtr['cut'] = [ 'value' => $list, 'range' => "[$min,$max]", 'view' => $list[0].' - '.$list[count($list)-1] ]; } if(!empty($_GET['clarity'])) { $clarity = safe($_GET['clarity']); $list = explode(',',$clarity); $wh .= ($wh==''?'':'AND')."(clarity IN ('','".join("','",$list)."'))"; $fclarity = $filtr['clarity']['value']; $min = array_search($list[0], $fclarity); $max = array_search($list[count($list)-1], $fclarity); $filtr['clarity'] = [ 'value' => $list, 'range' => "[$min,$max]", 'view' => $list[0].' - '.$list[count($list)-1] ]; } if(!empty($_GET['pay'])) { $pay = safe($_GET['pay']); list($min,$max) = explode(',',$pay); //echo "Price: $min - $max
"; $fpay = $filtr['pay']['value']; $min = min(explode(',',$pay)).'000000'; $max = max(explode(',',$pay)).'000000'; //echo "Range: $pmin - $pmax
"; if(count(explode(',',$pay)) == 1){ $wh .= ($wh==''?'':'AND')."(Price>='$min')"; } else { $wh .= ($wh==''?'':'AND')."(Price BETWEEN '$min' AND '$max')"; } } if(!empty($_GET['sort'])) { if($_GET['sort'] == 1 ){ $orderby = "ORDER BY Price ASC"; }elseif($_GET['sort'] == 2 ){ $orderby = "ORDER BY minLi ASC"; }elseif($_GET['sort'] == 3 ){ $orderby = "ORDER BY carat ASC"; }elseif($_GET['sort'] == 4 ){ $orderby = "ORDER BY color ASC"; }else{ $orderby = "ORDER BY Price DESC,NgayCN DESC"; } } if(!empty($_GET['bst'])) { $bst = $_GET['bst']; $wh .= ($wh==''?'':'AND')."(Bosuutap LIKE '%#$bst#%')"; } /* $filtr['pay']['view'] = '['.$filtr['pay']['min'].','.$filtr['pay']['max'].']'; if($filtr['pay']['max']==1000) { $filtr['pay']['max'] = '1.000'; } echo '
'.print_r($filtr['pay'],true).'
'; */ $brule = "SELECT * FROM ".PREFIX_NAME."diamond_collection_rule".SUPFIX_NAME." WHERE Active='1'"; $brule_diamond_rule = []; $brule_diamond_rule_check = []; if($brs = $dx->get_results($brule)){ foreach($brs as $bt){ $where = ''; $Shape = preg_split("/[#,]/",$bt->Shape,-1,PREG_SPLIT_NO_EMPTY); $Millimetre1 = stripslashes($bt ->Millimetre1); $Millimetre2 = stripslashes($bt ->Millimetre2); $Color1 = stripslashes($bt ->Color1); $Color2 = stripslashes($bt ->Color2); $Carat1 = stripslashes($bt ->Carat1); $Carat2 = stripslashes($bt ->Carat2); $Cut1 = stripslashes($bt ->Cut1); $Cut2 = stripslashes($bt ->Cut2); $Fluorescent1 = stripslashes($bt ->Fluorescent1); $Fluorescent2 = stripslashes($bt ->Fluorescent2); $Shape = preg_split("/[#,]/",$bt->Shape,-1,PREG_SPLIT_NO_EMPTY); $where = ''; $sp=''; foreach($Shape as $item){ if(!empty($item)){ $sp .= "'".$fshape1[$item]."',"; } } if(!empty($sp)){ $sp = rtrim($sp,','); $where .= ($where==''?'':'AND')."(shape IN ($sp))"; } if(!empty($Millimetre1)){ $where .= ($where==''?'':'AND')."(minLi>'$Millimetre1')"; if(!empty($Millimetre2)){ $where .= ($where==''?'':'AND')."(maxLi<'$Millimetre2')"; } } if(!empty($Carat1)){ $where .= ($where==''?'':'AND')."(carat>'$Carat1')"; if(!empty($Carat2)){ $where .= ($where==''?'':'AND')."(carat<'$Carat2')"; } } if(!empty($Color1)){ $vitri = array_search($Color1,$arrcolor,true); $arrcolor = array_slice($arrcolor,0,$vitri+1); if(!empty($Color2)){ $vitri1 = array_search($Color2,$arrcolor,true); $arrcolor = array_slice($arrcolor,$vitri-1); } $where .= ($where==''?'':'AND')."(color IN ('".join("','",$arrcolor)."'))"; } if(!empty($Cut1)){ $vitri = array_search($Cut1,$arrcut,true); $arrcut = array_slice($arrcut,0,$vitri+1); if(!empty($Cut2)){ $vitri1 = array_search($Cut2,$arrcut,true); $arrcut = array_slice($arrcut,$vitri-1); } $where .= ($where==''?'':'AND')."(cut IN ('".join("','",$arrcut)."'))"; } if(!empty($Fluorescent1)){ $vitri = array_search($Fluorescent1,$arrfluorescent,true); $arrcolor = array_slice($arrfluorescent,0,$vitri+1); if(!empty($Fluorescent2)){ $vitri1 = array_search($Fluorescent2,$arrfluorescent,true); $arrcolor = array_slice($arrfluorescent,$vitri-1); } $where .= ($where==''?'':'AND')."(fluor_fluorescent IN ('".join("','",$arrfluorescent)."'))"; } // $where .= ($where==''?'':'AND')."(Active='1')"; $where .= ($where==''?'':'AND')."(Deleted='0')"; $where = ($where==''?'':'WHERE').$where; $ds = "SELECT * FROM ".PREFIX_NAME."diamond".SUPFIX_NAME." $where LIMIT $offset, $rowsPerPage"; //echo $ds; if($rx = $dx->get_results($ds)){ foreach($rx as $vl){ $brule_diamond_rule_check[] = $vl->diaID ; } } // var_dump($brule_diamond_rule_check);exit; $info = [ 'id' => $bt->diaclrID , 'name' => stripslashes($bt ->Ten), 'Shape' => $Shape, 'Millimetre1' => stripslashes($bt ->Millimetre1), 'Millimetre2' => stripslashes($bt ->Millimetre2), 'Color1' => stripslashes($bt ->Color1), 'Color2' => stripslashes($bt ->Color2), 'Carat1' => stripslashes($bt ->Carat1), 'Carat2' => stripslashes($bt ->Carat2), 'Cut1' => stripslashes($bt ->Cut1), 'Cut2' => stripslashes($bt ->Cut2), 'Fluorescent1' => stripslashes($bt ->Fluorescent1), 'Fluorescent2' => stripslashes($bt ->Fluorescent2), ]; $brule_diamond_rule[] =$info; } } // $wh .= ($wh==''?'':'AND')."(Active='1')"; $wh .= ($wh==''?'':'AND')."(Deleted='0')"; $wh = ($wh==''?'':'WHERE').$wh; $orderby = $orderby==''?'ORDER BY CASE WHEN shape="ROUND" THEN shape_name end DESC ':($orderby.',CASE WHEN shape="ROUND" THEN shape_name end DESC'); $numPages = NumOfPages($dx,PREFIX_NAME.'diamond_hk'.SUPFIX_NAME,$wh,$rowsPerPage); $ds = "SELECT * FROM ".PREFIX_NAME."diamond_hk".SUPFIX_NAME." $wh $orderby LIMIT $offset, $rowsPerPage"; //echo $ds; $soluong = NumOfRows($dx,PREFIX_NAME.'diamond_hk'.SUPFIX_NAME,"$wh"); //echo "SQL: $ds"; $diamond = []; if($drs = $dx->get_results($ds)){ foreach($drs as $dr){ $s = "SELECT * FROM ".PREFIX_NAME."diamon_hk_url WHERE Stock_NO ='".$dr->Stock_NO."' LIMIT 1"; $url = '' ; if($r = $dx->get_row($s)) { $url = $r->URL_NEW; } $explode_fullname = explode('x', $dr->measurement); $shape = explode(' ', $dr->shape); $info = [ 'id' => $dr->diaID, 'name' => 'Diamond '.stripslashes($dr->shape), 'image' => $fshape[$shape[0]][0], 'preview' => $fshape[$shape[0]][1], 'shape' => stripslashes($dr->shape), 'carat' => stripslashes($dr->carat), 'color' => stripslashes($dr->color), 'clarity' => stripslashes($dr->clarity), 'cut' => stripslashes($dr->cut), // 'measurement' => $dr->meas_length.'*'.$dr->meas_width.'*'.$dr->meas_depth, 'measurement' => $dr->measurement, 'table' => $dr->amount.'%', 'depth' => $dr->TD_.'% '.$explode_fullname[2].'mm', 'girdle' => $dr->Girdle, 'culet' => $dr->CUL, 'cert' => $dr->CERT_NO, 'fluorescent' => stripslashes($dr->fluorescent), 'price' => format_money($dr->Price,'đ','CTA'), 'bosuutap' =>preg_split("/[#,]/",$dr->Bosuutap,-1,PREG_SPLIT_NO_EMPTY), 'URL' => $url ]; $diamond[] = $info; } //bo su tap $bst = "SELECT * FROM ".PREFIX_NAME."diamond_collection".SUPFIX_NAME." WHERE Active='1'"; $bst_diamond = []; if($brs = $dx->get_results($bst)){ foreach($brs as $bt){ $info = [ 'id' => $bt->diacolID , 'name' => stripslashes($bt ->Ten), ]; $bst_diamond[] =$info; } } //get data table diamond_des if(!empty($_GET['name'])){ $pageURL = safe($_GET['name']); } $s = "SELECT * FROM ".PREFIX_NAME."diamond_des".SUPFIX_NAME." WHERE URL='$pageURL' LIMIT 1"; if($r = $dx->get_row($s)) { // Da ngon ngu if(MULTI_LANGUAGE && lc()!=DEFAULT_LANGUAGE){ $ss = "SELECT * FROM ".PREFIX_NAME."diamond_des_lg".SUPFIX_NAME." WHERE diadesID ='".$r->diadesID."' ".lw('AND'); if($rr = $dx->get_row($ss)){ foreach(['Mota','BanText','TagTitle'] as $key) { $r->$key = $rr->$key; } } } } if(empty($r->diadesID)) { $web['title'] = $title.' | '.$web['title']; } else { $brief = stripslashes($r->Mota); $txtSEO = stripslashes($r->BanText); $TagTitle = stripslashes($r->TagTitle); // Title tag for SEO $seot = stripslashes($r->TagTitle); if(empty($seot)) $seot = $title.' | '.$web['title']; if(!empty($seot)) $web['title'] = $seot; } } ?>

Shape (Hình dạng)

  • >

    Tất cả

  • $val) { ?>
  • >

Millimetre (Kích thước)

Carat (Trọng lượng)

Color (Màu sắc)

  • D
  • E
  • F
  • G
  • H
  • I
  • J
  • K
  • L
  • M

Cut (Chế tác)

  • Excellent
  • Very Good
  • Good
  • Fair

Clarity (Độ sạch)

  • FL
  • IF
  • VVS1
  • VVS2
  • VS1
  • VS2
  • SI1
  • SI2
  • I1
  • I2

Price(Giá tiền)

Shape (Hình dạng) filter_list

Color (Màu sắc) filter_list

Carat (Trọng lượng) filter_list ct - ct

Millimetre (Kích thước) filter_list li - li

Cut (Chế tác) filter_list

Clarity (Độ sạch) filter_list

Price (Giá tiền triệu VNĐ) filter_list

0) {?>
Diamond

Pagination($numPages,$curPage,$pageURL); ?>
get_results($sfaq)){ foreach($rfaq as $ra){ $infofaq = [ 'name' => stripslashes($ra->Ten), 'cautraloi' => stripslashes($ra->cautraloi) ]; // Da ngon ngu if(MULTI_LANGUAGE && lc()!=DEFAULT_LANGUAGE){ $ss = "SELECT * FROM ".PREFIX_NAME."FAQ_lg".SUPFIX_NAME." WHERE lgID='".$ra->faqID."' ".lw('AND'); if($rr = $dx->get_row($ss)){ $infofaq['name'] = stripslashes($rr->Ten); $infofaq['cautraloi'] = stripslashes($rr->cautraloi); } } $faq[] = $infofaq; } } if(count($faq) > 0){ foreach($faq as $key=> $pa){ ?>

keyboard_arrow_down keyboard_arrow_up

Sản phẩm đang cập nhật. Vui lòng liên hệ Hotline để được tư vấn chi tiết!