/** * @param $id * @return \Illuminate\View\View */ public function getEdit($id) { $countrySelect = Country::lists('country_name', 'id'); $user = User::findOrFail($id); return view('admin.edit', compact('user', 'countrySelect')); }
public function projectedit(ProjectRepository $project_repo) { $categories = Category::lists('name', 'id'); $genres = Genre::lists('name', 'id'); $g_countries = Country::lists('countryName', 'countryID'); $step_value = Session::get('editfstep'); $edit_id = Session::has('editfs_id') ? Session::get('editfs_id') : ''; $statArr = array('' => " -- Select -- "); $countries = array_merge($statArr, $g_countries); if (isset($edit_id)) { $projectdet = Project::where('id', $edit_id)->first(); } else { $projectdet = array(); } $gountryId = $projectdet['country_id']; $citylist = $this->project_repo->getcitylist($gountryId); $datan = array(); foreach ($citylist as $cityval) { $id = $cityval['cityID']; $name = $cityval['cityName']; $datan[$id] = $name; } $rewardlist = $this->project_repo->getrewarddata($edit_id); if ($step_value == 1) { return view('project.startaproject-edit', ['last_insert_id' => $edit_id, 'categories' => $categories, 'genres' => $genres, 'projectdet' => $projectdet, '_menus' => $this->menuItems, 'login_url' => $this->login_url]); } elseif ($step_value == 2) { return view('project.startaproject-step2-edit', ['last_insert_id' => $edit_id, 'countries' => $countries, 'projectdet' => $projectdet, 'citylist' => $datan, '_menus' => $this->menuItems, 'login_url' => $this->login_url]); } elseif ($step_value == 3) { $prewordstat = $this->project_repo->projectrewordd($edit_id); if ($prewordstat > 0) { $rview = 'project.startaproject-step3-edit'; } else { $rview = 'project.startaproject-step3'; } return view($rview, ['rewardlist' => $rewardlist, 'last_insert_id' => $edit_id, 'projectdet' => $projectdet, '_menus' => $this->menuItems, 'login_url' => $this->login_url]); } elseif ($step_value == 4) { return view('project.project.create-step4', ['last_insert_id' => $edit_id, '_menus' => $this->menuItems, 'login_url' => $this->login_url]); } elseif ($step_value == 5) { return view('project.startaproject-confirmation', ['last_insert_id' => $edit_id, 'projectdet' => $projectdet, '_menus' => $this->menuItems, 'login_url' => $this->login_url]); } else { return view('project.project.editproject', ['last_insert_id' => $edit_id, '_menus' => $this->menuItems, 'login_url' => $this->login_url]); } }
public function getEditproject(ProjectRepository $project_repo) { $users = User::lists('name', 'id'); $categories = Category::lists('name', 'id'); $genres = Genre::lists('name', 'id'); $g_countries = Country::lists('countryName', 'countryID'); $step_value = Session::get('editstep'); $edit_id = Session::has('edit_id') ? Session::get('edit_id') : ''; $statArr = array('' => " -- Select -- "); $countries = array_merge($statArr, $g_countries); if (isset($edit_id)) { $projectdet = Project::where('id', $edit_id)->first(); } else { $projectdet = array(); } $gountryId = $projectdet['country_id']; /* $getCitylist = $this->project_repo->getcitylist($gountryId); echo "<pre>"; print_r($getCitylist); exit; $statArr = array( 0 => array( 'cityID' => '', 'cityName' => 'Select City' ) ); $result = array_merge($statArr, $citylist); */ $citylist = $this->project_repo->getcitylist($gountryId); $datan = array(); foreach ($citylist as $cityval) { $id = $cityval['cityID']; $name = $cityval['cityName']; $datan[$id] = $name; } $rewardlist = $this->project_repo->getrewarddata($edit_id); $url = config('medias.url'); $func = "edit"; if ($step_value == 1) { return view('admin.project.editproject', ['func' => $func, 'url' => $url, 'last_insert_id' => $edit_id, 'categories' => $categories, 'genres' => $genres, 'users' => $users, 'projectdet' => $projectdet]); } elseif ($step_value == 2) { return view('admin.project.create-step2-edit', ['func' => $func, 'url' => $url, 'last_insert_id' => $edit_id, 'countries' => $countries, 'projectdet' => $projectdet, 'citylist' => $datan]); } elseif ($step_value == 3) { return view('admin.project.create-step3-edit', ['func' => $func, 'url' => $url, 'rewardlist' => $rewardlist, 'last_insert_id' => $edit_id, 'projectdet' => $projectdet]); } elseif ($step_value == 4) { return view('admin.project.create-step4', ['func' => $func, 'url' => $url, 'last_insert_id' => $edit_id]); } elseif ($step_value == 5) { return view('admin.project.confirmation', ['func' => $func, 'url' => $url, 'last_insert_id' => $edit_id]); } else { return view('admin.project.editproject', ['func' => $func, 'url' => $url, 'last_insert_id' => $edit_id]); } }
public function profile($id = null) { if (!$id) { $id = Company::create()->id; $newed = Company::findOrFail($id); event(new CompanyWasCreated($newed)); return redirect('companies/' . $id . '/profile'); } else { $company = Company::with($this->related)->where('id', $id)->first(); } $countries = Country::lists('country', 'id'); //return $company; return view('companies.profile', compact('company', 'countries')); }
public function aircraft($id) { $aircraft = ProjectAircraft::where('project_id', $id)->first(); $countries = Country::lists('country', 'id'); $mfg = ['Boeing' => 'Boeing', 'Airbus' => 'Airbus']; $provider = ['ADC' => 'ADC', 'Owner' => 'Owner']; return view('projects.aircraft', compact('aircraft', 'countries', 'mfg', 'provider')); }