@extends('layouts.home_layout') @php $pageTitle = "Improve practices used for fattening (individual farmer)"; @endphp @section('title', $pageTitle) @section('style') @endsection @section('content') @php // dd($list); @endphp

{{$pageTitle}}

@if (sizeof($list) > 0) @include('common.print_css') @php $fullColspan = 10; $partner_id = request()->get('partner_id'); $cooperative_id = request()->get('cooperative_id'); $group_id = request()->get('group_id'); $farmer_id = request()->get('farmer_id'); $animal_type_id = request()->get('animal_type_id'); $cattle_gender_id = request()->get('cattle_gender_id'); $livestock_breed_id = request()->get('cattle_gender_id'); $division_id = request()->get('division_id'); $district_id = request()->get('district_id'); $upazilla_id = request()->get('upazilla_id'); $union_id = request()->get('union_id'); $village_id = request()->get('village_id'); $firstColspan = 3; $lastColspan = ($fullColspan - $firstColspan); @endphp @if ($reportInfo['partners']) @endif @if ($reportInfo['cooperative']) @endif @if ($reportInfo['group']) @endif @if ($reportInfo['farmer']) @endif @if ($reportInfo['animal_type']) @endif @if ($reportInfo['livestock_breed']) @endif @if ($reportInfo['cattle_gender']) @endif @if ($reportInfo['division']) @endif @if ($reportInfo['district']) @endif @if ($reportInfo['upazilla']) @endif @if ($reportInfo['union']) @endif @if ($reportInfo['village']) @endif @php $i = 1; $j = 1; // $totalRows = sizeof($list); // $lastKey = ($totalRows - 1); $list_ = json_decode($list); $dv_data = json_decode($dewormedVaccinatedData); $antibiotics = json_decode($antibiotics); $totalSameRows = 0; $totalPrintRows = 0; @endphp @foreach ($list as $key => $v) @php $cattleNo = $v->id_prefix ? $v->id_prefix.' - ' : ''; $cattleNo .= $v->cattle_id_no; @endphp @if ($j==1) @php $cattle_arr = array_values(array_filter($list_, function($l) use($v) { return $l->cattle_id == $v->cattle_id; })); $dv_arr = array_values(array_filter($dv_data, function($dv) use($v) { return $dv->cattle_id == $v->cattle_id; })); $tment_arr = array_values(array_filter($antibiotics, function($tment) use($v) { return $tment->cattle_id == $v->cattle_id; })); @endphp @if ($cattle_arr) @php $totalSameRows = sizeof($cattle_arr); $totalPrintRows += 1; $cattle_d_data = 'No'; $cattle_v_data = 'No'; $cattle_t_data = 'No'; if($dv_arr) { if($dv_arr[0]->deworming_data != 0) { $cattle_d_data = 'Yes'; } } elseif($v->deworming_status == 2) { $cattle_d_data = 'Yes'; } if($dv_arr) { if($dv_arr[0]->deworming_data != 0) { $cattle_v_data = 'Yes'; } } elseif($v->deworming_status == 2) { $cattle_v_data = 'Yes'; } if($dv_arr) { if($dv_arr[0]->treatment_data != 0) { $cattle_t_data = 'Yes'; } } $used_med = ''; @endphp @endif {{-- @if ($cattle_arr) --}} @else {{-- @if ($j==1) --}} @php $totalPrintRows += 1; @endphp @endif {{-- @if ($j==1) --}} @php if($totalPrintRows == $totalSameRows) { $j = 1; } @endphp @endforeach

{{$pageTitle}}

Partner Name {{$reportInfo['partners']->partner_name_en}} {{$reportInfo['partners']->partner_code ? "[{$reportInfo['partners']->partner_code}]" : ''}}
Cooperative Name {{$reportInfo['cooperative']->cp_name_en}} {{$reportInfo['cooperative']->cp_code ? "[{$reportInfo['cooperative']->cp_code}]" : ''}}
Farmer Group Name {{$reportInfo['group']->group_name_en}} {{$reportInfo['group']->group_code ? "[{$reportInfo['group']->group_code}]" : ''}}
Farmer Name {{$reportInfo['farmer']->farmer_name_en}} {{$reportInfo['farmer']->farmer_code ? "[{$reportInfo['farmer']->farmer_code}]" : ''}}
Animal Type Name {{$reportInfo['animal_type']->type_name}}
Livestock Breed Name {{$reportInfo['livestock_breed']->breed_name_en}}
Cattle Gender {{$reportInfo['cattle_gender']->gender_name}}
Division Name {{$reportInfo['division']->name}}
District Name {{$reportInfo['district']->name}}
Upazila Name {{$reportInfo['upazilla']->name}}
Union Name {{$reportInfo['union']->name}}
Village Name {{$reportInfo['village']->en_name}}
Reporting Date {{date('d-M-Y')}}
# Animal ID {!!str_repeat(" ", 10)!!}Breed Name{!!str_repeat(" ", 10)!!} Number of Teeth Dewormed Vaccinated Medicine Used for Treatment Used Antibiotic # Feed Used for Cattle Rearing
{{$i++}} {{$cattleNo}} {{$v->breed_name_en}} {{($v->cattle_teeth == 0) ? 'N/A' : $v->cattle_teeth}} {{$cattle_d_data}} {{$cattle_v_data}} {{$cattle_t_data}} @if ($tment_arr) @foreach ($tment_arr as $med) @php $used_med = $med->medicine_id. ' (Withdrawal date is '; $used_med .= date('d-M-Y', strtotime($med->treatment_date.' +'.$med->withdrawal_days.' days')).'), '; @endphp @endforeach @endif {{$used_med}} {{$j++}} {{$v->feed_name_en}}
{{$j++}} {{$v->feed_name_en}}
@endif
{{-- Modal Start id="modal" --}} {{-- Modal End --}}
@endsection @section('script') @endsection