@extends('front.layouts.account')
<?php
$title = 'My Transactions';
$customerTypes = Config("params.customer_types");
$currency = Config("params.currency");
?>
@include('front/common/meta')
@section('content')
<div class="col-lg-8 px-lg-5 transaction-box overflow-auto shadow py-lg-5 py-3">
    <h4 class="font-weight-bold mb-4">Transactions </h4>

    <?php
    if (count($model) > 0) {
        foreach ($model as $row) {
            ?>
            <div class="transaction shadow p-3 mb-4">
                <p class="text-right mb-2"><strong>DATE: <?php echo date("d/m/Y", strtotime($row->startDate)) ?></strong></p>
                <div class="row">
                    <div class="col-2 pl-4 text-white">
                        <strong>Invoice <br>#<?php echo $row->invoiceNumber ?></strong><br>
                        <a href="<?php echo url("transaction/" . $row->invoiceNumber) ?>" class="text-white"><small><i class="fas fa-eye"></i> view</small></a>
                        <!-- <br> -->
                        <a href="<?php echo url("my-transaction/pdf/" . $row->invoiceNumber) ?>" class="text-white"><small><i class="fas fa-file"></i> PDF</small></a>
                    </div>
                    <div class="col-2 text-center">
                        <strong class="mb-2 d-block text-uppercase">Created</strong>
                        <span><?php echo date("d/m/Y h:i a", strtotime($row->created_at)) ?></span>
                    </div>
                    <div class="col-2 text-center">
                        <strong class="mb-2 d-block text-uppercase">Package</strong>
                        <span><?php echo $row->package->title ?></span>
                    </div>
                    <div class="col-4 text-center">
                        <strong class="mb-2 d-block text-uppercase">Payment Frequency</strong>
                        <span><?php echo ucfirst($row->type) ?></span>
                    </div>
                    <div class="col-2 text-center">
                        <strong class="mb-2 d-block text-uppercase">Total</strong>
                        <span><?php echo $currency["symbol"] ?><?php echo $row->total ?></span>
                    </div>
                </div>
            </div>
            <?php
        }
    } else {
        ?>

        <div class="form-row mt-4">
            <div class="alert alert-warning" role="alert">
                You haven't subscribe to any of our packages.
            </div>
        </div>


    <?php } ?>
    <div class="pt-3 text-center d-none">
        <button class="btn btn-lg"><i class="fas fa-chevron-down fa-lg"></i></button>
    </div>
</div>


@endsection

@section('myscript')

<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

@endsection