public function dashboard() { $leavecount = LeaveCounter::where('employee_id', Auth::user()->employee_id)->first(); $announce = Announcements::with('user')->orderBy('created_at', 'desc')->get(); $profile = UserDetails::where('employee_id', '=', Auth::user()->employee_id)->first(); $recentleave = LeaveWPay::with('user')->where('employee_id', Auth::user()->employee_id)->orderBy('created_at', 'desc')->get(); $recentwleave = LeaveWOPay::with('user')->where('employee_id', Auth::user()->employee_id)->orderBy('created_at', 'desc')->get(); $obleave = LeaveOB::with('user')->where('employee_id', Auth::user()->employee_id)->orderBy('created_at', 'desc')->get(); $awtleave = LeaveAWT::with('user')->where('employee_id', Auth::user()->employee_id)->orderBy('created_at', 'desc')->get(); return View::make('dashboard.dashboard')->with('announce', $announce)->with('profile', $profile)->with('countleave', $leavecount)->with('rleave', $recentleave)->with('obleave', $obleave)->with('awtleave', $awtleave)->with('sleave', $recentwleave)->with('title', 'STI | Dashboard'); }
/** * Display a listing of the resource. * GET /notification * * @return Response */ public function index() { $leavelog = UserLeaveLog::with('user')->where('employee_id', Auth::user()->employee_id)->orderBy('created_at', 'desc')->get(); $leaveoblog = LeaveOB::with('user')->where('employee_id', Auth::user()->employee_id)->orderBy('created_at', 'desc')->get(); $leavecount = LeaveCounter::where('employee_id', Auth::user()->employee_id)->first(); $profile = UserDetails::where('employee_id', '=', Auth::user()->employee_id)->first(); $recentleave = LeaveWPay::with('user')->where('employee_id', Auth::user()->employee_id)->orderBy('created_at', 'desc')->get(); $recentwleave = LeaveWOPay::with('user')->where('employee_id', Auth::user()->employee_id)->orderBy('created_at', 'desc')->get(); $obleave = LeaveOB::with('user')->where('employee_id', Auth::user()->employee_id)->orderBy('created_at', 'desc')->get(); $awtleave = LeaveAWT::with('user')->where('employee_id', Auth::user()->employee_id)->orderBy('created_at', 'desc')->get(); return View::make('dashboard.notification_box')->with('profile', $profile)->with('leavelog', $leavelog)->with('rleave', $recentleave)->with('sleave', $recentwleave)->with('leaveob', $leaveoblog)->with('leaveawt', $awtleave)->with('countleave', $leavecount)->with('obleave', $obleave)->with('title', 'STI | Notification Box'); }
public function post_delete($id) { $d_login = UserLogin::where('employee_id', $id)->first(); $d_login->delete(); $userlog = UserLeaveLog::where('employee_id', $id)->delete(); LeaveWPay::where('employee_id', $id)->delete(); LeaveWOPay::where('employee_id', $id)->delete(); LeaveCounter::where('employee_id', $id)->delete(); LeaveAWT::where('employee_id', $id)->delete(); LeaveOB::where('employee_id', $id)->delete(); AdminLogWP::where('employee_id', $id)->delete(); AdminLogWOP::where('employee_id', $id)->delete(); AdminLogOB::where('employee_id', $id)->delete(); AdminLogAWT::where('employee_id', $id)->delete(); AnnouncementComments::where('employee_id', $id)->delete(); Approval::where('employee_id', $id)->delete(); $d_user = UserDetails::where('employee_id', $id)->first(); $d_user->delete(); return Redirect::route('view_users'); }
/** * Remove the specified resource from storage. * DELETE /atw/{id} * * @param int $id * @return Response */ public function destroy($id) { // LeaveAWT::where('leave_id', $id)->delete(); return Redirect::route('dash'); }