<?php $__env->startSection('content'); ?>
<div class="p-4">

<div class="ml-2 text-md text-gray-800 dark:text-gray-200 flex">
<?php echo e($user->first_name); ?>'s Investment
            <svg class="w-5 h-5 ml-2 mb-4" fill="currentColor" viewBox="0 0 20 20">
            <path d="M17.431,2.156h-3.715c-0.228,0-0.413,0.186-0.413,0.413v6.973h-2.89V6.687c0-0.229-0.186-0.413-0.413-0.413H6.285c-0.228,0-0.413,0.184-0.413,0.413v6.388H2.569c-0.227,0-0.413,0.187-0.413,0.413v3.942c0,0.228,0.186,0.413,0.413,0.413h14.862c0.228,0,0.413-0.186,0.413-0.413V2.569C17.844,2.342,17.658,2.156,17.431,2.156 M5.872,17.019h-2.89v-3.117h2.89V17.019zM9.587,17.019h-2.89V7.1h2.89V17.019z M13.303,17.019h-2.89v-6.651h2.89V17.019z M17.019,17.019h-2.891V2.982h2.891V17.019z"
            ></path>
            </svg>
</div>

<hr class="mb-4">


        <!-- Account Balance Card -->
        <div
        class="flex items-center justify-between p-4 bg-white shadow-xs dark:bg-gray-800 mb-6 mt-4"
        id="acc-balance"
        >
            <div class="flex items-center">
                <div
                    class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500"
                >
                    <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
                    <path
                        fill-rule="evenodd"
                        d="M4 4a2 2 0 00-2 2v4a2 2 0 002 2V6h10a2 2 0 00-2-2H4zm2 6a2 2 0 012-2h8a2 2 0 012 2v4a2 2 0 01-2 2H8a2 2 0 01-2-2v-4zm6 4a2 2 0 100-4 2 2 0 000 4z"
                        clip-rule="evenodd"
                    ></path>
                    </svg>
                </div>
                <div>
                    <p
                    class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400"
                    >
                    Available balance
                    </p>
                    <p
                    class="text-2xl font-semibold text-gray-700 dark:text-gray-200 mb-0"
                    >
                    NGN <?php echo e(number_format($user->balance)); ?>

                    <br>
                   
                  
                    </p>
                </div>
            </div>
        </div>


        <!-- Current Investment Record -->
        <div class="grid gap-6 mb-8 md:grid-cols-2">
            <!-- Current Plan Info -->
            <div
            class="flex justify-between p-4 bg-white shadow-xs dark:bg-gray-800 mb-6 mt-4"
            >
                <div class="flex items-center">
                    <?php if($a_investment != null): ?>
                    <div
                        class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500"
                        >
                        <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
                        <path d="M17.431,2.156h-3.715c-0.228,0-0.413,0.186-0.413,0.413v6.973h-2.89V6.687c0-0.229-0.186-0.413-0.413-0.413H6.285c-0.228,0-0.413,0.184-0.413,0.413v6.388H2.569c-0.227,0-0.413,0.187-0.413,0.413v3.942c0,0.228,0.186,0.413,0.413,0.413h14.862c0.228,0,0.413-0.186,0.413-0.413V2.569C17.844,2.342,17.658,2.156,17.431,2.156 M5.872,17.019h-2.89v-3.117h2.89V17.019zM9.587,17.019h-2.89V7.1h2.89V17.019z M13.303,17.019h-2.89v-6.651h2.89V17.019z M17.019,17.019h-2.891V2.982h2.891V17.019z"
                        ></path>
                        </svg>
                    </div>
                    <div>
                        <p
                        class="mb-2 text-sm font-semibold text-gray-600 dark:text-gray-400"
                        >
                        <?php if($a_investment->status == 1): ?>Pending <?php elseif($a_investment->status == 2): ?>Ongoing <?php endif; ?> Investment:
                        </p>
                        <p
                        class="text-xl font-semibold text-gray-700 dark:text-gray-200"
                        >
                        <?php echo e($a_investment->plan->name); ?>

                        </p>
                        <p
                        class="text-sm text-gray-700 dark:text-gray-200"
                        >
                        <b>CAPITAL:</b>
                        &#8358;<?php echo e(number_format($a_investment->amount)); ?>

                        </p>
                        <p
                        class="text-sm text-gray-700 dark:text-gray-200"
                        >
                        <b>ROI:</b>
                        <?php echo e($a_investment->plan->percent_profit); ?>%  
                        </p>
                        <p
                        class="text-sm text-gray-700 dark:text-gray-200"
                        >
                        <b>R. AMT:</b>
                        NGN <?php echo e(number_format(($a_investment->amount/100 * $a_investment->plan->percent_profit) * $a_investment->plan->period + $a_investment->amount)); ?>

                        </p>
                        <div
                        class="inline-flex space-x-4 text-xs md:text-sm font-semibold text-gray-700 dark:text-gray-200"
                        >
                            <div>   
                                <button type="button" class="h-3 w-3 rounded-full" style="background-color: green;"></button>
                                <?php echo date('Y-m-d', strtotime($a_investment->buy_date)); ?>

                            </div>

                            <div>   
                                <button type="button" class="h-3 w-3 rounded-full" style="background-color: red;"></button>
                                <?php echo date('Y-m-d', strtotime($a_investment->end_date)); ?>

                            </div>
                        </div>
                    </div>
                    <?php else: ?>
                    <div
                        class="p-3 mr-4 text-gray-500 bg-green-100 rounded-full dark:text-green-100 dark:bg-gray-700"
                    >
                        <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
                        <path d="M18.344,16.174l-7.98-12.856c-0.172-0.288-0.586-0.288-0.758,0L1.627,16.217c0.339-0.543-0.603,0.668,0.384,0.682h15.991C18.893,16.891,18.167,15.961,18.344,16.174 M2.789,16.008l7.196-11.6l7.224,11.6H2.789z M10.455,7.552v3.561c0,0.244-0.199,0.445-0.443,0.445s-0.443-0.201-0.443-0.445V7.552c0-0.245,0.199-0.445,0.443-0.445S10.455,7.307,10.455,7.552M10.012,12.439c-0.733,0-1.33,0.6-1.33,1.336s0.597,1.336,1.33,1.336c0.734,0,1.33-0.6,1.33-1.336S10.746,12.439,10.012,12.439M10.012,14.221c-0.244,0-0.443-0.199-0.443-0.445c0-0.244,0.199-0.445,0.443-0.445s0.443,0.201,0.443,0.445C10.455,14.021,10.256,14.221,10.012,14.221"
                        ></path>
                        </svg>
                    </div>
                    <div>
                        <p
                        class="text-sm text-gray-700 dark:text-gray-200"
                        >
                            You currently have no ongoing plan, <br>
                            click on the "invest" menu to buy one.
                        </p>
                    </div>
                    <?php endif; ?>
                </div>

               
            </div>


            <!-- ROI Info -->
           
        </div>


















        <!-- Recent Transaction Card -->
        <div class="mb-8" id="transaction-board">
            <!-- Deposit History Card -->
            <div x-data={show:false} class="rounded-b-lg bg-white shadow-xs dark:bg-gray-800">
                <div
                class="p-4 mb-0 h-64 bg-blue-600 text-lg font-semibold text-purple-100 rounded-t-lg shadow-md focus:outline-none focus:shadow-outline-purple"
                style="color: #fff;"
                >
                    <div class="flex justify-between items-center">
                        <div class="flex items-center">
                            <svg
                            class="w-5 h-5 mr-2"
                            fill="currentColor"
                            viewBox="0 0 20 20"
                            >
                            <path
                            d="M17.431,2.156h-3.715c-0.228,0-0.413,0.186-0.413,0.413v6.973h-2.89V6.687c0-0.229-0.186-0.413-0.413-0.413H6.285c-0.228,0-0.413,0.184-0.413,0.413v6.388H2.569c-0.227,0-0.413,0.187-0.413,0.413v3.942c0,0.228,0.186,0.413,0.413,0.413h14.862c0.228,0,0.413-0.186,0.413-0.413V2.569C17.844,2.342,17.658,2.156,17.431,2.156 M5.872,17.019h-2.89v-3.117h2.89V17.019zM9.587,17.019h-2.89V7.1h2.89V17.019z M13.303,17.019h-2.89v-6.651h2.89V17.019z M17.019,17.019h-2.891V2.982h2.891V17.019z"
                            ></path>
                            </svg>
                            <span>Investment ROI Board</span>
                        </div>
                        <div x-show="!show" class="text-sm cursor-pointer" @click="show=!show" style="cursor:pointer;">&#x25BC;</div>
                        <div x-show="show" class="text-sm cursor-pointer" @click="show=!show" style="cursor:pointer;">&#x25B2;</div>
                    </div>
                </div>
                <div x-show="show" class="bg-white rounded-b-lg shadow-xs dark:bg-gray-800 text-gray-700 dark:text-gray-200 p-4" x-transition>

                    <?php if($a_investment != null): ?>
                    <table class="w-full whitespace-no-wrap border-separate">
                        <thead align="center">
                            <tr class="text-base font-bold">
                                <td>ROI Amount</td>
                                <td>Date</td>
                                <td>Status</td>
                            </tr>
                        </thead>

                        <tbody align="center" class="p-2 text-sm md:text-base font-semibold text-gray-600 dark:text-gray-400">
                            <?php $__empty_1 = true; $__currentLoopData = $a_investment->inTransaction; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $in_transaction): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr class="hover:bg-gray-600 dark:hover:bg-gray-400 py-2">
                                <td class="font-mono cursor-pointer text-lg" title="Click to clear balance">&#8358;<?php echo e(number_format($in_transaction->in_deposits)); ?></td>
                                
                                <td class="font-mono cursor-pointer text-lg" title="Balance cleared"><?php echo e(date('M j Y', strtotime($in_transaction->created_at))); ?></td>
                               
                                <td>
                                    <?php if($in_transaction->in_withdrawals == 1): ?>
                                    <span style="color:green">Paid</span>
                                    <?php elseif($in_transaction->in_withdrawals == 2): ?>
                                    <span style="color:red">Declined</span>
                                    <?php else: ?>
                                    <span style="color:orange">Unattended To</span>
                                    <?php endif; ?>
                                </td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                <p
                                align="center"
                                class="text-sm text-gray-700 dark:text-gray-200"
                                >
                                    No ROI added yet!
                                </p>
                            <?php endif; ?>
                        </tbody>
                    </table>
                    <?php else: ?>
                    <p
                    align="center"
                    class="text-sm text-gray-700 dark:text-gray-200"
                    >
                        You currently have no ongoing plan, <br>
                        click on the "invest" menu to buy one.
                    </p>
                    <?php endif; ?>
                </div>       
            </div>
        </div>








        <!-- Recent Transaction Card -->
        <div class="grid gap-6 mb-8 md:grid-cols-2">
            <!-- Deposit History Card -->
            <div class="rounded-b-lg bg-white shadow-xs dark:bg-gray-800">
                <div
                class="p-4 mb-0 h-64 bg-blue-600 text-lg font-semibold text-purple-100 rounded-t-lg shadow-md focus:outline-none focus:shadow-outline-purple"
                style="color: #fff;"
                >
                    <div class="flex items-center">
                        <svg
                        class="w-5 h-5 mr-2"
                        fill="currentColor"
                        viewBox="0 0 20 20"
                        >
                        <path
                            d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
                        ></path>
                        </svg>
                        <span>Deposit History</span>
                    </div>
                </div>
                <div class="bg-white rounded-b-lg shadow-xs dark:bg-gray-800 text-gray-700 dark:text-gray-200">
                    <?php
                    # The variable $i will be incremented by one at every loop so we can display only 5 records
                    # This is so that we can apply a pagination functionality, or a "view more" to see the full history
                    $i = 0;
                    ?>
                    <?php $__empty_1 = true; $__currentLoopData = $deposits; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $deposit): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <div class="flex items-center justify-between text-gray-700 dark:text-gray-200 border-b p-4">
                        <div>
                            <span class="text-lg font-semibold">NGN <?php echo e(number_format($deposit->amount)); ?></span>
                        </div>
                        <div>
                            <span class="text-sm">
                                <?php echo date('M j Y', strtotime($deposit->created_at)); ?> <br>
                                <?php if($deposit->status == 1): ?>
                                <span style="color:green">successfull</span>
                                <?php elseif($deposit->status == 2): ?>
                                <span style="color:red">unsuccessfull</span>
                                <?php elseif($deposit->status == null): ?>
                                <span style="color:orange">pending</span>
                                <?php endif; ?>
                            </span>
                        </div>
                    </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <div class="flex items-center p-4">
                        <div
                            class="p-3 mr-4 text-gray-500 bg-green-100 rounded-full dark:text-green-100 dark:bg-gray-700"
                        >
                            <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
                            <path d="M10.185,1.417c-4.741,0-8.583,3.842-8.583,8.583c0,4.74,3.842,8.582,8.583,8.582S18.768,14.74,18.768,10C18.768,5.259,14.926,1.417,10.185,1.417 M10.185,17.68c-4.235,0-7.679-3.445-7.679-7.68c0-4.235,3.444-7.679,7.679-7.679S17.864,5.765,17.864,10C17.864,14.234,14.42,17.68,10.185,17.68 M10.824,10l2.842-2.844c0.178-0.176,0.178-0.46,0-0.637c-0.177-0.178-0.461-0.178-0.637,0l-2.844,2.841L7.341,6.52c-0.176-0.178-0.46-0.178-0.637,0c-0.178,0.176-0.178,0.461,0,0.637L9.546,10l-2.841,2.844c-0.178,0.176-0.178,0.461,0,0.637c0.178,0.178,0.459,0.178,0.637,0l2.844-2.841l2.844,2.841c0.178,0.178,0.459,0.178,0.637,0c0.178-0.176,0.178-0.461,0-0.637L10.824,10z"
                            ></path>
                            </svg>
                        </div>
                        <div>
                            <p
                            class="text-sm text-gray-700 dark:text-gray-200"
                            >
                                You are yet to make a deposit. <br>
                                Do so, and your deposit history should appear here.
                            </p>
                        </div>
                    </div>
                    <?php endif; ?>
                </div>       
            </div>
            
            <!-- Withdraw History card -->
            <div class="rounded-b-lg bg-white shadow-xs dark:bg-gray-800">
                <div
                class="p-4 mb-0 bg-blue-600 h-64 text-lg font-semibold text-purple-100 rounded-t-lg shadow-md focus:outline-none focus:shadow-outline-purple"
                style="color: #fff;"
                >
                    <div class="flex items-center">
                        <svg
                        class="w-5 h-5 mr-2"
                        fill="currentColor"
                        viewBox="0 0 20 20"
                        >
                        <path
                            d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
                        ></path>
                        </svg>
                        <span>Withdraw History</span>
                    </div>
                </div>
                <div class="bg-white rounded-b-lg shadow-xs dark:bg-gray-800 text-gray-700 dark:text-gray-200">
                 <?php $__empty_1 = true; $__currentLoopData = $withdrawals; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $withdrawal): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <div class="flex items-center justify-between text-gray-700 dark:text-gray-200 border-b p-4">
                        <div>
                            <span class="text-lg font-semibold">
                                NGN <?php echo e(number_format($withdrawal->amount)); ?></span>
                        </div>
                        <div>
                            <span class="text-sm">
                                <?php echo date('M j Y', strtotime($withdrawal->created_at)); ?> <br>
                                <?php if($withdrawal->status == 2): ?>
                                <span style="color:green">approved</span>
                                <?php elseif($withdrawal->status == 1): ?>
                                <span style="color:yellow">pending</span>
                                <?php elseif($withdrawal->status == 3): ?>
                                <span style="color:red">declined</span>
                                <?php endif; ?>
                            </span>
                        </div>
                    </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <div class="flex items-center p-4">
                        <div
                            class="p-3 mr-4 text-gray-500 bg-green-100 rounded-full dark:text-green-100 dark:bg-gray-700"
                        >
                            <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
                            <path d="M10.185,1.417c-4.741,0-8.583,3.842-8.583,8.583c0,4.74,3.842,8.582,8.583,8.582S18.768,14.74,18.768,10C18.768,5.259,14.926,1.417,10.185,1.417 M10.185,17.68c-4.235,0-7.679-3.445-7.679-7.68c0-4.235,3.444-7.679,7.679-7.679S17.864,5.765,17.864,10C17.864,14.234,14.42,17.68,10.185,17.68 M10.824,10l2.842-2.844c0.178-0.176,0.178-0.46,0-0.637c-0.177-0.178-0.461-0.178-0.637,0l-2.844,2.841L7.341,6.52c-0.176-0.178-0.46-0.178-0.637,0c-0.178,0.176-0.178,0.461,0,0.637L9.546,10l-2.841,2.844c-0.178,0.176-0.178,0.461,0,0.637c0.178,0.178,0.459,0.178,0.637,0l2.844-2.841l2.844,2.841c0.178,0.178,0.459,0.178,0.637,0c0.178-0.176,0.178-0.461,0-0.637L10.824,10z"
                            ></path>
                            </svg>
                        </div>
                        <div>
                            <p
                            class="text-sm text-gray-700 dark:text-gray-200"
                            >
                            You haven't carried out any withdrawals yet
                            </p>
                        </div>
                    </div>
                    <?php endif; ?>
                </div>       
            </div>
        </div>

            

</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin_layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\wamp64\www\jango\resources\views/admin/user_dashboard.blade.php ENDPATH**/ ?>