@php use App\Support\MonthlyReportSummaryChartSvg; $dash = is_array($summary ?? null) ? $summary : []; $kpis = $dash['kpis'] ?? []; $planned = $kpis['planned'] ?? ['regular' => 0, 'compliance' => 0, 'special' => 0, 'pmu' => 0, 'total' => 0]; $conducted = $kpis['conducted'] ?? ['regular' => 0, 'compliance' => 0, 'special' => 0, 'pmu' => 0, 'total' => 0]; $published = $kpis['published'] ?? ['current_month' => 0, 'previous_month' => 0, 'total' => 0, 'current_label' => '—', 'previous_label' => '—']; $visitStatus = $dash['visit_status'] ?? ['total' => 0, 'completed' => 0, 'pending' => 0, 'completed_pct' => 0, 'pending_pct' => 0]; $publishedReportStatus = $dash['published_report_status'] ?? ['total' => 0, 'satisfactory' => 0, 'unsatisfactory' => 0, 'satisfactory_pct' => 0, 'unsatisfactory_pct' => 0]; $sectorPie = $dash['sector_distribution'] ?? ['items' => [], 'conic_gradient' => '#e2e8f0 0deg 360deg', 'total' => 0]; $subSectorPie = $dash['sub_sector_distribution'] ?? ['items' => [], 'conic_gradient' => '#e2e8f0 0deg 360deg', 'total' => 0]; $costPie = $dash['cost_distribution'] ?? ['items' => [], 'conic_gradient' => '#e2e8f0 0deg 360deg', 'total' => 0]; $typeWisePie = $dash['type_wise_distribution'] ?? ['items' => [], 'conic_gradient' => '#e2e8f0 0deg 360deg', 'total' => 0]; $pcReceiving = $dash['pc_receiving'] ?? ['rows' => [], 'total_adp' => 0]; $pcReceivingRows = is_array($pcReceiving['rows'] ?? null) ? $pcReceiving['rows'] : []; $regionBars = is_array($dash['region_bars'] ?? null) ? $dash['region_bars'] : []; $monthWiseProgress = $dash['month_wise_progress'] ?? ['labels' => [], 'assigned' => [], 'visited' => [], 'published' => [], 'satisfactory' => [], 'unsatisfactory' => [], 'max' => 1]; $pmuMonthProgress = $dash['pmu_month_progress'] ?? ['labels' => [], 'assigned' => [], 'visited' => [], 'published' => [], 'max' => 1]; $topDepartments = is_array($dash['top_departments'] ?? null) ? $dash['top_departments'] : []; $mapPoints = is_array($dash['map_points'] ?? null) ? $dash['map_points'] : []; $majorObservations = is_array($dash['major_observations'] ?? null) ? $dash['major_observations'] : []; $titlePeriod = $dash['title_period'] ?? now()->format('F Y'); $generatedAt = $dash['generated_at'] ?? now()->format('d M Y'); $rowCount = (int) ($dash['row_count'] ?? 0); $donutSatisfactoryDeg = max(0, min(360, (int) round(((float) ($publishedReportStatus['satisfactory_pct'] ?? 0) / 100) * 360))); $monthWiseCount = count($monthWiseProgress['labels'] ?? []); $pmuMonthCount = count($pmuMonthProgress['labels'] ?? []); $regionAxisMax = (int) ($regionBars[0]['max'] ?? 10); $sectorPieSvg = (($sectorPie['total'] ?? 0) > 0) ? MonthlyReportSummaryChartSvg::isometricPie($sectorPie['items'] ?? [], 'sector') : ''; $subSectorPieSvg = (($subSectorPie['total'] ?? 0) > 0) ? MonthlyReportSummaryChartSvg::isometricPie($subSectorPie['items'] ?? [], 'subsector') : ''; $costPieSvg = (($costPie['total'] ?? 0) > 0) ? MonthlyReportSummaryChartSvg::isometricPie($costPie['items'] ?? [], 'cost') : ''; $typeWisePieSvg = (($typeWisePie['total'] ?? 0) > 0) ? MonthlyReportSummaryChartSvg::isometricPie($typeWisePie['items'] ?? [], 'typewise') : ''; $monthWiseChartSvg = $monthWiseCount > 0 ? MonthlyReportSummaryChartSvg::monthWiseProgress($monthWiseProgress) : ''; $pmuMonthChartSvg = $pmuMonthCount > 0 ? MonthlyReportSummaryChartSvg::pmuMonthWiseProgress($pmuMonthProgress) : ''; /** Compact A4 layout only when explicitly requested — print preview uses full Summary design. */ $printMode = ! empty($printMode); $compactLayout = ! empty($compactLayout); $enableMapSnapshot = ! empty($enableMapSnapshot) || $printMode; $barChartHeight = $compactLayout ? 108 : ($printMode ? 88 : 144); $topDepartmentsDisplay = $printMode ? array_slice($topDepartments, 0, 6) : $topDepartments; $majorObservationsDisplay = array_slice($majorObservations, 0, 5); $topDepartmentsHidden = $printMode ? max(0, count($topDepartments) - count($topDepartmentsDisplay)) : 0; $majorObservationsHidden = max(0, count($majorObservations) - count($majorObservationsDisplay)); $mecLogo = asset('assets/mec logo.jpg'); $gosLogo = asset('assets/dist/img/gos.png'); @endphp
@if ($mapPoints === []) {{ __('Sindh province · no scheme coordinates in current filters · zoom out for country view') }} @else {{ __('Sindh province · :count visited schemes · zoom out for country view', ['count' => count($mapPoints)]) }} @endif
@if ($mapPoints === []) {{ __('Sindh province · no scheme coordinates in current filters · zoom out for country view') }} @else {{ __('Sindh province · :count visited schemes · zoom out for country view', ['count' => count($mapPoints)]) }} @endif
| {{ __('S#') }} | {{ __('Observations') }} |
|---|---|
| {{ $observation['rank'] }} | {{ $observation['observation'] }} |
| {{ __('S#') }} | {{ __('Description') }} | {{ __('No.') }} | {{ __('%') }} |
|---|---|---|---|
| {{ $pcRow['rank'] }} | {{ Str::limit($pcRow['description'], $printMode ? 42 : 120) }} | {{ number_format((int) $pcRow['count']) }} | {{ $pcRow['pct_label'] ?? '—' }} |
| # | {{ __('Department') }} | {{ __('Visits') }} |
|---|---|---|
| {{ $dept['rank'] }} | {{ Str::limit($dept['name'], $printMode ? 22 : 28) }} | {{ $dept['visits'] }} |