From c8d2d6a4761553c14514afa0fca63c69917909fe Mon Sep 17 00:00:00 2001 From: sayaliparab Date: Tue, 28 May 2024 12:45:23 +0530 Subject: [PATCH] cmsModule --- .../Controllers/Admin/AboutUsController.php | 83 ++++---- .../Controllers/Admin/ManageCmsController.php | 13 ++ .../Admin/ManageCustomerController.php | 31 ++- .../Admin/PrivacyPolicyController.php | 28 ++- app/Models/ManageModule.php | 21 ++ app/Models/ManageModuleLink.php | 22 ++ app/Models/PrivacyPolicy.php | 2 + ..._27_100833_create_manage_modules_table.php | 32 +++ ...01115_create_manage_module_links_table.php | 31 +++ .../manage_privacy_policy/privacy_policy.js | 7 +- .../views/Admin/layouts/master.blade.php | 12 +- .../manage_aboutus/manage_about_us.blade.php | 144 +++++++++++++ .../manage_about_us_cust.blade.php | 73 +++++++ .../manage_about_us_rest.blade.php | 80 +++++++ .../pages/manage_cms/manage_cms.blade.php | 102 +++++++++ .../manage_privacy/manage_privacy.blade.php | 161 +++++++-------- .../manage_privacy_policy_edit.blade.php | 5 +- .../manage_privacy_policy_edit_rest.blade.php | 91 ++++++++ .../manage_customer/customer.blade.php | 195 +++++++++--------- routes/web.php | 9 + 20 files changed, 918 insertions(+), 224 deletions(-) create mode 100644 app/Http/Controllers/Admin/ManageCmsController.php create mode 100644 app/Models/ManageModule.php create mode 100644 app/Models/ManageModuleLink.php create mode 100644 database/migrations/2024_05_27_100833_create_manage_modules_table.php create mode 100644 database/migrations/2024_05_27_101115_create_manage_module_links_table.php create mode 100644 resources/views/Admin/pages/manage_cms/manage_aboutus/manage_about_us.blade.php create mode 100644 resources/views/Admin/pages/manage_cms/manage_aboutus/manage_about_us_cust.blade.php create mode 100644 resources/views/Admin/pages/manage_cms/manage_aboutus/manage_about_us_rest.blade.php create mode 100644 resources/views/Admin/pages/manage_cms/manage_cms.blade.php create mode 100644 resources/views/Admin/pages/manage_cms/manage_privacy/manage_privacy_policy_edit_rest.blade.php diff --git a/app/Http/Controllers/Admin/AboutUsController.php b/app/Http/Controllers/Admin/AboutUsController.php index 18802c9..0122e9f 100644 --- a/app/Http/Controllers/Admin/AboutUsController.php +++ b/app/Http/Controllers/Admin/AboutUsController.php @@ -16,46 +16,59 @@ use Illuminate\Support\Facades\Auth; class AboutUsController extends Controller { - // public function index() - // { + public function index() + { $view_about = Aboutus::get()->toArray(); - // return view('Admin.pages.manage_cms.manage_aboutus.manage_aboutsus'); - // } - public function index(Request $request) - { - - try { - $about_data = Aboutus::with('category')->get(); - // @dd($about_data); - - foreach ($about_data as $k => $val) { - $about_data[$k]['thumbnail_image'] = ListingImageUrl('about_images', $val['thumbnail_image']); - } - - return view('Admin.pages.manage_cms.manage_aboutus.manage_aboutsus', compact('about_data')); - } catch (Exception $e) { - Log::error("Manage About Page Not Load " . $e->getMessage()); - return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500); - } + return view('Admin.pages.manage_cms.manage_aboutus.manage_about_us',compact('view_about')); } - public function edit($id) + // public function index(Request $request) + // { + + + // try { + // $about_data = Aboutus::with('category')->get(); + // // @dd($about_data); + + // foreach ($about_data as $k => $val) { + // $about_data[$k]['thumbnail_image'] = ListingImageUrl('about_images', $val['thumbnail_image']); + // } + + // return view('Admin.pages.manage_cms.manage_aboutus.manage_aboutsus', compact('about_data')); + // } catch (Exception $e) { + // Log::error("Manage About Page Not Load " . $e->getMessage()); + // return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500); + // } + // } + + // public function edit($id) + // { + + + + + // try { + // $edit_service = Aboutus::find($id)->toArray(); + // $about_us_cat = MainCategory::all()->toArray(); + // $edit_service['thumbnail_image'] = ListingImageUrl('about_images', $edit_service['thumbnail_image']); + + // return view('Admin.pages.manage_cms.manage_aboutus.manage_about_us_edit', compact('edit_service', 'about_us_cat')); + // } catch (Exception $e) { + // Log::error("edit voucher Page Load Failed " . $e->getMessage()); + // return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500); + // } + // } + public function edit($id){ + $edit_privacy_policy = Aboutus::find($id)->toArray(); + return view('Admin.pages.manage_cms.manage_aboutus.manage_about_us_cust', compact('edit_privacy_policy')); + } + + public function edit_rest($id) { - - - - - try { - $edit_service = Aboutus::find($id)->toArray(); - $about_us_cat = MainCategory::all()->toArray(); - $edit_service['thumbnail_image'] = ListingImageUrl('about_images', $edit_service['thumbnail_image']); - - return view('Admin.pages.manage_cms.manage_aboutus.manage_about_us_edit', compact('edit_service', 'about_us_cat')); - } catch (Exception $e) { - Log::error("edit voucher Page Load Failed " . $e->getMessage()); - return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500); - } + $edit_about_rest = Aboutus::find($id)->toArray(); + dd('sdfnkjfn'); + return view('Admin.pages.manage_cms.manage_aboutus.manage_about_us_rest', compact('edit_about_rest')); } public function update(Request $request) diff --git a/app/Http/Controllers/Admin/ManageCmsController.php b/app/Http/Controllers/Admin/ManageCmsController.php new file mode 100644 index 0000000..afd9e05 --- /dev/null +++ b/app/Http/Controllers/Admin/ManageCmsController.php @@ -0,0 +1,13 @@ +orderBy('created_at', 'desc')->get(); + + // foreach ($customers as $customer) { + // $activePassportCount = OrderedPassport::where('iam_principal_xid', $customer->id) + // ->where('is_active', 1) // Assuming 'status' field indicates the status of the passport + // ->count(); + // $customer->activePassportCount = $activePassportCount; + // } + return view('Admin.pages.manage_users.manage_customer.customer', compact('customers')); + } catch (Exception $e) { + Log::error("Manage Voucher Page Not Load " . $e->getMessage()); + return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500); + } } + } diff --git a/app/Http/Controllers/Admin/PrivacyPolicyController.php b/app/Http/Controllers/Admin/PrivacyPolicyController.php index 96565fa..85924a2 100644 --- a/app/Http/Controllers/Admin/PrivacyPolicyController.php +++ b/app/Http/Controllers/Admin/PrivacyPolicyController.php @@ -19,13 +19,35 @@ class PrivacyPolicyController extends Controller // } public function index(){ - $view_policy = PrivacyPolicy::get()->toArray(); - // dd($view_privacy_policy); - return view('Admin.pages.manage_cms.manage_privacy.manage_privacy'); + $view_privacy = PrivacyPolicy::get()->toArray(); + return view('Admin.pages.manage_cms.manage_privacy.manage_privacy', compact('view_privacy')); } + public function edit($id){ $edit_privacy_policy = PrivacyPolicy::find($id)->toArray(); return view('Admin.pages.manage_cms.manage_privacy.manage_privacy_policy_edit', compact('edit_privacy_policy')); } + + public function update(Request $request) + { + $update = PrivacyPolicy::find($request->privacy_custom_id); + $update->description = $request->input('privacy_policy'); + $update->save(); + return response()->json(['success' => true, 'status' => 200]); + } + public function edit_rest($id) + { + $edit_privacy_policy_rest = PrivacyPolicy::find($id)->toArray(); + return view('Admin.pages.manage_cms.manage_privacy.manage_privacy_policy_edit_rest', compact('edit_privacy_policy_rest')); + } + + public function update_rest(Request $request) + { + $update = PrivacyPolicy::find($request->privacy_rest_id); + $update->description = $request->input('edit_privacy_policy_rest'); + $update->save(); + return response()->json(['success' => true, 'status' => 200]); + } + } diff --git a/app/Models/ManageModule.php b/app/Models/ManageModule.php new file mode 100644 index 0000000..555f2a3 --- /dev/null +++ b/app/Models/ManageModule.php @@ -0,0 +1,21 @@ +hasMany(ManageModuleLink::class); + } +} diff --git a/app/Models/ManageModuleLink.php b/app/Models/ManageModuleLink.php new file mode 100644 index 0000000..eb0937f --- /dev/null +++ b/app/Models/ManageModuleLink.php @@ -0,0 +1,22 @@ +belongsTo(IamPrincipal::class); + } + + public function module() + { + return $this->belongsTo(ManageModule::class); + } +} diff --git a/app/Models/PrivacyPolicy.php b/app/Models/PrivacyPolicy.php index 1b23ff7..7fafbcf 100644 --- a/app/Models/PrivacyPolicy.php +++ b/app/Models/PrivacyPolicy.php @@ -7,5 +7,7 @@ use Illuminate\Database\Eloquent\Model; class PrivacyPolicy extends Model { + protected $table = "privacy_policies"; + use HasFactory; } diff --git a/database/migrations/2024_05_27_100833_create_manage_modules_table.php b/database/migrations/2024_05_27_100833_create_manage_modules_table.php new file mode 100644 index 0000000..269c936 --- /dev/null +++ b/database/migrations/2024_05_27_100833_create_manage_modules_table.php @@ -0,0 +1,32 @@ +id(); + $table->string('name'); + $table->string('slug'); + $table->integer('created_by')->nullable(); + $table->integer('modified_by')->nullable(); + $table->softDeletes(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('manage_modules'); + } +}; diff --git a/database/migrations/2024_05_27_101115_create_manage_module_links_table.php b/database/migrations/2024_05_27_101115_create_manage_module_links_table.php new file mode 100644 index 0000000..2d90477 --- /dev/null +++ b/database/migrations/2024_05_27_101115_create_manage_module_links_table.php @@ -0,0 +1,31 @@ +id(); + $table->unsignedBigInteger('principal_xid'); + $table->foreign('principal_xid')->references('id')->on('iam_principal')->onDelete('cascade'); + $table->unsignedBigInteger('manage_modules_xid'); + $table->foreign('manage_modules_xid')->references('id')->on('manage_modules')->onDelete('cascade'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('manage_module_links'); + } +}; diff --git a/public/assets/js/admin/manage_cms/manage_privacy_policy/privacy_policy.js b/public/assets/js/admin/manage_cms/manage_privacy_policy/privacy_policy.js index 2a93dd3..d23d191 100644 --- a/public/assets/js/admin/manage_cms/manage_privacy_policy/privacy_policy.js +++ b/public/assets/js/admin/manage_cms/manage_privacy_policy/privacy_policy.js @@ -5,6 +5,7 @@ $.validator.addMethod("quillNotEmpty", function(value, element) { var quill = new Quill('#terms-quill-edit'); return quill.getText().trim().length > 0; }, "Please enter privacy Policy "); + $('#privacy_policy_form').validate({ ignore: [], debug: false, @@ -49,9 +50,13 @@ $.validator.addMethod("quillNotEmpty", function(value, element) { }); }); + + + + // privacy policy for rest $('#update_privacy_policy_rest').on("click", function (e) { - + // alert("kjhskhf"); $.validator.addMethod("quillNotEmpty", function(value, element) { var quill = new Quill('#terms-quill-edit'); return quill.getText().trim().length > 0; diff --git a/resources/views/Admin/layouts/master.blade.php b/resources/views/Admin/layouts/master.blade.php index 0ce60f0..e6fb32b 100644 --- a/resources/views/Admin/layouts/master.blade.php +++ b/resources/views/Admin/layouts/master.blade.php @@ -181,7 +181,7 @@ - + + + + + + + + + + + + + + + + + +@endsection +@section('section_script') + + + + +@endsection \ No newline at end of file diff --git a/resources/views/Admin/pages/manage_cms/manage_aboutus/manage_about_us_rest.blade.php b/resources/views/Admin/pages/manage_cms/manage_aboutus/manage_about_us_rest.blade.php new file mode 100644 index 0000000..e4de331 --- /dev/null +++ b/resources/views/Admin/pages/manage_cms/manage_aboutus/manage_about_us_rest.blade.php @@ -0,0 +1,80 @@ +@extends('admin.layouts.master') + +@section('content') +@php + $currentPage = 'manage_cms'; +@endphp + +
+
+
+ +
+
+
+
+
+
+
+
+
+ +
{!! $edit_about_rest['description'] !!}
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+
+ + +@endsection +@section('section_script') + + + +@endsection diff --git a/resources/views/Admin/pages/manage_cms/manage_cms.blade.php b/resources/views/Admin/pages/manage_cms/manage_cms.blade.php new file mode 100644 index 0000000..70b4cb4 --- /dev/null +++ b/resources/views/Admin/pages/manage_cms/manage_cms.blade.php @@ -0,0 +1,102 @@ +@extends('admin.layouts.master') + +@section('content') + @php + $currentPage = 'manage-cms'; + @endphp + + + + + @endsection + +@section('section_script') + +@endsection + + diff --git a/resources/views/Admin/pages/manage_cms/manage_privacy/manage_privacy.blade.php b/resources/views/Admin/pages/manage_cms/manage_privacy/manage_privacy.blade.php index ab1a497..a0d0357 100644 --- a/resources/views/Admin/pages/manage_cms/manage_privacy/manage_privacy.blade.php +++ b/resources/views/Admin/pages/manage_cms/manage_privacy/manage_privacy.blade.php @@ -81,94 +81,91 @@ $currentPage = 'manage-privacy';
-->
-
-
-
-
-
-
Privacy Policy Customer
- - @if(!empty($view_privacy_policy)) - - Edit Details - -@else -

No privacy policy found.

-@endif +
+
+
+
+
+
Privacy Policy Customer
-
-
-
-
-
-
-
-
-
-
-
-
-

- {!! $view_privacy_policy[0]['description'] !!} -

-
-
+ @if(!empty($view_privacy )) + + Edit Details + + @else +

No privacy policy found.

+ @endif -
- -
- -
- - -
- -
-
-
- -
-
-
-
-
Privacy Policy Resturant
- - Edit Details - -
-
- - -
-
-
-
-
-
-
-
-
-

{!! $view_privacy_policy[1]['description'] !!}

-
-
-
- -
- -
- - -
- -
+
+
+
+
+
+
+
+
+

+ {!! $view_privacy[0]['description'] !!} +

+
+
+ +
+ +
+ +
+ + +
+ +
+
+
+ +
+
+
+
+
Privacy Policy Resturant
+ + Edit Details + +
+
+ + +
+
+
+
+
+
+
+
+
+

+ {!! $view_privacy[1]['description'] !!} +

+
+
+ +
+ +
+ + +
+ +
+
+
+
+
diff --git a/resources/views/Admin/pages/manage_cms/manage_privacy/manage_privacy_policy_edit.blade.php b/resources/views/Admin/pages/manage_cms/manage_privacy/manage_privacy_policy_edit.blade.php index 51e9e9c..90d32fa 100644 --- a/resources/views/Admin/pages/manage_cms/manage_privacy/manage_privacy_policy_edit.blade.php +++ b/resources/views/Admin/pages/manage_cms/manage_privacy/manage_privacy_policy_edit.blade.php @@ -12,7 +12,7 @@
+ href="{{ route('manage.privacy')}}">
Edit Details for customer
@@ -30,7 +30,7 @@
-
{!! $edit_privacy_policy['description'] !!}
+
{!! $edit_privacy_policy['description'] !!}
@@ -40,6 +40,7 @@
+
diff --git a/resources/views/Admin/pages/manage_cms/manage_privacy/manage_privacy_policy_edit_rest.blade.php b/resources/views/Admin/pages/manage_cms/manage_privacy/manage_privacy_policy_edit_rest.blade.php new file mode 100644 index 0000000..7f1d0d5 --- /dev/null +++ b/resources/views/Admin/pages/manage_cms/manage_privacy/manage_privacy_policy_edit_rest.blade.php @@ -0,0 +1,91 @@ +@extends('admin.layouts.master') + +@section('content') +@php + $currentPage = 'manage_cms'; +@endphp + + + + +
+
+
+ +
+
+
+
+
+
+
+
+
+ +
{!! $edit_privacy_policy_rest['description'] !!}
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+ + + + + +@endsection +@section('section_script') + + + + +@endsection \ No newline at end of file diff --git a/resources/views/Admin/pages/manage_users/manage_customer/customer.blade.php b/resources/views/Admin/pages/manage_users/manage_customer/customer.blade.php index cd7bad3..de3e9b9 100644 --- a/resources/views/Admin/pages/manage_users/manage_customer/customer.blade.php +++ b/resources/views/Admin/pages/manage_users/manage_customer/customer.blade.php @@ -7,89 +7,95 @@ $currentPage = 'manage-patient'; -
-
-
-
-
-
-
Manage Customers
-
-
- -
-
+
+
+
+
+
+
+
Manage Customers
-
-
- - - - - - - - - - - +
-
- - - - - - - - - - - - - - - - + + + +
+
+
-
- -
-
Sr noFull NameUser IDEmail IdDate of birthPhone NumberLocationPassportsAction
-
- -
-
1Akanksha Surve1234567akanksha@gmail.com08/22/2023+5624878954New York - View - -
- - -
-
+ + + + + + + + + + + + + + + + @foreach ($customers as $customer) + + + + + + + + + + + + + + @endforeach + + + + + + + - -
+
+ +
+
Sr noFull NameUser IDEmail IdDate of birthPhone NumberLocationPassportsAction
+
+ +
+
{{ $loop->iteration }}{{ $customer->first_name }}{{ $customer->id }}{{ $customer->address_line1 }}{{ $customer->email_address }}{{ \Carbon\Carbon::parse($customer->date_of_birth)->format('d/m/Y') }}{{ $customer->phone_number }}{{ $customer->activePassportCount }} + View + +
+ + +
+
-
-
+ +
+
+
@endsection @@ -247,7 +253,10 @@ $currentPage = 'manage-patient'; "<'table-responsive'tr>" + "<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>", "oLanguage": { - "oPaginate": { "sPrevious": '', "sNext": '' }, + "oPaginate": { + "sPrevious": '', + "sNext": '' + }, "sInfo": "Showing page _PAGE_ of _PAGES_", "sSearch": '', "sSearchPlaceholder": "Search...", @@ -259,8 +268,8 @@ $currentPage = 'manage-patient'; }); -@endsection +@endsection \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index aa5be89..e06ed12 100644 --- a/routes/web.php +++ b/routes/web.php @@ -19,6 +19,7 @@ use App\Http\Controllers\Admin\ManageFeedbackController; use App\Http\Controllers\Admin\ManageNotificationsController; use App\Http\Controllers\Admin\DashboardController ; use App\Http\Controllers\Admin\LoginController; +use App\Http\Controllers\Admin\ManageCmsController; Route::get('/', [LoginController::class, 'index'])->name('login'); Route::post('/check_login', [LoginController::class, 'login_check']); @@ -53,6 +54,8 @@ Route::get('/manage-vouchers', [ManageVouchersController ::class, 'index'])->nam //*******************************************************manage contact******************************************************** Route::get('/manage-contact', [ManageContactUsController ::class, 'index'])->name('manage.contact'); //*******************************************************manage cms******************************************************** +Route::get('/manage-cms', [ManageCmsController::class, 'index'])->name('manage.cms'); + //*******************************************************manage new&article******************************************************** Route::get('/manage-new-articles', [ManageNewsAndArticlesController ::class, 'index'])->name('manage.Newarticles'); Route::get('/change-article-Status', [ManageNewsAndArticlesController::class, 'change_news_article_Status']); @@ -71,6 +74,8 @@ Route::post('/insert_about_us', [AboutUsController::class, 'insert']); Route::get('/manage-about-us', [AboutUsController ::class, 'index'])->name('manage.aboutUs'); Route::get('/about_us_edit/{id}', [AboutUsController::class, 'edit'])->name('about_us_edit'); + Route::get('/about_us_rest/{id}', [PrivacyPolicyController::class, 'edit_rest'])->name('aboutusRestEdit'); + Route::post('/about_us_update', [AboutUsController::class, 'update']); Route::delete('/delete_about/{id}', [AboutUsController::class, 'delete_about']); Route::get('/change_Status', [AboutUsController::class, 'change_about_Status']); @@ -93,6 +98,10 @@ Route::post('/insert_about_us', [AboutUsController::class, 'insert']); //*******************************************************manage privacypolicy******************************************************** Route::get('/privacy', [ PrivacyPolicyController ::class, 'index'])->name('manage.privacy'); Route::get('/privacy_edit/{id}', [PrivacyPolicyController::class, 'edit'])->name('privacy_edit'); + Route::get('/privacy_edit_rest/{id}', [PrivacyPolicyController::class, 'edit_rest'])->name('privacy_edit_rest'); + Route::post('/privacy_policy_update', [PrivacyPolicyController::class, 'update']); + Route::post('/privacy_policy_update_rest', [PrivacyPolicyController::class, 'update_rest']); + //*******************************************************manage reports******************************************************** Route::get('/manage-reports', [ ManageReportsController ::class, 'index'])->name('manage.reports');