# [07-Oct-2024 08:22:04] /spisanie8/root/admin/users/account.html 108.61.209.243

set names utf8

SELECT
                            `Access`
                        FROM
                            `users`
                        WHERE
                            `ID` = '22159' AND
                            `Access` = '2' AND
                            `SecureKey` = '1d5912819d62329b1d984d9a004b11e4'
                        LIMIT 1

SELECT * FROM users WHERE ID = 22159 LIMIT 1

SELECT
                `products`.`ID`,
                `products`.`URLLabel`,
                `products`.`Title`,
                `products`.`Gallery`,
                `groups`.`URLLabel` AS `MLabel`
            FROM
                `products`
                INNER JOIN `magazines` ON `ID` = `ProductID`
                INNER JOIN `groups` ON `groups`.`ID` = `products`.`GroupID`
            WHERE
                `products`.`PostDate` <= NOW() AND
                `products`.`Visible` = 1
            ORDER BY
                `products`.`PostDate` DESC
            LIMIT 1

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

SELECT *
            FROM (
                (SELECT
                    `products`.`ID`,
                    `products`.`PostDate`,
                    `products`.`Title`,
                    `products`.`Annotation`,
                    `products`.`Image`,
                    `products`.`Gallery`,
                    `products`.`URLLabel`,
                    `groups`.`URLLabel` AS `MLabel`,
                    `products`.`PDF`,
                    `magazines`.`ProductID`,
                    0 AS Gift
                FROM
                    `orders`
                    INNER JOIN `order_products` ON `orders`.`ID` = `order_products`.`OrderID`
                    INNER JOIN `products` ON `products`.`ID` = `order_products`.`ProductID`
                    INNER JOIN `groups` ON `groups`.`ID` = `products`.`GroupID`
                    LEFT JOIN `magazines` ON `products`.`ID` = `magazines`.`ProductID`
                WHERE
                    `orders`.`UserID` = 22159 AND
                    `products`.`OnlinePrice` > 0 AND
                    `products`.`Visible` = 1 AND
                    `products`.`PDF` != '' AND
                    (`orders`.`Status` & 32 OR `orders`.`Status` & 64) AND
                    `orders`.`Status` & 256 = 0 AND
                    `magazines`.`ProductID` IS NULL
                GROUP BY
                    `products`.`ID`)

                UNION ALL

                (SELECT /* podaryci */
                    `products`.`ID`,
                    `products`.`PostDate`,
                    `products`.`Title`,
                    `products`.`Annotation`,
                    `products`.`Image`,
                    `products`.`Gallery`,
                    `products`.`URLLabel`,
                    `groups`.`URLLabel` AS `MLabel`,
                    `products`.`PDF`,
                    `magazines`.`ProductID`,
                    1 AS Gift
                FROM
                    `gifts`
                    INNER JOIN `orders` ON `gifts`.`OrderID` = 0 OR
                        (`gifts`.`OrderID` = `orders`.`ID` AND
                        (`orders`.`Status` & 32 OR `orders`.`Status` & 64) AND
                        `orders`.`Status` & 256 = 0)
                    INNER JOIN `products` ON `products`.`ID` = `gifts`.`ProductID`
                    INNER JOIN `groups` ON `groups`.`ID` = `products`.`GroupID`
                    LEFT OUTER JOIN `magazines` ON `products`.`ID` = `magazines`.`ProductID`
                WHERE
                    `magazines`.`ProductID` IS NULL AND
                    `gifts`.`UserID` = 22159 AND
                    `gifts`.`GiftType` = 2 AND
                    `products`.`OnlinePrice` > 0 AND
                    `products`.`Visible` = 1
                GROUP BY
                    `products`.`ID`)

            ) A
            GROUP BY `ID`
            ORDER BY `PostDate` DESC

SELECT *
            FROM (
                (SELECT /* za otdelni spisaniq */
                    `products`.`ID`,
                    `products`.`PostDate`,
                    `products`.`Title`,
                    `products`.`Annotation`,
                    `products`.`Image`,
                    `products`.`Gallery`,
                    `products`.`URLLabel`,
                    `groups`.`URLLabel` AS `MLabel`,
                    `products`.`PDF`,
                    0 AS Gift
                FROM
                    `orders`
                    INNER JOIN `order_products` ON `orders`.`ID` = `order_products`.`OrderID`
                    INNER JOIN `products` ON `products`.`ID` = `order_products`.`ProductID`
                    INNER JOIN `magazines` ON `products`.`ID` = `magazines`.`ProductID`
                    INNER JOIN `groups` ON `groups`.`ID` = `products`.`GroupID`
                WHERE
                    `orders`.`UserID` = 22159 AND
                    `products`.`OnlinePrice` > 0 AND
                    `products`.`Visible` = 1 AND
                    (`orders`.`Status` & 32 OR `orders`.`Status` & 64) AND
                    `orders`.`Status` & 256 = 0
                GROUP BY
                    `products`.`ID`)

                UNION ALL

                (SELECT /* za abonament */
                    `products`.`ID`,
                    `products`.`PostDate`,
                    `products`.`Title`,
                    `products`.`Annotation`,
                    `products`.`Image`,
                    `products`.`Gallery`,
                    `products`.`URLLabel`,
                    `groups`.`URLLabel` AS `MLabel`,
                    `products`.`PDF`,
                    0 AS Gift
                FROM
                    `orders`
                    INNER JOIN `order_products` ON `orders`.`ID` = `order_products`.`OrderID`
                    INNER JOIN `subscriptions` ON `order_products`.`ProductID` = `subscriptions`.`ProductID`
                    INNER JOIN `products` ON `products`.`PostDate` BETWEEN `order_products`.`StartDate` AND`order_products`.`EndDate`
                    INNER JOIN `magazines` ON `products`.`ID` = `magazines`.`ProductID`
                    INNER JOIN `groups` ON `groups`.`ID` = `products`.`GroupID`
                WHERE
                    `orders`.`UserID` = 22159 AND
                    `subscriptions`.`Digital` = 1 AND
                    `products`.`OnlinePrice` > 0 AND
                    `products`.`Visible` = 1 AND
                    (`orders`.`Status` & 32 OR `orders`.`Status` & 64) AND
                    `orders`.`Status` & 256 = 0
                GROUP BY
                    `products`.`ID`)

                UNION ALL

                (SELECT /* podaryci za otdelni spisaniq */
                    `products`.`ID`,
                    `products`.`PostDate`,
                    `products`.`Title`,
                    `products`.`Annotation`,
                    `products`.`Image`,
                    `products`.`Gallery`,
                    `products`.`URLLabel`,
                    `groups`.`URLLabel` AS `MLabel`,
                    `products`.`PDF`,
                    1 AS Gift
                FROM
                    `gifts`
                    INNER JOIN `orders` ON `gifts`.`OrderID` = 0 OR
                        (`gifts`.`OrderID` = `orders`.`ID` AND
                        (`orders`.`Status` & 32 OR `orders`.`Status` & 64) AND
                        `orders`.`Status` & 256 = 0)
                    INNER JOIN `products` ON `products`.`ID` = `gifts`.`ProductID`
                    INNER JOIN `magazines` ON `products`.`ID` = `magazines`.`ProductID`
                    INNER JOIN `groups` ON `groups`.`ID` = `products`.`GroupID`
                WHERE
                    `gifts`.`UserID` = 22159 AND
                    `gifts`.`GiftType` = 1 AND
                    `products`.`OnlinePrice` > 0 AND
                    `products`.`Visible` = 1
                GROUP BY
                    `products`.`ID`)

            ) A
            GROUP BY `ID`
            ORDER BY `PostDate` DESC

SELECT
                `ID`,
                `ParentID`,
                `Colour`,
                `MenuLabel`,
                `URLLabel`
            FROM
                `groups`
            WHERE
                `ParentID` > 0 AND
                `Visible` = 1
         ORDER BY `PostDate` DESC

SELECT
                `products`.`ID`,
                `products`.`URLLabel`,
                `products`.`Title`,
                `products`.`Gallery`,
                `groups`.`URLLabel` AS `MLabel`
            FROM
                `products`
                INNER JOIN `magazines` ON `ID` = `ProductID`
                INNER JOIN `groups` ON `groups`.`ID` = `products`.`GroupID`
            WHERE
                `products`.`PostDate` <= NOW() AND
                `products`.`Visible` = 1
            ORDER BY
                `products`.`PostDate` DESC
            LIMIT 1

SELECT
                `products`.`ID`,
                `products`.`PostDate`,
                `products`.`URLLabel`,
                `products`.`Title`,
                `products`.`Annotation`,
                `products`.`Gallery`,
                `magazines`.`IntDate`,
                `groups`.`URLLabel` AS `MLabel`
            FROM
                `products`
                INNER JOIN `magazines` ON `ID` = `ProductID`
                INNER JOIN `groups` ON `groups`.`ID` = `products`.`GroupID`
            WHERE
                `products`.`PostDate` <= NOW() AND
                `products`.`Visible` = 1
            ORDER BY
                `products`.`PostDate` DESC
            LIMIT 6

SELECT
                `URLLabel`,
                `MenuLabel`
            FROM
                `pages`
            WHERE
                `Rules` = 0 AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC

SELECT
                `URLLabel`,
                `MenuLabel`
            FROM
                `pages`
            WHERE
                `Rules` = 1 AND
                `Visible` = 1
            ORDER BY
                `PostDate` DESC
# [07-Oct-2024 08:22:05] /spisanie8/root/ajax/banners/sc_MSw5LDIsMw.html?_=1728278524555 108.61.209.243

set names utf8

SELECT
                `ID`,
                `URL`,
                `Target`,
                `Images`,
                `Source`,
                `Width`,
                `Height`,
                `Section`,
                `Rotation`,
                `Alignment`
            FROM
                `banners`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Section` = 1 AND
                `Visible` = 1
            ORDER BY
                `Priority` DESC,
                `Rotation` ASC,
                RAND()
            LIMIT 1

SELECT
                `ID`,
                `URL`,
                `Target`,
                `Images`,
                `Source`,
                `Width`,
                `Height`,
                `Section`,
                `Rotation`,
                `Alignment`
            FROM
                `banners`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Section` = 9 AND
                `Visible` = 1
            ORDER BY
                `Priority` DESC,
                `Rotation` ASC,
                RAND()
            LIMIT 1

SELECT
                `ID`,
                `URL`,
                `Target`,
                `Images`,
                `Source`,
                `Width`,
                `Height`,
                `Section`,
                `Rotation`,
                `Alignment`
            FROM
                `banners`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Section` = 2 AND
                `Visible` = 1
            ORDER BY
                `Priority` DESC,
                `Rotation` ASC,
                RAND()
            LIMIT 1

SELECT
                `ID`,
                `URL`,
                `Target`,
                `Images`,
                `Source`,
                `Width`,
                `Height`,
                `Section`,
                `Rotation`,
                `Alignment`
            FROM
                `banners`
            WHERE
                (CURDATE() BETWEEN `StartFrom` AND `EndTo` OR `EndTo` IS NULL) AND
                `Section` = 3 AND
                `Visible` = 1
            ORDER BY
                `Priority` DESC,
                `Rotation` ASC,
                RAND()
            LIMIT 1
