
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

UPDATE `users` SET `LastUpdate` = NOW(), `AccessKey` = '' WHERE `ID` = 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 `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 'w6XCnsK1wqPDo8KVw490w6TDkcK7w5HDpcKww5XDn8Kfwqdyw4nCtA%' 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

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
                            `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 `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` = '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 '%w5t8wqDCrsOb%' LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                *
            FROM
                `users`
            WHERE 1
         AND `SearchKey` LIKE '%w5t8wqDCrsOb%') 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` = 1033 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1033
            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

UPDATE `users` SET `LastUpdate` = NOW(), `AccessKey` = '' WHERE `ID` = 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 `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 'w6vCmsK9wqjCt8KVw4nCmMKlw5HCtsOO%' LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1033 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` = 1033 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

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

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

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1033 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

set names utf8

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

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1033
            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` = 1033 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

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

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

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1033 AND
                            `UserKey` LIKE '%1'
                        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
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1033 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

set names utf8

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

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

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

SELECT * FROM `users` WHERE `ID` = 1033 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` = 1033 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

SELECT * FROM `users` LIMIT 1

SHOW COLUMNS FROM `users`

UPDATE `users` SET `LastUpdate` = '2024-10-18 14:33:37', `Data` = 'P3qfFeRyWdPcPNoqKA9wwlcQRi24_q6gBjpLFp0TtSQaW9fR9kZsHl9HWFWEVAjC0CZr00WS7hYW9uRNudJ1W-VDPMtMsvpI2r2vCsd_cx6_65rJiemNFoClsVutnZapS7aeV4Jxa0ke_5pWdqucvlUOUgfZlxt0n0N9dWr8LXfPL81DvKBTmaG-ivZCgQZxAN13rVyxUDJXVL0dBbDmVw4ucL-ZvBZzycx1bM0-LKLJ_RZV6UUQLVcBynpc-arO_HKp-iaMSgP1c36IiCQQIdvOny9N37Wf5crzXLJgCRx7F7jzZgLasq9TH0ZezmAenWpoBcosl6TwF7XIb7aNxd1mDcHvJHl31GgErCwuHMp9jwAFf6xzF_u25U_JBHuI-ztA-FUuFJuZn-Sx6nYJnGGKzTOJ0zSD5NdQgIqDPr4', `SearchKey` = 'w5t8wqDCrsObw5t8wqDCrsObw4R5wrFnw4Z4wqtlw4XDhMKMw6HDgcw5t8wqDCrsOb' WHERE `ID` = 1033

set names utf8

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

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1033
            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` = 1033 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

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

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

set names utf8

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

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

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 'w6XCnsK1wqPDo8KVw490w6TDkcK7w5HDpcKww5XDn8Kfwqdyw4nCtA%' 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

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 `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` = '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 '%w5t8wqDCrsObecKYwpzDmsKiwpTDn8OMwqfCs8%' 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 '%w5t8wqDCrsOb%' LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                *
            FROM
                `users`
            WHERE 1
         AND `SearchKey` LIKE '%w5t8wqDCrsOb%') 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` = 1033 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1033
            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
                `ID` = 1033
            LIMIT 1

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

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` = 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

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` = 1033
            LIMIT 1

SELECT * FROM `users` LIMIT 1

SHOW COLUMNS FROM `users`

UPDATE `users` SET `LastUpdate` = '2024-10-18 14:35:14', `UserKey` = 'w6vCmsK9wqjCt8KVw4nCmMKlw5HCtsOOa9af9bc42a96e901f1ab6bb39480aa941', `PriceListID` = '3', `PriceVisible` = '1', `WithoutQty` = 0, `OEMSearch` = '1', `Brand` = 'BOSCH', `Data` = 'uvya-gxKGxFqjzAeaBM0ee9h0ceouE_PBhwnQao_mx8SNxOyTveH6PMjsrRGpBHELVM3JG_pFpev8QJ8fNXiXJ-XAQjmaYys1Q5EGvjlmfZxqdJXq6VMM7XocJY32saiufcBHcdw_gOUXd42g7MWgRYXCADD5U4nejN8EFBhIvOYmGqgWl_qarjYtnhyFuCBJYoes_2EVvIjwVrEyl6ZOR_BMTBCwyCY1RORdyfFC9rRbNQjLCkV8okT2v1mCI3bKcjOMDD900ZBSXalD2JmX5WTDtY6gUjiYiG65LaeHLZluN_S5C2HZNTlh8BtSFoBdIoLC2by1C6LpzKXaQ5ll0e3EyQERJgwTIItYjSsl8QdUyGWTmjrsbzH8x-kLTbMaA0YpuPFRo7fAW76obG9boITeslZ-YNgPzN5F5hWAYbTTUxXaziLQBTasJx0AmXR69fXojd7gKQZfvBsf0sir44JNFG3dNd-tfhd2s3pNzCYJEwku-_21dswi-khBpetOJusvp_zOnSpp7-w2vYR9A', `SearchKey` = 'w5t8wqDCrsObecKYwpzDmsKiwpTDn8OMwqfCs8w5t8wqDCrsObw5t8wqDCrsObw4R5wrFnw4Z4wqtlw4XDhMKMw6HDgcw5t8wqDCrsOb' WHERE `ID` = '1033'

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` = 1033 LIMIT 1

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

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1033
            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

UPDATE `users` SET `LastUpdate` = NOW(), `AccessKey` = '' WHERE `ID` = 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 `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 'w6vCmsK9wqjCt8KVw4nCmMKlw5HCtsOO%' LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1033 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` = 1033 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

set names utf8

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

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

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

set names utf8

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

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1033
            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` = 1033 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

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

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

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1033 AND
                            `UserKey` LIKE '%1'
                        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
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1033 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

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

set names utf8

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

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

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

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

set names utf8

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

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1033
            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` = 1033 AND
                            `UserKey` LIKE '%1'
                        LIMIT 1

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

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

set names utf8

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

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

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 'w6XCnsK1wqPDo8KVw490w6TDkcK7w5HDpcKww5XDn8Kfwqdyw4nCtA%' 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

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 `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` = '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 '%w5t8wqDCrsObecKYwpzDmsKiwpTDn8OMwqfCs8%' LIMIT 0, 30

SELECT COUNT(*) AS NumRows FROM (SELECT
                *
            FROM
                `users`
            WHERE 1
         AND `SearchKey` LIKE '%w5t8wqDCrsObecKYwpzDmsKiwpTDn8OMwqfCs8%') 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` = 1033 LIMIT 1

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

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1033
            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
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir800%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir800%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

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

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

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 3
            WHERE
                `parts`.`RefNumber` = 'IR8002'

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             LIMIT 1

set names utf8

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

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

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 3
            WHERE
                `parts`.`RefNumber` = 'IR8006R'

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8006R'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             LIMIT 1

set names utf8

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

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

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 3
            WHERE
                `parts`.`RefNumber` = 'IR8002'

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             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` = 1033 LIMIT 1

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

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1033
            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 `ID` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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 `ID` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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 `ID` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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 `ID` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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 `ID` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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 `ID` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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 `ID` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir800%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir800%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

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

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

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             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` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir800%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir800%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

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

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

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             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` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        `part-brands`.`Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                        LEFT JOIN `part-brands` ON `part-brands`.`RefNumber` = `parts`.`RefNumber`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ир80%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )

                UNION

                (
                    SELECT
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        `part-brands`.`Brand`,
                        `part-brands`.`BrandNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `part-brands`
                        INNER JOIN `parts` ON `part-brands`.`RefNumber` = `parts`.`RefNumber`
                    WHERE
                        `part-brands`.`BrandNumberSearch` LIKE 'ир80%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ир80%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

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

(
                    SELECT
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir800%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir800%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

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

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

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             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` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir800%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir800%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

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

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

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             LIMIT 1

set names utf8

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

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

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             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` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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
                    `groups`
                WHERE
                    `URLLabel` = 'starters-parts' 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` = 2 OR `ParentGroup`.`ID` = 2) AND
                `part-texts`.`Language` = 'bg'
                
            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` = 2 OR `ParentGroup`.`ID` = 2) AND
                `part-texts`.`Language` = 'bg'
                
            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` = '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-parts' 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 `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` = 149471

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IA9578BOSCH' 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` = 137383

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IA9713BOSCH' 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` = 151086

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IA9763' 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` = 150908

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 `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IA9859' AND `Quantity` > 0 ORDER BY `Store` DESC

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` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'bg'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2 OR `ParentGroup`.`ID` = 2)
            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` = 150913

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IA9860' 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` = 150918

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IA9861' 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` = 151511

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IB5065' 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` = 154921

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IB5065P' 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` = 151088

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IB9107ZB' 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` = 139929

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IB5019MITSUBISHI' 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` = 140954

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IB9119PRESTOLITE' 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` = 150874

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IA9856' 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 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` = 149471 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

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

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

UPDATE
                            `basket`
                        SET
                            `UpdateDate` = NOW(),
                            `Basket` = '{"142427":{"qty":3,"price":"26.01","note":"","number":"432592, 432596, 433322"},"142250":{"qty":3,"price":"40.01","note":"","number":"188574, 432582, 432672"},"149471":{"qty":1,"price":0,"note":"","number":""}}',
                            `Num` = 7
                        WHERE
                            `UserID` = 1030 LIMIT 1

set names utf8

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

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

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

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` = 142427 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

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

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

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

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` = 142250 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

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

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

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` = 149471 AND
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`Visible` = 1
                LIMIT 1

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

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

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

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

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 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` = 'starters-parts' AND
                    `groups`.`Language` = 'bg' AND
                    `groups`.`Visible` = 1 AND
                    `SubGroups`.`URLLabel` = 'vkluchvateli' AND
                    `SubGroups`.`Language` = 'bg' 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` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                
                `parts`.`ID` = 149471 AND
                `part-texts`.`Language` = 'bg'
            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` = 149471 AND
                    `users`.`ID` = 1030
                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` = 149471 AND
                `groups`.`Language` = 'bg'
            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` = 149471 AND
                `Language` = 'bg'
            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` = 149471 AND
                `Language` = 'bg'
            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` = 149471 
                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` = 149471 
            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` = 149471
            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` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `part-texts`.`Language` = 'bg' AND
                `equivalents`.`Language` = 'bg' AND
                `equivalents`.`RefNumber` = 'IA9578BOSCH'
            GROUP BY `parts`.`ID`

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
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'starters-parts' 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 `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` = 149471

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

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

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` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'bg'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2 OR `ParentGroup`.`ID` = 2)
            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
                    `groups`.`URLLabel` AS `ParentURLLabel`,
                    `groups`.`Title` AS `ParentTitle`,
                    `SubGroups`.*
                FROM
                    `groups`
                    INNER JOIN `groups` AS `SubGroups` ON `groups`.`ID` = `SubGroups`.`ParentID`
                WHERE
                    `groups`.`URLLabel` = 'starters-parts' AND
                    `groups`.`Language` = 'bg' AND
                    `groups`.`Visible` = 1 AND
                    `SubGroups`.`URLLabel` = 'vkluchvateli' AND
                    `SubGroups`.`Language` = 'bg' 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` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                
                `parts`.`ID` = 149471 AND
                `part-texts`.`Language` = 'bg'
            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` = 149471 AND
                    `users`.`ID` = 1030
                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` = 149471 AND
                `groups`.`Language` = 'bg'
            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` = 149471 AND
                `Language` = 'bg'
            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` = 149471 AND
                `Language` = 'bg'
            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` = 149471 
                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` = 149471 
            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` = 149471
            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` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND `ParentGroup`.`Language` = 'bg'
            WHERE
                `part-texts`.`Language` = 'bg' AND
                `equivalents`.`Language` = 'bg' AND
                `equivalents`.`RefNumber` = 'IA9578BOSCH'
            GROUP BY `parts`.`ID`

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
                `ID`
            FROM
                `groups`
            WHERE
                `URLLabel` = 'starters-parts' 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 `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` = 149471

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

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

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` = 'bg'
                LEFT JOIN `groups` AS `ParentGroup` ON
                    `ParentGroup`.`ID` = `SubGroup`.`ParentID` AND
                    `ParentGroup`.`Language` = 'bg'
                INNER JOIN vehicles ON `parts`.`RefNumber` = `vehicles`.`RefNumber`
            WHERE
                (`SubGroup`.`ID` = 2 OR `ParentGroup`.`ID` = 2)
            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 * FROM `users` WHERE `ID` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir80%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir80%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

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

SELECT `PriceListID` FROM `users` WHERE `ID` = :nUserID LIMIT 1

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8097'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             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` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir800%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir800%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

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

SELECT `PriceListID` FROM `users` WHERE `ID` = :nUserID LIMIT 1

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             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` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir8-00%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir8-00%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

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

(
                    SELECT
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir8%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir8%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

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

(
                    SELECT
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir80%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir80%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

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

SELECT `PriceListID` FROM `users` WHERE `ID` = :nUserID LIMIT 1

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8097'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             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` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir80%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir80%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        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` = :nPartID AND
                    `users`.`ID` = 1
                LIMIT 3
            ) AS `Result`;

SELECT `PriceListID` FROM `users` WHERE `ID` = :nUserID LIMIT 1

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8097'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             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` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir800%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir800%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        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` = :nPartID AND
                    `users`.`ID` = 1
                LIMIT 3
            ) AS `Result`;

SELECT `PriceListID` FROM `users` WHERE `ID` = :nUserID LIMIT 1

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             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` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir800%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir800%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        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` = 149471 AND
                    `users`.`ID` = 1
                LIMIT 3
            ) AS `Result`;

SELECT `PriceListID` FROM `users` WHERE `ID` = :nUserID LIMIT 1

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             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` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir800%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir800%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        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` = 149471 AND
                    `users`.`ID` = 1
                LIMIT 3
            ) AS `Result`;

SELECT `PriceListID` FROM `users` WHERE `ID` = :nUserID LIMIT 1

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             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` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir800%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir800%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        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` = 149471 AND
                    `users`.`ID` = 1
                LIMIT 3
            ) AS `Result`;

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

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             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` = 1 LIMIT 1

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

SELECT
                *
            FROM
                `orders`
            WHERE
                `Status` > 0 AND
                `UserID` = 1
            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 `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
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir800%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir800%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        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` = 149471 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

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

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 3
            WHERE
                `parts`.`RefNumber` = 'IR8002'

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        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` = 1 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

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

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 3
            WHERE
                `parts`.`RefNumber` = 'IR8002'

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        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` = 1 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

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

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 3
            WHERE
                `parts`.`RefNumber` = 'IR8006R'

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8006R'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             LIMIT 1

set names utf8

SELECT
                            `PriceListID`,
                            `PriceVisible`,
                            /*`PriceCorrection`,*/
                            `OEMSearch`,
                            `WithoutQty`
                        FROM
                            `users`
                        WHERE
                            `ID` = 1030 AND
                            `UserKey` LIKE '%2'
                        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` = 1 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

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

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 3
            WHERE
                `parts`.`RefNumber` = 'IR8002'

SELECT
                `prices`.`Price`,
                `parts`.`PriceGroup`
            FROM
                `parts`
                LEFT JOIN `prices` ON
                    `prices`.`RefNumber` = `parts`.`RefNumber` AND
                    `prices`.`PriceListID` = 711
            WHERE
                `parts`.`RefNumber` = 'IR8002'

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

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

SELECT
                    `Exchange`,
                    `Label`,
                    `FixPosition`
                FROM
                    `currencies`
                WHERE
                    `CharCode` = 'EUR'
             LIMIT 1

set names utf8

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

(
                    SELECT
                        `parts`.`ID` AS `PartID`,
                        `parts`.`RefNumber`,
                        'MONEA' AS `Brand`,
                        `parts`.`RefNumber` AS `Number`,
                        `parts`.`Gallery`
                    FROM
                        `parts`
                    WHERE
                        `parts`.`RefNumber` LIKE 'ir800%'
                    ORDER BY `parts`.`Gallery` DESC
                    LIMIT 10
                )
            

            UNION

            (
                SELECT
                    `parts`.`ID` AS `PartID`,
                    `parts`.`RefNumber`,
                    `applications`.`Brand`,
                    `applications`.`BrandNumber` AS `Number`,
                    `parts`.`Gallery`
                FROM
                    `applications`
                    INNER JOIN `parts` ON `applications`.`RefNumber` = `parts`.`RefNumber`
                WHERE
                    `applications`.`BrandNumberSearch` LIKE 'ir800%'
                ORDER BY `parts`.`Gallery` DESC
                LIMIT 10
            )
             LIMIT 10

set names utf8

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

SELECT `RefNumber` FROM `parts` WHERE `RefNumber` LIKE 'IR8003%'

SELECT `RefNumber`, `Brand`, `BrandNumber` FROM `part-brands` WHERE `BrandNumberSearch` LIKE 'IR8003%'

SELECT `RefNumber`, `Brand`, `BrandNumber` FROM `applications` WHERE `BrandNumberSearch` LIKE 'IR8003%'

SELECT
                    `parts`.`ID`,
                    `parts`.`PostDate`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    `parts`.`RefNumber`,
                    `parts`.`Label`,
                    `parts`.`Barcode`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PartType`,
                    `parts`.`Connecteur`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `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
                    
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`RefNumber` IN ('IR8003','IR8003P','IR8003R','IR8003RP','IR8003VALEO','IR8213','IR8213RP','IR8213MITSUBISHI','IR8213P','IR8000','IR8000RP','IR8000P','IR8000R','IR8046R','IR8046','IR8046RP','IR8046P','IA1117','IA1125','IA1129','IA1669','IA1689','IA1700','IA1733','IA1765','IA1779','IA1815','IA1815P','IA1858','IA1869','IA1900','IA1900IKA','IA1900P','IA1907','IA1922','IA1923','IA1929','IA1930','IA1930P','IA2505','IA2505BOSCH','IA2505ZEN','IA2544','IA2544ZEN','IA2546','IA2546BOSCH','IA2546ZEN','IA2555','IA2555VALEO','IA2555ZEN','IA2685','IA2685W','IA2685ZEN','IA2686','IA2686ZEN','IA2688','IA2688ZEN','IA2717','IA2717ZEN','IA2778','IA2778ZEN','IA2878','IA3127','IA3128','IA3128P','IA3129','IA3140','IA3153','IA3544','IA3545','IA3545IKA','IA3551','IA3551IKA','IA3557','IA3557IKA','IA3562','IA3609','IA3609IKA','IA3609P','IA3715','IA3715IKA','IA3726','IA5000','IA5001','IA5001P','IA5002','IA5003','IA5005','IA5005IKA','IA5022','IA5024','IA5034','IA5038','IA5038IKA','IA5038P','IA5050','IA5055','IA5056','IA5056P','IA5085','IA5087','IA5088','IA5608','IA5608IKA','IA5608P','IA5609','IA5609IKA','IA5609P','IA5614','IA5614IKA','IA5615','IA5615IKA','IA5641','IA5641IKA','IA5641P','IA5643','IA5643IKA','IA5643P','IA5645','IA5645IKA','IA5645P','IA5646','IA5646IKA','IA5646P','IA5651','IA5651IKA','IA5661','IA5661IKA','IA5665','IA5666','IA5666IKA','IA5666P','IA5697','IA5697IKA','IA5700','IA5705','IA5705BULK1','IA5705NTN','IA5705NTNBULK1','IA5705P','IA5737','IA5737IKA','IA5737INA','IA5737P','IA6532','IA6532BOSCH','IA6532IKA','IA6572','IA6572BOSCH','IA6572IKA','IA6659','IA6659IKA','IA6674BOSCH','IA6784','IA6784IKA','IA9100','IA9100ZB','IA9114','IA9114ZB','IA9117','IA9117F','IA9117ZB','IA9121','IA9121VALEO','IA9121ZB','IA9533','IA9533ZB','IA9655','IA9655G','IA9655P','IA9655VALEO','IA9655ZB','IA9801','IA9801ZB','IA9835ZB','IA9838','IA9838P','IA9838ZB','IA9890','IB2022','IB2022ZEN','IB2133','IB5049','IB5072','IB5072BOSCH','IB5137','IB5468','IB5627')
                GROUP BY
                    `parts`.`ID`
                ORDER BY
                    CASE
                        WHEN `parts`.`RefNumber` = 'IR8003' THEN 0
                        WHEN `parts`.`RefNumber` LIKE 'IR8003%' THEN 1
                        ELSE 2
                    END,
                    `SubGroup`.`ParentID`,
                    `part-texts`.`Title`
             LIMIT 0, 12

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 1852 AND
                `Language` = 'bg'
            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` = 1852 AND
                `Language` = 'bg'
            ORDER BY
                `Parameter` ASC

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` = 1852 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 142528 AND
                `Language` = 'bg'
            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` = 142528 AND
                `Language` = 'bg'
            ORDER BY
                `Parameter` ASC

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` = 142528 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 148225 AND
                `Language` = 'bg'
            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` = 148225 AND
                `Language` = 'bg'
            ORDER BY
                `Parameter` ASC

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` = 148225 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 141936 AND
                `Language` = 'bg'
            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` = 141936 AND
                `Language` = 'bg'
            ORDER BY
                `Parameter` ASC

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` = 141936 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 140988 AND
                `Language` = 'bg'
            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` = 140988 AND
                `Language` = 'bg'
            ORDER BY
                `Parameter` ASC

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` = 140988 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 155136 AND
                `Language` = 'bg'
            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` = 155136 AND
                `Language` = 'bg'
            ORDER BY
                `Parameter` ASC

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` = 155136 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 148224 AND
                `Language` = 'bg'
            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` = 148224 AND
                `Language` = 'bg'
            ORDER BY
                `Parameter` ASC

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` = 148224 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 142084 AND
                `Language` = 'bg'
            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` = 142084 AND
                `Language` = 'bg'
            ORDER BY
                `Parameter` ASC

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` = 142084 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 148245 AND
                `Language` = 'bg'
            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` = 148245 AND
                `Language` = 'bg'
            ORDER BY
                `Parameter` ASC

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` = 148245 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 148261 AND
                `Language` = 'bg'
            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` = 148261 AND
                `Language` = 'bg'
            ORDER BY
                `Parameter` ASC

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` = 148261 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 1849 AND
                `Language` = 'bg'
            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` = 1849 AND
                `Language` = 'bg'
            ORDER BY
                `Parameter` ASC

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` = 1849 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT
                `ParamID`,
                `Parameter`,
                `ParamValue`
            FROM
                `part-params`
                INNER JOIN `params` ON `params`.`ID` = `part-params`.`ParamID`
            WHERE
                `params`.`ID` < 1000 AND
                `PartID` = 155135 AND
                `Language` = 'bg'
            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` = 155135 AND
                `Language` = 'bg'
            ORDER BY
                `Parameter` ASC

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` = 155135 AND
                    `users`.`ID` = 1030
                LIMIT 3
            ) AS `Result`;

SELECT COUNT(*) AS NumRows FROM (
                SELECT
                    `parts`.`ID`,
                    `parts`.`PostDate`,
                    `ParentGroup`.`URLLabel` AS `ParentGroupUrlLabel`,
                    `SubGroup`.`URLLabel` AS `GroupUrlLabel`,
                    `parts`.`RefNumber`,
                    `parts`.`Label`,
                    `parts`.`Barcode`,
                    `part-texts`.`Title`,
                    `part-texts`.`URLLabel`,
                    `parts`.`Gallery`,
                    `parts`.`PartType`,
                    `parts`.`Connecteur`,
                    `parts`.`Weight`,
                    `parts`.`MinQuantity`,
                    `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
                    
                    `part-texts`.`Language` = 'bg' AND
                    `parts`.`RefNumber` IN ('IR8003','IR8003P','IR8003R','IR8003RP','IR8003VALEO','IR8213','IR8213RP','IR8213MITSUBISHI','IR8213P','IR8000','IR8000RP','IR8000P','IR8000R','IR8046R','IR8046','IR8046RP','IR8046P','IA1117','IA1125','IA1129','IA1669','IA1689','IA1700','IA1733','IA1765','IA1779','IA1815','IA1815P','IA1858','IA1869','IA1900','IA1900IKA','IA1900P','IA1907','IA1922','IA1923','IA1929','IA1930','IA1930P','IA2505','IA2505BOSCH','IA2505ZEN','IA2544','IA2544ZEN','IA2546','IA2546BOSCH','IA2546ZEN','IA2555','IA2555VALEO','IA2555ZEN','IA2685','IA2685W','IA2685ZEN','IA2686','IA2686ZEN','IA2688','IA2688ZEN','IA2717','IA2717ZEN','IA2778','IA2778ZEN','IA2878','IA3127','IA3128','IA3128P','IA3129','IA3140','IA3153','IA3544','IA3545','IA3545IKA','IA3551','IA3551IKA','IA3557','IA3557IKA','IA3562','IA3609','IA3609IKA','IA3609P','IA3715','IA3715IKA','IA3726','IA5000','IA5001','IA5001P','IA5002','IA5003','IA5005','IA5005IKA','IA5022','IA5024','IA5034','IA5038','IA5038IKA','IA5038P','IA5050','IA5055','IA5056','IA5056P','IA5085','IA5087','IA5088','IA5608','IA5608IKA','IA5608P','IA5609','IA5609IKA','IA5609P','IA5614','IA5614IKA','IA5615','IA5615IKA','IA5641','IA5641IKA','IA5641P','IA5643','IA5643IKA','IA5643P','IA5645','IA5645IKA','IA5645P','IA5646','IA5646IKA','IA5646P','IA5651','IA5651IKA','IA5661','IA5661IKA','IA5665','IA5666','IA5666IKA','IA5666P','IA5697','IA5697IKA','IA5700','IA5705','IA5705BULK1','IA5705NTN','IA5705NTNBULK1','IA5705P','IA5737','IA5737IKA','IA5737INA','IA5737P','IA6532','IA6532BOSCH','IA6532IKA','IA6572','IA6572BOSCH','IA6572IKA','IA6659','IA6659IKA','IA6674BOSCH','IA6784','IA6784IKA','IA9100','IA9100ZB','IA9114','IA9114ZB','IA9117','IA9117F','IA9117ZB','IA9121','IA9121VALEO','IA9121ZB','IA9533','IA9533ZB','IA9655','IA9655G','IA9655P','IA9655VALEO','IA9655ZB','IA9801','IA9801ZB','IA9835ZB','IA9838','IA9838P','IA9838ZB','IA9890','IB2022','IB2022ZEN','IB2133','IB5049','IB5072','IB5072BOSCH','IB5137','IB5468','IB5627')
                GROUP BY
                    `parts`.`ID`
                ORDER BY
                    CASE
                        WHEN `parts`.`RefNumber` = 'IR8003' THEN 0
                        WHEN `parts`.`RefNumber` LIKE 'IR8003%' THEN 1
                        ELSE 2
                    END,
                    `SubGroup`.`ParentID`,
                    `part-texts`.`Title`
            ) 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 `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` = 148225

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003RP' 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` = 141936

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003VALEO' 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` = 140988

SELECT `Store`, `Quantity` FROM `availabilities` WHERE `RefNumber` = 'IR8003P' 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` = 155136

