| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623 |
- <div class="dashboard-container">
- <style>
- .dashboard-container {
- background: #F6F7FF;
- min-height: 100vh;
- padding: 20px;
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
- }
- .dashboard-grid {
- display: grid;
- grid-template-columns: 1fr 1fr 1fr;
- gap: 20px;
- margin-bottom: 20px;
- }
- .dashboard-section {
- background: white;
- border-radius: 12px;
- padding: 20px;
- box-shadow: 0 2px 10px rgba(0,0,0,0.05);
- }
- .stat-card {
- background: white;
- border-radius: 12px;
- padding: 20px;
- box-shadow: 0 2px 10px rgba(0,0,0,0.05);
- position: relative;
- }
- .stat-card-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 10px;
- }
- .stat-card-title {
- font-size: 14px;
- color: #666;
- font-weight: 500;
- }
- .stat-card-value {
- font-size: 48px;
- font-weight: bold;
- color: #333;
- margin: 10px 0;
- }
- .stat-card-change {
- font-size: 12px;
- color: #666;
- }
- .stat-card-change.positive {
- color: #339E8E;
- }
- .stat-card-change.negative {
- color: #D6234F;
- }
- .stat-icon {
- width: 24px;
- height: 24px;
- border-radius: 4px;
- display: flex;
- align-items: center;
- justify-content: center;
- color: white;
- font-size: 12px;
- }
- .courses-list {
- max-height: 300px;
- overflow-y: auto;
- }
- .course-item {
- padding: 12px;
- border-left: 4px solid #7438FA;
- margin-bottom: 8px;
- background: #F6F7FF;
- border-radius: 0 8px 8px 0;
- }
- .course-time {
- font-weight: bold;
- color: #333;
- font-size: 14px;
- }
- .course-name {
- font-size: 13px;
- color: #7438FA;
- font-weight: 600;
- }
- .course-days {
- font-size: 12px;
- color: #666;
- }
- .fields-grid {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 10px;
- }
- .field-item {
- padding: 12px;
- border: 2px solid #339E8E;
- border-radius: 8px;
- text-align: center;
- background: white;
- }
- .field-item.occupied {
- border-color: #D6234F;
- background: #FFF5F7;
- }
- .field-name {
- font-weight: bold;
- color: #333;
- }
- .field-time {
- color: #666;
- font-size: 12px;
- }
- .notes-section {
- background: #F6F7FF;
- border-radius: 8px;
- padding: 15px;
- margin-top: 15px;
- }
- .notes-input {
- width: 100%;
- border: none;
- background: transparent;
- outline: none;
- font-size: 14px;
- min-height: 60px;
- resize: vertical;
- }
- .save-btn {
- background: #7438FA;
- color: white;
- border: none;
- padding: 8px 16px;
- border-radius: 6px;
- font-size: 12px;
- cursor: pointer;
- margin-top: 10px;
- }
- .save-btn:hover {
- background: #6028E0;
- }
- .notes-list {
- max-height: 200px;
- overflow-y: auto;
- margin-bottom: 15px;
- }
- .note-item {
- display: flex;
- align-items: flex-start;
- gap: 10px;
- padding: 10px;
- background: white;
- border-radius: 8px;
- margin-bottom: 8px;
- border-left: 3px solid #7438FA;
- }
- .note-checkbox {
- width: 18px;
- height: 18px;
- border: 2px solid #7438FA;
- border-radius: 4px;
- background: white;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- color: white;
- font-size: 12px;
- font-weight: bold;
- transition: all 0.2s ease;
- flex-shrink: 0;
- margin-top: 2px;
- }
- .note-checkbox:hover {
- background: #7438FA;
- transform: scale(1.1);
- }
- .note-content {
- flex: 1;
- }
- .note-text {
- color: #333;
- font-size: 14px;
- line-height: 1.4;
- margin-bottom: 5px;
- }
- .note-date {
- color: #666;
- font-size: 11px;
- }
- .empty-notes {
- text-align: center;
- color: #666;
- font-size: 13px;
- padding: 20px;
- font-style: italic;
- }
- .chart-container {
- background: white;
- border-radius: 12px;
- padding: 20px;
- box-shadow: 0 2px 10px rgba(0,0,0,0.05);
- grid-column: span 3;
- }
- .financial-cards {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 20px;
- margin-bottom: 20px;
- }
- .financial-card {
- background: white;
- border-radius: 12px;
- padding: 20px;
- box-shadow: 0 2px 10px rgba(0,0,0,0.05);
- text-align: center;
- }
- .financial-card.income {
- border-left: 4px solid #339E8E;
- }
- .financial-card.expense {
- border-left: 4px solid #D6234F;
- }
- .financial-amount {
- font-size: 36px;
- font-weight: bold;
- margin: 10px 0;
- }
- .financial-amount.income {
- color: #339E8E;
- }
- .financial-amount.expense {
- color: #D6234F;
- }
- .recent-users-table {
- width: 100%;
- border-collapse: collapse;
- }
- .recent-users-table th,
- .recent-users-table td {
- text-align: left;
- padding: 12px 8px;
- border-bottom: 1px solid #f0f0f0;
- }
- .recent-users-table th {
- background: #F6F7FF;
- font-weight: 600;
- color: #333;
- font-size: 12px;
- }
- .recent-users-table td {
- font-size: 14px;
- color: #333;
- }
- .transaction-list {
- max-height: 300px;
- overflow-y: auto;
- }
- .transaction-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 12px;
- border-bottom: 1px solid #f0f0f0;
- }
- .transaction-name {
- font-weight: 500;
- color: #333;
- }
- .transaction-amount {
- font-weight: bold;
- }
- .transaction-type {
- font-size: 10px;
- padding: 4px 8px;
- border-radius: 12px;
- color: white;
- font-weight: bold;
- }
- .transaction-type.income {
- background: #339E8E;
- }
- .transaction-type.expense {
- background: #D6234F;
- }
- .participation-bar {
- height: 20px;
- background: #f0f0f0;
- border-radius: 10px;
- overflow: hidden;
- margin: 8px 0;
- }
- .participation-fill {
- height: 100%;
- transition: width 0.3s ease;
- }
- .participation-fill.padel {
- background: #FFD700;
- }
- .participation-fill.tennis {
- background: #8B4CF7;
- }
- .participation-fill.pallavolo {
- background: #FF6B35;
- }
- .participation-fill.yoga {
- background: #339E8E;
- }
- .section-title {
- font-size: 18px;
- font-weight: bold;
- color: #333;
- margin-bottom: 20px;
- }
- .chart-title {
- font-size: 16px;
- font-weight: 600;
- color: #333;
- margin-bottom: 15px;
- }
- .grid-4 {
- display: grid;
- grid-template-columns: repeat(4, 1fr);
- gap: 15px;
- margin-bottom: 20px;
- }
- .grid-3 {
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- gap: 20px;
- margin-bottom: 20px;
- }
- .grid-2 {
- display: grid;
- grid-template-columns: repeat(2, 1fr);
- gap: 20px;
- margin-bottom: 20px;
- }
- .full-width {
- grid-column: span 3;
- }
- .half-width {
- grid-column: span 2;
- }
- .fade-out {
- opacity: 0;
- transform: translateX(100%);
- transition: all 0.3s ease;
- }
- </style>
- <div class="grid-4">
- <div class="stat-card">
- <div class="stat-card-header">
- <div class="stat-card-title">Utenti Totali</div>
- <div class="stat-icon">👥</div>
- </div>
- <div class="stat-card-value">{{$activeUsers}}</div>
- </div>
- <div class="stat-card">
- <div class="stat-card-header">
- <div class="stat-card-title">Tesserati</div>
- <div class="stat-icon">📋</div>
- </div>
- <div class="stat-card-value">{{$registeredUsers}}</div>
- </div>
- <div class="stat-card">
- <div class="stat-card-header">
- <div class="stat-card-title">Certificati medici scaduti</div>
- <div class="stat-icon">📄</div>
- </div>
- <div class="stat-card-value">{{$expiredCertificates}}</div>
- </div>
- <div class="stat-card">
- <div class="stat-card-header">
- <div class="stat-card-title">Abbonamenti sospesi</div>
- <div class="stat-icon">⏸️</div>
- </div>
- <div class="stat-card-value">{{$suspendedSubscriptions}}</div>
- </div>
- </div>
- <div class="grid-3">
- <div class="dashboard-section">
- <div class="section-title">Ultimi utenti registrati</div>
- @if(count($recentUsers) > 0)
- <table class="recent-users-table">
- <thead>
- <tr>
- <th>Cognome</th>
- <th>Nome</th>
- <th>Telefono</th>
- <th>Email</th>
- </tr>
- </thead>
- <tbody>
- @foreach($recentUsers as $user)
- <tr>
- <td>{{$user['surname']}}</td>
- <td>{{$user['name']}}</td>
- <td>{{$user['phone']}}</td>
- <td>{{$user['email']}}</td>
- </tr>
- @endforeach
- </tbody>
- </table>
- @else
- <div style="text-align: center; color: #666; padding: 40px;">
- Nessun utente registrato di recente
- </div>
- @endif
- </div>
- <div class="dashboard-section">
- <div class="section-title">Corsi</div>
- @if(count($courses) > 0)
- <div class="courses-list">
- @foreach($courses as $course)
- <div class="course-item">
- <div class="course-time">{{$course['time']}}</div>
- <div class="course-name">{{$course['course_name']}}</div>
- <div class="course-days">{{$course['days']}}</div>
- </div>
- @endforeach
- </div>
- @else
- <div style="text-align: center; color: #666; padding: 40px;">
- Nessun corso programmato per oggi
- </div>
- @endif
- </div>
- <div class="dashboard-section">
- <div class="section-title">To do</div>
- <div style="font-size: 14px; color: #666; margin-bottom: 10px;">{{date('d/m/Y')}}</div>
- @if(count($savedNotes) > 0)
- <div class="notes-list">
- @foreach($savedNotes as $note)
- <div class="note-item">
- <div class="note-checkbox" wire:click="completeNote('{{$note['id']}}')" title="Segna come completato">
- ✓
- </div>
- <div class="note-content">
- <div class="note-text">{{$note['text']}}</div>
- <div class="note-date">{{$note['created_at']}}</div>
- </div>
- </div>
- @endforeach
- </div>
- @else
- <div class="empty-notes">
- Nessuna nota salvata
- </div>
- @endif
- <div class="notes-section">
- <textarea class="notes-input" placeholder="Inserisci una nuova nota..." wire:model="notes"></textarea>
- <button class="save-btn" wire:click="saveNote">SALVA</button>
- </div>
- </div>
- </div>
- <div class="grid-2">
- <div class="dashboard-section">
- <div class="section-title">Corsi con più partecipazioni</div>
- @if(count($coursesParticipation) > 0)
- <div style="padding: 10px 0;">
- @foreach($coursesParticipation as $course)
- <div style="margin-bottom: 20px;">
- <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px;">
- <span style="font-weight: 600; color: #333; font-size: 14px;">{{$course['course_name']}}</span>
- <span style="font-size: 12px; color: #666;">{{$course['participants']}} partecipanti</span>
- </div>
- <div class="participation-bar">
- <div class="participation-fill {{$course['color']}}" style="width: {{$course['percentage']}}%"></div>
- </div>
- </div>
- @endforeach
- </div>
- @else
- <div style="text-align: center; color: #666; padding: 40px;">
- Nessun corso con partecipazioni
- </div>
- @endif
- </div>
- <div>
- <div class="financial-cards" style="margin-bottom: 0;">
- <div class="financial-card income">
- <div style="font-size: 14px; color: #666; margin-bottom: 10px;">Incassato mese corrente</div>
- <div class="financial-amount income">€ {{number_format($toReceive, 2)}}</div>
- </div>
- <div class="financial-card expense">
- <div style="font-size: 14px; color: #666; margin-bottom: 10px;">Pagato mese corrente</div>
- <div class="financial-amount expense">€ {{number_format($toPay, 2)}}</div>
- </div>
- </div>
- </div>
- </div>
- <div class="dashboard-section">
- <div class="section-title">Ultimi movimenti finanziari</div>
- @if(count($recentTransactions) > 0)
- <div class="transaction-list">
- @foreach($recentTransactions as $transaction)
- <div class="transaction-item">
- <div class="transaction-name">{{$transaction['name']}}</div>
- <div style="display: flex; align-items: center; gap: 10px;">
- <div class="transaction-amount">€ {{number_format($transaction['amount'], 2)}}</div>
- <div class="transaction-type {{$transaction['type'] == 'ENTRATA' ? 'income' : 'expense'}}">
- {{$transaction['type']}}
- </div>
- </div>
- </div>
- @endforeach
- </div>
- @else
- <div style="text-align: center; color: #666; padding: 40px;">
- Nessun movimento finanziario recente
- </div>
- @endif
- </div>
- </div>
- @push('scripts')
- <script>
- window.addEventListener('note-saved', event => {
- // Show success message
- if (typeof toastr !== 'undefined') {
- toastr.success('Nota salvata con successo!');
- } else {
- alert('Nota salvata con successo!');
- }
- });
- window.addEventListener('note-completed', event => {
- if (typeof toastr !== 'undefined') {
- toastr.success('Nota completata!');
- } else {
- alert('Nota completata!');
- }
- });
- document.addEventListener('keydown', function(e) {
- if (e.ctrlKey && e.key === 'Enter') {
- let textarea = document.querySelector('.notes-input');
- if (textarea === document.activeElement) {
- Livewire.emit('saveNote');
- }
- }
- });
- </script>
- @endpush
|