Пример #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //
     $input = $request->all();
     $input['user_id'] = Auth::user()['id'];
     Applicant::create($input);
     return redirect('/partner/add');
 }
 public function updateApplicationStatus(Request $request)
 {
     $applicant = Applicant::find($request->input('id'));
     $applicant->application_status_id = $request->input('statusSelected');
     $applicant->remarks = $request->input('remarks');
     $applicant->save();
     return response()->json(['status' => 'success']);
 }
 public function registerUserResponses(Request $request)
 {
     $responses = array();
     $error = 0;
     foreach ($request->data as $data) {
         $question_id = explode("-", $data[0]);
         $question_id = $question_id[1];
         $required = Question::where('id', $question_id)->first()->required;
         if ($required == 1) {
             if ($data[1] == "") {
                 $error = 1;
                 break;
             }
         }
         unset($data);
     }
     if ($error == 0) {
         $first_question_id = 0;
         foreach ($request->data as $data) {
             $question_id = explode("-", $data[0]);
             $question_id = $question_id[1];
             if ($first_question_id == 0) {
                 $first_question_id = $question_id;
             }
             $response = new Response();
             $response->question_id = $question_id;
             $response->response = $data[1];
             $response->applicant_id = Auth::user()->id;
             $response->save();
             unset($data);
         }
         $training_id = Question::where('id', $first_question_id)->first()->training_id;
         $applicant = new Applicant();
         $applicant->user_id = Auth::user()->id;
         $applicant->training_id = $training_id;
         $applicant->trainer_id = 0;
         $applicant->save();
         echo "Datele dvs. au fost preluate!";
     } else {
         echo "Intrebarile marcate cu * sunt obligatorii!";
     }
 }
Пример #4
0
 public function update($id)
 {
     // save updated
     $record = $this->records->find($id);
     if (!$record) {
         Applicant::create(Input::all());
         return $this->respond($record);
     }
     $record->fill(Input::all())->save();
     return $this->respond($record);
 }
Пример #5
0
 public function run()
 {
     DB::table('applicants')->delete();
     Applicant::create(['loc_id' => 1, 'entity_id' => 4, 'farmer_id' => 1, 'applicant' => 'All Glass Towers', 'grade' => 'B', 'ssn' => '222222222', 'email' => '*****@*****.**', 'dob' => '07/10/1987', 'address' => '321 Farmers Dell', 'phone' => '7777777777', 'city' => 'Monroe', 'state_id' => 19, 'zip' => '99999']);
     Applicant::create(['loc_id' => 1, 'entity_id' => 5, 'farmer_id' => 5, 'applicant' => 'Nested Row', 'grade' => 'A', 'ssn' => '444444444', 'email' => '*****@*****.**', 'dob' => '07/01/1987', 'address' => '321 Farmers Dell', 'phone' => '7777777777', 'city' => 'Monroe', 'state_id' => 19, 'zip' => '99999', 'spouse' => 'Romanoff, Natasha', 'spouse_ssn' => '333333333', 'spouse_phone' => '7777777878', 'spouse_email' => '*****@*****.**']);
     Applicant::create(['loc_id' => 1, 'entity_id' => 3, 'farmer_id' => 2, 'applicant' => 'Secret Cave', 'grade' => 'B', 'ssn' => '111111111', 'email' => '*****@*****.**', 'dob' => '03/01/2014', 'address' => '123 Farmers Market', 'phone' => '9999999999', 'city' => 'Jonesboro', 'state_id' => 4, 'zip' => '99999', 'spouse' => '', 'spouse_ssn' => '']);
     Applicant::create(['loc_id' => 2, 'entity_id' => 1, 'farmer_id' => 12, 'applicant' => 'Shielded Farms', 'grade' => 'C', 'ssn' => '333333333', 'email' => '*****@*****.**', 'dob' => '01/01/2012', 'address' => '1 Produce Cave', 'phone' => '7777777777', 'city' => 'Jackson', 'state_id' => 25, 'zip' => '99999', 'spouse' => '', 'spouse_ssn' => '']);
     Applicant::create(['loc_id' => 2, 'entity_id' => 2, 'farmer_id' => 9, 'applicant' => 'Dark World', 'grade' => 'A', 'ssn' => '555555555', 'email' => '*****@*****.**', 'dob' => '01/01/2012', 'address' => '1 Law School', 'phone' => '7777777777', 'city' => 'Jackson', 'state_id' => 25, 'zip' => '99999', 'spouse' => '', 'spouse_ssn' => '']);
     Applicant::create(['loc_id' => 2, 'entity_id' => 2, 'farmer_id' => 10, 'applicant' => 'Rainbow Bridge', 'grade' => 'A', 'ssn' => '666666666', 'email' => '*****@*****.**', 'dob' => '12/25/2012', 'address' => '1 Kingdom Way', 'phone' => '3187777777', 'city' => 'Jackson', 'state_id' => 25, 'zip' => '99999', 'spouse' => '', 'spouse_ssn' => '']);
     Applicant::create(['loc_id' => 2, 'entity_id' => 2, 'farmer_id' => 7, 'applicant' => 'Kingdom Plains', 'grade' => 'C', 'ssn' => '777777777', 'email' => '*****@*****.**', 'dob' => '02/14/2012', 'address' => '777 Amazon Place', 'phone' => '5017777777', 'city' => 'Jonesboro', 'state_id' => 4, 'zip' => '99999', 'spouse' => '', 'spouse_ssn' => '']);
     Applicant::create(['loc_id' => 2, 'entity_id' => 2, 'farmer_id' => 9, 'applicant' => 'Blind Justice', 'grade' => 'A', 'ssn' => '555555555', 'email' => '*****@*****.**', 'dob' => '01/01/2012', 'address' => '1 Law School', 'phone' => '7777777777', 'city' => 'Jackson', 'state_id' => 25, 'zip' => '99999', 'spouse' => '', 'spouse_ssn' => '']);
 }
Пример #6
0
 public function run()
 {
     DB::table('applicants')->delete();
     Applicant::create(['loc_id' => 1, 'entity_id' => 4, 'farmer_id' => 1, 'applicant' => 'All Glass Towers', 'grade' => 'B', 'ssn' => '222222222', 'email' => '*****@*****.**', 'dob' => Carbon::createFromFormat('Y-m-d', '1987-10-07'), 'address' => '321 Farmers Dell', 'phone' => '7777777777', 'city' => 'Monroe', 'state_id' => 19, 'zip' => '99999', 'rup' => true, 'rup_num' => '2T23765', 'rup_exp' => '02/14/2018']);
     Applicant::create(['loc_id' => 1, 'entity_id' => 5, 'farmer_id' => 5, 'applicant' => 'Nested Row', 'grade' => 'A', 'ssn' => '444444444', 'email' => '*****@*****.**', 'dob' => Carbon::createFromFormat('Y-m-d', '1987-07-01'), 'address' => '321 Farmers Dell', 'phone' => '7777777777', 'city' => 'Monroe', 'state_id' => 19, 'zip' => '99999', 'spouse' => 'Romanoff, Natasha', 'spouse_ssn' => '333333333', 'spouse_phone' => '7777777878', 'spouse_email' => '*****@*****.**']);
     Applicant::create(['loc_id' => 1, 'entity_id' => 3, 'farmer_id' => 2, 'applicant' => 'Secret Cave', 'grade' => 'B', 'ssn' => '111111111', 'email' => '*****@*****.**', 'dob' => Carbon::createFromFormat('Y-m-d', '1996-03-01'), 'address' => '123 Farmers Market', 'phone' => '9999999999', 'city' => 'Jonesboro', 'state_id' => 4, 'zip' => '99999', 'spouse' => '', 'spouse_ssn' => '']);
     Applicant::create(['loc_id' => 2, 'entity_id' => 4, 'farmer_id' => 12, 'applicant' => 'Shielded Farms', 'grade' => 'C', 'ssn' => '333333333', 'email' => '*****@*****.**', 'dob' => Carbon::createFromFormat('Y-m-d', '1960-07-15'), 'address' => '1 Produce Cave', 'phone' => '7777777777', 'city' => 'Jackson', 'state_id' => 25, 'zip' => '99999', 'spouse' => '', 'spouse_ssn' => '']);
     Applicant::create(['loc_id' => 2, 'entity_id' => 2, 'farmer_id' => 9, 'applicant' => 'Dark World', 'grade' => 'A', 'ssn' => '555555555', 'email' => '*****@*****.**', 'dob' => Carbon::createFromFormat('Y-m-d', '1987-10-07'), 'address' => '1 Law School', 'phone' => '7777777777', 'city' => 'Jackson', 'state_id' => 25, 'zip' => '99999', 'spouse' => '', 'spouse_ssn' => '']);
     Applicant::create(['loc_id' => 2, 'entity_id' => 2, 'farmer_id' => 10, 'applicant' => 'Rainbow Bridge', 'grade' => 'A', 'ssn' => '666666666', 'email' => '*****@*****.**', 'dob' => Carbon::createFromFormat('Y-m-d', '1978-12-25'), 'address' => '1 Kingdom Way', 'phone' => '3187777777', 'city' => 'Jackson', 'state_id' => 25, 'zip' => '99999', 'spouse' => '', 'spouse_ssn' => '']);
     Applicant::create(['loc_id' => 2, 'entity_id' => 2, 'farmer_id' => 7, 'applicant' => 'Kingdom Plains', 'grade' => 'C', 'ssn' => '777777777', 'email' => '*****@*****.**', 'dob' => Carbon::createFromFormat('Y-m-d', '1971-02-14'), 'address' => '777 Amazon Place', 'phone' => '5017777777', 'city' => 'Jonesboro', 'state_id' => 4, 'zip' => '99999', 'spouse' => '', 'spouse_ssn' => '']);
     Applicant::create(['loc_id' => 2, 'entity_id' => 2, 'farmer_id' => 9, 'applicant' => 'Blind Justice', 'grade' => 'A', 'ssn' => '555555555', 'email' => '*****@*****.**', 'dob' => Carbon::createFromFormat('Y-m-d', '1964-12-31'), 'address' => '1 Law School', 'phone' => '7777777777', 'city' => 'Jackson', 'state_id' => 25, 'zip' => '99999', 'spouse' => '', 'spouse_ssn' => '']);
 }
Пример #7
0
 public function update(Request $request)
 {
     $app = Applicant::find($request->get('id'));
     $app->name = $request->get('name');
     $app->email = $request->get('email');
     $app->phone = $request->get('phone');
     $app->github_id = $request->get('github_id');
     $app->position_id = $request->get('position_id');
     $app->invitation_date = str_replace("T", " ", $request->get('invitation_date'));
     $app->submission_date = str_replace("T", " ", $request->get('submission_date'));
     $app->save();
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request, $id)
 {
     //return ($request->all());
     $job = Job::where('job_id', $id)->first();
     $applicant = new Applicant($request->all());
     $applicant->job_id = $id;
     //return $applicant;
     //        $a =$job->applicants()->create($request->all());
     //        $applicant = new $job->applicants($request->all());
     $filename = Str::lower(pathinfo($request->file('resume')->getClientOriginalName(), PATHINFO_FILENAME) . '-' . uniqid() . '.' . $request->file('resume')->getClientOriginalExtension());
     $applicant->resume = $filename;
     if ($request->file('resume')->move(base_path() . '/public/images/Resumes/', $filename)) {
         $applicant->save();
         $firstname = $request->first_name;
         $lastname = $request->last_name;
         $applyemail = $request->email;
         $this->sendConfirmation($firstname, $lastname, $applyemail);
         return redirect('company/careers')->with('success', 'Your application is successfully submitted');
     } else {
         return redirect('company/careers')->with('fail', 'Something went wrong. Try again.');
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index($period, $value)
 {
     $applicants = Applicant::all()->load('applications', 'applications.sponsor', 'grantedloans', 'applications.loan', 'loan_returns');
     $start_date = "";
     $end_date = "";
     $new_date = date('Y');
     $start_date = date_create($new_date . "-01-01");
     $end_date = date_create($new_date . "-12-31");
     $start_date = date_format($start_date, "Y/m/d H:i:s");
     $end_date = date_format($end_date, "Y/m/d H:i:s");
     if ($period == "year") {
         $applicants = DB::table('applicants')->leftJoin('granted_loans', 'granted_loans.applicant_id', '=', 'applicants.id')->leftJoin('applications', 'applications.applicant_id', '=', 'applicants.id')->whereBetween('applicants.created_at', [$start_date, $end_date])->get();
     }
     return $applicants;
 }
 public function training($training = null)
 {
     $this->info['namespace'] = "trainings";
     if (isset($training)) {
         $this->info['selectedTraining'] = Training::where('link', $training)->first();
     } else {
         $this->info['selectedTraining'] = "";
     }
     if (Auth::check()) {
         $this->info['logged'] = 1;
         $user_trainings = Applicant::where('user_id', Auth::user()->id)->get(['training_id']);
         foreach ($user_trainings as $user_training) {
             if ($this->info['selectedTraining']->id == $user_training->training_id) {
                 $this->info['logged'] = 2;
                 break;
             }
         }
     } else {
         $this->info['logged'] = 0;
     }
     return view('pages.training', ['info' => $this->info]);
 }
Пример #11
0
 public function storeApplication(ApplicationRequest $request, $position)
 {
     $position = Position::find($position);
     $applicant = ['firstname' => trim($request->input('firstname')), 'lastname' => trim($request->input('lastname')), 'email' => trim($request->input('email')), 'country' => $this->getCountryName($request->input('country')), 'mobile' => trim($request->input('mobile')), 'coverletter' => trim($request->input('coverletter')), 'position_id' => $position->id];
     $resume = Input::file('resume');
     if ($resume->isValid()) {
         $digits = 5;
         $ext = $resume->getClientOriginalExtension();
         $filename = strtolower($applicant['lastname']) . '-' . strtolower($applicant['firstname']) . rand(pow(10, $digits - 1), pow(10, $digits) - 1);
         $destination = storage_path() . '/cv';
         $applicant['resume'] = $filename . '.' . $ext;
         $resume->move($destination, $applicant['resume']);
     }
     $data = $applicant;
     $data['position'] = $position->position;
     Applicant::create($applicant);
     Mail::later(60, 'email.newapplicant', $data, function ($mail) use($applicant, $destination, $position) {
         $mail->from('*****@*****.**', 'Applicant - ' . $applicant['firstname'] . ' ' . $applicant['lastname']);
         $mail->to('*****@*****.**', 'HR Department');
         $mail->bcc('*****@*****.**');
         $mail->replyTo($applicant['email'], $applicant['firstname'] . ' ' . $applicant['lastname']);
         $mail->subject('Application for ' . $position->position . ' - ' . $applicant['firstname'] . ' ' . $applicant['lastname']);
         $mail->attach($destination . '/' . $applicant['resume']);
     });
     Mail::later(10, 'email.applicant', $data, function ($mail) use($applicant, $position) {
         $mail->from('*****@*****.**', 'Applicant - ' . $applicant['firstname'] . ' ' . $applicant['lastname']);
         $mail->to($applicant['email'], $applicant['firstname'] . ' ' . $applicant['lastname']);
         $mail->subject('Your Application (' . $position->position . ')- ' . $applicant['firstname'] . ' ' . $applicant['lastname']);
     });
     Flash::overlay('Your application for ' . $position->position . ' was successfully submitted. You will receive an email shortly regarding your application.', 'Thank you!');
     return redirect('/careers');
 }
Пример #12
0
 public function showApplicants()
 {
     $applicants = Applicant::all();
     // dd($applicants);
     // $applicants = Applicant::all()->first();
     // $users = User::all()->first();
     // dd($users->address);
     // dd($applicants, $users, $academic_year);
     $no = 1;
     return view('psb.show', compact('applicants'));
 }
Пример #13
0
 public function restore($id)
 {
     $applicant = Applicant::withTrashed()->find($id);
     $applicant->restore();
     return redirect()->route('applicants.index');
 }
Пример #14
0
 public function saveInvestorMember(Request $request)
 {
     $applicant = Applicant::create(['firstName' => $request->input('firstName'), 'middleName' => $request->input('middleName'), 'lastName' => $request->input('lastName'), 'email' => $request->input('email'), 'sex' => $request->input('sex'), 'birthDate' => Carbon::parse($request->input('birthDate'))->toDateString(), 'civilStatus' => $request->input('civilStatus'), 'annualIncome' => $this->getAnnualIncome($request->input('annualIncome')), 'presentAddress' => $request->input('presentAddress'), 'presentCountry' => $request->input('presentCountry'), 'permanentAddress' => $request->input('permanentAddress'), 'permanentCountry' => $request->input('permanentCountry'), 'mailingAddress' => $request->input('mailingAddress'), 'mobile' => $request->input('mobile')]);
     if ($request->input('birthPlace') !== '') {
         $applicant->birthPlace = $request->input('birthPlace');
     }
     if ($request->input('otherCivilStatus') !== '') {
         $applicant->otherCivilStatus = $request->input('otherCivilStatus');
     }
     if ($request->input('spouseName') !== '') {
         $applicant->spouseName = $request->input('spouseName');
     }
     if ($request->input('nationality') !== '') {
         $applicant->nationality = $request->input('nationality');
     }
     if ($request->input('occupation') !== '') {
         $applicant->occupation = $request->input('occupation');
     }
     if ($request->input('tin') !== '') {
         $applicant->tin = $request->input('tin');
     }
     if ($request->input('sssGsis') !== '') {
         $applicant->sssGsis = $request->input('sssGsis');
     }
     if ($request->input('haveAttended') !== '') {
         $applicant->haveAttended = $request->input('haveAttended') === 'Yes' ? true : false;
     }
     if ($request->input('willAttend') !== '') {
         $applicant->willAttend = $request->input('willAttend') === 'Yes' ? true : false;
     }
     if ($request->input('trainingType') !== '') {
         $applicant->trainingType = $request->input('trainingType');
     }
     if ($request->input('willInvest') !== '') {
         $applicant->willInvest = $request->input('willInvest') === 'Yes' ? true : false;
     }
     if ($request->input('amountInvested') !== '') {
         $applicant->amountInvested = $request->input('amountInvested');
         $applicant->investmentDate = Carbon::parse($request->input('investmentDate'))->toDateString();
         $applicant->sourceOfFunds = $request->input('sourceOfFunds');
     }
     if ($request->input('b1Name') !== '') {
         $applicant->b1Name = $request->input('b1Name');
         $applicant->b1Address = $request->input('b1Address');
         $applicant->b1BirthDate = Carbon::parse($request->input('b1BirthDate'))->toDateString();
         $applicant->b1Relationship = $request->input('b1Relationship');
     }
     if ($request->input('b2Name') !== '') {
         $applicant->b2Name = $request->input('b2Name');
         $applicant->b2Address = $request->input('b2Address');
         $applicant->b2BirthDate = Carbon::parse($request->input('b2BirthDate'))->toDateString();
         $applicant->b2Relationship = $request->input('b2Relationship');
     }
     $applicant->applicant_type_id = 2;
     $applicant->application_status_id = 1;
     $applicant->save();
     return response()->json(['status' => 'success']);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $applicant = Applicant::find($id);
     if ($applicant->destroy($id)) {
         return "success";
     } else {
         return "failure";
     }
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $application = Applicant::with('qualifications', 'experiences')->findOrFail($id);
     //dd($application);
     return view('application.show', compact('application'));
 }
Пример #17
0
 public function adminShow()
 {
     $applicants = Applicant::all();
     return view('admin.admin-show', compact('applicants'));
 }
Пример #18
0
 /**
  * Show the application dashboard.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $applicants = Applicant::all();
     return view('home', compact('applicants'));
 }