dashoabrdExcel
This commit is contained in:
44
app/Exports/DashboardExportUser.php
Normal file
44
app/Exports/DashboardExportUser.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class DashboardExportUser implements FromCollection, WithHeadings
|
||||
{
|
||||
protected $recentTransactions;
|
||||
|
||||
public function __construct(array $recentTransactions)
|
||||
{
|
||||
$this->recentTransactions = $recentTransactions;
|
||||
}
|
||||
|
||||
public function collection()
|
||||
{
|
||||
$serial = 1;
|
||||
$mappedTransactions = collect($this->recentTransactions)->map(function ($transaction) use (&$serial) {
|
||||
return [
|
||||
'Sr No.' => $serial++, // Increment serial number
|
||||
'Name' => $transaction['subscription']['first_name'] . ' ' . $transaction['subscription']['last_name'],
|
||||
'Customer Id' => $transaction['subscription']['id'],
|
||||
'Amount' => $transaction['amount'],
|
||||
'Payment Details' => $transaction['stripe_customer_id'], // Adjust as needed
|
||||
];
|
||||
});
|
||||
|
||||
return new Collection($mappedTransactions);
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Sr No.',
|
||||
'Name',
|
||||
'Customer Id',
|
||||
'Amount',
|
||||
'Payment Details',
|
||||
];
|
||||
}
|
||||
}
|
||||
50
app/Exports/DashboardSelectedExportUser.php
Normal file
50
app/Exports/DashboardSelectedExportUser.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use App\Models\Subscriptions;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class DashboardSelectedExportUser implements FromCollection, WithHeadings
|
||||
{
|
||||
protected $ids;
|
||||
|
||||
public function __construct($ids)
|
||||
{
|
||||
$this->ids = explode(',', $ids);
|
||||
}
|
||||
|
||||
public function collection()
|
||||
{
|
||||
$selectedTransactions = Subscriptions::whereIn('id', $this->ids)
|
||||
->with('subscription')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
$serial = 1;
|
||||
$mappedTransactions = collect($selectedTransactions)->map(function ($transaction) use (&$serial) {
|
||||
return [
|
||||
'Sr No.' => $serial++, // Increment serial number
|
||||
'Name' => $transaction['subscription']['first_name'] . ' ' . $transaction['subscription']['last_name'],
|
||||
'Customer Id' => $transaction['subscription']['id'],
|
||||
'Amount' => $transaction['amount'],
|
||||
'Payment Details' => $transaction['stripe_customer_id'], // Adjust as needed
|
||||
];
|
||||
});
|
||||
|
||||
return new Collection($mappedTransactions);
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Sr No.',
|
||||
'Name',
|
||||
'Customer Id',
|
||||
'Amount',
|
||||
'Payment Details',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -5,59 +5,54 @@ namespace App\Exports;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use App\Models\IamPrincipal;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
|
||||
|
||||
class customer_export implements FromCollection , WithHeadings
|
||||
class customer_export implements FromCollection, WithHeadings
|
||||
{
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
$customers = IamPrincipal::where('principal_type_xid', 3)
|
||||
->select(
|
||||
'id',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'email_address',
|
||||
'date_of_birth',
|
||||
'state_xid',
|
||||
'phone_number'
|
||||
)
|
||||
->get();
|
||||
|
||||
|
||||
public function collection(){
|
||||
return IamPrincipal::where('principal_type_xid',3)
|
||||
->select('id',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'email_address',
|
||||
'date_of_birth',
|
||||
'state_xid',
|
||||
'phone_number'
|
||||
)
|
||||
->get()
|
||||
->map(function ($customer) {
|
||||
$serial = 1;
|
||||
return $customers->map(function ($customer) use (&$serial) {
|
||||
return [
|
||||
'id' => $customer->id,
|
||||
'first_name' => $customer->first_name,
|
||||
'last_name' => $customer->last_name,
|
||||
'Sr No.' => $serial++, // Increment serial number
|
||||
'id' => $customer->id,
|
||||
'first_name' => $customer->first_name,
|
||||
'last_name' => $customer->last_name,
|
||||
'email_address' => $customer->email_address,
|
||||
'date_of_birth'=> \Carbon\Carbon::parse($customer->date_of_birth)->format('m/d/Y'),
|
||||
'state_xid' => $customer->state->name ?? '', // Access the state name and handle null
|
||||
'phone_number' => $customer->phone_number,
|
||||
'date_of_birth' => \Carbon\Carbon::parse($customer->date_of_birth)->format('m/d/Y'),
|
||||
'state_xid' => $customer->state->name ?? '', // Access the state name and handle null
|
||||
'phone_number' => $customer->phone_number,
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
//function header in excel
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
// Function to provide the headings in Excel
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Sr No.',
|
||||
'User Id',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'email_address',
|
||||
'date_of_birth',
|
||||
'state_name',
|
||||
'phone_number'
|
||||
'First Name',
|
||||
'Last Name',
|
||||
'Email Address',
|
||||
'Date of Birth',
|
||||
'State Name',
|
||||
'Phone Number',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class customer_export_selected implements FromCollection, WithHeadings
|
||||
// Log the ids for debugging purposes
|
||||
Log::info('Fetching data for IDs: ' . implode(',', $this->ids));
|
||||
|
||||
$selected_customer = IamPrincipal::whereIn('id', $this->ids)
|
||||
$selected_customers = IamPrincipal::whereIn('id', $this->ids)
|
||||
->with('state:id,name') // Eager load the state relationship
|
||||
->orderBy('id', 'desc')
|
||||
->select(
|
||||
@@ -37,28 +37,32 @@ class customer_export_selected implements FromCollection, WithHeadings
|
||||
'state_xid',
|
||||
'phone_number'
|
||||
)
|
||||
->get()
|
||||
->map(function ($customer) {
|
||||
return [
|
||||
'id' => $customer->id,
|
||||
'first_name' => $customer->first_name,
|
||||
'last_name' => $customer->last_name,
|
||||
'email_address' => $customer->email_address,
|
||||
'date_of_birth' => \Carbon\Carbon::parse($customer->date_of_birth)->format('m/d/Y'), // Format the date
|
||||
'state_xid' => $customer->state->name ?? '', // Access the state name and handle null
|
||||
'phone_number' => $customer->phone_number,
|
||||
];
|
||||
});
|
||||
->get();
|
||||
|
||||
$serial = 1;
|
||||
$mappedCustomers = $selected_customers->map(function ($customer) use (&$serial) {
|
||||
return [
|
||||
'Sr No.' => $serial++, // Increment serial number
|
||||
'id' => $customer->id,
|
||||
'first_name' => $customer->first_name,
|
||||
'last_name' => $customer->last_name,
|
||||
'email_address' => $customer->email_address,
|
||||
'date_of_birth' => \Carbon\Carbon::parse($customer->date_of_birth)->format('m/d/Y'), // Format the date
|
||||
'state_xid' => $customer->state->name ?? '', // Access the state name and handle null
|
||||
'phone_number' => $customer->phone_number,
|
||||
];
|
||||
});
|
||||
|
||||
// Log the fetched data for debugging purposes
|
||||
Log::info('Fetched customer data: ' . $selected_customer->toJson());
|
||||
Log::info('Fetched customer data: ' . $mappedCustomers->toJson());
|
||||
|
||||
return new Collection($selected_customer);
|
||||
return new Collection($mappedCustomers);
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Sr No.',
|
||||
'User Id',
|
||||
'First Name',
|
||||
'Last Name',
|
||||
|
||||
@@ -8,6 +8,10 @@ use App\Models\IamPrincipal;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Models\ManageRestaurant;
|
||||
use App\Models\Subscriptions;
|
||||
use App\Exports\DashboardExportUser;
|
||||
use App\Exports\DashboardSelectedExportUser;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
@@ -93,4 +97,28 @@ class DashboardController extends Controller
|
||||
'recent_transaction'
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Created By : Sayali Parab
|
||||
Created at : 08 July 2024
|
||||
Use : To Get Excel.
|
||||
*/
|
||||
public function exportRecentTransactions(Request $request)
|
||||
{
|
||||
try {
|
||||
if ($request->has('all_id')) {
|
||||
$recentTransaction = Subscriptions::with('subscription')->get()->toArray();
|
||||
// return $recentTransaction;
|
||||
return Excel::download(new DashboardExportUser($recentTransaction), 'recent_transactions.xlsx');
|
||||
}
|
||||
|
||||
$ids = $request->input('selected_id');
|
||||
$fileName = 'selected_customer_transaction_data.xlsx';
|
||||
return Excel::download(new DashboardSelectedExportUser($ids), $fileName);
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['error' => 'Export failed. Something went wrong.'], 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ class ManageCustomerController extends Controller
|
||||
{
|
||||
try {
|
||||
if ($request->has('all_id')) {
|
||||
return Excel::download(new customer_export, 'Passport_data.xlsx');
|
||||
return Excel::download(new customer_export, 'customer_data.xlsx');
|
||||
}
|
||||
|
||||
$ids = $request->selected_id;
|
||||
|
||||
@@ -12,6 +12,7 @@ class Subscriptions extends Model
|
||||
protected $table = 'subscriptions';
|
||||
protected $guarded = [];
|
||||
|
||||
|
||||
public function subscription()
|
||||
{
|
||||
return $this->belongsTo(IamPrincipal::class, 'iam_principal_xid', 'id');
|
||||
@@ -19,11 +20,8 @@ class Subscriptions extends Model
|
||||
|
||||
|
||||
|
||||
public function iamPrincipal()
|
||||
{
|
||||
return $this->belongsTo(IamPrincipal::class, 'iam_principal_xid', 'id');
|
||||
public function iamPrincipal()
|
||||
{
|
||||
return $this->belongsTo(IamPrincipal::class, 'iam_principal_xid', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
@extends('Admin.layouts.master')
|
||||
@section('content')
|
||||
@php
|
||||
$currentPage = 'dashboard';
|
||||
@endphp
|
||||
<div class="layout-px-spacing">
|
||||
<div class="middle-content container-xxl p-0">
|
||||
<div class="row layout-top-spacing ">
|
||||
<div class="top-tabel">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<h6 class="card-title">Dashboard</h6>
|
||||
@php
|
||||
$currentPage = 'dashboard';
|
||||
@endphp
|
||||
<div class="layout-px-spacing">
|
||||
<div class="middle-content container-xxl p-0">
|
||||
<div class="row layout-top-spacing ">
|
||||
<div class="top-tabel">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<h6 class="card-title">Dashboard</h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 d-flex align-items-center gap-3 p-0 mb-4">
|
||||
<div class="col-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<a href="{{ route('manage.customer') }}">
|
||||
<h5>No of Customers</h5>
|
||||
<h2 class="m-0 font-weight-bold">{{ $customerCount }}</h2>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 d-flex align-items-center gap-3 p-0 mb-4">
|
||||
<div class="col-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<a href="{{ route('manage.customer') }}">
|
||||
<h5>No of Customers</h5>
|
||||
<h2 class="m-0 font-weight-bold">{{ $customerCount }}</h2>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- <div class="col-6">
|
||||
{{-- <div class="col-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
|
||||
@@ -52,37 +52,37 @@
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
<div class="col-6">
|
||||
<div class="col-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<a href="{{ route('manage.restaurants') }}">
|
||||
<h5>No of Restaurants</h5>
|
||||
<h2 class="m-0 font-weight-bold">{{ $restaurantCount }}</h2>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 d-flex align-items-center p-0 mb-4">
|
||||
<div class="col-12 d-flex align-items-center p-0 mb-4">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<a href="{{ route('manage.restaurants') }}">
|
||||
<h5>No of Restaurants</h5>
|
||||
<h2 class="m-0 font-weight-bold">{{ $restaurantCount }}</h2>
|
||||
</a>
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h5>User Graph</h5>
|
||||
<select class="form-control w-25" id="graph-filter">
|
||||
<option value="monthly" selected>Monthly</option>
|
||||
<option value="quarterly">Quarterly</option>
|
||||
<option value="yearly">Yearly</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="user-chart"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 d-flex align-items-center p-0 mb-4">
|
||||
<div class="col-12 d-flex align-items-center p-0 mb-4">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h5>User Graph</h5>
|
||||
<select class="form-control w-25" id="graph-filter">
|
||||
<option value="monthly" selected>Monthly</option>
|
||||
<option value="quarterly">Quarterly</option>
|
||||
<option value="yearly">Yearly</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="user-chart"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- <div class="col-md-6">
|
||||
{{-- <div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
@@ -99,117 +99,100 @@
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
</div>
|
||||
<div class="col-12 d-flex align-items-center p-0 mb-4">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5>Recent Transactions</h5>
|
||||
<form method="POST" id="customer-form">
|
||||
@csrf
|
||||
<input type="hidden" name="selected_id" id="ids" disabled>
|
||||
<input type="hidden" name="all_id" id="all_id" value="all" disabled>
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<table id="zero-config" class="table dt-table-hover location_table"
|
||||
style="width:100%">
|
||||
<thead class="text-center">
|
||||
<tr>
|
||||
<th class="w-10px pe-2">
|
||||
<div
|
||||
class="form-check form-check-sm form-check-custom form-check-solid me-3">
|
||||
<input class="form-check-input" type="checkbox"
|
||||
name="customer_ids" id="select-all-ids" />
|
||||
</div>
|
||||
</th>
|
||||
<th class="text-start">Sr no</th>
|
||||
<th class="text-start">Name</th>
|
||||
<th class="text-start">Customer Id</th>
|
||||
<th class="text-start">Amount</th>
|
||||
<th class="text-start">payment Details</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="text-center">
|
||||
@foreach ($recent_transaction as $recent_transactions)
|
||||
<tr>
|
||||
<td>
|
||||
<div
|
||||
class="form-check form-check-sm form-check-custom form-check-solid">
|
||||
<input class="form-check-input" type="checkbox"
|
||||
id="customer_checkbox_ids" name="customer_ids"
|
||||
value="{{ $recent_transactions['id'] }}" />
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-start">{{ $loop->iteration }}</td>
|
||||
<td class="text-start">
|
||||
{{ $recent_transactions['subscription']['first_name'] }}
|
||||
{{ $recent_transactions['subscription']['last_name'] }}
|
||||
</td>
|
||||
<td class="text-start">
|
||||
{{ $recent_transactions['subscription']['id'] }}</td>
|
||||
<td class="text-start">$ {{ $recent_transactions['amount'] }}</td>
|
||||
<td class="text-start">
|
||||
<a class="view-btn m-0 pointer sub_admin_permission"
|
||||
data-toggle="modal" data-target="#payment-details-modal"
|
||||
data-id="{{ $recent_transactions['id'] }}"
|
||||
data-name="{{ $recent_transactions['subscription']['first_name'] }}"
|
||||
data-price="{{ $recent_transactions['amount'] }}"
|
||||
data-subscription-id="{{ $recent_transactions['subscription_id'] }}"
|
||||
data-customer-id="{{ $recent_transactions['stripe_customer_id'] }}"
|
||||
data-subscription-status="{{ $recent_transactions['subscription_status'] }}"
|
||||
data-start-date="{{ $recent_transactions['current_period_start'] }}"
|
||||
data-end-date="{{ $recent_transactions['current_period_end'] }}"
|
||||
data-next-date="{{ $recent_transactions['next_payment_date'] }}">View</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 d-flex align-items-center p-0 mb-4">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5>Recent Transactions</h5>
|
||||
<form action ="{{ route('export.recent.transactions') }}" method="POST" id="customer-form">
|
||||
@csrf
|
||||
<input type="hidden" name="selected_id" id="ids" disabled>
|
||||
<input type="hidden" name="all_id" id="all_id" value="all" disabled>
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<table id="zero-config" class="table dt-table-hover location_table" style="width:100%">
|
||||
<thead class="text-center">
|
||||
<tr>
|
||||
<th class="w-10px pe-2">
|
||||
<div class="form-check form-check-sm form-check-custom form-check-solid me-3">
|
||||
<input class="form-check-input" type="checkbox" name="customer_ids" id="select-all-ids" />
|
||||
</div>
|
||||
</th>
|
||||
<th class="text-start">Sr no</th>
|
||||
<th class="text-start">Name</th>
|
||||
<th class="text-start">Customer Id</th>
|
||||
<th class="text-start">Amount</th>
|
||||
<th class="text-start">payment Details</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="text-center">
|
||||
@foreach ($recent_transaction as $recent_transactions)
|
||||
<tr>
|
||||
<td>
|
||||
<div class="form-check form-check-sm form-check-custom form-check-solid">
|
||||
<input class="form-check-input" type="checkbox" id="customer_checkbox_ids" name="customer_ids" value="{{ $recent_transactions['id'] }}" />
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-start">{{ $loop->iteration }}</td>
|
||||
<td class="text-start">
|
||||
{{ $recent_transactions['subscription']['first_name'] }}
|
||||
{{ $recent_transactions['subscription']['last_name'] }}
|
||||
</td>
|
||||
<td class="text-start">
|
||||
|
||||
{{ $recent_transactions['subscription']['id'] }}
|
||||
</td>
|
||||
<td class="text-start">$ {{ $recent_transactions['amount'] }}</td>
|
||||
<td class="text-start">
|
||||
<a class="view-btn m-0 pointer sub_admin_permission" data-toggle="modal" data-target="#payment-details-modal" data-id="{{ $recent_transactions['id'] }}" data-name="{{ $recent_transactions['subscription']['first_name'] }}" data-price="{{ $recent_transactions['amount'] }}" data-subscription-id="{{ $recent_transactions['subscription_id'] }}" data-customer-id="{{ $recent_transactions['stripe_customer_id'] }}" data-subscription-status="{{ $recent_transactions['subscription_status'] }}" data-start-date="{{ $recent_transactions['current_period_start'] }}" data-end-date="{{ $recent_transactions['current_period_end'] }}" data-next-date="{{ $recent_transactions['next_payment_date'] }}">View</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="payment-details-modal" tabindex="-1" role="dialog"
|
||||
aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document" style="max-width: 550px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="modal-header d-flex justify-content-between modal-title">
|
||||
<h5>View Details</h5>
|
||||
<button type="button pointer" class="btn-close" data-dismiss="modal"
|
||||
aria-label="Close">
|
||||
x
|
||||
</button>
|
||||
</div>
|
||||
<div class="row" style="padding: 0px 10px;">
|
||||
<div class="form-group subadmin-option col-md-12">
|
||||
<div class="payment-main-div">
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Name:</strong></p><span></span>
|
||||
</div>
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Price:</strong></p><span></span>
|
||||
</div>
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Subscription ID:</strong></p><span></span>
|
||||
</div>
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Stripe Customer Id:</strong></p><span></span>
|
||||
</div>
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Subscription Status:</strong></p><span></span>
|
||||
</div>
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Current Start Period:</strong></p><span></span>
|
||||
</div>
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Current End Period:</strong></p><span></span>
|
||||
</div>
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Next Period Date:</strong></p><span></span>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="payment-details-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document" style="max-width: 550px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="modal-header d-flex justify-content-between modal-title">
|
||||
<h5>View Details</h5>
|
||||
<button type="button pointer" class="btn-close" data-dismiss="modal" aria-label="Close">
|
||||
x
|
||||
</button>
|
||||
</div>
|
||||
<div class="row" style="padding: 0px 10px;">
|
||||
<div class="form-group subadmin-option col-md-12">
|
||||
<div class="payment-main-div">
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Name:</strong></p><span></span>
|
||||
</div>
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Price:</strong></p><span></span>
|
||||
</div>
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Subscription ID:</strong></p><span></span>
|
||||
</div>
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Stripe Customer Id:</strong></p><span></span>
|
||||
</div>
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Subscription Status:</strong></p><span></span>
|
||||
</div>
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Current Start Period:</strong></p><span></span>
|
||||
</div>
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Current End Period:</strong></p><span></span>
|
||||
</div>
|
||||
<div class="payment-inn-div">
|
||||
<p><strong>Next Period Date:</strong></p><span></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -217,230 +200,276 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('section_script')
|
||||
<script>
|
||||
$('#zero-config').DataTable({
|
||||
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
||||
"<'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": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>',
|
||||
"sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>'
|
||||
},
|
||||
"sInfo": "Showing page PAGE of _PAGES_",
|
||||
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
||||
"sSearchPlaceholder": "Search...",
|
||||
"sLengthMenu": "Results : _MENU_",
|
||||
<script>
|
||||
$('#zero-config').DataTable({
|
||||
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
||||
"<'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": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>',
|
||||
"sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>'
|
||||
},
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [7, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
});
|
||||
"sInfo": "Showing page PAGE of _PAGES_",
|
||||
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
||||
"sSearchPlaceholder": "Search...",
|
||||
"sLengthMenu": "Results : _MENU_",
|
||||
},
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [7, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
});
|
||||
|
||||
$('#zero-config2').DataTable({
|
||||
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
||||
"<'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": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>',
|
||||
"sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>'
|
||||
},
|
||||
"sInfo": "Showing page PAGE of _PAGES_",
|
||||
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
||||
"sSearchPlaceholder": "Search...",
|
||||
"sLengthMenu": "Results : _MENU_",
|
||||
$('#zero-config2').DataTable({
|
||||
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
||||
"<'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": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>',
|
||||
"sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>'
|
||||
},
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [7, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
"sInfo": "Showing page PAGE of _PAGES_",
|
||||
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
||||
"sSearchPlaceholder": "Search...",
|
||||
"sLengthMenu": "Results : _MENU_",
|
||||
},
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [7, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
});
|
||||
|
||||
|
||||
$(function(e) {
|
||||
$("#select-all-ids").click(function() {
|
||||
$(".form-check-input").prop('checked', $(this).prop('checked'));
|
||||
});
|
||||
|
||||
|
||||
$(function(e) {
|
||||
$("#select-all-ids").click(function() {
|
||||
$(".form-check-input").prop('checked', $(this).prop('checked'));
|
||||
});
|
||||
|
||||
$(".form-check-input").click(function() {
|
||||
if (!$(this).prop('checked')) {
|
||||
$("#select-all-ids").prop('checked', false);
|
||||
} else {
|
||||
if ($(".form-check-input:checked").length === $(".form-check-input").length) {
|
||||
$("#select-all-ids").prop('checked', true);
|
||||
}
|
||||
$(".form-check-input").click(function() {
|
||||
if (!$(this).prop('checked')) {
|
||||
$("#select-all-ids").prop('checked', false);
|
||||
} else {
|
||||
if ($(".form-check-input:checked").length === $(".form-check-input").length) {
|
||||
$("#select-all-ids").prop('checked', true);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("click", "#download-selected", function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var allIds = [];
|
||||
|
||||
// Iterate over each page of the DataTable
|
||||
var table = $('#zero-config').DataTable();
|
||||
for (var i = 0; i < table.page.info().pages; i++) {
|
||||
table.page(i).draw(false); // Switch to page i
|
||||
$('#zero-config tbody input:checked').each(function() {
|
||||
allIds.push($(this).val());
|
||||
});
|
||||
}
|
||||
|
||||
if (allIds.length > 0) {
|
||||
// If there are selected customers
|
||||
$('#ids').prop('disabled', false);
|
||||
$('#all_id').prop('disabled', true);
|
||||
$('#ids').val(allIds);
|
||||
// Now submit the form or perform download action
|
||||
$('#customer-form').submit(); // Or perform your download action here
|
||||
} else {
|
||||
// No customers selected
|
||||
toastr.error("Please select at least one customer to download.");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$(document).on("click", "#download_all", function(e) {
|
||||
$('#all_id').prop('disabled', false);
|
||||
$('#ids').prop('disabled', true);
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("click", ".more", function(e) {
|
||||
$(document).on("click", "#download-selected", function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
var allIds = [];
|
||||
|
||||
// Iterate over each page of the DataTable
|
||||
var table = $('#zero-config').DataTable();
|
||||
for (var i = 0; i < table.page.info().pages; i++) {
|
||||
table.page(i).draw(false); // Switch to page i
|
||||
$('#zero-config tbody input:checked').each(function() {
|
||||
allIds.push($(this).val());
|
||||
});
|
||||
}
|
||||
|
||||
if (allIds.length > 0) {
|
||||
// If there are selected customers
|
||||
$('#ids').prop('disabled', false);
|
||||
$('#all_id').prop('disabled', true);
|
||||
$('#ids').val(allIds);
|
||||
// Now submit the form or perform download action
|
||||
$('#customer-form').submit(); // Or perform your download action here
|
||||
} else {
|
||||
// No customers selected
|
||||
toastr.error("Please select at least one customer to download.");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('<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-mid 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="javascript:void(0)" id="download_all"><span>Download Overview</span></a></div><div class="dropdown-item"><a href="javascript:void(0)" id="download-selected"><span id="export">Download Selected</span></a></div></div></li></ul></button>')
|
||||
.insertBefore("#zero-config_filter label");
|
||||
|
||||
$("#zero-config").on("click", ".sub_admin_permission", function() {
|
||||
var Name = $(this).data('name');
|
||||
var Price = $(this).data('price');
|
||||
var SubID = $(this).data('subscription-id');
|
||||
var CustID = $(this).data('customer-id');
|
||||
var SubStatus = $(this).data('subscription-status');
|
||||
var startDate = $(this).data('start-date');
|
||||
var endDate = $(this).data('end-date');
|
||||
var nextDate = $(this).data('next-date');
|
||||
var formattedPrice = '$' + Price;
|
||||
|
||||
$('.subadmin-option span').eq(0).text(Name);
|
||||
$('.subadmin-option span').eq(1).text(formattedPrice);
|
||||
$('.subadmin-option span').eq(2).text(SubID);
|
||||
$('.subadmin-option span').eq(3).text(CustID);
|
||||
$('.subadmin-option span').eq(4).text(SubStatus);
|
||||
$('.subadmin-option span').eq(5).text(startDate);
|
||||
$('.subadmin-option span').eq(6).text(endDate);
|
||||
$('.subadmin-option span').eq(7).text(nextDate); // Corrected index for next-date
|
||||
});
|
||||
|
||||
|
||||
$(document).on("click", "#download_all", function(e) {
|
||||
$('#all_id').prop('disabled', false);
|
||||
$('#ids').prop('disabled', true);
|
||||
})
|
||||
});
|
||||
|
||||
$(document).on("click", ".more", function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// $('<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-mid 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="javascript:void(0)" id="download_all"><span>Download Overview</span></a></div><div class="dropdown-item"><a href="javascript:void(0)" id="download-selected"><span id="export">Download Selected</span></a></div></div></li></ul></button>')
|
||||
// .insertBefore("#zero-config_filter label");
|
||||
$('<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-mid 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="javascript:void(0)" id="download_all"><span>Download Overview</span></a>' +
|
||||
'</div>' +
|
||||
'<div class="dropdown-item">' +
|
||||
'<a href="javascript:void(0)" id="download-selected"><span id="export">Download Selected</span></a>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</li>' +
|
||||
'</ul>' +
|
||||
'</button>').insertBefore("#zero-config_filter label");
|
||||
|
||||
// Select/Deselect all checkboxes
|
||||
// $('#select-all-ids').click(function() {
|
||||
// $('input[name="customer_ids"]').prop('checked', this.checked);
|
||||
// });
|
||||
|
||||
// // Download all data
|
||||
// $('#download_all').click(function() {
|
||||
// window.location.href = '{{ route("export.recent.transactions") }}?all_id=true';
|
||||
// });
|
||||
|
||||
// // Download selected data
|
||||
// $('#download-selected').click(function() {
|
||||
// var selectedIds = [];
|
||||
// $('input[name="customer_ids"]:checked').each(function() {
|
||||
// selectedIds.push($(this).val());
|
||||
// });
|
||||
|
||||
// if (selectedIds.length > 0) {
|
||||
// var ids = selectedIds.join(',');
|
||||
// window.location.href = '{{ route("export.recent.transactions") }}?selected_id=' + ids;
|
||||
// } else {
|
||||
// alert('Please select at least one transaction to export.');
|
||||
// }
|
||||
// });
|
||||
$("#zero-config").on("click", ".sub_admin_permission", function() {
|
||||
var Name = $(this).data('name');
|
||||
var Price = $(this).data('price');
|
||||
var SubID = $(this).data('subscription-id');
|
||||
var CustID = $(this).data('customer-id');
|
||||
var SubStatus = $(this).data('subscription-status');
|
||||
var startDate = $(this).data('start-date');
|
||||
var endDate = $(this).data('end-date');
|
||||
var nextDate = $(this).data('next-date');
|
||||
var formattedPrice = '$' + Price;
|
||||
|
||||
$('.subadmin-option span').eq(0).text(Name);
|
||||
$('.subadmin-option span').eq(1).text(formattedPrice);
|
||||
$('.subadmin-option span').eq(2).text(SubID);
|
||||
$('.subadmin-option span').eq(3).text(CustID);
|
||||
$('.subadmin-option span').eq(4).text(SubStatus);
|
||||
$('.subadmin-option span').eq(5).text(startDate);
|
||||
$('.subadmin-option span').eq(6).text(endDate);
|
||||
$('.subadmin-option span').eq(7).text(nextDate); // Corrected index for next-date
|
||||
});
|
||||
</script>
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// Initial data and categories
|
||||
var userChartData = getUserChartData('monthly');
|
||||
var userCategories = getUserChartCategories('monthly');
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// Initial data and categories
|
||||
var userChartData = getUserChartData('monthly');
|
||||
var userCategories = getUserChartCategories('monthly');
|
||||
|
||||
// Chart options
|
||||
var userOptions = {
|
||||
chart: {
|
||||
type: 'line',
|
||||
zoom: {
|
||||
enabled: false
|
||||
},
|
||||
toolbar: {
|
||||
show: false
|
||||
}
|
||||
// Chart options
|
||||
var userOptions = {
|
||||
chart: {
|
||||
type: 'line',
|
||||
zoom: {
|
||||
enabled: false
|
||||
},
|
||||
series: userChartData,
|
||||
toolbar: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
series: userChartData,
|
||||
xaxis: {
|
||||
categories: userCategories
|
||||
},
|
||||
stroke: {
|
||||
curve: 'smooth',
|
||||
width: [4, 4]
|
||||
}
|
||||
};
|
||||
|
||||
// Create the chart
|
||||
var userChart = new ApexCharts(document.querySelector("#user-chart"), userOptions);
|
||||
userChart.render();
|
||||
|
||||
// Event listener for filter select element
|
||||
document.getElementById('graph-filter').addEventListener('change', function(event) {
|
||||
var selectedFilter = event.target.value;
|
||||
userChartData = getUserChartData(selectedFilter);
|
||||
userCategories = getUserChartCategories(selectedFilter);
|
||||
|
||||
userChart.updateSeries(userChartData);
|
||||
userChart.updateOptions({
|
||||
xaxis: {
|
||||
categories: userCategories
|
||||
},
|
||||
stroke: {
|
||||
curve: 'smooth',
|
||||
width: [4, 4]
|
||||
}
|
||||
};
|
||||
|
||||
// Create the chart
|
||||
var userChart = new ApexCharts(document.querySelector("#user-chart"), userOptions);
|
||||
userChart.render();
|
||||
|
||||
// Event listener for filter select element
|
||||
document.getElementById('graph-filter').addEventListener('change', function(event) {
|
||||
var selectedFilter = event.target.value;
|
||||
userChartData = getUserChartData(selectedFilter);
|
||||
userCategories = getUserChartCategories(selectedFilter);
|
||||
|
||||
userChart.updateSeries(userChartData);
|
||||
userChart.updateOptions({
|
||||
xaxis: {
|
||||
categories: userCategories
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function getUserChartData(filter) {
|
||||
switch (filter) {
|
||||
case 'monthly':
|
||||
return [{
|
||||
name: 'Total Accounts',
|
||||
data: <?php echo json_encode(array_values($dataMonthlyWithType3)); ?>
|
||||
},
|
||||
{
|
||||
name: 'Total Subscribed',
|
||||
data: <?php echo json_encode(array_values($dataMonthlyWithType4)); ?>
|
||||
}
|
||||
];
|
||||
case 'quarterly':
|
||||
return [{
|
||||
name: 'Total Accounts',
|
||||
data: <?php echo json_encode(array_values($dataQuarterlyWithType3)); ?>
|
||||
},
|
||||
{
|
||||
name: 'Total Subscribed',
|
||||
data: <?php echo json_encode(array_values($dataQuarterlyWithType4)); ?>
|
||||
}
|
||||
];
|
||||
case 'yearly':
|
||||
return [{
|
||||
name: 'Total Accounts',
|
||||
data: <?php echo json_encode(array_values($dataYearlyWithType3)); ?>
|
||||
},
|
||||
{
|
||||
name: 'Total Subscribed',
|
||||
data: <?php echo json_encode(array_values($dataYearlyWithType4)); ?>
|
||||
}
|
||||
];
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
function getUserChartData(filter) {
|
||||
switch (filter) {
|
||||
case 'monthly':
|
||||
return [{
|
||||
name: 'Total Accounts',
|
||||
data: <?php echo json_encode(array_values($dataMonthlyWithType3)); ?>
|
||||
},
|
||||
{
|
||||
name: 'Total Subscribed',
|
||||
data: <?php echo json_encode(array_values($dataMonthlyWithType4)); ?>
|
||||
}
|
||||
];
|
||||
case 'quarterly':
|
||||
return [{
|
||||
name: 'Total Accounts',
|
||||
data: <?php echo json_encode(array_values($dataQuarterlyWithType3)); ?>
|
||||
},
|
||||
{
|
||||
name: 'Total Subscribed',
|
||||
data: <?php echo json_encode(array_values($dataQuarterlyWithType4)); ?>
|
||||
}
|
||||
];
|
||||
case 'yearly':
|
||||
return [{
|
||||
name: 'Total Accounts',
|
||||
data: <?php echo json_encode(array_values($dataYearlyWithType3)); ?>
|
||||
},
|
||||
{
|
||||
name: 'Total Subscribed',
|
||||
data: <?php echo json_encode(array_values($dataYearlyWithType4)); ?>
|
||||
}
|
||||
];
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
function getUserChartCategories(filter) {
|
||||
switch (filter) {
|
||||
case 'monthly':
|
||||
return ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
case 'quarterly':
|
||||
return ['Q1', 'Q2', 'Q3', 'Q4'];
|
||||
case 'yearly':
|
||||
return <?php echo json_encode(array_keys($dataYearlyWithType3)); ?>;
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
function getUserChartCategories(filter) {
|
||||
switch (filter) {
|
||||
case 'monthly':
|
||||
return ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
case 'quarterly':
|
||||
return ['Q1', 'Q2', 'Q3', 'Q4'];
|
||||
case 'yearly':
|
||||
return <?php echo json_encode(array_keys($dataYearlyWithType3)); ?>;
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@@ -61,6 +61,7 @@ Route::group(['middleware' => ['checkStatus']], function () {
|
||||
|
||||
|
||||
Route::get('/dashboard', [DashboardController::class, 'showDashboard'])->name('dashboard');
|
||||
Route::post('/export_recent_transaction', [DashboardController::class, 'exportRecentTransactions'])->name('export.recent.transactions');
|
||||
|
||||
Route::get('/profile', [ManageProfileController::class, 'index'])->name('profile');
|
||||
Route::post('/update_profile', [ManageProfileController::class, 'update_profile'])->name('update.profile');
|
||||
|
||||
Reference in New Issue
Block a user