2020-04-29 17:15:54 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
2020-05-08 05:06:24 +00:00
|
|
|
use App\Vacancy;
|
2020-04-29 17:15:54 +00:00
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
|
|
class ApplicationController extends Controller
|
|
|
|
{
|
2020-04-30 15:38:54 +00:00
|
|
|
|
2020-04-30 15:55:14 +00:00
|
|
|
public function showPendingUserApps()
|
2020-04-30 15:38:54 +00:00
|
|
|
{
|
|
|
|
return view('dashboard.user.applications');
|
|
|
|
}
|
|
|
|
|
2020-04-30 15:55:14 +00:00
|
|
|
public function showDeniedUserApps()
|
|
|
|
{
|
|
|
|
return view('dashboard.user.deniedapplications');
|
|
|
|
}
|
|
|
|
|
2020-04-30 21:53:57 +00:00
|
|
|
public function showApprovedApps()
|
|
|
|
{
|
|
|
|
return view('dashboard.user.approvedapplications');
|
|
|
|
}
|
|
|
|
|
2020-05-01 04:42:19 +00:00
|
|
|
public function showAllPendingApps()
|
|
|
|
{
|
|
|
|
return view('dashboard.appmanagement.outstandingapps');
|
|
|
|
}
|
|
|
|
|
2020-05-01 05:21:44 +00:00
|
|
|
public function showPeerReview()
|
|
|
|
{
|
|
|
|
return view('dashboard.appmanagement.peerreview');
|
|
|
|
}
|
2020-05-02 05:54:14 +00:00
|
|
|
|
|
|
|
public function showPendingInterview()
|
|
|
|
{
|
|
|
|
return view('dashboard.appmanagement.interview');
|
|
|
|
}
|
2020-05-08 05:06:24 +00:00
|
|
|
|
|
|
|
public function renderApplicationForm(Request $request, $vacancySlug)
|
|
|
|
{
|
|
|
|
$vacancyWithForm = Vacancy::with('forms')->where('vacancySlug', $vacancySlug)->get();
|
|
|
|
|
|
|
|
if (!$vacancyWithForm->isEmpty())
|
|
|
|
{
|
|
|
|
|
|
|
|
return view('dashboard.application-rendering.apply')
|
|
|
|
->with([
|
|
|
|
|
|
|
|
'vacancy' => $vacancyWithForm->first(),
|
|
|
|
'preprocessedForm' => json_decode($vacancyWithForm->first()->forms->formStructure, true)
|
|
|
|
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
abort(404, 'We\'re ssssorry, but the application form you\'re looking for could not be found.');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2020-04-29 17:15:54 +00:00
|
|
|
}
|