From 8f364afdde85c18a98fc460a13acf25591a55ad8 Mon Sep 17 00:00:00 2001 From: itsbenny99 Date: Sat, 22 Feb 2020 16:28:51 +0000 Subject: [PATCH] #2 --- app/Http/Controllers/StudentSchController.php | 24 +++ .../Training/MentorSchController.php | 2 +- .../Training/StudentSchController.php | 33 +-- app/Http/Controllers/TrainingController.php | 2 +- .../training/mentors/mentoravail.blade.php | 138 ------------ .../training/sch/mtr_avail.blade.php | 199 ------------------ resources/views/site/mentoravi.blade.php | 199 ++++++++++++++++++ routes/web.php | 4 +- 8 files changed, 247 insertions(+), 354 deletions(-) create mode 100644 app/Http/Controllers/StudentSchController.php delete mode 100644 resources/views/dashboard/training/mentors/mentoravail.blade.php delete mode 100644 resources/views/dashboard/training/sch/mtr_avail.blade.php diff --git a/app/Http/Controllers/StudentSchController.php b/app/Http/Controllers/StudentSchController.php new file mode 100644 index 00000000..c3e89be8 --- /dev/null +++ b/app/Http/Controllers/StudentSchController.php @@ -0,0 +1,24 @@ +whereNull('trainee_id') + ->where('slot', '>', Carbon::now('America/New_York')) + ->get(); + return View('site.mentoravi')->with('availability', $availability)->with('postion', $postion); + } +} diff --git a/app/Http/Controllers/Training/MentorSchController.php b/app/Http/Controllers/Training/MentorSchController.php index 21a55639..5ef3cfad 100644 --- a/app/Http/Controllers/Training/MentorSchController.php +++ b/app/Http/Controllers/Training/MentorSchController.php @@ -2,13 +2,13 @@ namespace App\Http\Controllers\Training; +use App\Http\Controllers\Controller; use App\MentorAvail; use App\User; use Auth; use Carbon\Carbon; use Illuminate\Support\Facades\Input; use Illuminate\Support\Facades\Redirect; -use App\Http\Controllers\Controller; class MentorSchController extends Controller { public function showAvail() diff --git a/app/Http/Controllers/Training/StudentSchController.php b/app/Http/Controllers/Training/StudentSchController.php index 9b96a2e0..ba9ba5ec 100644 --- a/app/Http/Controllers/Training/StudentSchController.php +++ b/app/Http/Controllers/Training/StudentSchController.php @@ -1,21 +1,28 @@ whereNull('trainee_id') - ->where('slot', '>', Carbon::now('America/New_York')) - ->get(); - return View('site.mentoravi')->with('availability', $availability)->with('postion', $postion); - } + + public function showMentAvail() + { + $id = Auth::id(); + $postion = ['Minor Delivery/Ground']; + $availability = MentorAvail::with('mentor') + ->whereNull('trainee_id') + ->where('slot', '>', Carbon::now('America/New_York')) + ->get(); + return View('site.mentoravi')->with('availability', $availability)->with('postion', $postion); + } + } diff --git a/app/Http/Controllers/TrainingController.php b/app/Http/Controllers/TrainingController.php index df424fda..e1d12dbf 100644 --- a/app/Http/Controllers/TrainingController.php +++ b/app/Http/Controllers/TrainingController.php @@ -35,7 +35,7 @@ public function showMentAvail() ->whereNull('trainee_id') ->where('slot', '>', Carbon::now('America/New_York')) ->get(); - return View('dashboard.training.sch.mtr_avail')->with('availability', $availability)->with('postion', $postion); + return View('site.mentoravi')->with('availability', $availability)->with('postion', $postion); } public function saveSession() { diff --git a/resources/views/dashboard/training/mentors/mentoravail.blade.php b/resources/views/dashboard/training/mentors/mentoravail.blade.php deleted file mode 100644 index d2e40c8d..00000000 --- a/resources/views/dashboard/training/mentors/mentoravail.blade.php +++ /dev/null @@ -1,138 +0,0 @@ -@extends('layouts.dashboard') - -@section('title') -@parent -| Training -@stop - -@section('content') - -
-
-

Admin - Training - Availability

-
-
- -
- - Select time blocks available for mentoring. Current Time: EST - - -
- - - - - - -
-
-

- -

- - - {{ Form::open(['action' => 'MentorController@postAvail', 'class' => 'avail-form']) }} - {{ Form::close() }} -
- - - - - -@stop diff --git a/resources/views/dashboard/training/sch/mtr_avail.blade.php b/resources/views/dashboard/training/sch/mtr_avail.blade.php deleted file mode 100644 index c9f9bef3..00000000 --- a/resources/views/dashboard/training/sch/mtr_avail.blade.php +++ /dev/null @@ -1,199 +0,0 @@ -@extends('layouts.master') - -@section('title') -@parent -| Training -@stop - -@section('content') - -
-
-

Training - Request Session

-
-
- -@if(Auth::user()->canTrain == 0) -
-
-
-

Your Training Has Been Disabled By The Instructors

-
-
-@else -
- - Select an available time slot for training. Current Time: EST - - -
- - - - - - -
-
- - {{ Form::open(['action' => 'TrainingController@saveSession', 'class' => 'session-request-form']) }} -
-
- {{Form::label('slot', 'Mentor:', ['class'=>'control-label'])}} - {{Form::select('slot', [], 0, ['class'=>'form-control','onChange'=>'populatePositions()'])}} -
-
-
-
-
- {{Form::label('position', 'Position:', ['class'=>'control-label'])}} - {{Form::select('position', [], 0, ['class'=>'form-control'])}} -
-
-
-
- {{Form::label('date', 'Slot:', ['class'=>'control-label'])}} - {{Form::text('date', null, ['class'=>'form-control', 'disabled' => 'disabled'])}} -
-
-
-
-
-
- {{Form::label('comments', 'Comments:', ['class'=>'control-label'])}} - {{Form::textarea('comments', null, ['class'=>'form-control'])}} -
-
-
-
-
-
- {{Form::submit('Submit', ['class' => 'btn btn-primary'])}} -
-
-
- {{ Form::close() }} -
- - - - - - -@endif - -@stop diff --git a/resources/views/site/mentoravi.blade.php b/resources/views/site/mentoravi.blade.php index e69de29b..c9f9bef3 100644 --- a/resources/views/site/mentoravi.blade.php +++ b/resources/views/site/mentoravi.blade.php @@ -0,0 +1,199 @@ +@extends('layouts.master') + +@section('title') +@parent +| Training +@stop + +@section('content') + +
+
+

Training - Request Session

+
+
+ +@if(Auth::user()->canTrain == 0) +
+
+
+

Your Training Has Been Disabled By The Instructors

+
+
+@else +
+ + Select an available time slot for training. Current Time: EST + + +
+ + + + + + +
+
+ + {{ Form::open(['action' => 'TrainingController@saveSession', 'class' => 'session-request-form']) }} +
+
+ {{Form::label('slot', 'Mentor:', ['class'=>'control-label'])}} + {{Form::select('slot', [], 0, ['class'=>'form-control','onChange'=>'populatePositions()'])}} +
+
+
+
+
+ {{Form::label('position', 'Position:', ['class'=>'control-label'])}} + {{Form::select('position', [], 0, ['class'=>'form-control'])}} +
+
+
+
+ {{Form::label('date', 'Slot:', ['class'=>'control-label'])}} + {{Form::text('date', null, ['class'=>'form-control', 'disabled' => 'disabled'])}} +
+
+
+
+
+
+ {{Form::label('comments', 'Comments:', ['class'=>'control-label'])}} + {{Form::textarea('comments', null, ['class'=>'form-control'])}} +
+
+
+
+
+
+ {{Form::submit('Submit', ['class' => 'btn btn-primary'])}} +
+
+
+ {{ Form::close() }} +
+ + + + + + +@endif + +@stop diff --git a/routes/web.php b/routes/web.php index f9b75108..be533454 100644 --- a/routes/web.php +++ b/routes/web.php @@ -39,7 +39,7 @@ -Route::post('/mtravi', 'TrainingController@saveSession'); +Route::get('/mentoravi', 'Training\StudentSchController@showMentAvail'); Route::get('/admin/mentor/manage_avi', 'Training\MentorSchController@showAvail'); Route::get("/admin", 'AdminDash@index'); Route::get('/admin/roster', 'AdminDash@ShowRoster'); @@ -75,7 +75,7 @@ Route::prefix('controllers')->group(function() { - Route::get('/mentoravi', 'TrainingController@showMentAvail'); + Route::get('/mentoravi', 'Training\StudentSchController@showMentAvail'); Route::post('/mentoravi', 'TrainingController@saveSession'); Route::get('/trainingreq', 'TrainingController@showRequests'); Route::delete('/trainingreq/{id}/delete', 'TrainingController@cancelSession');