/** * Run the database seeds. * * @return void */ public function run() { // clear table \App\Education::truncate(); // add 1st row \App\Education::create(['user_id' => 1, 'field' => 'Computer Science', 'degree' => 'Баклавар']); // add 2nd row \App\Education::create(['user_id' => 1, 'degree' => 'Магистр', 'field' => 'Art science']); }
/** * Show Cv information * * @param int $id * @return Response */ public function show($id) { $positions = Position::all(); $employee = Employee::find($id); $educations = Education::where('employee_id', '=', $employee->id)->get(); $employee_skills = EmployeeSkill::where('employee_id', '=', $employee->id)->get(); $experiences = WorkingExperience::where('employee_id', '=', $employee->id)->get(); $taken_projects = TakenProject::where('employee_id', '=', $employee->id)->get(); $nationalities = Nationality::all(); $category_skill = CategorySkill::all(); return view('printpreview.printpreview', compact('taken_projects', 'position', 'employee_skills', 'nationalities', 'employee', 'educations', 'experiences', 'category_skill')); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { // $education = Education::find($id); //return $gender; if (count($education) > 0) { $statusCode = 200; $response = ['id' => $education->id, 'Education' => $education->education]; } else { $response = ["error" => "Education doesn`t exist"]; $statusCode = 404; } return response($response, $statusCode)->header('Content-Type', 'application/json'); }
/** * Show and Export CV information * * @param [int] $id * @return Response */ public function show($id) { $positions = Position::all(); $employee = Employee::find($id); $educations = Education::where('employee_id', '=', $employee->id)->get(); $employee_skills = EmployeeSkill::where('employee_id', '=', $employee->id)->get(); $experiences = WorkingExperience::where('employee_id', '=', $employee->id)->get(); $taken_projects = TakenProject::where('employee_id', '=', $employee->id)->get(); $nationalities = Nationality::all(); $category_skill = CategorySkill::all(); $parameterr = array(); $parameter['employee'] = $employee; $parameter['educations'] = $educations; $parameter['category_skill'] = $category_skill; $parameter['employee_skills'] = $employee_skills; $parameter['taken_projects'] = $taken_projects; $parameter['experiences'] = $experiences; $parameter['nationalities'] = $nationalities; $pdf = \PDF::loadView('welcome', $parameter)->setPaper('a4')->setOrientation('landscape')->setWarnings(false); return $pdf->download('cv.pdf'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $edu = Education::findOrFail($id)->delete(); return Redirect::route('admin.setup.qualification.educations.index')->withFlashSuccess('Education data was successfully deleted.'); }
public function run() { DB::table('education')->delete(); Education::create(['id' => '1', 'education' => 'Basic']); Education::create(['id' => '2', 'education' => 'High School Diploma']); Education::create(['id' => '3', 'education' => 'Bachelor Degree']); Education::create(['id' => '4', 'education' => 'Master Degree']); Education::create(['id' => '5', 'education' => 'Doctoral Degree']); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit() { // $gender = Gender::lists('gender', 'id'); $age = Age::lists('age', 'id'); $occupation = Occupation::lists('occupation', 'id'); $country = Country::orderBy('country')->lists('country', 'id'); //for alphabetic order $education = Education::lists('education', 'id'); //return Auth::User()->profile; return view('user.edit', compact('gender', 'age', 'occupation', 'country', 'education')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $title = 'job'; $skills = Skills::lists('name', 'name'); if (Auth::user()->identifier == 1) { $postjob = Postjob::where('unique_id', '=', $id)->where('individual_id', '=', Auth::user()->induser_id)->first(); $connections = Induser::whereRaw('indusers.id in ( select connections.user_id as id from connections where connections.connection_user_id=? and connections.status=1 union select connections.connection_user_id as id from connections where connections.user_id=? and connections.status=1 )', [Auth::user()->induser_id, Auth::user()->induser_id])->get(['id', 'fname'])->lists('fname', 'id'); $groups = Group::leftjoin('groups_users', 'groups_users.group_id', '=', 'groups.id')->where('groups.admin_id', '=', Auth::user()->induser_id)->orWhere('groups_users.user_id', '=', Auth::user()->induser_id)->groupBy('groups.id')->get(['groups.id as id', 'groups.group_name as name'])->lists('name', 'id'); $education = Education::orderBy('level')->orderBy('name')->get(); $farearoleList = Functional_area_role_mapping::orderBy('id')->get(); return view('pages.postjob_edit', compact('title', 'skills', 'connections', 'groups', 'education', 'farearoleList', 'postjob')); } else { $postjob = Postjob::where('unique_id', '=', $id)->where('corporate_id', '=', Auth::user()->corpuser_id)->first(); $education = Education::all(); $farearoleList = Functional_area_role_mapping::orderBy('id')->get(); return view('pages.postjob_edit', compact('title', 'skills', 'education', 'farearoleList', 'postjob')); } }
public function myPost() { if (Auth::check()) { $title = 'mypost'; if (Auth::user()->identifier == 1) { $posts = Postjob::with('induser', 'postActivity', 'postactivity.user', 'taggedUser', 'taggedGroup')->where('individual_id', '=', Auth::user()->induser_id)->where('inactive', '=', 0)->orderBy('id', 'desc')->get(); $myActivities = DB::select('(select pa.id,pa.user_id,pa.post_id,"Thanks" as identifier,pa.thanks as activity, pa.thanks_dtTime as time,pj.unique_id, pj.post_type, pj.post_title, pj.post_compname from postactivities pa join postjobs pj on pj.id = pa.post_id where pa.user_id=? and pa.thanks = 1) union (select pa.id,pa.user_id,pa.post_id,"Shared" as identifier,pa.share as share, pa.share_dtTime as time,pj.unique_id,pj.post_type, pj.post_title, pj.post_compname from postactivities pa join postjobs pj on pj.id = pa.post_id where pa.user_id=? and pa.share = 1) union (select pa.id,pa.user_id,pa.post_id,"Applied" as identifier,pa.apply as activity, pa.apply_dtTime as time,pj.unique_id, pj.post_type, pj.post_title, pj.post_compname from postactivities pa join postjobs pj on pj.id = pa.post_id where pa.user_id=? and pa.apply = 1) union (select pa.id,pa.user_id,pa.post_id,"Contacted" as identifier,pa.contact_view as activity,pa.contact_view_dtTime as time,pj.unique_id, pj.post_type, pj.post_title, pj.post_compname from postactivities pa join postjobs pj on pj.id = pa.post_id where pa.user_id=? and pa.contact_view = 1) order by time desc', [Auth::user()->id, Auth::user()->id, Auth::user()->id, Auth::user()->id]); $myActivities = collect($myActivities); if (Auth::user()->identifier == 1) { $share_links = Induser::whereRaw('indusers.id in ( select connections.user_id as id from connections where connections.connection_user_id=? and connections.status=1 union select connections.connection_user_id as id from connections where connections.user_id=? and connections.status=1 )', [Auth::user()->induser_id, Auth::user()->induser_id])->get(['id', 'fname'])->lists('fname', 'id'); $share_groups = Group::leftjoin('groups_users', 'groups_users.group_id', '=', 'groups.id')->where('groups.admin_id', '=', Auth::user()->induser_id)->orWhere('groups_users.user_id', '=', Auth::user()->induser_id)->groupBy('groups.id')->get(['groups.id as id', 'groups.group_name as name'])->lists('name', 'id'); } $user = User::where('id', '=', Auth::user()->id)->with('induser')->first(); $skills = Skills::lists('name', 'name'); $thanks = Postactivity::with('user', 'post')->join('postjobs', 'postjobs.id', '=', 'postactivities.post_id')->where('postjobs.individual_id', '=', Auth::user()->induser_id)->where('postjobs.inactive', '=', 0)->where('postactivities.thanks', '=', 1)->orderBy('postactivities.id', 'desc')->sum('postactivities.thanks'); $linksCount = Connections::where('user_id', '=', Auth::user()->induser_id)->where('status', '=', 1)->orWhere('connection_user_id', '=', Auth::user()->induser_id)->where('status', '=', 1)->count('id'); $educationList = Education::orderBy('level')->orderBy('name')->where('name', '!=', '0')->get(); $location = Induser::where('id', '=', Auth::user()->induser_id)->first(['prefered_location']); $farearoleList = Functional_area_role_mapping::orderBy('id')->get(); // return $myActivities; } else { if (Auth::user()->identifier == 2) { $posts = Postjob::with('corpuser')->where('corporate_id', '=', Auth::user()->corpuser_id)->orderBy('id', 'desc')->get(); $user = User::where('id', '=', Auth::user()->id)->with('corpuser')->first(); $thanks = Postactivity::with('user', 'post')->join('postjobs', 'postjobs.id', '=', 'postactivities.post_id')->where('postjobs.corporate_id', '=', Auth::user()->corpuser_id)->where('postactivities.thanks', '=', 1)->orderBy('postactivities.id', 'desc')->sum('postactivities.thanks'); } } return view('pages.mypostcontent', compact('posts', 'title', 'myActivities', 'user', 'share_links', 'share_groups', 'skills', 'educationList', 'location', 'farearoleList', 'thanks', 'linksCount')); } else { return redirect('login'); } }
public function createUserRequest(Request $request) { $skills = Skills::lists('name', 'name'); $educationList = Education::orderBy('level')->orderBy('name')->where('name', '!=', '0')->get(); $farearoleList = Functional_area_role_mapping::orderBy('id')->get(); $indUser = new Induser(); $indUser->fname = $request['fname']; $indUser->lname = $request['lname']; $indUser->gender = $request['gender']; $indUser->city = $request['city']; $indUser->about_individual = $request['about_individual']; $indUser->education = $request['education']; $indUser->experience = $request['experience']; $indUser->working_status = $request['working_status']; $indUser->working_at = $request['working_at']; $indUser->industry = $request['industry']; if ($request['role'] != null) { $farea_role = $request['role']; $temp = explode('-', $farea_role); $indUser->functional_area = $temp[0]; $indUser->role = $temp[1]; } if ($request['linked_skill_id'] != null) { $indUser->linked_skill = implode(', ', $request['linked_skill_id']); } if ($request['prefered_location'] != null) { $indUser->prefered_location = implode(', ', $request['prefered_location']); } $indUser->email = $request['email']; $indUser->mobile = $request['mobile']; $indUser->prefered_jobtype = $request['prefered_jobtype']; $indUser->save(); $user = new User(); $user->name = $request['fname'] . ' ' . $request['lname']; $user->email = $request['email']; $user->mobile = $request['mobile']; $user->password = md5(rand(111111, 999999)); $user->identifier = 1; if ($request['email'] != null) { $vcode = 'A' . rand(1111, 9999); $user->email_vcode = $vcode; } if ($request['mobile'] != null) { $otp = rand(1111, 9999); $user->mobile_otp = $otp; } $resetCode = md5(rand(11111, 99999)); $user->reset_code = $resetCode; $indUser->user()->save($user); $email = $request['email']; if ($request['email'] != null) { $email = $request['email']; $fname = $request['fname']; Mail::send('emails.auth.resetpassword', array('fname' => $fname, 'token' => $resetCode), function ($message) use($email, $fname) { $message->to($email, $fname)->subject('Jobtip - Profile Created!')->from('*****@*****.**', 'JobTip'); }); } return view('pages.create_users', compact('skills', 'educationList', 'farearoleList'))->withErrors(['errors' => 'Profile Created Successfully.']); }
/** * Store a newly profile * * @param [int] $id * @return Response */ public function store(AddEditEmployeeRequest $request) { $positions = Position::all(); $employee = Auth::user()->employee()->get()->first(); $img = Request::get('imageup'); $requestdata = Request::all(); $requestdata['date_of_birth'] = $this->convert_datepicker_to_datetimesql(Request::input('dateofbirth')); if ($img != "") { $requestdata['avatar'] = 'avatar/' . $requestdata['avatar']; $img = str_replace('data:image/png;base64,', '', $img); $img = str_replace(' ', '+', $img); $data = base64_decode($img); $file = public_path() . "/avatar/" . Request::input('avatar'); $bytes_written = File::put($file, $data); } else { $requestdata['avatar'] = $requestdata['avatar_save']; } $employee->update($requestdata); $educations = Education::where('employee_id', '=', $employee->id)->get(); $employee->date_of_birth = $this->convert_datepicker_to_datetimesql($employee->date_of_birth); foreach ($educations as $k_edu => $k_val) { $yearstart = Request::input('edu_yearstart' . $k_val->id); if ($yearstart == null) { Education::destroy($k_val->id); continue; } $yearend = Request::input('edu_yearend' . $k_val->id); $education = Request::input('edu_education' . $k_val->id); $edu = Education::find($k_val->id); $edu->update(['year_start' => $yearstart, 'year_end' => $yearend, 'education' => $education]); } $yearstart_new = Request::input('edu_yearstart'); $yearend_new = Request::input('edu_yearend'); $education_new = Request::input('edu_education'); if ($yearstart_new != null && $yearstart_new[0] != "") { foreach ($yearstart_new as $k_n => $v_n) { $user = Education::create(array('employee_id' => $employee->id, 'year_start' => $yearstart_new[$k_n], 'year_end' => $yearend_new[$k_n], 'education' => $education_new[$k_n])); } } $educations = Education::where('employee_id', '=', $employee->id)->get(); $nationalities = Nationality::all(); $working_experience = WorkingExperience::where('employee_id', '=', $employee->id)->delete(); $company = Request::input('company'); $startdate = Request::input('startdate'); $enddate = Request::input('enddate'); $position = Request::input('position'); $mainduties = Request::input('mainduties'); if (!empty($startdate)) { foreach ($startdate as $key => $value) { $startdate[$key] = $this->convert_datepicker_to_datetimesql($value); } foreach ($enddate as $key => $value) { $enddate[$key] = $this->convert_datepicker_to_datetimesql($value); } } if (!empty($company)) { foreach ($company as $key => $value) { if ($value == "") { continue; } $companys = WorkingExperience::create(array('employee_id' => $employee->id, 'company' => $value, 'year_start' => $startdate[$key], 'year_end' => $enddate[$key], 'position' => $position[$key], 'main_duties' => $mainduties[$key])); } } $taken_project = TakenProject::where('employee_id', '=', $employee->id)->delete(); $projectname = Request::input('projectname'); $customername = Request::input('customername'); $role = Request::input('role'); $numberpeople = Request::input('numberpeople'); $projectdescription = Request::input('projectdescription'); $projectperiod = Request::input('projectperiod'); $skillset = Request::input('skillset'); if (!empty($projectname)) { foreach ($projectname as $key => $value) { if ($value == "") { continue; } //dd($numberpeople[$key]); $projects = TakenProject::create(array('employee_id' => $employee->id, 'project_name' => $value, 'customer_name' => $customername[$key], 'number_people' => $numberpeople[$key], 'role' => $role[$key], 'project_description' => $projectdescription[$key], 'project_period' => $projectperiod[$key], 'skill_set_ultilized' => $skillset[$key])); } } $skill = array(); $experience = array(); $skill = Request::input('skill'); $experience = Request::input('month_experience'); EmployeeSkill::where("employee_id", "=", $employee->id)->delete(); foreach ($skill as $key => $value) { if ($value < 0) { unset($experience[$key]); unset($skill[$key]); } else { if ($experience[$key] < 0) { $experience[$key] = 0; } $employeeskill = EmployeeSkill::create(array("employee_id" => $employee->id, "skill_id" => $value, "month_experience" => $experience[$key])); } } $request->session()->flash('flagMessage', 'true'); return redirect()->route('profiles.index'); }
/** * Delete employee * @param [int] $id * @return [Reponse] */ public function delete($id) { $employee = Employee::find($id); WorkingExperience::where('employee_id', '=', $employee->id)->delete(); TakenProject::where('employee_id', '=', $employee->id)->delete(); EmployeeSkill::where('employee_id', '=', $employee->id)->delete(); Education::where('employee_id', '=', $employee->id)->delete(); User::where('employee_id', '=', $employee->id)->delete(); $employee->delete(); return redirect()->route('employee.index')->with('messageDelete', 'Delete employee successfully!'); }
/** * Display the specified resource. * * @param Request $request * @param CV $cv * @return \Illuminate\Http\Response */ public function show(Request $request, CV $cv) { // Get the cv sections. $sections = $cv->sections()->get(); // Build empty subsections. $workSection = array(); $languageSection = array(); $educationSection = array(); $hobbySection = array(); $skillSection = array(); // For each section, determine it's type, and append it's data to the corresponding subsection. foreach ($sections as $section) { $w = Work::whereSectionId($section->id)->get(['name', 'location', 'title', 'description', 'start_date', 'end_date'])->toArray(); $l = Language::whereSectionId($section->id)->get(['name', 'level', 'creditation'])->toArray(); $e = Education::whereSectionId($section->id)->get(['name', 'location', 'title', 'description', 'start_date', 'end_date'])->toArray(); $h = Hobby::whereSectionId($section->id)->get(['text'])->toArray(); $s = Skill::whereSectionId($section->id)->get(['name', 'level', 'description'])->toArray(); if (count($w) != 0) { array_push($workSection, $w); } if (count($l) != 0) { array_push($languageSection, $l); } if (count($e) != 0) { array_push($educationSection, $e); } if (count($h) != 0) { array_push($hobbySection, $h); } if (count($s) != 0) { array_push($skillSection, $s); } } return view('pages.cvs.show', ['cv' => $cv, 'user' => $request->user(), 'workSection' => $workSection, 'languageSection' => $languageSection, 'educationSection' => $educationSection, 'hobbySection' => $hobbySection, 'skillSection' => $skillSection]); }
public function edit_view() { if (Auth::user()->identifier == 1) { $title = 'indprofile_edit'; $user = User::where('id', '=', Auth::user()->id)->with('induser')->first(); $skills = Skills::lists('name', 'name'); $thanks = Postactivity::with('user', 'post')->join('postjobs', 'postjobs.id', '=', 'postactivities.post_id')->where('postjobs.individual_id', '=', Auth::user()->induser_id)->where('postjobs.inactive', '=', 0)->where('postactivities.thanks', '=', 1)->orderBy('postactivities.id', 'desc')->sum('postactivities.thanks'); $posts = Postjob::where('individual_id', '=', Auth::user()->induser_id)->count('id'); $linksCount = Connections::where('user_id', '=', Auth::user()->induser_id)->where('status', '=', 1)->orWhere('connection_user_id', '=', Auth::user()->induser_id)->where('status', '=', 1)->count('id'); $educationList = Education::orderBy('level')->orderBy('name')->where('name', '!=', '0')->get(); $location = Induser::where('id', '=', Auth::user()->induser_id)->first(['prefered_location']); // $loc = explode(',', $location); $farearoleList = Functional_area_role_mapping::orderBy('id')->get(); $acc_id = ""; $profilePer = 0; if (Auth::user()->induser->fname != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->lname != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->email != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->mobile != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->dob != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->city != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->fb_page != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->in_page != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->gender != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->about_individual != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->education != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->experience != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->working_status != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->working_at != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->role != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->linked_skill != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->resume != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->prefered_location != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->prefered_jobtype != null) { $profilePer = $profilePer + 1; } if (Auth::user()->induser->profile_pic != null) { $profilePer = $profilePer + 1; } $profilePer = round($profilePer / 20 * 100); return view('pages.professional_page', compact('user', 'acc_id', 'title', 'skills', 'educationList', 'location', 'farearoleList', 'thanks', 'linksCount', 'posts', 'profilePer')); } else { if (Auth::user()->identifier == 2) { $title = 'corpprofile_edit'; $user = User::where('id', '=', Auth::user()->id)->with('corpuser')->first(); $skills = Skills::lists('name', 'name'); $acc_id = ""; return view('pages.firm_details', compact('user', 'title', 'skills', 'acc_id')); } } }
public function update(Request $request) { Education::find($request->input('pk'))->update([$request->input('name') => $request->input('value')]); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit(Employee $employee, Empqualification $qualification) { $edu = ['' => 'Select'] + Education::lists('name', 'id')->toArray(); return view('backend.employees.qualification.edit', compact('employee', 'qualification', 'edu')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $title = 'skill'; $skills = Skills::lists('name', 'name'); $farearoleList = Functional_area_role_mapping::orderBy('id')->get(); $education = Education::orderBy('level')->orderBy('name')->get(); $postskill = Postjob::where('unique_id', '=', $id)->where('individual_id', '=', Auth::user()->induser_id)->first(); return view('pages.postskill_edit', compact('title', 'skills', 'farearoleList', 'education', 'postskill')); }
public function accountDelete() { if (Auth::user()->identifier == 1) { $title = "AccountSetting"; $acc_id = Input::get('account_id'); $password = bcrypt(Input::get('password')); $skills = Skills::lists('name', 'name'); $thanks = Postactivity::with('user', 'post')->join('postjobs', 'postjobs.id', '=', 'postactivities.post_id')->where('postjobs.individual_id', '=', Auth::user()->induser_id)->where('postjobs.inactive', '=', 0)->where('postactivities.thanks', '=', 1)->orderBy('postactivities.id', 'desc')->sum('postactivities.thanks'); $posts = Postjob::where('individual_id', '=', Auth::user()->induser_id)->count('id'); $linksCount = Connections::where('user_id', '=', Auth::user()->induser_id)->where('status', '=', 1)->orWhere('connection_user_id', '=', Auth::user()->induser_id)->where('status', '=', 1)->count('id'); $educationList = Education::orderBy('level')->orderBy('name')->where('name', '!=', '0')->get(); $location = Induser::where('id', '=', Auth::user()->induser_id)->first(['prefered_location']); $farearoleList = Functional_area_role_mapping::orderBy('id')->get(); $userDetail = User::where('induser_id', '=', Auth::user()->induser_id)->first(); $token = 'AD' . rand(11111, 99999) . rand(11111, 99999); if (Hash::check(Input::get('password'), $userDetail->password)) { $user = User::with('induser')->where('id', '=', Auth::user()->id)->first(); return view('pages.professional_page', compact('title', 'user', 'acc_id', 'skills', 'educationList', 'location', 'farearoleList', 'thanks', 'linksCount', 'posts')); } else { return redirect('/mypost'); } } elseif (Auth::user()->identifier == 2) { $title = "AccountSetting"; $acc_id = Input::get('account_id'); $password = bcrypt(Input::get('password')); $skills = Skills::lists('name', 'name'); $userDetail = User::where('corpuser_id', '=', Auth::user()->corpuser_id)->first(); $token = 'AD' . rand(11111, 99999) . rand(11111, 99999); if (Hash::check(Input::get('password'), $userDetail->password)) { $user = User::with('corpuser')->where('id', '=', Auth::user()->id)->first(); return view('pages.firm_details', compact('title', 'user', 'acc_id', 'skills')); } else { return redirect('/mypost'); } } }