Пример #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');
 }
Пример #2
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);
 }
Пример #3
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' => '']);
 }
Пример #4
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' => '']);
 }
Пример #5
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']);
 }
Пример #6
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');
 }