Beispiel #1
0
 public function edit($id)
 {
     $anggota = [];
     // $anggota['aktif']
     $profiles = Profile::where('status', 1)->count();
     $active = $profiles;
     // $anggota['inactive']
     $inactive = Inactive::where('updated_at', 'like', Carbon::now()->format('Y') . '%')->where('status', 1)->count();
     // $anggota['keseluruhan']
     $profiles = Profile::all();
     $keseluruhan = $profiles->count();
     $max = 0;
     foreach ($profiles as $profile) {
         $profile->no_anggota = (int) $profile->no_anggota;
         if ($profile->no_anggota != 0 && $profile->no_anggota > $max) {
             $max = $profile->no_anggota;
         }
     }
     $anggota = ['keseluruhan' => $keseluruhan, 'aktif' => $active, 'inactive' => $inactive, 'no_akhir' => $max];
     $profile = Profile::where('no_gaji', $id)->first();
     $status = ['1' => 'AKTIF', '0' => 'TIDAK AKTIF', '2' => 'PENCEN'];
     $zon = Zon::lists('nama', 'kod');
     $jantina = Jantina::lists('nama', 'id');
     return View('members.profile.edit', compact('profile', 'status', 'anggota', 'zon', 'jantina'));
 }