/** * This function shows user profile */ public function getUserProfile() { if (Session::get('admin') == 'admin') { $user = User::where('username', '=', Session::get('username'))->get()->first(); $userProfile = Admin::find($user->details_id); $userProfile->DOB = DateFormat::show($userProfile->DOB); return View::make('user.profile')->with('userProfile', $userProfile); } if (Session::get('employee') == 'employee') { $user = User::where('username', '=', Session::get('username'))->get()->first(); $userProfile = Employee::find($user->details_id); $userProfile->DOB = DateFormat::show($userProfile->DOB); return View::make('user.profile')->with('userProfile', $userProfile); } if (Session::get('member') == 'member') { $user = User::where('username', '=', Session::get('username'))->get()->first(); $userProfile = Member::find($user->details_id); $userProfile->DOB = DateFormat::show($userProfile->DOB); return View::make('user.profile')->with('userProfile', $userProfile); } }
/** * This function responses to * the get request of /admin/employee/details/{id} * and view employee respect to id */ public function getDetails($id, $msg = null) { $employee = Employee::find($id); $employee->DOB = DateFormat::show($employee->DOB); if (!empty($msg) && $msg == 1) { return View::make('adminArea.employee.details')->with('employee', $employee)->with('orders', Order::orderBy('from', 'desc')->get())->with('success', "Order has been deactivated successfully"); } return View::make('adminArea.employee.details')->with('employee', $employee)->with('orders', Order::orderBy('from', 'desc')->get()); }
/** * This function responses to * the get request of /admin/order/details/{id} * and view order respect to id */ public function getDetails($id, $msg = null) { $order = Order::find($id); $order->from = DateFormat::show($order->from); $order->to = DateFormat::show($order->to); if (!empty($msg) && $msg == 1) { return View::make('adminArea.order.details')->with('order', $order); } return View::make('adminArea.order.details')->with('order', $order); }