<div class="card">
<div class="card-header border-bottom">
<h4 class="card-title"><?php echo e(__('locale.labels.current_plan')); ?></h4>
</div>
<div class="card-body pt-1">
<div class="row">
<?php if(isset($customer->customer->subscription) && $customer->customer->activeSubscription() !== null): ?>
<div class="col-12">
<p class="mb-2"><?php echo __('locale.subscription.you_are_currently_subscribed_to_plan',
[
'plan' => $customer->customer->currentPlanName(),
'price' => \App\Library\Tool::format_price($customer->customer->activeSubscription()->plan->price, $customer->customer->activeSubscription()->plan->currency->format),
'remain' => \App\Library\Tool::formatHumanTime($customer->customer->subscription->current_period_ends_at),
'end_at' => \App\Library\Tool::formatDate($customer->customer->subscription->current_period_ends_at)
]); ?></p>
</div>
<div class="col-12">
<p><?php echo __('locale.description.subscription_logs'); ?></p>
<ul class="nav nav-tabs nav-justified mb-3" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="account-tab" data-bs-toggle="tab" href="#logs" aria-controls="logs" role="tab" aria-selected="true">
<i data-feather="database"></i> <?php echo e(__('locale.subscription.logs')); ?>
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="information-tab" data-bs-toggle="tab" href="#transactions" aria-controls="transactions" role="tab" aria-selected="false">
<i data-feather="shopping-cart"></i> <?php echo e(__('locale.labels.transactions')); ?>
</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="logs" aria-labelledby="account-tab" role="tabpanel">
<div class="table-responsive">
<table class="table table-hover table-bordered mb-0">
<thead class="table-primary">
<tr>
<th scope="col"><?php echo e(__('locale.labels.created_at')); ?></th>
<th scope="col"><?php echo e(__('locale.labels.message')); ?></th>
</tr>
</thead>
<tbody>
<?php $__empty_1 = true; $__currentLoopData = $customer->customer->subscription->getLogs(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $log): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<tr>
<td> <?php echo e(\App\Library\Tool::formatDateTime($log->created_at)); ?> </td>
<td> <?php echo __('locale.subscription.log_' . $log->type, $log->getData()); ?> </td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<tr>
<td class="text-center" colspan="5">
<?php echo e(__('locale.datatables.no_results')); ?>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<div class="tab-pane" id="transactions" aria-labelledby="information-tab" role="tabpanel">
<div class="table-responsive">
<table class="table table-hover table-bordered mb-0">
<thead class="thead-primary">
<tr>
<th scope="col"><?php echo e(__('locale.labels.created_at')); ?></th>
<th scope="col"><?php echo e(__('locale.labels.title')); ?></th>
<th scope="col"><?php echo e(__('locale.labels.amount')); ?></th>
<th scope="col"><?php echo e(__('locale.labels.status')); ?></th>
</tr>
</thead>
<tbody>
<?php $__empty_1 = true; $__currentLoopData = $customer->customer->subscription->getTransactions(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $invoice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<tr>
<td><?php echo e(\App\Library\Tool::formatDate($invoice->created_at)); ?></td>
<td>
<?php echo $invoice->title; ?>
<?php if($invoice->description): ?>
<div class="small text-muted"><?php echo $invoice->description; ?></div>
<?php endif; ?>
</td>
<td><?php echo e($invoice->amount); ?></td>
<td>
<?php if($invoice->status == 'failed'): ?>
<div class="chip chip-danger">
<?php elseif($invoice->status == 'pending' || $invoice->status == 'plan_change' || $invoice->status == 'renew' ): ?>
<div class="chip chip-warning">
<?php elseif($invoice->status == 'auto_charge'): ?>
<div class="chip chip-info">
<?php else: ?>
<div class="chip chip-success">
<?php endif; ?>
<div class="chip-body">
<div class="chip-text text-uppercase"> <?php echo e(str_replace('_', ' ', $invoice->status)); ?></div>
</div>
</div>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<tr>
<td class="text-center" colspan="5">
<?php echo e(__('locale.datatables.no_results')); ?>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php else: ?>
<div class="col-12">
<h5 class="text-center text-info"><?php echo __('locale.subscription.no_active_subscription'); ?></h5>
<div class="row justify-content-center mt-2">
<a href="<?php echo e(route('admin.subscriptions.create', ['customer_id' => $customer->id])); ?>" class="btn btn-primary"><?php echo e(__('locale.buttons.new_subscription')); ?></a>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php /**PATH /home/bouloter/sms/resources/views/admin/customer/_subscription.blade.php ENDPATH**/ ?>