$title = lg('Diamond'); $pageURL = safe($_GET['content']); $web['title'] = $title.' | '.$web['title']; ?>
include_once('_header.php')?>'.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ả
Millimetre (Kích thước)
Carat (Trọng lượng)
Color (Màu sắc)
Cut (Chế tác)
Clarity (Độ sạch)
Price(Giá tiền)
Shape (Hình dạng) $name = $filtr['shape']; if($name=='') $name = 'Tất cả'; echo $name; ?>
Color (Màu sắc)
Carat (Trọng lượng) ct - ct
Millimetre (Kích thước) li - li
Cut (Chế tác)
Clarity (Độ sạch)
Price (Giá tiền triệu VNĐ)
Tất cả
Tất cả
if(count($bst_diamond)>0) { foreach($bst_diamond as $bt){ ?>}}?>
Shape
Millimetre (mm)
Carat
Color
Clarity
Cut
Fluorescent
GIA Report
![]()
|
|
Measurement(mm)
Carat
Color
Clarity
Cut
Fluorescent