
set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    `URLLabel` = 'contacts'
                LIMIT 1

SELECT
                *
	        FROM
	        	`pages`
	    	WHERE
                `URLLabel` = 'contacts' AND
                `Language` = 'bg'
            LIMIT 1

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `URLLabel`
            FROM
                `pages`
            WHERE
                `Rules` = 'gdpr' AND
                `Language` = 'bg'
         AND `Visible` = 1 LIMIT 1

SELECT
                `TermsLabel`,
                `TermsLinkLabel`,
                `TermsUrlLabel`
	        FROM
	        	`contacts`
	    	WHERE
                `Language` = 'bg'
            LIMIT 1

set names utf8

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT `ID`, `UserKey` FROM `users` WHERE `UserKey` LIKE 'w5vClsOAwpXDqcKnw4HCncK3w5fCsMOLw5zCu8KTw5rCpcKx%' LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

UPDATE `users` SET `LastUpdate` = NOW(), `AccessKey` = '' WHERE `ID` = 33

set names utf8

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT `ID`, `UserKey` FROM `users` WHERE `UserKey` LIKE 'w5_Cp8KzwqfDq8KjwpbCocOYw6jCqsOcw5TCv8ONw6DCmXLCpsOO%' LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

SELECT * FROM `users` WHERE `ID` = 109 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 109

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT
                    *
                FROM
                    `groups`
                WHERE
                    `URLLabel` = 'starters' AND
                    `Language` = 'bg' AND
                    `Visible` = 1
                LIMIT 1

SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'bg'
                 AND `parts`.`Visible` = 1
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
         LIMIT 0, 12

SELECT COUNT(*) AS NumRows FROM (
            SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'bg'
                 AND `parts`.`Visible` = 1
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
        ) AS CountTable

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'starters' AND
                `Language` = 'bg' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 109 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 109

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 109

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1852

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'BGN'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1854

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8005' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142427

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8006R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142250

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8038R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1888

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148241

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 120023

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8064' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8072RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1932

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8083' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2190

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8341' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8374' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 139384

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8374V' AND `Quantity` > 0 ORDER BY `Store` DESC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `users`.`ID` = 109
                LIMIT 3
            ) AS `Result`;

SELECT `Basket` FROM `basket` WHERE `UserID` = 109 LIMIT 1

SELECT `MinQuantity` FROM `parts` WHERE `ID` = 1854

INSERT INTO  `basket`
                        (`UserID`, `PostDate`, `UpdateDate`, `Basket`, `Num`) VALUES
                        (109, NOW(), NOW(), '{"1854":{"qty":1,"price":0,"note":"","number":"0986017120, 0001107401, 0001107402"}}', 1)

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT `Basket` FROM `basket` WHERE `UserID` = 109 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 109

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PriceGroup`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `parts`.`IsPromo`,
                    `ParentGroup`.`Title` AS `ParentGroupName`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`Title` AS `SubGroupName`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    -- `prices`.`Price` AS `UserPrice`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `availabilities`.`Quantity`
                FROM
                    `parts`
                    INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                    INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                    INNER JOIN `groups` AS `SubGroup` ON
                        `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                        `SubGroup`.`Language` = 'bg'
                    LEFT JOIN `groups` AS `ParentGroup` ON
                        `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                        `ParentGroup`.`Language` = 'bg'
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                    LEFT JOIN `availabilities` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'BGN'
             AND `Visible` = 1 LIMIT 1

SELECT `ID` FROM `orders` WHERE `UserID` = 109 AND `Status` = 0 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 109 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

UPDATE `users` SET `LastUpdate` = NOW(), `AccessKey` = '' WHERE `ID` = 109

set names utf8

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT `ID`, `UserKey` FROM `users` WHERE `UserKey` LIKE 'w5vClsOAwpXDqcKnw4HCncK3w5fCsMOLw5zCu8KTw5rCpcKx%' LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 3
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 33

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 33
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `orders`.*,
                `users`.`Data` AS `UserData`,
                RIGHT(`UserKey`, 1) AS `Access`
            FROM
                `orders`
                LEFT JOIN `users` ON `orders`.`UserID` = `users`.`ID`
            WHERE
                `orders`.`Status` > 0
         ORDER BY `orders`.`LastUpdate` DESC LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                `orders`.*,
                `users`.`Data` AS `UserData`,
                RIGHT(`UserKey`, 1) AS `Access`
            FROM
                `orders`
                LEFT JOIN `users` ON `orders`.`UserID` = `users`.`ID`
            WHERE
                `orders`.`Status` > 0
         ORDER BY `orders`.`LastUpdate` DESC) AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Code`, `Name` FROM `countries` ORDER BY `countries`.`Name` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `ID`,
                    `UserKey`,
                    `Data`
                FROM
                    `users`
                WHERE
                    `users`.`SearchKey` LIKE '%w5h9wpTC%'
                ORDER BY
                    CASE
                        WHEN `users`.`SearchKey` LIKE 'w5h9wpTC%' THEN 0
                        ELSE 1
                    END
                LIMIT 20

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 109 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `ID`, `RefNumber` FROM `parts` WHERE `RefNumber` LIKE 'IR8005%' LIMIT 20

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `PriceListID` FROM `users` WHERE `ID` = 109 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 109

SELECT
                    `Exchange`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'BGN'
                LIMIT 1

SELECT
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1854

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1854 AND
                    `users`.`ID` = 109
                LIMIT 3
            ) AS `Result`;

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                *
            FROM
                `users`
            WHERE 1
         LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                *
            FROM
                `users`
            WHERE 1
        ) AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                *
            FROM
                `users`
            WHERE 1
         AND `SearchKey` LIKE '%w5h9wpTCpMOaZ8Kow%' LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                *
            FROM
                `users`
            WHERE 1
         AND `SearchKey` LIKE '%w5h9wpTCpMOaZ8Kow%') AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 109 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 3
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 109

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 109
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                *
            FROM
                `users`
            WHERE
                `ID` = 109
            LIMIT 1

SELECT * FROM `user-price-groups` WHERE `UserID` = 109

SELECT `Code`, `Name` FROM `countries` ORDER BY `countries`.`Name` ASC

SELECT DISTINCT `Brand` FROM `part-brands` WHERE 1

SELECT `ID`, `ListName` FROM `pricelist` WHERE `ID` != 687

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 3
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 33

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 33
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 33
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    *
                FROM
                    `groups`
                WHERE
                    `URLLabel` = 'starters' AND
                    `Language` = 'bg' AND
                    `Visible` = 1
                LIMIT 1

SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'bg'
                 AND `parts`.`Visible` = 1
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
         LIMIT 0, 12

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

SELECT COUNT(*) AS NumRows FROM (
            SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'bg'
                 AND `parts`.`Visible` = 1
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
        ) AS CountTable

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'starters' AND
                `Language` = 'bg' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 3
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1030
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                *
            FROM
                `users`
            WHERE 1
         LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                *
            FROM
                `users`
            WHERE 1
        ) AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                *
            FROM
                `users`
            WHERE 1
         AND `SearchKey` LIKE '%w5DCosKgwqfDmmfCqMKcw5rDnsKVw5bDlsK9w%' LIMIT 0, 30

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                *
            FROM
                `users`
            WHERE 1
         AND `SearchKey` LIKE '%w5DCosKgwqfDmmfCqMKcw5rDnsKVw%' LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                *
            FROM
                `users`
            WHERE 1
         AND `SearchKey` LIKE '%w5DCosKgwqfDmmfCqMKcw5rDnsKVw%') AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 99 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 702
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 99

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 99
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'bg' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'bg' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'bg' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'bg' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'bg' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'bg' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'bg'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'pl' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'pl' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'pl' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'pl' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'pl'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'pl'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'pl'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT
                    *
                FROM
                    `groups`
                WHERE
                    `URLLabel` = 'starters' AND
                    `Language` = 'pl' AND
                    `Visible` = 1
                LIMIT 1

SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'pl'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'pl'
                 AND `parts`.`Visible` = 1
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
         LIMIT 0, 12

SELECT COUNT(*) AS NumRows FROM (
            SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'pl'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'pl'
                 AND `parts`.`Visible` = 1
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
        ) AS CountTable

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'starters' AND
                `Language` = 'pl' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'pl' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'pl'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'pl'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                    *
                FROM
                    `groups`
                WHERE
                    `URLLabel` = 'starters' AND
                    `Language` = 'pl' AND
                    `Visible` = 1
                LIMIT 1

SELECT
                `parts`.*,
                `part-texts`.*,
                IF(`ParentGroup`.`URLLabel` IS NULL, `SubGroup`.`URLLabel`, '') AS `ParentGroupUrlLabel`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'pl'
            WHERE
                `parts`.`Visible` = 1 AND
                `parts`.`ID` = 142427 AND
                `part-texts`.`Language` = 'pl'
            LIMIT 1

SELECT
                GROUP_CONCAT(`groups`.`MenuLabel` SEPARATOR ', ') AS `Groups`
            FROM
                `groups`
                INNER JOIN `part-groups` ON `part-groups`.`GroupID` = `groups`.`ID`
                INNER JOIN `parts` ON `parts`.`ID` = `part-groups`.`PartID`
            WHERE
                `parts`.`ID` = 142427 AND
                `groups`.`Language` = 'pl'
            GROUP BY
                `parts`.`ID`

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 142427 AND
                `Language` = 'pl'
            ORDER BY
                `Parameter` ASC

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` > 1000 AND
                `PartID` = 142427 AND
                `Language` = 'pl'
            ORDER BY
                `Parameter` ASC

SELECT DISTINCT
                    `parts`.`RefNumber`,
                    `brands`.`ID`,
                    `brands`.`Title`,
                    `part-brands`.`BrandNumber`,
                    `part-brands`.`BrandNumberSearch`,
                    `applications`.`BrandNumberSearch` AS `OrgNumber`,
                    `brands`.`PartVisible`
                FROM
                    `part-brands`
                    INNER JOIN `brands` ON `part-brands`.`Brand` = `brands`.`Title`
                    INNER JOIN `parts` ON `part-brands`.`RefNumber` = `parts`.`RefNumber`
                    LEFT JOIN `applications` ON `applications`.`BrandNumberSearch` = `part-brands`.`BrandNumberSearch`
                WHERE
                    `parts`.`ID` = 142427  AND `brands`.`PartVisible` = 1 
                ORDER BY
                    `brands`.`Title`,
                    `part-brands`.`BrandNumber`

SELECT DISTINCT
                `parts`.`RefNumber`,
                `brands`.`ID`,
                 UPPER(`applications`.`Brand`) AS `Title`,
                `applications`.`BrandNumber`,
                `applications`.`BrandNumberSearch`,
                `part-brands`.`BrandNumberSearch` AS `PartsNumber`,
                `brands`.`PartVisible`
            FROM
                `applications`
                INNER JOIN `brands` ON `applications`.`Brand` = `brands`.`Title`
                INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                LEFT JOIN `part-brands` ON `applications`.`BrandNumberSearch` = `part-brands`.`BrandNumberSearch`
            WHERE
                `parts`.`ID` = 142427  AND `brands`.`PartVisible` = 1 
            GROUP BY
                `applications`.`BrandNumber`
            ORDER BY
                `applications`.`Brand`,
                `applications`.`BrandNumber`

SELECT DISTINCT
                `Marque`,
                `ModelName`,
                `ModelType`,
                `Carburant`,
                `Engine`,
                `DateDebut`,
                `DateFin`,
                `TypeID`
            FROM
                `vehicles`
                INNER JOIN `parts` ON `vehicles`.`RefNumber` = `parts`.`RefNumber`
            WHERE
                `parts`.`ID` = 142427
            ORDER BY
                `Marque`, `ModelName`

SELECT
                `equivalents`.*,
                `parts`.`ID` AS `PartID`,
                `part-texts`.`URLLabel` AS `PartURLLabel`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`
            FROM
                `equivalents`
                INNER JOIN `parts` ON `equivalents`.`EquivalentNumber` = `parts`.`RefNumber`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'pl'
            WHERE
                `part-texts`.`Language` = 'pl' AND
                `equivalents`.`Language` = 'pl' AND
                `equivalents`.`RefNumber` = 'IR8006R'
            GROUP BY `parts`.`ID`

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'starters' AND
                `Language` = 'pl' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'pl' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'pl'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'pl'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                    *
                FROM
                    `groups`
                WHERE
                    `URLLabel` = 'alternators-parts' AND
                    `Language` = 'pl' AND
                    `Visible` = 1
                LIMIT 1

SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'pl'
        
            WHERE
                (`SubGroup`.`ID` = 26 OR `ParentGroup`.`ID` = 26) AND
                `part-texts`.`Language` = 'pl'
                 AND `parts`.`Visible` = 1
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
         LIMIT 0, 12

SELECT COUNT(*) AS NumRows FROM (
            SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'pl'
        
            WHERE
                (`SubGroup`.`ID` = 26 OR `ParentGroup`.`ID` = 26) AND
                `part-texts`.`Language` = 'pl'
                 AND `parts`.`Visible` = 1
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
        ) AS CountTable

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'alternators-parts' AND
                `Language` = 'pl' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'pl' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'pl'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 26 OR `ParentGroup`.`ID` = 26)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                    `groups`.`URLLabel` AS `ParentURLLabel`,
                    `groups`.`Title` AS `ParentTitle`,
                    `SubGroups`.*
                FROM
                    `groups`
                    INNER JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
                WHERE
                    `groups`.`URLLabel` = 'alternators-parts' AND
                    `groups`.`Language` = 'pl' AND
                    `groups`.`Visible` = 1 AND
                    `SubGroups`.`URLLabel` = 'fixed-pulleys' AND
                    `SubGroups`.`Language` = 'pl' AND
                    `SubGroups`.`Visible` = 1
                LIMIT 1

SELECT
                `parts`.*,
                `part-texts`.*,
                IF(`ParentGroup`.`URLLabel` IS NULL, `SubGroup`.`URLLabel`, '') AS `ParentGroupUrlLabel`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'pl'
            WHERE
                `parts`.`Visible` = 1 AND
                `parts`.`ID` = 158392 AND
                `part-texts`.`Language` = 'pl'
            LIMIT 1

SELECT
                GROUP_CONCAT(`groups`.`MenuLabel` SEPARATOR ', ') AS `Groups`
            FROM
                `groups`
                INNER JOIN `part-groups` ON `part-groups`.`GroupID` = `groups`.`ID`
                INNER JOIN `parts` ON `parts`.`ID` = `part-groups`.`PartID`
            WHERE
                `parts`.`ID` = 158392 AND
                `groups`.`Language` = 'pl'
            GROUP BY
                `parts`.`ID`

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 158392 AND
                `Language` = 'pl'
            ORDER BY
                `Parameter` ASC

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` > 1000 AND
                `PartID` = 158392 AND
                `Language` = 'pl'
            ORDER BY
                `Parameter` ASC

SELECT DISTINCT
                    `parts`.`RefNumber`,
                    `brands`.`ID`,
                    `brands`.`Title`,
                    `part-brands`.`BrandNumber`,
                    `part-brands`.`BrandNumberSearch`,
                    `brands`.`PartVisible`
                FROM
                    `part-brands`
                    INNER JOIN `brands` ON `part-brands`.`Brand` = `brands`.`Title`
                    INNER JOIN `parts` ON `part-brands`.RefNumber = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 158392  AND `brands`.`PartVisible` = 1 
                ORDER BY
                    `brands`.`Title`,
                    `part-brands`.`BrandNumber`

SELECT DISTINCT
                `parts`.`RefNumber`,
                `brands`.`ID`,
                 UPPER(`applications`.`Brand`) AS `Title`,
                `applications`.`BrandNumber`,
                `applications`.`BrandNumberSearch`,
                `part-brands`.`BrandNumberSearch` AS `PartsNumber`,
                `brands`.`PartVisible`
            FROM
                `applications`
                INNER JOIN `brands` ON `applications`.`Brand` = `brands`.`Title`
                INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                LEFT JOIN `part-brands` ON `applications`.`BrandNumberSearch` = `part-brands`.`BrandNumberSearch`
            WHERE
                `parts`.`ID` = 158392  AND `brands`.`PartVisible` = 1 
            GROUP BY
                `applications`.`BrandNumber`
            ORDER BY
                `applications`.`Brand`,
                `applications`.`BrandNumber`

SELECT DISTINCT
                `Marque`,
                `ModelName`,
                `ModelType`,
                `Carburant`,
                `Engine`,
                `DateDebut`,
                `DateFin`,
                `TypeID`
            FROM
                `vehicles`
                INNER JOIN `parts` ON `vehicles`.`RefNumber` = `parts`.`RefNumber`
            WHERE
                `parts`.`ID` = 158392
            ORDER BY
                `Marque`, `ModelName`

SELECT
                `equivalents`.*,
                `parts`.`ID` AS `PartID`,
                `part-texts`.`URLLabel` AS `PartURLLabel`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`
            FROM
                `equivalents`
                INNER JOIN `parts` ON `equivalents`.`EquivalentNumber` = `parts`.`RefNumber`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'pl'
            WHERE
                `part-texts`.`Language` = 'pl' AND
                `equivalents`.`Language` = 'pl' AND
                `equivalents`.`RefNumber` = 'IB6963'
            GROUP BY `parts`.`ID`

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'alternators-parts' AND
                `Language` = 'pl' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'pl' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'pl'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 26 OR `ParentGroup`.`ID` = 26)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'pl' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'pl'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT `ID`, `UserKey` FROM `users` WHERE `UserKey` LIKE 'w5vClsOAwpXDqcKnw4HCncK3w5fCsMOLw5zCu8KTw5rCpcKx%' LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `groups`.`URLLabel` AS `ParentURLLabel`,
                    `groups`.`Title` AS `ParentTitle`,
                    `SubGroups`.*
                FROM
                    `groups`
                    INNER JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
                WHERE
                    `groups`.`URLLabel` = 'alternators-parts' AND
                    `groups`.`Language` = 'pl' AND
                    `groups`.`Visible` = 1 AND
                    `SubGroups`.`URLLabel` = 'fixed-pulleys' AND
                    `SubGroups`.`Language` = 'pl' AND
                    `SubGroups`.`Visible` = 1
                LIMIT 1

SELECT
                `parts`.*,
                `part-texts`.*,
                IF(`ParentGroup`.`URLLabel` IS NULL, `SubGroup`.`URLLabel`, '') AS `ParentGroupUrlLabel`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'pl'
            WHERE
                `parts`.`Visible` = 1 AND
                `parts`.`ID` = 158392 AND
                `part-texts`.`Language` = 'pl'
            LIMIT 1

SELECT GROUP_CONCAT(`BrandNumber` SEPARATOR ', ') AS `Numbers`
            FROM (
                SELECT
                    `part-brands`.`BrandNumber`
                FROM
                    `users`
                    INNER JOIN `part-brands` ON `users`.`Brand` = `part-brands`.`Brand`
                    INNER JOIN `parts` ON `parts`.`RefNumber` = `part-brands`.`RefNumber`
                WHERE
                    `parts`.`ID` = 158392 AND
                    `users`.`ID` = 33
                LIMIT 3
            ) AS `Result`;

SELECT
                GROUP_CONCAT(`groups`.`MenuLabel` SEPARATOR ', ') AS `Groups`
            FROM
                `groups`
                INNER JOIN `part-groups` ON `part-groups`.`GroupID` = `groups`.`ID`
                INNER JOIN `parts` ON `parts`.`ID` = `part-groups`.`PartID`
            WHERE
                `parts`.`ID` = 158392 AND
                `groups`.`Language` = 'pl'
            GROUP BY
                `parts`.`ID`

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 158392 AND
                `Language` = 'pl'
            ORDER BY
                `Parameter` ASC

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` > 1000 AND
                `PartID` = 158392 AND
                `Language` = 'pl'
            ORDER BY
                `Parameter` ASC

SELECT DISTINCT
                    `parts`.`RefNumber`,
                    `brands`.`ID`,
                    `brands`.`Title`,
                    `part-brands`.`BrandNumber`,
                    `part-brands`.`BrandNumberSearch`,
                    `brands`.`PartVisible`
                FROM
                    `part-brands`
                    INNER JOIN `brands` ON `part-brands`.`Brand` = `brands`.`Title`
                    INNER JOIN `parts` ON `part-brands`.RefNumber = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 158392  AND `brands`.`PartVisible` = 1 
                ORDER BY
                    `brands`.`Title`,
                    `part-brands`.`BrandNumber`

SELECT DISTINCT
                `parts`.`RefNumber`,
                `brands`.`ID`,
                 UPPER(`applications`.`Brand`) AS `Title`,
                `applications`.`BrandNumber`,
                `applications`.`BrandNumberSearch`,
                `part-brands`.`BrandNumberSearch` AS `PartsNumber`,
                `brands`.`PartVisible`
            FROM
                `applications`
                INNER JOIN `brands` ON `applications`.`Brand` = `brands`.`Title`
                INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                LEFT JOIN `part-brands` ON `applications`.`BrandNumberSearch` = `part-brands`.`BrandNumberSearch`
            WHERE
                `parts`.`ID` = 158392  AND `brands`.`PartVisible` = 1 
            GROUP BY
                `applications`.`BrandNumber`
            ORDER BY
                `applications`.`Brand`,
                `applications`.`BrandNumber`

SELECT DISTINCT
                `Marque`,
                `ModelName`,
                `ModelType`,
                `Carburant`,
                `Engine`,
                `DateDebut`,
                `DateFin`,
                `TypeID`
            FROM
                `vehicles`
                INNER JOIN `parts` ON `vehicles`.`RefNumber` = `parts`.`RefNumber`
            WHERE
                `parts`.`ID` = 158392
            ORDER BY
                `Marque`, `ModelName`

SELECT
                `equivalents`.*,
                `parts`.`ID` AS `PartID`,
                `part-texts`.`URLLabel` AS `PartURLLabel`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`
            FROM
                `equivalents`
                INNER JOIN `parts` ON `equivalents`.`EquivalentNumber` = `parts`.`RefNumber`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'pl'
            WHERE
                `part-texts`.`Language` = 'pl' AND
                `equivalents`.`Language` = 'pl' AND
                `equivalents`.`RefNumber` = 'IB6963'
            GROUP BY `parts`.`ID`

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'alternators-parts' AND
                `Language` = 'pl' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'pl' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'pl'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 26 OR `ParentGroup`.`ID` = 26)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 3
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 33

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 33
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'pl' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'pl'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                *
            FROM
                `users`
            WHERE 1
         LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                *
            FROM
                `users`
            WHERE 1
        ) AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'pl' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'pl'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 37 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 37

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 37
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'pl' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'pl'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 37 LIMIT 1

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'pl' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'pl' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'pl' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'pl'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 33 LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 33 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 33

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'pl'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'pl'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'en' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'en' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'en' AND
                `OnFirstPage` = 1
         ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'en'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'en'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 3
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1030
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

set names utf8

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 3
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1030
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 3
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1030
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                *
            FROM
                `users`
            WHERE 1
         LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                *
            FROM
                `users`
            WHERE 1
        ) AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                *
            FROM
                `users`
            WHERE 1
         AND `SearchKey` LIKE '%w5DCosKgwqfDmmfCqMKcw5rDnsKVw%' LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                *
            FROM
                `users`
            WHERE 1
         AND `SearchKey` LIKE '%w5DCosKgwqfDmmfCqMKcw5rDnsKVw%') AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 642 LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 642

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 642
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'en' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'en' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'en' AND
                `OnFirstPage` = 1
         ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'en'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'en'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 3
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1030
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

set names utf8

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                *
            FROM
                `users`
            WHERE 1
         AND `SearchKey` LIKE '%w5DCosKgwqfDmmfCqMKcw5rDnsKVw%' LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                *
            FROM
                `users`
            WHERE 1
         AND `SearchKey` LIKE '%w5DCosKgwqfDmmfCqMKcw5rDnsKVw%') AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

set names utf8

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1146 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 702
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1146

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1146
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

set names utf8

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1146 LIMIT 1

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

set names utf8

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `UserKey`
            FROM
                `users`
            WHERE
                `ID` = 1146
            LIMIT 1

SELECT * FROM `users` LIMIT 1

SHOW COLUMNS FROM `users`

UPDATE `users` SET `LastUpdate` = '2024-09-30 14:00:37', `UserKey` = 'w5rCpMK9wqHDoMKiwoTClsOcw5zCtsOew5TDgcOZw5zCqMKEwr3DiMK1wr7CuMKlw5XCpsKwa9af9bc42a96e901f1ab6bb39480aa941' WHERE `ID` = '1146'

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1146 LIMIT 1

SELECT
                `ListName`
            FROM
                `pricelist`
            WHERE
                `ID` = 702
            LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1146

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1146
            ORDER BY
                `PostDate` DESC
            LIMIT 100

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    *
                FROM
                    `groups`
                WHERE
                    `URLLabel` = 'starters' AND
                    `Language` = 'en' AND
                    `Visible` = 1
                LIMIT 1

SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'en'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'en'
                
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
         LIMIT 0, 12

SELECT COUNT(*) AS NumRows FROM (
            SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'en'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'en'
                
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
        ) AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'starters' AND
                `Language` = 'en' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1852

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142528

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1854

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8005' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142427

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8006R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142250

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8038R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1888

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148241

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 120023

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8064' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8072RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1932

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8083' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2190

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8341' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8374' AND `Quantity` > 0 ORDER BY `Store` DESC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `availabilities`.`RefNumber`,
                    `availabilities`.`Quantity`
                FROM
                    `availabilities`
                    INNER JOIN `parts` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1852
                LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `availabilities`.`RefNumber`,
                    `availabilities`.`Quantity`
                FROM
                    `availabilities`
                    INNER JOIN `parts` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1852
                LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    *
                FROM
                    `groups`
                WHERE
                    `URLLabel` = 'starters' AND
                    `Language` = 'en' AND
                    `Visible` = 1
                LIMIT 1

SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'en'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'en'
                
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
         LIMIT 0, 12

SELECT COUNT(*) AS NumRows FROM (
            SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'en'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'en'
                
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
        ) AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'starters' AND
                `Language` = 'en' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1852

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142528

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1854

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8005' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142427

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8006R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142250

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8038R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1888

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148241

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039RP' AND `Quantity` > 0 ORDER BY `Store` DESC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 120023

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8064' AND `Quantity` > 0 ORDER BY `Store` DESC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8072RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1932

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8083' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2190

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8341' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8374' AND `Quantity` > 0 ORDER BY `Store` DESC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    `availabilities`.`RefNumber`,
                    `availabilities`.`Quantity`
                FROM
                    `availabilities`
                    INNER JOIN `parts` ON `availabilities`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `parts`.`ID` = 1852
                LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                    *
                FROM
                    `groups`
                WHERE
                    `URLLabel` = 'starters' AND
                    `Language` = 'en' AND
                    `Visible` = 1
                LIMIT 1

SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'en'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'en'
                
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
         LIMIT 0, 12

SELECT COUNT(*) AS NumRows FROM (
            SELECT
                `parts`.`ID`,
                `parts`.`PostDate`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                CHAR_LENGTH(`parts`.`Gallery`) AS `IsGallery`,
                `parts`.`IsPromo`,
                `parts`.`IsNew`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'en'
        
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1) AND
                `part-texts`.`Language` = 'en'
                
            GROUP BY
                `parts`.`ID`
            ORDER BY
                `IsGallery` DESC,
                `parts`.IsPromo ASC,
                `ParentGroup`.`URLLabel` ASC,
                `parts`.RefNumber ASC
        ) AS CountTable

SELECT `CharCode` FROM `currencies`

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'starters' AND
                `Language` = 'en' AND
                `Visible` = 1
            LIMIT 1

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT `GroupID`, `PriceCorrection` FROM `user-price-groups` WHERE `UserID` = 1030

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1852

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             AND `Visible` = 1 LIMIT 1

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142528

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1854

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8005' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142427

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8006R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 142250

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8038R' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1888

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148241

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8039RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 120023

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8064' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 148223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8072RP' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 1932

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8083' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2190

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8341' AND `Quantity` > 0 ORDER BY `Store` DESC

SELECT
                    `parts`.`ID`,
                    `parts`.`RefNumber`,
                    `GPL`.`Price` AS `Price`,
                    `UPL`.`Price` AS `UserPrice`,
                    `parts`.`PriceGroup`,
                    `parts`.`MinQuantity`,
                    `parts`.`DeliveryDate`,
                    `parts`.`Orange`,
                    `parts`.`QtyOrder`
                FROM
                    `parts`
                    LEFT JOIN `prices` AS `GPL` ON
                        `GPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `GPL`.`PriceListID` = 711
                    LEFT JOIN `prices` AS `UPL` ON
                        `UPL`.`RefNumber` = `parts`.`RefNumber` AND
                        `UPL`.`PriceListID` = 3
                WHERE
                    `parts`.`ID` = 2223

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8374' AND `Quantity` > 0 ORDER BY `Store` DESC

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 1 OR `ParentGroup`.`ID` = 1)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

SELECT * FROM `users` WHERE `ID` = 1030 LIMIT 1

SELECT `Num` FROM `basket` WHERE `UserID` = 1030

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        LIMIT 1

UPDATE `users` SET `LastUpdate` = NOW(), `AccessKey` = '' WHERE `ID` = 1030

set names utf8

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'en' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'en' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'en' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'en'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'en'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                    `ID`,
                    `MetaTitle`,
                    `MetaDescription`,
                    `MetaKeywords`,
                    `MetaImage`
                FROM
                    `nav`
                WHERE
                    `Language` = 'en' AND
                    (`URLLabel` IS NULL OR `URLLabel` = '')
                LIMIT 1

SELECT
                *
            FROM
                `slider`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Language` = 'en' AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
            LIMIT 6

SELECT
                `ID`,
                `PostDate`,
                `Title`,
                `URLLabel`,
                `Annotation`,
                `FilePath`,
                `Visible`
	        FROM
	        	`events`
	    	WHERE
                `Language` = 'en' AND
                `OnFirstPage` = 1
         AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 4

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

set names utf8

SELECT
                `vehicles`.`ManufacturerID` AS `ID`,
                `vehicles`.`Marque` AS `Name`
            FROM
                parts
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON
                    `SubGroup`.`ID` = `part-groups`.`GroupID` AND
                    `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'en'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2000 OR `ParentGroup`.`ID` = 2000)
            GROUP BY
                `vehicles`.`Marque`
            ORDER BY
                `vehicles`.`Marque`

set names utf8

SELECT
                `parts`.`ID`,
                `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                `parts`.`RefNumber`,
                `parts`.`Label`,
                `part-texts`.`Title`,
                `part-texts`.`URLLabel`,
                `parts`.`Gallery`,
                `parts`.`Visible`
            FROM
                `parts`
                INNER JOIN `part-texts` ON `parts`.`ID` = `part-texts`.`PartID`
                INNER JOIN `part-groups` ON `parts`.`ID` = `part-groups`.`PartID`
                INNER JOIN `groups` AS `SubGroup` ON `SubGroup`.`ID` = `part-groups`.`GroupID` AND `SubGroup`.`Language` = 'en'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'en'
            WHERE
                `parts`.`IsNew` = 1 AND
                `parts`.`Visible` = 1 AND
                `parts`.`PostDate` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND /* TODO 12 -> 1 */
                `part-texts`.`Language` = 'en'
            GROUP BY `parts`.`ID`
         ORDER BY RAND() LIMIT 8

set names utf8

SELECT `CharCode` FROM `currencies`  WHERE `Visible` = 1

SELECT
                *
	        FROM
	        	`rollingnews`
	    	WHERE
                (CURDATE() BETWEEN FromDate AND ToDate OR ToDate = '0000-00-00') AND
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`PostDate` DESC
            LIMIT 4

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
                `ID`,
	        	`MenuLabel`,
	        	`URLLabel`
	        FROM
	        	`nav`
	    	WHERE
                `Language` = 'en' AND
	    		`Visible` = 1
            ORDER BY
            	`ItemPosition` ASC

SELECT
                `groups`.`ID`,
                `groups`.`ParentID`,
	        	`groups`.`MenuLabel`,
	        	`groups`.`URLLabel`,
                `groups`.`PartsLabel`,
                `SubGroups`.`ID` AS `SubGroupID`,
                `groups`.`Visible`
	        FROM
	        	`groups`
                LEFT JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
	    	WHERE
                `groups`.`Language` = 'en' AND
	    		`groups`.`Visible` = 1
            GROUP BY
                `groups`.`ID`
            ORDER BY
                `groups`.`ParentID` ASC,
            	`groups`.`ItemPosition` ASC,
                `groups`.`MenuLabel` ASC

SELECT
	        	`pages`.`MenuLabel`,
	        	`pages`.`URLLabel`,
                `pages`.`Visible`
	        FROM
	        	`pages`
	    	WHERE
                `pages`.`Language` = 'en' AND
	    		`pages`.`Visible` = 1 AND
                `pages`.`InFooter` = 1
            ORDER BY
            	`pages`.`ItemPosition` ASC,
                `pages`.`MenuLabel` ASC

