diff --git a/app/Http/Controllers/HR/Applications/RecruitmentApplicationController.php b/app/Http/Controllers/HR/Applications/RecruitmentApplicationController.php new file mode 100644 index 0000000000..fdf4b22adf --- /dev/null +++ b/app/Http/Controllers/HR/Applications/RecruitmentApplicationController.php @@ -0,0 +1,61 @@ +filter; + + switch ($filter) { + case 'last-week': + $startDate = Carbon::now()->startOfWeek()->subWeek(); + $endDate = Carbon::now()->endOfWeek()->subWeek(); + break; + case 'last-month': + $startDate = Carbon::now()->startOfMonth()->subMonth(); + $endDate = Carbon::now()->endOfMonth()->subMonth(); + break; + case 'last-quarter': + $startDate = Carbon::now()->startOfQuarter()->subQuarter(); + $endDate = Carbon::now()->endOfQuarter()->subQuarter(); + break; + } + + $rejectedApplicationCount = Application::rejected() + ->whereDate('updated_at', '>=', $startDate) + ->whereDate('updated_at', '<=', $endDate) + ->count(); + + $receivedApplicationCount = Application::whereDate('created_at', '>=', $startDate) + ->whereDate('created_at', '<=', $endDate) + ->count(); + + // $introductoryApplicationCount = Application::whereDate('updated_at', '>=', $startDate) + // ->whereDate('updated_at', '<=', $endDate) + // ->applicationRounds()->introductoryCall() + // ->count(); + + // $newApplicationCount = Application::whereDate('updated_at', '>=', $startDate) + // ->whereDate('updated_at', '<=', $endDate) + // ->applicationRounds()->resumeScreening() + // ->count(); + + return [ + "total_received_applications" => $receivedApplicationCount, + "total_rejected_applications" => $rejectedApplicationCount, + "total_introductory_call_applications" => 30, + "total_new_applications" => 40, + ]; + } +} diff --git a/resources/js/app.js b/resources/js/app.js index a5c465a4d0..c15de3c270 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -83,6 +83,22 @@ Vue.component( "user-dashboard-library", require("./components/Dashboard/UserDashboardLibrary.vue").default ); +Vue.component( + "user-dashboard-hiring", + require("./components/Dashboard/UserDashboardHiringActivity.vue").default +); +Vue.component( + "user-hiring-last-week", + require("./components/Dashboard/UserDashboardHiringLastWeek.vue").default +); +Vue.component( + "user-hiring-last-month", + require("./components/Dashboard/UserDashboardHiringLastMonth.vue").default +); +Vue.component( + "user-hiring-last-quarter", + require("./components/Dashboard/UserDashboardHiringLastQuarter.vue").default +); Vue.component( "user-dashboard-infrastructure", require("./components/Dashboard/UserDashboardInfrastructure.vue").default diff --git a/resources/js/components/Dashboard/UserDashboardHiringActivity.vue b/resources/js/components/Dashboard/UserDashboardHiringActivity.vue new file mode 100644 index 0000000000..5224c866ec --- /dev/null +++ b/resources/js/components/Dashboard/UserDashboardHiringActivity.vue @@ -0,0 +1,69 @@ + + + + diff --git a/resources/js/components/Dashboard/UserDashboardHiringLastMonth.vue b/resources/js/components/Dashboard/UserDashboardHiringLastMonth.vue new file mode 100644 index 0000000000..f70e303b6e --- /dev/null +++ b/resources/js/components/Dashboard/UserDashboardHiringLastMonth.vue @@ -0,0 +1,47 @@ + + + diff --git a/resources/js/components/Dashboard/UserDashboardHiringLastQuarter.vue b/resources/js/components/Dashboard/UserDashboardHiringLastQuarter.vue new file mode 100644 index 0000000000..df6893cab2 --- /dev/null +++ b/resources/js/components/Dashboard/UserDashboardHiringLastQuarter.vue @@ -0,0 +1,47 @@ + + + diff --git a/resources/js/components/Dashboard/UserDashboardHiringLastWeek.vue b/resources/js/components/Dashboard/UserDashboardHiringLastWeek.vue new file mode 100644 index 0000000000..2e1764b8d4 --- /dev/null +++ b/resources/js/components/Dashboard/UserDashboardHiringLastWeek.vue @@ -0,0 +1,47 @@ + + + diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 9daf90c32e..6fd11cf145 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -45,6 +45,12 @@ @endcan + @if(Module::checkStatus('HR') && auth()->user()->can('hr_recruitment_jobs.view')) +
+ +
+ @endif + @can('projects.view')
diff --git a/routes/web.php b/routes/web.php index ef09f1fcbc..44f1bd0de3 100644 --- a/routes/web.php +++ b/routes/web.php @@ -173,4 +173,5 @@ Route::get('user/read-books', 'UserBookController@index'); Route::get('user/wishlist-books', 'UserBookController@booksInWishlist'); Route::get('user/projects', 'UserController@projects'); + Route::post('dashboart/hiring-activity', 'HR\Applications\RecruitmentApplicationController@index'); });