lk-students/resources/views/dashboard.blade.php

144 lines
6.6 KiB
PHP
Raw Permalink Normal View History

2024-07-12 12:47:16 +03:00
@php
use App\Helpers\GetDay;
use Carbon\Carbon;
$dayNumber = 1;
@endphp
2024-06-19 13:42:36 +03:00
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
2024-07-12 12:47:16 +03:00
Текущая неделя:
@if($currentWeek['err'] !== 0)
Что то сломалось: {{ $currentWeek['msg'] }}
@elseif($currentWeek['week_cur'] == 1)
нечетная
@else
четная
@endif
2024-06-19 13:42:36 +03:00
</h2>
</x-slot>
2024-07-12 12:47:16 +03:00
@if($timetable['err'] !== 0)
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 text-gray-900 dark:text-gray-100">
{{ $timetable['msg'] }}
</div>
2024-06-19 13:42:36 +03:00
</div>
</div>
</div>
2024-07-12 12:47:16 +03:00
@else
<div class="container">
<div class="row align-items-start">
<div class="col">
<div class="accordion max-w-7xl mx-auto sm:px-6 lg:px-8" id="accordionPanelsStayOpenExample">
@foreach($timetable[$currentWeek['week_cur']] as $day => $subjects)
<div class="accordion-item">
<h2 class="accordion-header">
<button
class="accordion-button @if(Carbon::now()->dayOfWeek !== $dayNumber) collapsed @endif"
type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapse{{ $dayNumber }}" aria-expanded="true"
aria-controls="panelsStayOpen-collapse{{ $dayNumber }}">
{{ GetDay::getDay($day) }}
</button>
</h2>
<div id="panelsStayOpen-collapse{{ $dayNumber }}"
class="accordion-collapse collapse @if(Carbon::now()->dayOfWeek === $dayNumber) show @endif">
<div class="accordion-body">
@foreach($subjects as $subject)
{{ $subject['time1'] }} ({{ $subject['time_name'][0] }} - {{ $subject['time_name'][1] }}) / <strong>{{ $subject['predmet'] }} </strong> ({{ $subject['vid_name'] }})<br>
Аудитория: {{ $subject['aname'] }} <br>
Преподаватель: {{ $subject['fio'] }} <br>
<br>
@endforeach
</div>
</div>
</div>
@php $dayNumber++ @endphp
@endforeach
</div>
</div>
<div class="col">
<div class="accordion max-w-7xl mx-auto sm:px-6 lg:px-8" id="accordionPanelsStayOpenExample">
<div class="accordion-item text-center">Следующая неделя</div>
@foreach($timetable[($currentWeek['week_cur'] === 1) ? 2 : 1] as $day => $subjects)
<div class="accordion-item">
<h2 class="accordion-header">
<button
class="accordion-button collapsed"
type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapse{{ $dayNumber }}" aria-expanded="true"
aria-controls="panelsStayOpen-collapse{{ $dayNumber }}">
{{ GetDay::getDay($day) }}
</button>
</h2>
<div id="panelsStayOpen-collapse{{ $dayNumber }}"
class="accordion-collapse collapse">
<div class="accordion-body">
@foreach($subjects as $subject)
{{ $subject['time1'] }} ({{ $subject['time_name'][0] }} - {{ $subject['time_name'][1] }}) / <strong>{{ $subject['predmet'] }} </strong> ({{ $subject['vid_name'] }})<br>
Аудитория: {{ $subject['aname'] }} <br>
Преподаватель: {{ $subject['fio'] }} <br>
<br>
@endforeach
</div>
</div>
</div>
@php $dayNumber++ @endphp
@endforeach
</div>
</div>
</div>
</div>
@endif
2024-06-19 16:46:09 +03:00
2024-07-12 12:47:16 +03:00
<div class="container py-12 max-w-7xl mx-auto sm:px-6 lg:px-8">
2024-06-19 16:46:09 +03:00
<table class="table">
<thead>
<tr>
2024-07-12 12:47:16 +03:00
<th colspan="2">Профиль</th>
2024-06-19 16:46:09 +03:00
</tr>
</thead>
<tbody>
<tr>
2024-07-12 12:47:16 +03:00
<td>Полное имя</td>
<td>{{ $user->name }}</td>
</tr>
<tr>
<td>Email</td>
<td>{{ $user->email }}</td>
</tr>
<tr>
<td>Имя</td>
<td>{{ $user->first_name }}</td>
</tr>
<tr>
<td>Фамилия</td>
<td>{{ $user->last_name }}</td>
</tr>
<tr>
<td>Отчество</td>
<td>{{ $user->middle_name }}</td>
</tr>
<tr>
<td>Зачетная книжка</td>
<td>{{ $user->number_record_book }}</td>
</tr>
<tr>
<td>Факультет</td>
<td>{{ $user->faculty }}</td>
2024-06-19 16:46:09 +03:00
</tr>
<tr>
2024-07-12 12:47:16 +03:00
<td>Курс</td>
<td>{{ $user->course }}</td>
2024-06-19 16:46:09 +03:00
</tr>
<tr>
2024-07-12 12:47:16 +03:00
<td>Группа</td>
<td>{{ $user->group }}</td>
2024-06-19 16:46:09 +03:00
</tr>
</tbody>
</table>
</div>
2024-06-19 13:42:36 +03:00
</x-app-layout>