sark hace 1 mes
commit
419db5c5a1
Se han modificado 50 ficheros con 5205 adiciones y 0 borrados
  1. 119 0
      bin/migrate.php
  2. 9 0
      composer.json
  3. 18 0
      composer.lock
  4. 15 0
      config/src.php
  5. BIN
      database/database.db
  6. 360 0
      public/css/admin/style.css
  7. 786 0
      public/css/styles.css
  8. BIN
      public/images/18+.png
  9. BIN
      public/images/GA.png
  10. BIN
      public/images/GLI.png
  11. 3 0
      public/images/Star.svg
  12. BIN
      public/images/ecogra.png
  13. BIN
      public/images/itechlabs.png
  14. BIN
      public/images/logo.png
  15. BIN
      public/images/mga.png
  16. BIN
      public/images/slider.webp
  17. 25 0
      public/index.php
  18. 564 0
      public/js/admin/scripts.js
  19. 290 0
      public/js/script.js
  20. BIN
      public/uploads/3861988_bf23eec6.jpg
  21. BIN
      public/uploads/Capture-2025-05-13-130007.png
  22. BIN
      public/uploads/Capture-2025-06-26-151206.png
  23. BIN
      public/uploads/Velobet.png
  24. BIN
      public/uploads/backgroun-calc-baner.jpg
  25. 15 0
      resources/css/style.css
  26. 0 0
      resources/js/app.js
  27. 12 0
      resources/view/404.php
  28. 571 0
      resources/view/admin/index.php
  29. 458 0
      resources/view/home.php
  30. 36 0
      resources/view/partials/footer.php
  31. 30 0
      resources/view/partials/header.php
  32. 58 0
      resources/view/redirecting.php
  33. 72 0
      src/Database.php
  34. 4 0
      src/Pages/404.php
  35. 137 0
      src/Pages/admin/index.php
  36. 107 0
      src/Pages/home.php
  37. 55 0
      src/Settings.php
  38. 286 0
      src/helpers.php
  39. 22 0
      vendor/autoload.php
  40. 579 0
      vendor/composer/ClassLoader.php
  41. 396 0
      vendor/composer/InstalledVersions.php
  42. 21 0
      vendor/composer/LICENSE
  43. 11 0
      vendor/composer/autoload_classmap.php
  44. 10 0
      vendor/composer/autoload_files.php
  45. 9 0
      vendor/composer/autoload_namespaces.php
  46. 10 0
      vendor/composer/autoload_psr4.php
  47. 48 0
      vendor/composer/autoload_real.php
  48. 41 0
      vendor/composer/autoload_static.php
  49. 5 0
      vendor/composer/installed.json
  50. 23 0
      vendor/composer/installed.php

+ 119 - 0
bin/migrate.php

@@ -0,0 +1,119 @@
+<?php
+
+/**
+ * Database Migration Script
+ * This file contains all database table creation scripts
+ * Each table is checked for existence before creation
+ */
+
+require_once __DIR__ . '/../vendor/autoload.php';
+
+try {
+    $db = db();
+    
+    echo "Starting database migration...\n";
+    
+    // Migration: Create settings table
+    $settingsTableSQL = "
+    CREATE TABLE IF NOT EXISTS settings (
+        id INTEGER PRIMARY KEY AUTOINCREMENT,
+        grupa VARCHAR(255) NOT NULL,
+        name VARCHAR(255) NOT NULL,
+        value TEXT
+    )";
+    
+    $db->execute($settingsTableSQL);
+    echo " Settings table checked/created\n";
+    
+    // Create index for settings table
+    $settingsIndexSQL = "CREATE INDEX IF NOT EXISTS idx_settings_grupa_name ON settings(grupa, name)";
+    $db->execute($settingsIndexSQL);
+    echo " Settings table index checked/created\n";
+    
+    
+    // Insert default settings if they don't exist
+    $defaultSettings = [
+        // Content settings
+        ['grupa' => 'content', 'name' => 'title', 'value' => 'Welcome to Amazing Casino - Your Ultimate Gaming Destination'],
+        ['grupa' => 'content', 'name' => 'top_text', 'value' => '<h2>Best Online Casino Experience</h2><p>Discover the most exciting online casino games with amazing bonuses and instant payouts!</p>'],
+        ['grupa' => 'content', 'name' => 'bottom_text', 'value' => '<p>Join thousands of players who trust our platform for secure gaming. Play responsibly and enjoy the thrill of winning big!</p>'],
+        ['grupa' => 'content', 'name' => 'author-name', 'value' => 'John Smith'],
+        ['grupa' => 'content', 'name' => 'modified-date', 'value' => '2024-01-15'],
+        ['grupa' => 'content', 'name' => 'login', 'value' => 'Login Now'],
+        ['grupa' => 'content', 'name' => 'password', 'value' => 'Reset Password'],
+        ['grupa' => 'content', 'name' => 'faq-title', 'value' => 'Frequently Asked Questions'],
+        ['grupa' => 'content', 'name' => 'footer__text', 'value' => 'Your trusted casino partner since 2020. Licensed and regulated for your safety.'],
+        ['grupa' => 'content', 'name' => 'copyright', 'value' => '© 2024 Amazing Casino. All rights reserved.'],
+        ['grupa' => 'content', 'name' => 'review-count', 'value' => '1250'],
+        ['grupa' => 'content', 'name' => 'listing', 'value' => 'Top Rated Casinos'],
+        ['grupa' => 'content', 'name' => 'content_btn', 'value' => 'Play Now'],
+        ['grupa' => 'content', 'name' => 'hide-btns', 'value' => '0'],
+        ['grupa' => 'content', 'name' => 'header-logo', 'value' => '{"src":"uploads/logo.png","title":"Amazing Casino Logo","alt":"Amazing Casino - Best Online Gaming"}'],
+        ['grupa' => 'content', 'name' => 'banner-logo', 'value' => '{"src":"uploads/banner.jpg","title":"Welcome Bonus Banner","alt":"Get 200% Welcome Bonus","width":"800","height":"400"}'],
+        ['grupa' => 'content', 'name' => 'footer-logo', 'value' => '{"src":"uploads/footer-logo.png","title":"Footer Logo","alt":"Amazing Casino Footer"}'],
+        ['grupa' => 'content', 'name' => 'favicon', 'value' => 'uploads/favicon.ico'],
+        ['grupa' => 'content', 'name' => 'author-img', 'value' => 'uploads/author.jpg'],
+        ['grupa' => 'content', 'name' => 'hash', 'value' => 'ac123main'],
+        ['grupa' => 'content', 'name' => 'hash-1', 'value' => 'ac123promo'],
+        ['grupa' => 'content', 'name' => 'hash-2', 'value' => 'ac123bonus'],
+        ['grupa' => 'content', 'name' => 'hash-3', 'value' => 'ac123games'],
+        ['grupa' => 'content', 'name' => 'hash-4', 'value' => 'ac123vip'],
+        ['grupa' => 'content', 'name' => 'hash-5', 'value' => 'ac123support'],
+        ['grupa' => 'content', 'name' => 'casino_list', 'value' => '[{"heading":"Royal Casino","text":"200% Welcome Bonus + 50 Free Spins","button":"Claim Bonus","rating":"10"},{"heading":"Golden Palace","text":"100% Match Bonus up to $500","button":"Play Now","rating":"9.5"},{"heading":"Diamond Club","text":"$1000 Welcome Package + VIP Treatment","button":"Join VIP","rating":"9"}]'],
+        ['grupa' => 'content', 'name' => 'faq', 'value' => '[{"question":"How do I create an account?","answer":"Click the Register button and fill in your details. Verification usually takes 5-10 minutes."},{"question":"What payment methods do you accept?","answer":"We accept credit cards, e-wallets, bank transfers, and cryptocurrencies."},{"question":"How long do withdrawals take?","answer":"Most withdrawals are processed within 24 hours."}]'],
+        ['grupa' => 'content', 'name' => 'menu', 'value' => '[{"title":"Home","anchor":"#home"},{"title":"Games","anchor":"#games"},{"title":"Bonuses","anchor":"#bonuses"},{"title":"Reviews","anchor":"#reviews"},{"title":"Contact","anchor":"#contact"}]'],
+        
+        // Style settings
+        ['grupa' => 'styles', 'name' => 'main_color', 'value' => '#1a1a2e'],
+        ['grupa' => 'styles', 'name' => 'secondary_color', 'value' => '#16213e'],
+        ['grupa' => 'styles', 'name' => 'accent_color', 'value' => '#e94560'],
+        ['grupa' => 'styles', 'name' => 'font_color', 'value' => '#ffffff'],
+        ['grupa' => 'styles', 'name' => 'hover_link_color', 'value' => '#f39c12'],
+        ['grupa' => 'styles', 'name' => 'main-fz', 'value' => 'Arial, sans-serif'],
+        ['grupa' => 'styles', 'name' => 'footer_color', 'value' => '#0f0f23'],
+        ['grupa' => 'styles', 'name' => 'link_color', 'value' => '#3498db'],
+        ['grupa' => 'styles', 'name' => 'header_color', 'value' => '#2c2c54'],
+        ['grupa' => 'styles', 'name' => 'login_btn_color', 'value' => '#27ae60'],
+        ['grupa' => 'styles', 'name' => 'pass_btn_color', 'value' => '#e74c3c'],
+        ['grupa' => 'styles', 'name' => 'table', 'value' => '#ecf0f1'],
+        ['grupa' => 'styles', 'name' => 'caption', 'value' => '#bdc3c7'],
+        ['grupa' => 'styles', 'name' => 'faq-title-font-color', 'value' => '#2c3e50'],
+        ['grupa' => 'styles', 'name' => 'faq-title-hover-font-color', 'value' => '#e94560'],
+        ['grupa' => 'styles', 'name' => 'burger-color', 'value' => '#ffffff'],
+
+        // SEO settings
+        ['grupa' => 'seo', 'name' => 'title', 'value' => 'Amazing Casino - Best Online Gaming Experience 2024'],
+        ['grupa' => 'seo', 'name' => 'description', 'value' => 'Join Amazing Casino for the ultimate online gaming experience. Enjoy 200+ games, generous bonuses, and secure payments. Licensed and trusted worldwide.'],
+        ['grupa' => 'seo', 'name' => 'keywords', 'value' => 'online casino, casino games, slots, blackjack, poker, roulette, bonuses, secure gaming'],
+        ['grupa' => 'seo', 'name' => 'canonical', 'value' => 'https://amazing-casino.com'],
+        ['grupa' => 'seo', 'name' => 'og-type', 'value' => 'website'],
+        ['grupa' => 'seo', 'name' => 'og-title', 'value' => 'Amazing Casino - Win Big with Our Casino Games'],
+        ['grupa' => 'seo', 'name' => 'og-description', 'value' => 'Experience the thrill of premium casino games with Amazing Casino. Get your 200% welcome bonus today!'],
+        ['grupa' => 'seo', 'name' => 'og-locale', 'value' => 'en_US'],
+        ['grupa' => 'seo', 'name' => 'og-image', 'value' => 'uploads/og-image.jpg'],
+        ['grupa' => 'seo', 'name' => 'lang', 'value' => 'en'],
+        ['grupa' => 'seo', 'name' => 'lang-page', 'value' => 'en-US'],
+        ['grupa' => 'seo', 'name' => 'hreflang', 'value' => '[{"hreflang":"en","href":"https://amazing-casino.com/en/"},{"hreflang":"es","href":"https://amazing-casino.com/es/"},{"hreflang":"fr","href":"https://amazing-casino.com/fr/"},{"hreflang":"x-default","href":"https://amazing-casino.com/"}]'],
+    ];
+    
+    foreach ($defaultSettings as $setting) {
+        $exists = $db->fetchOne(
+            "SELECT id FROM settings WHERE grupa = ? AND name = ?",
+            [$setting['grupa'], $setting['name']]
+        );
+        
+        if (!$exists) {
+            $db->execute(
+                "INSERT INTO settings (grupa, name, value) VALUES (?, ?, ?)",
+                [$setting['grupa'], $setting['name'], $setting['value']]
+            );
+            echo "✓ Default setting {$setting['grupa']}.{$setting['name']} created\n";
+        }
+    }
+    
+    echo "Migration completed successfully!\n";
+    
+} catch (Exception $e) {
+    echo " Migration failed: " . $e->getMessage() . "\n";
+    exit(1);
+}

+ 9 - 0
composer.json

@@ -0,0 +1,9 @@
+{
+    "autoload": {
+        "psr-4": {
+            "App\\": "src/"
+        },
+        "classmap": ["config/src.php"],
+        "files": ["src/helpers.php"]
+    }
+}

+ 18 - 0
composer.lock

@@ -0,0 +1,18 @@
+{
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+        "This file is @generated automatically"
+    ],
+    "content-hash": "d751713988987e9331980363e24189ce",
+    "packages": [],
+    "packages-dev": [],
+    "aliases": [],
+    "minimum-stability": "stable",
+    "stability-flags": {},
+    "prefer-stable": false,
+    "prefer-lowest": false,
+    "platform": {},
+    "platform-dev": {},
+    "plugin-api-version": "2.6.0"
+}

+ 15 - 0
config/src.php

@@ -0,0 +1,15 @@
+<?php 
+class Config
+{
+    const PATH = [
+        'root' => __DIR__.'/..',
+        'src' => __DIR__.'/../src',
+        'storage' => __DIR__.'/../public/uploads',
+        'resources' => __DIR__.'/../resources',
+        'view' => __DIR__.'/../resources/view',
+        'public' => __DIR__.'/../public',
+    ];
+
+    public static function __callStatic($name, $arguments) {}
+}
+ ?>

BIN
database/database.db


+ 360 - 0
public/css/admin/style.css

@@ -0,0 +1,360 @@
+*{
+    margin: 0;
+    padding: 0;
+    /* text-transform: capitalize; */
+}
+.item{
+    display: flex;
+    flex-direction: column;
+    margin: 10px 0;
+    gap: 5px;
+}
+
+.styles .item{
+    flex-direction: column;
+}
+.styles .item {
+    flex-direction: column;
+}
+.hash .item{
+    flex-direction: row;
+    height: fit-content;
+    align-items: center;
+}
+.item textarea{
+    height: 70px;
+}
+.form__submit{
+    border: none;
+    background: green;
+    color: white;
+    border-radius: 7px;
+    padding: 10px 20px;
+    margin: 20px 0;
+    cursor: pointer;
+}
+.form__btn-block{
+    justify-content: center;
+    display: flex;
+}
+.container{
+    max-width: 1200px;
+    margin: auto;
+    background: #f3f3f3;
+    padding: 15px;
+}
+.meta{
+    text-align: center;
+}
+input[type="text"]{
+    padding: 10px;
+}
+.content{
+    text-align: center;
+}
+.styles h2{
+    text-align: center;
+}
+.style-grid{
+    display: grid;
+    grid-template-columns: 1fr 1fr;
+}
+.img-block{
+    display: flex;
+    align-items: flex-end;
+    border-bottom: 1px solid lightgray;
+    padding-bottom: 5px;
+}
+#menu-repeater h2{
+    text-align: center;
+    margin: 15px 0;
+}
+.menu-faq-btn{
+    margin: 10px 0;
+}
+#menu-form{
+    margin: auto;
+}
+.btn-rm{
+
+}
+textarea{
+    padding: 10px;
+}
+.item  span +div{
+    display: flex;
+    align-items: center;
+    gap: 10px;
+}
+#faq-repeater  .repeater-item{
+    display: flex;
+    align-items: center;
+    gap: 10px;
+}
+#faq-repeater  .repeater-item input{
+    height: 70px;
+}
+.repeater-item textarea{
+    height: 70px;
+}
+#faq-repeater h2{
+    text-align: center;
+}
+.img-thumb{
+    max-width: 70px;
+    display: block;
+}
+#menu-repeater button{
+    padding: 10px 20px;
+    border: none;
+    background: #70acf0;
+     color: white;
+}
+#faq-repeater button{
+    padding: 10px 20px;
+    border: none;
+    background: #70acf0;
+     color: white;
+}
+hr{
+    width: 40%;
+    text-align: center;
+    display: block;
+    margin: 20px auto;
+}
+
+#listing-repeater h2{
+    text-align: center;
+    margin: 15px 0;
+}
+#listing-repeater button[type="submit"]{
+    padding: 10px 20px;
+    border: none;
+    background: #70acf0;
+    color: white;
+    cursor: pointer;
+}
+#listing-repeater button[type="button"]{
+    padding: 10px 20px;
+    border: none;
+    background: #70acf0;
+    color: white;
+    cursor: pointer;
+}
+.casino-item > div{
+    width: 45%;
+    display: flex;
+    justify-content: space-between;
+    margin: 15px 0;
+    align-items: center;
+}
+.casino-item input{
+    width: 350px;
+
+}
+h2.title{
+    font-size: 40px;
+    text-align: center;
+    margin-bottom: 20px;
+}
+.form-fields{
+    display: flex;
+    justify-content: flex-start;
+    flex-direction: column;
+    gap: 10px;
+}
+.form-fields div{
+    text-align: left;
+}
+.href-block{
+    display: flex;
+}
+
+/* Drag & Drop styles for casino items */
+.casino-item {
+    transition: opacity 0.3s ease, transform 0.2s ease;
+}
+
+.casino-item.dragging {
+    opacity: 0.5;
+}
+
+.casino-item:hover {
+    border-color: #999 !important;
+}
+
+.drag-handle {
+    cursor: grab !important;
+    user-select: none;
+}
+
+.drag-handle:active {
+    cursor: grabbing !important;
+}
+
+#casinoRepeater {
+    position: relative;
+}
+
+/* Accordion styles for casino items */
+.casino-item-header {
+    transition: background-color 0.2s ease;
+}
+
+.casino-item-header:hover {
+    background-color: #e0e0e0 !important;
+}
+
+.casino-item-content {
+    display: flex;
+    flex-direction: column;
+    gap: 15px;
+    padding-top: 10px;
+    transition: all 0.3s ease;
+}
+
+.casino-item-content > div {
+    display: flex;
+    flex-direction: column;
+    gap: 5px;
+}
+
+.casino-item-content > div span {
+    font-weight: 500;
+    font-size: 14px;
+}
+
+.casino-item-content input[type="text"],
+.casino-item-content input[type="file"] {
+    width: 300px;
+    box-sizing: border-box;
+}
+
+.casino-item-content button {
+    align-self: flex-start;
+    margin-top: 5px;
+}
+
+.toggle-accordion {
+    transition: transform 0.3s ease;
+}
+
+.casino-item-title {
+    font-size: 14px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
+
+/* Tab styles for admin interface */
+.tabs {
+    display: flex;
+    border-bottom: 2px solid #ddd;
+    margin-bottom: 20px;
+}
+
+.tab {
+    padding: 12px 24px;
+    cursor: pointer;
+    border: 1px solid #ddd;
+    border-bottom: none;
+    background: #f5f5f5;
+    margin-right: 5px;
+    transition: background 0.3s;
+}
+
+.tab.active {
+    background: #007bff;
+    color: white;
+}
+
+.tab:hover {
+    background: #e0e0e0;
+}
+
+.tab.active:hover {
+    background: #0056b3;
+}
+
+/* Alpine.js cloak to prevent flash of unstyled content */
+[x-cloak] { display: none !important; }
+
+.tab-content {
+    display: block;
+}
+
+/* Image block styles */
+.img-block {
+    display: flex;
+    gap: 20px;
+    margin-bottom: 20px;
+    align-items: flex-start;
+}
+
+.img-block .item {
+    flex: 0 0 auto;
+}
+
+.img-block > div:last-child {
+    flex: 1;
+}
+
+.img-block > div:last-child span {
+    display: block;
+    margin-bottom: 5px;
+    font-weight: bold;
+}
+
+.img-block > div:last-child input {
+    width: 100%;
+    margin-bottom: 10px;
+    padding: 5px;
+}
+
+.img-thumb {
+    max-width: 150px;
+    max-height: 100px;
+    object-fit: cover;
+    border: 1px solid #ddd;
+    border-radius: 4px;
+    margin-bottom: 10px;
+    display: block;
+}
+
+/* Override existing item styles for better layout */
+.item span {
+    display: inline-block;
+    min-width: 150px;
+    font-weight: bold;
+    margin-right: 10px;
+}
+
+.item input[type="file"] {
+    margin-left: 10px;
+}
+
+/* Hreflang block styles */
+.href-block {
+    display: grid;
+    grid-template-columns: 1fr 1fr;
+    gap: 20px;
+    margin-bottom: 15px;
+}
+
+.href-block .item {
+    display: flex;
+    flex-direction: column;
+}
+
+.href-block .item span {
+    margin-bottom: 5px;
+    font-weight: bold;
+    min-width: auto;
+}
+
+.href-block .item input {
+    width: 100%;
+    padding: 8px;
+    border: 1px solid #ddd;
+    border-radius: 4px;
+}

+ 786 - 0
public/css/styles.css

@@ -0,0 +1,786 @@
+* {
+    margin: 0;
+    padding: 0;
+     box-sizing: border-box;
+
+}
+html{
+    scroll-behavior: smooth;
+}
+body {
+    color: white;
+    background: #3E3E40;
+    font-size: 18px;
+    font-family: Arial, Helvetica, Verdana, sans-serif;
+    scroll-behavior: smooth;
+}
+ul,ol{
+    margin-top: 20px;
+    margin-bottom: 20px;
+}
+ul{
+    margin-left: 15px;
+}
+ol{
+    margin-left: 20px;  
+}
+.container {
+    max-width: 1310px;
+    width: 100%;
+    height: 100%;
+    margin: 0 auto;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    position: relative;
+    padding: 0 16px;
+}
+
+.header {
+    background: #595959;
+    position: fixed;
+    width: 100%;
+    top: 0;
+    height: 70px;
+    z-index: 1;
+}
+.header__logo{
+    min-width: 33%;
+}
+.header__menu{
+    min-width: 33%;
+    display: flex;
+    justify-content: center;
+}
+.header__logo img{
+    height: 36px;
+    cursor: pointer;
+}
+.header__btns{
+    min-width: 33%;
+}
+@media only screen and (max-width: 768px) {
+    .header__logo img{
+        height: 28px;
+    } 
+    .main__title {
+        font-size: 35px!important;
+       text-align: center;
+        
+    }
+    h1,h2,h3,h4,h5,h6{
+        text-align: center;
+    }
+}
+.header__menu-list li{
+    cursor: pointer;
+}
+
+.header__menu-list {
+    list-style: none;
+    display: flex;
+    gap: 40px;
+}
+
+.header__btns {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    /* gap: 15px; */
+}
+
+.main {
+    margin-top: 70px;
+    margin-bottom: 70px;
+}
+
+.main__title {
+    font-size: 35px;
+    margin: 15px 0;
+    
+}
+
+.main .container {
+    flex-direction: column;
+}
+
+.header__login {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    padding: 0 10px;
+    white-space: nowrap;
+    height: 42px;
+    border-radius: 6px;
+    font-size: 16px;
+    color: white;
+    text-decoration: none;
+    cursor: pointer;
+    transition: 0.3s ease-in-out;
+    background: #404040;
+    margin-right: 15px; 
+}
+
+@media only screen and (max-width: 768px) {
+    .footer__content{
+        flex-direction: column;
+    }
+    .footer__bottom-imgs{
+        flex-wrap: wrap;
+    }
+    .header .container{
+        width: initial;
+    }
+     .container{
+        width: auto;
+
+    }
+    .pulse__btn.main__btn{
+        height: 59px!important;
+    }
+    .header__menu-list{
+        /* background: #595959; */
+        display: flex;
+        flex-direction: column;
+        padding-left: 15px;
+        border-top: 1px solid white;
+        gap: 0;
+    
+    }
+    .header__menu-list li{
+        text-transform: uppercase;
+        padding: 20px 0;
+    }
+    .footer__menu li {
+        text-align: center;
+    }
+    .header__login {
+        height: 38px;
+        max-width: none;
+        width: auto;
+        padding: 0 10px;
+        white-space: normal;
+        text-align: center;
+        margin-right: 5px;
+    }
+    .header__mobile-menu{
+        margin-left: 5px!important;
+    }
+    .pulse__btn{
+        height: 38px!important;
+        max-width: none;
+        width: auto;
+        padding: 0 10px;
+        white-space: normal;
+        text-align: center;
+    }
+    /* html,body{
+        overflow-x: hidden;
+    } */
+}
+.pulse__btn {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    padding: 0 10px;
+    white-space: nowrap;
+    height: 42px;
+    border-radius: 6px;
+    font-size: 16px;
+    color: #090909;
+    text-decoration: none;
+    cursor: pointer;
+    -webkit-animation: pulse 2s infinite;
+    animation: pulse 2s infinite;
+    background: #FFDA16;
+    font-weight: 600;
+}
+/* .pulse__btn:hover{
+    background:  #fff61e;
+    transition: 0.3s ease-in-out;
+} */
+
+.main__banner{
+    cursor: pointer;
+}
+.main__text{
+    color: var(--text-color);
+    font-size: 20px;
+    line-height: 140%;
+    margin: 15px 0px;
+}
+.main__btn{
+    max-width: 300px;
+    height: 60px;
+    width: 100%;
+    font-size: 18px;
+}
+.footer{
+    background: #595959;
+    padding: 20px 0;
+}
+.footer .container{
+    flex-direction: column;
+}
+.footer__bottom-imgs{
+    display: flex;
+    list-style-type: none;
+    gap: 20px;
+    margin-bottom: 10px;
+}
+.footer__copyright{
+    text-align: center;
+    color: white;
+    font-size: 13px;
+}
+.footer__content{
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    width: 100%;
+    margin: 25px 0; 
+}
+.footer__menu ul{
+    list-style: none;
+}
+.footer__logo img{
+    height: 60px;
+    cursor: pointer;
+}
+.footer__menu li{
+    margin: 15px 0;
+}
+
+.accordion-container {
+    width: 100%;
+    margin-top: 35px;
+  }
+  
+  .accordion-item {
+    background-color: #FFFFFF; /* White background for items */
+    border: 1px solid #E0E0E0; /* Light border */
+    border-radius: 8px;
+    margin-bottom: 10px;
+    overflow: hidden;
+    height: fit-content;
+  }
+  
+  .accordion-header {
+    background-color: #595959; /* Soft purple */
+    padding: 20px 32px;
+    border: none;
+    width: 100%;
+    text-align: left;
+    cursor: pointer;
+    outline: none;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    border-radius: 8px;
+    transition: background-color 0.3s ease;
+    color: white;
+    font-family: Arial, Helvetica, Verdana, sans-serif;  
+    font-size: 18px;
+    font-style: normal;
+    font-weight: 700;
+    line-height: normal;
+  }
+  
+  .accordion-header:hover {
+    /* background: #FFDA16; */
+    color: black;
+  }
+  .accordion-header:hover .icon {
+    color: white;
+    opacity: 1;
+  }
+  
+  .accordion-content {
+    background-color: #595959; /* Very light grey for content */
+    overflow: hidden;
+    padding: 0 32px;
+    max-height: 0;
+    transition: max-height 0.3s ease;
+
+  }
+  
+  .accordion-content p {
+    margin: 15px 0;
+    line-height: 1.5;
+  }
+  
+  .icon {
+    transition: transform 0.3s ease;
+    font-weight: 100;
+    opacity: 0.6;
+    font-size: 33px;
+  }
+  
+  .active .icon {
+    transform: rotate(45deg);
+  }
+  
+  .accordion-header.active {
+    /* background: #FFDA16; */
+    color: black;
+    border-bottom-left-radius: 0;
+    border-bottom-right-radius: 0;
+  }
+  .accordion-header.active .icon {
+    opacity: 1;
+  }
+  .accordion-container {
+    width: 100%;
+    display: grid;
+    grid-template-columns: 1fr 1fr;
+    grid-column-gap: 8px;
+}
+h2{
+    margin: 15px 0;
+    padding-bottom: 12px;
+    position: relative;
+    display: block;
+    width: 100%;
+}
+
+h2::after {
+    content: '';
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+    height: 1px;
+    background: currentColor;
+}
+p{
+    margin: 10px 0;
+}
+table{
+    border: 1px solid white;
+    width: 100%;
+    border-collapse: collapse;
+    margin: 20px 0;
+}
+caption{
+    padding: 15px;
+    border: 1px solid white;
+    display: table-caption;
+    text-align: center;
+}
+td{
+    border: 1px solid white;
+    padding: 10px;
+}
+th{
+    border: 1px solid white;
+    padding: 10px;
+}
+
+/* Стили для десктопа */
+/* .header__menu {
+    display: block;
+} */
+
+.header__mobile-menu {
+    display: none;
+    cursor: pointer;
+    position: relative;
+    width: 24px;
+    height: 24px;
+    margin-left: 15px;
+}
+
+.burger, .burger:before, .burger:after {
+    content: '';
+    position: absolute;
+    background-color: #333;
+    width: 100%;
+    height: 3px;
+    transition: all 0.3s ease;
+}
+
+.burger {
+    top: 50%;
+    transform: translateY(-50%);
+}
+
+.burger:before {
+    top: -8px;
+}
+
+.burger:after {
+    top: 8px;
+}
+
+.burger.active {
+    background-color: transparent;
+}
+
+.burger.active:before {
+    top: 0;
+    transform: rotate(45deg);
+}
+
+.burger.active:after {
+    top: 0;
+    transform: rotate(-45deg);
+}
+
+/* Скрываем меню на мобильных устройствах */
+@media only screen and (max-width: 768px) {
+    .header__menu {
+        display: none;
+        position: absolute;
+        top: 70px;
+        left: 0;
+        width: 100%;
+        background: #fff;
+        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
+        transition: all 0.3s ease;
+    }
+    .footer__content{
+       text-align: center;
+       gap: 20px!important;
+    }
+    .header__menu.active {
+        display: block;
+    }
+
+    .header__mobile-menu {
+        display: block;
+    }
+    .main__banner img{
+        max-width: 100%;
+        object-fit: contain;
+        height: auto;
+    }
+    .accordion-container {
+        grid-template-columns: 1fr;
+    }
+}
+.header__menu-list{
+    margin: initial;
+}
+.main img{
+    max-width: 100%;
+    height: auto;
+}
+.footer__content{
+    gap: 40px;
+}
+.main{
+    overflow-x: hidden;
+}
+.secondary__text{
+    max-width: 1310px;
+    width: 100%;
+    margin-bottom: 30px;
+}
+.table-wrap{
+    overflow-x: auto;
+}
+
+.casinos__item{
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    width: 100%;
+    gap: 24px;
+    padding: 24px 32px;
+    border-radius: 8px;
+background: var(--Main-White, #FFF);
+box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1), 0px 8px 16px rgba(0, 0, 0, 0.08);
+}
+.casinos__info{
+    display: flex;
+    align-items: center;
+    gap: 24px;
+    width: 40%;
+}
+.casinos__image img{
+    display: flex;
+    width: 140px;
+    height: 92px;
+    flex-direction: column;
+    align-items: flex-start;
+    gap: 10px;
+    border-radius: 8px;
+    object-fit: cover;
+        
+}
+.casinos__image{
+    overflow: hidden;
+}
+.casinos__wrap{
+    display: flex;
+    flex-direction: column;
+    gap: 16px;
+    margin: 20px auto;
+}
+.casinos__button button{
+    display: flex;
+    width: 200px;
+    height: 52px;
+    padding: 18px 32px;
+    justify-content: center;
+    align-items: center;
+    gap: 10px;
+    border-radius: 4px;
+    border: none;
+    color: var(--Main-White, #FFF);
+/* Mountserrat/Bold/18 */
+    font-size: 18px;
+    font-style: normal;
+    font-weight: 700;
+    line-height: normal;
+    cursor: pointer;
+    transition: filter 0.3s ease;
+}
+
+.casinos__button button:hover{
+    filter: brightness(0.85);
+}
+.casinos__bonus{
+    font-size: 24px;
+    font-style: normal;
+    font-weight: 700;
+    line-height: 32px; /* 133.333% */
+    width: 40%;
+}
+.casinos__number{
+    border-radius: 4px;
+    display: flex;
+    width: 40px;
+    height: 40px;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    gap: 10px;
+    position: relative;
+}
+
+/* .top-casino .casinos__number::after {
+    content: '⭐';
+    position: absolute;
+    top: -8px;
+    right: -4px;
+    font-size: 16px;
+} */
+
+/* Топ-3 казино - золотой ободок */
+.casinos__item.top-casino {
+    border: 2px solid #FFD700;
+    box-shadow: 0px 4px 8px rgba(255, 215, 0, 0.4), 0px 8px 20px rgba(255, 215, 0, 0.25);
+}
+.casinos__title{
+    color: var(--Main-Back, #000);
+    font-size: 20px;
+    font-style: normal;
+    font-weight: 900;
+    line-height: normal;
+}
+.casinos__rait{
+    display: flex;
+    gap: 8px;
+    margin-top: 12px;
+    align-items: center;
+}
+
+.casinos__rait img {
+    filter: brightness(0) saturate(100%) invert(76%) sepia(94%) saturate(1615%) hue-rotate(360deg) brightness(105%) contrast(103%);
+}
+
+.casinos__rating-box {
+    display: inline-flex;
+    align-items: center;
+    justify-content: center;
+    padding: 4px 10px;    font-weight: 700;
+    line-height: 1;
+    white-space: nowrap;
+    border-radius: 8px;
+    border: 1px solid #EFF2F5;
+    background: #F5F8FB;
+    color: rgba(0, 0, 0, 0.40);
+    font-size: 12px;
+    font-style: normal;
+    font-weight: 700;
+    line-height: normal;
+ }
+
+.casinos__rating-value {
+    color: var(--Main-Back, #000);
+    font-size: 16px;
+    font-style: normal;
+    font-weight: 700;
+    line-height: normal;
+}
+
+@media only screen and (max-width: 768px) {
+    .casinos__item{
+        flex-direction: column;
+        padding: 16px;
+        position: relative;
+    }
+    .casinos__info{
+        width: 100%;
+        align-items: flex-start;
+    }
+    .casinos__bonus{
+        width: 100%;
+        text-align: center;
+        font-size: 16px;
+        font-style: normal;
+        font-weight: 700;
+        line-height: 20px; /* 125% */
+    }
+    .casinos__rait{
+        justify-content: center;
+    }
+    .casinos{
+        padding: 0 30px;
+    }
+    .casinos__number{
+        position: absolute;
+        width: 32px;
+        height: 32px;
+        top: 6px;
+        left: 6px;
+    }
+
+    /* .top-casino .casinos__number::after {
+        font-size: 14px;
+        top: -3px;
+        right: -3px;
+    } */
+
+    .casinos__image img {
+        width: 100px;
+        height: 64px;
+    }
+    .casinos__title{
+        color: var(--Main-Back, #000);
+        font-size: 18px;
+        font-style: normal;
+        font-weight: 900;
+        line-height: normal;
+    }
+    .casinos__rait{
+        justify-content: flex-start;
+    }
+    .casinos__button {
+        width: 100%;
+    }
+    .casinos__button a{
+        width: 100%;
+    }
+    .casinos__button button{
+        width: 100%;
+        font-size: 18px;
+    }
+    .form-wrap{
+        flex-direction: column;
+        margin: 0 0 0 0!important;
+        gap: 5px!important;
+    }
+    .form-wrap .main__text{
+        margin: 0;
+    }
+    .contact-form{
+        max-width: 80%!important;
+        margin:20px auto;
+    }
+}
+.redirect-js{
+    cursor: pointer;
+}
+.banner__info{
+    display: flex;
+    flex-direction: column;
+    margin-top: 70px;
+}
+.secondary__text{
+    margin:  30px 0;
+}
+.container.banner__info {
+    flex-direction: column;
+    margin-top: 70px;
+}
+.author{
+    display: flex;
+    gap: 10px;
+    align-items: center;
+    margin: 15px 0 0 0;
+    width: 100%;
+}
+.author img{
+    height: 60px;
+    width: 60px;
+    border-radius: 50%;
+}
+.author__date{
+    opacity: 0.6;
+    font-style: italic;
+}
+.author__name{
+    font-style: italic;
+}
+.author__info{
+    display: flex;
+    flex-direction: column;
+    gap: 5px;
+}
+.author img img{
+    object-fit: cover;
+}
+.form-wrap{
+    display: flex;
+    gap: 30px;
+    margin: 25px 0;
+}
+    .contact-form {
+      background: #fff;
+      padding: 20px 30px;
+      border-radius: 8px;
+      box-shadow: 0 4px 10px rgba(0,0,0,0.1);
+      width: 100%;
+      max-width: 400px;
+    }
+    .contact-form h2 {
+      margin-bottom: 15px;
+      color: #333;
+      font-size: 1.5rem;
+      text-align: center;
+    }
+    .contact-form label {
+      display: block;
+      margin-bottom: 5px;
+      color: #555;
+    }
+    .contact-form input,
+    .contact-form textarea {
+      width: 100%;
+      padding: 10px;
+      margin-bottom: 15px;
+      border: 1px solid #ccc;
+      border-radius: 5px;
+      font-size: 1rem;
+      box-sizing: border-box;
+    }
+    .contact-form textarea {
+      resize: vertical;
+      height: 100px;
+    }
+    .contact-form button {
+      background-color: #4CAF50;
+      color: #fff;
+      border: none;
+      padding: 10px 20px;
+      border-radius: 5px;
+      cursor: pointer;
+      font-size: 1rem;
+      transition: background 0.3s ease;
+      width: 100%;
+    }
+    .contact-form button:hover {
+      background-color: #45a049;
+    }

BIN
public/images/18+.png


BIN
public/images/GA.png


BIN
public/images/GLI.png


+ 3 - 0
public/images/Star.svg

@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M17.5623 21.3332C17.4032 21.3332 17.2442 21.2968 17.0992 21.2219L12 18.5985L6.90077 21.2219C6.56275 21.3953 6.15474 21.3647 5.84972 21.1441C5.54171 20.9235 5.3887 20.5503 5.4527 20.181L6.42475 14.6387L2.30456 10.7144C2.02955 10.4535 1.93154 10.0615 2.04855 9.70405C2.16455 9.34657 2.47857 9.0866 2.85559 9.03243L8.55684 8.21704L11.104 3.1691C11.442 2.49946 12.558 2.49946 12.896 3.1691L15.4432 8.21704L21.1444 9.03243C21.5214 9.0866 21.8354 9.34657 21.9514 9.70405C22.0685 10.0615 21.9705 10.4535 21.6954 10.7144L17.5753 14.6387L18.5473 20.181C18.6113 20.5503 18.4583 20.9235 18.1503 21.1441C17.9773 21.2702 17.7703 21.3332 17.5623 21.3332Z" fill="#FFC400"/>
+</svg>

BIN
public/images/ecogra.png


BIN
public/images/itechlabs.png


BIN
public/images/logo.png


BIN
public/images/mga.png


BIN
public/images/slider.webp


+ 25 - 0
public/index.php

@@ -0,0 +1,25 @@
+<?php 
+require dirname(__FILE__, 2).'/vendor/autoload.php';
+
+//route
+$requestUri = $_GET['p'] ?? parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
+$page = match (true) {
+  ('/' === $requestUri) => 'home.php',
+  ('/admin/' === $requestUri) => 'admin/index.php',
+  ('/verstka/' === $requestUri) => 'verstka.php',
+  (preg_match('#^/redirect/([\w-]+)/$#', $requestUri, $matches) === 1) => 'redirect.php',
+  default => '404.php',
+};
+
+//slug
+if (isset($matches[1])) {
+  $slug = $matches[1];
+}
+
+//connect
+$content = (!empty($page) && file_exists(Config::PATH['src']."/Pages/{$page}"))
+  ? require Config::PATH['src']."/Pages/{$page}"
+  : 'Select a page to view please'
+?>
+
+<?=$content ?>

+ 564 - 0
public/js/admin/scripts.js

@@ -0,0 +1,564 @@
+document.addEventListener('DOMContentLoaded', function() {
+    tinymce.init({
+        license_key: 'gpl',
+        remove_script_host: false,
+        relative_urls: false,  
+        entity_encoding: 'raw', // Записывает символы как есть
+        valid_elements: '*[*]', // Разрешает любые элементы и атрибуты
+        content_css: false,     // Отключает внешнюю CSS-стилизацию
+        force_br_newlines: true,
+        //force_p_newlines: true,
+        entities: '160,nbsp', // Мини
+        remove_linebreaks: false,
+        selector: '.secondary-content', // Ваши текстовые области
+        encoding: 'UTF-8',      // Указывает кодировку 
+        plugins: 'image link media code table lists', // Подключены плагины для изображений, таблиц, списков
+        toolbar: 'undo redo | styleselect | bold italic | bullist numlist | alignleft aligncenter alignright alignjustify | outdent indent | link image media table | code', // Добавлены кнопки для списков
+        menubar: 'file edit view insert format tools table help', // Включаем меню с таблицами
+        contextmenu: 'table', // Контекстное меню для работы с таблицами
+        images_upload_url: '/admin/upload.php', // URL для загрузки изображений
+        automatic_uploads: true, // Автоматическая загрузка изображений
+        file_picker_types: 'image', // Включаем выбор файлов
+        images_reuse_filename: true, // Сохраняем оригинальное название файла
+        paste_as_text: true,
+        setup: function (editor) {
+            // Обработка перед сохранением
+            editor.on('SaveContent', function (e) {
+                e.content = e.content.replace(/<img([^>]*?)src=/g, '<img$1class="lazy" data-src=');
+            });
+    
+            // Обработка контента при загрузке в редактор
+            editor.on('BeforeSetContent', function (e) {
+                e.content = e.content.replace(/<img([^>]*?)src=/g, '<img$1class="lazy" data-src=');
+            });
+        },
+        table_default_attributes: {
+            border: '1', // Граница таблицы по умолчанию
+        },
+        table_default_styles: {
+            width: '100%', // Ширина таблицы по умолчанию
+            borderCollapse: 'collapse', // Границы объединяются
+        },
+        file_picker_callback: function(callback, value, meta) {
+            // Если это изображение, открываем стандартный файловый выбор
+            if (meta.filetype === 'image') {
+                const input = document.createElement('input');
+                input.setAttribute('type', 'file');
+                input.setAttribute('accept', 'image/*');
+                input.onchange = function() {
+                    const file = this.files[0];
+                    const formData = new FormData();
+                    formData.append('file', file);
+    
+                    fetch('/admin/upload.php', {
+                        method: 'POST',
+                        body: formData
+                    })
+                    .then(response => response.json())
+                    .then(result => {
+                        callback(result.location); // URL изображения
+                    })
+                    .catch(() => alert('Ошибка при загрузке изображения.'));
+                };
+                input.click();
+            }
+        },
+        content_style: `
+        body { font-family: Arial, sans-serif; font-size: 14px; }
+        table { border-collapse: collapse; width: 100%; }
+        th, td { border: 1px solid #ddd; padding: 8px; }
+        th { background-color: #f2f2f2; text-align: left; }
+    ` // Добавлены стили для таблиц
+    });
+});
+
+
+
+// Выбор цвета-------------------------
+document.addEventListener('DOMContentLoaded', function () {
+    // Получаем все элементы input с классами inp-color и inp-color-text
+    const colorPickers = document.querySelectorAll('.inp-color');
+    const textInputs = document.querySelectorAll('.inp-color-text');
+
+    // Синхронизация inp-color -> inp-color-text
+    colorPickers.forEach(colorPicker => {
+        colorPicker.addEventListener('input', function () {
+            const textInput = this.nextElementSibling;
+            if (textInput && textInput.classList.contains('inp-color-text')) {
+                textInput.value = this.value;
+            }
+        });
+    });
+
+    // Синхронизация inp-color-text -> inp-color
+    textInputs.forEach(textInput => {
+        textInput.addEventListener('input', function () {
+            const colorPicker = this.previousElementSibling;
+            if (colorPicker && colorPicker.classList.contains('inp-color')) {
+                // Проверяем, что введенное значение является валидным цветом в формате HEX
+                if (/^#([0-9A-F]{3}|[0-9A-F]{6})$/i.test(this.value)) {
+                    colorPicker.value = this.value;
+                }
+            }
+        });
+
+        // Проверяем и синхронизируем значение при загрузке страницы
+        const colorPicker = textInput.previousElementSibling;
+        if (colorPicker && colorPicker.classList.contains('inp-color')) {
+            // Проверяем, что значение в текстовом поле валидное
+            if (/^#([0-9A-F]{3}|[0-9A-F]{6})$/i.test(textInput.value)) {
+                colorPicker.value = textInput.value;
+            }
+        }
+    });
+});
+
+
+// function addRepeaterItem(type) {
+//     const container = document.getElementById(`${type}-items`);
+//     const index = container.children.length;
+//     const html = `
+//         <div class="repeater-item">
+//             <input type="text" name="items[${index}][question]" placeholder="Question">
+//             <input type="text" name="items[${index}][answer]" placeholder="Answer">
+//             <button type="button" onclick="this.parentElement.remove()">Remove</button>
+//         </div>`;
+//     container.insertAdjacentHTML('beforeend', html);
+// }
+
+
+function addCasinoItem() {
+    const container = document.getElementById('casinoRepeater');
+    const tpl = document.getElementById('casinoTemplate').content.cloneNode(true);
+    container.appendChild(tpl);
+}
+
+function uploadImage(input, wrapper) {
+    const file = input.files[0];
+    const formData = new FormData();
+    formData.append('image', file);
+
+    fetch('upload_repeater_image.php', {
+            method: 'POST',
+            body: formData
+        })
+        .then(resp => resp.json())
+        .then(data => {
+            if (data.success) {
+                wrapper.querySelector('.image').value = data.path;
+            } else {
+                alert('Ошибка загрузки изображения: ' + data.message);
+            }
+        });
+}
+
+function saveRepeater() {
+    const items = [];
+    document.querySelectorAll('#casinoRepeater .casino-item').forEach((item, index) => {
+        items.push({
+            id: item.dataset.id || null,
+            sort_order: index,
+            image: item.querySelector('.image').value,
+            alt: item.querySelector('.alt').value,
+            title: item.querySelector('.title').value,
+            heading: item.querySelector('.heading').value,
+            text: item.querySelector('.text').value,
+            button: item.querySelector('.button').value,
+            keitaro: item.querySelector('.keitaro').value,
+        });
+    });
+    document.getElementById('casinoRepeaterData').value = JSON.stringify(items);
+    return true;
+}
+
+// Drag and Drop functionality for casino items
+document.addEventListener('DOMContentLoaded', function() {
+    const container = document.getElementById('casinoRepeater');
+    if (!container) return;
+
+    let draggedElement = null;
+    let placeholder = null;
+
+    function updateOrderNumbers() {
+        const items = container.querySelectorAll('.casino-item');
+        items.forEach((item, index) => {
+            const numberElement = item.querySelector('.casino-order-number');
+            if (numberElement) {
+                numberElement.textContent = index + 1;
+            }
+        });
+    }
+
+    function createPlaceholder() {
+        const div = document.createElement('div');
+        div.className = 'drag-placeholder';
+        div.style.cssText = 'height: 60px; margin: 10px 0; border: 2px dashed #007bff; background: #f0f8ff; opacity: 0.5;';
+        return div;
+    }
+
+    // Accordion functionality
+    function initAccordion() {
+        const items = container.querySelectorAll('.casino-item');
+
+        items.forEach(item => {
+            const header = item.querySelector('.casino-item-header');
+            const toggleBtn = item.querySelector('.toggle-accordion');
+            const content = item.querySelector('.casino-item-content');
+            const dragHandle = item.querySelector('.drag-handle');
+
+            if (!header || !toggleBtn || !content) return;
+
+            // Toggle accordion
+            const toggleAccordion = (e) => {
+                // Не закрывать если клик по drag handle
+                if (e.target.closest('.drag-handle')) {
+                    return;
+                }
+
+                const isOpen = content.style.display !== 'none' && content.style.display !== '';
+
+                if (isOpen) {
+                    content.style.display = 'none';
+                    toggleBtn.textContent = '▼';
+                } else {
+                    content.style.display = 'flex';
+                    toggleBtn.textContent = '▲';
+                }
+            };
+
+            header.addEventListener('click', toggleAccordion);
+
+            // Запрет на перетаскивание при клике на header (кроме drag-handle)
+            header.addEventListener('mousedown', (e) => {
+                if (!e.target.closest('.drag-handle')) {
+                    item.setAttribute('draggable', 'false');
+                }
+            });
+
+            header.addEventListener('mouseup', () => {
+                item.setAttribute('draggable', 'true');
+            });
+
+            // Drag только за handle
+            dragHandle.addEventListener('mousedown', (e) => {
+                e.stopPropagation();
+                item.setAttribute('draggable', 'true');
+            });
+
+            // Обновление заголовка при изменении Casino title
+            const headingInput = item.querySelector('.heading');
+            if (headingInput) {
+                headingInput.addEventListener('input', function() {
+                    const titleElement = item.querySelector('.casino-item-title');
+                    if (titleElement) {
+                        titleElement.textContent = this.value || 'New Casino Item';
+                    }
+                });
+            }
+        });
+    }
+
+    function initDragAndDrop() {
+        const items = container.querySelectorAll('.casino-item');
+
+        items.forEach(item => {
+            item.setAttribute('draggable', 'true');
+
+            const dragHandle = item.querySelector('.drag-handle');
+
+            // Drag только при клике на handle
+            dragHandle.addEventListener('mousedown', function(e) {
+                item.setAttribute('draggable', 'true');
+            });
+
+            item.addEventListener('dragstart', function(e) {
+                // Проверяем что перетаскивание началось с drag-handle
+                if (!e.target.querySelector('.drag-handle')) {
+                    e.preventDefault();
+                    return;
+                }
+
+                draggedElement = this;
+                this.classList.add('dragging');
+                e.dataTransfer.effectAllowed = 'move';
+                e.dataTransfer.setData('text/html', '');
+
+                setTimeout(() => {
+                    this.style.display = 'none';
+                }, 0);
+            });
+
+            item.addEventListener('dragend', function(e) {
+                this.style.display = '';
+                this.classList.remove('dragging');
+
+                if (placeholder && placeholder.parentNode) {
+                    placeholder.parentNode.removeChild(placeholder);
+                }
+                placeholder = null;
+                draggedElement = null;
+
+                updateOrderNumbers();
+            });
+        });
+    }
+
+    container.addEventListener('dragover', function(e) {
+        e.preventDefault();
+        e.dataTransfer.dropEffect = 'move';
+
+        if (!draggedElement) return;
+
+        const afterElement = getDragAfterElement(container, e.clientY);
+        const currentItems = [...container.querySelectorAll('.casino-item:not(.dragging)')];
+
+        if (!placeholder) {
+            placeholder = createPlaceholder();
+        }
+
+        if (afterElement == null) {
+            container.appendChild(placeholder);
+        } else {
+            container.insertBefore(placeholder, afterElement);
+        }
+    });
+
+    container.addEventListener('drop', function(e) {
+        e.preventDefault();
+
+        if (!draggedElement || !placeholder) return;
+
+        if (placeholder.parentNode) {
+            placeholder.parentNode.insertBefore(draggedElement, placeholder);
+            placeholder.parentNode.removeChild(placeholder);
+        }
+
+        draggedElement.style.display = '';
+        placeholder = null;
+    });
+
+    function getDragAfterElement(container, y) {
+        const draggableElements = [...container.querySelectorAll('.casino-item:not(.dragging)')];
+
+        return draggableElements.reduce((closest, child) => {
+            const box = child.getBoundingClientRect();
+            const offset = y - box.top - box.height / 2;
+
+            if (offset < 0 && offset > closest.offset) {
+                return { offset: offset, element: child };
+            } else {
+                return closest;
+            }
+        }, { offset: Number.NEGATIVE_INFINITY }).element;
+    }
+
+    // Инициализация при загрузке
+    initAccordion();
+    initDragAndDrop();
+    updateOrderNumbers();
+
+    // Слушаем событие удаления элемента
+    container.addEventListener('itemRemoved', function() {
+        updateOrderNumbers();
+    });
+
+    // Переопределяем addCasinoItem для инициализации drag&drop на новых элементах
+    window.originalAddCasinoItem = window.addCasinoItem;
+    window.addCasinoItem = function() {
+        if (window.originalAddCasinoItem) {
+            window.originalAddCasinoItem();
+        } else {
+            const container = document.getElementById('casinoRepeater');
+            const tpl = document.getElementById('casinoTemplate').content.cloneNode(true);
+            container.appendChild(tpl);
+        }
+        setTimeout(() => {
+            initAccordion();
+            initDragAndDrop();
+            updateOrderNumbers();
+        }, 10);
+    };
+});
+
+
+const pageSelect = document.getElementById('page-select');
+if (pageSelect) {
+    pageSelect.addEventListener('change', function () {
+        const selected = this.value;
+        const blocks = document.querySelectorAll('.page-block');
+
+        blocks.forEach(block => {
+            if (block.classList.contains(selected)) {
+                block.style.display = 'block';
+            } else {
+                block.style.display = 'none';
+            }
+        });
+    });
+}
+
+// Tab switching functionality for new admin interface
+function switchTab(tabName) {
+    // Hide all tab contents
+    const contents = document.querySelectorAll('.tab-content');
+    contents.forEach(content => content.classList.remove('active'));
+    
+    // Remove active class from all tabs
+    const tabs = document.querySelectorAll('.tab');
+    tabs.forEach(tab => tab.classList.remove('active'));
+    
+    // Show selected tab content
+    document.getElementById(tabName + '-tab').classList.add('active');
+    
+    // Add active class to clicked tab
+    event.target.classList.add('active');
+}
+
+// Repeater functionality for new admin interface
+function addRepeaterItem(type) {
+    const container = document.getElementById(`${type}-items`);
+    const index = container.children.length;
+
+    const html = `
+        <div class="repeater-item" style="margin-bottom: 15px; padding: 15px; border: 1px solid #ddd;">
+            ${type === 'menu' ? `
+                <input type="text" name="repeaters[${type}][${index}][title]" placeholder="Menu Title" style="width: 100%; margin-bottom: 10px;">
+                <input type="text" name="repeaters[${type}][${index}][anchor]" placeholder="Anchor Link (#id)" style="width: 100%; margin-bottom: 10px;">
+            ` : `
+                <input type="text" name="repeaters[${type}][${index}][question]" placeholder="Question" style="width: 100%; margin-bottom: 10px;">
+                <textarea name="repeaters[${type}][${index}][answer]" placeholder="Answer" style="width: 100%; margin-bottom: 10px;"></textarea>
+            `}
+            <button type="button" onclick="removeRepeaterItem(this)" style="background: #dc3545; color: white; border: none; padding: 5px 10px;">Remove</button>
+        </div>`;
+    container.insertAdjacentHTML('beforeend', html);
+}
+
+function removeRepeaterItem(button) {
+    button.parentElement.remove();
+}
+
+function addCasinoItem() {
+    const container = document.getElementById('casino-items');
+    const index = container.children.length;
+
+    const html = `
+        <div class="casino-item" style="margin-bottom: 20px; padding: 15px; border: 1px solid #ddd;">
+            <h4>Casino Item #${index + 1}</h4>
+            <input type="text" name="repeaters[casino_list][${index}][heading]" placeholder="Casino Name" style="width: 100%; margin-bottom: 10px;">
+            <input type="text" name="repeaters[casino_list][${index}][text]" placeholder="Bonus Text" style="width: 100%; margin-bottom: 10px;">
+            <input type="text" name="repeaters[casino_list][${index}][button]" placeholder="Button Text" style="width: 100%; margin-bottom: 10px;">
+            <input type="file" name="casino_image_${index}" style="margin-bottom: 10px;">
+            <button type="button" onclick="removeRepeaterItem(this)" style="background: #dc3545; color: white; border: none; padding: 5px 10px;">Remove</button>
+        </div>`;
+    container.insertAdjacentHTML('beforeend', html);
+}
+
+function addHreflangItem() {
+    const container = document.getElementById('hreflang-items');
+    const index = container.children.length;
+
+    const html = `
+        <div style="margin-bottom: 15px; padding: 15px; border: 1px solid #ddd;">
+            <div style="display: grid; grid-template-columns: 1fr 1fr auto; gap: 15px; align-items: center;">
+                <div>
+                    <label style="display: block; margin-bottom: 5px; font-weight: bold;">Hreflang</label>
+                    <input type="text" name="seo[hreflang][${index}][hreflang]" placeholder="en, es, fr, etc." style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
+                </div>
+                <div>
+                    <label style="display: block; margin-bottom: 5px; font-weight: bold;">Href URL</label>
+                    <input type="text" name="seo[hreflang][${index}][href]" placeholder="https://example.com/en/" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
+                </div>
+                <button type="button" onclick="removeRepeaterItem(this)" style="background: #dc3545; color: white; border: none; padding: 8px 12px; border-radius: 4px; margin-top: 25px;">Remove</button>
+            </div>
+        </div>`;
+    container.insertAdjacentHTML('beforeend', html);
+}
+
+// Load existing data for new admin interface
+function loadExistingData() {
+    const menuItems = window.menuItems || [];
+    const faqItems = window.faqItems || [];
+    const casinoItems = window.casinoItems || [];
+    const hreflangItems = window.hreflangItems || [];
+
+    // Load existing menu items
+    menuItems.forEach((item, index) => {
+        if (item && item.title) {
+            const container = document.getElementById('menu-items');
+            if (container) {
+                const html = `
+                    <div class="repeater-item" style="margin-bottom: 15px; padding: 15px; border: 1px solid #ddd;">
+                        <input type="text" name="repeaters[menu][${index}][title]" value="${item.title}" placeholder="Menu Title" style="width: 100%; margin-bottom: 10px;">
+                        <input type="text" name="repeaters[menu][${index}][anchor]" value="${item.anchor || ''}" placeholder="Anchor Link (#id)" style="width: 100%; margin-bottom: 10px;">
+                        <button type="button" onclick="removeRepeaterItem(this)" style="background: #dc3545; color: white; border: none; padding: 5px 10px;">Remove</button>
+                    </div>`;
+                container.insertAdjacentHTML('beforeend', html);
+            }
+        }
+    });
+
+    // Load existing FAQ items
+    faqItems.forEach((item, index) => {
+        if (item && item.question) {
+            const container = document.getElementById('faq-items');
+            if (container) {
+                const html = `
+                    <div class="repeater-item" style="margin-bottom: 15px; padding: 15px; border: 1px solid #ddd;">
+                        <input type="text" name="repeaters[faq][${index}][question]" value="${item.question}" placeholder="Question" style="width: 100%; margin-bottom: 10px;">
+                        <textarea name="repeaters[faq][${index}][answer]" placeholder="Answer" style="width: 100%; margin-bottom: 10px;">${item.answer || ''}</textarea>
+                        <button type="button" onclick="removeRepeaterItem(this)" style="background: #dc3545; color: white; border: none; padding: 5px 10px;">Remove</button>
+                    </div>`;
+                container.insertAdjacentHTML('beforeend', html);
+            }
+        }
+    });
+
+    // Load existing casino items
+    casinoItems.forEach((item, index) => {
+        if (item && item.heading) {
+            const container = document.getElementById('casino-items');
+            if (container) {
+                const html = `
+                    <div class="casino-item" style="margin-bottom: 20px; padding: 15px; border: 1px solid #ddd;">
+                        <h4>${item.heading}</h4>
+                        <input type="text" name="repeaters[casino_list][${index}][heading]" value="${item.heading}" placeholder="Casino Name" style="width: 100%; margin-bottom: 10px;">
+                        <input type="text" name="repeaters[casino_list][${index}][text]" value="${item.text || ''}" placeholder="Bonus Text" style="width: 100%; margin-bottom: 10px;">
+                        <input type="text" name="repeaters[casino_list][${index}][button]" value="${item.button || ''}" placeholder="Button Text" style="width: 100%; margin-bottom: 10px;">
+                        <button type="button" onclick="removeRepeaterItem(this)" style="background: #dc3545; color: white; border: none; padding: 5px 10px;">Remove</button>
+                    </div>`;
+                container.insertAdjacentHTML('beforeend', html);
+            }
+        }
+    });
+
+    // Load existing hreflang items
+    hreflangItems.forEach((item, index) => {
+        if (item && (item.hreflang || item.href)) {
+            const container = document.getElementById('hreflang-items');
+            if (container) {
+                const html = `
+                    <div style="margin-bottom: 15px; padding: 15px; border: 1px solid #ddd;">
+                        <div style="display: grid; grid-template-columns: 1fr 1fr auto; gap: 15px; align-items: center;">
+                            <div>
+                                <label style="display: block; margin-bottom: 5px; font-weight: bold;">Hreflang</label>
+                                <input type="text" name="seo[hreflang][${index}][hreflang]" value="${item.hreflang || ''}" placeholder="en, es, fr, etc." style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
+                            </div>
+                            <div>
+                                <label style="display: block; margin-bottom: 5px; font-weight: bold;">Href URL</label>
+                                <input type="text" name="seo[hreflang][${index}][href]" value="${item.href || ''}" placeholder="https://example.com/en/" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
+                            </div>
+                            <button type="button" onclick="removeRepeaterItem(this)" style="background: #dc3545; color: white; border: none; padding: 8px 12px; border-radius: 4px; margin-top: 25px;">Remove</button>
+                        </div>
+                    </div>`;
+                container.insertAdjacentHTML('beforeend', html);
+            }
+        }
+    });
+}
+
+// Initialize on DOM ready (for new admin interface)
+if (document.readyState === 'loading') {
+    document.addEventListener('DOMContentLoaded', loadExistingData);
+} else {
+    loadExistingData();
+}

+ 290 - 0
public/js/script.js

@@ -0,0 +1,290 @@
+document.querySelectorAll('.accordion-header').forEach(button => {
+    button.addEventListener('click', () => {
+        const accordionContent = button.nextElementSibling;
+
+        button.classList.toggle('active');
+
+        if (button.classList.contains('active')) {
+            accordionContent.style.maxHeight = accordionContent.scrollHeight + 'px';
+        } else {
+            accordionContent.style.maxHeight = 0;
+        }
+
+        // Close other open accordion items
+        document.querySelectorAll('.accordion-header').forEach(otherButton => {
+            if (otherButton !== button) {
+                otherButton.classList.remove('active');
+                otherButton.nextElementSibling.style.maxHeight = 0;
+            }
+        });
+    });
+});
+
+// Меню-------------------------
+
+    document.addEventListener('DOMContentLoaded', function () {
+        const mobileMenuButton = document.querySelector('.header__mobile-menu');
+        const menu = document.querySelector('.header__menu');
+        const burger = document.querySelector('.burger');
+
+        mobileMenuButton.addEventListener('click', function () {
+            menu.classList.toggle('active');
+            burger.classList.toggle('active');
+        });
+    });
+
+
+// Redirect
+
+function redirectJs(e) {
+    e.preventDefault();
+    let idp = this.getAttribute('data-idp');
+    let label = this.getAttribute('data-label');
+    let customUrl = this.getAttribute('data-url');
+    let page = window.location.href;
+
+    let redirectForm = document.createElement('form');
+    redirectForm.target = '_blank';
+    redirectForm.method = 'POST';
+    redirectForm.action = 'redirecting.php';
+
+    let redirectInput2 = document.createElement('input');
+    redirectInput2.type = 'hidden';
+    redirectInput2.name = 'idpage';
+    redirectInput2.value = idp;
+    redirectForm.appendChild(redirectInput2);
+
+    let redirectInput3 = document.createElement('input');
+    redirectInput3.type = 'hidden';
+    redirectInput3.name = 'page';
+    redirectInput3.value = page;
+    redirectForm.appendChild(redirectInput3);
+
+    let redirectInput4 = document.createElement('input');
+    redirectInput4.type = 'hidden';
+    redirectInput4.name = 'label';
+    redirectInput4.value = label;
+    redirectForm.appendChild(redirectInput4);
+
+    // Добавляем custom_url если есть
+    if (customUrl) {
+        let redirectInput5 = document.createElement('input');
+        redirectInput5.type = 'hidden';
+        redirectInput5.name = 'custom_url';
+        redirectInput5.value = customUrl;
+        redirectForm.appendChild(redirectInput5);
+    }
+
+    document.body.appendChild(redirectForm);
+    redirectForm.submit();
+}
+
+let redirectButtons = document.querySelectorAll('.redirect-js');
+
+for (let i = 0; i < redirectButtons.length; i++) {
+    redirectButtons[i].addEventListener('click', redirectJs);
+}
+
+document.addEventListener('DOMContentLoaded', function () {
+    var bLazy = new Blazy({
+        selector: '.lazy',  // Класс для ленивой загрузки
+    });
+});
+
+// Автоматическое оборачивание всех таблиц в table-wrap
+(function() {
+    function wrapTables(container) {
+        if (!container || !container.querySelectorAll) {
+            return;
+        }
+
+        const tables = container.querySelectorAll('table:not(.table-wrapped)');
+
+        tables.forEach(function(table) {
+            // Проверяем, не обёрнута ли уже таблица
+            if (table.parentElement && table.parentElement.classList.contains('table-wrap')) {
+                table.classList.add('table-wrapped');
+                return;
+            }
+
+            // Создаём обёртку
+            const wrapper = document.createElement('div');
+            wrapper.className = 'table-wrap';
+
+            // Вставляем обёртку перед таблицей
+            table.parentNode.insertBefore(wrapper, table);
+
+            // Перемещаем таблицу внутрь обёртки
+            wrapper.appendChild(table);
+
+            // Помечаем таблицу как обёрнутую
+            table.classList.add('table-wrapped');
+        });
+    }
+
+    function initTableWrapping() {
+        // Оборачиваем все существующие таблицы
+        wrapTables(document.body);
+
+        // Повторно проверяем через небольшую задержку (для динамического контента)
+        setTimeout(function() {
+            wrapTables(document.body);
+        }, 500);
+
+        setTimeout(function() {
+            wrapTables(document.body);
+        }, 1500);
+    }
+
+    // Запускаем при загрузке
+    if (document.readyState === 'loading') {
+        document.addEventListener('DOMContentLoaded', initTableWrapping);
+    } else {
+        initTableWrapping();
+    }
+
+    // Наблюдаем за изменениями DOM (для динамического контента из TinyMCE)
+    const observer = new MutationObserver(function(mutations) {
+        let shouldProcess = false;
+
+        mutations.forEach(function(mutation) {
+            if (mutation.addedNodes.length) {
+                mutation.addedNodes.forEach(function(node) {
+                    if (node.nodeType === 1) {
+                        // Если добавлена таблица или контейнер с таблицей
+                        if (node.tagName === 'TABLE' || (node.querySelectorAll && node.querySelectorAll('table').length > 0)) {
+                            shouldProcess = true;
+                        }
+                    }
+                });
+            }
+        });
+
+        if (shouldProcess) {
+            wrapTables(document.body);
+        }
+    });
+
+    // Запускаем наблюдатель
+    function startObserver() {
+        if (document.body) {
+            observer.observe(document.body, {
+                childList: true,
+                subtree: true
+            });
+        }
+    }
+
+    if (document.body) {
+        startObserver();
+    } else {
+        document.addEventListener('DOMContentLoaded', startObserver);
+    }
+})();
+
+// Автоматическое добавление rel="nofollow noopener" target="_blank" ко всем внешним ссылкам
+(function() {
+    const currentHost = window.location.hostname;
+
+    function processExternalLinks(container) {
+        if (!container || !container.querySelectorAll) {
+            return;
+        }
+
+        // Находим все ссылки в контейнере
+        const allLinks = container.querySelectorAll('a[href]');
+
+        allLinks.forEach(function(link) {
+            // Пропускаем уже обработанные ссылки
+            if (link.hasAttribute('data-external-processed')) {
+                return;
+            }
+
+            const href = link.getAttribute('href');
+
+            // Пропускаем пустые, якорные ссылки, относительные пути и специальные протоколы
+            if (!href || href.startsWith('#') || href.startsWith('javascript:') ||
+                href.startsWith('mailto:') || href.startsWith('tel:') || href.startsWith('/')) {
+                return;
+            }
+
+            try {
+                // Проверяем, является ли ссылка внешней
+                let isExternal = false;
+
+                // Если ссылка начинается с http:// или https://
+                if (href.startsWith('http://') || href.startsWith('https://')) {
+                    const linkUrl = new URL(href);
+                    isExternal = (linkUrl.hostname !== currentHost);
+                }
+
+                // Если это внешняя ссылка, добавляем атрибуты
+                if (isExternal) {
+                    link.setAttribute('rel', 'nofollow noopener');
+                    link.setAttribute('target', '_blank');
+                    link.setAttribute('data-external-processed', 'true');
+                }
+            } catch (e) {
+                // Если возникла ошибка при парсинге URL, игнорируем
+                console.warn('Unable to parse URL:', href, e);
+            }
+        });
+    }
+
+    function initExternalLinks() {
+        // Обрабатываем все ссылки на странице
+        processExternalLinks(document.body);
+
+        // Повторно обрабатываем через небольшую задержку (для динамического контента)
+        setTimeout(function() {
+            processExternalLinks(document.body);
+        }, 500);
+
+        setTimeout(function() {
+            processExternalLinks(document.body);
+        }, 1500);
+    }
+
+    // Обрабатываем существующие ссылки при загрузке
+    if (document.readyState === 'loading') {
+        document.addEventListener('DOMContentLoaded', initExternalLinks);
+    } else {
+        // DOM уже загружен
+        initExternalLinks();
+    }
+
+    // Наблюдаем за изменениями DOM (для динамического контента, включая TinyMCE)
+    const observer = new MutationObserver(function(mutations) {
+        let shouldProcess = false;
+
+        mutations.forEach(function(mutation) {
+            if (mutation.addedNodes.length) {
+                mutation.addedNodes.forEach(function(node) {
+                    if (node.nodeType === 1) { // Element node
+                        shouldProcess = true;
+                    }
+                });
+            }
+        });
+
+        if (shouldProcess) {
+            processExternalLinks(document.body);
+        }
+    });
+
+    // Запускаем наблюдатель после загрузки DOM
+    function startObserver() {
+        if (document.body) {
+            observer.observe(document.body, {
+                childList: true,
+                subtree: true
+            });
+        }
+    }
+
+    if (document.body) {
+        startObserver();
+    } else {
+        document.addEventListener('DOMContentLoaded', startObserver);
+    }
+})();

BIN
public/uploads/3861988_bf23eec6.jpg


BIN
public/uploads/Capture-2025-05-13-130007.png


BIN
public/uploads/Capture-2025-06-26-151206.png


BIN
public/uploads/Velobet.png


BIN
public/uploads/backgroun-calc-baner.jpg


+ 15 - 0
resources/css/style.css

@@ -0,0 +1,15 @@
+.header{
+    position: sticky;
+    top: 0;
+    left: 0;
+    z-index: 102;
+    width: 100%;
+    background: rgb(21 , 21, 21);
+    pointer-events: auto;
+}
+.header__inner{
+    position: relative;
+    height: 106px;
+    padding: 12px 20px;
+
+}

+ 0 - 0
resources/js/app.js


+ 12 - 0
resources/view/404.php

@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>404 Not Found</title>
+</head>
+<body>
+    <h1>404 Not Found</h1>
+    <p>The page you are looking for does not exist.</p>
+</body>
+</html>

+ 571 - 0
resources/view/admin/index.php

@@ -0,0 +1,571 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Admin Panel</title>
+    <script defer src="https://cdnjs.cloudflare.com/ajax/libs/alpinejs/3.15.0/cdn.js"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/8.1.2/tinymce.min.js"></script>
+    <link rel="stylesheet" href="/css/admin/style.css">
+</head>
+
+<body>
+    <div class="container">
+        <div style="margin-bottom: 20px;">
+            <a href="pages.php" style="display: inline-block; padding: 10px 20px; background: #007bff; color: white; text-decoration: none; border-radius: 4px; margin-bottom: 10px;">📄 Manage Dynamic Pages</a>
+        </div>
+
+        <!-- Navigation Tabs -->
+        <div x-data="{ activeTab: 'content' }" x-cloak class="tabs-container">
+            <div class="tabs">
+                <div class="tab" :class="{ 'active': activeTab === 'content' }" @click="activeTab = 'content'">Content</div>
+                <div class="tab" :class="{ 'active': activeTab === 'options' }" @click="activeTab = 'options'">Options</div>
+                <div class="tab" :class="{ 'active': activeTab === 'styles' }" @click="activeTab = 'styles'">Styles</div>
+                <div class="tab" :class="{ 'active': activeTab === 'seo' }" @click="activeTab = 'seo'">SEO & Meta</div>
+            </div>
+
+            <!-- Debug: Active tab is: <span x-text="activeTab"></span> -->
+
+            <form method="POST" action="" enctype="multipart/form-data">
+                <input type="hidden" name="form_submitted" value="1">
+
+                <!-- Content Tab -->
+                <div x-show="activeTab === 'content'" x-transition class="tab-content">
+                    <h2>Page Content</h2>
+                    <hr>
+
+                    <div class="item">
+                        <span>Page Title (H1):</span>
+                        <input type="text" name='content[title]' value="<?= $content['title'] ?? '' ?>">
+                    </div>
+
+                    <div class="item">
+                        <h3>Top Text</h3>
+                        <textarea class="secondary-content" name='content[top_text]'><?= urldecode($content['top_text'] ?? '') ?></textarea>
+                    </div>
+
+                    <div class="item">
+                        <h3>Bottom Text</h3>
+                        <textarea class="secondary-content" name='content[bottom_text]'><?= htmlspecialchars($content['bottom_text'] ?? '', ENT_QUOTES, 'UTF-8') ?></textarea>
+                    </div>
+
+                    <div class="item">
+                        <span>Author name</span>
+                        <input type="text" name='content[author-name]' value="<?= $content['author-name'] ?? '' ?>">
+                    </div>
+
+                    <div class="item">
+                        <span>Modified date</span>
+                        <input type="text" name='content[modified-date]' value="<?= $content['modified-date'] ?? '' ?>">
+                    </div>
+
+                    <div class="item">
+                        <span>Text login button</span>
+                        <input type="text" name='content[login]' value="<?= $content['login'] ?? '' ?>">
+                    </div>
+
+                    <div class="item">
+                        <span>Text password button</span>
+                        <input type="text" name='content[password]' value="<?= $content['password'] ?? '' ?>">
+                    </div>
+
+                    <div class="item">
+                        <span>Faq title</span>
+                        <input type="text" name='content[faq-title]' value="<?= $content['faq-title'] ?? '' ?>">
+                    </div>
+
+                    <div class="item">
+                        <span>Footer text</span>
+                        <textarea name='content[footer__text]'><?= $content['footer__text'] ?? '' ?></textarea>
+                    </div>
+
+                    <div class="item">
+                        <span>Copyright</span>
+                        <textarea name='content[copyright]'><?= $content['copyright'] ?? '' ?></textarea>
+                    </div>
+
+
+                    <h3>Casino/Review Settings</h3>
+                    <hr>
+
+                    <div class="item">
+                        <span>Review casino count</span>
+                        <input type="text" name='content[review-count]' value="<?= $content['review-count'] ?? '' ?>">
+                    </div>
+
+                    <div class="item">
+                        <span>h2 - Casino listing</span>
+                        <input type="text" name='content[listing]' value="<?= $content['listing'] ?? '' ?>">
+                    </div>
+
+                    <div class="item">
+                        <span>Text content button</span>
+                        <input type="text" name='content[content_btn]' value="<?= $content['content_btn'] ?? '' ?>">
+                    </div>
+
+                    <div class="item">
+                        <span>Hide login-password btns</span>
+                        <input type="hidden" name="content[hide-btns]" value="0">
+                        <input type="checkbox" name="content[hide-btns]" value="1" <?= !empty($content['hide-btns']) ? 'checked' : '' ?>>
+                    </div>
+
+
+                    <h3>Images & Media</h3>
+                    <hr>
+
+                    <div class="img-block">
+                        <div class="item">
+                            <?php 
+                            $headerLogo = [];
+                            if (isset($content['header-logo']) && !empty($content['header-logo'])) {
+                                $headerLogo = json_decode($content['header-logo'], true) ?: [];
+                            }
+                            ?>
+                            <?php if (!empty($headerLogo['src'])): ?>
+                                <img class="img-thumb" src="../<?= $headerLogo['src'] ?>" alt="Header Logo">
+                            <?php endif; ?>
+                            <span>Header logo</span>
+                            <input type="file" name="content[header-logo]">
+                        </div>
+                        <div>
+                            <span>Header logo title</span>
+                            <input type="text" name='content[header-logo][title]' value="<?= htmlspecialchars($headerLogo['title'] ?? '') ?>">
+                            <span>Header logo alt</span>
+                            <input type="text" name='content[header-logo][alt]' value="<?= htmlspecialchars($headerLogo['alt'] ?? '') ?>">
+                        </div>
+                    </div>
+
+                    <div class="img-block">
+                        <div class="item">
+                            <?php 
+                            $bannerLogo = [];
+                            if (isset($content['banner-logo']) && !empty($content['banner-logo'])) {
+                                $bannerLogo = json_decode($content['banner-logo'], true) ?: [];
+                            }
+                            ?>
+                            <?php if (!empty($bannerLogo['src'])): ?>
+                                <img class="img-thumb" src="../<?= $bannerLogo['src'] ?>" alt="Banner Image">
+                            <?php endif; ?>
+                            <span>Banner Image</span>
+                            <input type="file" name="content[banner-logo]">
+                        </div>
+                        <div>
+                            <span>Banner logo title</span>
+                            <input type="text" name='content[banner-logo][title]' value="<?= htmlspecialchars($bannerLogo['title'] ?? '') ?>">
+                            <span>Banner logo alt</span>
+                            <input type="text" name='content[banner-logo][alt]' value="<?= htmlspecialchars($bannerLogo['alt'] ?? '') ?>">
+                            <span>Banner logo width</span>
+                            <input type="text" name='content[banner-logo][width]' value="<?= htmlspecialchars($bannerLogo['width'] ?? '') ?>">
+                            <span>Banner logo height</span>
+                            <input type="text" name='content[banner-logo][height]' value="<?= htmlspecialchars($bannerLogo['height'] ?? '') ?>">
+                        </div>
+                    </div>
+
+                    <div class="img-block">
+                        <div class="item">
+                            <?php 
+                            $footerLogo = [];
+                            if (isset($content['footer-logo']) && !empty($content['footer-logo'])) {
+                                $footerLogo = json_decode($content['footer-logo'], true) ?: [];
+                            }
+                            ?>
+                            <?php if (!empty($footerLogo['src'])): ?>
+                                <img class="img-thumb" src="../<?= $footerLogo['src'] ?>" alt="Footer Logo">
+                            <?php endif; ?>
+                            <span>Footer logo</span>
+                            <input type="file" name="content[footer-logo]">
+                        </div>
+                        <div>
+                            <span>Footer logo title</span>
+                            <input type="text" name='content[footer-logo][title]' value="<?= htmlspecialchars($footerLogo['title'] ?? '') ?>">
+                            <span>Footer logo alt</span>
+                            <input type="text" name='content[footer-logo][alt]' value="<?= htmlspecialchars($footerLogo['alt'] ?? '') ?>">
+                        </div>
+                    </div>
+
+                    <div class="item">
+                        <?php if (!empty($content['favicon'])): ?>
+                            <img class="img-thumb" src="../<?= $content['favicon'] ?>" alt="Favicon">
+                        <?php endif; ?>
+                        <span>Favicon</span>
+                        <input type="file" name="content[favicon]">
+                    </div>
+
+                    <div class="item">
+                        <?php if (!empty($content['author-img'])): ?>
+                            <img class="img-thumb" src="../<?= $content['author-img'] ?>" alt="author-img">
+                        <?php endif; ?>
+                        <span>Author img</span>
+                        <input type="file" name="content[author-img]">
+                    </div>
+
+
+                    <h3>Dynamic Content</h3>
+                    <hr>
+
+                    <!-- FAQ Section -->
+                    <div x-data="{ 
+                        faqItems: <?= htmlspecialchars(json_encode($faqItems ?? []), ENT_QUOTES, 'UTF-8'); ?> || []
+                    }">
+                        <h4>FAQ Items</h4>
+                        <button type="button" @click="faqItems.push({ question: '', answer: '' })" style="background: #007bff; color: white; border: none; padding: 10px 20px; border-radius: 4px; margin-bottom: 15px; cursor: pointer; font-size: 14px;">+ Add FAQ Item</button>
+
+                        <template x-for="(item, index) in faqItems" :key="index">
+                            <div style="margin-bottom: 15px; padding: 15px; border: 1px solid #ddd;">
+                                <div style="display: grid; grid-template-columns: 1fr auto; gap: 15px; align-items: start;">
+                                    <div style="display: flex; flex-direction: column; gap: 10px;">
+                                        <div>
+                                            <label style="display: block; margin-bottom: 5px; font-weight: bold;">Question</label>
+                                            <input type="text" x-model="item.question" :name="`content[faq][${index}][question]`" placeholder="Question" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
+                                        </div>
+                                        <div>
+                                            <label style="display: block; margin-bottom: 5px; font-weight: bold;">Answer</label>
+                                            <textarea x-model="item.answer" :name="`content[faq][${index}][answer]`" placeholder="Answer" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; min-height: 80px;"></textarea>
+                                        </div>
+                                    </div>
+                                    <button type="button" @click="faqItems.splice(index, 1)" style="background: #dc3545; color: white; border: none; padding: 8px 12px; border-radius: 4px;">Remove</button>
+                                </div>
+                            </div>
+                        </template>
+                    </div>
+
+                    <!-- Menu Section -->
+                    <div x-data="{ 
+                        menuItems: <?= htmlspecialchars(json_encode($menuItems ?? []), ENT_QUOTES, 'UTF-8'); ?> || []
+                    }">
+                        <h4>Menu Items</h4>
+                        <button type="button" @click="menuItems.push({ title: '', anchor: '' })" style="background: #007bff; color: white; border: none; padding: 10px 20px; border-radius: 4px; margin-bottom: 15px; cursor: pointer; font-size: 14px;">+ Add Menu Item</button>
+
+                        <template x-for="(item, index) in menuItems" :key="index">
+                            <div style="margin-bottom: 15px; padding: 15px; border: 1px solid #ddd;">
+                                <div style="display: grid; grid-template-columns: 1fr 1fr auto; gap: 15px; align-items: center;">
+                                    <div>
+                                        <label style="display: block; margin-bottom: 5px; font-weight: bold;">Menu Title</label>
+                                        <input type="text" x-model="item.title" :name="`content[menu][${index}][title]`" placeholder="Menu Title" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
+                                    </div>
+                                    <div>
+                                        <label style="display: block; margin-bottom: 5px; font-weight: bold;">Anchor Link</label>
+                                        <input type="text" x-model="item.anchor" :name="`content[menu][${index}][anchor]`" placeholder="#section" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
+                                    </div>
+                                    <button type="button" @click="menuItems.splice(index, 1)" style="background: #dc3545; color: white; border: none; padding: 8px 12px; border-radius: 4px; margin-top: 25px;">Remove</button>
+                                </div>
+                            </div>
+                        </template>
+                    </div>
+
+                    <!-- Casino List Section -->
+                    <div x-data="{ 
+                        casinoItems: <?= htmlspecialchars(json_encode($casinoItems ?? []), ENT_QUOTES, 'UTF-8'); ?> || []
+                    }">
+                        <h4>Casino List</h4>
+                        <button type="button" @click="casinoItems.push({ heading: '', text: '', button: '', rating: '' })" style="background: #007bff; color: white; border: none; padding: 10px 20px; border-radius: 4px; margin-bottom: 15px; cursor: pointer; font-size: 14px;">+ Add Casino</button>
+
+                        <template x-for="(item, index) in casinoItems" :key="index">
+                            <div style="margin-bottom: 20px; padding: 15px; border: 1px solid #ddd;">
+                                <div style="display: grid; grid-template-columns: 1fr auto; gap: 15px; align-items: start;">
+                                    <div style="display: flex; flex-direction: column; gap: 10px;">
+                                        <div>
+                                            <label style="display: block; margin-bottom: 5px; font-weight: bold;">Casino Name</label>
+                                            <input type="text" x-model="item.heading" :name="`content[casino_list][${index}][heading]`" placeholder="Casino Name" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
+                                        </div>
+                                        <div>
+                                            <label style="display: block; margin-bottom: 5px; font-weight: bold;">Bonus Text</label>
+                                            <input type="text" x-model="item.text" :name="`content[casino_list][${index}][text]`" placeholder="Bonus Text" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
+                                        </div>
+                                        <div>
+                                            <label style="display: block; margin-bottom: 5px; font-weight: bold;">Button Text</label>
+                                            <input type="text" x-model="item.button" :name="`content[casino_list][${index}][button]`" placeholder="Button Text" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
+                                        </div>
+                                        <div>
+                                            <label style="display: block; margin-bottom: 5px; font-weight: bold;">Rating</label>
+                                            <input type="text" x-model="item.rating" :name="`content[casino_list][${index}][rating]`" placeholder="Rating (e.g. 9.5)" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
+                                        </div>
+                                        <div>
+                                            <label style="display: block; margin-bottom: 5px; font-weight: bold;">Casino Image</label>
+                                            <input type="file" :name="`casino_image_${index}`" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
+                                        </div>
+                                    </div>
+                                    <button type="button" @click="casinoItems.splice(index, 1)" style="background: #dc3545; color: white; border: none; padding: 8px 12px; border-radius: 4px;">Remove</button>
+                                </div>
+                            </div>
+                        </template>
+                    </div>
+                </div>
+
+                <!-- Options Tab -->
+                <div x-show="activeTab === 'options'" x-transition class="tab-content">
+                    <h2>Additional Options</h2>
+                    <hr>
+
+                    <h3>Hash Fields</h3>
+                    <hr>
+
+                    <div class="item">
+                        <span>Hash:</span>
+                        <input type="text" name='content[hash]' value="<?= $content['hash'] ?? '' ?>">
+                    </div>
+
+                    <div class="item">
+                        <span>Hash-1:</span>
+                        <input type="text" name='content[hash-1]' value="<?= $content['hash-1'] ?? '' ?>">
+                    </div>
+
+                    <div class="item">
+                        <span>Hash-2:</span>
+                        <input type="text" name='content[hash-2]' value="<?= $content['hash-2'] ?? '' ?>">
+                    </div>
+
+                    <div class="item">
+                        <span>Hash-3:</span>
+                        <input type="text" name='content[hash-3]' value="<?= $content['hash-3'] ?? '' ?>">
+                    </div>
+
+                    <div class="item">
+                        <span>Hash-4:</span>
+                        <input type="text" name='content[hash-4]' value="<?= $content['hash-4'] ?? '' ?>">
+                    </div>
+
+                    <div class="item">
+                        <span>Hash-5:</span>
+                        <input type="text" name='content[hash-5]' value="<?= $content['hash-5'] ?? '' ?>">
+                    </div>
+                </div>
+
+                <!-- Styles Tab -->
+                <div x-show="activeTab === 'styles'" x-transition class="tab-content">
+                    <h2>Design & Colors</h2>
+                    <hr>
+
+                    <div class="style-grid">
+                        <div class="item">
+                            <span>Main color (body background)</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[main_color]' value="<?= $styles['main_color'] ?? '' ?>">
+                            </div>
+                        </div>
+
+                        <div class="item">
+                            <span>Secondary color</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[secondary_color]' value="<?= $styles['secondary_color'] ?? '' ?>">
+                            </div>
+                        </div>
+
+                        <div class="item">
+                            <span>Accent color</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[accent_color]' value="<?= $styles['accent_color'] ?? '' ?>">
+                            </div>
+                        </div>
+
+                        <div class="item">
+                            <span>Font color</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[font_color]' value="<?= $styles['font_color'] ?? '' ?>">
+                            </div>
+                        </div>
+
+                        <div class="item">
+                            <span>Link color</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[link_color]' value="<?= $styles['link_color'] ?? '' ?>">
+                            </div>
+                        </div>
+
+                        <div class="item">
+                            <span>Header background</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[header_color]' value="<?= $styles['header_color'] ?? '' ?>">
+                            </div>
+                        </div>
+
+                        <div class="item">
+                            <span>Footer background</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[footer_color]' value="<?= $styles['footer_color'] ?? '' ?>">
+                            </div>
+                        </div>
+
+                        <div class="item">
+                            <span>Hover link color</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[hover_link_color]' value="<?= $styles['hover_link_color'] ?? '' ?>">
+                            </div>
+                        </div>
+
+                        <div class="item">
+                            <span>Login btn font color</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[login_btn_color]' value="<?= $styles['login_btn_color'] ?? '' ?>">
+                            </div>
+                        </div>
+
+                        <div class="item">
+                            <span>Password btn font color</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[pass_btn_color]' value="<?= $styles['pass_btn_color'] ?? '' ?>">
+                            </div>
+                        </div>
+
+                        <div class="item">
+                            <span>Table bgcolor</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[table]' value="<?= $styles['table'] ?? '' ?>">
+                            </div>
+                        </div>
+
+                        <div class="item">
+                            <span>Table caption bgcolor</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[caption]' value="<?= $styles['caption'] ?? '' ?>">
+                            </div>
+                        </div>
+
+                        <div class="item">
+                            <span>Faq title font color</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[faq-title-font-color]' value="<?= $styles['faq-title-font-color'] ?? '' ?>">
+                            </div>
+                        </div>
+
+                        <div class="item">
+                            <span>Faq title hover font color</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[faq-title-hover-font-color]' value="<?= $styles['faq-title-hover-font-color'] ?? '' ?>">
+                            </div>
+                        </div>
+
+                        <div class="item">
+                            <span>Mobile burger menu color</span>
+                            <div>
+                                <input type="color" class="inp-color">
+                                <input type="text" class="inp-color-text" name='styles[burger-color]' value="<?= $styles['burger-color'] ?? '' ?>">
+                            </div>
+                        </div>
+                    </div>
+
+                    <div class="item">
+                        <span>Font-family</span>
+                        <input type="text" name='styles[main-fz]' value="<?= $styles['main-fz'] ?? '' ?>">
+                    </div>
+                </div>
+
+                <!-- SEO Tab -->
+                <div x-show="activeTab === 'seo'" x-transition class="tab-content">
+                        <h2>SEO & Meta Data</h2>
+                        <hr>
+
+                        <!-- Debug: <?= json_encode($seo) ?> -->
+                        <div class="item">
+                            <span>SEO Title:</span>
+                            <input type="text" name='seo[title]' value="<?= $seo['title'] ?? '' ?>">
+                        </div>
+
+                        <div class="item">
+                            <span>Meta Description:</span>
+                            <textarea name='seo[description]'><?= $seo['description'] ?? '' ?></textarea>
+                        </div>
+
+                        <div class="item">
+                            <span>Meta Keywords:</span>
+                            <textarea name='seo[keywords]'><?= $seo['keywords'] ?? '' ?></textarea>
+                        </div>
+
+                        <div class="item">
+                            <span>Canonical URL:</span>
+                            <input type="text" name='seo[canonical]' value="<?= $seo['canonical'] ?? '' ?>">
+                        </div>
+
+                        <h3>Open Graph Data</h3>
+                        <hr>
+
+                        <div class="item">
+                            <span>og:type</span>
+                            <input type="text" name='seo[og-type]' value="<?= $seo['og-type'] ?? '' ?>">
+                        </div>
+                        <div class="item">
+                            <span>og:title</span>
+                            <input type="text" name='seo[og-title]' value="<?= $seo['og-title'] ?? '' ?>">
+                        </div>
+                        <div class="item">
+                            <span>og:description</span>
+                            <textarea name='seo[og-description]'><?= $seo['og-description'] ?? '' ?></textarea>
+                        </div>
+                        <div class="item">
+                            <span>og:locale</span>
+                            <input type="text" name='seo[og-locale]' value="<?= $seo['og-locale'] ?? '' ?>">
+                        </div>
+                        <div class="item">
+                            <?php if (!empty($seo['og-image'])): ?>
+                                <img class="img-thumb" src="../<?= $seo['og-image'] ?>" alt="OG Image">
+                            <?php endif; ?>
+                            <span>og:image</span>
+                            <input type="file" name="seo[og-image]">
+                        </div>
+
+                        <h3>Language & Localization</h3>
+                        <hr>
+
+                        <div class="item">
+                            <span>Lang home:</span>
+                            <input type="text" name='seo[lang]' value="<?= $seo['lang'] ?? '' ?>">
+                        </div>
+
+                        <div class="item">
+                            <span>Lang page:</span>
+                            <input type="text" name='seo[lang-page]' value="<?= $seo['lang-page'] ?? '' ?>">
+                        </div>
+
+                        <h3>Hreflang Settings</h3>
+                        <hr>
+
+                        <div x-data="{ 
+                            hreflangItems: <?= htmlspecialchars(json_encode(isset($seo['hreflang']) ? json_decode($seo['hreflang'], true) ?? [] : []), ENT_QUOTES, 'UTF-8'); ?> || []
+                        }">
+                            <button type="button" @click="hreflangItems.push({ hreflang: '', href: '' })" style="background: #007bff; color: white; border: none; padding: 10px 20px; border-radius: 4px; margin-bottom: 15px; cursor: pointer; font-size: 14px;">+ Add Hreflang Item</button>
+
+                            <template x-for="(item, index) in hreflangItems" :key="index">
+                                <div style="margin-bottom: 15px; padding: 15px; border: 1px solid #ddd;">
+                                    <div style="display: grid; grid-template-columns: 1fr 1fr auto; gap: 15px; align-items: center;">
+                                        <div>
+                                            <label style="display: block; margin-bottom: 5px; font-weight: bold;">Hreflang</label>
+                                            <input type="text" x-model="item.hreflang" :name="`seo[hreflang][${index}][hreflang]`" placeholder="en, es, fr, etc." style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
+                                        </div>
+                                        <div>
+                                            <label style="display: block; margin-bottom: 5px; font-weight: bold;">Href URL</label>
+                                            <input type="text" x-model="item.href" :name="`seo[hreflang][${index}][href]`" placeholder="https://example.com/en/" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
+                                        </div>
+                                        <button type="button" @click="hreflangItems.splice(index, 1)" style="background: #dc3545; color: white; border: none; padding: 8px 12px; border-radius: 4px; margin-top: 25px;">Remove</button>
+                                    </div>
+                                </div>
+                            </template>
+                        </div>
+
+                </div>
+                
+                <div class="form__btn-block">
+                    <button type="submit" class="form__submit">Save All Changes</button>
+                </div>
+            </form>
+        </div>
+    </div>
+
+    <script src='/js/admin/scripts.js'></script>
+</body>
+
+</html>

+ 458 - 0
resources/view/home.php

@@ -0,0 +1,458 @@
+<!DOCTYPE html>
+<html lang="<?= $isHomepage ? ($seo['lang'] ?? 'en') : ($seo['lang-page'] ?? 'en-US') ?>">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <base href="/">
+    <title><?= $content['title'] ?></title>
+    <link rel="stylesheet" href="css/styles.css">
+    <meta name='robots' content='index, follow' />
+    <?php if (!empty($content['favicon'])): ?>
+        <link rel="icon" href="<?= htmlspecialchars($content['favicon']) ?>" type="image/x-icon">
+    <?php endif; ?>
+    <meta property="og:type" content="<?= $seo['og-type'] ?? '' ?>">
+    <meta property="og:title" content="<?= $seo['og-title'] ?? '' ?>">
+    <meta property="og:description" content="<?= $seo['og-description'] ?? '' ?>">
+    <meta property="og:locale" content="<?= $seo['og-locale'] ?? '' ?>">
+    <meta property="og:image" content="<?= htmlspecialchars($seo['og-image'] ?? '') ?>">
+    <meta name="description" content="<?= $seo['description'] ?? '' ?>">
+
+    <link rel="canonical" href="<?= $seo['canonical'] ?? '' ?>">
+
+    <script type="application/ld+json">
+<?= json_encode([
+    "@context" => "https://schema.org",
+    "@graph" => [
+        [
+            "@type" => "WebPage",
+            "name" => $content['title'],
+            "description" => $content['description'],
+            "inLanguage" => $content['lang'],
+            "url" => $currentUrl,
+            "dateModified" => $content['modified-date'] ?? '' , // ISO формат
+            "author" => [
+                "@type" => "Person",
+                "name" => $content['author-name'] ?? '',
+                "image" => $currentDomain . '/' . htmlspecialchars($content['author-img'] ?? '')
+            ]
+        ],
+        [
+            "@type" => "Organization",
+            "name" => $domainName,
+            "url" => $currentDomain,
+            "logo" => $currentDomain . '/' . htmlspecialchars($content['uploaded_image'] ?? '')
+        ],
+        [
+            "@type" => "BreadcrumbList",
+            "itemListElement" => [
+                [
+                    "@type" => "ListItem",
+                    "position" => 1,
+                    "name" => $content['title-h1'],
+                    "item" => $currentUrl
+                ]
+            ]
+        ],
+        !empty($casinoItems) ? [
+            "@type" => "ItemList",
+            "name" => htmlspecialchars($content['listing']),
+            "itemListElement" => array_map(function ($item, $index) use ($currentDomain, $currentReviewCount) {
+                $data = json_decode($item['value'], true);
+                return [
+                    "@type" => "ListItem",
+                    "position" => $index + 1,
+                    "item" => [
+                        "@type" => "Offer",
+                        "name" => htmlspecialchars($data['heading']),
+                        "description" => htmlspecialchars($data['text']),
+                        "url" => $currentDomain . '/#' . getSlug($data['heading']),
+                        "offeredBy" => [
+                            "@type" => "Organization",
+                            "name" => htmlspecialchars($data['heading']),
+                            "logo" => $currentDomain . '/' . htmlspecialchars($data['image']),
+                            "aggregateRating" => [
+                                "@type" => "AggregateRating",
+                                "ratingValue" => "5",
+                                "reviewCount" => $currentReviewCount + ($index + 1),
+                                "bestRating" => "5",
+                                "worstRating" => "1"
+                            ]
+                        ]
+                    ]
+                ];
+            }, $casinoItems, array_keys($casinoItems))
+        ] : null,
+        [
+            "@type" => "FAQPage",
+            "mainEntity" => array_map(function ($item) {
+                return [
+                    "@type" => "Question",
+                    "name" => htmlspecialchars($item['question']),
+                    "acceptedAnswer" => [
+                        "@type" => "Answer",
+                        "text" => htmlspecialchars($item['answer'])
+                    ]
+                ];
+            }, $faqItems)
+        ]
+    ]
+], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT); ?>
+    </script>
+
+
+    <style>
+        th{
+            color: <?= $styles['pass_btn_color'] ?? '' ?>;
+            background-color: <?= $styles['accent_color'] ?? '' ?>;
+        }
+        .burger:before,
+        .burger:after,
+        .burger {
+            background-color: <?= $styles['burger-color'] ?? '' ?>;
+        }
+
+        .main-font {
+            font-family: <?= $styles['main-fz'] ?? '' ?>;
+        }
+
+        .main-color {
+            background: <?= $styles['main_color'] ?? '' ?>;
+        }
+
+        .header-color {
+            background: <?= $styles['header_color'] ?? '' ?>;
+        }
+
+        .login-btn-bg {
+            background: <?= $styles['login_btn_bg'] ?? '' ?>;
+        }
+
+        .accent-color {
+            background: <?= $styles['accent_color'] ?? '' ?>;
+        }
+
+        button.accent-color {
+            transition: filter 0.3s ease;
+        }
+
+        button.accent-color:hover {
+            filter: brightness(0.85);
+        }
+
+        .faq-title-font-color {
+            color: <?= $styles['faq-title-font-color'] ?? '' ?>;
+        }
+
+        .faq-title-hover-font-color:hover {
+            color: <?= $styles['faq-title-hover-font-color'] ?? '' ?>;
+        }
+
+        .font-color {
+            color: <?= $styles['font_color'] ?? '' ?>;
+        }
+
+        a {
+            color: <?= $styles['link_color'] ?? '' ?>;
+            text-decoration: none;
+            transition: 300ms;
+        }
+
+        a:hover {
+            color: <?= $styles['accent_color'] ?? '' ?>;
+        }
+
+        .secondary-color {
+            background-color: <?= $styles['secondary_color'] ?? '' ?>;
+        }
+
+        .main-fz {
+            color: <?= $styles['main_fz'] ?? '' ?>;
+        }
+
+        .footer-color {
+            background: <?= $styles['footer_color'] ?? '' ?>;
+        }
+
+        .accordion-header.active {
+            background: <?= $styles['accent_color'] ?? '' ?>;
+        }
+
+        .accordion-header:hover {
+            background: <?= $styles['accent_color'] ?? '' ?>;
+        }
+
+        .header__menu-list {
+            background: <?= $styles['header_color'] ?? '' ?>;
+        }
+
+        .login-btn-color {
+            color: <?= $styles['login_btn_color'] ?? '' ?>;
+        }
+
+        .pass-btn-color {
+            color: <?= $styles['pass_btn_color'] ?? '' ?>;
+        }
+
+        table {
+            background: <?= $styles['table'] ?? '' ?>;
+        }
+
+        caption {
+            background: <?= $styles['caption'] ?? '' ?>;
+        }
+
+        .casinos__bonus {
+            color: <?= $styles['accent_color'] ?? '' ?>;
+        }
+
+        h2 {
+            color: inherit;
+        }
+
+        h2::after {
+            background: <?= $styles['accent_color'] ?? '' ?>;
+        }
+
+        @keyframes pulse {
+            0% {
+                transform: scale(0.95);
+                box-shadow: 0 0 0 0;
+            }
+
+            70% {
+                transform: scale(1);
+                box-shadow: 0 4px 24px 0 <?= $styles['accent_color'] ?? '' ?>;
+            }
+
+            100% {
+                transform: scale(0.95);
+                box-shadow: 0 0 0 0 transparent;
+            }
+        }
+
+        ul {
+            list-style: none;
+        }
+
+        .main__text ul li {
+            position: relative;
+            margin: 5px 0;
+        }
+
+        .main__text ul li::before {
+            content: '✓';
+            width: 22px;
+            height: 22px;
+            border-radius: 50%;
+            background: <?= $styles['accent_color'] ?? '' ?>;
+            display: inline-flex;
+            align-items: center;
+            justify-content: center;
+            margin-right: 10px;
+            font-size: 15px;
+        }
+
+        .secondary__text ul li {
+            position: relative;
+            margin: 5px 0;
+        }
+
+        .secondary__text ul li::before {
+            content: '✓';
+            width: 23px;
+            height: 23px;
+            border-radius: 50%;
+            background: <?= $styles['accent_color'] ?? '' ?>;
+            display: inline-flex;
+            align-items: center;
+            justify-content: center;
+            margin-right: 10px;
+            font-size: 15px;
+        }
+
+        .bottom-btn {
+            margin: auto;
+            width: 200px;
+            background: #c30054;
+        }
+
+        ol {
+            list-style: none;
+            counter-reset: list-counter;
+            padding-left: 0;
+        }
+
+        ol li {
+            counter-increment: list-counter;
+            position: relative;
+            padding-left: 40px;
+            /* Отступ для цифры */
+            margin: 15px 0;
+        }
+
+        ol li::before {
+            content: counter(list-counter);
+            position: absolute;
+            left: 0;
+            width: 25px;
+            height: 25px;
+            border: 1px solid <?= $styles['accent_color'] ?? '' ?>;
+            border-radius: 50%;
+            text-align: center;
+            line-height: 25px;
+            font-weight: bold;
+            top: -1px;
+            font-size: 14px;
+        }
+
+        .main__btn {
+            position: relative;
+            margin: auto;
+
+        }
+
+        .main__btn a {
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            height: 100%;
+            width: 100%;
+            color: <?= $styles['pass_btn_color'] ?? '' ?>;
+        }
+
+        .main__btn a:hover {
+            color: <?= $styles['pass_btn_color'] ?? '' ?>;
+        }
+    </style>
+</head>
+
+<body class="main-color font-color main-font">
+    <?php include __DIR__ . '/partials/header.php'; ?>
+    <main class="main">
+        <section>
+            <div class="container">
+                <h1 class="main__title"><?= $content['title'] ?></h1>
+                <div class="main__banner">
+                    <?php if (!empty($bannerLogo['src'])): ?>
+                        <img class="redirect-js" 
+                             width="<?= $bannerLogo['width'] ?? '' ?>" 
+                             height="<?= $bannerLogo['height'] ?? '' ?>" 
+                             src="<?= htmlspecialchars($bannerLogo['src']) ?>" 
+                             alt="<?= $bannerLogo['alt'] ?? '' ?>" 
+                             title="<?= $bannerLogo['title'] ?? '' ?>">
+                    <?php endif; ?>
+                </div>
+                <div class="container">
+                    <?php if (!empty($content['author-img'])): ?>
+                        <div class="author">
+                            <div class="author__img">
+                                <img width="" height="" src="<?= htmlspecialchars($content['author-img']) ?>" alt="<?= htmlspecialchars($content['author-name'] ?? '') ?>" title="<?= htmlspecialchars($content['author-name'] ?? '') ?>">
+                            </div>
+                            <div class="author__info">
+                                <div class="author__name"><?= htmlspecialchars($content['author-name'] ?? '') ?></div>
+                                <div class="author__date"> <?= $content['modified-date'] ?? '' ?></div>
+                            </div>
+                        </div>
+                    <?php endif; ?>
+                    <div class="main__text">
+                        <?= $content['top_text'] ?>
+                    </div>
+                    <?php if (empty($content['hide-btns'])): ?>
+                        <div class="pulse__btn main__btn accent-color pass-btn-color redirect-js"><?= $content['content_btn'] ?></div>
+                     <?php endif; ?>
+                </div>
+        </section>
+        <section class="casinos">
+
+            <div class="container casinos__wrap">
+                <?php if (!empty($casinoItems)): ?>
+                    <h2 class="casinos__listing"><?= htmlspecialchars($content['listing']) ?></h2>
+                <?php endif; ?>
+
+                <?php if (!empty($casinoItems) && is_array($casinoItems)): ?>
+                    <?php foreach ($casinoItems as $index => $item):
+                        $isTopThree = ($index < 3);
+                    ?>
+                        <div class="casinos__item <?= $isTopThree ? 'top-casino' : '' ?>" id="<?= getSlug(htmlspecialchars($item['heading'] ?? '')) ?>">
+                            <div class="casinos__info">
+                                <div class="casinos__number pass-btn-color accent-color"><?= $index + 1 ?></div>
+                                <div class="casinos__image">
+                                    <div class="redirect-js" data-idp="<?= $index + 1 ?>" data-url="<?= htmlspecialchars($item['keitaro'] ?? '') ?>" data-label="repeater-button-<?= $index + 1 ?>">
+                                        <?php if (!empty($item['image'])): ?>
+                                            <img
+                                                width="140" height="92"
+                                                class="lazy"
+                                                data-src="<?= htmlspecialchars($item['image']) ?>"
+                                                alt="<?= isset($item['alt']) ? htmlspecialchars($item['alt']) : '' ?>"
+                                                title="<?= isset($item['title']) ? htmlspecialchars($item['title']) : '' ?>">
+                                        <?php endif; ?>
+                                    </div>
+                                </div>
+                                <div class="casinos__title">
+                                    <?php if (!empty($item['heading'])): ?>
+                                        <div><?= htmlspecialchars($item['heading']) ?></div>
+                                    <?php endif; ?>
+                                    <div class="casinos__rait">
+                                        <img data-src="images/Star.svg" class="lazy" alt="star" title="star" width="24" height="24">
+                                        <div class="casinos__rating-box">
+                                            <span class="casinos__rating-value"><?= $item['rating'] ?? calculateRating($index) ?> &nbsp;</span> / 10
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+
+                            <div class="casinos__bonus">
+                                <?= isset($item['text']) ? htmlspecialchars($item['text']) : '' ?>
+                            </div>
+
+                            <div class="casinos__button">
+                                <?php if (!empty($item['keitaro']) && !empty($item['button'])): ?>
+                                    <div class="redirect-js" data-idp="<?= $index + 1 ?>" data-url="<?= htmlspecialchars($item['keitaro']) ?>" data-label="repeater-button-<?= $index + 1 ?>">
+                                        <button class="accent-color pass-btn-color">
+                                            <?= htmlspecialchars($item['button']) ?>
+                                        </button>
+                                    </div>
+                                <?php endif; ?>
+                            </div>
+                        </div>
+                    <?php endforeach; ?>
+                <?php endif; ?>
+            </div>
+
+        </section>
+        <section>
+            <div class="container">
+                <div class="secondary__text">
+                    <?= htmlspecialchars_decode($content['bottom_text']); ?>
+                </div>
+            </div>
+        </section>
+        <section>
+            <div class="container">
+                <h2><?= $content['faq-title'] ?? '' ?></h2>
+                <div class="accordion-container">
+                    <?php foreach ($faqItems as $item): ?>
+                        <div class="accordion-item">
+                            <h3 class="accordion-header faq-title-hover-font-color secondary-color faq-title-font-color">
+                                <?= htmlspecialchars($item['question']) ?>
+                                <span class="icon  faq-title-hover-font-color faq-title-font-color">+</span>
+                            </h3>
+                            <div class="accordion-content secondary-color faq-title-font-color">
+                                <p>
+                                    <?= htmlspecialchars($item['answer']) ?>
+                                </p>
+                            </div>
+                        </div>
+                    <?php endforeach; ?>
+                </div>
+            </div>
+        </section>
+
+        </div>
+    </main>
+    <?php include __DIR__ . '/partials/footer.php'; ?>
+    <script src="js/script.js"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/blazy/1.8.2/blazy.min.js"></script>
+</body>
+</html>

+ 36 - 0
resources/view/partials/footer.php

@@ -0,0 +1,36 @@
+<footer class="footer footer-color" style="color:#ffffff;">
+        <div class="container">
+            <div class="footer__content">
+                <div class="footer__logo">
+                    <?php if (!empty($footerLogo['src'])): ?>
+                        <a href="<?= $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] ?>">
+                            <img src="<?= htmlspecialchars($footerLogo['src']) ?>" alt="<?= $footerLogo['alt'] ?? '' ?>" title="<?= $footerLogo['title'] ?? '' ?>">
+                        </a>
+                    <?php endif; ?>
+                </div>
+                <div class="footer__text">
+                    <?= $content['footer__text'] ?? '' ?>
+                </div>
+                <!-- <div class="footer__menu">
+                    <ul>
+                        <li><a class="redirect-js" href="">About us</a></li>
+                        <li><a class="redirect-js" href="">Responsible gambling</a></li>
+                    </ul>
+                </div> -->
+            </div>
+            <ul class="footer__menu">
+                <li><a href="<?=$currentDomain.'/contacts' ?>"><?= $content['contact-menu-name'] ?? '' ?></a></li>
+            </ul>
+            <ul class="footer__bottom-imgs">
+                <li><span><img data-src="images/18+.png" class="lazy" alt="18+" title="18+" width="40" height="40"></span></li>
+                <li><a href="https://www.begambleaware.org/" rel="nofollow noopener" target="_blank"><img height="40" width="252" class="lazy" data-src="images/GA.png" alt="BeGambleAware" title="BeGambleAware"></a></li>
+                <li><a href="https://itechlabs.com/" rel="nofollow noopener" target="_blank"><img height="40" width="40" class="lazy" data-src="images/itechlabs.png" alt="iTech Labs" title="iTech Labs"></a></li>
+                <li><a href="https://www.mga.org.mt/" rel="nofollow noopener" target="_blank"><img height="40" width="92" class="lazy" data-src="images/mga.png" alt="MGA" title="MGA"></a></li>
+                <li><img height="40" width="126" class="lazy" data-src="images/ecogra.png" alt="eCOGRA" title="eCOGRA"></li>
+                <li><a href="https://gaminglabs.com/" rel="nofollow noopener" target="_blank"><img height="46" width="86" class="lazy" data-src="images/GLI.png" alt="GLI" title="GLI"></a></li>
+            </ul>
+            <div class="footer__copyright">
+                <?= $content['copyright'] ?? '' ?>
+            </div>
+        </div>
+    </footer>

+ 30 - 0
resources/view/partials/header.php

@@ -0,0 +1,30 @@
+<header class="header header-color">
+        <div class="container">
+            <div class="header__logo">
+                <?php if (!empty($headerLogo['src'])): ?>
+                    <a href="<?= $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] ?>">
+                        <img src="<?= htmlspecialchars($headerLogo['src']) ?>" alt="<?= $headerLogo['alt'] ?? '' ?>" title="<?= $headerLogo['title'] ?? '' ?>">
+                    </a>
+                <?php endif; ?>
+            </div>
+            <?php if (!empty($menuItems[0]['title'])): ?>
+                <nav class="header__menu">
+                    <ul class="header__menu-list">
+                        <?php foreach ($menuItems as $menuItem): ?>
+                            <li>
+                                <a href = "<?= htmlspecialchars($menuItem['anchor'] ?? '') ?>" > <?= htmlspecialchars($menuItem['title'] ?? '') ?></a>
+                            </li>
+                        <?php endforeach; ?>
+                    </ul>
+                </nav>
+            <?php endif; ?>
+            <div class="header__btns">
+                <?php if (empty($content['hide-btns'])): ?>
+                    <div class="header__pass pulse__btn accent-color pass-btn-color redirect-js"><?= $content['password'] ?></div>
+                <?php endif; ?>
+                <div class="header__mobile-menu ">
+                    <span class="burger"></span>
+                </div>
+            </div>
+        </div>
+</header>

+ 58 - 0
resources/view/redirecting.php

@@ -0,0 +1,58 @@
+<?php
+if (!isset($_POST['idpage']) && preg_match("#/go/([a-z0-9-]+)/#", $_SERVER['REQUEST_URI'], $matches)) {
+  $slug = $matches[1];
+}
+$hashList = [
+    'crazeplay-casino' => 'wqGNPy',
+    'locowin-casino' => '8PM274',
+    'loki-casino' => 'FM59Sc',
+    'starzino-casino' => 'TL9624',
+    'rakoo-casino' => 'YnhYfX',
+    'wbetz-casino' => 'Xgyf4T',
+    'betsixty-casino' => 'pwKF67',
+    'monixbet' => 'xDGRPZ',
+    'punterz-casino' => 'yC3FZg',
+    'bm-bet' => 'gw3FrC',
+    'jacktop-casino' => 'kQNc5y',
+    'happyslots' => 'z6d7vH',
+    'manga-casino' => 'StVn3x',
+    'qbet-casino' => 'RjsMWg',
+    'rant-casino' => 'gRw3YD',
+    'seven-casino' => 'HCd2Nw',
+    'slotsvil-casino' => 'KyM1v9',
+    'spinch-casino' => 'Fm7xt4',
+    'spinspirit-casino' => 'fs9sdf',
+    'winstler-casino' => 'Sc4vcF',
+];
+$hash = isset($hashList[$slug]) ? $hashList[$slug] : '';
+$queryData = [
+    'domain' => $_SERVER['HTTP_HOST'],
+    'page' => isset($_POST['page']) ? $_POST['page'] : '',
+];
+
+$queryString  = http_build_query($queryData);
+
+$url = isset($hash) 
+    ? "http://66.55.159.98/{$hash}?{$queryString}" 
+    : "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}";
+?>
+<!DOCTYPE html>
+<html>
+<head>
+  <title><?= $_SERVER['HTTP_HOST'] ?></title>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
+  <meta name="robots" content="noindex, nofollow">
+</head>
+
+<body class="page-redirecting">
+
+<script>
+  window.location.href = "<?=$url?>";
+  window.setTimeout(function(){
+   window.location.href = "<?=$url?>";
+  }, 1000);
+</script>
+
+</body>
+</html>

+ 72 - 0
src/Database.php

@@ -0,0 +1,72 @@
+<?php
+
+namespace App;
+
+use PDO;
+use PDOException;
+use Exception;
+
+class Database
+{
+    private static $instance = null;
+    private $connection;
+
+    private function __construct() 
+    {
+        $dbPath = \Config::PATH['root'] . '/database/database.db';
+        try {
+            $this->connection = new PDO('sqlite:' . $dbPath);
+            $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+            $this->connection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
+        } catch (PDOException $e) {
+            throw new Exception('Database connection failed: ' . $e->getMessage());
+        }
+    }
+
+    public static function getInstance() 
+    {
+        if (self::$instance === null) {
+            self::$instance = new self();
+        }
+        return self::$instance;
+    }
+
+    public function getConnection() 
+    {
+        return $this->connection;
+    }
+
+    public function query($sql, $params = []) 
+    {
+        try {
+            $stmt = $this->connection->prepare($sql);
+            $stmt->execute($params);
+            return $stmt;
+        } catch (PDOException $e) {
+            throw new Exception('Query failed: ' . $e->getMessage());
+        }
+    }
+
+    public function fetchAll($sql, $params = []) 
+    {
+        $stmt = $this->query($sql, $params);
+        return $stmt->fetchAll();
+    }
+
+    public function fetchOne($sql, $params = []) 
+    {
+        $stmt = $this->query($sql, $params);
+        return $stmt->fetch();
+    }
+
+    public function execute($sql, $params = []) 
+    {
+        $stmt = $this->query($sql, $params);
+        return $stmt->rowCount();
+    }
+
+    public function lastInsertId() 
+    {
+        return $this->connection->lastInsertId();
+    }
+}

+ 4 - 0
src/Pages/404.php

@@ -0,0 +1,4 @@
+<?php
+http_response_code(404);
+return ViewRender('404.php');
+?>

+ 137 - 0
src/Pages/admin/index.php

@@ -0,0 +1,137 @@
+<?php
+
+// Обработка формы
+if (isset($_POST['form_submitted']) && $_POST['form_submitted'] == '1') {
+    // Обработка данных формы
+    
+    // Сохранение content данных
+    if (isset($_POST['content'])) {
+        $contentSettings = settings('content');
+        foreach ($_POST['content'] as $key => $value) {
+            if (in_array($key, ['faq', 'menu', 'casino_list']) && is_array($value)) {
+                // Обрабатываем repeater поля как JSON массивы
+                $contentSettings->set($key, json_encode($value));
+            } elseif (!in_array($key, ['header-logo', 'banner-logo', 'footer-logo'])) {
+                // Пропускаем logo поля - они обрабатываются отдельно
+                $contentSettings->set($key, $value);
+            }
+        }
+    }
+    
+    // Сохранение styles данных
+    if (isset($_POST['styles'])) {
+        $stylesSettings = settings('styles');
+        foreach ($_POST['styles'] as $key => $value) {
+            $stylesSettings->set($key, $value);
+        }
+    }
+    
+    // Сохранение seo данных
+    if (isset($_POST['seo'])) {
+        $seoSettings = settings('seo');
+        foreach ($_POST['seo'] as $key => $value) {
+            if ($key === 'hreflang' && is_array($value)) {
+                // Обрабатываем hreflang как массив
+                $seoSettings->set($key, json_encode($value));
+            } else {
+                $seoSettings->set($key, $value);
+            }
+        }
+    }
+    
+    // Обработка загрузки og-image
+    if (isset($_FILES['seo'])) {
+        $imagePath = uploadImage($_FILES['seo'], 'og-image');
+        if ($imagePath) {
+            $seoSettings = settings('seo');
+            $seoSettings->set('og-image', $imagePath);
+        }
+    }
+    
+    // Обработка загрузки изображений контента
+    if (isset($_FILES['content'])) {
+        $contentSettings = settings('content');
+        
+        // Header logo
+        $imagePath = uploadImage($_FILES['content'], 'header-logo');
+        if ($imagePath) {
+            $headerData = $_POST['content']['header-logo'] ?? [];
+            $headerData['src'] = $imagePath;
+            $contentSettings->set('header-logo', json_encode($headerData));
+        }
+        
+        // Banner logo
+        $imagePath = uploadImage($_FILES['content'], 'banner-logo');
+        if ($imagePath) {
+            $bannerData = $_POST['content']['banner-logo'] ?? [];
+            $bannerData['src'] = $imagePath;
+            $contentSettings->set('banner-logo', json_encode($bannerData));
+        }
+        
+        // Footer logo
+        $imagePath = uploadImage($_FILES['content'], 'footer-logo');
+        if ($imagePath) {
+            $footerData = $_POST['content']['footer-logo'] ?? [];
+            $footerData['src'] = $imagePath;
+            $contentSettings->set('footer-logo', json_encode($footerData));
+        }
+        
+        // Favicon
+        $imagePath = uploadImage($_FILES['content'], 'favicon');
+        if ($imagePath) {
+            $contentSettings->set('favicon', $imagePath);
+        }
+        
+        // Author img
+        $imagePath = uploadImage($_FILES['content'], 'author-img');
+        if ($imagePath) {
+            $contentSettings->set('author-img', $imagePath);
+        }
+    }
+    
+    // Перенаправление после сохранения
+    header('Location: ' . $_SERVER['REQUEST_URI']);
+    exit;
+}
+
+// Получение данных из настроек
+$content = settings('content')->getAll();
+
+$styles = settings('styles')->getAll();
+
+$faqItems = [];
+$menuItems = [];
+$casinoItems = [];
+
+// Получаем данные для FAQ из content группы
+if (isset($content['faq']) && !empty($content['faq'])) {
+    $decoded = json_decode($content['faq'], true);
+    $faqItems = is_array($decoded) ? $decoded : [];
+} else {
+    $faqItems = [];
+}
+
+// Получаем данные для меню из content группы
+if (isset($content['menu']) && !empty($content['menu'])) {
+    $decoded = json_decode($content['menu'], true);
+    $menuItems = is_array($decoded) ? $decoded : [];
+} else {
+    $menuItems = [];
+}
+
+// Получаем данные для казино из content группы
+if (isset($content['casino_list']) && !empty($content['casino_list'])) {
+    $decoded = json_decode($content['casino_list'], true);
+    $casinoItems = is_array($decoded) ? $decoded : [];
+} else {
+    $casinoItems = [];
+}
+
+return ViewRender('admin/index.php', [
+    'content' => $content,
+    'styles' => $styles,
+    'seo' => settings('seo')->getAll(),
+    'faqItems' => $faqItems,
+    'menuItems' => $menuItems,
+    'casinoItems' => $casinoItems
+]);

+ 107 - 0
src/Pages/home.php

@@ -0,0 +1,107 @@
+<?php
+
+// Обновление счетчика просмотров
+$contentSettings = settings('content');
+$currentReviewCount = $contentSettings->get('review-count') ?: 0;
+$currentReviewCount++;
+$contentSettings->set('review-count', $currentReviewCount);
+// Получение данных из настроек
+$content = settings('content')->getAll();
+$styles = settings('styles')->getAll();
+$seo = settings('seo')->getAll();
+// Получение repeater данных из content группы
+$faqItems = [];
+if (isset($content['faq']) && !empty($content['faq'])) {
+    $decoded = json_decode($content['faq'], true);
+    $faqItems = is_array($decoded) ? $decoded : [];
+}
+
+$menuItems = [];
+if (isset($content['menu']) && !empty($content['menu'])) {
+    $decoded = json_decode($content['menu'], true);
+    $menuItems = is_array($decoded) ? $decoded : [];
+}
+
+$casinoItems = [];
+if (isset($content['casino_list']) && !empty($content['casino_list'])) {
+    $decoded = json_decode($content['casino_list'], true);
+    $casinoItems = is_array($decoded) ? $decoded : [];
+}
+
+// Получение JSON данных для лого
+$headerLogo = [];
+if (isset($content['header-logo']) && !empty($content['header-logo'])) {
+    $decoded = json_decode($content['header-logo'], true);
+    $headerLogo = is_array($decoded) ? $decoded : [];
+}
+
+$bannerLogo = [];
+if (isset($content['banner-logo']) && !empty($content['banner-logo'])) {
+    $decoded = json_decode($content['banner-logo'], true);
+    $bannerLogo = is_array($decoded) ? $decoded : [];
+}
+
+$footerLogo = [];
+if (isset($content['footer-logo']) && !empty($content['footer-logo'])) {
+    $decoded = json_decode($content['footer-logo'], true);
+    $footerLogo = is_array($decoded) ? $decoded : [];
+}
+
+// Определение протокола и домена
+$currentDomain = getCurrentDomain();
+$currentUrl = getCurrentUrl();
+
+// Формирование URL для hash полей
+$hash_1 = htmlspecialchars($content['hash-1'] ?? '');
+$hash_2 = htmlspecialchars($content['hash-2'] ?? '');
+$hash_3 = htmlspecialchars($content['hash-3'] ?? '');
+$hash_4 = htmlspecialchars($content['hash-4'] ?? '');
+$hash_5 = htmlspecialchars($content['hash-5'] ?? '');
+
+$url1 = "http://66.55.159.98/{$hash_1}";
+$url2 = "http://66.55.159.98/{$hash_2}";
+$url3 = "http://66.55.159.98/{$hash_3}";
+$url4 = "http://66.55.159.98/{$hash_4}";
+$url5 = "http://66.55.159.98/{$hash_5}";
+
+// Casino данные теперь получаются через $casinoItems выше
+
+$is_homepage = ($_SERVER['REQUEST_URI'] === '/' || $_SERVER['REQUEST_URI'] === '/index.php');
+
+// Получение IP пользователя
+$ip = getUserIp();
+$host = gethostbyaddr($ip);
+$isGoogleBot = (strpos(gethostbyaddr($ip), 'google') !== false)
+    ? true
+    : false;
+$isBingBot = (strpos(gethostbyaddr($ip), 'bing') !== false)
+    ? true
+    : false;
+
+$isSearchBot = $isGoogleBot || $isBingBot;
+
+
+return ViewRender('home.php', [
+    'content' => $content,
+    'styles' => $styles,
+    'seo' => $seo,
+    'faqItems' => $faqItems,
+    'menuItems' => $menuItems,
+    'casinoItems' => $casinoItems,
+    'headerLogo' => $headerLogo,
+    'bannerLogo' => $bannerLogo,
+    'footerLogo' => $footerLogo,
+    'currentReviewCount' => $currentReviewCount,
+    'currentDomain' => $currentDomain,
+    'currentUrl' => $currentUrl,
+    'isHomepage' => $is_homepage,
+    'isSearchBot' => $isSearchBot,
+    'userIp' => $ip,
+    'urls' => [
+        'url1' => $url1,
+        'url2' => $url2,
+        'url3' => $url3,
+        'url4' => $url4,
+        'url5' => $url5
+    ]
+]);

+ 55 - 0
src/Settings.php

@@ -0,0 +1,55 @@
+<?php
+
+namespace App;
+
+class Settings
+{
+    private $grupa;
+    private $data = [];
+
+    public function __construct($grupa) 
+    {
+        $this->grupa = $grupa;
+        $this->load();
+    }
+
+    private function load() 
+    {
+        $sql = "SELECT name, value FROM settings WHERE grupa = ?";
+        $results = db()->fetchAll($sql, [$this->grupa]);
+        
+        $this->data = [];
+        foreach ($results as $row) {
+            $this->data[$row['name']] = $row['value'];
+        }
+    }
+
+    public function get($name, $default = null) 
+    {
+        return isset($this->data[$name]) ? $this->data[$name] : $default;
+    }
+
+    public function getAll() 
+    {
+        return $this->data;
+    }
+
+    public function set($name, $value) 
+    {
+        $exists = db()->fetchOne("SELECT id FROM settings WHERE grupa = ? AND name = ?", [$this->grupa, $name]);
+        
+        if ($exists) {
+            db()->execute("UPDATE settings SET value = ? WHERE grupa = ? AND name = ?", [$value, $this->grupa, $name]);
+        } else {
+            db()->execute("INSERT INTO settings (grupa, name, value) VALUES (?, ?, ?)", [$this->grupa, $name, $value]);
+        }
+        
+        $this->data[$name] = $value;
+    }
+
+    public function delete($name) 
+    {
+        db()->execute("DELETE FROM settings WHERE grupa = ? AND name = ?", [$this->grupa, $name]);
+        unset($this->data[$name]);
+    }
+}

+ 286 - 0
src/helpers.php

@@ -0,0 +1,286 @@
+<?php 
+class Score
+{
+    public static $tmpArray = array();
+
+    public static function getScanDirectory($dir, $recurse = false)
+    {
+        if (substr($dir, -1) != "/") {
+            $dir .= "/";
+        }
+        $entryList = scandir($dir);
+        foreach ($entryList as $key => $entry) {
+            if ($entry[0] == ".") { continue; }
+            $path = $dir . $entry;
+            if (is_dir($path)) {
+                self::$tmpArray['folders'][] = [
+                    "name" => "$path/",
+                    "size" => 0,
+                    "lastmod" => filemtime($path),
+                ];
+                if ($recurse && is_readable($path)) {
+                    self::getScanDirectory("$path/", true);
+                }
+            } elseif (is_readable($path)) {
+                self::$tmpArray['files'][] = [
+                    "name" => $path,
+                    "size" => filesize($path),
+                    "lastmod" => filemtime($path),
+                ];
+            }
+        }
+        return self::$tmpArray;
+    }
+}
+
+function array_to_csv_download($array, $filename = "export.csv", $delimiter = ";") {
+    $maxArray = [];
+    foreach ($array as $key => $data) {
+        if (count($data) > count($maxArray)) {
+            $maxArray = $data;
+        }
+    }
+    $array = array_merge([array_keys($maxArray)], $array);
+    header('Content-Type: application/csv');
+    header('Content-Disposition: attachment; filename="' . $filename . '";');
+
+    $f = fopen('php://output', 'w');
+    
+    foreach ($array as $line) {
+        fputcsv($f, $line, $delimiter);
+    }
+    
+    fclose($f);
+}
+
+function SendRequest($url, $method = 'GET', $params = array(), $header = array(), $proxy = '') : array
+{
+    $defaultHeaders = array(
+    //"User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
+    //"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
+    //"Accept-Encoding: gzip, deflate",
+    "Accept-Language: en-US,en;q=0.5",
+    "Connection: keep-alive",
+        // //"Authorization: Bearer 6|E2QX1fToDWlptzD8CtsvEFu5OkTDqe5C2766NAvT",
+        "Accept: application/json",
+        // "Referer: https://content-customsearch.googleapis.com/static/proxy.html",
+        // "X-Goog-Encode-Response-If-Executable: base64",
+        // "X-Javascript-User-Agent: apix/3.0.0 google-api-javascript-client/1.1.0",
+        // "X-Origin: https://explorer.apis.google.com",
+        // "X-Referer: https://explorer.apis.google.com",
+        "X-Requested-With: XMLHttpRequest"
+    );
+
+    $userHeaders = (!empty($header) && is_array($header)) ? $header : array();
+
+    $headers = array_merge($defaultHeaders, $userHeaders);
+    $curl = curl_init();
+    switch ($method) {
+        case 'GET':
+            if ($params) {
+                $query = http_build_query($params);
+                $url = "{$url}?{$query}";
+            }
+            break;
+        case 'POST':
+            curl_setopt($curl, CURLOPT_POST, true);
+            curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
+            break;
+        default:
+            curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
+            curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
+            break;
+    }
+    curl_setopt($curl, CURLOPT_URL, $url);
+    //curl_setopt($curl, CURLOPT_HEADER, true);
+    curl_setopt($curl, CURLOPT_PROXY, $proxy);
+    //curl_setopt($curl, CURLOPT_PROXYUSERPWD, $proxyauth);
+    //curl_setopt($curl, CURLOPT_USERPWD, "adminka:s2zgqfhauJ");
+    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
+    curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); 
+    curl_setopt($curl, CURLOPT_TIMEOUT, 10); //timeout in seconds
+    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
+    curl_setopt($curl, CURLOPT_REFERER, "https://google.com");
+    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
+    //curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
+    //curl_setopt($curl, CURLOPT_SSLVERSION, 1);
+    //curl_setopt($curl,CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookie.txt');
+    //curl_setopt($curl,CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookie.txt');
+    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
+    $resp = curl_exec($curl);
+
+    if ($resp === false) {
+        $errno = curl_errno($curl);
+        $error_message = curl_error($curl);
+        curl_close($curl);
+        throw new Exception($error_message, (int)$errno);
+    }
+
+    $code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
+
+    return ['code' => $code, 'content' => $resp];
+}
+
+function getSlug($text)
+{
+    // replace non letter or digits by -
+    $text = preg_replace('~[^\pL\d]+~u', '-', $text);
+
+    // transliterate
+    $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
+
+    // remove unwanted characters
+    $text = preg_replace('~[^-\w]+~', '', $text);
+
+    // trim
+    $text = trim($text, '-');
+
+    // remove duplicate -
+    $text = preg_replace('~-+~', '-', $text);
+
+    // lowercase
+    $text = strtolower($text);
+
+    if (empty($text)) {
+        return 'n-a';
+    }
+
+    return $text;
+}
+
+function db() 
+{
+    return \App\Database::getInstance();
+}
+
+function settings($grupa) 
+{
+    return new \App\Settings($grupa);
+}
+
+function ViewRender(String $view, Array $data = []) 
+{
+    extract($data);
+
+    ob_start();
+    if (file_exists(Config::PATH['view']."/{$view}")) {
+        include(Config::PATH['view']."/{$view}"); 
+    } else {
+        echo "View {$view} not found!";
+    }
+    $content = ob_get_contents();
+    ob_end_clean();
+
+    return $content;
+}
+
+/**
+ * Универсальная функция для загрузки изображений
+ * @param array $files - $_FILES элемент или массив файлов
+ * @param string $fieldName - имя поля файла (для вложенных массивов)
+ * @return string|false - относительный путь к файлу или false при ошибке
+ */
+function uploadImage($files, $fieldName = null): bool|string {
+    // Разрешенные MIME типы для изображений
+    $allowedMimeTypes = [
+        'image/jpeg',
+        'image/jpg', 
+        'image/png',
+        'image/gif',
+        'image/webp',
+        'image/svg+xml',
+        'image/x-icon',
+        'image/vnd.microsoft.icon'
+    ];
+    
+    // Если передано имя поля, извлекаем данные из вложенного массива
+    if ($fieldName && isset($files['name'][$fieldName])) {
+        $file = [
+            'name' => $files['name'][$fieldName],
+            'tmp_name' => $files['tmp_name'][$fieldName], 
+            'error' => $files['error'][$fieldName],
+            'type' => $files['type'][$fieldName]
+        ];
+    } else {
+        $file = $files;
+    }
+    
+    if (empty($file['name']) || $file['error'] !== UPLOAD_ERR_OK) {
+        return false;
+    }
+    
+    // Проверка MIME типа
+    $finfo = finfo_open(FILEINFO_MIME_TYPE);
+    $mimeType = finfo_file($finfo, $file['tmp_name']);
+    finfo_close($finfo);
+    
+    if (!in_array($mimeType, $allowedMimeTypes)) {
+        return false;
+    }
+    
+    // Дополнительная проверка по расширению файла
+    $fileExtension = strtolower(pathinfo($file['name'], PATHINFO_EXTENSION));
+    $allowedExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg', 'ico'];
+    
+    if (!in_array($fileExtension, $allowedExtensions)) {
+        return false;
+    }
+    
+    $uploadDir = Config::PATH['storage'] . '/';
+    
+    // Создаем директорию если она не существует
+    if (!file_exists($uploadDir)) {
+        mkdir($uploadDir, 0755, true);
+    }
+    
+    // Используем оригинальное имя файла
+    $fileName = basename($file['name']);
+    $targetPath = $uploadDir . $fileName;
+    
+    if (move_uploaded_file($file['tmp_name'], $targetPath)) {
+        // Возвращаем относительный путь для веб-доступа
+        return 'uploads/' . $fileName;
+    }
+    
+    return false;
+}
+
+/**
+ * Получение реального IP адреса пользователя
+ * @return string IP адрес пользователя
+ */
+function getUserIp(): string {
+    if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
+        return $_SERVER['HTTP_CF_CONNECTING_IP'];
+    } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+        // Берём первый IP из списка (если их несколько через запятую)
+        return explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])[0];
+    } else {
+        return $_SERVER['REMOTE_ADDR'];
+    }
+}
+
+function calculateRating($index) {
+    if ($index < 3) {
+        return '10';
+    } elseif ($index < 6) {
+        return '9.5';
+    } elseif ($index < 9) {
+        return '9';
+    } else {
+        return '8.5';
+    }
+}
+
+function getCurrentUrl() {
+    $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
+    $domain = $_SERVER['HTTP_HOST'];
+    $requestUri = $_SERVER['REQUEST_URI'];
+    return $protocol . $domain . $requestUri;
+}
+
+function getCurrentDomain() {
+    $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
+    $domain = $_SERVER['HTTP_HOST'];
+    return $protocol . $domain;
+} 

+ 22 - 0
vendor/autoload.php

@@ -0,0 +1,22 @@
+<?php
+
+// autoload.php @generated by Composer
+
+if (PHP_VERSION_ID < 50600) {
+    if (!headers_sent()) {
+        header('HTTP/1.1 500 Internal Server Error');
+    }
+    $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
+    if (!ini_get('display_errors')) {
+        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
+            fwrite(STDERR, $err);
+        } elseif (!headers_sent()) {
+            echo $err;
+        }
+    }
+    throw new RuntimeException($err);
+}
+
+require_once __DIR__ . '/composer/autoload_real.php';
+
+return ComposerAutoloaderInitd751713988987e9331980363e24189ce::getLoader();

+ 579 - 0
vendor/composer/ClassLoader.php

@@ -0,0 +1,579 @@
+<?php
+
+/*
+ * This file is part of Composer.
+ *
+ * (c) Nils Adermann <naderman@naderman.de>
+ *     Jordi Boggiano <j.boggiano@seld.be>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
+ *
+ *     $loader = new \Composer\Autoload\ClassLoader();
+ *
+ *     // register classes with namespaces
+ *     $loader->add('Symfony\Component', __DIR__.'/component');
+ *     $loader->add('Symfony',           __DIR__.'/framework');
+ *
+ *     // activate the autoloader
+ *     $loader->register();
+ *
+ *     // to enable searching the include path (eg. for PEAR packages)
+ *     $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Jordi Boggiano <j.boggiano@seld.be>
+ * @see    https://www.php-fig.org/psr/psr-0/
+ * @see    https://www.php-fig.org/psr/psr-4/
+ */
+class ClassLoader
+{
+    /** @var \Closure(string):void */
+    private static $includeFile;
+
+    /** @var string|null */
+    private $vendorDir;
+
+    // PSR-4
+    /**
+     * @var array<string, array<string, int>>
+     */
+    private $prefixLengthsPsr4 = array();
+    /**
+     * @var array<string, list<string>>
+     */
+    private $prefixDirsPsr4 = array();
+    /**
+     * @var list<string>
+     */
+    private $fallbackDirsPsr4 = array();
+
+    // PSR-0
+    /**
+     * List of PSR-0 prefixes
+     *
+     * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
+     *
+     * @var array<string, array<string, list<string>>>
+     */
+    private $prefixesPsr0 = array();
+    /**
+     * @var list<string>
+     */
+    private $fallbackDirsPsr0 = array();
+
+    /** @var bool */
+    private $useIncludePath = false;
+
+    /**
+     * @var array<string, string>
+     */
+    private $classMap = array();
+
+    /** @var bool */
+    private $classMapAuthoritative = false;
+
+    /**
+     * @var array<string, bool>
+     */
+    private $missingClasses = array();
+
+    /** @var string|null */
+    private $apcuPrefix;
+
+    /**
+     * @var array<string, self>
+     */
+    private static $registeredLoaders = array();
+
+    /**
+     * @param string|null $vendorDir
+     */
+    public function __construct($vendorDir = null)
+    {
+        $this->vendorDir = $vendorDir;
+        self::initializeIncludeClosure();
+    }
+
+    /**
+     * @return array<string, list<string>>
+     */
+    public function getPrefixes()
+    {
+        if (!empty($this->prefixesPsr0)) {
+            return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
+        }
+
+        return array();
+    }
+
+    /**
+     * @return array<string, list<string>>
+     */
+    public function getPrefixesPsr4()
+    {
+        return $this->prefixDirsPsr4;
+    }
+
+    /**
+     * @return list<string>
+     */
+    public function getFallbackDirs()
+    {
+        return $this->fallbackDirsPsr0;
+    }
+
+    /**
+     * @return list<string>
+     */
+    public function getFallbackDirsPsr4()
+    {
+        return $this->fallbackDirsPsr4;
+    }
+
+    /**
+     * @return array<string, string> Array of classname => path
+     */
+    public function getClassMap()
+    {
+        return $this->classMap;
+    }
+
+    /**
+     * @param array<string, string> $classMap Class to filename map
+     *
+     * @return void
+     */
+    public function addClassMap(array $classMap)
+    {
+        if ($this->classMap) {
+            $this->classMap = array_merge($this->classMap, $classMap);
+        } else {
+            $this->classMap = $classMap;
+        }
+    }
+
+    /**
+     * Registers a set of PSR-0 directories for a given prefix, either
+     * appending or prepending to the ones previously set for this prefix.
+     *
+     * @param string              $prefix  The prefix
+     * @param list<string>|string $paths   The PSR-0 root directories
+     * @param bool                $prepend Whether to prepend the directories
+     *
+     * @return void
+     */
+    public function add($prefix, $paths, $prepend = false)
+    {
+        $paths = (array) $paths;
+        if (!$prefix) {
+            if ($prepend) {
+                $this->fallbackDirsPsr0 = array_merge(
+                    $paths,
+                    $this->fallbackDirsPsr0
+                );
+            } else {
+                $this->fallbackDirsPsr0 = array_merge(
+                    $this->fallbackDirsPsr0,
+                    $paths
+                );
+            }
+
+            return;
+        }
+
+        $first = $prefix[0];
+        if (!isset($this->prefixesPsr0[$first][$prefix])) {
+            $this->prefixesPsr0[$first][$prefix] = $paths;
+
+            return;
+        }
+        if ($prepend) {
+            $this->prefixesPsr0[$first][$prefix] = array_merge(
+                $paths,
+                $this->prefixesPsr0[$first][$prefix]
+            );
+        } else {
+            $this->prefixesPsr0[$first][$prefix] = array_merge(
+                $this->prefixesPsr0[$first][$prefix],
+                $paths
+            );
+        }
+    }
+
+    /**
+     * Registers a set of PSR-4 directories for a given namespace, either
+     * appending or prepending to the ones previously set for this namespace.
+     *
+     * @param string              $prefix  The prefix/namespace, with trailing '\\'
+     * @param list<string>|string $paths   The PSR-4 base directories
+     * @param bool                $prepend Whether to prepend the directories
+     *
+     * @throws \InvalidArgumentException
+     *
+     * @return void
+     */
+    public function addPsr4($prefix, $paths, $prepend = false)
+    {
+        $paths = (array) $paths;
+        if (!$prefix) {
+            // Register directories for the root namespace.
+            if ($prepend) {
+                $this->fallbackDirsPsr4 = array_merge(
+                    $paths,
+                    $this->fallbackDirsPsr4
+                );
+            } else {
+                $this->fallbackDirsPsr4 = array_merge(
+                    $this->fallbackDirsPsr4,
+                    $paths
+                );
+            }
+        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+            // Register directories for a new namespace.
+            $length = strlen($prefix);
+            if ('\\' !== $prefix[$length - 1]) {
+                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+            }
+            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+            $this->prefixDirsPsr4[$prefix] = $paths;
+        } elseif ($prepend) {
+            // Prepend directories for an already registered namespace.
+            $this->prefixDirsPsr4[$prefix] = array_merge(
+                $paths,
+                $this->prefixDirsPsr4[$prefix]
+            );
+        } else {
+            // Append directories for an already registered namespace.
+            $this->prefixDirsPsr4[$prefix] = array_merge(
+                $this->prefixDirsPsr4[$prefix],
+                $paths
+            );
+        }
+    }
+
+    /**
+     * Registers a set of PSR-0 directories for a given prefix,
+     * replacing any others previously set for this prefix.
+     *
+     * @param string              $prefix The prefix
+     * @param list<string>|string $paths  The PSR-0 base directories
+     *
+     * @return void
+     */
+    public function set($prefix, $paths)
+    {
+        if (!$prefix) {
+            $this->fallbackDirsPsr0 = (array) $paths;
+        } else {
+            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
+        }
+    }
+
+    /**
+     * Registers a set of PSR-4 directories for a given namespace,
+     * replacing any others previously set for this namespace.
+     *
+     * @param string              $prefix The prefix/namespace, with trailing '\\'
+     * @param list<string>|string $paths  The PSR-4 base directories
+     *
+     * @throws \InvalidArgumentException
+     *
+     * @return void
+     */
+    public function setPsr4($prefix, $paths)
+    {
+        if (!$prefix) {
+            $this->fallbackDirsPsr4 = (array) $paths;
+        } else {
+            $length = strlen($prefix);
+            if ('\\' !== $prefix[$length - 1]) {
+                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+            }
+            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+            $this->prefixDirsPsr4[$prefix] = (array) $paths;
+        }
+    }
+
+    /**
+     * Turns on searching the include path for class files.
+     *
+     * @param bool $useIncludePath
+     *
+     * @return void
+     */
+    public function setUseIncludePath($useIncludePath)
+    {
+        $this->useIncludePath = $useIncludePath;
+    }
+
+    /**
+     * Can be used to check if the autoloader uses the include path to check
+     * for classes.
+     *
+     * @return bool
+     */
+    public function getUseIncludePath()
+    {
+        return $this->useIncludePath;
+    }
+
+    /**
+     * Turns off searching the prefix and fallback directories for classes
+     * that have not been registered with the class map.
+     *
+     * @param bool $classMapAuthoritative
+     *
+     * @return void
+     */
+    public function setClassMapAuthoritative($classMapAuthoritative)
+    {
+        $this->classMapAuthoritative = $classMapAuthoritative;
+    }
+
+    /**
+     * Should class lookup fail if not found in the current class map?
+     *
+     * @return bool
+     */
+    public function isClassMapAuthoritative()
+    {
+        return $this->classMapAuthoritative;
+    }
+
+    /**
+     * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
+     *
+     * @param string|null $apcuPrefix
+     *
+     * @return void
+     */
+    public function setApcuPrefix($apcuPrefix)
+    {
+        $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
+    }
+
+    /**
+     * The APCu prefix in use, or null if APCu caching is not enabled.
+     *
+     * @return string|null
+     */
+    public function getApcuPrefix()
+    {
+        return $this->apcuPrefix;
+    }
+
+    /**
+     * Registers this instance as an autoloader.
+     *
+     * @param bool $prepend Whether to prepend the autoloader or not
+     *
+     * @return void
+     */
+    public function register($prepend = false)
+    {
+        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+
+        if (null === $this->vendorDir) {
+            return;
+        }
+
+        if ($prepend) {
+            self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
+        } else {
+            unset(self::$registeredLoaders[$this->vendorDir]);
+            self::$registeredLoaders[$this->vendorDir] = $this;
+        }
+    }
+
+    /**
+     * Unregisters this instance as an autoloader.
+     *
+     * @return void
+     */
+    public function unregister()
+    {
+        spl_autoload_unregister(array($this, 'loadClass'));
+
+        if (null !== $this->vendorDir) {
+            unset(self::$registeredLoaders[$this->vendorDir]);
+        }
+    }
+
+    /**
+     * Loads the given class or interface.
+     *
+     * @param  string    $class The name of the class
+     * @return true|null True if loaded, null otherwise
+     */
+    public function loadClass($class)
+    {
+        if ($file = $this->findFile($class)) {
+            $includeFile = self::$includeFile;
+            $includeFile($file);
+
+            return true;
+        }
+
+        return null;
+    }
+
+    /**
+     * Finds the path to the file where the class is defined.
+     *
+     * @param string $class The name of the class
+     *
+     * @return string|false The path if found, false otherwise
+     */
+    public function findFile($class)
+    {
+        // class map lookup
+        if (isset($this->classMap[$class])) {
+            return $this->classMap[$class];
+        }
+        if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
+            return false;
+        }
+        if (null !== $this->apcuPrefix) {
+            $file = apcu_fetch($this->apcuPrefix.$class, $hit);
+            if ($hit) {
+                return $file;
+            }
+        }
+
+        $file = $this->findFileWithExtension($class, '.php');
+
+        // Search for Hack files if we are running on HHVM
+        if (false === $file && defined('HHVM_VERSION')) {
+            $file = $this->findFileWithExtension($class, '.hh');
+        }
+
+        if (null !== $this->apcuPrefix) {
+            apcu_add($this->apcuPrefix.$class, $file);
+        }
+
+        if (false === $file) {
+            // Remember that this class does not exist.
+            $this->missingClasses[$class] = true;
+        }
+
+        return $file;
+    }
+
+    /**
+     * Returns the currently registered loaders keyed by their corresponding vendor directories.
+     *
+     * @return array<string, self>
+     */
+    public static function getRegisteredLoaders()
+    {
+        return self::$registeredLoaders;
+    }
+
+    /**
+     * @param  string       $class
+     * @param  string       $ext
+     * @return string|false
+     */
+    private function findFileWithExtension($class, $ext)
+    {
+        // PSR-4 lookup
+        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
+
+        $first = $class[0];
+        if (isset($this->prefixLengthsPsr4[$first])) {
+            $subPath = $class;
+            while (false !== $lastPos = strrpos($subPath, '\\')) {
+                $subPath = substr($subPath, 0, $lastPos);
+                $search = $subPath . '\\';
+                if (isset($this->prefixDirsPsr4[$search])) {
+                    $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
+                    foreach ($this->prefixDirsPsr4[$search] as $dir) {
+                        if (file_exists($file = $dir . $pathEnd)) {
+                            return $file;
+                        }
+                    }
+                }
+            }
+        }
+
+        // PSR-4 fallback dirs
+        foreach ($this->fallbackDirsPsr4 as $dir) {
+            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+                return $file;
+            }
+        }
+
+        // PSR-0 lookup
+        if (false !== $pos = strrpos($class, '\\')) {
+            // namespaced class name
+            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
+                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+        } else {
+            // PEAR-like class name
+            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
+        }
+
+        if (isset($this->prefixesPsr0[$first])) {
+            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
+                if (0 === strpos($class, $prefix)) {
+                    foreach ($dirs as $dir) {
+                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+                            return $file;
+                        }
+                    }
+                }
+            }
+        }
+
+        // PSR-0 fallback dirs
+        foreach ($this->fallbackDirsPsr0 as $dir) {
+            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+                return $file;
+            }
+        }
+
+        // PSR-0 include paths.
+        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
+            return $file;
+        }
+
+        return false;
+    }
+
+    /**
+     * @return void
+     */
+    private static function initializeIncludeClosure()
+    {
+        if (self::$includeFile !== null) {
+            return;
+        }
+
+        /**
+         * Scope isolated include.
+         *
+         * Prevents access to $this/self from included files.
+         *
+         * @param  string $file
+         * @return void
+         */
+        self::$includeFile = \Closure::bind(static function($file) {
+            include $file;
+        }, null, null);
+    }
+}

+ 396 - 0
vendor/composer/InstalledVersions.php

@@ -0,0 +1,396 @@
+<?php
+
+/*
+ * This file is part of Composer.
+ *
+ * (c) Nils Adermann <naderman@naderman.de>
+ *     Jordi Boggiano <j.boggiano@seld.be>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer;
+
+use Composer\Autoload\ClassLoader;
+use Composer\Semver\VersionParser;
+
+/**
+ * This class is copied in every Composer installed project and available to all
+ *
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
+ *
+ * To require its presence, you can require `composer-runtime-api ^2.0`
+ *
+ * @final
+ */
+class InstalledVersions
+{
+    /**
+     * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
+     * @internal
+     */
+    private static $selfDir = null;
+
+    /**
+     * @var mixed[]|null
+     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
+     */
+    private static $installed;
+
+    /**
+     * @var bool
+     */
+    private static $installedIsLocalDir;
+
+    /**
+     * @var bool|null
+     */
+    private static $canGetVendors;
+
+    /**
+     * @var array[]
+     * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
+     */
+    private static $installedByVendor = array();
+
+    /**
+     * Returns a list of all package names which are present, either by being installed, replaced or provided
+     *
+     * @return string[]
+     * @psalm-return list<string>
+     */
+    public static function getInstalledPackages()
+    {
+        $packages = array();
+        foreach (self::getInstalled() as $installed) {
+            $packages[] = array_keys($installed['versions']);
+        }
+
+        if (1 === \count($packages)) {
+            return $packages[0];
+        }
+
+        return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
+    }
+
+    /**
+     * Returns a list of all package names with a specific type e.g. 'library'
+     *
+     * @param  string   $type
+     * @return string[]
+     * @psalm-return list<string>
+     */
+    public static function getInstalledPackagesByType($type)
+    {
+        $packagesByType = array();
+
+        foreach (self::getInstalled() as $installed) {
+            foreach ($installed['versions'] as $name => $package) {
+                if (isset($package['type']) && $package['type'] === $type) {
+                    $packagesByType[] = $name;
+                }
+            }
+        }
+
+        return $packagesByType;
+    }
+
+    /**
+     * Checks whether the given package is installed
+     *
+     * This also returns true if the package name is provided or replaced by another package
+     *
+     * @param  string $packageName
+     * @param  bool   $includeDevRequirements
+     * @return bool
+     */
+    public static function isInstalled($packageName, $includeDevRequirements = true)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (isset($installed['versions'][$packageName])) {
+                return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Checks whether the given package satisfies a version constraint
+     *
+     * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
+     *
+     *   Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
+     *
+     * @param  VersionParser $parser      Install composer/semver to have access to this class and functionality
+     * @param  string        $packageName
+     * @param  string|null   $constraint  A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
+     * @return bool
+     */
+    public static function satisfies(VersionParser $parser, $packageName, $constraint)
+    {
+        $constraint = $parser->parseConstraints((string) $constraint);
+        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
+
+        return $provided->matches($constraint);
+    }
+
+    /**
+     * Returns a version constraint representing all the range(s) which are installed for a given package
+     *
+     * It is easier to use this via isInstalled() with the $constraint argument if you need to check
+     * whether a given version of a package is installed, and not just whether it exists
+     *
+     * @param  string $packageName
+     * @return string Version constraint usable with composer/semver
+     */
+    public static function getVersionRanges($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            $ranges = array();
+            if (isset($installed['versions'][$packageName]['pretty_version'])) {
+                $ranges[] = $installed['versions'][$packageName]['pretty_version'];
+            }
+            if (array_key_exists('aliases', $installed['versions'][$packageName])) {
+                $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
+            }
+            if (array_key_exists('replaced', $installed['versions'][$packageName])) {
+                $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
+            }
+            if (array_key_exists('provided', $installed['versions'][$packageName])) {
+                $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
+            }
+
+            return implode(' || ', $ranges);
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @param  string      $packageName
+     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+     */
+    public static function getVersion($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            if (!isset($installed['versions'][$packageName]['version'])) {
+                return null;
+            }
+
+            return $installed['versions'][$packageName]['version'];
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @param  string      $packageName
+     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+     */
+    public static function getPrettyVersion($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            if (!isset($installed['versions'][$packageName]['pretty_version'])) {
+                return null;
+            }
+
+            return $installed['versions'][$packageName]['pretty_version'];
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @param  string      $packageName
+     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
+     */
+    public static function getReference($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            if (!isset($installed['versions'][$packageName]['reference'])) {
+                return null;
+            }
+
+            return $installed['versions'][$packageName]['reference'];
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @param  string      $packageName
+     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
+     */
+    public static function getInstallPath($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @return array
+     * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
+     */
+    public static function getRootPackage()
+    {
+        $installed = self::getInstalled();
+
+        return $installed[0]['root'];
+    }
+
+    /**
+     * Returns the raw installed.php data for custom implementations
+     *
+     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
+     * @return array[]
+     * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
+     */
+    public static function getRawData()
+    {
+        @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
+
+        if (null === self::$installed) {
+            // only require the installed.php file if this file is loaded from its dumped location,
+            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+            if (substr(__DIR__, -8, 1) !== 'C') {
+                self::$installed = include __DIR__ . '/installed.php';
+            } else {
+                self::$installed = array();
+            }
+        }
+
+        return self::$installed;
+    }
+
+    /**
+     * Returns the raw data of all installed.php which are currently loaded for custom implementations
+     *
+     * @return array[]
+     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
+     */
+    public static function getAllRawData()
+    {
+        return self::getInstalled();
+    }
+
+    /**
+     * Lets you reload the static array from another file
+     *
+     * This is only useful for complex integrations in which a project needs to use
+     * this class but then also needs to execute another project's autoloader in process,
+     * and wants to ensure both projects have access to their version of installed.php.
+     *
+     * A typical case would be PHPUnit, where it would need to make sure it reads all
+     * the data it needs from this class, then call reload() with
+     * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
+     * the project in which it runs can then also use this class safely, without
+     * interference between PHPUnit's dependencies and the project's dependencies.
+     *
+     * @param  array[] $data A vendor/composer/installed.php data set
+     * @return void
+     *
+     * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
+     */
+    public static function reload($data)
+    {
+        self::$installed = $data;
+        self::$installedByVendor = array();
+
+        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
+        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
+        // so we have to assume it does not, and that may result in duplicate data being returned when listing
+        // all installed packages for example
+        self::$installedIsLocalDir = false;
+    }
+
+    /**
+     * @return string
+     */
+    private static function getSelfDir()
+    {
+        if (self::$selfDir === null) {
+            self::$selfDir = strtr(__DIR__, '\\', '/');
+        }
+
+        return self::$selfDir;
+    }
+
+    /**
+     * @return array[]
+     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
+     */
+    private static function getInstalled()
+    {
+        if (null === self::$canGetVendors) {
+            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
+        }
+
+        $installed = array();
+        $copiedLocalDir = false;
+
+        if (self::$canGetVendors) {
+            $selfDir = self::getSelfDir();
+            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
+                $vendorDir = strtr($vendorDir, '\\', '/');
+                if (isset(self::$installedByVendor[$vendorDir])) {
+                    $installed[] = self::$installedByVendor[$vendorDir];
+                } elseif (is_file($vendorDir.'/composer/installed.php')) {
+                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
+                    $required = require $vendorDir.'/composer/installed.php';
+                    self::$installedByVendor[$vendorDir] = $required;
+                    $installed[] = $required;
+                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
+                        self::$installed = $required;
+                        self::$installedIsLocalDir = true;
+                    }
+                }
+                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
+                    $copiedLocalDir = true;
+                }
+            }
+        }
+
+        if (null === self::$installed) {
+            // only require the installed.php file if this file is loaded from its dumped location,
+            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+            if (substr(__DIR__, -8, 1) !== 'C') {
+                /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
+                $required = require __DIR__ . '/installed.php';
+                self::$installed = $required;
+            } else {
+                self::$installed = array();
+            }
+        }
+
+        if (self::$installed !== array() && !$copiedLocalDir) {
+            $installed[] = self::$installed;
+        }
+
+        return $installed;
+    }
+}

+ 21 - 0
vendor/composer/LICENSE

@@ -0,0 +1,21 @@
+
+Copyright (c) Nils Adermann, Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+

+ 11 - 0
vendor/composer/autoload_classmap.php

@@ -0,0 +1,11 @@
+<?php
+
+// autoload_classmap.php @generated by Composer
+
+$vendorDir = dirname(__DIR__);
+$baseDir = dirname($vendorDir);
+
+return array(
+    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
+    'Config' => $baseDir . '/config/src.php',
+);

+ 10 - 0
vendor/composer/autoload_files.php

@@ -0,0 +1,10 @@
+<?php
+
+// autoload_files.php @generated by Composer
+
+$vendorDir = dirname(__DIR__);
+$baseDir = dirname($vendorDir);
+
+return array(
+    '48483d6c44b015b6d6d681c009d084a7' => $baseDir . '/src/helpers.php',
+);

+ 9 - 0
vendor/composer/autoload_namespaces.php

@@ -0,0 +1,9 @@
+<?php
+
+// autoload_namespaces.php @generated by Composer
+
+$vendorDir = dirname(__DIR__);
+$baseDir = dirname($vendorDir);
+
+return array(
+);

+ 10 - 0
vendor/composer/autoload_psr4.php

@@ -0,0 +1,10 @@
+<?php
+
+// autoload_psr4.php @generated by Composer
+
+$vendorDir = dirname(__DIR__);
+$baseDir = dirname($vendorDir);
+
+return array(
+    'App\\' => array($baseDir . '/src'),
+);

+ 48 - 0
vendor/composer/autoload_real.php

@@ -0,0 +1,48 @@
+<?php
+
+// autoload_real.php @generated by Composer
+
+class ComposerAutoloaderInitd751713988987e9331980363e24189ce
+{
+    private static $loader;
+
+    public static function loadClassLoader($class)
+    {
+        if ('Composer\Autoload\ClassLoader' === $class) {
+            require __DIR__ . '/ClassLoader.php';
+        }
+    }
+
+    /**
+     * @return \Composer\Autoload\ClassLoader
+     */
+    public static function getLoader()
+    {
+        if (null !== self::$loader) {
+            return self::$loader;
+        }
+
+        spl_autoload_register(array('ComposerAutoloaderInitd751713988987e9331980363e24189ce', 'loadClassLoader'), true, true);
+        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
+        spl_autoload_unregister(array('ComposerAutoloaderInitd751713988987e9331980363e24189ce', 'loadClassLoader'));
+
+        require __DIR__ . '/autoload_static.php';
+        call_user_func(\Composer\Autoload\ComposerStaticInitd751713988987e9331980363e24189ce::getInitializer($loader));
+
+        $loader->register(true);
+
+        $filesToLoad = \Composer\Autoload\ComposerStaticInitd751713988987e9331980363e24189ce::$files;
+        $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
+            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
+                $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
+
+                require $file;
+            }
+        }, null, null);
+        foreach ($filesToLoad as $fileIdentifier => $file) {
+            $requireFile($fileIdentifier, $file);
+        }
+
+        return $loader;
+    }
+}

+ 41 - 0
vendor/composer/autoload_static.php

@@ -0,0 +1,41 @@
+<?php
+
+// autoload_static.php @generated by Composer
+
+namespace Composer\Autoload;
+
+class ComposerStaticInitd751713988987e9331980363e24189ce
+{
+    public static $files = array (
+        '48483d6c44b015b6d6d681c009d084a7' => __DIR__ . '/../..' . '/src/helpers.php',
+    );
+
+    public static $prefixLengthsPsr4 = array (
+        'A' => 
+        array (
+            'App\\' => 4,
+        ),
+    );
+
+    public static $prefixDirsPsr4 = array (
+        'App\\' => 
+        array (
+            0 => __DIR__ . '/../..' . '/src',
+        ),
+    );
+
+    public static $classMap = array (
+        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
+        'Config' => __DIR__ . '/../..' . '/config/src.php',
+    );
+
+    public static function getInitializer(ClassLoader $loader)
+    {
+        return \Closure::bind(function () use ($loader) {
+            $loader->prefixLengthsPsr4 = ComposerStaticInitd751713988987e9331980363e24189ce::$prefixLengthsPsr4;
+            $loader->prefixDirsPsr4 = ComposerStaticInitd751713988987e9331980363e24189ce::$prefixDirsPsr4;
+            $loader->classMap = ComposerStaticInitd751713988987e9331980363e24189ce::$classMap;
+
+        }, null, ClassLoader::class);
+    }
+}

+ 5 - 0
vendor/composer/installed.json

@@ -0,0 +1,5 @@
+{
+    "packages": [],
+    "dev": true,
+    "dev-package-names": []
+}

+ 23 - 0
vendor/composer/installed.php

@@ -0,0 +1,23 @@
+<?php return array(
+    'root' => array(
+        'name' => '__root__',
+        'pretty_version' => '1.0.0+no-version-set',
+        'version' => '1.0.0.0',
+        'reference' => null,
+        'type' => 'library',
+        'install_path' => __DIR__ . '/../../',
+        'aliases' => array(),
+        'dev' => true,
+    ),
+    'versions' => array(
+        '__root__' => array(
+            'pretty_version' => '1.0.0+no-version-set',
+            'version' => '1.0.0.0',
+            'reference' => null,
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../../',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+    ),
+);