popup dashboard

This commit is contained in:
2026-07-11 19:49:14 +02:00
parent 51cfd0a434
commit a94eac9fb4
3 changed files with 81 additions and 0 deletions
@@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreateOptionsTable extends AbstractMigration
{
public function change(): void
{
$table = $this->table('options');
$table
->addColumn('opt_key', 'string', ['limit' => 100])
->addColumn('opt_value', 'text', ['null' => true])
->addColumn('created_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP'])
->addColumn('updated_at', 'timestamp', [
'default' => 'CURRENT_TIMESTAMP',
'update' => 'CURRENT_TIMESTAMP',
])
->addIndex(['opt_key'], ['unique' => true])
->create();
// Righe iniziali del popup
$this->table('options')->insert([
[
'opt_key' => 'popup_enabled',
'opt_value' => '1',
],
[
'opt_key' => 'popup_version',
'opt_value' => '2026-07-migrazione',
],
[
'opt_key' => 'popup',
'opt_value' =>
'<h2 style="margin-top:0;">Nuovo portale disponibile</h2>'
. '<p>Ci siamo spostati. Da ora usa il nuovo indirizzo:</p>'
. '<p style="text-align:center;">'
. '<a href="https://trfsmart-bv.cesoft.io/" '
. 'style="display:inline-block;padding:12px 24px;background:#2563eb;'
. 'color:#fff;text-decoration:none;border-radius:6px;">Vai al nuovo portale</a>'
. '</p>'
. '<p style="font-size:13px;color:#666;">Salva il nuovo indirizzo nei preferiti. '
. 'Se riscontri problemi puoi continuare a usare questo portale per ora.</p>',
],
])->saveData();
}
}
+1
View File
@@ -183,6 +183,7 @@
</head>
<body>
<?php include('include/popup.php'); ?>
<div class="wrapper">
<?php include('include/navbar.php'); ?>
<?php include('include/topbar.php'); ?>
+32
View File
@@ -0,0 +1,32 @@
<?php
$popupEnabled = (($_ENV['POPUP_ENABLED'] ?? getenv('POPUP_ENABLED')) === 'true');
if ($popupEnabled):
?>
<div id="app-popup-overlay" style="position:fixed;inset:0;background:rgba(0,0,0,.5);display:flex;align-items:center;justify-content:center;z-index:99999;">
<div style="background:#fff;max-width:520px;width:90%;padding:28px;border-radius:10px;position:relative;box-shadow:0 10px 40px rgba(0,0,0,.3);">
<button onclick="document.getElementById('app-popup-overlay').remove()"
style="position:absolute;top:10px;right:14px;border:none;background:none;font-size:22px;cursor:pointer;line-height:1;color:#888;">&times;</button>
<h2 style="margin-top:0;">Nuovo sito in produzione</h2>
<p>Il nuovo portale è disponibile all'indirizzo:</p>
<p style="text-align:center;font-weight:bold;">https://trfsmart-bv.cesoft.io/</p>
<p style="text-align:center;">
<a href="https://trfsmart-bv.cesoft.io/"
style="display:inline-block;padding:12px 24px;background:#2563eb;color:#fff;text-decoration:none;border-radius:6px;">
Clicca qui per accedere
</a>
</p>
<p style="font-size:13px;color:#666;margin-top:24px;">
Se invece hai problemi con il nuovo sito, puoi chiudere questo messaggio e continuare su questo portale:
</p>
<p style="text-align:center;">
<button onclick="document.getElementById('app-popup-overlay').remove()"
style="padding:10px 20px;background:#e5e7eb;color:#111;border:none;border-radius:6px;cursor:pointer;">
Chiudi e procedi su questo sito
</button>
</p>
</div>
</div>
<?php endif; ?>