public function index() { $param['pageNo'] = 10; $user_id = Session::get('user_id'); $param['member'] = Members::find($user_id); return View::make('user.dashboard.dashboard')->with($param); }
public function store() { $rules = ['firstname' => 'required ', 'lastname' => 'required ', 'email' => 'required|unique:member', 'password' => 'required|confirmed', 'password_confirmation' => 'required', 'username' => 'required|unique:member']; $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } else { $memberList = new MembersModel(); $password = Input::get('password'); $memberList->first_name = Input::get('firstname'); $memberList->last_name = Input::get('lastname'); $memberList->email = Input::get('email'); $memberList->password = md5($password); $memberList->username = Input::get('username'); $memberList->remember_token = Input::get('_token'); $memberList->save(); $alert['msg'] = 'User has been saved successfully'; $alert['type'] = 'success'; return Redirect::route('user.login')->with('alert', $alert); } }
public function delete($id) { try { MembersModel::find($id)->delete(); $alert['msg'] = 'This user has been deleted successfully'; $alert['type'] = 'success'; } catch (\Exception $ex) { $alert['msg'] = 'This user focus has been already used'; $alert['type'] = 'danger'; } return Redirect::route('admin.member')->with('alert', $alert); }
public function editCompany($id) { $user_id = Session::get('user_id'); $param['member'] = MembersModel::find($user_id); if ($alert = Session::get('alert')) { $param['alert'] = $alert; } $param['type'] = TypeModel::whereRaw(true)->orderBy('type', 'asc')->get(); $param['people'] = PeopleModel::whereRaw(true)->orderBy('firstName', 'asc')->get(); $param['company'] = CompanyModel::all(); $param['companyItem'] = CompanyModel::find($id); return View::make('user.company.edit')->with($param); }
public function index() { if ($alert = Session::get('alert')) { $param['alert'] = $alert; } $param['pageNo'] = 12; $param['members'] = MembersModel::whereRaw(true)->orderBy('first_name', 'asc')->get(); /****note base*******/ $param['noteType'] = NoteTypeModel::whereRaw(true)->orderBy('notesType', 'asc')->get(); $param['noteCommType'] = NoteCommTypeModel::whereRaw(true)->orderBy('noteCommType', 'asc')->get(); $param['noteAssign'] = NoteAssignModel::whereRaw(true)->orderBy('noteAssign', 'asc')->get(); $param['noteStatus'] = NoteStatusModel::whereRaw(true)->orderBy('notesStatus', 'asc')->get(); $param['noteTypeDetails'] = NoteTypeDetailsModel::whereRaw(true)->orderBy('noteTypeDetails', 'asc')->get(); /****note ***/ $param['note'] = NoteModel::paginate(10); return View::make('admin.note.index')->with($param); }
public function quote($peopleId, $projectId, $quoteId) { if ($alert = Session::get('alert')) { $param['alert'] = $alert; } $param['pageNo'] = 61; $user_id = Session::get('user_id'); $param['member'] = MembersModel::find($user_id); $param['people'] = PeopleModel::find($peopleId); $param['project'] = ProjectModel::find($projectId); $param['quote'] = QuoteModel::whereRaw('projectId = ? ', array($projectId))->get(); $param['members'] = MembersModel::whereRaw(true)->orderBy('first_name', 'asc')->get(); $param['payment'] = PaymentModel::whereRaw(true)->orderBy('payment', 'asc')->get(); $param['quoteItem'] = QuoteModel::find($quoteId); return View::make('admin.contact.quote')->with($param); }
public function noteContact() { $param['pageNo'] = 6; $user_id = Session::get('user_id'); $param['member'] = MembersModel::find($user_id); $param['noteType'] = NoteTypeModel::whereRaw(true)->orderBy('notesType', 'asc')->get(); $param['noteCommType'] = NoteCommTypeModel::whereRaw(true)->orderBy('noteCommType', 'asc')->get(); $param['noteAssign'] = NoteAssignModel::whereRaw(true)->orderBy('noteAssign', 'asc')->get(); $param['noteStatus'] = NoteStatusModel::whereRaw(true)->orderBy('notesStatus', 'asc')->get(); $param['noteTypeDetails'] = NoteTypeDetailsModel::whereRaw(true)->orderBy('noteTypeDetails', 'asc')->get(); $param['members'] = MembersModel::whereRaw(true)->orderBy('first_name', 'asc')->get(); return View::make('user.contact.note')->with($param); }