@php $enroll_no = ""; $sn = 0; foreach($allDepartment as $ac){ $name = ""; $from_dt = ""; $district = ""; $tehsil = ""; $to_dt = ""; @endphp @php } @endphp
S.No. Department Name
{{ ++$sn; }} {{ $ac->deptname }} @php $asql = DB::table('cishc_standing_council_adv as csca') ->join('bci_advocate as ba', function ($join) { $join->on('ba.enrolment_number', '=', DB::raw('csca.enroll_no')) ->where(DB::raw("DATE_PART('year', ba.enrolment_date)"), '=', DB::raw('csca.enroll_yr')) ->where('ba.org_id', '=', 3); }) ->join('bci_users as bu', function ($join) { $join->on('ba.id', '=', 'bu.advocate_id') ->where('ba.org_id', '=', 3); }) ->where('csca.stn_cnl_id', '=', $ac->id) ->where('csca.display', '=', 'Y') ->where(function ($query) use ($date) { $query->where('csca.to_date', '>=', $date) ->orWhereNull('csca.to_date'); }) ->select(DB::raw("CONCAT(csca.enroll_no, '/', csca.enroll_yr) as enroll_no"), 'bu.user_name', 'csca.id', 'csca.from_date', 'csca.to_date') ->get(); if(count($asql) > 0){ @endphp @php foreach($asql as $aa){ $name .= $aa->enroll_no." - ".$aa->user_name."
"; $from_dt .= date("d-m-Y",strtotime($aa->from_date))."
"; if($aa->to_date != null) $to_dt = date("d-m-Y",strtotime($aa->to_date)); else $to_dt = ""; @endphp @php } @endphp
Enroll No Name Region From Date To Date
{{ $aa->enroll_no }} {{ $aa->user_name }} @php $result = DB::table('cishc_standing_council_region as cscr') ->leftJoin('master_district as md', 'md.district_code', '=', 'cscr.district') ->leftJoin('master_sub_district as msd', function ($join) { $join->on('msd.subdistrict_code', '=', 'cscr.tehsil') ->where('msd.district_code', '=', DB::raw('md.district_code')); }) ->where('cscr.stn_cnl_adv_id', '=', $aa->id) ->where('cscr.display', '=', 'Y') ->select('md.district_name_english', 'msd.subdistrict_name_english') ->get(); if(count($result) > 0){ @endphp @php foreach($result as $res){ if($res->subdistrict_name_english != "" && $res->subdistrict_name_english != null){ $subdis = " - ".$res->subdistrict_name_english; }else $subdis = ""; @endphp @php } @endphp
{{ $res->district_name_english."".$subdis }}
@php } @endphp
{{ date("d-m-Y",strtotime($aa->from_date)) }} {{ $to_dt }}
@php } @endphp