From 7401abca32b705c7576aa6954d7669b63cec1207 Mon Sep 17 00:00:00 2001 From: sayaliparab Date: Mon, 27 May 2024 12:10:55 +0530 Subject: [PATCH] CMS --- .../Controllers/Admin/AboutUsController.php | 154 +++++++- app/Http/Controllers/Admin/FaqController.php | 64 +++- .../Admin/PrivacyPolicyController.php | 19 +- .../Controllers/Admin/TermsController.php | 36 +- app/Models/Faq.php | 4 + app/Models/Termsandconditions.php | 12 + app/Services/Admin/about_us_service.php | 44 +++ app/Services/Admin/faqServices.php | 20 + .../Admin/termsandconditionServices.php | 17 + .../2024_05_25_084200_create_faqs_table.php | 33 ++ ...152503_create_termsandconditions_table.php | 30 ++ .../manage_cms/manage_aboutus/add_about_us.js | 4 +- .../manage_aboutus/edit_about_us.js | 4 +- .../admin/manage_cms/manage_aboutus/main.js | 2 +- .../js/admin/manage_cms/manage_faq/add_faq.js | 92 +++-- .../manage_terms_condition.js | 193 ++++++---- .../manage_about_us_add.blade.php | 110 ++++++ .../manage_about_us_edit.blade.php | 104 +++-- .../manage_aboutus/manage_aboutsus.blade.php | 185 +++++---- .../manage_faq/manage_faq.blade.php | 362 ++++++++++++------ .../manage_privacy/manage_privacy.blade.php | 94 ++++- .../manage_privacy_policy_edit.blade.php | 73 ++++ .../manage_terms/manage_terms.blade.php | 71 +--- .../manage_terms/manage_terms_edit.blade.php | 114 ++++++ .../manage_feedback/manage_feedback.blade.php | 4 +- routes/web.php | 19 +- 26 files changed, 1460 insertions(+), 404 deletions(-) create mode 100644 app/Models/Termsandconditions.php create mode 100644 app/Services/Admin/about_us_service.php create mode 100644 app/Services/Admin/faqServices.php create mode 100644 app/Services/Admin/termsandconditionServices.php create mode 100644 database/migrations/2024_05_25_084200_create_faqs_table.php create mode 100644 database/migrations/2024_05_25_152503_create_termsandconditions_table.php create mode 100644 resources/views/Admin/pages/manage_cms/manage_aboutus/manage_about_us_add.blade.php create mode 100644 resources/views/Admin/pages/manage_cms/manage_privacy/manage_privacy_policy_edit.blade.php create mode 100644 resources/views/Admin/pages/manage_cms/manage_terms/manage_terms_edit.blade.php diff --git a/app/Http/Controllers/Admin/AboutUsController.php b/app/Http/Controllers/Admin/AboutUsController.php index 782df72..18802c9 100644 --- a/app/Http/Controllers/Admin/AboutUsController.php +++ b/app/Http/Controllers/Admin/AboutUsController.php @@ -4,30 +4,170 @@ namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use Illuminate\Http\Request; +use App\Models\Aboutus; +use App\Models\MainCategory; +use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Log; +use Exception; +use Illuminate\Support\Facades\Hash; +use Illuminate\Support\Facades\Auth; + + class AboutUsController extends Controller { - public function index(){ - - return view('Admin.pages.manage_cms.manage_aboutus.manage_aboutsus'); + // public function index() + // { + // 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); + } } public function edit($id) { - - + + try { $edit_service = Aboutus::find($id)->toArray(); - $about_us_cat = AboutUsCategory::all()->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_about_us_edit', compact('edit_service', 'about_us_cat')); + 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 update(Request $request) + { + + + try { + DB::beginTransaction(); + $about_data = Aboutus::where('id', $request->about_id)->first(); + + if ($request->hasFile('about_image')) { + $image = $request->file('about_image'); + $normalImage = saveSingleImageWithoutCrop($image, 'about_images'); + $about_data->thumbnail_image = $normalImage; + } + + $about_data->title = $request->input('about_title'); + $about_data->description = $request->input('about_des'); + $about_data->category_xid = $request->input('category'); + + $about_data->save(); + + + DB::commit(); + + return jsonResponseWithSuccessMessage(__('success.update_data')); + } catch (Exception $e) { + DB::rollBack(); + Log::error("updateCustomerNewsArticle Services Page Load Failed " . $e->getMessage()); + return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500); + } + } + + + public function delete_about($id) + { + + + try { + $blog = Aboutus::find($id); + + if (!$blog) { + return response()->json(['error' => 'Aboutus entry not found.'], 404); + } + + $blog->delete(); + + return response()->json(['success' => 'Aboutus entry deleted successfully.']); + } catch (\Exception $e) { + // Log the exception or handle it in a way that makes sense for your application + return response()->json(['error' => 'An error occurred while deleting the Aboutus entry.'], 500); + } + } + public function change_about_Status(Request $request) + { + + + try { + $status = Aboutus::find($request->program_id); + + if (!$status) { + return response()->json(['error' => 'Aboutus entry not found.'], 404); + } + + $status->is_active = $request->status; + $status->save(); + + return response()->json(['success' => 'Status change successfully.']); + } catch (\Exception $e) { + // Log the exception or handle it in a way that makes sense for your application + return response()->json(['error' => 'An error occurred while changing the status.'], 500); + } + } + + public function add() + { + $about_us_cat = MainCategory::all()->toArray(); + return view('Admin.pages.manage_cms.manage_aboutus.manage_about_us_add', compact('about_us_cat')); + } + + public function insert(Request $request) + { + + try { + DB::beginTransaction(); + + if (isset($request->about_image)) { + $image = $request->about_image; + $image_db = null; + } else { + $image = null; + $image_db = $request->about_image; + } + $tnormalImage = saveSingleImageWithoutCrop($image, 'about_images', $image_db); + + + $about_data = new Aboutus(); + $about_data->title = $request->input('about_title'); + $about_data->description = $request->input('about_des'); + + $about_data->thumbnail_image = $tnormalImage; + $about_data->category_xid = $request->input('category'); + $about_data->save(); + + DB::commit(); + return jsonResponseWithSuccessMessage(__('success.save_data')); + // return $voucher_data; + } catch (Exception $e) { + DB::rollBack(); + Log::error("About Store Page Load Failed " . $e->getMessage()); + return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500); + } + } + } diff --git a/app/Http/Controllers/Admin/FaqController.php b/app/Http/Controllers/Admin/FaqController.php index ca37ce4..0fe569b 100644 --- a/app/Http/Controllers/Admin/FaqController.php +++ b/app/Http/Controllers/Admin/FaqController.php @@ -2,13 +2,71 @@ namespace App\Http\Controllers\Admin; +use App\Services\Admin\faqServices; +use App\Models\Faq; +use Illuminate\Support\Facades\Log; + use App\Http\Controllers\Controller; use Illuminate\Http\Request; class FaqController extends Controller { - public function index(){ - - return view('Admin.pages.manage_cms.manage_faq.manage_faq'); + protected $faqServices; + public function __construct(faqServices $faqServices) + { + $this->faqServices = $faqServices; + } + + public function index() + { + $data = $this->faqServices->viewfaq(); + return view('Admin.pages.manage_cms.manage_faq.manage_faq')->with($data); + } + + public function change_faqStatus(Request $request) + { + $status = Faq::find($request->program_id); + $status->is_active = $request->status; + $status->save(); + return response()->json(['success' => 'Status change successfully.']); + } + + + public function delete_faq($id) + { + $faq = Faq::find($id); + if (!$faq) { + return response()->json(['success' => false, 'status' => 404, 'message' => 'FAQ not found']); + } + + $faq->delete(); + return response()->json(['success' => true, 'status' => 200]); + } + + public function update(Request $request) + { + $faq = new Faq(); + $faq = Faq::find($request->faq_id); + $faq->question = $request->question; + $faq->answers = $request->answer; + $faq->faq_category_id = $request->faq_categ; + $faq->save(); + return response()->json(['success' => true, 'status' => 200]); + } + + public function store(Request $request) + { + try { + $faq = new Faq(); + $faq->question = $request->question; + $faq->answers = $request->answer; + $faq->faq_category_id = $request->faq_categ; + $faq->save(); + + return response()->json(['success' => true, 'status' => 200]); + } catch (\Exception $e) { + // Log the exception or handle it as needed + return response()->json(['success' => false, 'error' => $e->getMessage(), 'status' => 500]); + } } } diff --git a/app/Http/Controllers/Admin/PrivacyPolicyController.php b/app/Http/Controllers/Admin/PrivacyPolicyController.php index ea45c9c..96565fa 100644 --- a/app/Http/Controllers/Admin/PrivacyPolicyController.php +++ b/app/Http/Controllers/Admin/PrivacyPolicyController.php @@ -4,11 +4,28 @@ namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use Illuminate\Http\Request; +use App\Models\PrivacyPolicy; class PrivacyPolicyController extends Controller { - public function index(){ + // public function index(){ + // return view('Admin.pages.manage_cms.manage_privacy.manage_privacy'); + // } + // public function index(){ + // $view_privacy_policy = PrivacyPolicy::get()->toArray(); + // // dd($view_privacy_policy); + // return view('Admin.pages.manage_cms.manage_privacy.manage_privacy'); + // } + + public function index(){ + $view_policy = PrivacyPolicy::get()->toArray(); + // dd($view_privacy_policy); return view('Admin.pages.manage_cms.manage_privacy.manage_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')); + } } diff --git a/app/Http/Controllers/Admin/TermsController.php b/app/Http/Controllers/Admin/TermsController.php index aed5d85..0ccd18b 100644 --- a/app/Http/Controllers/Admin/TermsController.php +++ b/app/Http/Controllers/Admin/TermsController.php @@ -1,15 +1,45 @@ toArray(); + + return view('Admin.pages.manage_cms.manage_terms.manage_terms',compact('terms_condition')); } + // public function edit($id) + // { + // $terms = Termsandconditions::find($id)->toArray(); + // return view('Admin.pages.manage_cms.manage_terms.manage_terms_edit', compact('terms')); + // } + public function edit($id) +{ + + $terms = Termsandconditions::find($id); + // dd($terms); + return view('Admin.pages.manage_cms.manage_terms.manage_terms_edit', compact('terms')); + +} + + public function update(Request $request) + { + + $validated = $request->validate([ + + 'article_des' => 'required', // Add validation for article_des + ]); + $update = Termsandconditions::find($request->custom_id); + $update->message = $request->input('article_des'); + $update->save(); + return response()->json(['success' => true, 'status' => 200]); + } } diff --git a/app/Models/Faq.php b/app/Models/Faq.php index f481246..04f5364 100644 --- a/app/Models/Faq.php +++ b/app/Models/Faq.php @@ -4,9 +4,13 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; + class Faq extends Model { + use SoftDeletes; + use HasFactory; protected $table = 'faqs'; diff --git a/app/Models/Termsandconditions.php b/app/Models/Termsandconditions.php new file mode 100644 index 0000000..ae9331a --- /dev/null +++ b/app/Models/Termsandconditions.php @@ -0,0 +1,12 @@ +get(); + return $view_service; + } catch (Exception $ex) { + Log::error($ex); + throw $ex; + } + } + + public function index_about_us() + { + try { + $view_about_us = Aboutus::get(); + return $view_about_us; + } catch (Exception $ex) { + Log::error($ex); + throw $ex; + } + } + + +} + diff --git a/app/Services/Admin/faqServices.php b/app/Services/Admin/faqServices.php new file mode 100644 index 0000000..882ac98 --- /dev/null +++ b/app/Services/Admin/faqServices.php @@ -0,0 +1,20 @@ +get(); + return $data; + } + + + +} diff --git a/app/Services/Admin/termsandconditionServices.php b/app/Services/Admin/termsandconditionServices.php new file mode 100644 index 0000000..add4c98 --- /dev/null +++ b/app/Services/Admin/termsandconditionServices.php @@ -0,0 +1,17 @@ +get(); + return $data; + } + +} + diff --git a/database/migrations/2024_05_25_084200_create_faqs_table.php b/database/migrations/2024_05_25_084200_create_faqs_table.php new file mode 100644 index 0000000..c27db88 --- /dev/null +++ b/database/migrations/2024_05_25_084200_create_faqs_table.php @@ -0,0 +1,33 @@ +id(); + $table->unsignedBigInteger('faq_category_id'); + $table->foreign('faq_category_id')->references('id')->on('main_category'); + $table->longText('question', 100)->nullable(); + $table->longText('answers', 100)->nullable(); + $table->enum('is_active',['0','1'])->comment('0 = Inactive, 1 = Active'); + $table->softDeletes(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('faqs'); + } +}; diff --git a/database/migrations/2024_05_25_152503_create_termsandconditions_table.php b/database/migrations/2024_05_25_152503_create_termsandconditions_table.php new file mode 100644 index 0000000..cd5a9c8 --- /dev/null +++ b/database/migrations/2024_05_25_152503_create_termsandconditions_table.php @@ -0,0 +1,30 @@ +id(); + $table->unsignedBigInteger('category_xid'); + $table->foreign('category_xid')->references('id')->on('main_categories'); + $table->longtext('message')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('termsandconditions'); + } +}; diff --git a/public/assets/js/admin/manage_cms/manage_aboutus/add_about_us.js b/public/assets/js/admin/manage_cms/manage_aboutus/add_about_us.js index 241abe2..de20cb4 100644 --- a/public/assets/js/admin/manage_cms/manage_aboutus/add_about_us.js +++ b/public/assets/js/admin/manage_cms/manage_aboutus/add_about_us.js @@ -62,12 +62,12 @@ $(document).on("click", "#add_about_btn", function (e) { if (result.status_code == 200) { toastr.success('About Us Data Added Successfully'); setTimeout(function() { - window.location.href = base_url + "/about_us"; + window.location.href = base_url + "/manage-about-us"; }, 2000); } else { toastr.error('Something Went Wrong'); setTimeout(function() { - window.location.href = base_url + "/about_us"; + window.location.href = base_url + "/manage-about-us"; }, 2000); } $('#add_about_btn').attr('disabled', false); diff --git a/public/assets/js/admin/manage_cms/manage_aboutus/edit_about_us.js b/public/assets/js/admin/manage_cms/manage_aboutus/edit_about_us.js index 6443c68..d1c8b84 100644 --- a/public/assets/js/admin/manage_cms/manage_aboutus/edit_about_us.js +++ b/public/assets/js/admin/manage_cms/manage_aboutus/edit_about_us.js @@ -56,12 +56,12 @@ $('#update_about_us').on("click", function (e) { if (result.status_code == 200) { toastr.success('About Us Data Updated Successfully'); setTimeout(function() { - window.location.href = base_url + "/about_us"; + window.location.href = base_url + "/manage-about-us"; }, 2000); } else { toastr.error('Something Went Wrong'); setTimeout(function() { - window.location.href = base_url + "/about_us"; + window.location.href = base_url + "/manage-about-us"; }, 2000); } $('#update_about_us').attr('disabled', false); diff --git a/public/assets/js/admin/manage_cms/manage_aboutus/main.js b/public/assets/js/admin/manage_cms/manage_aboutus/main.js index d11f02d..10fb42f 100644 --- a/public/assets/js/admin/manage_cms/manage_aboutus/main.js +++ b/public/assets/js/admin/manage_cms/manage_aboutus/main.js @@ -59,7 +59,7 @@ $(document).on("click", ".delete_about_button", function (e) { success: function (response) { console.log(response); toastr.success("About Data Successfully"); - window.location.href = base_url + "/about_us"; + window.location.href = base_url + "/manage-about-us"; } }); }); diff --git a/public/assets/js/admin/manage_cms/manage_faq/add_faq.js b/public/assets/js/admin/manage_cms/manage_faq/add_faq.js index 0c46cd0..c9b0d85 100644 --- a/public/assets/js/admin/manage_cms/manage_faq/add_faq.js +++ b/public/assets/js/admin/manage_cms/manage_faq/add_faq.js @@ -5,7 +5,7 @@ $(document).on("click", "#submit_faq", function (e) { rules: { question: { required: true, - minlength: 255 + maxlength: 255 }, answer: { required: true, @@ -17,7 +17,7 @@ $(document).on("click", "#submit_faq", function (e) { messages: { question: { required: "Please enter the question.", - minlength: "The question must be at least 255 characters long." + maxlength: "The question must be at least 255 characters long." }, answer: { required: "Please enter the answer.", @@ -61,36 +61,72 @@ $(document).on("click", "#submit_faq", function (e) { // add faq end here -//delete -$(document).ready(function () { - $('.delete-faq-btn').on('click', function (e) { - e.preventDefault(); +//delete old +// $(document).ready(function () { +// $('.delete-faq-btn').on('click', function (e) { +// e.preventDefault(); - var faqId = $(this).data('faq-id'); - if (confirm('Are you sure you want to delete this FAQ?')) { - $.ajax({ - url: url_path + '/delete_faq/' + faqId, - type: 'DELETE', - headers: { - 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') - }, - success: function (response) { - if (response.status == 200) { - toastr.success('Faq deleted successfully'); - setTimeout(function () { - window.location.href = url_path + "/faq"; - }, 1000); - } else { - toastr.error("Something went wrong"); - } - }, - error: function () { - toastr.error("Error deleting FAQ"); - } - }); +// var faqId = $(this).data('faq-id'); +// if (confirm('Are you sure you want to delete this FAQ?')) { +// $.ajax({ +// url: url_path + '/delete_faq/' + faqId, +// type: 'DELETE', +// headers: { +// 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') +// }, +// success: function (response) { +// if (response.status == 200) { +// toastr.success('Faq deleted successfully'); +// setTimeout(function () { +// window.location.href = url_path + "/faq"; +// }, 1000); +// } else { +// toastr.error("Something went wrong"); +// } +// }, +// error: function () { +// toastr.error("Error deleting FAQ"); +// } +// }); +// } +// }); +// }); + +//new delete with modal +$(document).on("click", ".delete_about", function () { + var delete_id = $(this).data('faq-id'); // Corrected this line + $('#delete_about_id').val(delete_id); +}); + +$(document).on("click", ".delete_about_button", function (e) { + e.preventDefault(); + let base_url = url_path; + var faqId = $('#delete_about_id').val(); // Ensure you're getting the correct ID + + $.ajaxSetup({ + headers: { + "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"), + }, + }); + $.ajax({ + type: "DELETE", + url: base_url + "/delete_faq/" + faqId, + success: function (response) { + if(response.success) { + toastr.success("FAQ successfully deleted"); + window.location.href = base_url + "/faq"; + } else { + toastr.error(response.message); + } + }, + error: function (response) { + toastr.error("An error occurred while deleting the FAQ"); } }); }); +//end delete + + // change status $(".switch-btn").on("change", ".active_newsletter", function () { diff --git a/public/assets/js/admin/manage_cms/manage_terms_cond/manage_terms_condition.js b/public/assets/js/admin/manage_cms/manage_terms_cond/manage_terms_condition.js index f60d154..c738b02 100644 --- a/public/assets/js/admin/manage_cms/manage_terms_cond/manage_terms_condition.js +++ b/public/assets/js/admin/manage_cms/manage_terms_cond/manage_terms_condition.js @@ -1,99 +1,132 @@ -// privacy policy for cust -$('#update_terms').on("click", function (e) { - $('#terms_form').validate({ - ignore: [], - debug: false, - rules: { - article_des: { - required: true - } - }, - messages: { - article_des: { - required: "Please Enter Terms and Condition" - } - }, - submitHandler: function (form) { - let base_url = url_path; - var formData = new FormData(form); - $.ajaxSetup({ - headers: { - "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"), - }, - }); +$(document).ready(function() { + var quill = new Quill('#terms-quill-edit', { + theme: 'snow' + }); + + var storedMessage = document.getElementById('stored-terms-message').value; + quill.clipboard.dangerouslyPasteHTML(storedMessage); + + $('#update_terms').on("click", function(e) { + e.preventDefault(); + $('#terms_form').validate({ + ignore: [], + debug: false, + rules: { + article_des: { + required: true, + minlength:1000, + } + }, + messages: { + article_des: { + required: "Please Enter Terms and Condition", + minlength:"Please Enter Terms and Condition" + } + }, + errorClass: 'error-message', + + submitHandler: function(form) { + // Get the HTML content from Quill editor + var article_des = quill.root.innerHTML; + + if (article_des.trim() === '


') { + toastr.error("Please Enter Terms and Condition"); + return false; + } + + let base_url = url_path; + var custom_id = document.querySelector('input[name="custom_id"]').value; + + // Create a form data object + var formData = new FormData(form); + formData.append('article_des', article_des); + + $.ajaxSetup({ + headers: { + "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"), + }, + }); + $.ajax({ url: base_url + '/update_terms', type: 'POST', data: formData, processData: false, contentType: false, - success: function (response) { + success: function(response) { if (response.status == 200) { - toastr.success('Terms and Condtion Data Updated Successfully'); - setTimeout(function () { + toastr.success('Terms and Condition Data Updated Successfully'); + setTimeout(function() { window.location.href = base_url + "/terms"; }, 1000); - }else { + } else { toastr.error("Something went wrong"); } }, + error: function(response) { + toastr.error("An error occurred while updating the terms"); + } }); - } + } + }); + + // Trigger form validation + $('#terms_form').submit(); }); }); -$.validator.addMethod("quillNotEmpty", function(value, element) { - var quill = new Quill('#terms-quill-edit'); - return quill.getText().trim().length > 0; -}, "Please enter terms and conditions"); + + + + // privacy policy for rest -$('#update_terms_rest').on("click", function (e) { - $('#update_terms_rest_form').validate({ - ignore: [], - debug: false, - rules: { - article_des_rest: { - required: true, - quillNotEmpty: true - } - }, - messages: { - article_des_rest: { - required: "Please Enter Terms and Condition" - } - }, - errorClass: 'error-message', - submitHandler: function (form) { - let base_url = url_path; - var formData = new FormData(form); - $.ajaxSetup({ - headers: { - "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"), - }, - }); - $.ajax({ - url: base_url + '/update_terms_rest', - type: 'POST', - data: formData, - processData: false, - contentType: false, - success: function (response) { - if (response.status == 200) { - toastr.success('Terms and Condtion Data Updated Successfully'); - setTimeout(function () { - window.location.href = base_url + "/terms"; - }, 1000); - } - else if (response.status == 204) { - toastr.error(response.error); - } - else { - toastr.error("Something went wrong"); - } - }, - }); - } - }); -}); \ No newline at end of file +// $('#update_terms_rest').on("click", function (e) { +// $('#update_terms_rest_form').validate({ +// ignore: [], +// debug: false, +// rules: { +// article_des_rest: { +// required: true, +// quillNotEmpty: true +// } +// }, +// messages: { +// article_des_rest: { +// required: "Please Enter Terms and Condition" +// } +// }, +// errorClass: 'error-message', +// submitHandler: function (form) { +// let base_url = url_path; +// var formData = new FormData(form); +// $.ajaxSetup({ +// headers: { +// "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"), +// }, +// }); +// $.ajax({ +// url: base_url + '/update_terms_rest', +// type: 'POST', +// data: formData, +// processData: false, +// contentType: false, +// success: function (response) { +// if (response.status == 200) { +// toastr.success('Terms and Condtion Data Updated Successfully'); +// setTimeout(function () { +// window.location.href = base_url + "/terms"; +// }, 1000); +// } +// else if (response.status == 204) { +// toastr.error(response.error); +// } +// else { +// toastr.error("Something went wrong"); +// } +// }, +// }); +// } +// }); +// }); \ No newline at end of file diff --git a/resources/views/Admin/pages/manage_cms/manage_aboutus/manage_about_us_add.blade.php b/resources/views/Admin/pages/manage_cms/manage_aboutus/manage_about_us_add.blade.php new file mode 100644 index 0000000..294a1cb --- /dev/null +++ b/resources/views/Admin/pages/manage_cms/manage_aboutus/manage_about_us_add.blade.php @@ -0,0 +1,110 @@ +@extends('admin.layouts.master') + +@section('content') + @php + $currentPage = 'manage_cms'; + @endphp + + +
+
+
+
+ +
+
+
+
+
+ @csrf +
+
+
+ + +
+
+
+
+ + + +
+
+
+
+ +
+ +
+
+
+
+ + +
+
+
+ +
+
+
+
+
+
+ +
+
+
+@endsection +@section('section_script') + + + + + +@endsection diff --git a/resources/views/Admin/pages/manage_cms/manage_aboutus/manage_about_us_edit.blade.php b/resources/views/Admin/pages/manage_cms/manage_aboutus/manage_about_us_edit.blade.php index 52a1a57..49b3286 100644 --- a/resources/views/Admin/pages/manage_cms/manage_aboutus/manage_about_us_edit.blade.php +++ b/resources/views/Admin/pages/manage_cms/manage_aboutus/manage_about_us_edit.blade.php @@ -20,53 +20,74 @@ - -
-
-
-
- - +
+
+
+
+
+ +
-
-
-
-
-
-
-
-
-
-
- -
-
+
+
+
+
+
+
+
+
+
+ + + +
+
+
+
+ + +
+ Image Preview
+
+
+ +
{!! $edit_service['description'] !!}
+ +
+
+
+
+ + +
+
+
+ +
+
- +
+
@@ -76,5 +97,12 @@ var quill = new Quill('#about-quill-edit', { theme: 'snow' }); + // Listen for changes and update the hidden input with the HTML content + quill.on('text-change', function() { + var htmlContent = quill.root.innerHTML; + document.getElementById('about_des').value = htmlContent; + }); -@endsection \ No newline at end of file + + +@endsection diff --git a/resources/views/Admin/pages/manage_cms/manage_aboutus/manage_aboutsus.blade.php b/resources/views/Admin/pages/manage_cms/manage_aboutus/manage_aboutsus.blade.php index 10f57df..5f48a13 100644 --- a/resources/views/Admin/pages/manage_cms/manage_aboutus/manage_aboutsus.blade.php +++ b/resources/views/Admin/pages/manage_cms/manage_aboutus/manage_aboutsus.blade.php @@ -6,89 +6,128 @@ @endphp - - -
-
-
-
-
-
-
Manage About Us
- - Edit Details - -
-
- - +
+
+
+
+
+
+
Manage About Us
-
-
-
-
-
-
-
-
-

- Vorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam - eu turpis molestie, dictum est a, mattis tellus. Sed - dignissim, metus nec fringilla accumsan, risus sem sollicitudin - lacus, ut interdum tellus elit sed risus. Maecenas eget - condimentum velit, sit amet feugiat lectus. Class aptent taciti - sociosqu ad litora torquent per conubia nostra, per - inceptos himenaeos. -

-
-
-

- Vorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam - eu turpis molestie, dictum est a, mattis tellus. Sed - dignissim, metus nec fringilla accumsan, risus sem sollicitudin - lacus, ut interdum tellus elit sed risus. Maecenas eget - condimentum velit, sit amet feugiat lectus. Class aptent taciti - sociosqu ad litora torquent per conubia nostra, per - inceptos himenaeos. -

-
-
-

- Vorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam - eu turpis molestie, dictum est a, mattis tellus. Sed - dignissim, metus nec fringilla accumsan, risus sem sollicitudin - lacus, ut interdum tellus elit sed risus. Maecenas eget - condimentum velit, sit amet feugiat lectus. Class aptent taciti - sociosqu ad litora torquent per conubia nostra, per - inceptos himenaeos. -

-
-
+
-
- -
- -
- - -
- -
+
+
+ + + + + + + + + + + + + + @foreach ( $about_data as $about_us_data) + + + + + + + + + + @endforeach + +
Sr noTitleImageCategoryAdded DateAction
{{$loop->iteration}}{{ $about_us_data->title }} + + + {{ $about_us_data->category->name }} + + {{ \Carbon\Carbon::parse($about_us_data['created_at'])->format('m/d/Y') }} +
+ + +
+
+
+
+
+
+
+ + + +@endsection @section('section_script') -@endsection \ No newline at end of file + +@endsection diff --git a/resources/views/Admin/pages/manage_cms/manage_faq/manage_faq.blade.php b/resources/views/Admin/pages/manage_cms/manage_faq/manage_faq.blade.php index e015683..4b61395 100644 --- a/resources/views/Admin/pages/manage_cms/manage_faq/manage_faq.blade.php +++ b/resources/views/Admin/pages/manage_cms/manage_faq/manage_faq.blade.php @@ -1,45 +1,93 @@ @extends('admin.layouts.master') @section('content') - @php - $currentPage = 'manage-faq'; - @endphp +@php +$currentPage = 'manage-faq'; +@endphp + -
-
-
-
-
-
-
Manage FAQ
-
-
- -
-
+
+
+
+
+
+
+
Manage FAQ
-
-
- - - - - - - - - - - - - - - - - - + + + @endforeach + +
Sr noQuestionAnswerFAQ Added DateAction
1LoremLoremLorem08/22/2023 +
+ +
+ + +
+
+ + + + + + + + + + + + + + @foreach ($faq as $index => $faqs) + + + + + + + + + -
Sr noQuestionAnswerFAQAdded DateAction
{{ $index + 1 }}{{ $faqs['question'] }} + @if (isset($faqs['answers'])) + {{ $faqs['answers'] }} + @endif + + @if($faqs['faq_category_id'] == 1) + Customer + @else + Restaurant + @endif + + @if (isset($faqs['created_at'])) + {{ \Carbon\Carbon::parse($faqs['created_at'])->format('m/d/Y') }} + @endif + +
+ +
+ + +
+ + + + Edit + + + -
-
+ + + + Delete + + + +
+
+
+
+
+
+
+ + + - - - @endsection +@section('section_script') + + + + + + + +@endsection \ No newline at end of file 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 7f96f1f..ab1a497 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 @@ -8,7 +8,7 @@ $currentPage = 'manage-privacy'; -
+ + +
+
+
+
+
+
+
Privacy Policy Customer
+ + @if(!empty($view_privacy_policy)) + + Edit Details + +@else +

No privacy policy found.

+@endif + +
+
+
+
+
+
+
+
+
+
+
+
+

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

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

{!! $view_privacy_policy[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 new file mode 100644 index 0000000..51e9e9c --- /dev/null +++ b/resources/views/Admin/pages/manage_cms/manage_privacy/manage_privacy_policy_edit.blade.php @@ -0,0 +1,73 @@ +@extends('admin.layouts.master') + +@section('content') +@php + $currentPage = 'manage_cms'; +@endphp +
+
+
+ +
+
+
+
+
+
+
+
+
+ +
{!! $edit_privacy_policy['description'] !!}
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+ + + + + +@endsection +@section('section_script') + + + + +@endsection \ No newline at end of file diff --git a/resources/views/Admin/pages/manage_cms/manage_terms/manage_terms.blade.php b/resources/views/Admin/pages/manage_cms/manage_terms/manage_terms.blade.php index ea495fb..69684cd 100644 --- a/resources/views/Admin/pages/manage_cms/manage_terms/manage_terms.blade.php +++ b/resources/views/Admin/pages/manage_cms/manage_terms/manage_terms.blade.php @@ -15,70 +15,39 @@
Terms & Conditions
- - Edit Details - + + Edit +
-
-
-
-
-
-
-
-
-

- Vorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam - eu turpis molestie, dictum est a, mattis tellus. Sed - dignissim, metus nec fringilla accumsan, risus sem sollicitudin - lacus, ut interdum tellus elit sed risus. Maecenas eget - condimentum velit, sit amet feugiat lectus. Class aptent taciti - sociosqu ad litora torquent per conubia nostra, per - inceptos himenaeos. -

-
-
-

- Vorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam - eu turpis molestie, dictum est a, mattis tellus. Sed - dignissim, metus nec fringilla accumsan, risus sem sollicitudin - lacus, ut interdum tellus elit sed risus. Maecenas eget - condimentum velit, sit amet feugiat lectus. Class aptent taciti - sociosqu ad litora torquent per conubia nostra, per - inceptos himenaeos. -

-
-
-

- Vorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam - eu turpis molestie, dictum est a, mattis tellus. Sed - dignissim, metus nec fringilla accumsan, risus sem sollicitudin - lacus, ut interdum tellus elit sed risus. Maecenas eget - condimentum velit, sit amet feugiat lectus. Class aptent taciti - sociosqu ad litora torquent per conubia nostra, per - inceptos himenaeos. -

-
-
- +
+
+ @csrf +
+
+
+
+
+
+

+ {!! $terms_condition[0]['message'] !!} +

-
-
- -
-
+
+
diff --git a/resources/views/Admin/pages/manage_cms/manage_terms/manage_terms_edit.blade.php b/resources/views/Admin/pages/manage_cms/manage_terms/manage_terms_edit.blade.php new file mode 100644 index 0000000..1459488 --- /dev/null +++ b/resources/views/Admin/pages/manage_cms/manage_terms/manage_terms_edit.blade.php @@ -0,0 +1,114 @@ +@extends('admin.layouts.master') + +@section('content') +@php +$currentPage = 'manage-terms'; +@endphp + + + + +
+
+
+
+ + + +
+ + +
+
+
+
+ @csrf +
+
+
+
+
+ + +
+ + +
+
+ +
+
+
+
+
+
+
+
+
+ + + +
+
+
+ + + +@endsection +@section('section_script') + + + + + +@endsection \ No newline at end of file diff --git a/resources/views/Admin/pages/manage_feedback/manage_feedback.blade.php b/resources/views/Admin/pages/manage_feedback/manage_feedback.blade.php index 27b51d5..a66f2ee 100644 --- a/resources/views/Admin/pages/manage_feedback/manage_feedback.blade.php +++ b/resources/views/Admin/pages/manage_feedback/manage_feedback.blade.php @@ -53,7 +53,7 @@ $currentPage = 'manage-feedback'; - + Delete @@ -73,7 +73,7 @@ $currentPage = 'manage-feedback'; - + Delete diff --git a/routes/web.php b/routes/web.php index 03699a0..0437ef9 100644 --- a/routes/web.php +++ b/routes/web.php @@ -63,17 +63,34 @@ Route::post('/manage_insert_news', [ManageNewsAndArticlesController::class, 'ins Route::get('/manage-newsletter', [ManageNewsLetterController ::class, 'index'])->name('manage.newLetter'); //*******************************************************manage aboutus******************************************************** +Route::get('/add_about_us', [AboutUsController::class, 'add'])->name('about_us_add'); +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::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']); + //*******************************************************manage terms******************************************************** Route::get('/terms', [TermsController ::class, 'index'])->name('manage.terms'); - + Route::get('/terms_edit/{id}', [TermsController::class, 'edit'])->name('terms_edit'); + Route::post('/update_terms', [TermsController::class, 'update']); +// Route::get('/terms_edit_rest/{id}', [TermsController::class, 'edit_rest'])->name('terms_edit'); //*******************************************************manage faq******************************************************** Route::get('/faq', [FaqController ::class, 'index'])->name('manage.faq'); + Route::get('/change_faq_Status', [FaqController::class, 'change_faqStatus']); + Route::delete('/delete_faq/{id}', [FaqController::class, 'delete_faq']); + Route::post('/update_faq', [FaqController::class, 'update'])->name('manage_edit_faq'); + Route::post('/store_faq', [FaqController::class, 'store'])->name('store_faq'); + + //*******************************************************manage privacypolicy******************************************************** Route::get('/privacy', [ PrivacyPolicyController ::class, 'index'])->name('manage.privacy'); + Route::get('/privacy_edit/{id}', [PrivacyPolicyController::class, 'edit'])->name('privacy_edit'); + //*******************************************************manage reports******************************************************** Route::get('/manage-reports', [ ManageReportsController ::class, 'index'])->name('manage.reports'); //*******************************************************manage feedback********************************************************