@php if (request()->has('popup')) $layout = "common.layout-popup"; else $layout = "common.layout"; @endphp @extends($layout) @section("page-title", "회원 관리: ".$user->name) @section("header") {!! resource('css/form.css') !!} {!! resource('js/common/kakaoPost.js') !!} {!! resource('js/modal.js') !!} {!! setResources([ 'toast-calendar']) !!} {{-- {!! resource('js/components/calendar.js') !!} --}} {!! resource('js/schedule/schedule.js') !!} @endsection @section("content") @if (!request()->has('popup'))

회원 관리: {{ $user->name }}

@endif
@csrf
회원 정보
{{-- 회원 번호 --}}
{{ $user->id }} ({{ date("Y.m.d", strtotime($user->created_at)) }})
{{-- 활성 --}} @if($User->role->name == 'root')
activated)>
@else @endif {{-- 역할 --}} @if($User->role->name == 'root')
role->name))> @foreach ($roles as $role) role->name) and $user->role->name == $role->name)> @endforeach
@endif {{-- 등록기기 --}}
{{-- 회원이미지--}}
@if (!empty($user->photo)) @endif Selected Image
{{-- edm_id --}}
@if($User->role->name == 'root') {{-- password --}}
@endif
{{-- name --}}
@error('name') {{ $message }} @enderror
{{-- phone --}}
@error('phone') {{ $message }} @enderror
{{-- email --}}
@error('email') {{ $message }} @enderror
{{-- address --}}
{{-- student fields --}}
role->name))class="is_staff" @endif>
is_accepted_email)>
is_accepted_phone)>
캘린더
{{ date('Y-m') }}
@if ($user->enrollments->where('service', 'academy')->isNotEmpty())
어학원 강좌 지급
@foreach($user->enrollments->where('service', 'academy') as $enrollment) @php $startDate = \Carbon\Carbon::parse($enrollment->started_at); $endDate = \Carbon\Carbon::parse($enrollment->ended_at); $currentDate = $startDate->copy()->startOfMonth(); $monthlyPeriods = []; $courseIndex = 0; // 강좌 순서를 추적할 변수 $totalCourses = $enrollment->enrollmentCourses->count(); // 총 강좌 수 while ($currentDate->lte($endDate)) { $startOfMonth = $currentDate->copy()->startOfMonth(); $endOfMonth = $currentDate->copy()->endOfMonth(); $periodStart = $startDate->greaterThan($startOfMonth) ? $startDate : $startOfMonth; $periodEnd = $endDate->lessThan($endOfMonth) ? $endDate : $endOfMonth; $monthlyPeriods[] = [ 'start' => $periodStart->format('Y-m-d'), 'end' => $periodEnd->format('Y-m-d'), ]; $currentDate->addMonth(); } @endphp
@csrf
{{ $enrollment->product->name }} ({{ $enrollment->productOption->name }})
{{ config('system.enrollment_status')[$enrollment->status] }}
수강 기간
@foreach($monthlyPeriods as $period) @php $periodStartDate = \Carbon\Carbon::parse($period['start']); $periodMonth = $periodStartDate->format('ym'); // YYMM 형식으로 월을 추출 $todayDate = \Carbon\Carbon::now(); $isPastOrStarted = $periodStartDate->lte($todayDate); // 현재 날짜가 시작일보다 이후인지 확인 // 현재 월에 해당하는 강좌 찾기 $monthCourse = $enrollment->enrollmentCourses->firstWhere('month', $periodMonth); @endphp @endforeach @if ($totalCourses > count($monthlyPeriods)) @php // month가 null인 강좌들 (미할당 강좌) $unassignedCourses = $enrollment->enrollmentCourses->filter(function($course) { return $course->month === null; }); @endphp @if ($unassignedCourses->count() > 0) @foreach($unassignedCourses as $index => $unassignedCourse) @endforeach @endif @endif
수강월 수강기간 강좌
{{ $periodStartDate->format('n') }}월 {{ $period['start'] }} ~ {{ $period['end'] }} {{-- 250516 테스트를 위해 강좌 제한 조건 주석처리 --}} {{-- @if (!$isPastOrStarted) --}} {{-- @else {{ $monthCourse ? $monthCourse->name : '미등록' }} @endif --}} {{-- @if (!$isPastOrStarted && $monthCourse) --}} @if ($monthCourse) @endif
@endforeach
@endif
@endsection @push("script") @endpush