public function show_announce($id) { $post_comment = AnnouncementComments::where('post_id', $id)->orderBy('created_at', 'desc')->get(); $leavecount = LeaveCounter::where('employee_id', Auth::user()->employee_id)->first(); $announce = Announcements::with('user')->where('post_id', $id)->orderBy('created_at', 'desc')->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(); return View::make('dashboard.announcement')->with('post', $announce)->with('post_comment', $post_comment)->with('profile', $profile)->with('countleave', $leavecount)->with('rleave', $recentleave)->with('sleave', $recentwleave)->with('title', 'STI | Show Announcement'); }
/** * 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 save_options($id) { LeaveWOPay::with('user')->where('leave_id', $id)->update(array('status' => Input::get('status'))); $approve = LeaveWOPay::with('user')->where('leave_id', $id)->first(); $adminlog = new AdminLogWOP(); $adminlog->employee_id = Input::get('employee_id'); $adminlog->leave_id = Input::get('leave_id'); $adminlog->days_of_leave = $approve->days_of_leave; $adminlog->wdays_of_leave = $approve->wdays_of_leave; $adminlog->date_from = $approve->date_from; $adminlog->time_from = $approve->time_from; $adminlog->date_to = $approve->date_to; $adminlog->time_to = $approve->time_to; $adminlog->reason = $approve->reason; $adminlog->message = Input::get('message'); $adminlog->status = Input::get('status'); $adminlog->save(); $userlog = new UserLeaveLog(); $userlog->employee_id = Input::get('employee_id'); $userlog->leave_id = Input::get('leave_id'); $userlog->type_of_leave = 'Leave without pay'; $userlog->days_of_leave = $approve->days_of_leave; $userlog->wdays_of_leave = $approve->wdays_of_leave; $userlog->date_from = $approve->date_from; $userlog->time_from = $approve->time_from; $userlog->date_to = $approve->date_to; $userlog->time_to = $approve->time_to; $userlog->company = ''; $userlog->address = ''; $userlog->reason = $approve->reason; $userlog->status = Input::get('status'); $userlog->save(); $approve = new Approval(); $approve->employee_id = Auth::user()->employee_id; $approve->leave_id = Input::get('leave_id'); $approve->type_of_leave = 'Leave without pay'; $approve->message = Input::get('message'); $approve->status = Input::get('status'); $approve->save(); return Redirect::route('leavewopay'); }
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 /leavewopay/{id} * * @param int $id * @return Response */ public function destroy($id) { // LeaveWOPay::where('leave_id', $id)->delete(); return Redirect::route('dash'); }