app/Http/Controllers/koordinatorController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index($x)
    {   
        $k = koordinator::find($x);
        $r = $k->wilayah;
        $wil = wilayah::all()->where('id', $r);
        $get = sapi::all()->where('wilayah', $r);
        $jumlah = $get->count();
        $betina = $get->where('jenis_kelamin',0)->count();
        $jantan = $get->where('jenis_kelamin',1)->count();
        $orang = anggotaadm::all()->where('wilayah', $r);
        $total = $orang->count();
        return view('koordinator.index', compact('k','wil','total', 'jumlah', 'betina', 'jantan'));    
    }
public function index ( $ x ) { $ k = koordinator :: find ( $ x ) ; $ r = $ k -> wilayah ; $ wil = wilayah :: all ( ) -> where ( 'id' , $ r ) ; $ get = sapi :: all ( ) -> where ( 'wilayah' , $ r ) ; $ jumlah = $ get -> count ( ) ; $ betina = $ get -> where ( 'jenis_kelamin' , 0 ) -> count ( ) ; $ jantan = $ get -> where ( 'jenis_kelamin' , 1 ) -> count ( ) ; $ orang = anggotaadm :: all ( ) -> where ( 'wilayah' , $ r ) ; $ total = $ orang -> count ( ) ; return view ( 'koordinator.index' , compact ( 'k' , 'wil' , 'total' , 'jumlah' , 'betina' , 'jantan' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .
// var_dump($jantan) or die;