Merge pull request #21 from WDI-Ideas/sayaliP

Sayali p
This commit is contained in:
CodewithSayali
2024-05-28 19:40:42 +05:30
committed by GitHub
2 changed files with 20 additions and 32 deletions

View File

@@ -149,23 +149,7 @@ public function delete_customer($id)
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 {
@@ -183,23 +167,23 @@ public function download_pdf($id)
}
public function exportSelectedCustomer(Request $request)
{
// public function exportSelectedCustomer(Request $request)
// {
// try {
try {
// if ($request->has('all_id')) {
// return Excel::download(new customer_export, 'Passport_data.xlsx');
// }
if ($request->has('all_id')) {
return Excel::download(new customer_export, 'Passport_data.xlsx');
}
// $ids = $request->selected_id;
$ids = $request->selected_id;
$fileName = 'selected_customer_data.xlsx';
return Excel::download(new CustomerExportSelected ($ids), $fileName);
} catch (\Exception $e) {
return response()->json(['error' => 'Export failed. Something went wrong.'], 500);
}
}
// $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);
// }
// }

View File

@@ -279,9 +279,13 @@ $currentPage = 'manage-patient';
</script> -->
<script>
// $(document).ready(function() {
// $('<button><a class="extra-btn width-max-content" href="{{ route('customer_archive') }}">View Archive List</a></button><button><ul class="navbar-item flex-row ms-lg-auto ms-0"><li class="nav-item dropdown action-dropdown order-lg-0 order-1"><a href="javascript:void(0);"class="nav-link dropdown-toggle user extra-btn" id="actionDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><div class="avatar-container"><div class="avatar avatar-sm avatar-indicators avatar-online"><h3>Export</h3></div></div></a><div class="dropdown-menu position-absolute" aria-labelledby="actionDropdown"><div class="dropdown-item"><a href="#"><span>Download Overview</span></a></div><div class="dropdown-item"><a href="#"><span>Download Patient Data</span></a></div><div class="dropdown-item"><a href="#"> <span>Download Selected</span></a></div></div></li></ul></button>').insertBefore("#zero-config_filter label");
// });
$(document).ready(function() {
$('<button><a class="extra-btn width-max-content" href="{{ route('customer_archive') }}">View Archive List</a></button><button><ul class="navbar-item flex-row ms-lg-auto ms-0"><li class="nav-item dropdown action-dropdown order-lg-0 order-1"><a href="javascript:void(0);"class="nav-link dropdown-toggle user extra-btn" id="actionDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><div class="avatar-container"><div class="avatar avatar-sm avatar-indicators avatar-online"><h3>Export</h3></div></div></a><div class="dropdown-menu position-absolute" aria-labelledby="actionDropdown"><div class="dropdown-item"><a href="#"><span>Download Overview</span></a></div><div class="dropdown-item"><a href="#"><span>Download Patient Data</span></a></div><div class="dropdown-item"><a href="#"> <span>Download Selected</span></a></div></div></li></ul></button>').insertBefore("#zero-config_filter label");
});
$('<button><a class="extra-btn width-max-content" href="{{ route('customer_archive') }}">View Archive List</a></button>').insertBefore("#zero-config_filter label");
});
</script>
@endsection