public function dashboard() { $prospeks = Prospek::all(); $projects = Project::all(); $pelatihans = Pelatihan::all(); $rpds = Rpd::mine()->where('status', 'BACK TO INITIATOR')->orWhere('status', 'SUBMIT')->orderBy('kode')->paginate(10); $users = Pegawai::all(); $lpds = Lpd::mine()->where('status', 'BACK TO INITIATOR')->orWhere('status', 'SUBMIT')->orWhere('status', 'TAKE PAYMENT')->where('status', 'BACK TO INITIATOR')->orWhere('status', 'PROCESS PAYMENT')->orderBy('kode')->paginate(10); return view('dashboard', compact('prospeks', 'projects', 'pelatihans', 'rpds', 'users', 'lpds')); }
/** * Remove the specified resource from storage. * * @param App\Prospek $prospek * @return Response */ public function destroy(Prospek $prospek) { $prospek->delete(); return redirect('/prospek')->with('success', 'Sukses menghapus prospek ' . $prospek->nama_prospek . '.'); }
public function editRpd(Rpd $rpd) { $user = Auth::user(); if ($user->role == 'administration') { if ($rpd->status != 'SUBMIT' && $rpd->nik != $user->nik) { return redirect('/rpd/submitted')->with('error', 'Anda tidak dapat melakukan edit terhadap RPD tersebut.'); } } else { if ($rpd->status == 'SUBMIT' || $rpd->nik != $user->nik) { return redirect('/rpd/submitted')->with('error', 'Anda tidak dapat melakukan edit terhadap RPD tersebut.'); } } $list_pegawai = Pegawai::orderBy('nama_lengkap', 'asc')->lists('nama_lengkap', 'nik'); $list_kota = Kota::orderBy('nama_kota', 'asc')->lists('nama_kota', 'kode'); $list_project = Project::orderBy('nama_project')->select('nama_project', 'nama_lembaga', 'kode')->get(); $list_prospek = Prospek::orderBy('nama_prospek')->select('nama_prospek', 'nama_lembaga', 'kode')->get(); $list_pelatihan = Pelatihan::orderBy('nama_pelatihan')->select('nama_pelatihan', 'nama_lembaga', 'kode')->get(); $list_transportasi = Transportasi::orderBy('nama_transportasi', 'asc')->get()->all(); $list_penginapan = Penginapan::orderBy('nama_penginapan')->lists('nama_penginapan', 'id'); return view('rpd.edit', compact('rpd', 'list_pegawai', 'list_kota', 'list_project', 'list_prospek', 'list_pelatihan', 'list_transportasi', 'list_penginapan')); }
public function prospek() { $prospek = Prospek::all(); return $prospek->toJson(); }