# [22-Nov-2025 18:25:55] /tsauto/www/ 113.196.59.51

set names utf8

SELECT
                *
	        FROM
	        	`meta`
                INNER JOIN `pages` ON
                    `pages`.`ID` = `meta`.`ID` AND
                    `pages`.`Language` = `meta`.`Language`
	    	WHERE
                `meta`.`Language` = 'bg' AND
                `meta`.`Module` = 'pages' AND
	    		`meta`.`URLLabel` = 'index'
         AND `meta`.`Visible` = 1 LIMIT 1

SELECT
                P2.`Language`,
                P2.`URLLabel`
            FROM
                `meta` AS P1
                INNER JOIN `meta` AS P2 ON
                    P1.`ID` = P2.`ID` AND
                    P1.`Module` = P2.`Module` AND
                    P2.`NoIndex` = 0 AND
                    P2.`Language` != 'bg' AND
                    P2.`Visible` = 1
            WHERE
                P1.`NoIndex` = 0 AND
                P1.`Module` = 'pages' AND
                P1.`Language` = 'bg' AND
                P1.`URLLabel` = 'index' AND
                P1.`Visible` = 1

SELECT
                IF(`Parent`.`URLLabel` = 'index', `meta`.`URLLabel`, CONCAT(`Parent`.`URLLabel`, '/', `meta`.`URLLabel`)) AS `URLLabel`
            FROM
                `meta`
                INNER JOIN `pages` ON
                    `pages`.`ID` = `meta`.`ID` AND
                    `pages`.`Language` = `meta`.`Language`
                LEFT JOIN `meta` AS `Parent` ON
                    `meta`.`ParentID` = `Parent`.`ID` AND
                    `meta`.`Language` = `Parent`.`Language`
            WHERE
                (`meta`.`Module` = 'pages' OR `Parent`.`Module` = 'pages' OR `meta`.`Module` = `Parent`.`Module`) AND
                `pages`.`Language` = 'bg' AND
                `meta`.`Module` = 'services' AND
                `pages`.`Action` = 'index'
         AND `meta`.`Visible` = 1 LIMIT 1

SELECT
                `meta`.`ID`,
                `meta`.`PostDate`,
                `meta`.`UploadID`,
                `services`.`Icon`,
                `meta`.`URLLabel`,
                `services`.`Title`,
                `services`.`Annotation`
            FROM
                `services`
                INNER JOIN `meta` ON
                    `services`.`ID` = `meta`.`ID` AND
                    `services`.`Language` = `meta`.`Language` AND
                    `meta`.`Module` = 'services'
            WHERE
                `meta`.`Language` = 'bg'
         AND
                    `services`.`HomePage` = 1
                 AND
                `meta`.`Visible` = 1
            
            GROUP BY
                `services`.`ID`
            ORDER BY
                `meta`.`PostDate` ASC

SELECT
                `pages`.`ID`,
                `pages`.`Annotation`
	        FROM
	        	`meta`
                INNER JOIN `pages` ON
                    `pages`.`ID` = `meta`.`ID` AND
                    `pages`.`Language` = `meta`.`Language`
	    	WHERE
                `meta`.`Language` = 'bg' AND
                `meta`.`Module` = 'services' AND
	    		`meta`.`URLLabel` = 'uslugi'
         AND `meta`.`Visible` = 1 LIMIT 1

SELECT
                COUNT(`services`.`ID`)
            FROM
                `services`
                INNER JOIN `meta` ON
                    `services`.`ID` = `meta`.`ID` AND
                    `services`.`Language` = `meta`.`Language` AND
                    `meta`.`Module` = 'services'
            WHERE
                `meta`.`Language` = 'bg'
         AND
                `meta`.`Visible` = 1

SELECT
                `Label`,
                `Value`
            FROM
                `labels`
            WHERE
                `Label` IN ('LViewAll') AND
                `Language` = 'bg'
             ORDER BY
                `labels`.`Label` ASC

SELECT
                IF(`Parent`.`URLLabel` = 'index', `meta`.`URLLabel`, CONCAT(`Parent`.`URLLabel`, '/', `meta`.`URLLabel`)) AS `URLLabel`
            FROM
                `meta`
                INNER JOIN `pages` ON
                    `pages`.`ID` = `meta`.`ID` AND
                    `pages`.`Language` = `meta`.`Language`
                LEFT JOIN `meta` AS `Parent` ON
                    `meta`.`ParentID` = `Parent`.`ID` AND
                    `meta`.`Language` = `Parent`.`Language`
            WHERE
                (`meta`.`Module` = 'pages' OR `Parent`.`Module` = 'pages' OR `meta`.`Module` = `Parent`.`Module`) AND
                `pages`.`Language` = 'bg' AND
                `meta`.`Module` = 'reviews' AND
                `pages`.`Action` = 'index'
         AND `meta`.`Visible` = 1 LIMIT 1

SELECT
                `ID`,
                `UploadID`,
                `Rate`,
                `Image`,
                `FullName`,
                `Review`,
                `Media`,
                `MediaURL`,
                `HomePage`,
                `Visible`
            FROM
                `reviews`
            WHERE
                `Language` = 'bg'
         AND `HomePage` = 1 AND `Visible` = 1 ORDER BY `PostDate` DESC LIMIT 0, 4

SELECT
                `pages`.`ID`,
                `pages`.`Annotation`
	        FROM
	        	`meta`
                INNER JOIN `pages` ON
                    `pages`.`ID` = `meta`.`ID` AND
                    `pages`.`Language` = `meta`.`Language`
	    	WHERE
                `meta`.`Language` = 'bg' AND
                `meta`.`Module` = 'reviews' AND
	    		`meta`.`URLLabel` = 'otzivi'
         AND `meta`.`Visible` = 1 LIMIT 1

SELECT
                IF(`Parent`.`URLLabel` = 'index', `meta`.`URLLabel`, CONCAT(`Parent`.`URLLabel`, '/', `meta`.`URLLabel`)) AS `URLLabel`
            FROM
                `meta`
                INNER JOIN `pages` ON
                    `pages`.`ID` = `meta`.`ID` AND
                    `pages`.`Language` = `meta`.`Language`
                LEFT JOIN `meta` AS `Parent` ON
                    `meta`.`ParentID` = `Parent`.`ID` AND
                    `meta`.`Language` = `Parent`.`Language`
            WHERE
                (`meta`.`Module` = 'pages' OR `Parent`.`Module` = 'pages' OR `meta`.`Module` = `Parent`.`Module`) AND
                `pages`.`Language` = 'bg' AND
                `meta`.`Module` = 'contacts' AND
                `pages`.`Action` = 'index'
         AND `meta`.`Visible` = 1 LIMIT 1

SELECT
                `pages`.`ID`,
                `pages`.`Annotation`
	        FROM
	        	`meta`
                INNER JOIN `pages` ON
                    `pages`.`ID` = `meta`.`ID` AND
                    `pages`.`Language` = `meta`.`Language`
	    	WHERE
                `meta`.`Language` = 'bg' AND
                `meta`.`Module` = 'contacts' AND
	    		`meta`.`URLLabel` = 'contacts'
         AND `meta`.`Visible` = 1 LIMIT 1

SELECT
                `Label`,
                `Value`
            FROM
                `labels`
            WHERE
                `Label` IN ('LBook') AND
                `Language` = 'bg'
             ORDER BY
                `labels`.`Label` ASC

SELECT
                `meta`.`Module`,
                `pages`.`MenuLabel`,
                `pages`.`FooterLabel`,
                IF(`Parent`.`URLLabel` = 'index', `meta`.`URLLabel`, CONCAT(`Parent`.`URLLabel`, '/', `meta`.`URLLabel`)) AS `URLLabel`
            FROM
                `meta`
                INNER JOIN `pages` ON
                    `pages`.`ID` = `meta`.`ID` AND
                    `pages`.`Language` = `meta`.`Language`
                LEFT JOIN `meta` AS `Parent` ON
                    `meta`.`ParentID` = `Parent`.`ID` AND
                    `meta`.`Language` = `Parent`.`Language`
            WHERE
                `pages`.`Language` = 'bg' AND
                (`pages`.`MenuLabel` <> '' OR `pages`.`FooterLabel` <> '') AND
                (`meta`.`Module` = 'pages' OR `Parent`.`Module` = 'pages' OR `meta`.`Module` = `Parent`.`Module`)
         AND `meta`.`Visible` = 1
            GROUP BY
                `pages`.`ID`
            ORDER BY
                `meta`.`PostDate` ASC

SELECT
                `meta`.`Module`,
                `services`.`FooterLabel`,
                 CONCAT(`Parent`.`URLLabel`, '/', `meta`.`URLLabel`) AS `URLLabel`
            FROM
                `meta`
                INNER JOIN `services` ON
                    `services`.`ID` = `meta`.`ID` AND
                    `services`.`Language` = `meta`.`Language`
                INNER JOIN `meta` AS `Parent` ON
                    `meta`.`ParentID` = `Parent`.`ID` AND
                    `meta`.`Language` = `Parent`.`Language`
            WHERE
                `services`.`FooterLabel` <> '' AND
                `services`.`Language` = 'bg' AND
                `meta`.`Module` = 'services' AND
                `Parent`.`Module` = 'services'
            GROUP BY
                `services`.`ID`
            ORDER BY
                `meta`.`PostDate` ASC

SELECT
                `Label`,
                `Value`
            FROM
                `labels`
            WHERE
                `Label` IN ('LMercedesBenzService','LContactUs','Address','LFollowUs','FacebookURL','InstagramURL','Phone','EMail','LServices','LBusinessHours','BusinessHours','Copyright') AND
                `Language` = 'bg'
             ORDER BY
                `labels`.`Label` ASC
