@inject('comp_model', 'App\Models\ComponentsData') @php // Access permissions $can_add = $user->canAccess('ready/add'); $can_edit = $user->canAccess('ready/edit'); $can_view = $user->canAccess('ready/view'); $can_delete = $user->canAccess('ready/delete'); // Request parameters $field_name = request()->segment(3); $field_value = request()->segment(4); // Pagination data $total_records = $records->total(); $limit = $records->perPage(); $record_count = count($records); $pageTitle = 'Ready Certificates'; @endphp @extends($layout) @section('title', $pageTitle) @section('content')
{{-- Page Header --}} @if($show_header == true)
All Generated Certificates
@endif {{-- Main Content --}}
{{-- Breadcrumb --}} @php Html::page_bread_crumb('/ready/', $field_name, $field_value); Html::display_page_errors($errors); @endphp {{-- Filter Tags --}}
@php Html::filter_tag('search', __('Search')); @endphp
{{-- Data Table --}} @if($can_delete) @endif @if($total_records) @foreach($records as $data) @php $rec_id = $data['id'] ? urlencode($data['id']) : null; @endphp @if($can_delete) @endif @endforeach @else @endif
Workshop Unique Code Status Actions
{{ $data['workshops_workshop_name'] }} {{ $data['workshop_unique_code'] }} @if(!$data->is_expired) @if($data->days_remaining <= 30) EXPIRING SOON ({{ $data->days_remaining }} days) @else ACTIVE ({{ $data->days_remaining }} days) @endif @else EXPIRED @endif
{{-- Download Button (Always visible) --}} download Download {{-- Renew Button (Conditional visibility and clickability) --}} @if($data->is_expired) @if($data->recently_renewed) {{-- Recently renewed - show disabled button --}} @elseif($data->has_renewal_request) {{-- Has renewal payment - clickable --}} refresh Renew @else {{-- No renewal payment - disabled --}} @endif @elseif($data->days_remaining <= 30) {{-- Expiring soon - show renew button based on payment status --}} @if($data->has_renewal_request) refresh Renew Early @else @endif @endif {{-- If certificate is active and not expiring soon, no renew button shown --}} {{-- History Button (Show if certificate has been renewed) --}} @if($data->has_been_renewed) @endif
@if($can_view) visibility Preview @endif
block No record found
{{-- Footer with Pagination --}} @if($show_footer)
@if($can_delete) @endif
@php if ($show_pagination == true) { $pager = new Pagination($total_records, $record_count); $pager->show_page_count = false; $pager->show_record_count = true; $pager->show_page_limit = false; $pager->limit = $limit; $pager->show_page_number_list = true; $pager->pager_link_range = 5; // Maintain search parameter in pagination links if(request('search')) { $pager->set_query_string('search', request('search')); } $pager->render(); } @endphp
@endif
{{-- Renewal History Modal --}} {{-- Scripts Section --}} @endsection