%Linkstart%Name%Linkstop"); $idPRDGRP = mysql_real_escape_string($idPRDGRP); if($idPRDGRP=="" ) { $parent = "-1"; $MenuTitle = $mainMenuTitle; } else $parent = getParentID($idPRDGRP); $childCount = countChildren($idPRDGRP); $GroupName = getGroupName($idPRDGRP); $ParentGroupName = getGroupName($parent); if($childCount==0) { $query = "SELECT * FROM wmsproduct_groups WHERE parent='$parent' AND Active=1 AND wmslang_id='$wmslang_id' ORDER BY sortIDX,Name"; } else { $query = "SELECT * FROM wmsproduct_groups WHERE parent='$idPRDGRP' AND Active=1 AND wmslang_id='$wmslang_id' ORDER BY sortIDX,Name"; } $result = mysql_query($query); $MenuMenuButton = "$BackToLabel"; $MenuTitle = "$GroupName"; if($childCount>0){ if($parent!=-1) $BackButton = "$BackToLabel"; else $BackButton = $MenuMenuButton; } else { if($parent!=-1) { $MenuTitle = "$ParentGroupName"; $GrantParent = getParentID($parent); if($GrantParent!=-1) { $parent = $GrantParent; $ParentGroupName = getGroupName($parent); $BackButton = "$BackToLabel"; } else $BackButton = $MenuMenuButton; } else $MenuTitle = $mainMenuTitle; } while( $row = mysql_fetch_array( $result ) ) { if($row['Name']==$GroupName) $Name = "".$row['Name'].""; else $Name = $row['Name']; $output.= str_ireplace(array('%name','%linkstart','%linkstop'), array($Name,"",''), $viewGroupTemplate); } if($result) mysql_free_result($result); return "$MenuTitle
$output

$BackButton"; } function getChildren($parent,$selected,$wmslang_id,$step=0) { $query = "SELECT * FROM wmsproduct_groups WHERE Active=1 AND wmslang_id='$wmslang_id' AND parent=$parent ORDER BY sortIDX,Name"; $results = mysql_query( $query ); while( $row = mysql_fetch_array( $results ) ) { $idPRDGRP = $row['idPRDGRP']; if( $row['parent']==-1 ) $step = 0; if($selected==$idPRDGRP) { $selStyle = "style='color:#ff2222;font-weight:bold;'"; } else { $selStyle = ""; } if(countChildren($idPRDGRP)>0) { if($row['parent']==-1) $style ="font-size:12pt;font-weight:bold;"; else { $style ="font-size:11pt;padding-left:".$step * 15 . "px"; } $output.= "
".$row['Name']."
"; $output.= getChildren($idPRDGRP,$selected,$wmslang_id,$step+1); $output.= "
"; } else { $left = $step * 15 . "px"; $output.= "
$selPrefix".$row['Name']."
"; } } mysql_free_result($results); return $output; } function product_viewgroupnavigatorlong($idPRDGRP,$wmslang_id="NL") { $idPRDGRP = mysql_real_escape_string($idPRDGRP); $output.= getChildren(-1,$idPRDGRP,$wmslang_id,0); if( $idPRDGRP=="" ) $selColor = "#ff2222"; else $selColor = "inherrit"; return "
Productgroepen..

$output"; } $output = product_viewgroupnavigatorlong($_GET['idPRDGRP']); ?>Product eigenschappen:
"); $PropertyItemTemplate = loadSetting("productcatalogus","template.PropertyItem","%PropertyName:
%PropertyValue 

"); $query = "SELECT a.PropertyValue,b.Description FROM wmsproduct_properties as a, wmsproduct_propertyfields as b ". "WHERE a.PRDCODE='$PRDCODE' AND a.Active=1 AND b.idProductPropertyField=a.idProductPropertyField AND a.wmslang_id='$wmslang_id' AND b.wmslang_id='$wmslang_id' ORDER BY a.sortIDX,b.Description"; $result = mysql_query($query); while( $row = mysql_fetch_array( $result ) ) { $tmpTemplate = $PropertyItemTemplate; if( $row['showFieldname']==1 ) $Description = $row['Description'].":"; else $Description = ""; $output.= str_ireplace(array('%PropertyName','%PropertyValue'),array($Description,nl2br($row['PropertyValue'])),$tmpTemplate); } mysql_free_result($result); if($output!="") $output = "$viewPropertyTitle$output"; return $output; } function getImageList($PRDCODE) { $ImageListItemTemplate = loadSetting("productcatalogus","template.ImageListItem","
"); $productsImagePath = loadSetting("productcatalogus","productsImagePath","/wmspub/var/products/images"); $query = "SELECT a.*,b.Name as ProductName FROM wmsproduct_images as a, wmsproducts as b WHERE a.PRDCODE='$PRDCODE' AND b.PRDCODE=a.PRDCODE AND b.Active=1 ORDER BY sortIDX"; $result = mysql_query($query); if(mysql_num_rows($result)>0){ while( $row = mysql_fetch_array( $result ) ) { $imgFileSmall = "$productsImagePath/".$row['filenameSmall']; $imgFileNormal = "$productsImagePath/".$row['filenameNormal']; $imgFileBig = "$productsImagePath/".$row['filenameBig']; $tmpTemplate = $ImageListItemTemplate; $output.= str_ireplace(array('%imgFileSmall','%imgFileNormal','%imgFileBig','%imgDescription','%imgCopyright','%ProductTitle'),array($imgFileSmall,$imgFileNormal,$imgFileBig,$row['Description'],$row['Copyright'],$row['ProductName']),$tmpTemplate); } mysql_free_result($result); } return $output; } function countProducts2($idPRDGRP) { $query = "SELECT count(idPRDGRP) as recCount FROM wmsproducts WHERE idPRDGRP='$idPRDGRP'"; $result = mysql_query($query); $row = mysql_fetch_array($result); mysql_free_result($result); return $row['recCount']; } function getGroupPath($idPRDGRP,$wmslang_id="NL",$sales=0) { $grouppathStartLabel = loadSetting("productcatalogus","grouppathStartLabel.$wmslang_id","Producten"); $grouppathDelimter = loadSetting("productcatalogus","grouppathDelimter"," / "); $salesMenuTitle = loadSetting("productcatalogus","salesMenuTitle.$wmslang_id","Aanbiedingen"); $query = "SELECT grouppath FROM wmsproduct_groups WHERE idPRDGRP='$idPRDGRP' AND wmslang_id='$wmslang_id' AND Active=1"; $result = mysql_query($query); $row = mysql_fetch_array($result); mysql_free_result($result); if($grouppathStartLabel!="") $grouppathStartLabel = "$grouppathStartLabel"; if($sales==1) $groupPath = "$grouppathStartLabel$grouppathDelimter$salesMenuTitle"; else { if($row['grouppath']!=""&&$grouppathStartLabel!="") $grouppathStartLabel.= $grouppathDelimter; $groupPath = $grouppathStartLabel.$row['grouppath']; } return $groupPath; } function getGroupDescription($idPRDGRP,$wmslang_id="NL") { //Get description if turned on.. if(loadSetting("productcatalogus","ViewGroupDescription","1")==1) { $query = "SELECT Description FROM wmsproduct_groups WHERE idPRDGRP='$idPRDGRP' AND wmslang_id='$wmslang_id'"; $result = mysql_query($query); $row = mysql_fetch_array($result); mysql_free_result($result); $GroupDescription = nl2br($row['Description']); } else $GroupDescription = ""; return $GroupDescription; } function getModelsOptions($idProductModels,$wmslang_id="NL") { $query = "SELECT models FROM wmsproduct_models WHERE idProductModels='$idProductModels' AND wmslang_id='$wmslang_id'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $models = explode(";",$row['models']); foreach( $models as $val ) { $options.= ""; } return ""; } function productTiles($wmslang_id="NL") { $groupname = "productcatalogus"; $order = ""; $Filter = ""; $TemplateStandardTile = loadSetting($groupname,"template.standardTile.$wmslang_id",""); $productsImagePath = loadSetting($groupname,"productsImagePath","/wmspub/var/products/images"); $ButtonBuyTemplate = loadSetting($groupname,"template.ButtonBuy.$wmslang_id",""); $ButtonRFQTemplate = loadSetting($groupname,"template.ButtonRFQ.$wmslang_id",""); $currency = loadSetting($groupname,"currency","€"); $query = "SELECT a.*,b.Description,b.DescriptionShort,b.Active as descActive,c.Name as GroupName,c.Parent as parent FROM wmsproducts as a,wmsproduct_description as b, wmsproduct_groups as c ". "WHERE a.Highlight=1 AND a.Active=1 AND b.PRDCODE=a.PRDCODE AND b.wmslang_id='$wmslang_id' AND c.idPRDGRP=a.idPRDGRP AND c.wmslang_id='$wmslang_id' AND c.Active=1 ORDER BY a.onTop DESC,a.sortIDX,a.Name"; $result = mysql_query($query); while( $row = mysql_fetch_array( $result ) ) { $StripGroupName = preg_replace('/[^A-Za-z0-9-_]/', '',str_replace(" ","_",$row['GroupName'])); $StripPRDName = preg_replace('/[^A-Za-z0-9-_]/', '',str_replace(" ","_",$row['Name'])); $PRDCODE = $row['PRDCODE']; $idPRDGRP = $row['idPRDGRP']; $parent = $row['parent']; # Set Tile.. $q = "SELECT tileTemplate,tileUseDefault FROM wmsproduct_groups WHERE idPRDGRP='$idPRDGRP'"; $r = mysql_query($q); $d = mysql_fetch_array( $r ); if($row['tileUseDefault']==1) $TemplateDefTile = loadSetting($groupname,"template.standardTile.$wmslang_id",""); else $TemplateDefTile = $d['tileTemplate']; mysql_free_result( $r ); //Get image.. $query = "SELECT * FROM wmsproduct_images WHERE PRDCODE='$PRDCODE' ORDER BY sortIDX LIMIT 0,1"; $result2 = mysql_query($query); if(mysql_num_rows($result2)>0) { $row2 = mysql_fetch_array($result2); $imageFileSmall = "$productsImagePath/".$row2['filenameSmall']; $imageFileNormal= "$productsImagePath/".$row2['filenameNormal']; mysql_free_result( $result2 ); } else { $imageFileSmall="/wmspub/var/products/catalog/_noimage.png"; $imageFileNormal="/wmspub/var/products/catalog/_noimage.png"; } //Pricing.. setlocale(LC_MONETARY, 'nl_NL'); if($row['SalesPrice']>0) { $salesPrice = $row['SalesPrice']; $normalPrice = $row['Price']; $TileTemplate = $TemplateSalesTile; } else { if($row['Price']>0) $normalPrice = $row['Price']; else { $normalPrice = ""; $directBuyButton=""; } $TileTemplate = $TemplateDefTile; } //Discount is only calculated over normal price.. if($row['Discount']>0&&$row['SalesPrice']==0) { $TileTemplate = $TemplateSalesTile; $salesPrice = $normalPrice * (1-($row['Discount']/100)); } if($normalPrice>0) $normalPrice = str_ireplace("EUR","$currency",money_format('%.2n',$normalPrice)); if($salesPrice>0) $salesPrice = str_ireplace("EUR","$currency",money_format('%.2n',$salesPrice)); if($row['idProductModels']!=-1) $product_models = getModelsOptions($row['idProductModels'],$wmslang_id); else $product_models = ""; $BuyButtonURL = "/winkelwagen.html?action=add&prdcode=$PRDCODE"; if($row['shoppingCart']==0||$row['Price']==0) $BuyButton = ""; else $BuyButton = str_ireplace( array('%PRDCODE','%ProductName','%ButtonAction','%models'),array($row['PRDCODE'],$row['Name'],"document.location.href=$BuyButtonURL",$product_models),$ButtonBuyTemplate); $RFQButtonURL = "/$wmslang_id/question/$salesLink$idPRDGRP/$StripGroupName/$PRDCODE/$StripPRDName.html"; $RFQButton = str_ireplace( array('%ProductName','%ButtonAction'),array($row['Name'],"document.location.href='$RFQButtonURL';"),$ButtonRFQTemplate); //Description.. if($row['descActive']==1) { if($row['DescriptionShort']!="") { $Description = $row['DescriptionShort']; } else { if(strlen($row['Description'])>125) $Description = strip_tags(substr($row['Description'],0,125)."..."); else $Description = strip_tags($row['Description']); } } else $Description = ""; $output.= str_ireplace( array('%name','%description','%models','%normalPrice','%salesPrice','%imageFileSmall','%imageFileNormal','%BuyButton','%RFQButton','%linkstart','%linkstop','%Anchor'), array($row['Name'],$Description,$product_models,$normalPrice,$salesPrice,$imageFileSmall,$imageFileNormal,$BuyButton,$RFQButton,"",''," "),$TileTemplate); } return "$output"; } $wmslang_id = "NL"; $output = productTiles("$wmslang_id",1); ?> Allurewielen.nl - startpagina
Allure-wielen
Zandvoort 23
9331 JH, Norg


WIELBOUWERS          SINDS                             1977



(c) 2016 Allurewielen.nl