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

144 lines
6.6 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@php
use App\Helpers\GetDay;
use Carbon\Carbon;
$dayNumber = 1;
@endphp
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
Текущая неделя:
@if($currentWeek['err'] !== 0)
Что то сломалось: {{ $currentWeek['msg'] }}
@elseif($currentWeek['week_cur'] == 1)
нечетная
@else
четная
@endif
</h2>
</x-slot>
@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>
</div>
</div>
</div>
@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
<div class="container py-12 max-w-7xl mx-auto sm:px-6 lg:px-8">
<table class="table">
<thead>
<tr>
<th colspan="2">Профиль</th>
</tr>
</thead>
<tbody>
<tr>
<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>
</tr>
<tr>
<td>Курс</td>
<td>{{ $user->course }}</td>
</tr>
<tr>
<td>Группа</td>
<td>{{ $user->group }}</td>
</tr>
</tbody>
</table>
</div>
</x-app-layout>