<?php include('../includes/db_conx.php');

isset($_SESSION['detect_login']);
if (!isset($_SESSION['detect_login'])) {
    header("location: ../online/customer_login");
    exit();
} else {
    $id = $_SESSION['id'];
    // echo $id;
    // get all the varible from the database for personal information 
    include('../includes/cus-info.php');

    include('../includes/dash-header.php');
}
?>

<body>

    <?php
    include('../includes/side-nav.php');
    ?>



    <div class="main-content" id="panel">
        <?php
        include('../includes/top-nav.php');
        ?>


        <div class="header pb-4">
            <div class="container-fluid">
                <div class="header-body">
                </div>
            </div>
        </div>
        <br>
        <br>
        <!-- header end -->
        <style>
            .card ul li {
                margin-bottom: 10px;
            }
        </style>

        <div class="container-fluid mt--6">
            <div class="content-wrapper">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card bg-white">
                            <div class="card-body">
                                <div class="">
                                    <h3> <?= $sitename ?> Virtual Card</h3>
                                    <p> 3D secure card for even more versatile transactions </p>

                                    <div class='card p-1'>


                                        <ul>
                                            <br />
                                            <li>
                                                <h5 class='text-warning ' style='margin-bottom: 1px;'> Card Creation fee</h5>
                                                <small><?= $currency ?> 3 </small>
                                            </li>

                                            <li>
                                                <h5 class='text-warning ' style='margin-bottom: 1px;'> Transaction fees</h5>
                                                <small>0.5% per Transaction capped at <?= $currency ?>5 </small>
                                            </li>
                                            <li>
                                                <h5 class='text-warning ' style='margin-bottom: 1px;'> 3D Secure</h5>
                                                <small>Yes </small>
                                            </li>
                                        </ul>

                                    </div>
                                    <h3 class="">Request for a Virtual Card</h3>
                                    <?php
                                    if ($c_status == 2) {
                                        echo '<div class="alert alert-warning alert-dismissible fade show" role="alert">
                                            <strong>Notice!</strong> Your card request has been sent. Kindly wait for approval
                                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                                <span aria-hidden="true">&times;</span>
                                            </button>
                                            </div>';
                                    } elseif ($c_status == 1) {

                                        echo '<div class="alert alert-success alert-dismissible fade show" role="alert">
                                            <strong>Notice!</strong> Your card request has been Approved.
                                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                                <span aria-hidden="true">&times;</span>
                                            </button>
                                            </div>';
                                    } else {


                                    ?>

                                        <form method='POST'>
                                            <input value='2' type='text' hidden>
                                            <button type="submit" name='b_submit' class="btn btn-sm btn-neutral"><i class="fa fa-arrow-right"></i> Create request</button>

                                        </form>
                                    <?php } ?>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card bg-white">
                            <div class="card-body">
                                <div class="">
                                    <h3 class="">Why choose our Virtual Card</h3>
                                    </br />
                                    <ul>
                                        <li>
                                            <h3> Staff empowerment</h3>

                                            <p>
                                                <?= $sitename ?> Virtual cards can be issued to multiple team members who are required to make payments for their business on a daily basis. So instead of hounding your manager or accounts department for access to the one single physical card to make a payment (or going through the onerous paperwork to get a corporate card yourself), staff can be issued with individual virtual payment cards that are unique to them.
                                            </p>
                                        </li>
                                        <li>
                                            <h3> Access new debit cards instantly </h3>

                                            <p>
                                                One of the biggest pain points with opening new card accounts is waiting for them to arrive in the mail. You usually need to wait for the physical card to arrive which could take weeks, especially with the shipping delays in a post-pandemic world. For businesses with remote teams, this normally means then having to mail the card back out to your employees. Virtual cards on the other hand can be activated and used for online purchases pretty much instantaneously, meaning you can get access to your funds faster.
                                            </p>
                                        </li>
                                        <li>
                                            <h3> Improved accountability </h3>

                                            <p>
                                                Another virtual debit card benefit is the improved oversight and accountability you receive over your business’ money. As you’re able to assign virtual payment cards to specific suppliers or vendors, you always know exactly where your money is going, and why. Purchases made against this card are then automatically logged into your card management system. Everything is neatly processed, labelled, and accounted for—no more mystery payments.
                                            </p>
                                        </li>
                                        <li>
                                            <h3> Added payment security </h3>

                                            <p>
                                                One of the biggest pain points with opening new card accounts is waiting for them to arrive in the mail. You usually need to wait for the physical card to arrive which could take weeks, especially with the shipping delays in a post-pandemic world. For businesses with remote teams, this normally means then having to mail the card back out to your employees. Virtual cards on the other hand can be activated and used for online purchases pretty much instantaneously, meaning you can get access to your funds faster.
                                            </p>
                                        </li>
                                        <li>
                                            <h3> Easy to create and use</h3>

                                            <p>
                                                Typically virtual cards were only available to large enterprises, but with the recent advances in fintech, these products are now available to everyday businesses as well. Companies like fintech unicorn Airwallex allow businesses to create virtual cards within seconds. All you need to do is set up an account (which you can do completely online) and you can start creating them for your business.
                                            </p>
                                        </li>
                                        <li>
                                            <h3> Lower cost per card issued</h3>

                                            <p>
                                                Typically virtual cards were only available to large enterprises, but with the recent advances in fintech, these products are now available to everyday businesses as well. Companies like fintech unicorn Airwallex allow businesses to create virtual cards within seconds. All you need to do is set up an account (which you can do completely online) and you can start creating them for your business.
                                            </p>
                                        </li>

                                    </ul>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>



                <!-- footer begin -->
                <footer class="footer pt-0">

                </footer>
            </div>
        </div>
        <?php
        include('../includes/dash_footer.php') ?>

</body>


<?php




function swal_success()
{
    echo "
    <script> 
        $(document).ready(function(){
        Swal.fire({
            title: 'Success',
            text: 'Success! Your Card request was successful',
            icon: 'success',
            showCancelButton: false,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Continue'
        }).then((result) => {
            if (result.isConfirmed) {
            window.location.replace('ticket.php');
            }
        })

    });
    // this is the end of the swal jquery in the php function page 
    </script>
        ";
}




if (isset($_POST['b_submit'])) {
    $sql_card = "UPDATE personal_identification SET c_status = '2' WHERE id = '$id'";
    $query_card = $db_conx->query($sql_card);
    if ($query_card) {
        swal_success();
    }
}

?>
<!-- -->

</html>

<script>
</script>
<script type="text/javascript">
    $('.preloader').fadeOut(1000);
</script>