@include('updown.headers')

Per Office Summary

Per Offices and Summary

@foreach($offices as $office)
SQD 1-8 {{ $office->office_name }}
@if(!empty($startDate[$office->office_id]) && !empty($endDate[$office->office_id]))

Date Range: {{ date('F j, Y', strtotime($startDate[$office->office_id])) }} to {{ date('F j, Y', strtotime($endDate[$office->office_id])) }}

@elseif(isset($dateRanges[$office->office_id]))

Date Range: {{ date('F j, Y', strtotime($dateRanges[$office->office_id]->earliest_date)) }} to {{ date('F j, Y', strtotime($dateRanges[$office->office_id]->latest_date)) }}

@else

No data available for this office.

@endif @php // Initialize accumulators for overall totals across all offices $all_offices_totals = [ 'strongly_agree' => 0, 'agree' => 0, 'neutral' => 0, 'disagree' => 0, 'strongly_disagree' => 0, 'na' => 0, 'total_responses' => 0, 'overall_percentage' => 0 ]; $categories = [ ['label' => 'Responsiveness', 'prefix' => 'sqdone'], ['label' => 'Reliability', 'prefix' => 'sqdtwo'], ['label' => 'Access and Facilities', 'prefix' => 'sqdthree'], ['label' => 'Communication', 'prefix' => 'sqdfour'], ['label' => 'Costs', 'prefix' => 'sqdfive'], ['label' => 'Integrity', 'prefix' => 'sqdsix'], ['label' => 'Assurance', 'prefix' => 'sqdseven'], ['label' => 'Outcome', 'prefix' => 'sqdeight'], ]; // Initialize accumulators for overall totals for this office $overall_totals = [ 'strongly_agree' => 0, 'agree' => 0, 'neutral' => 0, 'disagree' => 0, 'strongly_disagree' => 0, 'na' => 0, 'total_responses' => 0, 'overall_percentage' => 0 ]; @endphp @foreach($categories as $category) @php // Accumulate totals for overall row for this office $overall_totals['strongly_agree'] += $office->{$category['prefix'] . '_strongly_agree'}; $overall_totals['agree'] += $office->{$category['prefix'] . '_agree'}; $overall_totals['neutral'] += $office->{$category['prefix'] . '_neutral'}; $overall_totals['disagree'] += $office->{$category['prefix'] . '_disagree'}; $overall_totals['strongly_disagree'] += $office->{$category['prefix'] . '_strongly_disagree'}; $overall_totals['na'] += $office->{$category['prefix'] . '_na'}; $overall_totals['total_responses'] += $office->{$category['prefix'] . '_total_responses'}; $overall_totals['overall_percentage'] += $office->{$category['prefix'] . '_overall_rating_percentage'}; // Accumulate totals for all offices $all_offices_totals['strongly_agree'] += $office->{$category['prefix'] . '_strongly_agree'}; $all_offices_totals['agree'] += $office->{$category['prefix'] . '_agree'}; $all_offices_totals['neutral'] += $office->{$category['prefix'] . '_neutral'}; $all_offices_totals['disagree'] += $office->{$category['prefix'] . '_disagree'}; $all_offices_totals['strongly_disagree'] += $office->{$category['prefix'] . '_strongly_disagree'}; $all_offices_totals['na'] += $office->{$category['prefix'] . '_na'}; $all_offices_totals['total_responses'] += $office->{$category['prefix'] . '_total_responses'}; $all_offices_totals['overall_percentage'] += $office->{$category['prefix'] . '_overall_rating_percentage'}; @endphp @endforeach
Strongly Agree Agree Neither Agree nor Disagree Disagree Strongly Disagree N/A Total Response Overall
{{ $category['label'] }} {{ $office->{$category['prefix'] . '_strongly_agree'} }} {{ $office->{$category['prefix'] . '_agree'} }} {{ $office->{$category['prefix'] . '_neutral'} }} {{ $office->{$category['prefix'] . '_disagree'} }} {{ $office->{$category['prefix'] . '_strongly_disagree'} }} {{ $office->{$category['prefix'] . '_na'} }} {{ $office->{$category['prefix'] . '_total_responses'} }} {{ number_format($office->{$category['prefix'] . '_overall_rating_percentage'}, 2) }}%
Overall {{ $overall_totals['strongly_agree'] }} {{ $overall_totals['agree'] }} {{ $overall_totals['neutral'] }} {{ $overall_totals['disagree'] }} {{ $overall_totals['strongly_disagree'] }} {{ $overall_totals['na'] }} {{ $overall_totals['total_responses'] }} {{ number_format($overall_totals['overall_percentage'] / count($categories), 2) }}%
@endforeach
@foreach($CC as $office)
Citizen's Charter {{ $office->office_name }}
@if(!empty($startDate[$office->office_id]) && !empty($endDate[$office->office_id]))

Date Range: {{ date('F j, Y', strtotime($startDate[$office->office_id])) }} to {{ date('F j, Y', strtotime($endDate[$office->office_id])) }}

@elseif(isset($dateRanges[$office->office_id]))

Date Range: {{ date('F j, Y', strtotime($dateRanges[$office->office_id]->earliest_date)) }} to {{ date('F j, Y', strtotime($dateRanges[$office->office_id]->latest_date)) }}

@else

No data available for this office.

@endif
Citizen’s Charter Answers Responses Overall
CC1. Which of the following describes your awareness of the CC?
1. I know what a CC is and I saw this office’s CC. {{ $office->i_know_i_saw_cc1 }} {{ number_format(($office->i_know_i_saw_cc1 / $office->total_responses_cc1) * 100, 2) }}%
2. I know what a CC is but I did not see this office’s CC. {{ $office->i_know_cc_cc1 }} {{ number_format(($office->i_know_cc_cc1 / $office->total_responses_cc1) * 100, 2) }}%
3. I learned of the CC only when I saw this office’s CC. {{ $office->only_i_saw_office_cc1 }} {{ number_format(($office->only_i_saw_office_cc1 / $office->total_responses_cc1) * 100, 2) }}%
4. I do not know what a CC is and I did not see this office’s CC. {{ $office->didnt_see_office_cc1 }} {{ number_format(($office->didnt_see_office_cc1 / $office->total_responses_cc1) * 100, 2) }}%
5. N/A {{ $office->na_cc1 }} {{ number_format(($office->na_cc1 / $office->total_responses_cc1) * 100, 2) }}%
CC2. If aware of CC, would you say that the CC of this office was…?
1. Easy to see {{ $office->easy_to_see_cc2 }} {{ number_format(($office->easy_to_see_cc2 / $office->total_responses_cc1) * 100, 2) }}%
2. Somewhat easy to see {{ $office->somewhat_easy_to_see_cc2 }} {{ number_format(($office->somewhat_easy_to_see_cc2 / $office->total_responses_cc1) * 100, 2) }}%
3. Difficult to see {{ $office->difficult_to_see_cc2 }} {{ number_format(($office->difficult_to_see_cc2 / $office->total_responses_cc1) * 100, 2) }}%
4. Not visible {{ $office->not_visible_cc2 }} {{ number_format(($office->not_visible_cc2 / $office->total_responses_cc1) * 100, 2) }}%
5. N/A {{ $office->na_cc2 }} {{ number_format(($office->na_cc2 / $office->total_responses_cc1) * 100, 2) }}%
CC3. How would you rate the helpfulness of the CC?
1. Helped very much {{ $office->na_cc3 }} {{ number_format(($office->na_cc3 / $office->total_responses_cc1) * 100, 2) }}%
2. Somewhat helped {{ $office->did_not_help_cc3 }} {{ number_format(($office->did_not_help_cc3 / $office->total_responses_cc1) * 100, 2) }}%
3. Did not help {{ $office->somewhat_help_cc3 }} {{ number_format(($office->somewhat_help_cc3 / $office->total_responses_cc1) * 100, 2) }}%
4. N/A {{ $office->helped_very_much_cc3 }} {{ number_format(($office->helped_very_much_cc3 / $office->total_responses_cc1) * 100, 2) }}%
@endforeach
@foreach($demograpic as $office)
Age {{ $office->office_name }}
@if(!empty($startDate[$office->office_id]) && !empty($endDate[$office->office_id]))

Date Range: {{ date('F j, Y', strtotime($startDate[$office->office_id])) }} to {{ date('F j, Y', strtotime($endDate[$office->office_id])) }}

@elseif(isset($dateRanges[$office->office_id]))

Date Range: {{ date('F j, Y', strtotime($dateRanges[$office->office_id]->earliest_date)) }} to {{ date('F j, Y', strtotime($dateRanges[$office->office_id]->latest_date)) }}

@else

No data available for this office.

@endif @php $totalResponses = $office->age_19_or_lower + $office->age_20_34 + $office->age_35_49 + $office->age_50_64 + $office->age_65_or_higher + $office->age_did_not_specify; @endphp
Age Range Responses Overall
19 or lower {{ $office->age_19_or_lower }} {{ number_format(($totalResponses > 0) ? ($office->age_19_or_lower / $totalResponses) * 100 : 0, 2) }}%
20-34 {{ $office->age_20_34 }} {{ number_format(($totalResponses > 0) ? ($office->age_20_34 / $totalResponses) * 100 : 0, 2) }}%
35-49 {{ $office->age_35_49 }} {{ number_format(($totalResponses > 0) ? ($office->age_35_49 / $totalResponses) * 100 : 0, 2) }}%
50-64 {{ $office->age_50_64 }} {{ number_format(($totalResponses > 0) ? ($office->age_50_64 / $totalResponses) * 100 : 0, 2) }}%
65 or higher {{ $office->age_65_or_higher }} {{ number_format(($totalResponses > 0) ? ($office->age_65_or_higher / $totalResponses) * 100 : 0, 2) }}%
Did not specify {{ $office->age_did_not_specify }} {{ number_format(($totalResponses > 0) ? ($office->age_did_not_specify / $totalResponses) * 100 : 0, 2) }}%
@endforeach
@foreach($region as $office)
Sex {{ $office->office_name }}
@if(!empty($startDate[$office->office_id]) && !empty($endDate[$office->office_id]))

Date Range: {{ date('F j, Y', strtotime($startDate[$office->office_id])) }} to {{ date('F j, Y', strtotime($endDate[$office->office_id])) }}

@elseif(isset($dateRanges[$office->office_id]))

Date Range: {{ date('F j, Y', strtotime($dateRanges[$office->office_id]->earliest_date)) }} to {{ date('F j, Y', strtotime($dateRanges[$office->office_id]->latest_date)) }}

@else

No data available for this office.

@endif
Regions Responses Overall
Region I {{ $office->regionone }} {{ number_format(($office->regionone / $office->total_responses) * 100, 2) }}%
Region II {{ $office->regiontwo }} {{ number_format(($office->regiontwo / $office->total_responses) * 100, 2) }}%
Region III {{ $office->regionthree }} {{ number_format(($office->regionthree / $office->total_responses) * 100, 2) }}%
Region IV-A {{ $office->regionfour }} {{ number_format(($office->regionfour / $office->total_responses) * 100, 2) }}%
MIMAROPA {{ $office->mimaropa }} {{ number_format(($office->mimaropa / $office->total_responses) * 100, 2) }}%
Region V {{ $office->regionfive }} {{ number_format(($office->regionfive / $office->total_responses) * 100, 2) }}%
Region VI {{ $office->regionsix }} {{ number_format(($office->regionsix / $office->total_responses) * 100, 2) }}%
Region VII {{ $office->regionseven }} {{ number_format(($office->regionseven / $office->total_responses) * 100, 2) }}%
Region VIII {{ $office->regioneight }} {{ number_format(($office->regioneight / $office->total_responses) * 100, 2) }}%
Region IX {{ $office->regionnine }} {{ number_format(($office->regionnine / $office->total_responses) * 100, 2) }}%
Region X {{ $office->regionten }} {{ number_format(($office->regionten / $office->total_responses) * 100, 2) }}%
Region XI {{ $office->regioneleven }} {{ number_format(($office->regioneleven / $office->total_responses) * 100, 2) }}%
Region XII {{ $office->regiontwelve }} {{ number_format(($office->regiontwelve / $office->total_responses) * 100, 2) }}%
Region XIII {{ $office->regiontirten }} {{ number_format(($office->regiontirten / $office->total_responses) * 100, 2) }}%
NCR {{ $office->ncr }} {{ number_format(($office->ncr / $office->total_responses) * 100, 2) }}%
CAR {{ $office->car }} {{ number_format(($office->car / $office->total_responses) * 100, 2) }}%
BARMM {{ $office->barmm }} {{ number_format(($office->barmm / $office->total_responses) * 100, 2) }}%
@endforeach
@foreach($type as $office)
Region {{ $office->office_name }}
@if(!empty($startDate[$office->office_id]) && !empty($endDate[$office->office_id]))

Date Range: {{ date('F j, Y', strtotime($startDate[$office->office_id])) }} to {{ date('F j, Y', strtotime($endDate[$office->office_id])) }}

@elseif(isset($dateRanges[$office->office_id]))

Date Range: {{ date('F j, Y', strtotime($dateRanges[$office->office_id]->earliest_date)) }} to {{ date('F j, Y', strtotime($dateRanges[$office->office_id]->latest_date)) }}

@else

No data available for this office.

@endif
Customer Type Responses Overall
Citizen {{ $office->citizen }} {{ number_format(($office->citizen / $office->total_responses) * 100, 2) }}%
Business {{ $office->business }} {{ number_format(($office->business / $office->total_responses) * 100, 2) }}%
Government {{ $office->government }} {{ number_format(($office->government / $office->total_responses) * 100, 2) }}%
@endforeach
@foreach($gender as $office)
Client Type{{ $office->office_name }}
@if(!empty($startDate[$office->office_id]) && !empty($endDate[$office->office_id]))

Date Range: {{ date('F j, Y', strtotime($startDate[$office->office_id])) }} to {{ date('F j, Y', strtotime($endDate[$office->office_id])) }}

@elseif(isset($dateRanges[$office->office_id]))

Date Range: {{ date('F j, Y', strtotime($dateRanges[$office->office_id]->earliest_date)) }} to {{ date('F j, Y', strtotime($dateRanges[$office->office_id]->latest_date)) }}

@else

No data available for this office.

@endif
Gender Responses Overall
Male {{ $office->male }} {{ number_format(($office->male / $office->total_responses) * 100, 2) }}%
Female {{ $office->female }} {{ number_format(($office->female / $office->total_responses) * 100, 2) }}%
@endforeach
@include('updown.footers')