SubscriptionCancelled
This commit is contained in:
@@ -94,7 +94,7 @@ class SubscriptionController extends Controller
|
||||
public function createStripeProduct(Request $request)
|
||||
{
|
||||
|
||||
|
||||
|
||||
try {
|
||||
|
||||
DB::beginTransaction();
|
||||
@@ -257,98 +257,85 @@ class SubscriptionController extends Controller
|
||||
public function cancelSubscription(Request $request)
|
||||
{
|
||||
try {
|
||||
Log::info("Razorpay Cancel subscriptions Begin: ");
|
||||
DB::beginTransaction();
|
||||
$stripeSecret = (config('constants.subscription.stripe_secret_key'));
|
||||
// $stripeSecret = env('STRIPE_SECRET');
|
||||
|
||||
$validator = $this->validateCancelSubscriptionForm($request);
|
||||
$stripe = new \Stripe\StripeClient($stripeSecret);
|
||||
$userId = $request->iam_principal_xid;
|
||||
|
||||
if ($validator->fails()) {
|
||||
$validationErrors = $validator->errors()->all();
|
||||
Log::error("Razorpay Cancel subscriptions validation error: " . implode(", ", $validationErrors));
|
||||
return jsonResponseWithErrorMessageApi($validationErrors, 203);
|
||||
}
|
||||
// dd($request->all(),$stripeSecret);
|
||||
|
||||
$iamPrincipalId = $request->iam_principal_xid;
|
||||
$razorpaySubscriptionId = $request->subscription_id;
|
||||
$subscriptionXid = $request->subscription_xid;
|
||||
$getSubscriptionData = Subscriptions::where('iam_principal_xid', $userId)->where('subscription_status', 'active')->first();
|
||||
|
||||
$getSubscriptionData = RazorpaySubscriptions::where(['id' => $subscriptionXid, 'iam_principal_xid' => $iamPrincipalId, 'subscription_id' => $razorpaySubscriptionId, 'isCancelledSubscription' => 0])->first();
|
||||
$subscriptionId = $getSubscriptionData->subscription_id;
|
||||
|
||||
$cancelledSubscription = $stripe->subscriptions->update(
|
||||
$subscriptionId,
|
||||
['cancel_at_period_end' => true]
|
||||
);
|
||||
|
||||
|
||||
if (!$getSubscriptionData) {
|
||||
return response()->json(['status' => 502, 'message' => 'Something went wrong while cancelling Subscription']);
|
||||
}
|
||||
|
||||
$api = new Api(config('constants.razorpay.key_id'), config('constants.razorpay.key_secret'));
|
||||
|
||||
$options = ['cancel_at_cycle_end' => 1];
|
||||
// Call the subscription create method with request parameters
|
||||
$response = $api->subscription->fetch($razorpaySubscriptionId)->cancel($options);
|
||||
$subscriptionFromDatabase = Subscriptions::where('subscription_id', $subscriptionId)->first();
|
||||
$subscriptionFromDatabase->cancelled_at = date('Y-m-d H:i:s', $cancelledSubscription->canceled_at);
|
||||
|
||||
$subscriptionFromDatabase->subscription_status = $cancelledSubscription->status;
|
||||
$subscriptionFromDatabase->is_cancelled_subscription = 1; //2 for cancelled
|
||||
$subscriptionFromDatabase->status = "cancelled";
|
||||
|
||||
$subscriptionFromDatabase->save();
|
||||
|
||||
|
||||
$getSubscription = $stripe->subscriptions->retrieve($subscriptionFromDatabase->subscription_id, []);
|
||||
|
||||
|
||||
$getSubscribeCustomer = $stripe->customers->retrieve(
|
||||
$subscriptionFromDatabase->stripe_customer_id,
|
||||
[]
|
||||
);
|
||||
|
||||
$endAt = date('Y-m-d H:i:s', $response->end_at);
|
||||
$dateTime = now();
|
||||
$currentDateTime = $dateTime->format('Y-m-d H:i:s');
|
||||
$getSubscriptionData->isCancelledSubscription = 1;
|
||||
$getSubscriptionData->cancelled_at = $currentDateTime;
|
||||
$getSubscriptionData->save();
|
||||
|
||||
DB::commit();
|
||||
Log::info("Razorpay Cancel subscriptions end: ");
|
||||
return redirect()->back()->with(['success' => "Your Subscription Cancelled Successfully!"]);
|
||||
|
||||
return response()->json(['status' => 200, 'end_date' => $endAt]);
|
||||
// return response()->json(['status' => 200, 'message' => 'Your Subscription has been cancelled Sucessfully']);
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::error("An error occurred in " . _METHOD_ . ": " . $e->getMessage(), ['exception' => $e]);
|
||||
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
|
||||
|
||||
return redirect()->back()->with(['error' => "Something went wrong while cancelling subscription!" . $e->getMessage()]);
|
||||
// Log::error("An error occurred in " . _METHOD_ . ": " . $e->getMessage(), ['exception' => $e]);
|
||||
// return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
|
||||
}
|
||||
}
|
||||
public function validateCancelSubscriptionForm(Request $request)
|
||||
|
||||
/**
|
||||
* Created By : Hritik
|
||||
* Created at : 05 Jult 2024
|
||||
* Use : To Apply Referral Code and return the User Id.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
public function applyReferralCode(Request $request)
|
||||
{
|
||||
return Validator::make(
|
||||
$request->all(),
|
||||
[
|
||||
'iam_principal_xid' => 'required',
|
||||
'subscription_id' => 'required',
|
||||
'subscription_xid' => 'required',
|
||||
]
|
||||
);
|
||||
try {
|
||||
|
||||
$referralCode = $request->input('referral_code');
|
||||
$currentUserId = $request->input('current_iam_principal_xid');
|
||||
$code = IamPrincipal::where('referral_code', $referralCode)->where('id', '!=', $currentUserId)->where('principal_type_xid', 3)->first();
|
||||
|
||||
if ($code) {
|
||||
return response()->json(['success' => true, 'message' => 'Referral code applied successfully.', 'referralUserId' => $code->id]);
|
||||
} else {
|
||||
return response()->json(['success' => false, 'message' => 'Invalid referral code.']);
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage(), ['exception' => $e]);
|
||||
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// public function subscriptionUpgrade(Request $request)
|
||||
// {
|
||||
// // dd($request->all());
|
||||
|
||||
// $razorPaysubscriptionProductXid = $request->razorpay_plan_id;
|
||||
// $productTypeId = $request->product_type_xid;
|
||||
// $productTierId = $request->product_tier_xid;
|
||||
// $iamId = $request->iam_principal_xid;
|
||||
|
||||
// $user_id = 12; // Change this to dynamic user ID
|
||||
|
||||
// // Retrieve the current monthly subscription
|
||||
// $currentSubscription = RazorpaySubscriptions::where('iam_principal_xid', $user_id)->first();
|
||||
|
||||
// if (!$currentSubscription) {
|
||||
// return response()->json(['status' => 502, 'message' => 'Something went wrong current user Subscription not found']);
|
||||
// }
|
||||
|
||||
// $products = Products::where('product_type_xid', $productTypeId)
|
||||
// ->where('product_tier_xid', $productTierId)
|
||||
// ->where('razorpay_plan_id', $razorPaysubscriptionProductXid)
|
||||
// ->where('is_active', '1')->first();
|
||||
|
||||
// if (!$products) {
|
||||
// return response()->json(['status' => 502, 'message' => 'Something went wrong current product not found']);
|
||||
// }
|
||||
|
||||
// $api = new Api(config('constants.razorpay.key_id'), config('constants.razorpay.key_secret'));
|
||||
// $plan_id = $products->razorpay_plan_id;
|
||||
|
||||
// // Call the subscription create method with request parameters
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ use Illuminate\Http\Request;
|
||||
use App\Models\IamPrincipal;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Models\ManageRestaurant;
|
||||
|
||||
use App\Models\Subscriptions;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
@@ -33,8 +33,7 @@ class DashboardController extends Controller
|
||||
->pluck('count', 'month')
|
||||
->toArray();
|
||||
|
||||
$dataMonthlyWithType4 = IamPrincipal::select(DB::raw("COUNT(*) as count"), DB::raw("MONTH(created_at) as month"))
|
||||
->where('principal_type_xid', 4)
|
||||
$dataMonthlyWithType4 = Subscriptions::select(DB::raw("COUNT(*) as count"), DB::raw("MONTH(created_at) as month"))
|
||||
->whereYear('created_at', date('Y'))
|
||||
->groupBy(DB::raw("MONTH(created_at)"))
|
||||
->orderBy(DB::raw("MONTH(created_at)"))
|
||||
@@ -54,8 +53,7 @@ class DashboardController extends Controller
|
||||
->pluck('count', 'quarter')
|
||||
->toArray();
|
||||
|
||||
$dataQuarterlyWithType4 = IamPrincipal::select(DB::raw("COUNT(*) as count"), DB::raw("QUARTER(created_at) as quarter"))
|
||||
->where('principal_type_xid', 4)
|
||||
$dataQuarterlyWithType4 = Subscriptions::select(DB::raw("COUNT(*) as count"), DB::raw("QUARTER(created_at) as quarter"))
|
||||
->groupBy(DB::raw("QUARTER(created_at)"))
|
||||
->orderBy(DB::raw("QUARTER(created_at)"))
|
||||
->pluck('count', 'quarter')
|
||||
@@ -73,14 +71,15 @@ class DashboardController extends Controller
|
||||
->pluck('count', 'year')
|
||||
->toArray();
|
||||
|
||||
$dataYearlyWithType4 = IamPrincipal::select(DB::raw("COUNT(*) as count"), DB::raw("YEAR(created_at) as year"))
|
||||
->where('principal_type_xid', 4)
|
||||
$dataYearlyWithType4 = Subscriptions::select(DB::raw("COUNT(*) as count"), DB::raw("YEAR(created_at) as year"))
|
||||
->groupBy(DB::raw("YEAR(created_at)"))
|
||||
->pluck('count', 'year')
|
||||
->toArray();
|
||||
|
||||
$customerCount = IamPrincipal::where('principal_type_xid', '=', 3)->count();
|
||||
$restaurantCount = ManageRestaurant::where('is_active', 1)->count();
|
||||
$restaurantCount = Subscriptions::where('is_active', 1)->count();
|
||||
$recent_transaction = Subscriptions::with('subscription')->get()->toArray();
|
||||
|
||||
|
||||
return view('Admin.dashboard', compact(
|
||||
'customerCount',
|
||||
@@ -90,7 +89,8 @@ class DashboardController extends Controller
|
||||
'dataQuarterlyWithType3',
|
||||
'dataQuarterlyWithType4',
|
||||
'dataYearlyWithType3',
|
||||
'dataYearlyWithType4'
|
||||
'dataYearlyWithType4',
|
||||
'recent_transaction'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,13 @@ class Subscriptions extends Model
|
||||
|
||||
protected $table = 'subscriptions';
|
||||
protected $guarded = [];
|
||||
|
||||
public function subscription()
|
||||
{
|
||||
return $this->belongsTo(IamPrincipal::class, 'iam_principal_xid', 'id');
|
||||
}
|
||||
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'subscription_product_xid',
|
||||
@@ -34,8 +41,8 @@ class Subscriptions extends Model
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
public function iamPrincipal()
|
||||
{
|
||||
return $this->belongsTo(IamPrincipal::class, 'iam_principal_xid', 'id');
|
||||
|
||||
@@ -56,9 +56,14 @@ class AuthServices
|
||||
do {
|
||||
$referral_code = \Str::random(10);
|
||||
} while (IamPrincipal::where('referral_code', $referral_code)->exists());
|
||||
|
||||
|
||||
if ($request->one_signal_player_id == "null") {
|
||||
$playerId = null;
|
||||
} else {
|
||||
$playerId = $request->one_signal_player_id;
|
||||
}
|
||||
$user = IamPrincipal::create([
|
||||
'one_signal_player_id' => $request->one_signal_player_id,
|
||||
'one_signal_player_id' => $playerId,
|
||||
'first_name' => $request->first_name,
|
||||
'last_name' => $request->last_name,
|
||||
'email_address' => $request->email_address,
|
||||
@@ -118,8 +123,13 @@ class AuthServices
|
||||
Log::error('Customer Login Failed');
|
||||
return jsonResponseWithErrorMessageApi(__('auth.authentication_failed'), 403);
|
||||
}
|
||||
if ($request->one_signal_player_id == "null") {
|
||||
$playerId = null;
|
||||
} else {
|
||||
$playerId = $request->one_signal_player_id;
|
||||
}
|
||||
|
||||
$isExistEmail->one_signal_player_id = $request->one_signal_player_id;
|
||||
$isExistEmail->one_signal_player_id = $playerId ;
|
||||
$isExistEmail->save();
|
||||
$response = [
|
||||
'iam_principal_xid' => $isExistEmail->id,
|
||||
|
||||
@@ -100,668 +100,274 @@
|
||||
</div> --}}
|
||||
|
||||
</div>
|
||||
<!-- <div class="col-12 d-flex p-0 mb-3">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="text-start">Recent Transactions</h5>
|
||||
<div class="d-flex align-items-center justify-content-between mb-2">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="transcation-list">
|
||||
<i class="fa fa-picture-o" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div>
|
||||
<label class="m-0" for="">Jennifer Lawrence</label>
|
||||
<h6 class="font-weight-bold">Cheers to the Summer</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h6 class="font-weight-bold">$500</h6>
|
||||
</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>
|
||||
<div class="d-flex align-items-center justify-content-between mb-2">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="transcation-list">
|
||||
<i class="fa fa-picture-o" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div>
|
||||
<label class="m-0" for="">Jennifer Lawrence</label>
|
||||
<h6 class="font-weight-bold">Cheers to the Summer</h6>
|
||||
</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>
|
||||
<div>
|
||||
<h6 class="font-weight-bold">$500</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-between mb-2">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="transcation-list">
|
||||
<i class="fa fa-picture-o" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div>
|
||||
<label class="m-0" for="">Jennifer Lawrence</label>
|
||||
<h6 class="font-weight-bold">Cheers to the Summer</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h6 class="font-weight-bold">$500</h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="text-start">Locations</h5>
|
||||
<img src="{{ asset('public/assets/img/map.svg') }}" width="100%" height="173px"
|
||||
alt="">
|
||||
</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-price="{{ $recent_transactions['amount'] }}"
|
||||
data-first_name="{{ $recent_transactions['subscription']['first_name'] }}"
|
||||
data-stripeCustId="{{ $recent_transactions['stripe_customer_id'] }}"
|
||||
data-subId="{{ $recent_transactions['subscription_id'] }}"
|
||||
data-subStatus="{{ $recent_transactions['subscription_status'] }}"
|
||||
data-subStartPeriod="{{ $recent_transactions['current_period_start'] }}"
|
||||
data-subCurrentPeriod="{{ $recent_transactions['current_period_end'] }}"
|
||||
data-subNextPeriod="{{ $recent_transactions['next_payment_date'] }}">View</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div> --}}
|
||||
</div>
|
||||
<!-- <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12 layout-spacing">
|
||||
<div class="widget widget-six">
|
||||
<div class="widget-heading">
|
||||
<div class="task-action">
|
||||
<div class="user-details">
|
||||
<img src="../src/assets/img/user-2-svgrepo-com.svg" />
|
||||
<h3>Welcome ,</h3>
|
||||
<h4>Kartikey Gautam</h4>
|
||||
</div>
|
||||
<div class="row w-100">
|
||||
<div class="col-md-4 col-sm-12 layout-spacing pb-0">
|
||||
<div data-draggable="true"
|
||||
class="card simple-title-task ui-sortable-handle">
|
||||
<div class="card-body">
|
||||
<div class="task-header">
|
||||
<div class="order-summary">
|
||||
<div class="summary-list">
|
||||
<div class="w-icon">
|
||||
<img class="img1"
|
||||
src="../src/assets/img/patient(1).svg" />
|
||||
</div>
|
||||
<div class="w-summary-details">
|
||||
<div class="w-summary-info">
|
||||
<h6>Total patients</h6>
|
||||
<p class="summary-count">50</p>
|
||||
</div>
|
||||
|
||||
<div class="w-summary-stats">
|
||||
<div class="progress">
|
||||
<div class="progress-bar bg-gradient-success"
|
||||
role="progressbar" style="width: 50%"
|
||||
aria-valuenow="50" aria-valuemin="0"
|
||||
aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-summary-info mt-0">
|
||||
<p class="summary-text">50 % increase in 30 days
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-sm-12 layout-spacing pb-0">
|
||||
<div data-draggable="true"
|
||||
class="card simple-title-task ui-sortable-handle">
|
||||
<div class="card-body">
|
||||
<div class="task-header">
|
||||
<div class="order-summary">
|
||||
<div class="summary-list">
|
||||
<div class="w-icon">
|
||||
<img class="img2"
|
||||
src="../src/assets/img/heart-add(1).svg" />
|
||||
</div>
|
||||
<div class="w-summary-details">
|
||||
|
||||
<div class="w-summary-info">
|
||||
<h6>Total caregiver</h6>
|
||||
<p class="summary-count">80</p>
|
||||
</div>
|
||||
|
||||
<div class="w-summary-stats">
|
||||
<div class="progress">
|
||||
<div class="progress-bar bg-gradient-warning"
|
||||
role="progressbar" style="width: 80%"
|
||||
aria-valuenow="80" aria-valuemin="0"
|
||||
aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-summary-info mt-0">
|
||||
<p class="summary-text">30 % increase in 30 days
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-12 layout-spacing pb-0">
|
||||
<div data-draggable="true"
|
||||
class="card simple-title-task ui-sortable-handle">
|
||||
<div class="card-body">
|
||||
<div class="task-header">
|
||||
<div class="order-summary">
|
||||
<div class="summary-list">
|
||||
<div class="w-icon">
|
||||
<img class="img3"
|
||||
src="../src/assets/img/download-cloud.svg" />
|
||||
</div>
|
||||
<div class="w-summary-details">
|
||||
|
||||
<div class="w-summary-info">
|
||||
<h6>App downloads</h6>
|
||||
<p class="summary-count">40</p>
|
||||
</div>
|
||||
|
||||
<div class="w-summary-stats">
|
||||
<div class="progress">
|
||||
<div class="progress-bar bg-gradient-secondary"
|
||||
role="progressbar" style="width: 40%"
|
||||
aria-valuenow="40" aria-valuemin="0"
|
||||
aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-summary-info mt-0">
|
||||
<p class="summary-text">15 % increase in 30 days
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
<!-- <div class="col-xl-12 col-lg-4 col-md-4 col-sm-4 col-12 layout-spacing">
|
||||
<div class="widget widget-one_hybrid widget-engagement">
|
||||
<div class="widget-heading">
|
||||
<div class="w-title">
|
||||
<div class="grpah-details">
|
||||
<p class="w-value">New patients</p>
|
||||
<h5 class="">%20 High than last monthy</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="graph2">
|
||||
<div class="grpah-details2">
|
||||
<strong><span>100</span></strong>
|
||||
<span>Overall</span>
|
||||
</div>
|
||||
<div class="right-divider"></div>
|
||||
<div class="grpah-details2">
|
||||
<strong><span>50</span></strong>
|
||||
<span>Monthly</span>
|
||||
</div>
|
||||
<div class="right-divider"></div>
|
||||
<div class="grpah-details2">
|
||||
<strong><span>15</span></strong>
|
||||
<span>Daily</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="widget-content">
|
||||
<div class="w-chart">
|
||||
<div id="hybrid_followers3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-12 col-lg-12 col-sm-12 layout-spacing">
|
||||
<div class="widget-content widget-content-area br-8">
|
||||
<div class="index-card">
|
||||
<div class="grpah-details">
|
||||
<p class="w-value">New patients</p>
|
||||
<a href="manage-patient">View All</a>
|
||||
</div>
|
||||
<table id="zero-config" class="table dt-table-hover" style="width:100%">
|
||||
<thead class="text-center">
|
||||
<tr>
|
||||
<th class="text-start">Name</th>
|
||||
<th>Email address</th>
|
||||
<th>Contact Number</th>
|
||||
<th>Caregiver</th>
|
||||
<th>Subscription Plan</th>
|
||||
<th class="no-content">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="text-center">
|
||||
<tr>
|
||||
<td class="text-start">Raj Shinde</td>
|
||||
<td>rajshinde9@gmail.com</td>
|
||||
<td>+5624878954</td>
|
||||
<td>Kartikey Gautam</td>
|
||||
<td>Active</td>
|
||||
<td>
|
||||
<div class="dropout">
|
||||
<button class="more">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</button>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="view-customer.php">
|
||||
<img src="../src/assets/img/view.svg" />
|
||||
<span>View Details</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" data-toggle="modal" data-target="#archive-modal">
|
||||
<img src="../src/assets/img/archive.svg" />
|
||||
<span>Archive Patient</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<img src="../src/assets/img/download.svg" />
|
||||
<span>Download Data</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" data-toggle="modal" data-target="#suspend-modal">
|
||||
<img src="../src/assets/img/stop.svg" />
|
||||
<span>Suspend Patient</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-start">Raj Shinde</td>
|
||||
<td>rajshinde9@gmail.com</td>
|
||||
<td>+5624878954</td>
|
||||
<td>Kartikey Gautam</td>
|
||||
<td>Active</td>
|
||||
<td>
|
||||
<div class="dropout">
|
||||
<button class="more">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</button>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="view-customer.php">
|
||||
<img src="../src/assets/img/view.svg" />
|
||||
<span>View Details</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" data-toggle="modal" data-target="#archive-modal">
|
||||
<img src="../src/assets/img/archive.svg" />
|
||||
<span>Archive Patient</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<img src="../src/assets/img/download.svg" />
|
||||
<span>Download Data</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" data-toggle="modal" data-target="#suspend-modal">
|
||||
<img src="../src/assets/img/stop.svg" />
|
||||
<span>Suspend Patient</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-start">Raj Shinde</td>
|
||||
<td>rajshinde9@gmail.com</td>
|
||||
<td>+5624878954</td>
|
||||
<td>Kartikey Gautam</td>
|
||||
<td>Active</td>
|
||||
<td>
|
||||
<div class="dropout">
|
||||
<button class="more">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</button>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="view-customer.php">
|
||||
<img src="../src/assets/img/view.svg" />
|
||||
<span>View Details</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" data-toggle="modal" data-target="#archive-modal">
|
||||
<img src="../src/assets/img/archive.svg" />
|
||||
<span>Archive Patient</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<img src="../src/assets/img/download.svg" />
|
||||
<span>Download Data</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" data-toggle="modal" data-target="#suspend-modal">
|
||||
<img src="../src/assets/img/stop.svg" />
|
||||
<span>Suspend Patient</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-start">Raj Shinde</td>
|
||||
<td>rajshinde9@gmail.com</td>
|
||||
<td>+5624878954</td>
|
||||
<td>Kartikey Gautam</td>
|
||||
<td>Active</td>
|
||||
<td>
|
||||
<div class="dropout">
|
||||
<button class="more">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</button>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="view-customer.php">
|
||||
<img src="../src/assets/img/view.svg" />
|
||||
<span>View Details</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" data-toggle="modal" data-target="#archive-modal">
|
||||
<img src="../src/assets/img/archive.svg" />
|
||||
<span>Archive Patient</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<img src="../src/assets/img/download.svg" />
|
||||
<span>Download Data</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" data-toggle="modal" data-target="#suspend-modal">
|
||||
<img src="../src/assets/img/stop.svg" />
|
||||
<span>Suspend Patient</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-start">Raj Shinde</td>
|
||||
<td>rajshinde9@gmail.com</td>
|
||||
<td>+5624878954</td>
|
||||
<td>Kartikey Gautam</td>
|
||||
<td>Active</td>
|
||||
<td>
|
||||
<div class="dropout">
|
||||
<button class="more">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</button>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="view-customer.php">
|
||||
<img src="../src/assets/img/view.svg" />
|
||||
<span>View Details</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" data-toggle="modal" data-target="#archive-modal">
|
||||
<img src="../src/assets/img/archive.svg" />
|
||||
<span>Archive Patient</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<img src="../src/assets/img/download.svg" />
|
||||
<span>Download Data</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" data-toggle="modal" data-target="#suspend-modal">
|
||||
<img src="../src/assets/img/stop.svg" />
|
||||
<span>Suspend Patient</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@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>'
|
||||
@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_",
|
||||
},
|
||||
"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_",
|
||||
},
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [7, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
});
|
||||
|
||||
$(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() {
|
||||
// $('.sub_admin_permission').on('click', function() {
|
||||
var passportName = $(this).data('passport-name');
|
||||
var passportPrice = $(this).data('price');
|
||||
var passportId = $(this).data('passport-id');
|
||||
var quantity = $(this).data('quantity');
|
||||
var orderDate = $(this).data('orderdate');
|
||||
var tansId = $(this).data('payment_id');
|
||||
var paymentmode = $(this).data('paymentmode');
|
||||
var formattedPrice = '$' + passportPrice;
|
||||
|
||||
|
||||
$('.subadmin-option span').eq(0).text(passportName);
|
||||
$('.subadmin-option span').eq(1).text(formattedPrice);
|
||||
$('.subadmin-option span').eq(2).text(passportId);
|
||||
$('.subadmin-option span').eq(3).text(quantity);
|
||||
$('.subadmin-option span').eq(4).text(orderDate);
|
||||
$('.subadmin-option span').eq(5).text(tansId);
|
||||
$('.subadmin-option span').eq(6).text(paymentmode);
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [7, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(function(e) {
|
||||
$("#select-all-ids").click(function() {
|
||||
$(".form-check-input").prop('checked', $(this).prop('checked'));
|
||||
$('#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_",
|
||||
},
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [7, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
});
|
||||
|
||||
$(".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);
|
||||
|
||||
$(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(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", "#download-selected", function(e) {
|
||||
$(document).on("click", ".more", function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
});
|
||||
</script>
|
||||
|
||||
var allIds = [];
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// Initial data and categories
|
||||
var userChartData = getUserChartData('monthly');
|
||||
var userCategories = getUserChartCategories('monthly');
|
||||
|
||||
// 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());
|
||||
// Chart options
|
||||
var userOptions = {
|
||||
chart: {
|
||||
type: 'line',
|
||||
zoom: {
|
||||
enabled: false
|
||||
},
|
||||
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
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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.");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
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 [];
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
$(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.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 }
|
||||
},
|
||||
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 }
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function getUserChartData(filter) {
|
||||
switch (filter) {
|
||||
case 'monthly':
|
||||
return [
|
||||
{ name: 'Customer', data: <?php echo json_encode(array_values($dataMonthlyWithType3)); ?> },
|
||||
{ name: 'Restaurant', data: <?php echo json_encode(array_values($dataMonthlyWithType4)); ?> }
|
||||
];
|
||||
case 'quarterly':
|
||||
return [
|
||||
{ name: 'Customer', data: <?php echo json_encode(array_values($dataQuarterlyWithType3)); ?> },
|
||||
{ name: 'Restaurant', data: <?php echo json_encode(array_values($dataQuarterlyWithType4)); ?> }
|
||||
];
|
||||
case 'yearly':
|
||||
return [
|
||||
{ name: 'Customer', data: <?php echo json_encode(array_values($dataYearlyWithType3)); ?> },
|
||||
{ name: 'Restaurant', 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 [];
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
@@ -3,11 +3,32 @@
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
|
||||
{{-- <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.0.1/css/toastr.css" rel="stylesheet" />
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script> --}}
|
||||
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"
|
||||
integrity="sha512-VEd+nq25CkR676O+pLBnDW09R7VQX9Mdiij052gVCp5yVH3jGtH70Ho/UUv4mJDsEdTvqRCFZg0NKGiojGnUCw=="
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.css"
|
||||
integrity="sha512-3pIirOrwegjM6erE5gPSwkUzO+3cTjpnV9lexlNZqvupR64iZBnOOTiiLPb9M36zpMScbmUNIcHUqKD47M719g=="
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css"
|
||||
integrity="sha512-vKMx8UnXk60zUwyUnUPM3HbQo8QfmNx7+ltw8Pm5zLusl1XIfwcxo8DbWCqMGKaWeNxWA8yrx5v3SaVpMvR3CA=="
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.css"
|
||||
integrity="sha512-3pIirOrwegjM6erE5gPSwkUzO+3cTjpnV9lexlNZqvupR64iZBnOOTiiLPb9M36zpMScbmUNIcHUqKD47M719g=="
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
|
||||
<link rel="stylesheet" href="{{ asset('resources/views/Admin/pages/subscriptions/subscription-style.css') }}" />
|
||||
|
||||
|
||||
<title>List Of Products</title>
|
||||
</head>
|
||||
|
||||
@@ -62,15 +83,26 @@
|
||||
</div>
|
||||
</div>
|
||||
<hr class="my-5" style="border-top: 2px dashed; color: #042857;">
|
||||
<div class="input-group mb-5 d-flex align-items-center justify-content-between">
|
||||
<div class="input-group d-flex align-items-center justify-content-between">
|
||||
<div class="in-group">
|
||||
<label class="comm-head" for="">Enter coupon code</label>
|
||||
<label class="comm-head" for="">Enter Referral code</label>
|
||||
</div>
|
||||
<div class="apply-btn">
|
||||
<button class="apply" type="button">Apply</button>
|
||||
|
||||
|
||||
<button class="apply" type="button" onclick="applyReferralCode()">Apply</button>
|
||||
</div>
|
||||
<input type="text" class="form-control coupon-input mt-3" placeholder="Enter coupon code">
|
||||
<input type="text" class="form-control coupon-input mt-3" name ="referral_code"
|
||||
id="referral_code" placeholder="Enter Referral code" maxlength="10">
|
||||
|
||||
<input type="hidden" class="form-control coupon-input mt-3" name ="iam_principal_xid"
|
||||
id="iam_principal_xid" value="{{ $userData->id }}">
|
||||
|
||||
|
||||
</div>
|
||||
<div id="result-message" class="mt-3"></div>
|
||||
<div id="loader" style="display: none;">Loading...</div>
|
||||
|
||||
<hr>
|
||||
{{-- <div class="main-text">
|
||||
<div>
|
||||
@@ -87,6 +119,7 @@
|
||||
@csrf
|
||||
<input type="hidden" name="user_id" value="{{ $userData->id }}" />
|
||||
<input type="hidden" name="subscription_product_xid" value="{{ $productList->id }}" />
|
||||
<input type="hidden" name="referral_user_id" id="referral_user_id" />
|
||||
<div class="main-text">
|
||||
<div>
|
||||
<p class="comm-head">Total Payment</p>
|
||||
@@ -96,10 +129,11 @@
|
||||
<p class="price">${{ $productList->product_value }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit"class="subscribe-button w-75">SUBSCRIBE NOW</button>
|
||||
<button type="submit" class="subscribe-button w-75">SUBSCRIBE NOW</button>
|
||||
</form>
|
||||
{{-- <button class="subscribe-button w-75" type="button" data-bs-toggle="modal" data-bs-target="#exampleModal">SUBSCRIBE NOW</button> --}}
|
||||
<p class="grey-para text-center mt-3">You will be charged ${{ $productList->product_value }} every month
|
||||
<p class="grey-para text-center mt-3">You will be charged ${{ $productList->product_value }} every
|
||||
month
|
||||
after your free trial period ends.
|
||||
</p>
|
||||
<p class="grey-para text-center mt-2">Subscription will be renewed monthly until cancelled.</p>
|
||||
@@ -175,9 +209,15 @@
|
||||
|
||||
<!-- Modal end -->
|
||||
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous">
|
||||
</script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.0.1/js/toastr.js"></script>
|
||||
|
||||
|
||||
<script type="module">
|
||||
import {
|
||||
@@ -199,7 +239,106 @@
|
||||
}, 3000);
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
url_path = "{{ url('/') }}";
|
||||
</script>
|
||||
<script>
|
||||
function applyReferralCode() {
|
||||
var referralCode = document.getElementById('referral_code').value;
|
||||
var currentUserId = document.getElementById('iam_principal_xid').value;
|
||||
|
||||
var loader = document.getElementById('loader');
|
||||
var resultMessage = document.getElementById('result-message');
|
||||
var referralUserIdToStore = document.getElementById('referral_user_id');
|
||||
|
||||
// Show the loader
|
||||
loader.style.display = 'block';
|
||||
resultMessage.innerHTML = '';
|
||||
let base_url = url_path;
|
||||
console.log();
|
||||
if (referralCode == null || referralCode == '') {
|
||||
|
||||
toastr.error('Kindly Enter Referral Code');
|
||||
setTimeout(function() {
|
||||
|
||||
}, 100000)
|
||||
|
||||
|
||||
// alert('kindly apply referral code');
|
||||
loader.style.display = 'none';
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: base_url + '/apply-referral-code',
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}' // Include CSRF token
|
||||
},
|
||||
data: JSON.stringify({
|
||||
referral_code: referralCode,
|
||||
current_iam_principal_xid: currentUserId
|
||||
}),
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(result) {
|
||||
if (result.success) {
|
||||
resultMessage.innerHTML =
|
||||
'<span class="text-success">Successfully applied Referral code!</span>';
|
||||
|
||||
console.log("success", result);
|
||||
referralUserIdToStore.value = result.referralUserId;
|
||||
|
||||
loader.style.display = 'none';
|
||||
} else {
|
||||
resultMessage.innerHTML = '<span class="text-danger">Invalid referral code.</span>';
|
||||
loader.style.display = 'none';
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
toastr.error('Something went Wrong');
|
||||
setTimeout(function() {
|
||||
loader.style.display = 'none';
|
||||
}, 4000)
|
||||
// alert('something went wrong');
|
||||
|
||||
// toastr.error('Something went wrong');
|
||||
// $('#update_location').attr('disabled', false);
|
||||
// $('#update_location').text('Save');
|
||||
}
|
||||
});
|
||||
|
||||
// AJAX request
|
||||
// fetch('/apply-referral-code', {
|
||||
// method: 'POST',
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/json',
|
||||
// 'X-CSRF-TOKEN': '{{ csrf_token() }}' // Include CSRF token
|
||||
// },
|
||||
// body: JSON.stringify({
|
||||
// referral_code: referralCode
|
||||
// })
|
||||
// })
|
||||
// .then(response => response.json())
|
||||
// .then(data => {
|
||||
// // Hide the loader
|
||||
// loader.style.display = 'none';
|
||||
|
||||
// // Show the result message
|
||||
// if (data.success) {
|
||||
// resultMessage.innerHTML =
|
||||
// '<span class="text-success">Successfully applied referral code!</span>';
|
||||
// } else {
|
||||
// resultMessage.innerHTML = '<span class="text-danger">Invalid referral code.</span>';
|
||||
// }
|
||||
// })
|
||||
// .catch(error => {
|
||||
// loader.style.display = 'none';
|
||||
// resultMessage.innerHTML = '<span class="text-danger">An error occurred. Please try again.</span>';
|
||||
// });
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
@@ -2,47 +2,82 @@
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="{{ asset('resources/views/Admin/pages/subscriptions/subscription-style.css') }}" />
|
||||
|
||||
<title>My Subscription</title>
|
||||
<title>My Subscription</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<section class="new-subs-main">
|
||||
<div class="container">
|
||||
<h3 class="comm-head mt-3 d-flex gap-2" style="font-size: 20px;">
|
||||
<a href="subscription.html">
|
||||
{{-- <img src="images/arrow-left.png" alt=""> --}}
|
||||
</a>
|
||||
My Active Plan
|
||||
</h3>
|
||||
<div class="main-inn">
|
||||
<div class="inn-group my-4">
|
||||
<label class="comm-head" for="">Plan Name</label>
|
||||
<input type="text" class="form-control other-input mt-3" placeholder="Monthly Plan">
|
||||
</div>
|
||||
<div class="inn-group my-4">
|
||||
<label class="comm-head" for="">Subscription Charge</label>
|
||||
<input type="text" class="form-control other-input mt-3" value="{{$isSubscribedUser->amount}}">
|
||||
</div>
|
||||
<div class="inn-group my-4">
|
||||
<label class="comm-head" for="">Renewal date</label>
|
||||
<input type="text" class="form-control other-input mt-3" value="{{
|
||||
|
||||
\Carbon\Carbon::parse($isSubscribedUser->next_payment_date)->format('j M, Y') }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="my-5">
|
||||
<a href="" class="anch" type="button" data-bs-toggle="modal" data-bs-target="#exampleModal">Cancel
|
||||
Subscription</a>
|
||||
</div>
|
||||
</section>
|
||||
<section class="new-subs-main">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@if (session('success'))
|
||||
<div class="alert alert-success" id="alert-success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- <section class="mt-3 mb-5">
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
@if (session('error'))
|
||||
<div class="alert alert-danger" id="alert-danger">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<h3 class="comm-head mt-3 d-flex gap-2" style="font-size: 20px;">
|
||||
<a href="subscription.html">
|
||||
{{-- <img src="images/arrow-left.png" alt=""> --}}
|
||||
</a>
|
||||
My Active Plan
|
||||
</h3>
|
||||
<div class="main-inn">
|
||||
<div class="inn-group my-4">
|
||||
<label class="comm-head" for="">Plan Name</label>
|
||||
<input type="text" class="form-control other-input mt-3" readonly placeholder="Monthly Plan">
|
||||
</div>
|
||||
<div class="inn-group my-4">
|
||||
<label class="comm-head" for="">Subscription Charge</label>
|
||||
<input type="text" class="form-control other-input mt-3" readonly
|
||||
value="{{ $isSubscribedUser->amount }}">
|
||||
</div>
|
||||
<div class="inn-group my-4">
|
||||
<label class="comm-head" for="">Renewal date</label>
|
||||
<input type="text" class="form-control other-input mt-3" readonly
|
||||
value="{{ \Carbon\Carbon::parse($isSubscribedUser->next_payment_date)->format('j M, Y') }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="my-3">
|
||||
<hr>
|
||||
|
||||
@if ($isSubscribedUser->is_cancelled_subscription == 0)
|
||||
<a href="" class="subscribe-button mt-0" type="button" data-bs-toggle="modal"
|
||||
data-bs-target="#exampleModal">Cancel
|
||||
Subscription</a>
|
||||
|
||||
@else
|
||||
<div class="inn-group my-4">
|
||||
<label class="comm-head" for="">You cancelled your subscription on :-</label>
|
||||
|
||||
<h6 style="font-weight: bold;"> {{ \Carbon\Carbon::parse($isSubscribedUser->cancelled_at)->format('j M, Y') }}</h6>
|
||||
</div>
|
||||
<div class="inn-group my-4">
|
||||
<label class="comm-head" for="">Your current Plan will expire on :-</label>
|
||||
<h6 style="font-weight: bold;"> {{ \Carbon\Carbon::parse($isSubscribedUser->next_payment_date)->format('j M, Y') }}</h6>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- <section class="mt-3 mb-5">
|
||||
<div class="container">
|
||||
<h3 class=" head my-4">Subscription FAQs</h3>
|
||||
<div data-ui-tablist class="ui-accordion ui-accordion--outlined" data-ui-transition="collapse-fade">
|
||||
@@ -79,11 +114,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</section> -->
|
||||
{{-- <section class="mt-3 mb-5">
|
||||
{{-- <section class="mt-3 mb-5">
|
||||
<div class="container">
|
||||
<h3 class="head my-4">Subscription FAQs</h3>
|
||||
<div data-ui-tablist class="ui-accordion ui-accordion--outlined" data-ui-transition="collapse-fade">
|
||||
@foreach($faqs as $faq)
|
||||
@foreach ($faqs as $faq)
|
||||
<div class="ui-accordion-item">
|
||||
<button data-ui-tablist-tab class="ui-accordion-header">{{ $faq->question }}</button>
|
||||
<div data-ui-tablist-tabpanel {{ $loop->first ? '' : 'hidden' }}>
|
||||
@@ -97,72 +132,106 @@
|
||||
</div>
|
||||
</section> --}}
|
||||
|
||||
<!-- Modal start -->
|
||||
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="exampleModalLabel"></h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
|
||||
<img src="{{ asset('resources/views/Admin/pages/subscriptions/images/x.svg') }}" alt="">
|
||||
<!-- Modal start -->
|
||||
<form is="cancelSubscriptionForm" action="{{ route('cancel-subscription') }}" method="POST">
|
||||
@csrf
|
||||
<input type ="hidden" name="iam_principal_xid" value="{{ $isSubscribedUser->iam_principal_xid }}" />
|
||||
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="exampleModalLabel"></h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
|
||||
<img src="{{ asset('resources/views/Admin/pages/subscriptions/images/x.svg') }}"
|
||||
alt="">
|
||||
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="text-center para">If you cancel now, you can still access your subscription until {{\Carbon\Carbon::now()->format('M d ,Y')}} After this date, you will no longer be able to redeem cocktails.
|
||||
</p>
|
||||
<p class="text-center mt-3 para">Are you sure you want to cancel?
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-center gap-3 my-4">
|
||||
<button type="button" class="no-btn" data-bs-dismiss="modal">No</button>
|
||||
<button type="button" class="yes-btn" data-bs-toggle="modal" data-bs-target="#tar-mod">Yes</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="text-center para">If you cancel now, you can still access your subscription until
|
||||
{{ \Carbon\Carbon::now()->format('M d ,Y') }} After this date, you will no longer be able
|
||||
to redeem cocktails.
|
||||
</p>
|
||||
<p class="text-center mt-3 para">Are you sure you want to cancel?
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-center gap-3 my-4">
|
||||
<button type="button" class="no-btn" data-bs-dismiss="modal">No</button>
|
||||
<button type="submit" class="yes-btn" data-bs-toggle="modal" data-bs-target="#tar-mod"
|
||||
id="confirmCancellation">Yes</button>
|
||||
|
||||
<!-- Modal end -->
|
||||
|
||||
<!-- Modal start target -->
|
||||
<div class="modal fade bottom-mod" id="tar-mod" tabindex="-1" aria-labelledby="tar-modLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-bottom">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="tar-modLabel"></h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
|
||||
<img src="{{ asset('resources/views/Admin/pages/subscriptions/images/x.svg') }}" alt="">
|
||||
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body mb-4">
|
||||
<div class="mod-img d-flex align-items-center justify-content-center mb-3">
|
||||
{{-- <img src="images/dull.png" alt=""> --}}
|
||||
<img src="{{ asset('resources/views/Admin/pages/subscriptions/images/dull.png') }}" alt="">
|
||||
|
||||
</div>
|
||||
<p class="para-mid text-center">Your subscription has been cancelled successfully!</p>
|
||||
</div>
|
||||
<!-- <div class="modal-footer">
|
||||
</form>
|
||||
<!-- Modal end -->
|
||||
|
||||
<!-- Modal start target -->
|
||||
<div class="modal fade bottom-mod" id="tar-mod" tabindex="-1" aria-labelledby="tar-modLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-bottom">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="tar-modLabel"></h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
|
||||
<img src="{{ asset('resources/views/Admin/pages/subscriptions/images/x.svg') }}"
|
||||
alt="">
|
||||
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body mb-4">
|
||||
<div class="mod-img d-flex align-items-center justify-content-center mb-3">
|
||||
{{-- <img src="images/dull.png" alt=""> --}}
|
||||
<img src="{{ asset('resources/views/Admin/pages/subscriptions/images/dull.png') }}"
|
||||
alt="">
|
||||
|
||||
</div>
|
||||
<p class="para-mid text-center">Your subscription has been cancelled successfully!</p>
|
||||
</div>
|
||||
<!-- <div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal end -->
|
||||
<!-- Modal end -->
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
||||
crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous">
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
import { Tablist } from "https://cdn.jsdelivr.net/npm/jolty@0.6.2/dist/jolty.esm.min.js";
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
Tablist.initAll();
|
||||
});
|
||||
</script>
|
||||
<script type="module">
|
||||
import {
|
||||
Tablist
|
||||
} from "https://cdn.jsdelivr.net/npm/jolty@0.6.2/dist/jolty.esm.min.js";
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
Tablist.initAll();
|
||||
});
|
||||
|
||||
// $(document).ready(function () {
|
||||
// // Handle the confirmation modal
|
||||
// $('#confirmCancellation').click(function () {
|
||||
// $('#cancelSubscriptionForm').submit();
|
||||
// });
|
||||
// });
|
||||
</script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Hide the alert after 3 seconds (3000 milliseconds)
|
||||
setTimeout(function() {
|
||||
$('#alert-success').fadeOut('slow');
|
||||
}, 3000);
|
||||
setTimeout(function() {
|
||||
$('#alert-danger').fadeOut('slow');
|
||||
}, 3000);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
@@ -236,6 +236,11 @@ Route::group(['middleware' => ['customer.jwt.verify']], function () {
|
||||
// });
|
||||
Route::post('subscribe-to-plan', [SubscriptionController::class, 'subscriptionToPlan'])->name('subscribe-to-plan');
|
||||
Route::get('thank-you', [SubscriptionController::class, 'thankyou'])->name('thankyou');
|
||||
Route::post('cancel-subscription',[SubscriptionController::class,'cancelSubscription'])->name('cancel-subscription');
|
||||
Route::post('apply-referral-code', [SubscriptionController::class, 'applyReferralCode'])->name('apply-referral-code');
|
||||
|
||||
|
||||
|
||||
// Route::post('subscribe-to-product', [SubscriptionController::class, 'subscribeToProduct'])->name('subscribe-to-product');
|
||||
// Route::post('cancel-subscription', [SubscriptionController::class, 'cancelSubscription'])->name('cancel-subscription');
|
||||
// Route::get('cancel-thank-you', [SubscriptionController::class, 'cancelThankYou'])->name('cancel-thank-you');
|
||||
|
||||
Reference in New Issue
Block a user