conn_open(); ?> query($sql_y,$conn); $row_y=$db->num_rows($result_y); for ($i_y=0;$i_y<$row_y;$i_y++){ $rs_y=$db->fetch_array($result_y,MYSQL_BOTH); $rs_height[]=$rs_y["class_height"]; $rs_width[]=$rs_y["class_width"]; $rs_length[]=$rs_y["class_length"]; $rs_depth[]=$rs_y["class_depth"]; $rs_weight[]=$rs_y["class_weight"]; $rs_classid[]=$rs_y["class_id"]; if ($type_array){ $type_array="".$rs_y["type"].",".$type_array.""; }else{ $type_array=$rs_y["type"]; } if ($material_array){ $material_array="".$rs_y["material"].",".$material_array.""; }else{ $material_array=$rs_y["material"]; } if ($style_array){ $style_array="".$rs_y["style"].",".$style_array.""; }else{ $style_array=$rs_y["style"]; } if ($seasons_array){ $seasons_array="".$rs_y["seasons"].",".$seasons_array.""; }else{ $seasons_array=$rs_y["seasons"]; } if ($Gender_array){ $Gender_array="".$rs_y["Gender"].",".$Gender_array.""; }else{ $Gender_array=$rs_y["Gender"]; } } } foreach($rs_classid as $classid_diao){ $sql_color="select * from item_attr_val where attr_key_id=1 and item_id=$classid_diao order by attribute_val_id asc"; $result_color=$db->query($sql_color,$conn); $row_color=$db->num_rows($result_color); for ($i_color=0;$i_color<$row_color;$i_color++){ $rs_color=$db->fetch_array($result_color,MYSQL_BOTH); if ($color_array){ $color_array="".$rs_color["attr_value"].",".$color_array.""; }else{ $color_array=$rs_color["attr_value"]; }}} foreach($rs_classid as $classid_diao){ $sql_size="select * from item_attr_val where attr_key_id=2 and item_id=$classid_diao order by attribute_val_id asc"; $result_size=$db->query($sql_size,$conn); $row_size=$db->num_rows($result_size); for ($i_size=0;$i_size<$row_size;$i_size++){ $rs_size=$db->fetch_array($result_size,MYSQL_BOTH); if ($size_array){ $size_array="".$rs_size["attr_value"].",".$size_array.""; }else{ $size_array=$rs_size["attr_value"]; }}} // $size_array=explode(",",$size_array); $size_array_count=array_count_values($size_array); $size_array=array_unique(array_filter($size_array)); if($_GET['size']){ $size=explode("_",$_GET['size']); foreach($size as $size_r){ $sql_size2="select * from item_attr_val where attr_key_id=2 and attr_value='".$size_r."' order by attribute_val_id asc"; $result_size2=$db->query($sql_size2,$conn); $row_size2=$db->num_rows($result_size2); for ($i_size2=0;$i_size2<$row_size2;$i_size2++){ $rs_size2=$db->fetch_array($result_size2,MYSQL_BOTH); $class_id_size=$rs_size2["item_id"]; if($i_size2==0){ $strp_size=" class_id=$class_id_size "; }else{ $strp_size=" ( ".$strp_size." or class_id=$class_id_size ) "; } } $strp_size=" and ".$strp_size." "; } }else{ $strp_size=" "; } // $color_array=explode(",",$color_array); $color_array_count=array_count_values($color_array); $color_array=array_unique(array_filter($color_array)); if($_GET['color']){ $color=explode("_",$_GET['color']); foreach($color as $color_r){ $sql_color2="select * from item_attr_val where attr_key_id=1 and attr_value='".$color_r."' order by attribute_val_id asc"; $result_color2=$db->query($sql_color2,$conn); $row_color2=$db->num_rows($result_color2); for ($i_color2=0;$i_color2<$row_color2;$i_color2++){ $rs_color2=$db->fetch_array($result_color2,MYSQL_BOTH); $class_id_color=$rs_color2["item_id"]; if($i_color2==0){ $strp_color=" class_id=$class_id_color "; }else{ $strp_color=" ( ".$strp_color." or class_id=$class_id_color ) "; } } $strp_color=" and ".$strp_color." "; } }else{ $strp_color=" "; } // $type_array=explode(",",$type_array); $type_array_count=array_count_values($type_array); $type_array=array_unique(array_filter($type_array)); if($_GET['type']){ $type=explode("_",$_GET['type']); foreach($type as $type_r){ $strp_type=" and (type like '%".$type_r."%' ) "; } }else{ $strp_type=" "; } // $material_array=explode(",",$material_array); $material_array_count=array_count_values($material_array); $material_array=array_unique(array_filter($material_array)); if($_GET['material']){ $material=explode("_",$_GET['material']); foreach($material as $material_r){ $strp_material=" and (material like '%".$material_r."%' ) "; } }else{ $strp_material=" "; } // $style_array=explode(",",$style_array); $style_array_count=array_count_values($style_array); $style_array=array_unique(array_filter($style_array)); if($_GET['style']){ $style=explode("_",$_GET['style']); foreach($style as $style_r){ $strp_style=" and (style like '%".$style_r."%' ) "; } }else{ $strp_style=" "; } // $seasons_array=explode(",",$seasons_array); $seasons_array_count=array_count_values($seasons_array); $seasons_array=array_unique(array_filter($seasons_array)); if($_GET['seasons']){ $seasons=explode("_",$_GET['seasons']); foreach($seasons as $seasons_r){ $strp_seasons=" and (seasons like '%".$seasons_r."%' ) "; } }else{ $strp_seasons=" "; } // $Gender_array=explode(",",$Gender_array); $Gender_array_count=array_count_values($Gender_array); $Gender_array=array_unique(array_filter($Gender_array)); if($_GET['Gender']){ $Gender=explode("_",$_GET['Gender']); foreach($Gender as $Gender_r){ $strp_Gender=" and (Gender like '%".$Gender_r."%' ) "; } }else{ $strp_Gender=" "; } // $height_max=max(array_filter($rs_height)); $height_min=min(array_filter($rs_height)); // $height_array=explode(",",$rs_height); $height_array_count=array_count_values($rs_height); $height_array=array_unique(array_filter($rs_height)); if($_GET['height']){ $height=explode("_",$_GET['height']); foreach($height as $height_r){ $strp_height=" and (class_height like '%".$height_r."%' ) "; } }else{ $strp_height=" "; } // $width_max=max(array_filter($rs_width)); $width_min=min(array_filter($rs_width)); // $width_array=explode(",",$rs_width); $width_array_count=array_count_values($rs_width); $width_array=array_unique(array_filter($rs_width)); if($_GET['width']){ $width=explode("_",$_GET['width']); foreach($width as $width_r){ $strp_width=" and (class_width like '%".$width_r."%' ) "; } }else{ $strp_width=" "; } // $length_max=max(array_filter($rs_length)); $length_min=min(array_filter($rs_length)); // $length_array=explode(",",$rs_length); $length_array_count=array_count_values($rs_length); $length_array=array_unique(array_filter($rs_length)); if($_GET['length']){ $length=explode("_",$_GET['length']); foreach($length as $length_r){ $strp_length=" and (class_length like '%".$length_r."%' ) "; } }else{ $strp_length=" "; } // $depth_max=max(array_filter($rs_depth)); $depth_min=min(array_filter($rs_depth)); // $depth_array=explode(",",$rs_depth); $depth_array_count=array_count_values($rs_depth); $depth_array=array_unique(array_filter($rs_depth)); if($_GET['depth']){ $depth=explode("_",$_GET['depth']); foreach($depth as $depth_r){ $strp_depth=" and (class_depth like '%".$depth_r."%' ) "; } }else{ $strp_depth=" "; } // $weight_max=max(array_filter($rs_weight)); $weight_min=min(array_filter($rs_weight)); // $weight_array=explode(",",$rs_weight); $weight_array_count=array_count_values($rs_weight); $weight_array=array_unique(array_filter($rs_weight)); if($_GET['weight']){ $weight=explode("_",$_GET['weight']); foreach($weight as $weight_r){ $strp_weight=" and (class_weight like '%".$weight_r."%' ) "; } }else{ $strp_weight=" "; } ?> =$prices_s and price <=$prices_e "; }else{ $strp=" "; } $rating=$_GET['rating']; if($rating!=""){ if($rating==100){ $leftrating=" and xinxin=0 "; }elseif($rating==1){ $leftrating=" and xinxin=1 "; }elseif($rating==2){ $leftrating=" and xinxin=2 "; }elseif($rating==3){ $leftrating=" and xinxin=3 "; }elseif($rating==4){ $leftrating=" and xinxin=4 "; }elseif($rating==5){ $leftrating=" and xinxin=5 "; } }else{ $leftrating=" "; } $sortby=$_GET['sortby']; if($sortby==1){ $sortbydingyi=" order by price asc "; }elseif($sortby==2){ $sortbydingyi=" order by price desc "; }elseif($sortby==3){ $sortbydingyi=" order by class_title asc "; }elseif($sortby==4){ $sortbydingyi=" order by class_id desc "; }elseif($sortby==5){ $sortbydingyi="order by rating desc "; }elseif($sortby==6){ $sortbydingyi="order by class_id asc "; }elseif($sortby==7){ $sortbydingyi="order by tj_cata desc,class_order desc "; }else{ $sortbydingyi=" order by class_order desc "; } ?> -Product-