assign('select_b_id',$b_id); $where_product=array(80=>$b_id); } $rela_data=load_rela_sel_data(3,$parent_id=FALSE); foreach($rela_data as $r_row){ $shop_site[$r_row['r_id']]=$r_row['r_name']; $shop_site_en[$r_row['r_id']]=$r_row['r_name_en']; } $rela_data=load_rela_sel_data(1,$parent_id=FALSE); foreach($rela_data as $r_row){ $sex_data[$r_row['r_id']]=$r_row['r_name']; } $rela_data=load_rela_sel_data(2,$parent_id=FALSE); foreach($rela_data as $r_row){ $price_data[$r_row['r_id']]=$r_row['r_name']; } //----------------------------------------brand_list $info_list=load_info_font_data_list(5); $$info_list['assign_var']=$info_list['list']; $tpl->assign($info_list['assign_var'],$info_list['list']); //----------------------------------------brand_list end //----------------------------------------product_list $info_list=load_info_font_data_list(6,FALSE,$where_product,$where_custem,$where_or); $$info_list['assign_var']=$info_list['list']; //----------------------------------------product_list end //----------------------------------------product_type_list $info_list=load_info_font_data_list(7); $$info_list['assign_var']=$info_list['list']; $tpl->assign($info_list['assign_var'],$info_list['list']); //----------------------------------------product_type_list end foreach($product_list as $p_id=>$p_row){ $product_list[$p_id]['brand_name']=$brand_list[$p_row['brand_id']]['name']; $product_list[$p_id]['p_type_image']=$p_type_list[$p_row['p_type_id']]['image']; $product_list[$p_id]['sex_name']=$sex_data[$p_row['sex']]; $product_list[$p_id]['price_name']=$price_data[$p_row['price_id']]; } //---------------------------------------------find selected brand data $selected=false; $prev_selected=false; $next_selected=false; foreach($brand_list as $b_key=>$b_row){ if($b_key!=$b_id and $selected==false){ $prev_b_id=$b_key; $prev_selected=true; }elseif($b_key!=$b_id and $selected==true and $next_selected==false){ $next_b_id=$b_key; $next_selected=true; } if($b_key==$b_id){ $selected_brand=$b_row; $selected_brand['prev_b_id']=$prev_b_id; $selected=true; } } $selected_brand['next_b_id']=$next_b_id; if($prev_selected==false){ $selected_brand['prev_b_id']=$b_id; } if($next_selected==false){ $selected_brand['next_b_id']=$b_id; } //---------------------------------------------find selected brand data end $tpl->assign('product_list',$product_list); $tpl->assign('selected_brand',$selected_brand); $tpl->display('collection.html'); ?>