sark 1 miesiąc temu
rodzic
commit
ad820644c9

+ 4 - 0
.gitignore

@@ -5,6 +5,10 @@ database/database.db
 uploads/*
 !uploads/.gitkeep
 
+# Media
+media/*
+!media/.gitkeep
+
 # Logs
 *.log
 

+ 28 - 6
bin/migrate.php

@@ -86,11 +86,11 @@ try {
         ['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' => 'header-logo', 'value' => '{"src":"media/logo.png","title":"Amazing Casino Logo","alt":"Amazing Casino - Best Online Gaming"}'],
+        ['grupa' => 'content', 'name' => 'banner-logo', 'value' => '{"src":"media/banner.jpg","title":"Welcome Bonus Banner","alt":"Get 200% Welcome Bonus","width":"800","height":"400"}'],
+        ['grupa' => 'content', 'name' => 'footer-logo', 'value' => '{"src":"media/footer-logo.png","title":"Footer Logo","alt":"Amazing Casino Footer"}'],
+        ['grupa' => 'content', 'name' => 'favicon', 'value' => 'media/favicon.ico'],
+        ['grupa' => 'content', 'name' => 'author-img', 'value' => 'media/author.jpg'],
         ['grupa' => 'content', 'name' => 'hash', 'value' => 'ac123main'],
         ['grupa' => 'content', 'name' => 'hash-1', 'value' => 'ac123promo'],
         ['grupa' => 'content', 'name' => 'hash-2', 'value' => 'ac123bonus'],
@@ -129,7 +129,7 @@ try {
         ['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' => 'og-image', 'value' => 'media/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/"}]'],
@@ -193,6 +193,28 @@ try {
     $db->execute($faqsIndexSQL);
     echo "✓ FAQs table index checked/created\n";
     
+    // Migration: Create slots table
+    $slotsTableSQL = "
+        CREATE TABLE IF NOT EXISTS slots (
+        id INTEGER PRIMARY KEY AUTOINCREMENT,
+        name VARCHAR(255) NOT NULL,
+        image VARCHAR(255) NULL,
+        provider VARCHAR(255) NULL,
+        rtp DECIMAL(5,2) NULL,
+        demo_url VARCHAR(500) NULL,
+        created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
+        updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
+    )";
+    $db->execute($slotsTableSQL);
+    echo "✓ Slots table checked/created\n";
+    
+    // Create indexes for slots
+    $slotsNameIndexSQL = "CREATE INDEX IF NOT EXISTS idx_slots_name ON slots(name)";
+    $db->execute($slotsNameIndexSQL);
+    $slotsProviderIndexSQL = "CREATE INDEX IF NOT EXISTS idx_slots_provider ON slots(provider)";
+    $db->execute($slotsProviderIndexSQL);
+    echo "✓ Slots table indexes checked/created\n";
+    
     echo "Migration completed successfully!\n";
     
 } catch (Exception $e) {

+ 1 - 1
config/src.php

@@ -4,7 +4,7 @@ class Config
     const PATH = [
         'root' => __DIR__.'/..',
         'src' => __DIR__.'/../src',
-        'storage' => __DIR__.'/../public/uploads',
+        'storage' => __DIR__.'/../public/media',
         'resources' => __DIR__.'/../resources',
         'view' => __DIR__.'/../resources/view',
         'public' => __DIR__.'/../public',

BIN
database/database.db


+ 1 - 0
public/index.php

@@ -7,6 +7,7 @@ $page = match (true) {
   ('/' === $requestUri) => 'home.php',
   ('/admin/' === $requestUri) => 'admin/index.php',
   ('/admin/pages/' === $requestUri) => 'admin/pages.php',
+  ('/admin/slots/' === $requestUri) => 'admin/slots.php',
   ('/verstka/' === $requestUri) => 'verstka.php',
   (preg_match('#^/redirect/([\w-]+)/$#', $requestUri, $matches) === 1) => 'redirect.php',
   default => '404.php',

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


+ 8 - 1
resources/view/admin/partials/sidebar.php

@@ -8,8 +8,9 @@
         <div class="px-4 space-y-1">
 <?php
 $currentUri = $_SERVER['REQUEST_URI'];
-$isIndex = (strpos($currentUri, '/admin/pages/') === false && strpos($currentUri, '/admin/') !== false);
+$isIndex = (strpos($currentUri, '/admin/pages/') === false && strpos($currentUri, '/admin/slots/') === false && strpos($currentUri, '/admin/') !== false);
 $isPages = (strpos($currentUri, '/admin/pages/') !== false);
+$isSlots = (strpos($currentUri, '/admin/slots/') !== false);
 ?>
             <a href="/admin/" class="<?= $isIndex ? 'group flex items-center px-3 py-2 text-sm font-medium rounded-lg text-blue-700 bg-blue-50 border-r-4 border-blue-700' : 'group flex items-center px-3 py-2 text-sm font-medium rounded-lg text-gray-600 hover:text-gray-900 hover:bg-gray-50 transition-colors' ?>">
                 <svg class="mr-3 h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
@@ -23,6 +24,12 @@ $isPages = (strpos($currentUri, '/admin/pages/') !== false);
                 </svg>
                 Dynamic Pages
             </a>
+            <a href="/admin/slots/" class="<?= $isSlots ? 'group flex items-center px-3 py-2 text-sm font-medium rounded-lg text-blue-700 bg-blue-50 border-r-4 border-blue-700' : 'group flex items-center px-3 py-2 text-sm font-medium rounded-lg text-gray-600 hover:text-gray-900 hover:bg-gray-50 transition-colors' ?>">
+                <svg class="mr-3 h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
+                    <path fill-rule="evenodd" d="M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z" clip-rule="evenodd"/>
+                </svg>
+                Casino Slots
+            </a>
         </div>
     </nav>
 </div>

+ 1 - 1
src/helpers.php

@@ -239,7 +239,7 @@ function uploadImage($files, $fieldName = null): bool|string {
     
     if (move_uploaded_file($file['tmp_name'], $targetPath)) {
         // Возвращаем относительный путь для веб-доступа
-        return 'uploads/' . $fileName;
+        return 'media/' . $fileName;
     }
     
     return false;