sidebar.php 5.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. // Αρχείο: /var/www/html/hockey-cms/admin/sidebar.php
  3. if (isset($_GET['lang']) && in_array($_GET['lang'], ['el', 'en'])) {
  4. $_SESSION['lang'] = $_GET['lang'];
  5. }
  6. $current_lang = $_SESSION['lang'] ?? 'el';
  7. $sidebar_t = [
  8. 'el' => [
  9. 'panel_title' => 'Admin Panel',
  10. 'dashboard' => 'Dashboard',
  11. 'categories' => 'Κατηγορίες',
  12. 'attributes' => 'Χαρακτηριστικά',
  13. 'products' => 'Προϊόντα',
  14. 'orders' => 'Παραγγελίες',
  15. 'users' => 'Χρήστες & Sellers',
  16. 'texts' => 'Κείμενα (Δίγλωσσα)',
  17. 'email_settings' => 'Ρυθμίσεις Email',
  18. 'whatsapp_settings' => 'Ρυθμίσεις WhatsApp',
  19. 'sms_settings' => 'Ρυθμίσεις SMS (Brevo)',
  20. 'email_templates' => 'Πρότυπα Email',
  21. 'themes' => 'Εμφάνιση (Themes)',
  22. 'back_eshop' => 'Επιστροφή E-shop',
  23. 'logout' => 'Αποσύνδεση'
  24. ],
  25. 'en' => [
  26. 'panel_title' => 'Admin Panel',
  27. 'dashboard' => 'Dashboard',
  28. 'categories' => 'Categories',
  29. 'attributes' => 'Attributes',
  30. 'products' => 'Products',
  31. 'orders' => 'Orders',
  32. 'users' => 'Users & Sellers',
  33. 'texts' => 'Texts (Bilingual)',
  34. 'email_settings' => 'Email Settings',
  35. 'whatsapp_settings' => 'WhatsApp Settings',
  36. 'sms_settings' => 'SMS Settings (Brevo)',
  37. 'email_templates' => 'Email Templates',
  38. 'themes' => 'Appearance (Themes)',
  39. 'back_eshop' => 'Back to E-shop',
  40. 'logout' => 'Logout'
  41. ]
  42. ];
  43. $sb_t = $sidebar_t[$current_lang];
  44. $current_page = basename($_SERVER['PHP_SELF']);
  45. ?>
  46. <div class="sidebar">
  47. <h3 style="text-align: center; color: var(--primary); margin-bottom: 25px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;">⚙️ <?php echo $sb_t['panel_title']; ?></h3>
  48. <a href="index.php" class="<?php echo $current_page == 'index.php' ? 'active' : ''; ?>">📊 <?php echo $sb_t['dashboard']; ?></a>
  49. <a href="categories.php" class="<?php echo $current_page == 'categories.php' ? 'active' : ''; ?>">📁 <?php echo $sb_t['categories']; ?></a>
  50. <a href="attributes.php" class="<?php echo $current_page == 'attributes.php' ? 'active' : ''; ?>">⚡ <?php echo $sb_t['attributes']; ?></a>
  51. <a href="products.php" class="<?php echo $current_page == 'products.php' ? 'active' : ''; ?>">🏒 <?php echo $sb_t['products']; ?></a>
  52. <a href="orders.php" class="<?php echo $current_page == 'orders.php' ? 'active' : ''; ?>">🛒 <?php echo $sb_t['orders']; ?></a>
  53. <a href="users.php" class="<?php echo $current_page == 'users.php' ? 'active' : ''; ?>">👥 <?php echo $sb_t['users']; ?></a>
  54. <a href="texts.php" class="<?php echo $current_page == 'texts.php' ? 'active' : ''; ?>">📝 <?php echo $sb_t['texts']; ?></a>
  55. <a href="mail_settings.php" class="<?php echo $current_page == 'mail_settings.php' ? 'active' : ''; ?>">📧 <?php echo $sb_t['email_settings']; ?></a>
  56. <a href="whatsapp_settings.php" class="<?php echo $current_page == 'whatsapp_settings.php' ? 'active' : ''; ?>">📱 <?php echo $sb_t['whatsapp_settings']; ?></a>
  57. <a href="sms_settings.php" class="<?php echo $current_page == 'sms_settings.php' ? 'active' : ''; ?>">💬 <?php echo $sb_t['sms_settings']; ?></a>
  58. <a href="email_templates.php" class="<?php echo $current_page == 'email_templates.php' ? 'active' : ''; ?>">✉️ <?php echo $sb_t['email_templates']; ?></a>
  59. <a href="themes.php" class="<?php echo $current_page == 'themes.php' ? 'active' : ''; ?>">🎨 <?php echo $sb_t['themes']; ?></a>
  60. <div style="position: absolute; bottom: 20px; width: 100%;">
  61. <div style="display: flex; justify-content: center; gap: 10px; margin-bottom: 15px;">
  62. <a href="?lang=el" style="padding: 2px 8px; border-radius: 12px; font-size: 12px; margin:0; border: none; background: <?php echo $current_lang == 'el' ? 'var(--primary)' : 'rgba(255,255,255,0.1)'; ?>; color: #fff;">GR</a>
  63. <a href="?lang=en" style="padding: 2px 8px; border-radius: 12px; font-size: 12px; margin:0; border: none; background: <?php echo $current_lang == 'en' ? 'var(--primary)' : 'rgba(255,255,255,0.1)'; ?>; color: #fff;">EN</a>
  64. </div>
  65. <a href="../index.php" style="background: rgba(59, 130, 246, 0.1); color: #3b82f6; text-align: center; margin: 0 15px; border-radius: 6px; border: 1px solid rgba(59, 130, 246, 0.2);"><?php echo $sb_t['back_eshop']; ?></a>
  66. <a href="../logout.php" style="color: #ef4444; text-align: center; margin-top: 10px; background: transparent; border:none;"><?php echo $sb_t['logout']; ?></a>
  67. </div>
  68. </div>
  69. <style>
  70. .sidebar { width: 250px; background: var(--panel-bg); color: var(--text-main); position: fixed; height: 100vh; padding-top: 20px; box-shadow: 2px 0 10px rgba(0,0,0,0.5); border-right: 1px solid var(--border-color); z-index: 100;}
  71. .sidebar a { display: block; color: var(--text-muted); padding: 12px 20px; text-decoration: none; font-size: 14px; font-weight: 600; transition: 0.2s; border-left: 4px solid transparent; text-transform: uppercase; letter-spacing: 0.5px;}
  72. .sidebar a:hover { background: rgba(255,255,255,0.02); color: var(--text-main); }
  73. .sidebar a.active { background: rgba(249, 115, 22, 0.05); color: var(--primary); border-left: 4px solid var(--primary); }
  74. </style>