public function postAddJobLayout(Request $request) { $request['user_id'] = Auth::user()->id; if ($request['logo_image']) { $destinationPath = 'uploads'; // upload path $extension = Input::file('logo_image')->getClientOriginalExtension(); // getting image extension $fileName = time() . '.' . $extension; // renameing image $request['logo'] = $fileName; Input::file('logo_image')->move($destinationPath, $fileName); } if ($request['header_image']) { $destinationPath = 'uploads'; // upload path $extension = Input::file('header_image')->getClientOriginalExtension(); // getting image extension $headerfile = time() + 1 . '.' . $extension; // renameing image Input::file('header_image')->move($destinationPath, $headerfile); $request['header'] = $headerfile; } $jobaddlayout = Jobaddlayout::create($request->all()); return view('job.index')->with('job', Job::find($request['job_id']))->with('educationalqualifications', Educationalqualification::lists('name', 'id'))->with('joblevels', Joblevel::lists('name', 'id'))->with('industries', Industry::lists('name', 'id'))->with('jobtypes', Jobtype::lists('name', 'id'))->with('jobcategories', Jobcategory::lists('name', 'id'))->with('level', 2); return $request; }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $jobs = Job::find($id); if (!$jobs) { return $this->respondNotFount('No jobs here dude !'); } return $this->respond(['data' => $this->jobsTransformer->transform($jobs)]); }
public function destroy($id) { $job = Job::find($id); if (!$job) { return response()->json(['message' => 'Record not found'], 404); } if (\Auth::user()->id != $job->company_id) { return response()->json(['message' => 'You haven\'t permission to delete this entry'], 401); } $job->delete(); }
public function removeFromFeaturedJobs(Request $request) { $job = $request->get('data'); if (!empty($job)) { $jobObj = \App\Job::find($job['id']); if (!empty($jobObj)) { $jobObj->featured_flag = 0; $jobObj->updated_at = $jobObj->created_at; $job_id = \App\Job::saveInstance($jobObj); } } return 'true'; }
public function seekerRequestDone() { $accepted_job_id = Input::get('accepted_job_id'); $accepted_job = AcceptedJob::find($accepted_job_id); $accepted_job->seeker_confirm_done = 1; $job = Job::find($accepted_job->job_id); $freelancer = User::find($job->freelancer_info_id); $seeker = User::find($accepted_job->seeker_id); //notif buat freelancer $notification = new Notification(); $notification->user_id = $freelancer->id; $notification->notif = "Proyek untuk job " . $job->judul . " yang direquest oleh " . $seeker->name . " telah selesai"; $notification->type = 4; $notification->save(); // kalo freelancer juga udah setuju done if ($accepted_job->freelancer_confirm_done == 1) { // ubah status accepted job ini menjadi done $accepted_job->status = 1; $accepted_job->waktu_selesai = DB::raw('CURRENT_TIMESTAMP'); $accepted_job->save(); } else { $accepted_job->save(); } return Redirect::to('seeker/accepted/' . $accepted_job_id); }
public function deljob($id) { if (Auth::guest()) { \Session::flash('msg', ' No Permission for that Request'); return redirect('job'); } $job = Job::findOrFail($id); if (Auth::id() != $job['Employer_id']) { \Session::flash('msg', ' No Permission for that Request'); return redirect('job'); } if (Job::find($id)->delete()) { \Session::flash('msg', 'You Have Successfully Deleted Job : ' . $job->title); } return redirect('job/openings'); }
public function publish($company_id, $id) { $job = Job::find($id); $job->status_id = 1; // active this job $job->save(); $company = Company::find($company_id); return view('jobs.publish', compact('company', 'job')); }
public function inform(Request $request) { $jobId = $request->input('jobId', 0); $job = Job::find($jobId); if (empty($job)) { $job = false; } if ($request->has('inform')) { //send mail $content = $request->input('inform', array()); //$job->user->sendMail($content['content']); //show notification return redirect()->action('backend@display'); } return view('backend.inform')->with(array('job' => $job, 'page' => 'inform')); }
public function getViewJob($id) { return view("jobs.view-job", ["job" => Job::find($id)]); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $job = \App\Job::find($id); $job->delete(); return back()->with('success', 'Job removido com sucesso!'); }
/** * Accept job from seeker * * @return Response */ public function acceptJob() { $job_id = Input::get('job_id'); $seeker_id = Input::get('seeker_id'); //accept job, create accepted_job $accepted_job = new AcceptedJob(); $accepted_job->job_id = $job_id; $accepted_job->seeker_id = $seeker_id; $accepted_job->save(); //delete request $job_request = JobRequest::find($job_id, $seeker_id); //$job_request->delete(); $query = "DELETE FROM job_request "; $query = $query . "WHERE job_id = " . $job_id . " and seeker_id = " . $seeker_id; DB::select(DB::raw($query)); // add notification to the freelacer $freelancer_id = User::find(FreelancerInfo::find(Job::find($job_id)->freelancer_info_id)->user_info_id)->id; $freelancer_name = User::find($freelancer_id)->name; $job_name = Job::find($job_id)->judul; $notification = new Notification(); $notification->user_id = $seeker_id; $notification->notif = "Tawaran job " . $job_name . " telah diterima oleh freelancer " . $freelancer_name; $notification->type = 2; $notification->save(); return Redirect::to('show-job-request/'); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // $job = Job::find($id); $job->judul = Input::get('judul'); $job->deskripsi = Input::get('deskripsi'); $job->upah_max = Input::get('upah_max'); $job->upah_min = Input::get('upah_min'); $job->save(); return Redirect::to('/admin/manage/job'); }
/** * Load job apply view * @param $id * @return \Illuminate\Http\Response */ public function loadApplyView($id) { $data = ['title' => 'Teleaus | Job Apply Page', 'parentPage' => 'Career', 'page' => 'Job Application', 'job' => count(Job::find($id)) ? Job::find($id) : 0]; return view('job-apply-form')->with($data); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { // delete $deleted_job = Job::find($id); $deleted_job->delete(); // redirect Session::flash('message', 'Successfully deleted the job!'); return Redirect::to('job'); }
public function apply($id) { $job = Job::find($id); $userid = Auth::user()->id; try { $job->user()->attach($userid); Session::flash('success', 'You have been successfully applied for this job!'); return view('jobs.show')->withJob($job); } catch (\Exception $e) { Session::flash('danger', 'You have been already applied for this job! before'); return view('jobs.show')->withJob($job)->with('message', 'you have already applied for this job'); } //$job->user()->attach($userid); }