my-subscriptions.php
38.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
<?php
/**
* My Subscriptions section on the My Account page
*
* @author Prospress
* @category WooCommerce Subscriptions/Templates
* @version 2.0.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
include_once 'subcriptioninfo.php';
global $woocommerce;
$user_id = get_current_user_id();
?>
<div class="woocommerce_account_subscriptions col-lg-6 col-md-6 col-sm-6 col-xs-12">
<div class="bgef innerbox">
<h2 class="roboto_condensedbold font26"><?php esc_html_e('Your membership plan', 'woocommerce-subscriptions'); ?></h2>
<?php
$subscription_result = FGC_ActiveCampaign::get_info_of_active_or_onhold_subscription($user_id);
if ($subscription_result['has_subscription']) {
if ($subscription_result['status'] == 'active') {
$status_check = 'wc-active';
} else {
$status_check = 'wc-on-hold';
}
foreach ($subscriptions as $key => $value) {
if ($value->post->post_status == $status_check) {
$subscription = $value;
$active_subscription_id = $key;
break;
}
}
?>
<script>
jQuery(document).ready(function ($) {
$('input[name="active_subscription_id"]').val(<?php echo $active_subscription_id; ?>);
});
</script>
<?php
$totalInfo = productAndTotalSubcription($subscription);
?>
<table class="shop_table my_account_subscriptions my_account_orders">
<colgroup>
<col width="47%">
<col width="53%">
</colgroup>
<tbody>
<tr class="subscription-next-bill-date">
<th><?php esc_html_e('Next bill date', 'woocommerce-subscriptions') ?></th>
<td class="subscription-next-payment order-date">
<?php
$date = date_create($subscription->get_date('next_payment'));
echo date_format($date, "d F Y");
?>
<?php if (!$subscription->is_manual() && $subscription->has_status('active') && $subscription->get_time('next_payment') > 0) : ?>
<?php
// translators: placeholder is the display name of a payment gateway a subscription was paid by
$payment_method_to_display = sprintf(__('Via %s', 'woocommerce-subscriptions'), $subscription->get_payment_method_to_display());
$payment_method_to_display = apply_filters('woocommerce_my_subscriptions_payment_method', $payment_method_to_display, $subscription);
?>
<small><?php // echo esc_attr(str_replace('Via ', '', $payment_method_to_display)); ?></small>
<?php endif; ?>
</td>
</tr>
<tr class="subscription-quantily">
<th><?php esc_html_e('Quantity', 'woocommerce-subscriptions') ?></th>
<td class="subscription-status order-status" style="text-align:left; white-space:nowrap;">
<?php
$subscription_result = FGC_ActiveCampaign::get_info_of_active_or_onhold_subscription($user_id);
$_subscriptions = WC_Subscriptions_Manager::get_users_subscriptions($user_id);
foreach ($_subscriptions as $_subscription) {
if ($_subscription['status'] == 'active' || $_subscription['status'] == 'on-hold') {
$variation_id = $_subscription['variation_id'];
break;
}
}
?>
<div class="disktop">
<?php echo get_post_meta($variation_id, 'attribute_drinks')[0]; ?> drinks monthly
<br/>
<!--60 drinks / delivered monthly-->
</div>
<div class="mobile">
<?php echo get_post_meta($variation_id, 'attribute_drinks')[0]; ?> drinks monthly
<br/>
<!--60 drinks per monthly-->
</div>
</td>
</tr>
<tr class="subscription-amount">
<th><?php esc_html_e('Amount', 'woocommerce-subscriptions') ?></th>
<td class="subscription-next-payment order-date">
<?php echo $totalInfo['cart_subtotal']['value']; ?>
</td>
</tr>
<tr class="subscription-shipping">
<th><?php esc_html_e('Shipping', 'woocommerce-subscriptions') ?></th>
<td class="subscription-total order-total">
<?php
$shipping_label = get_post_meta($active_subscription_id, '_order_shipping_label', true);
$shipping_country = get_post_meta($active_subscription_id, '_shipping_country', true);
$order_shipping = get_post_meta($active_subscription_id, '_order_shipping', true);
if ($shipping_label) {
$_price_shipping = (float) get_post_meta($active_subscription_id, '_order_shipping')[0];
if ($_price_shipping > 0) {
?>
<span class="amount"><?php echo number_format($_price_shipping, 2, '.', ''); ?></span>
<small class="shipped_via"> <?php echo $woocommerce->countries->countries[$shipping_country]; ?> </small>
<?php
} else {
echo 'FREE';
}
} else {
echo 'FREE';
}
?>
<script>
// jQuery(document).ready(function ($) {
// if ($('.subscription-shipping .amount').text() === '$0.00') {
// $('.subscription-shipping .subscription-total ').html('FREE');
// }
// else {
// shipped_via = $('.shipped_via').html().split("-");
// last_number = shipped_via.length - 1;
// if (shipped_via.length > 1) {
// $('.shipped_via').html(shipped_via[last_number]);
// }
// }
// });
</script>
<?php // echo $totalInfo['shipping']['value']; ?>
</td>
</tr>
<tr class="subscription-total order-total text-uppercase">
<th>
<div class="desktop"> <?php esc_html_e('Total per month', 'woocommerce-subscriptions') ?> </div>
<div class="mobile"> Total <span>(per month)</span> </div>
</th>
<td class="subscription-actions order-actions"> <?php
// echo get_post_meta($subscription->id, '_order_total')[0];
echo wp_kses_post($subscription->get_formatted_order_total());
?> </td>
</tr>
<?php
$total_remaining = ClassProcessCronjob::getTotalRemainOfCustomer($user_id);
if ($total_remaining > 0) {
$payment_per_month = get_post_meta($subscription->id, '_order_total')[0];
if ($total_remaining >= $payment_per_month) {
// $credit_balance = (float) $payment_per_month;
$payment_next_month = (float) 0;
} else {
// $credit_balance = (float) $total_remaining;
$payment_next_month = (float) $payment_per_month - (float) $total_remaining;
}
?>
<tr class="credit-balance">
<th>Credit Balance:</th>
<td>$<?php echo number_format($total_remaining, 2, '.', ','); ?></td>
</tr>
<tr class="payment-next-month">
<th>Next Months Payment:</th>
<td>$<?php echo number_format($payment_next_month, 2, '.', ','); ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
} else {
?>
<p class="no_subscriptions">
<?php
// translators: placeholders are opening and closing link tags to take to the shop page
printf(esc_html__('You have no active subscriptions. Find the subscription that suits you %shere%s.', 'woocommerce-subscriptions'), '<a href="/get-started/">', '</a>');
?>
</p>
<?php
}
// $hasSubscription = false;
// foreach ($subscriptions as $key => $value) {
// if ($value->post->post_status == 'wc-active' || $value->post->post_status == 'wc-on-hold') {
// $subscription = $value;
// $hasSubscription = true;
// $active_subscription_id = $key;
// break;
// }
// }
?>
</div>
</div>
<?php
/*
* Added by: Tran Trong Thang(trangtrongthang1207@gmail.com)
* Added date: 15-Mar-2016
*/
?>
<div class=" form-group"></div>
<div class="profile-user col-lg-6 col-md-6 col-sm-6 col-xs-12 pull-right">
<div class="bg4d innerbox">
<h2 class="roboto_condensedbold font26 text-center"><?php esc_html_e('Earn Free Drinks And Make Deadpan Guy Smile') ?></h2>
<div class="innercontent">
<div class="friends">
<?php
$current_user = wp_get_current_user();
$current_email = isset($current_user->user_email) ? $current_user->user_email : '';
$current_pass = isset($current_user->user_pass) ? $current_user->user_pass : '';
?>
<?php
global $wpdb;
$friends = 0;
if ($user_id && affiliates_user_is_affiliate($user_id)) {
$affiliates_table = _affiliates_get_tablename('affiliates');
$affiliates_users_table = _affiliates_get_tablename('affiliates_users');
if ($affiliate_id = $wpdb->get_var($wpdb->prepare(
"SELECT $affiliates_users_table.affiliate_id FROM $affiliates_users_table LEFT JOIN $affiliates_table ON $affiliates_users_table.affiliate_id = $affiliates_table.affiliate_id WHERE $affiliates_users_table.user_id = %d AND $affiliates_table.status = 'active'", intval($user_id)
))) {
if ($totals = Affiliates_Shortcodes::get_total($affiliate_id, $from, $until, $status)) {
if (count($totals) > 0) {
$friends = $totals;
// var_dump($totals);
// $friends = count($totals);
}
}
$query_get_friends = "SELECT count(referral_id) as friends FROM wp_aff_referrals where affiliate_id = $affiliate_id and amount > 0";
$result_get_friends = $wpdb->get_results($query_get_friends);
if (count($result_get_friends) > 0) {
$friends = (int) $result_get_friends[0]->friends;
}
}
}
$img_name = 'deadpan';
if ($friends > 0) {
$img_name = 'little_smile';
if ($friends > 4) {
$img_name = 'cheeky_smile';
}
if ($friends > 9) {
$img_name = 'big_smile';
}
if ($friends > 19) {
$img_name = 'big_laugh';
}
}
?>
<div class="my_avatar col-lg-8 col-md-7 col-sm-7 col-xs-7">
<div>
<!--<img src="/wp-content/themes/reize/assets/images/General_9.png"/>-->
<img src="/wp-content/themes/reize/assets/images/<?php echo $img_name ?>.jpg"/>
</div>
</div>
<div class="my_friends">
<img src="/wp-content/themes/reize/assets/images/my_friends.png"/>
<input id="numberfriend" value="<?php echo $friends; ?>" type="hidden"/>
<img class="doticon" src="<?php echo get_site_url() . '/wp-content/themes/reize/assets/images/dot.png' ?>" data-toggle="tooltip" data-placement="left" title="<?php echo $friends; ?>"/>
<div class="hide">
<div class="colfriends"></div>
<div class="dotfriends friends100 text-uppercase">100 friends</div>
<div class="dotfriends friends50 text-uppercase">50 friends</div>
<div class="dotfriends friends10 text-uppercase">10 friends</div>
<div class="dotfriends friends5 text-uppercase">5 friends</div>
</div>
</div>
<div class="clearfix"></div>
<div class="form-group mobile"></div>
</div>
<div class="clearfix"></div>
<div class="informore text-center">
<h1 class="color_while your_bonus"><span>TOTAL BONUS EARNED: <?php
$total_amount = ClassProcessCronjob::getTotalAmountEarnOfCustomer($user_id);
if (!$total_amount) {
$total_amount = 0;
}
echo '$' . $total_amount;
?></span></h1>
<?php
$_affiliate_code = get_user_meta($user_id, '_affiliate_code', true);
$total_remaining = ClassProcessCronjob::getTotalRemainOfCustomer($user_id);
if ($total_remaining > 0) {
if ($subscription_result['has_subscription']) {
?> <div class = "contentline">Your bonus credit will be automatically applied against your next payment </div> <?php
// echo $_affiliate_code;
} else {
if ($_affiliate_code != '') {
?>
<div class="contentline">
Redeem credit with Gift Card <b><?php echo $_affiliate_code; ?></b>
</div>
<input class="_affiliate_code" name="_affiliate_code" value="<?php echo $_affiliate_code; ?>" type="hidden" />
<?php
}
}
}
?>
<div class="contentline">
Share the REIZE club with your friends & get a $15 credit every time a friend becomes a member. ($5 credit if they make a one-off purchase)
</div>
<div class="contentline marbotton">
Click below to share your unique referral link with your friends.
</div>
<div class="contentline">
<?php echo do_shortcode('[jpshare]'); ?>
</div>
<div class="referral_box">
<table>
<tr>
<td>Total Friends Referred: </td>
<td><?php echo $friends; ?></td>
</tr>
<tr>
<td>Total Credit Earned: </td>
<td><?php echo '$' . number_format($total_amount, 2, '.', ','); ?></td>
</tr>
<tr>
<td>Credit Paid Out So Far: </td>
<td><?php
$total_used = ClassProcessCronjob::getTotalUsedOfCustomer($user_id);
if (!$total_used) {
$total_used = 0;
} else {
if (count($total_used) == 0) {
$total_used = 0;
}
}
echo '$' . number_format($total_used, 2, '.', ',')
?></td>
</tr>
<tr>
<td>Credit Remaining: </td>
<td>$<?php echo number_format($total_remaining, 2, '.', ','); ?></td>
</tr>
</table>
<div class="arrow"></div>
</div>
</div>
<div class="contentline marbotton">
Or copy & paste this link wherever your friends will see it
</div>
<div class="contentline">
<input value="<?php echo do_shortcode('[affiliates_url]') ?>" id="link_affiliates"/>
<input value="<?php echo Affiliates_Shortcodes::affiliates_id('') ?>" id="id_affiliates" type="hidden"/>
</div>
<div id="email_sharing_content">
<div style="text-align: left" align="left">
<p style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: none !important; color: #94937F; font-family: Helvetica; font-size: 28px !important; line-height: 150% !important; text-align: left; margin: 10px 0; padding: 0" align="left">
<span style="color: #94937F">
<span style="font-size: 28px">
<span style="font-family: arial,helvetica neue,helvetica,sans-serif">
<strong>
CONGRATULATIONS!
</strong>
</span>
</span>
</span>
</p>
<p style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: none !important; color: #000; font-family: Helvetica; font-size: 12px !important; line-height: 150% !important; text-align: left; margin: 10px 0; padding: 0" align="left">
<span style="color: #000">
<span style="font-size: 16px">
<span style="font-family: arial,helvetica neue,helvetica,sans-serif">
<strong> Your friend has invited you to join the REIZE Club. </strong>
</span>
</span>
</span>
</p>
<p style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: none !important; color: #000; font-family: Helvetica; font-size: 12px !important; line-height: 150% !important; text-align: left; margin: 10px 0; padding: 0" align="left">
<button style="display: block; font-size: 16px; margin: 11px 0; background: #ffe833 none repeat scroll 0 0; border-radius: 5px; font-weight: 700; line-height: 25px; padding: 11px 0px;" >
<a href="<?php echo do_shortcode('[affiliates_url]'); ?>" style=" text-decoration: none; padding: 11px 24px; color: #000;">ACCEPT INVITATION</a>
</button>
</p>
<p style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: none !important; color: #000; font-family: Helvetica; font-size: 12px !important; line-height: 150% !important; text-align: left; margin: 10px 0; padding: 0" align="left">
<span style="color: #000">
<span style="font-size: 16px">
<span style="font-family: arial,helvetica neue,helvetica,sans-serif">
REIZE Energy Drink is new from Australia. The boost is AMAZING and you can mix it anyway you like. Best of all it's ridiculously cheap. Seriously, you will save bucketloads of cash!
</span>
</span>
</span>
</p>
<p style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: none !important; color: #202020; font-family: Helvetica; font-size: 16px !important; line-height: 150% !important; text-align: left; margin: 10px 0; padding: 0" align="left">
<span style="color: #000">
<span style="font-size: 16px">
<span style="font-family: arial,helvetica neue,helvetica,sans-serif">
<a href="<?php echo do_shortcode('[affiliates_url]'); ?>" style=" " target="_blank" rel="noreferrer">Join today using this link and get 25% off your first month. </a>
</span>
</span>
</span></p>
<p style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: none !important; color: #202020; font-family: Helvetica; font-size: 16px !important; line-height: 150% !important; text-align: left; margin: 10px 0; padding: 0" align="left">
<span style="color: #000">
<span style="font-size: 16px">
<span style="font-family: arial,helvetica neue,helvetica,sans-serif">
There's no hidden fees, no commitment, and no contracts. No kidding! And when you try the Club using the link in this email your friend gets $15. Yo `lil bewdy!
</span>
</span>
</span></p>
<p style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: none !important; color: #202020; font-family: Helvetica; font-size: 16px !important; line-height: 150% !important; text-align: left; margin: 10px 0; padding: 0" align="left">
<span style="color: #000">
<span style="font-size: 16px">
<span style="font-family: arial,helvetica neue,helvetica,sans-serif">
Welcome aboard,<br>
Marty & Steve
</span>
</span>
</span></p>
<p style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: none !important; color: #202020; font-family: Helvetica; font-size: 16px !important; line-height: 150% !important; text-align: center; margin: 10px 0; padding: 0" align="left">
<span style="color: #000">
<span style="font-size: 16px">
<span style="font-family: arial,helvetica neue,helvetica,sans-serif">
<strong> <a href="<?php echo do_shortcode('[affiliates_url]'); ?>" style="text-decoration: none" target="_blank" rel="noreferrer">TRY THE CLUB</a></strong>
</span>
</span>
</span></p>
</div>
</div>
</div>
</div>
</div>
<?php
/**
* Plan Options Box
*/
$link_upgrade = get_site_url() . '/get-started';
$can_upgrade = false;
$link_change_plan = '';
$can_change_plan = false;
$link_takemonth = '';
$can_take_month_off = false;
$class_disable = 'disable';
$take_month_off = $subscription_result['time_reactive'];
if ($subscription_result['has_subscription']) {
$link_upgrade = get_site_url() . '/upgrade';
$can_upgrade = true;
$link_change_plan = '/change-your-plan';
$can_change_plan = true;
if ($subscription_result['status'] == 'active') {
$link_takemonth = get_site_url() . '/take-month-off';
$can_take_month_off = true;
}
// if ($subscription_result['current_drink'] == 600) {
// $link_downgrade = get_site_url() . '/downgrade';
// $can_downgrade = true;
// }
}
?>
<div class="form-group"></div>
<div class="plan_options col-lg-6 col-md-6 col-sm-6 col-xs-12">
<div class="bgee innerbox">
<h2 class="roboto_condensedbold font26"><?php esc_html_e('Plan options', 'woocommerce-subscriptions'); ?></h2>
<table>
<colgroup>
<col width="50%">
<col width="50%">
</colgroup>
<tr class="not_enougt_reize">
<td>
<?php esc_html_e('Not enough REIZE?', 'woocommerce-subscriptions'); ?>
</td>
<td>
<a href="<?php echo $link_upgrade; ?>" class="button"><?php esc_html_e('Upgrade your plan', 'woocommerce-subscriptions'); ?></a>
</td>
</tr>
<tr class="too_much_reize">
<td>
<?php esc_html_e('Too much REIZE?', 'woocommerce-subscriptions') ?>
</td>
<td>
<a class="button <?php echo ($can_take_month_off) ? '' : $class_disable; ?>" href="<?php echo $link_takemonth ?>">
<?php esc_html_e('Take a month off', 'woocommerce-subscriptions') ?>
</a>
</td>
</tr>
<tr class="change_your_plan">
<td class="disktop">
</td>
<td>
<a href="<?php echo $link_change_plan ?>" class="button <?php echo ($can_change_plan) ? '' : $class_disable; ?>">
<?php esc_html_e('Change your plan', 'woocommerce-subscriptions') ?>
</a>
</td>
</tr>
<input type="hidden" name="take-month-off" value="<?php echo $take_month_off; ?>"/>
</table>
</div>
</div>
<div class=" form-group"></div>
<?php
$customer_id = get_user_meta($user_id, '_stripe_customer_id', true);
$stripe = new WC_Gateway_Stripe();
//$cards = $stripe->get_saved_cards($customer_id);
$cardInfo = $stripe->fgc_get_saved_cards($customer_id);
?>
<div class="account_information col-lg-6 col-md-6 col-sm-6 col-xs-12">
<div class="bgef innerbox">
<header class="title">
<h2 class="roboto_condensedbold font26"><?php esc_html_e('Account Information') ?></h2>
<a href="<?php echo wc_get_endpoint_url('edit-address', $name); ?>" id="add_card_number" class="edit robotoregular font16"><?php _e('Edit', 'woocommerce'); ?></a>
<div class="alert alert-success hide" id="account_info_alert"></div>
</header>
<div class="innercontent">
<table>
<colgroup>
<col width="47%">
<col width="53%">
</colgroup>
<tbody>
<tr>
<th><?php esc_html_e('Email', 'woocommerce-subscriptions') ?></th>
<td class="tv_email"><?php echo $current_email; ?></td>
</tr>
<tr>
<th><?php esc_html_e('Password', 'woocommerce-subscriptions') ?></th>
<td>........</td>
</tr>
<?php if (!empty($cardInfo)) { ?>
<tr>
<th><?php esc_html_e('Card Number', 'woocommerce-subscriptions') ?></th>
<td class="text-uppercase tv_cartinfo">****************<?php echo $cardInfo->last4; ?></td>
</tr>
<tr>
<th><?php esc_html_e('Expiration date', 'woocommerce-subscriptions') ?></th>
<td class="text-uppercase tv_cartinfo"><?php echo $cardInfo->exp_month . '/' . $cardInfo->exp_year; ?></td>
</tr>
<tr>
<th><?php esc_html_e('CCV', 'woocommerce-subscriptions') ?></th>
<td class="text-uppercase tv_cartinfo">.......</td>
</tr>
<?php } ?>
</tbody>
</table>
<div class="account_information_edit">
<form action="/?fgcSaveAddress&type=updateaccountinfo" class="form_account_information" method="post">
<p id="accout_emial_field" class="form-row form-row form-row-wide validate-required">
<input type="text" value="<?php echo $current_email; ?>" placeholder="Email" id="accout_emial" name="accout_emial" class="input-text ">
</p>
<p id="accout_password_field" class="form-row form-row form-row-wide validate-required">
<input type="password" value="<?php echo $current_pass ?>" id="accout_password" name="accout_password" class="input-text hidden" placeholder="">
<input type="password" value="" id="accout_password_old" name="accout_password_old" class="input-text " placeholder="Old Password">
</p>
<p id="accout_password_field_new" class="form-row form-row form-row-wide validate-required">
<input type="password" value="" id="accout_password_new" name="accout_password_new" class="input-text " placeholder="New Password">
</p>
<!-------------------BEGIN card form---------------------->
<?php if (!empty($cardInfo)) { ?>
<h2 class="roboto_condensedbold font26"><?php esc_html_e('Payment Detail') ?></h2>
<p class="form-row form-row-wide woocommerce-validated card_number">
<label for="stripe-card-number">Card Number <span class="required">*</span></label>
<input type="text" name="card_num" placeholder="****************<?php echo $cardInfo->last4; ?>" autocomplete="off" maxlength="20" class="input-text wc-credit-card-form-card-number" id="stripe-card-number" value="">
</p>
<div class="clearfix"></div>
<div class="despayment font14 robotoitalic">The digits on the front of the card</div>
<div class="select2-container month_select wc-credit-card-form-card-expiry select2-allowclear form-row-first" id="s2id_stripe-card-expiry-month">
<a tabindex="-1" class="select2-choice" href="javascript:void(0)">
<span class="select2-chosen" id="select2-chosen-5">3</span>
<abbr class="select2-search-choice-close"></abbr>
<span role="presentation" class="select2-arrow"><b role="presentation"></b></span>
</a>
<label class="select2-offscreen" for="s2id_autogen5"></label>
<input type="text" role="button" aria-haspopup="true" class="select2-focusser select2-offscreen" aria-labelledby="select2-chosen-5" id="s2id_autogen5">
<div id="select2-drop" class="select2-drop select2-display-none select2-drop-active">
<ul role="listbox" class="select2-results" id="select2-results-5">
</ul>
</div>
</div>
<div class="select2-container year_select wc-credit-card-form-card-expiry select2-allowclear form-row-last" id="s2id_stripe-card-expiry-year">
<a tabindex="-1" class="select2-choice" href="javascript:void(0)">
<span class="select2-chosen" id="select2-chosen-5">2017</span>
<abbr class="select2-search-choice-close"></abbr>
<span role="presentation" class="select2-arrow"><b role="presentation"></b></span>
</a>
<label class="select2-offscreen" for="s2id_autogen5"></label>
<input type="text" role="button" aria-haspopup="true" class="select2-focusser select2-offscreen" aria-labelledby="select2-chosen-5" id="s2id_autogen5">
<div id="select2-drop" class="select2-drop select2-display-none select2-drop-active">
<ul role="listbox" class="select2-results" id="select2-results-5">
</ul>
</div>
</div>
<select class="month_select wc-credit-card-form-card-expiry hidden" id="stripe-card-expiry-month" name="exp_month" data-placeholder="" tabindex="-1" title="">
<option></option>
<?php
for ($i = 1; $i <= 12; $i++) {
?>
<option <?php if ($cardInfo->exp_month == $i) echo 'selected'; ?> value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php } ?>
</select>
<select class="year_select wc-credit-card-form-card-expiry hidden" id="stripe-card-expiry-year" name="exp_year" data-placeholder="" tabindex="-1" title="">
<option></option>
<?php
$current_year = date('Y');
for ($i = $current_year; $i <= $current_year + 10; $i++) {
?>
<option <?php if ($cardInfo->exp_year == $i) echo 'selected'; ?> value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php } ?>
</select>
</p>
<div class="clearfix"></div>
<div class="despayment font14 robotoitalic">Expiration date - month and year</div>
<p class="form-row form-row-first cvc">
<label for="stripe-card-cvc">Card Code <span class="required">*</span></label>
<input type="text" name="cvc" placeholder="CCV" autocomplete="off" class="input-text wc-credit-card-form-card-cvc" id="stripe-card-cvc">
</p>
<p class="form-row form-row-last cvc">
<span class="icon_csv"> </span>
</p>
<div class="clearfix"></div>
<div class="despayment font14 robotoitalic">It's the last 3 digits on the back (or the 4 on the front for AMEX)</div>
<input type="hidden" name="card_id" value="<?php echo $cardInfo->id; ?>"/>
<div class="clear"></div>
<?php } ?>
<!-------------------END card form---------------------->
<input type="hidden" name="old_customer_email" value="<?php echo $current_email; ?>"/>
<input type="hidden" name="customer_id" value="<?php echo $user_id; ?>"/>
<input type="hidden" value="928b82c1b5" name="_wcsnonce" id="_wcsnonce">
<input type="hidden" value="/my-account/" name="_wp_http_referer">
<input type="hidden" name="exp_month_a" id="card_exp_month"/>
<input type="hidden" name="exp_year_a" id="card_exp_year"/>
<p>
<button name="save_address" class="button" type="submit" id="button_save_changes" >Save changes<i class="hide ajax-loader small animate-spin"></i></button>
<input type="hidden" value="a97f30ae39" name="_wpnonce" id="_wpnonce">
<input type="hidden" value="/my-account/" name="_wp_http_referer">
<input type="hidden" value="edit_address" name="action">
</p>
</form>
</div>
</div>
</div>
</div>
<div class=" form-group"></div>
<script>
jQuery(document).ready(function ($) {
$('input#stripe-card-number').payment('restrictNumeric');
$('input#stripe-card-number').payment('formatCardNumber');
$('input#stripe-card-cvc').payment('formatCardCVC');
$( "#add_card_number" ).click(function() {
var number_card_month = $( "#s2id_stripe-card-expiry-month" ).find("#select2-chosen-5").text();
$('#card_exp_month').val(number_card_month);
var number_card_year = $( "#s2id_stripe-card-expiry-year" ).find("#select2-chosen-5").text();
$('#card_exp_year').val(number_card_year);
});
});
</script>