@@ -27,14 +27,13 @@ class SubscriptionController extends Controller
|
||||
public function mySubscription(Request $request)
|
||||
{
|
||||
try {
|
||||
// dd($request->header('access-token'));
|
||||
$token = readHeaderToken();
|
||||
// dd("acc",$token);
|
||||
|
||||
// $token = true;
|
||||
|
||||
// dd($token, Session::get('vendorToken'));
|
||||
if ($token) {
|
||||
// $user_id = 13;
|
||||
// $user_id = 54;
|
||||
$user_id = $token['sub'];
|
||||
|
||||
$dateTime = now();
|
||||
@@ -412,7 +411,7 @@ class SubscriptionController extends Controller
|
||||
$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]);
|
||||
return response()->json(['success' => true, 'message' => 'Successfully applied referral code!', 'referralUserId' => $code->id]);
|
||||
} else {
|
||||
return response()->json(['success' => false, 'message' => 'Invalid referral code.']);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class ReferralCodeController extends Controller
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage(), ['exception' => $e]);
|
||||
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
|
||||
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,10 +167,10 @@
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="timeHours" class="label">Time in hours between redeeming two
|
||||
cocktails</label>
|
||||
drinks</label>
|
||||
<input type="number" class="form-control" id="timeHours" name="timeHours"
|
||||
required>
|
||||
<label for="timeQuantity" class="label">Maximum number of cocktails</label>
|
||||
<label for="timeQuantity" class="label">Maximum number of drinks</label>
|
||||
<div class="input-group">
|
||||
<select class="form-control" id="timeInterval" name="timeInterval"
|
||||
required>
|
||||
|
||||
@@ -127,14 +127,14 @@
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="timeHours" class="label">Time in hours between redeeming two
|
||||
cocktails</label>
|
||||
drinks</label>
|
||||
<input type="number" class="form-control" id="timeHours" name="timeHours"
|
||||
value="{{ $timeHours }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="timeQuantity" class="label">Maximum number of cocktails</label>
|
||||
<label for="timeQuantity" class="label">Maximum number of drinks</label>
|
||||
<div class="input-group">
|
||||
<select class="form-control" id="timeInterval" name="timeInterval"
|
||||
required>
|
||||
@@ -385,7 +385,7 @@
|
||||
number: "Longitude must be a number without spaces",
|
||||
},
|
||||
timeHours: {
|
||||
required: "Please enter the time in hours between redeeming two cocktails",
|
||||
required: "Please enter the time in hours between redeeming two drinks",
|
||||
number: "Time must be a number",
|
||||
min: "Time must be greater than 0"
|
||||
},
|
||||
@@ -395,9 +395,9 @@
|
||||
min: "Time quantity must be greater than 0"
|
||||
},
|
||||
maxCocktails: {
|
||||
required: "Please enter the maximum number of cocktails",
|
||||
number: "Maximum number of cocktails must be a number",
|
||||
min: "Maximum number of cocktails must be greater than 0"
|
||||
required: "Please enter the maximum number of drinks",
|
||||
number: "Maximum number of drinks must be a number",
|
||||
min: "Maximum number of drinks must be greater than 0"
|
||||
},
|
||||
bio: {
|
||||
required: "Enter Bio",
|
||||
|
||||
@@ -129,10 +129,10 @@
|
||||
<label for="location_name">Name</label>
|
||||
<input id="location_name" name="location_name" class="form-control" type="text">
|
||||
|
||||
<label for="timeHours" class="label">Time in hours between redeeming two cocktails</label>
|
||||
<label for="timeHours" class="label">Time in hours between redeeming two drinks</label>
|
||||
<input type="number" class="form-control" id="timeHours" name="timeHours" required>
|
||||
|
||||
<label for="timeQuantity" class="label">Maximum number of cocktails</label>
|
||||
<label for="timeQuantity" class="label">Maximum number of drinks</label>
|
||||
<div class="input-group">
|
||||
<select class="form-control" id="timeInterval" name="timeInterval" required>
|
||||
{{-- <option value="day">Day</option>
|
||||
@@ -177,11 +177,11 @@
|
||||
<input type="text" class="form-control" id="location-name" name="location_name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="time-hours">Time in hours between redeeming two cocktails</label>
|
||||
<label for="time-hours">Time in hours between redeeming two drinks</label>
|
||||
<input type="number" class="form-control" id="time-hours" name="time_hours">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="time-interval">Maximum number of cocktails</label>
|
||||
<label for="time-interval">Maximum number of drinks</label>
|
||||
<select class="form-control" id="time-interval" name="time_interval">
|
||||
{{-- <option value="day">Day</option>
|
||||
<option value="week">Week</option> --}}
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<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>
|
||||
<p class="para-mid text-center">Your subscription has been cancelled successfully.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -100,12 +100,9 @@
|
||||
<img src="{{ asset('resources/views/Admin/pages/subscriptions/images/cheers-logo.png') }}"
|
||||
alt="">
|
||||
</div>
|
||||
<p class="text-center mt-3 para-mid">Subscribe to Cheers to the Season app to gain access to free cocktails*
|
||||
at
|
||||
local
|
||||
restaurants.
|
||||
<p class="text-center mt-3 para-mid">Subscribe to Cheers to the Season to gain access to free drinks with your meal purchase at local restaurants.
|
||||
</p>
|
||||
<p class="text-center mt-3 grey-para">*Free cocktail stipulations vary by state in accordance with local
|
||||
<p class="text-center mt-3 grey-para">*Free drink stipulations vary by state in accordance with local
|
||||
liquor
|
||||
laws.</p>
|
||||
<div class="subscription-card">
|
||||
@@ -122,15 +119,15 @@
|
||||
<hr class="my-5" style="border-top: 2px dashed; color: #042857;">
|
||||
<div class="input-group d-flex align-items-center justify-content-between">
|
||||
<div class="in-group">
|
||||
<label class="comm-head" for="">Enter Referral code</label>
|
||||
<label class="comm-head" for="">Enter Referral Code</label>
|
||||
</div>
|
||||
<div class="apply-btn">
|
||||
|
||||
|
||||
<button class="apply" type="button" onclick="applyReferralCode()">Apply</button>
|
||||
</div>
|
||||
<input type="text" class="form-control coupon-input mt-3" style="text-transform: uppercase;"
|
||||
name ="referral_code" id="referral_code" placeholder="Enter Referral code" maxlength="10">
|
||||
<input type="text" class="form-control coupon-input mt-3"
|
||||
name ="referral_code" id="referral_code" placeholder="Enter Referral Code" oninput="this.value = this.value.toUpperCase()" maxlength="10">
|
||||
|
||||
<input type="hidden" class="form-control coupon-input mt-3" name ="iam_principal_xid"
|
||||
id="iam_principal_xid" value="{{ $userData->id }}">
|
||||
@@ -170,11 +167,14 @@
|
||||
<div id="loadingMessage" style="display: none;">Please wait...</div>
|
||||
</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
|
||||
after your free trial period ends.
|
||||
<p class="grey-para text-center mt-3" id="isCodeNotApplied" style="display: block;">
|
||||
|
||||
You will be charged ${{ $productList->product_value }} every month. Subscription will be renewed until cancelled.
|
||||
</p>
|
||||
<p class="grey-para text-center mt-2">Subscription will be renewed monthly until cancelled.</p>
|
||||
{{-- <p class="grey-para text-center mt-2">Subscription will be renewed monthly until cancelled.</p> --}}
|
||||
<p class="grey-para text-center mt-3" id="isCodeApplied" style="display: none;">
|
||||
Your coupon code has been entered successfully.<br /> You will be charged ${{ $productList->product_value }} after your free trial period. Subscription will be renewed until cancelled.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -290,7 +290,7 @@
|
||||
loader.style.display = 'block';
|
||||
resultMessage.innerHTML = '';
|
||||
let base_url = url_path;
|
||||
console.log();
|
||||
|
||||
if (referralCode == null || referralCode == '') {
|
||||
|
||||
toastr.error('Kindly Enter Referral Code');
|
||||
@@ -318,6 +318,9 @@
|
||||
contentType: false,
|
||||
success: function(result) {
|
||||
if (result.success) {
|
||||
document.getElementById('isCodeNotApplied').style.display = 'none';
|
||||
document.getElementById('isCodeApplied').style.display = 'block';
|
||||
|
||||
resultMessage.innerHTML =
|
||||
'<span class="text-success">Successfully applied Referral code!</span>';
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
@endif
|
||||
|
||||
<div class="inn-group my-4">
|
||||
<label class="comm-head" for="">Renewal date</label>
|
||||
<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('M j, Y') }}">
|
||||
</div>
|
||||
@@ -101,16 +101,18 @@
|
||||
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>
|
||||
<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>
|
||||
{{ \Carbon\Carbon::parse($isSubscribedUser->cancelled_at)->format('M d, Y') }}.</h6>
|
||||
</div>
|
||||
<div class="inn-group my-4">
|
||||
<label class="comm-head" for="">Your current Plan will expire on :-</label>
|
||||
<label class="comm-head" for="">You still have access to free drinks until:</label>
|
||||
<h6 style="font-weight: bold;">
|
||||
{{ \Carbon\Carbon::parse($isSubscribedUser->next_payment_date)->format('j M, Y') }}</h6>
|
||||
{{ \Carbon\Carbon::parse($isSubscribedUser->next_payment_date)->format('M d, Y') }}.</h6>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@@ -134,9 +136,9 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="text-center para">If you cancel now, you can still access your subscription until
|
||||
{{ \Carbon\Carbon::parse($isSubscribedUser->next_payment_date)->format('M d ,Y') }} After
|
||||
{{ \Carbon\Carbon::parse($isSubscribedUser->next_payment_date)->format('M d, Y') }} After
|
||||
this date, you will no longer be able
|
||||
to redeem cocktails.
|
||||
to redeem a drink.
|
||||
</p>
|
||||
<p class="text-center mt-3 para">Are you sure you want to cancel?
|
||||
</p>
|
||||
|
||||
@@ -54,7 +54,9 @@ hr {
|
||||
.main-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
/* justify-content: space-around; */
|
||||
justify-content: space-between; /*updated by hritik on 1 august*/
|
||||
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user