@extends('layouts.app') @section('admin_title', $mode === 'curriculum' ? 'Curriculum Courses' : ($mode === 'skill' ? 'Skill-Based Courses' : 'Courses')) @section('content') @if($mode === 'hub') {{-- ==================== 2-COLUMN COURSES HUB ==================== --}}

Courses — {{ $pageTitle }}

Select a track to explore courses for your college, inspect full details, or allocate batches.

Add Course Allocate Courses
Batch-Allocated

Curriculum Courses

University-affiliated syllabus courses for {{ $university->uname ?? 'your university' }}, allocated to specific departments & batches.

{{ number_format($curriculumCount) }}
Curriculum Courses
{{ $university->uname ?? 'University' }}
Affiliated University
Open Curriculum Courses
Common for All Students

Skill-Based Courses

Industry & career-ready skill tracks available to every student in {{ $collegeName ?? 'your college' }} without batch restrictions.

{{ number_format($skillCount) }}
Skill-Based Courses
All Students
College-Wide Access
Open Skill-Based Courses
@else {{-- ==================== CARD VIEW FOR SELECTED TRACK ==================== --}}

@if($mode === 'curriculum') Curriculum Courses @else Skill-Based Courses @endif

{{ $mode === 'curriculum' ? ($university->uname ?? 'University') : 'Common for All College Students' }}

Click any course card to view complete details{{ $mode === 'curriculum' ? ', syllabus, and batch allocations' : ' and course metadata' }}.

Courses Hub @if($mode === 'curriculum') Add Course Allocate @endif
Curriculum ({{ $curriculumCount }}) Skill-Based ({{ $skillCount }})
@if($search !== '') Clear @endif
@if($courses->count() > 0)
@foreach($courses as $c) @php $isSkill = $mode === 'skill'; $coursePayload = [ 'id' => $c->id, 'name' => $c->coursename, 'code' => $c->coursecode, 'type' => $isSkill ? 'Skill-Based Course' : 'Curriculum Course', 'is_skill' => $isSkill, 'program' => strtoupper($c->program->pname ?? 'N/A'), 'university' => $isSkill ? 'Common for All College Students' : ($c->university->uname ?? ($university->uname ?? 'N/A')), 'regulation' => $c->regulation ?: '—', 'hours' => (int) ($c->hours ?? 0), 'percentage' => (float) ($c->percentage ?? 0), 'syllabus' => $c->syllabus ? asset($c->syllabus) : null, 'edit_url' => route('admin.courses.edit', $c->id), 'alloc_url' => route('admin.courses.allocation.details', $c->id), 'delete_url' => route('admin.courses.destroy', $c->id), ]; @endphp
{{ $c->coursecode }} {{ strtoupper($c->program->pname ?? 'N/A') }}

{{ $c->coursename }}

{{ (int) ($c->hours ?? 0) }} Hours
Pass: {{ (float) ($c->percentage ?? 0) }}%
{{ $isSkill ? 'All Students' : ('Reg: ' . ($c->regulation ?: '—')) }}
{{ $c->syllabus ? 'Syllabus Ready' : 'Course Track' }}
@endforeach
{{ $courses->links() }}
@else

No {{ $mode === 'curriculum' ? 'Curriculum' : 'Skill-Based' }} Courses Found

{{ $search !== '' ? 'Try clearing your search filter.' : 'No courses have been added to this track yet.' }}

@endif

Course Code
Program / Language
University / Scope
Regulation
Course Hours
Pass Percentage
Batch Allocations
Loading...
Edit Course
Batch Allocation

@endif @endsection