diff --git a/app/Http/Controllers/Backend/AuthenticationController.php b/app/Http/Controllers/Backend/AuthenticationController.php index ec05a3e..cab4e6f 100644 --- a/app/Http/Controllers/Backend/AuthenticationController.php +++ b/app/Http/Controllers/Backend/AuthenticationController.php @@ -33,7 +33,7 @@ public function signUpStore(SignUpRequest $request) else return redirect('login')->with('danger', 'Please Try Again'); } catch (Exception $e) { - dd($e); + // dd($e); return redirect('login')->with('danger', 'Please Try Again'); } } @@ -56,7 +56,7 @@ public function signInCheck(SignInRequest $request) } else return redirect()->route('login')->with('error', 'Username or Password is wrong!'); } catch (Exception $e) { - dd($e); + // dd($e); return redirect()->route('login')->with('error', 'Username or Password is wrong!'); } } @@ -66,8 +66,8 @@ public function setSession($user) return request()->session()->put( [ 'userId' => encryptor('encrypt', $user->id), - 'userName' => encryptor('encrypt', $user->name), - 'userId' => encryptor('encrypt', $user->id), + 'userName' => encryptor('encrypt', $user->name_en), + 'emailAddress' => encryptor('encrypt', $user->email), 'role_id'=> encryptor('encrypt',$user->role_id), 'accessType'=> encryptor('encrypt',$user->full_access), 'role' => encryptor('encrypt', $user->role->type), @@ -83,4 +83,9 @@ public function signOut() request()->session()->flush(); return redirect('login')->with('danger', 'Succesfully Logged Out'); } -} + +public function show(User $data) + { + return view('backend.user.profile', compact('data')); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Backend/UserController.php b/app/Http/Controllers/Backend/UserController.php index 1b99e6c..61e32ba 100644 --- a/app/Http/Controllers/Backend/UserController.php +++ b/app/Http/Controllers/Backend/UserController.php @@ -10,8 +10,9 @@ use App\Http\Requests\Backend\User\UpdateRequest; use Exception; use Illuminate\Support\Facades\Hash; +use File; -class UserController extends Controller +class UserController extends Controller { /** * Display a listing of the resource. @@ -120,8 +121,16 @@ public function update(UpdateRequest $request, $id) /** * Remove the specified resource from storage. */ - public function destroy(string $id) + public function destroy($id) { - // + $data=User::findOrFail(encryptor('decrypt',$id)); + $image_path=public_path('uploads/users/').$data->image; + + if($data->delete()){ + if(File::exists($image_path)) + File::delete($image_path); + + return redirect()->back(); + } } } diff --git a/app/Http/Controllers/CourseCategoryController.php b/app/Http/Controllers/CourseCategoryController.php new file mode 100644 index 0000000..8f7001b --- /dev/null +++ b/app/Http/Controllers/CourseCategoryController.php @@ -0,0 +1,112 @@ +category_name = $request->category_name; + $data->category_status = $request->category_status; + + if ($request->hasFile('category_image')) { + $imageName = rand(111, 999) . time() . '.' . $request->category_image->extension(); + $request->category_image->move(public_path('uploads/courseCategories'), $imageName); + $data->category_image = $imageName; + } + if ($data->save()) + return redirect()->route('courseCategory.index')->with('success', 'Data Saved'); + else + return redirect()->back()->withInput()->with('error', 'Please try again'); + } catch (Exception $e) { + // dd($e); + return redirect()->back()->withInput()->with('error', 'Please try again'); + } + } + + /** + * Display the specified resource. + */ + public function show(CourseCategory $courseCategory) + { + // + } + + /** + * Show the form for editing the specified resource. + */ + public function edit($id) + { + $data = CourseCategory::findOrFail($id); + return view('courseCategory.edit', compact('data')); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, $id) + { + try { + $data = CourseCategory::findOrFail($id); + $data->category_name = $request->category_name; + $data->category_status = $request->category_status; + + if ($request->hasFile('category_image')) { + $imageName = rand(111, 999) . time() . '.' . $request->category_image->extension(); + $request->category_image->move(public_path('uploads/courseCategories'), $imageName); + $data->category_image = $imageName; + } + if ($data->save()) + return redirect()->route('courseCategory.index')->with('success', 'Data Saved'); + else + return redirect()->back()->withInput()->with('error', 'Please try again'); + } catch (Exception $e) { + // dd($e); + return redirect()->back()->withInput()->with('error', 'Please try again'); + } + } + + /** + * Remove the specified resource from storage. + */ + public function destroy($id) + { + $data = CourseCategory::findOrFail($id); + $image_path = public_path('uploads/courseCategories/') . $data->category_image; + + if ($data->delete()) { + if (File::exists($image_path)) + File::delete($image_path); + + return redirect()->back(); + } + } +} diff --git a/app/Http/Middleware/checkRole.php b/app/Http/Middleware/checkRole.php index 0476131..61a52d3 100644 --- a/app/Http/Middleware/checkRole.php +++ b/app/Http/Middleware/checkRole.php @@ -22,7 +22,7 @@ public function handle(Request $request, Closure $next): Response } else { $user = User::find(currentUserId()); if (!$user) { - return redirecty()->route('logOut'); + return redirect()->route('logOut'); } else if ($user->full_access == "1") { return $next($request); } else { diff --git a/app/Http/Requests/Backend/CourseCategory/AddNewRequest.php b/app/Http/Requests/Backend/CourseCategory/AddNewRequest.php new file mode 100644 index 0000000..6bb6e6d --- /dev/null +++ b/app/Http/Requests/Backend/CourseCategory/AddNewRequest.php @@ -0,0 +1,28 @@ +|string> + */ + public function rules(): array + { + return [ + 'category_name'=>'required|max:255' + ]; + } +} diff --git a/app/Http/Requests/Backend/CourseCategory/UpdateRequest.php b/app/Http/Requests/Backend/CourseCategory/UpdateRequest.php new file mode 100644 index 0000000..62818ff --- /dev/null +++ b/app/Http/Requests/Backend/CourseCategory/UpdateRequest.php @@ -0,0 +1,28 @@ +|string> + */ + public function rules(): array + { + return [ + // + ]; + } +} diff --git a/app/Http/Requests/Backend/User/AddNewRequest.php b/app/Http/Requests/Backend/User/AddNewRequest.php index 56bda9b..d0bfdf7 100644 --- a/app/Http/Requests/Backend/User/AddNewRequest.php +++ b/app/Http/Requests/Backend/User/AddNewRequest.php @@ -30,3 +30,4 @@ public function rules(): array ]; } } + \ No newline at end of file diff --git a/app/Models/CourseCategory.php b/app/Models/CourseCategory.php new file mode 100644 index 0000000..3309859 --- /dev/null +++ b/app/Models/CourseCategory.php @@ -0,0 +1,11 @@ +id(); + $table->string('category_name',255); + $table->boolean('category_status')->default(1)->comment('1=>active 2=>inactive'); + $table->string('category_image')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('course_categories'); + } +}; diff --git a/public/uploads/courseCategories/2561700453472.jpg b/public/uploads/courseCategories/2561700453472.jpg new file mode 100644 index 0000000..add9989 Binary files /dev/null and b/public/uploads/courseCategories/2561700453472.jpg differ diff --git a/public/uploads/courseCategories/2951700375064.jpg b/public/uploads/courseCategories/2951700375064.jpg new file mode 100644 index 0000000..8998ab2 Binary files /dev/null and b/public/uploads/courseCategories/2951700375064.jpg differ diff --git a/public/uploads/courseCategories/3871700453037.jpg b/public/uploads/courseCategories/3871700453037.jpg new file mode 100644 index 0000000..a28ac5b Binary files /dev/null and b/public/uploads/courseCategories/3871700453037.jpg differ diff --git a/public/uploads/courseCategories/5771700378684.jpg b/public/uploads/courseCategories/5771700378684.jpg new file mode 100644 index 0000000..29382ad Binary files /dev/null and b/public/uploads/courseCategories/5771700378684.jpg differ diff --git a/public/uploads/courseCategories/6171700375048.jpg b/public/uploads/courseCategories/6171700375048.jpg new file mode 100644 index 0000000..8998ab2 Binary files /dev/null and b/public/uploads/courseCategories/6171700375048.jpg differ diff --git a/public/uploads/courseCategories/9051700450448.jpg b/public/uploads/courseCategories/9051700450448.jpg new file mode 100644 index 0000000..30600c4 Binary files /dev/null and b/public/uploads/courseCategories/9051700450448.jpg differ diff --git a/public/uploads/courseCategories/9341700378633.jpg b/public/uploads/courseCategories/9341700378633.jpg new file mode 100644 index 0000000..a951ac9 Binary files /dev/null and b/public/uploads/courseCategories/9341700378633.jpg differ diff --git a/public/uploads/courseCategories/9871700452877.jpg b/public/uploads/courseCategories/9871700452877.jpg new file mode 100644 index 0000000..a28ac5b Binary files /dev/null and b/public/uploads/courseCategories/9871700452877.jpg differ diff --git a/public/uploads/users/1161700322558.png b/public/uploads/users/1161700322558.png deleted file mode 100644 index a98f5a4..0000000 Binary files a/public/uploads/users/1161700322558.png and /dev/null differ diff --git a/public/uploads/users/1501700288480.jpg b/public/uploads/users/1501700288480.jpg deleted file mode 100644 index e887733..0000000 Binary files a/public/uploads/users/1501700288480.jpg and /dev/null differ diff --git a/public/uploads/users/2191700324373.png b/public/uploads/users/2191700324373.png deleted file mode 100644 index e75f318..0000000 Binary files a/public/uploads/users/2191700324373.png and /dev/null differ diff --git a/public/uploads/users/3381700323338.png b/public/uploads/users/3381700323338.png deleted file mode 100644 index a98f5a4..0000000 Binary files a/public/uploads/users/3381700323338.png and /dev/null differ diff --git a/public/uploads/users/3851700319650.png b/public/uploads/users/3851700319650.png deleted file mode 100644 index 09c6a9e..0000000 Binary files a/public/uploads/users/3851700319650.png and /dev/null differ diff --git a/public/uploads/users/4251700380547.jpg b/public/uploads/users/4251700380547.jpg new file mode 100644 index 0000000..59f67cb Binary files /dev/null and b/public/uploads/users/4251700380547.jpg differ diff --git a/public/uploads/users/4561700323536.png b/public/uploads/users/4561700323536.png deleted file mode 100644 index a98f5a4..0000000 Binary files a/public/uploads/users/4561700323536.png and /dev/null differ diff --git a/public/uploads/users/6161700367047.png b/public/uploads/users/6161700367047.png new file mode 100644 index 0000000..1d46e96 Binary files /dev/null and b/public/uploads/users/6161700367047.png differ diff --git a/public/uploads/users/6211700323001.png b/public/uploads/users/6211700323001.png deleted file mode 100644 index a98f5a4..0000000 Binary files a/public/uploads/users/6211700323001.png and /dev/null differ diff --git a/public/uploads/users/7751700323556.png b/public/uploads/users/7751700323556.png deleted file mode 100644 index a98f5a4..0000000 Binary files a/public/uploads/users/7751700323556.png and /dev/null differ diff --git a/public/uploads/users/9231700380051.jpg b/public/uploads/users/9231700380051.jpg new file mode 100644 index 0000000..a12b602 Binary files /dev/null and b/public/uploads/users/9231700380051.jpg differ diff --git a/resources/views/backend/adminDashboard.blade.php b/resources/views/backend/adminDashboard.blade.php index 88d5c1a..c6dc8fe 100644 --- a/resources/views/backend/adminDashboard.blade.php +++ b/resources/views/backend/adminDashboard.blade.php @@ -1,529 +1,536 @@ @extends('backend.layouts.app') @section('title', 'Admin Dashboard') +@push('styles') + + + + + + + +@endpush + @section('content') -
- -
- -
- -
-
-
-
-

Total Students

-
422
-
-
-
-
-
+
+ +
+
+
+
+
+

Total Students

+
422
+
+
+
+
-
-
-
-

New Students

-
357
-
-
-
-
-
+
+
+
+
+

New Students

+
357
+
+
+
+
-
-
-
-

Total Course

-
547
-
-
-
6,2,8,4,-3,8,1,-3,6,-5,9,2,-8,1,4,8,9,8,2,1 -
+
+
+
+
+

Total Course

+
547
+
+
+
6,2,8,4,-3,8,1,-3,6,-5,9,2,-8,1,4,8,9,8,2,1
-
-
-
-

Fees Collection

-
3280$
-
-
- 7,6,8,7,3,8,3,3,6,5,9,2,8 +
+
+
+
+

Fees Collection

+
3280$
+
+
+ 7,6,8,7,3,8,3,3,6,5,9,2,8 +
+
+
+
+
+
+

Income/Expense Report

+
+
+ +
+
+
+
+
+
+

Income/Expense Report

+
+
+ +
+
+
+
+
+
+
Assign Task
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TaskAssigned ProfessorsStatusProgress
1Working Design reportHerman BeckDONE +
+
+ 70% Complete +
+
+
2Fees Collection reportEmma WatsonPanding +
+
+ 70% Complete +
+
+
3Management reportMary AdamsPanding +
+
+ 70% Complete +
+
+
4Library book statusCaleb RichardsSuspended +
+
+ 70% Complete +
+
+
5Placement statusJune LanePanding +
+
+ 70% Complete +
+
+
6Working Design reportHerman BeckDONE +
+
+ 70% Complete +
+
+
-
-
-
-

Income/Expense Report

-
-
- +
+
+ -
-
-
-

Income/Expense Report

-
-
- -
+
+
+
+
+

New Student List

-
-
-
-
-
Assign Task
-
-
-
- - - - - - - - - - - - - - - - - + + + + + + + +
#TaskAssigned ProfessorsStatusProgress
1Working Design reportHerman BeckDONE -
-
- 70% Complete +
+
+ + + + + + + + + + + + + + - - - - - - - + + + + + + + + - - - - - - - + + + + + + + + - - - - - - - + + + + + + + + - - - - - - - + + + + + + + + - - - - - - - + + + + + + + + - - -
NameAssigned ProfessorBranchStatusDate Of AdmitEdit
+ +
+
+ +
+
+
Ricky Antony
-
2Fees Collection reportEmma WatsonPanding -
-
- 70% Complete + +
Herman BeckMechanicalDONE30/03/2018 + + +
+ +
+
+ +
+
+
Emma Watson
-
3Management reportMary AdamsPanding -
-
- 70% Complete + +
Emma WatsonComputerPanding11/07/2017 + + +
+ +
+
+ +
+
+
Rowen Atkinson
-
4Library book statusCaleb RichardsSuspended -
-
- 70% Complete + +
Mary AdamsMechanicalDONE05/04/2016 + + +
+ +
+
+ +
+
+
Antony Hopkins
-
5Placement statusJune LanePanding -
-
- 70% Complete + +
Caleb Richards Computer Suspended05/04/2018 + + +
+ +
+
+ +
+
+
Jennifer Schramm
-
6Working Design reportHerman BeckDONE -
-
- 70% Complete + +
June LaneFees CollectionPanding17/03/2016 + + +
+ +
+
+ +
+
+
Raymond Mims
-
-
-
-
-
- -
-
-
-

New Student List

-
-
-
- - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameAssigned ProfessorBranchStatusDate Of AdmitEdit
- - Herman BeckComputerSuspended12/07/2014 + + +
+ + Herman BeckMechanicalDONE30/03/2018 - - -
- - Emma WatsonComputerPanding11/07/2017 - - -
- -
-
- -
-
-
Rowen Atkinson
-
-
-
-
Mary AdamsMechanicalDONE05/04/2016 - - -
- -
-
- -
-
-
Antony Hopkins
-
-
-
-
Caleb Richards Computer Suspended05/04/2018 - - -
- -
-
- -
-
-
Jennifer Schramm
-
-
-
-
June LaneFees CollectionPanding17/03/2016 - - -
- -
-
- -
-
-
Raymond Mims
-
-
-
-
Herman BeckComputerSuspended12/07/2014 - - -
- -
-
- -
-
-
Michael Jenkins
-
-
-
-
Jennifer SchrammMechanicalPanding15/06/2014 - - -
-
+
+ +
Jennifer SchrammMechanicalPanding15/06/2014 + + +
@@ -535,4 +542,32 @@ class="la la-trash-o"> Content body end ***********************************--> -@endsection \ No newline at end of file +@endsection + +@push('scripts') + + + + + + + + + + + + + + + + + + + + + + + +@endpush \ No newline at end of file diff --git a/resources/views/backend/dashboard.blade.php b/resources/views/backend/dashboard.blade.php index b2abd92..f2784e1 100644 --- a/resources/views/backend/dashboard.blade.php +++ b/resources/views/backend/dashboard.blade.php @@ -8,7 +8,6 @@
-
diff --git a/resources/views/backend/layouts/app.blade.php b/resources/views/backend/layouts/app.blade.php index e0ffd72..a26b164 100644 --- a/resources/views/backend/layouts/app.blade.php +++ b/resources/views/backend/layouts/app.blade.php @@ -7,14 +7,7 @@ {{ENV('APP_NAME')}} | @yield('title') - - - - - - - - + @stack('styles') @@ -25,13 +18,13 @@ -
+
Contact
- Join NowJoin Now
diff --git a/routes/web.php b/routes/web.php index 4e32794..a7fd659 100644 --- a/routes/web.php +++ b/routes/web.php @@ -4,6 +4,7 @@ use App\Http\Controllers\Backend\AuthenticationController as auth; use App\Http\Controllers\Backend\UserController as user; use App\Http\Controllers\Backend\DashboardController as dashboard; +use App\Http\Controllers\CourseCategoryController as courseCategory; /* |-------------------------------------------------------------------------- @@ -22,15 +23,22 @@ Route::post('/login', [auth::class, 'signInCheck'])->name('login.check'); Route::get('/logout', [auth::class, 'signOut'])->name('logOut'); +Route::resource('/courseCategory', courseCategory::class); + + Route::middleware(['checkrole'])->group(function () { Route::get('/dashboard', [dashboard::class, 'index'])->name('dashboard'); Route::resource('/user', user::class); + Route::get('/userProfile', [auth::class, 'show'])->name('userProfile'); }); Route::get('/', function () { return view('frontend.home'); }); +Route::get('/home', function () { + return view('frontend.home'); +})->name('home'); // Route::get('/dashboard', function () { // return view('welcome');