From b5520f6e519cd26d7864f6125a64f732c75a19c1 Mon Sep 17 00:00:00 2001 From: sayaliparab Date: Tue, 28 May 2024 18:53:50 +0530 Subject: [PATCH] CustomerApp --- app/Exports/EventbriteUsersExport.php | 40 ++ app/Exports/PassportExport.php | 49 ++ app/Exports/customer_export.php | 36 ++ app/Exports/customer_export_selected.php | 56 ++ .../dashboard_export_reedeem_vouchers.php | 47 ++ app/Exports/dashboard_export_user.php | 49 ++ .../dashboard_selected_export_user.php | 58 ++ .../Admin/ManageCustomerController.php | 191 +++++- app/Models/IamPrincipal.php | 12 +- app/Models/ManageState.php | 16 + composer.json | 2 + composer.lock | 558 ++++++++++++++++-- config/app.php | 17 +- config/dompdf.php | 284 +++++++++ .../assets/js/admin/manage_customer/edit.js | 4 +- .../assets/js/admin/manage_customer/main.js | 4 +- .../archive_manage_customer.blade.php | 96 +++ .../manage_customer/customer.blade.php | 430 +++++++------- .../manage_customer/edit_customer.blade.php | 101 ++++ .../view_customer_details.blade.php | 121 ++++ .../view_customer_details_pdf.blade.php | 68 +++ routes/web.php | 8 + 22 files changed, 1954 insertions(+), 293 deletions(-) create mode 100644 app/Exports/EventbriteUsersExport.php create mode 100644 app/Exports/PassportExport.php create mode 100644 app/Exports/customer_export.php create mode 100644 app/Exports/customer_export_selected.php create mode 100644 app/Exports/dashboard_export_reedeem_vouchers.php create mode 100644 app/Exports/dashboard_export_user.php create mode 100644 app/Exports/dashboard_selected_export_user.php create mode 100644 config/dompdf.php create mode 100644 resources/views/Admin/pages/manage_users/manage_customer/archive_manage_customer.blade.php create mode 100644 resources/views/Admin/pages/manage_users/manage_customer/edit_customer.blade.php create mode 100644 resources/views/Admin/pages/manage_users/manage_customer/view_customer_details.blade.php create mode 100644 resources/views/Admin/pages/manage_users/manage_customer/view_customer_details_pdf.blade.php diff --git a/app/Exports/EventbriteUsersExport.php b/app/Exports/EventbriteUsersExport.php new file mode 100644 index 0000000..aca6749 --- /dev/null +++ b/app/Exports/EventbriteUsersExport.php @@ -0,0 +1,40 @@ +get(); + } + + public function headings(): array + { + return [ + 'Order ID', + 'User Email', + 'Passport ID', + 'Quantity', + 'Order Date', + ]; + } + + public function styles(Worksheet $sheet) + { + return [ + // Style the first row (headings) + 1 => ['font' => ['bold' => true]], + ]; + } +} diff --git a/app/Exports/PassportExport.php b/app/Exports/PassportExport.php new file mode 100644 index 0000000..072f43f --- /dev/null +++ b/app/Exports/PassportExport.php @@ -0,0 +1,49 @@ +get(); + } + + //function header in excel + public function headings(): array + { + return [ + 'Id', + 'Passport name', + 'Description', + 'Activated date', + 'Expiry date', + 'is_popular', + 'Capacity', + 'Coupon code', + 'Price', + 'is_active', + 'is_expired', + ]; + } +} diff --git a/app/Exports/customer_export.php b/app/Exports/customer_export.php new file mode 100644 index 0000000..9aad372 --- /dev/null +++ b/app/Exports/customer_export.php @@ -0,0 +1,36 @@ +get(); + } + + //function header in excel + public function headings(): array + { + return [ + 'first_name', + 'email_address', + 'date_of_birth', + 'phone_number' + ]; + } +} diff --git a/app/Exports/customer_export_selected.php b/app/Exports/customer_export_selected.php new file mode 100644 index 0000000..bcc92cc --- /dev/null +++ b/app/Exports/customer_export_selected.php @@ -0,0 +1,56 @@ +ids = $ids; + } + + /** + * @return \Illuminate\Support\Collection + */ + public function collection() + { + $selectedCareIds = explode(',', $this->ids); + + $selected_customer = IamPrincipal::whereIn('id', $selectedCareIds) + ->orderBy('id', 'Desc') + ->select( + 'first_name', + 'email_address', + 'date_of_birth', + 'phone_number' + ) + ->get(); + return $selected_customer; + } + + /** + * @return array + */ + public function headings(): array + { + return [ + 'first_name', + 'email_address', + 'date_of_birth', + 'phone_number' + ]; + } +} + + + + diff --git a/app/Exports/dashboard_export_reedeem_vouchers.php b/app/Exports/dashboard_export_reedeem_vouchers.php new file mode 100644 index 0000000..4f69241 --- /dev/null +++ b/app/Exports/dashboard_export_reedeem_vouchers.php @@ -0,0 +1,47 @@ +redeemedVouchers = collect($redeemedVouchers); + } + + public function collection() + { + // dd($redeemedVouchers); + return $this->redeemedVouchers->map(function ($transaction) { + return [ + $transaction['customer']['first_name'], + $transaction['passport_data']['passport_name'], + $transaction['passport_vouchers']['coupon_name'], + $transaction['redeem_date'] + ]; + }); + + } + + public function headings(): array + { + return [ + 'Name', + 'Passport Name', + 'Restaurant', + 'Reededm Date' + ]; + } +} diff --git a/app/Exports/dashboard_export_user.php b/app/Exports/dashboard_export_user.php new file mode 100644 index 0000000..aee7087 --- /dev/null +++ b/app/Exports/dashboard_export_user.php @@ -0,0 +1,49 @@ +recentTransactions = collect($recentTransactions); + } + + public function collection() + { + return $this->recentTransactions->map(function ($transaction) { + return [ + $transaction['iam_principal']['first_name'] ?? 'Unknown', + $transaction['is_cart_order'] == 1 ? $transaction['carts']['passport']['passport_name'] : $transaction['order_passport']['passport_name'], + $transaction['is_cart_order'] == 1 ? $transaction['carts']['passport']['price'] : $transaction['order_passport']['price'], + ]; + }); + } + + public function headings(): array + { + return [ + 'Name', + 'Passport Name', + 'Amount', + ]; + } + + public function styles(Worksheet $sheet) + { + return [ + // Style the first row (headings) + 1 => ['font' => ['bold' => true]], + ]; + } +} diff --git a/app/Exports/dashboard_selected_export_user.php b/app/Exports/dashboard_selected_export_user.php new file mode 100644 index 0000000..ce3338c --- /dev/null +++ b/app/Exports/dashboard_selected_export_user.php @@ -0,0 +1,58 @@ +ids = $ids; + } + + /** + * @return \Illuminate\Support\Collection + */ + public function collection() + { + $selectedCareIds = explode(',', $this->ids); + + return OrderedPassport::with('order_passport', 'carts.passport', 'iamPrincipal') + ->whereIn('id', $selectedCareIds) + ->get() + ->map(function ($transaction) { + return [ + 'Name' => $transaction->iamPrincipal->first_name ?? 'Unknown', + 'Passport Name' => $transaction->is_cart_order == 1 ? $transaction->carts->passport->passport_name : $transaction->order_passport->passport_name, + 'Amount' => $transaction->is_cart_order == 1 ? $transaction->carts->passport->price : $transaction->order_passport->price, + ]; + }); + } + + + public function headings(): array + { + return [ + 'Name', + 'Passport Name', + 'Amount', + ]; + } + + public function styles(Worksheet $sheet) + { + return [ + // Style the first row (headings) + 1 => ['font' => ['bold' => true]], + ]; + } +} diff --git a/app/Http/Controllers/Admin/ManageCustomerController.php b/app/Http/Controllers/Admin/ManageCustomerController.php index e9e4a43..3ae4ec4 100644 --- a/app/Http/Controllers/Admin/ManageCustomerController.php +++ b/app/Http/Controllers/Admin/ManageCustomerController.php @@ -9,8 +9,14 @@ use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\DB; use Maatwebsite\Excel\Facades\Excel; use App\Models\OrderedPassport; +use App\Exports\customer_export; +use App\Exports\customer_export_selected; use Exception; +use PDF; + + + class ManageCustomerController extends Controller { @@ -20,23 +26,178 @@ class ManageCustomerController extends Controller // return view('Admin.pages.manage_users.manage_customer.customer'); // } - public function index() - { + // public function index() + // { - try { - $customers = IamPrincipal::where('principal_type_xid', 3)->orderBy('created_at', 'desc')->get(); + // try { + // $customers = IamPrincipal::where('principal_type_xid', 3)->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); + // } + // } + public function index() +{ + try { + // Eager load the state relationship for all customers + $customers = IamPrincipal::where('principal_type_xid', 3) + ->with('state') + ->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); - } + 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); } +} + +public function view_customer($id) +{ + + + try { + $customers_data = IamPrincipal::findOrFail($id); + return view('Admin.pages.manage_users.manage_customer.view_customer_details', compact('customers_data')); + } catch (Exception $e) { + Log::error("Manage Voucher Page Not Load " . $e->getMessage()); + return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500); + } +} + + +public function edit_customer($id) +{ + + try { + $customers_data = IamPrincipal::findOrFail($id); + return view('Admin.pages.manage_users.manage_customer.edit_customer', compact('customers_data')); + } catch (Exception $e) { + Log::error("Manage Voucher Page Not Load " . $e->getMessage()); + return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500); + } +} + +public function update(Request $request) +{ + + + try { + DB::beginTransaction(); + $customer_data = IamPrincipal::where('id', $request->customer_id)->first(); + $customer_data->first_name = $request->input('name'); + $customer_data->last_name = $request->input('last_name'); + + $customer_data->phone_number = $request->input('phone'); + $customer_data->email_address = $request->input('email_id'); + $customer_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 archive_customer() +{ + /* + Created By : Sayali Parab + Created at : 28 May 2024 + Use : To Get archieve customer. + */ + try { + $customers = IamPrincipal::where('principal_type_xid', 3)->onlyTrashed()->latest()->get(); + return view('Admin.pages.manage_users.manage_customer.archive_manage_customer', compact('customers')); + } catch (Exception $e) { + Log::error("Manage Voucher Page Not Load " . $e->getMessage()); + return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500); + } +} + + +public function delete_customer($id) +{ + + try { + DB::beginTransaction(); + + $passport = IamPrincipal::find($id); + $passport->one_signal_player_id = null; + $passport->deleted_by_admin = 1; + $passport->save(); + + $passport->delete(); + // dd($passport); + DB::commit(); + + return response()->json(['success' => true, 'status' => 200]); + } catch (Exception $e) { + DB::rollBack(); + Log::error("delete_passport function Load Failed " . $e->getMessage()); + return response()->json(['success' => false, 'status' => 500, 'message' => __('auth.something_went_wrong')]); + } +} +// public function download_pdf($id) +// { + +// // try { +// $customers_data = IamPrincipal::findOrFail($id); +// // dd($customers_data); +// $data = [ +// 'customers_data' => $customers_data +// ]; + +// $pdf = PDF::loadView('Admin.pages.manage_users.manage_customer.view_customer_details_pdf', $data); +// return $pdf->download('customer_details.pdf'); +// // } catch (Exception $e) { +// // Log::error("Manage Voucher Page Not Load " . $e->getMessage()); +// // return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500); +// // } +// } +public function download_pdf($id) +{ + try { + $customers_data = IamPrincipal::findOrFail($id); + $data = [ + 'customers_data' => $customers_data + ]; + + $pdf = PDF::loadView('Admin.pages.manage_users.manage_customer.view_customer_details_pdf', $data); + return $pdf->download('customer_details.pdf'); + } catch (Exception $e) { + Log::error("Error generating PDF: " . $e->getMessage()); + return response()->json(['error' => __('auth.something_went_wrong')], 500); + } +} + + +public function exportSelectedCustomer(Request $request) +{ + + try { + + if ($request->has('all_id')) { + return Excel::download(new customer_export, 'Passport_data.xlsx'); + } + + $ids = $request->selected_id; + + $fileName = 'selected_customer_data.xlsx'; + return Excel::download(new customer_export_selected($ids), $fileName); + } catch (\Exception $e) { + return response()->json(['error' => 'Export failed. Something went wrong.'], 500); + } +} } diff --git a/app/Models/IamPrincipal.php b/app/Models/IamPrincipal.php index 55052b6..a65e7f0 100644 --- a/app/Models/IamPrincipal.php +++ b/app/Models/IamPrincipal.php @@ -8,9 +8,11 @@ use Illuminate\Notifications\Notifiable; use Tymon\JWTAuth\Contracts\JWTSubject; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; -use App\Models\admin\ManageFeedback; -use App\Models\admin\ManageModuleLink; -use App\Models\admin\ManageModule; +use App\Models\ManageFeedback; +use App\Models\ManageModuleLink; +use App\Models\ManageModule; +use App\Models\ManageState; + use App\Models\OrderedPassport; @@ -40,6 +42,10 @@ class IamPrincipal extends Authenticatable implements JWTSubject 'notification_status', 'deleted_by_admin' ]; + public function state() + { + return $this->belongsTo(ManageState::class, 'state_xid', 'id'); + } public function moduleLinks() { diff --git a/app/Models/ManageState.php b/app/Models/ManageState.php index 1f2d916..948ef4f 100644 --- a/app/Models/ManageState.php +++ b/app/Models/ManageState.php @@ -8,4 +8,20 @@ use Illuminate\Database\Eloquent\Model; class ManageState extends Model { use HasFactory; + + protected $table = 'manage_states'; + // protected $dates = ['deleted_at']; + + protected $fillable = [ + ' id ', + 'name', + 'is_active', + 'email_address', + 'created_by', + 'modified_by', + 'deleted_at', + 'created_at', + 'updated_at ', + + ]; } diff --git a/composer.json b/composer.json index c1e4d6f..4345b9b 100644 --- a/composer.json +++ b/composer.json @@ -9,11 +9,13 @@ "license": "MIT", "require": { "php": "^8.2", + "barryvdh/laravel-dompdf": "^2.2", "laravel/framework": "^11.0", "laravel/jetstream": "^5.1", "laravel/sanctum": "^4.0", "laravel/tinker": "^2.9", "livewire/livewire": "^3.0", + "maatwebsite/excel": "^1.1", "tymon/jwt-auth": "^2.1" }, "require-dev": { diff --git a/composer.lock b/composer.lock index ac7b1f8..13f2cfe 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e805067d0b9c7a47812cc3d4b85e8b42", + "content-hash": "9421f163e566ad7950fa7baf46aa2594", "packages": [ { "name": "bacon/bacon-qr-code", @@ -60,6 +60,83 @@ }, "time": "2024-04-18T11:16:25+00:00" }, + { + "name": "barryvdh/laravel-dompdf", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-dompdf.git", + "reference": "c96f90c97666cebec154ca1ffb67afed372114d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/c96f90c97666cebec154ca1ffb67afed372114d8", + "reference": "c96f90c97666cebec154ca1ffb67afed372114d8", + "shasum": "" + }, + "require": { + "dompdf/dompdf": "^2.0.7", + "illuminate/support": "^6|^7|^8|^9|^10|^11", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "larastan/larastan": "^1.0|^2.7.0", + "orchestra/testbench": "^4|^5|^6|^7|^8|^9", + "phpro/grumphp": "^1 || ^2.5", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + }, + "laravel": { + "providers": [ + "Barryvdh\\DomPDF\\ServiceProvider" + ], + "aliases": { + "Pdf": "Barryvdh\\DomPDF\\Facade\\Pdf", + "PDF": "Barryvdh\\DomPDF\\Facade\\Pdf" + } + } + }, + "autoload": { + "psr-4": { + "Barryvdh\\DomPDF\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "A DOMPDF Wrapper for Laravel", + "keywords": [ + "dompdf", + "laravel", + "pdf" + ], + "support": { + "issues": "https://github.com/barryvdh/laravel-dompdf/issues", + "source": "https://github.com/barryvdh/laravel-dompdf/tree/v2.2.0" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2024-04-25T13:16:04+00:00" + }, { "name": "brick/math", "version": "0.12.1", @@ -482,6 +559,68 @@ ], "time": "2024-02-05T11:56:58+00:00" }, + { + "name": "dompdf/dompdf", + "version": "v2.0.8", + "source": { + "type": "git", + "url": "https://github.com/dompdf/dompdf.git", + "reference": "c20247574601700e1f7c8dab39310fca1964dc52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/dompdf/zipball/c20247574601700e1f7c8dab39310fca1964dc52", + "reference": "c20247574601700e1f7c8dab39310fca1964dc52", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "masterminds/html5": "^2.0", + "phenx/php-font-lib": ">=0.5.4 <1.0.0", + "phenx/php-svg-lib": ">=0.5.2 <1.0.0", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "ext-json": "*", + "ext-zip": "*", + "mockery/mockery": "^1.3", + "phpunit/phpunit": "^7.5 || ^8 || ^9", + "squizlabs/php_codesniffer": "^3.5" + }, + "suggest": { + "ext-gd": "Needed to process images", + "ext-gmagick": "Improves image processing performance", + "ext-imagick": "Improves image processing performance", + "ext-zlib": "Needed for pdf stream compression" + }, + "type": "library", + "autoload": { + "psr-4": { + "Dompdf\\": "src/" + }, + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1" + ], + "authors": [ + { + "name": "The Dompdf Community", + "homepage": "https://github.com/dompdf/dompdf/blob/master/AUTHORS.md" + } + ], + "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter", + "homepage": "https://github.com/dompdf/dompdf", + "support": { + "issues": "https://github.com/dompdf/dompdf/issues", + "source": "https://github.com/dompdf/dompdf/tree/v2.0.8" + }, + "time": "2024-04-29T13:06:17+00:00" + }, { "name": "dragonmantank/cron-expression", "version": "v3.3.3", @@ -1741,31 +1880,34 @@ }, { "name": "lcobucci/clock", - "version": "2.2.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/lcobucci/clock.git", - "reference": "fb533e093fd61321bfcbac08b131ce805fe183d3" + "reference": "6f28b826ea01306b07980cb8320ab30b966cd715" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/clock/zipball/fb533e093fd61321bfcbac08b131ce805fe183d3", - "reference": "fb533e093fd61321bfcbac08b131ce805fe183d3", + "url": "https://api.github.com/repos/lcobucci/clock/zipball/6f28b826ea01306b07980cb8320ab30b966cd715", + "reference": "6f28b826ea01306b07980cb8320ab30b966cd715", "shasum": "" }, "require": { - "php": "^8.0", - "stella-maris/clock": "^0.1.4" + "php": "~8.2.0 || ~8.3.0", + "psr/clock": "^1.0" + }, + "provide": { + "psr/clock-implementation": "1.0" }, "require-dev": { - "infection/infection": "^0.26", - "lcobucci/coding-standard": "^8.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/phpunit": "^9.5" + "infection/infection": "^0.27", + "lcobucci/coding-standard": "^11.0.0", + "phpstan/extension-installer": "^1.3.1", + "phpstan/phpstan": "^1.10.25", + "phpstan/phpstan-deprecation-rules": "^1.1.3", + "phpstan/phpstan-phpunit": "^1.3.13", + "phpstan/phpstan-strict-rules": "^1.5.1", + "phpunit/phpunit": "^10.2.3" }, "type": "library", "autoload": { @@ -1786,7 +1928,7 @@ "description": "Yet another clock abstraction", "support": { "issues": "https://github.com/lcobucci/clock/issues", - "source": "https://github.com/lcobucci/clock/tree/2.2.0" + "source": "https://github.com/lcobucci/clock/tree/3.2.0" }, "funding": [ { @@ -1798,47 +1940,45 @@ "type": "patreon" } ], - "time": "2022-04-19T19:34:17+00:00" + "time": "2023-11-17T17:00:27+00:00" }, { "name": "lcobucci/jwt", - "version": "4.0.4", + "version": "4.3.0", "source": { "type": "git", "url": "https://github.com/lcobucci/jwt.git", - "reference": "55564265fddf810504110bd68ca311932324b0e9" + "reference": "4d7de2fe0d51a96418c0d04004986e410e87f6b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/jwt/zipball/55564265fddf810504110bd68ca311932324b0e9", - "reference": "55564265fddf810504110bd68ca311932324b0e9", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/4d7de2fe0d51a96418c0d04004986e410e87f6b4", + "reference": "4d7de2fe0d51a96418c0d04004986e410e87f6b4", "shasum": "" }, "require": { + "ext-hash": "*", + "ext-json": "*", "ext-mbstring": "*", "ext-openssl": "*", - "lcobucci/clock": "^2.0", + "ext-sodium": "*", + "lcobucci/clock": "^2.0 || ^3.0", "php": "^7.4 || ^8.0" }, "require-dev": { - "infection/infection": "^0.20", + "infection/infection": "^0.21", "lcobucci/coding-standard": "^6.0", - "mikey179/vfsstream": "^1.6", - "phpbench/phpbench": "^0.17", + "mikey179/vfsstream": "^1.6.7", + "phpbench/phpbench": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpstan/phpstan-strict-rules": "^1.0", "phpunit/php-invoker": "^3.1", - "phpunit/phpunit": "^9.4" + "phpunit/phpunit": "^9.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, "autoload": { "psr-4": { "Lcobucci\\JWT\\": "src" @@ -1862,7 +2002,7 @@ ], "support": { "issues": "https://github.com/lcobucci/jwt/issues", - "source": "https://github.com/lcobucci/jwt/tree/4.0.4" + "source": "https://github.com/lcobucci/jwt/tree/4.3.0" }, "funding": [ { @@ -1874,7 +2014,7 @@ "type": "patreon" } ], - "time": "2021-09-28T19:18:28+00:00" + "time": "2023-01-02T13:28:00+00:00" }, { "name": "league/commonmark", @@ -2328,6 +2468,132 @@ ], "time": "2024-05-21T13:39:04+00:00" }, + { + "name": "maatwebsite/excel", + "version": "v1.1.5", + "source": { + "type": "git", + "url": "https://github.com/Maatwebsite/Laravel-Excel.git", + "reference": "0c67aba8387726458d42461eae91a3415593bbc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Maatwebsite/Laravel-Excel/zipball/0c67aba8387726458d42461eae91a3415593bbc4", + "reference": "0c67aba8387726458d42461eae91a3415593bbc4", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "phpoffice/phpexcel": "~1.8.0" + }, + "require-dev": { + "mockery/mockery": "~0.9", + "orchestra/testbench": "~2.2.0@dev", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Maatwebsite\\Excel\\": "src/" + }, + "classmap": [ + "src/Maatwebsite/Excel", + "tests/TestCase.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Maatwebsite.nl", + "email": "patrick@maatwebsite.nl" + } + ], + "description": "An eloquent way of importing and exporting Excel and CSV in Laravel 4 with the power of PHPExcel", + "keywords": [ + "PHPExcel", + "batch", + "csv", + "excel", + "export", + "import", + "laravel" + ], + "support": { + "issues": "https://github.com/Maatwebsite/Laravel-Excel/issues", + "source": "https://github.com/Maatwebsite/Laravel-Excel/tree/master" + }, + "time": "2014-07-10T09:06:07+00:00" + }, + { + "name": "masterminds/html5", + "version": "2.9.0", + "source": { + "type": "git", + "url": "https://github.com/Masterminds/html5-php.git", + "reference": "f5ac2c0b0a2eefca70b2ce32a5809992227e75a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f5ac2c0b0a2eefca70b2ce32a5809992227e75a6", + "reference": "f5ac2c0b0a2eefca70b2ce32a5809992227e75a6", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8 || ^9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Masterminds\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Butcher", + "email": "technosophos@gmail.com" + }, + { + "name": "Matt Farina", + "email": "matt@mattfarina.com" + }, + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + } + ], + "description": "An HTML5 parser and serializer.", + "homepage": "http://masterminds.github.io/html5-php", + "keywords": [ + "HTML5", + "dom", + "html", + "parser", + "querypath", + "serializer", + "xml" + ], + "support": { + "issues": "https://github.com/Masterminds/html5-php/issues", + "source": "https://github.com/Masterminds/html5-php/tree/2.9.0" + }, + "time": "2024-03-31T07:05:07+00:00" + }, { "name": "mobiledetect/mobiledetectlib", "version": "4.8.06", @@ -2495,16 +2761,16 @@ }, { "name": "nesbot/carbon", - "version": "3.3.1", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "8ff64b92c1b1ec84fcde9f8bb9ff2ca34cb8a77a" + "reference": "8eab8983c83c30e0bacbef8d311e3f3b8172727f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8ff64b92c1b1ec84fcde9f8bb9ff2ca34cb8a77a", - "reference": "8ff64b92c1b1ec84fcde9f8bb9ff2ca34cb8a77a", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8eab8983c83c30e0bacbef8d311e3f3b8172727f", + "reference": "8eab8983c83c30e0bacbef8d311e3f3b8172727f", "shasum": "" }, "require": { @@ -2597,7 +2863,7 @@ "type": "tidelift" } ], - "time": "2024-05-01T06:54:22+00:00" + "time": "2024-05-24T14:26:34+00:00" }, { "name": "nette/schema", @@ -2960,6 +3226,158 @@ }, "time": "2024-05-08T12:18:48+00:00" }, + { + "name": "phenx/php-font-lib", + "version": "0.5.6", + "source": { + "type": "git", + "url": "https://github.com/dompdf/php-font-lib.git", + "reference": "a1681e9793040740a405ac5b189275059e2a9863" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/a1681e9793040740a405ac5b189275059e2a9863", + "reference": "a1681e9793040740a405ac5b189275059e2a9863", + "shasum": "" + }, + "require": { + "ext-mbstring": "*" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3 || ^4 || ^5 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "FontLib\\": "src/FontLib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Fabien Ménager", + "email": "fabien.menager@gmail.com" + } + ], + "description": "A library to read, parse, export and make subsets of different types of font files.", + "homepage": "https://github.com/PhenX/php-font-lib", + "support": { + "issues": "https://github.com/dompdf/php-font-lib/issues", + "source": "https://github.com/dompdf/php-font-lib/tree/0.5.6" + }, + "time": "2024-01-29T14:45:26+00:00" + }, + { + "name": "phenx/php-svg-lib", + "version": "0.5.4", + "source": { + "type": "git", + "url": "https://github.com/dompdf/php-svg-lib.git", + "reference": "46b25da81613a9cf43c83b2a8c2c1bdab27df691" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/46b25da81613a9cf43c83b2a8c2c1bdab27df691", + "reference": "46b25da81613a9cf43c83b2a8c2c1bdab27df691", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^7.1 || ^8.0", + "sabberworm/php-css-parser": "^8.4" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Svg\\": "src/Svg" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Fabien Ménager", + "email": "fabien.menager@gmail.com" + } + ], + "description": "A library to read, parse and export to PDF SVG files.", + "homepage": "https://github.com/PhenX/php-svg-lib", + "support": { + "issues": "https://github.com/dompdf/php-svg-lib/issues", + "source": "https://github.com/dompdf/php-svg-lib/tree/0.5.4" + }, + "time": "2024-04-08T12:52:34+00:00" + }, + { + "name": "phpoffice/phpexcel", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/PHPOffice/PHPExcel.git", + "reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/372c7cbb695a6f6f1e62649381aeaa37e7e70b32", + "reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32", + "shasum": "" + }, + "require": { + "ext-xml": "*", + "ext-xmlwriter": "*", + "php": ">=5.2.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "PHPExcel": "Classes/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Maarten Balliauw", + "homepage": "http://blog.maartenballiauw.be" + }, + { + "name": "Mark Baker" + }, + { + "name": "Franck Lefevre", + "homepage": "http://blog.rootslabs.net" + }, + { + "name": "Erik Tilt" + } + ], + "description": "PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", + "homepage": "http://phpexcel.codeplex.com", + "keywords": [ + "OpenXML", + "excel", + "php", + "spreadsheet", + "xls", + "xlsx" + ], + "support": { + "issues": "https://github.com/PHPOffice/PHPExcel/issues", + "source": "https://github.com/PHPOffice/PHPExcel/tree/master" + }, + "abandoned": "phpoffice/phpspreadsheet", + "time": "2015-05-01T07:00:55+00:00" + }, { "name": "phpoption/phpoption", "version": "1.9.2", @@ -3804,27 +4222,38 @@ "time": "2024-04-27T21:32:50+00:00" }, { - "name": "stella-maris/clock", - "version": "0.1.7", + "name": "sabberworm/php-css-parser", + "version": "v8.5.1", "source": { "type": "git", - "url": "https://github.com/stella-maris-solutions/clock.git", - "reference": "fa23ce16019289a18bb3446fdecd45befcdd94f8" + "url": "https://github.com/MyIntervals/PHP-CSS-Parser.git", + "reference": "4a3d572b0f8b28bb6fd016ae8bbfc445facef152" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stella-maris-solutions/clock/zipball/fa23ce16019289a18bb3446fdecd45befcdd94f8", - "reference": "fa23ce16019289a18bb3446fdecd45befcdd94f8", + "url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/4a3d572b0f8b28bb6fd016ae8bbfc445facef152", + "reference": "4a3d572b0f8b28bb6fd016ae8bbfc445facef152", "shasum": "" }, "require": { - "php": "^7.0|^8.0", - "psr/clock": "^1.0" + "ext-iconv": "*", + "php": ">=5.6.20" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "suggest": { + "ext-mbstring": "for parsing UTF-8 CSS" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "9.0.x-dev" + } + }, "autoload": { "psr-4": { - "StellaMaris\\Clock\\": "src" + "Sabberworm\\CSS\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3833,22 +4262,29 @@ ], "authors": [ { - "name": "Andreas Heigl", - "role": "Maintainer" + "name": "Raphael Schweikert" + }, + { + "name": "Oliver Klee", + "email": "github@oliverklee.de" + }, + { + "name": "Jake Hotson", + "email": "jake.github@qzdesign.co.uk" } ], - "description": "A pre-release of the proposed PSR-20 Clock-Interface", - "homepage": "https://gitlab.com/stella-maris/clock", + "description": "Parser for CSS Files written in PHP", + "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser", "keywords": [ - "clock", - "datetime", - "point in time", - "psr20" + "css", + "parser", + "stylesheet" ], "support": { - "source": "https://github.com/stella-maris-solutions/clock/tree/0.1.7" + "issues": "https://github.com/MyIntervals/PHP-CSS-Parser/issues", + "source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/v8.5.1" }, - "time": "2022-11-25T16:15:06+00:00" + "time": "2024-02-15T16:41:13+00:00" }, { "name": "symfony/clock", diff --git a/config/app.php b/config/app.php index 3cb6d56..227bbf1 100644 --- a/config/app.php +++ b/config/app.php @@ -166,6 +166,10 @@ return [ Tymon\JWTAuth\Providers\LaravelServiceProvider::class, // Ladumor\OneSignal\OneSignalServiceProvider::class, // Maatwebsite\Excel\ExcelServiceProvider::class, + Barryvdh\DomPDF\ServiceProvider::class, + // Maatwebsite\Excel\ExcelServiceProvider::class, + + ])->toArray(), @@ -180,14 +184,25 @@ return [ | */ + // 'aliases' => Facade::defaultAliases()->merge([ + // // 'Example' => App\Facades\Example::class, + // 'JWTAuth' => Tymon\JWTAuth\Facades\JWTAuth::class, + // 'JWTFactory' => Tymon\JWTAuth\Facades\JWTFactory::class, + // // 'OneSignal' => \Ladumor\OneSignal\OneSignal::class, + // 'PDF' => Barryvdh\DomPDF\Facade::class, + // // 'Excel' => Maatwebsite\Excel\Facades\Excel::class, + + + // ])->toArray(), 'aliases' => Facade::defaultAliases()->merge([ // 'Example' => App\Facades\Example::class, 'JWTAuth' => Tymon\JWTAuth\Facades\JWTAuth::class, 'JWTFactory' => Tymon\JWTAuth\Facades\JWTFactory::class, // 'OneSignal' => \Ladumor\OneSignal\OneSignal::class, - // 'PDF' => Barryvdh\DomPDF\Facade::class, + 'PDF' => Barryvdh\DomPDF\Facade::class, // 'Excel' => Maatwebsite\Excel\Facades\Excel::class, ])->toArray(), + ]; diff --git a/config/dompdf.php b/config/dompdf.php new file mode 100644 index 0000000..c9a928f --- /dev/null +++ b/config/dompdf.php @@ -0,0 +1,284 @@ + false, // Throw an Exception on warnings from dompdf + + 'public_path' => null, // Override the public path if needed + + /* + * Dejavu Sans font is missing glyphs for converted entities, turn it off if you need to show € and £. + */ + 'convert_entities' => true, + + 'options' => array( + /** + * The location of the DOMPDF font directory + * + * The location of the directory where DOMPDF will store fonts and font metrics + * Note: This directory must exist and be writable by the webserver process. + * *Please note the trailing slash.* + * + * Notes regarding fonts: + * Additional .afm font metrics can be added by executing load_font.php from command line. + * + * Only the original "Base 14 fonts" are present on all pdf viewers. Additional fonts must + * be embedded in the pdf file or the PDF may not display correctly. This can significantly + * increase file size unless font subsetting is enabled. Before embedding a font please + * review your rights under the font license. + * + * Any font specification in the source HTML is translated to the closest font available + * in the font directory. + * + * The pdf standard "Base 14 fonts" are: + * Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique, + * Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique, + * Times-Roman, Times-Bold, Times-BoldItalic, Times-Italic, + * Symbol, ZapfDingbats. + */ + "font_dir" => storage_path('fonts'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782) + + /** + * The location of the DOMPDF font cache directory + * + * This directory contains the cached font metrics for the fonts used by DOMPDF. + * This directory can be the same as DOMPDF_FONT_DIR + * + * Note: This directory must exist and be writable by the webserver process. + */ + "font_cache" => storage_path('fonts'), + + /** + * The location of a temporary directory. + * + * The directory specified must be writeable by the webserver process. + * The temporary directory is required to download remote images and when + * using the PDFLib back end. + */ + "temp_dir" => sys_get_temp_dir(), + + /** + * ==== IMPORTANT ==== + * + * dompdf's "chroot": Prevents dompdf from accessing system files or other + * files on the webserver. All local files opened by dompdf must be in a + * subdirectory of this directory. DO NOT set it to '/' since this could + * allow an attacker to use dompdf to read any files on the server. This + * should be an absolute path. + * This is only checked on command line call by dompdf.php, but not by + * direct class use like: + * $dompdf = new DOMPDF(); $dompdf->load_html($htmldata); $dompdf->render(); $pdfdata = $dompdf->output(); + */ + "chroot" => realpath(base_path()), + + /** + * Protocol whitelist + * + * Protocols and PHP wrappers allowed in URIs, and the validation rules + * that determine if a resouce may be loaded. Full support is not guaranteed + * for the protocols/wrappers specified + * by this array. + * + * @var array + */ + 'allowed_protocols' => [ + "file://" => ["rules" => []], + "http://" => ["rules" => []], + "https://" => ["rules" => []] + ], + + /** + * @var string + */ + 'log_output_file' => null, + + /** + * Whether to enable font subsetting or not. + */ + "enable_font_subsetting" => false, + + /** + * The PDF rendering backend to use + * + * Valid settings are 'PDFLib', 'CPDF' (the bundled R&OS PDF class), 'GD' and + * 'auto'. 'auto' will look for PDFLib and use it if found, or if not it will + * fall back on CPDF. 'GD' renders PDFs to graphic files. {@link + * Canvas_Factory} ultimately determines which rendering class to instantiate + * based on this setting. + * + * Both PDFLib & CPDF rendering backends provide sufficient rendering + * capabilities for dompdf, however additional features (e.g. object, + * image and font support, etc.) differ between backends. Please see + * {@link PDFLib_Adapter} for more information on the PDFLib backend + * and {@link CPDF_Adapter} and lib/class.pdf.php for more information + * on CPDF. Also see the documentation for each backend at the links + * below. + * + * The GD rendering backend is a little different than PDFLib and + * CPDF. Several features of CPDF and PDFLib are not supported or do + * not make any sense when creating image files. For example, + * multiple pages are not supported, nor are PDF 'objects'. Have a + * look at {@link GD_Adapter} for more information. GD support is + * experimental, so use it at your own risk. + * + * @link http://www.pdflib.com + * @link http://www.ros.co.nz/pdf + * @link http://www.php.net/image + */ + "pdf_backend" => "CPDF", + + /** + * PDFlib license key + * + * If you are using a licensed, commercial version of PDFlib, specify + * your license key here. If you are using PDFlib-Lite or are evaluating + * the commercial version of PDFlib, comment out this setting. + * + * @link http://www.pdflib.com + * + * If pdflib present in web server and auto or selected explicitely above, + * a real license code must exist! + */ + //"DOMPDF_PDFLIB_LICENSE" => "your license key here", + + /** + * html target media view which should be rendered into pdf. + * List of types and parsing rules for future extensions: + * http://www.w3.org/TR/REC-html40/types.html + * screen, tty, tv, projection, handheld, print, braille, aural, all + * Note: aural is deprecated in CSS 2.1 because it is replaced by speech in CSS 3. + * Note, even though the generated pdf file is intended for print output, + * the desired content might be different (e.g. screen or projection view of html file). + * Therefore allow specification of content here. + */ + "default_media_type" => "screen", + + /** + * The default paper size. + * + * North America standard is "letter"; other countries generally "a4" + * + * @see CPDF_Adapter::PAPER_SIZES for valid sizes ('letter', 'legal', 'A4', etc.) + */ + "default_paper_size" => "a4", + + /** + * The default paper orientation. + * + * The orientation of the page (portrait or landscape). + * + * @var string + */ + 'default_paper_orientation' => "portrait", + + /** + * The default font family + * + * Used if no suitable fonts can be found. This must exist in the font folder. + * @var string + */ + "default_font" => "serif", + + /** + * Image DPI setting + * + * This setting determines the default DPI setting for images and fonts. The + * DPI may be overridden for inline images by explictly setting the + * image's width & height style attributes (i.e. if the image's native + * width is 600 pixels and you specify the image's width as 72 points, + * the image will have a DPI of 600 in the rendered PDF. The DPI of + * background images can not be overridden and is controlled entirely + * via this parameter. + * + * For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI). + * If a size in html is given as px (or without unit as image size), + * this tells the corresponding size in pt. + * This adjusts the relative sizes to be similar to the rendering of the + * html page in a reference browser. + * + * In pdf, always 1 pt = 1/72 inch + * + * Rendering resolution of various browsers in px per inch: + * Windows Firefox and Internet Explorer: + * SystemControl->Display properties->FontResolution: Default:96, largefonts:120, custom:? + * Linux Firefox: + * about:config *resolution: Default:96 + * (xorg screen dimension in mm and Desktop font dpi settings are ignored) + * + * Take care about extra font/image zoom factor of browser. + * + * In images, size in pixel attribute, img css style, are overriding + * the real image dimension in px for rendering. + * + * @var int + */ + "dpi" => 96, + + /** + * Enable inline PHP + * + * If this setting is set to true then DOMPDF will automatically evaluate + * inline PHP contained within tags. + * + * Enabling this for documents you do not trust (e.g. arbitrary remote html + * pages) is a security risk. Set this option to false if you wish to process + * untrusted documents. + * + * @var bool + */ + "enable_php" => false, + + /** + * Enable inline Javascript + * + * If this setting is set to true then DOMPDF will automatically insert + * JavaScript code contained within tags. + * + * @var bool + */ + "enable_javascript" => true, + + /** + * Enable remote file access + * + * If this setting is set to true, DOMPDF will access remote sites for + * images and CSS files as required. + * This is required for part of test case www/test/image_variants.html through www/examples.php + * + * Attention! + * This can be a security risk, in particular in combination with DOMPDF_ENABLE_PHP and + * allowing remote access to dompdf.php or on allowing remote html code to be passed to + * $dompdf = new DOMPDF(, $dompdf->load_html(..., + * This allows anonymous users to download legally doubtful internet content which on + * tracing back appears to being downloaded by your server, or allows malicious php code + * in remote html pages to be executed by your server with your account privileges. + * + * @var bool + */ + "enable_remote" => true, + + /** + * A ratio applied to the fonts height to be more like browsers' line height + */ + "font_height_ratio" => 1.1, + + /** + * Use the HTML5 Lib parser + * + * @deprecated This feature is now always on in dompdf 2.x + * @var bool + */ + "enable_html5_parser" => true, + ), + + +); diff --git a/public/assets/js/admin/manage_customer/edit.js b/public/assets/js/admin/manage_customer/edit.js index 2956a16..5c0a3ec 100644 --- a/public/assets/js/admin/manage_customer/edit.js +++ b/public/assets/js/admin/manage_customer/edit.js @@ -70,12 +70,12 @@ $(document).on("click", "#customer_user_btn", function (e) { if (result.status_code == 200) { toastr.success('Customer Updated Sucessfully'); setTimeout(function() { - window.location.href = base_url + "/manage_customer"; + window.location.href = base_url + "/manage-customer"; }, 2000); } else { toastr.error('Something Went Wrong'); setTimeout(function() { - window.location.href = base_url + "/manage_customer"; + window.location.href = base_url + "/manage-customer"; }, 2000); } $('#customer_user_btn').attr('disabled', false); diff --git a/public/assets/js/admin/manage_customer/main.js b/public/assets/js/admin/manage_customer/main.js index 24c83b0..2d3d142 100644 --- a/public/assets/js/admin/manage_customer/main.js +++ b/public/assets/js/admin/manage_customer/main.js @@ -40,7 +40,7 @@ $(document).on("click", ".customer_archive", function (e) { if (response.status == 200) { toastr.success('Record has been archive'); setTimeout(function () { - window.location.href = base_url + "/manage_customer"; + window.location.href = base_url + "/manage-customer"; }, 1000); } else { toastr.error("Something went wrong"); @@ -72,7 +72,7 @@ $(document).on("click", ".customer_unarchive", function (e) { if (response.status == 200) { toastr.success('Record has been '); setTimeout(function () { - window.location.href = base_url + "/manage_customer"; + window.location.href = base_url + "/manage-customer"; }, 1000); } else { toastr.error("Something went wrong"); diff --git a/resources/views/Admin/pages/manage_users/manage_customer/archive_manage_customer.blade.php b/resources/views/Admin/pages/manage_users/manage_customer/archive_manage_customer.blade.php new file mode 100644 index 0000000..16e5d3e --- /dev/null +++ b/resources/views/Admin/pages/manage_users/manage_customer/archive_manage_customer.blade.php @@ -0,0 +1,96 @@ +@extends('admin.layouts.master') + +@section('content') +@php + $currentPage = 'manage-patient'; +@endphp + +
+
+
+ +
+
+ + + + + + + + + + {{-- --}} + + + + + @foreach ($customers as $customer) + + + + + + + + {{-- --}} + + + @endforeach + +
Sr noFull NameUser IDEmail IdDate of birthPhone NumberLocationAction
{{$loop->iteration }}{{$customer->first_name }}{{$customer->id }}{{$customer->email_address }}{{$customer->date_of_birth }}{{$customer->phone_number }}New York + + + Restore + +
+
+
+
+
+
+ + +@endsection + + +@section('section_script') + + +@endsection 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 8d54797..f6ba887 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 @@ -4,7 +4,53 @@ @php $currentPage = 'manage-patient'; @endphp +
@@ -22,221 +68,185 @@ $currentPage = 'manage-patient';
- - -
+
+ @csrf + + + + + + - - - - - - - - - - - @endforeach + + + + + + + + + + + + + + + + @foreach ($customers as $customer) + + + + + + + + + + + + + + + + + + + + + @endforeach + - - - +
+
+
- -
{{ $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 - -
- - -
-
Sr noFull NameUser IDEmail IdDate of birthPhone NumberLocationAction
+
+ +
+
{{ $loop->iteration }}{{ $customer->first_name }} {{ $customer->last_name }}{{ $customer->id }}{{ $customer->email_address }}{{ \Carbon\Carbon::parse($customer->date_of_birth)->format('d/m/Y') }}{{ $customer->phone_number }}{{ $customer->state ? $customer->state->name : 'No state assigned' }} + + View + + + Edit + + + Archive + +
+
- -
+ +
+ + + + +