public function index() { $today = Carbon::today(); if ($today->day < 15) { $inicio = $today->firstOfMonth(); $futuro = $inicio->addDays(14); } else { $futuro = $today->lastOfMonth(); } $noticias = Noticia::where('fin', $futuro)->get(); $user = Auth::user(); // ::::::::::: Becarios ::::::::::: $becarios = User::where('rol', 'becario')->get(); $activos = User::where('rol', 'becario')->where('activo', '1')->get(); $mujeres = Becario::where('genero', 'femenino')->get(); $hombres = Becario::where('genero', 'masculino')->get(); $total = count($becarios); $a = count($activos); $m = count($mujeres) * 100 / $a; $h = count($hombres) * 100 / $a; $s = count(Becario::where('area', 'software')->get()) * 100 / $a; $ha = count(Becario::where('area', 'hardware')->get()) * 100 / $a; $d = count(Becario::where('area', 'diseƱo')->get()) * 100 / $a; $so = count(Becario::where('area', 'social')->get()) * 100 / $a; // ::::::::::: Proyectos ::::::::::: $tp = count(Proyecto::all()); $pa = count(Proyecto::whereBetween('progreso', [1, 99])->get()); $pt = count(Proyecto::where('progreso', '100')->get()); return view('Admin/index', compact('user', 'noticias', 'total', 'a', 'm', 'h', 's', 'ha', 'd', 'so', 'tp', 'pa', 'pt')); }
public function mis_proyectos() { $user = Auth::user(); $becario = Becario::where('user_id', $user->id)->first(); return view('Becario/Evaluacion/proyectos', compact('user', 'becario')); }