index.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?php
  2. // Start session und so
  3. session_start();
  4. // Config lade
  5. $config = include(__DIR__ . '/../config.php');
  6. // Sqlite
  7. $db = new SQLite3(__DIR__ . '/../content.db');
  8. ?>
  9. <!DOCTYPE html>
  10. <html lang="en">
  11. <head>
  12. <meta charset="UTF-8">
  13. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  14. <title>Admin Panel</title>
  15. <link rel="stylesheet" href="../assets/css/tc.css">
  16. <style> /* nachher gihts denne keis styling meh im adminier panel will das blaot oder so isch*/
  17. body {
  18. font-family: Arial, sans-serif;
  19. display: flex;
  20. flex-direction: column;
  21. align-items: center;
  22. padding: 20px;
  23. }
  24. .header-content {
  25. display: flex;
  26. align-items: center;
  27. margin-bottom: 20px;
  28. }
  29. .header-content img {
  30. margin-right: 10px;
  31. width: 50px;
  32. height: auto;
  33. }
  34. .container {
  35. display: flex;
  36. width: 100%;
  37. max-width: 1200px;
  38. }
  39. .sidebar {
  40. width: 200px;
  41. background-color: #f4f4f4;
  42. padding: 15px;
  43. box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  44. }
  45. .sidebar a {
  46. display: block;
  47. padding: 10px;
  48. margin: 5px 0;
  49. color: #333;
  50. text-decoration: none;
  51. }
  52. .sidebar a:hover {
  53. background-color: #ddd;
  54. }
  55. .content {
  56. flex-grow: 1;
  57. padding: 20px;
  58. background-color: #fff;
  59. box-shadow: 0 0 10px rgba(0,0,0,0.1);
  60. }
  61. .content h1 {
  62. margin-top: 0;
  63. }
  64. .content p {
  65. margin-bottom: 20px;
  66. }
  67. .content form {
  68. margin-bottom: 20px;
  69. }
  70. </style>
  71. </head>
  72. <body>
  73. <div class="header-content">
  74. <img src="assets/svg/teleco.svg" alt="Teleco Logo" class="logo">
  75. <h1>Adminier Panel</h1>
  76. </div>
  77. <div class="container">
  78. <div class="sidebar">
  79. <h2>Adminier Panel</h2>
  80. <form method="GET" action="index.php">
  81. <label for="websiteId">Select Website:</label>
  82. <select name="websiteId" id="websiteId" onchange="this.form.submit()">
  83. <?php foreach ($config as $site): ?>
  84. <?php if (isset($site['id'])): ?>
  85. <option value="<?php echo $site['id']; ?>" <?php echo (isset($_GET['websiteId']) && $_GET['websiteId'] == $site['id']) ? 'selected' : ''; ?>>
  86. <?php echo htmlspecialchars($site['name']); ?>
  87. </option>
  88. <?php endif; ?>
  89. <?php endforeach; ?>
  90. </select>
  91. </form>
  92. <a href="backup_database.php?websiteId=<?php echo isset($_GET['websiteId']) ? (int)$_GET['websiteId'] : 1; ?>">Backup Database</a>
  93. <a href="tools/edit_database.php">Edit das Database</a>
  94. <a href="tools/manage_files.php">Manger das Filet</a>
  95. </div>
  96. <div class="content">
  97. <h1>Welcome to the TC-C-CMS admin Panel</h1>
  98. <p>Feast your eyes! This is the last time you will see properish CSS in the admin panel.</p>
  99. <p>Made with lots of love for PHP and pure hatred against JavaScript (has none) by T.B <br> TC-C-CMS means Teleco's Crappy Content Management System btw lol hahahaha ich chan das alles nümmeh! </p>
  100. <?php if (isset($_GET['backupMessage'])): ?>
  101. <p><?php echo htmlspecialchars($_GET['backupMessage']); ?></p>
  102. <?php endif; ?>
  103. </div>
  104. </div>
  105. </body>
  106. </html>