/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $departments = Department::lists('name', 'name'); $rooms = Room::lists('name', 'name'); $days = array('Saturday' => 'Saturday', 'Sunday' => 'Sunday', 'Monday' => 'Monday', 'Tuesday' => 'Tuesday', 'Wednesday' => 'Wednesday', 'Thursday' => 'Thursday', 'Friday' => 'Friday'); return view('layouts.allocateClassroom', ['departments' => $departments, 'overlap' => null, 'rooms' => $rooms, 'days' => $days]); }
/** * User chose single employee from dropdown to be edited * * @param Request $request * @return mixed */ public function doChooseEmployee(Request $request) { $employee = Employee::find($request->input('choose')); $dept = ['' => 'Choose...'] + Department::lists('name', 'id')->all(); $location = ['' => 'Choose...'] + Location::lists('name', 'id')->all(); return view('admin.edit-employee', compact('dept', 'location', 'employee')); }
public function show($id) { $user = User::find($id); $sections = Section::lists('name', 'id'); $departments = Department::lists('name', 'id'); $subjects = $user->type == 'student' ? $user->studentSubjects : $user->teacherSubjects; return view('admin.user.show', compact('user', 'sections', 'subjects', 'departments')); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $departments = Department::lists('name', 'code'); //Get the names of departments $semesters = Semester::lists('name', 'id'); //Get the names of semesters return view('layouts.saveCourse', ['departments' => $departments, 'semesters' => $semesters]); }
public function getRegister() { if (!Entrust::can('create_user')) { return redirect('/dashboard')->withErrors(config('constants.NA')); } $departments = Department::lists('department_name', 'id')->all(); if (Entrust::hasRole('admin')) { $roles = Role::lists('name', 'id')->all(); } else { $roles = Role::where('name', '!=', 'admin')->lists('name', 'id')->all(); } return view('user.create', compact('departments', 'roles')); }
public function create(Request $request) { $newBusinessPlan = new BusinessPlan(); $newBusinessPlan->start = date($request['sYear'] . '-01-01 00:00:00'); $newBusinessPlan->end = date($request['eYear'] . '-12-31 00:00:00'); $newBusinessPlan->save(); foreach (array_keys($request['data']) as $idx) { $key = array_keys($request['data'][$idx])[0]; $newGoal = new Goat(); $newGoal->type = 'G'; $newGoal->parent_id = null; $newGoal->description = $key; $newGoal->priority = 0; $newGoal->complete = false; $newGoal->goal_type = 'B'; $newGoal->due_date = null; $newGoal->budget = 0; $newGoal->bid = $newBusinessPlan->id; $newGoal->save(); foreach ($request['data'][$idx][$key] as $obj) { $newObj = new Goat(); $newObj->type = 'O'; $newObj->parent_id = $newGoal->id; $newObj->description = $obj; $newObj->priority = 0; $newObj->complete = false; $newObj->goal_type = 'B'; $newObj->due_date = null; $newObj->budget = 0; $newObj->bid = $newBusinessPlan->id; $newObj->save(); } } foreach (Department::lists('name') as $dept_name) { $newGoal = new Goat(); $newGoal->type = 'G'; $newGoal->parent_id = null; $newGoal->description = $dept_name . " Goals"; $newGoal->priority = 0; $newGoal->complete = false; $newGoal->goal_type = 'D'; $newGoal->due_date = null; $newGoal->budget = 0; $newGoal->bid = $newBusinessPlan->id; $newGoal->save(); } return response()->json([], 200); }
/** * Show the application calendar. * * @return \Illuminate\Http\Response */ public function profile() { $roles = \App\Role::lists('name', 'id'); $departments = \App\Department::lists('name', 'id'); return view('dashboard.profile', compact('departments', 'roles')); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $departments = Department::lists('name', 'name'); $designations = Designation::lists('name', 'name'); return view('layouts.saveTeacher', ['departments' => $departments, 'designations' => $designations]); }
public function subjectRegistration() { $subjects = Subject::all(); $departments = Department::lists('name', 'id'); return view('admin.subject.register', compact('subjects', 'departments')); }
public function edit(User $user) { if (!Entrust::can('edit_user')) { return redirect('/dashboard')->withErrors(config('constants.NA')); } if (!Helper::getMode()) { return redirect()->back()->withErrors(config('constants.DISABLE_MESSAGE')); } foreach ($user->roles as $role) { $role_id = $role->id; } $departments = Department::lists('department_name', 'id')->all(); $roles = Role::lists('display_name', 'id')->all(); $custom_field_values = Helper::getCustomFieldValues($this->form, $user->id); return view('user.edit', compact('user', 'departments', 'roles', 'role_id', 'custom_field_values')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $estimate = Estimate::findOrFail($id); $vehicles = Vehicle::lists('reg_no', 'id')->all(); $customer_list = Customer::lists('name', 'id')->all(); $departments = Department::lists('name', 'id'); $items = Item::lists('name', 'id')->all(); $estimate_details = DB::table('estimate_details')->where('estimate_id', '=', $id)->get(); return view('estimates.edit', compact('estimate', 'vehicles', 'estimate_details', 'customer_list', 'departments', 'items')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { // $post = Post::findOrFail($id); //Populate the select(dropdowns) //$department_options = Department::lists('name', 'id'); //$department_id = $post->department_id; $department_options = Department::lists('name', 'id'); $department_selected = $post->departments->lists('id'); //$project_options = Project::lists('name', 'id'); //$project_id = $post->project_id; $source_options = Source::lists('name', 'id'); $source_selected = $post->sources->lists('id'); $staff_options = Staff::select('Id', DB::raw('CONCAT(first_name, " ", last_name) AS full_name'))->orderBy('first_name')->lists('full_name', 'Id'); $staff_selected = $post->staffs->lists('id'); // Show the page return view('posts.forms.edit', compact('post', 'department_options', 'department_selected', 'source_options', 'source_selected', 'staff_options', 'staff_selected')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { // $authuser = Auth::user(); $user = User::findOrFail($id); $depts = Department::lists('name', 'department_id'); return view('superadmin.edit_user', array('authuser' => $authuser, 'user' => $user, 'depts' => $depts)); }
public function edit($id) { $subject = Subject::find($id); $departments = Department::lists('name', 'id'); return view('admin.subject.edit', compact('subject', 'departments')); }
/** * Create a new user controller instance. * * @return void */ public function __construct() { $this->priviledge_user(); $this->_user_roles = Role::lists('name', 'id'); $this->_user_departments = Department::lists('name', 'id'); }
public function createTicket() { if (!Entrust::can('create_ticket')) { return redirect('/dashboard')->withErrors(config('constants.NA')); } $departments = Department::lists('department_name', 'id')->all(); $ticket_types = TicketType::lists('ticket_type_name', 'id')->all(); $tickets = Ticket::where('user_id', '=', Auth::user()->id)->get(); $assets = ['hide_sidebar']; return view('ticket.create-ticket', compact('departments', 'ticket_types', 'assets', 'tickets')); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $user = User::find($id); $user->first_name = $request->input("first_name"); $user->last_name = $request->input("last_name"); $user->username = $request->input("username"); $user->password = $request->password ? bcrypt($request->input("password")) : $user->password; $user->email = $request->input("email"); $permissions = array(); foreach (Department::lists('id') as $dept_id) { $perm = $request->input($dept_id); if ($perm) { $permissions[$dept_id] = ['permission_level' => $perm]; } } $user->save(); $user->departments()->sync($permissions); return redirect('admin/users'); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $departments = Department::lists('name', 'code'); //Get the names of departments return view('layouts.registerStudent', ['departments' => $departments]); }