
<style>
    .dt-search,
    .dt-length {
        display: none !important;
    }
</style>
<?php $__env->startSection('content'); ?>

<h5><button type="button" class="btn btn-icon bg-white me-2 waves-effect waves-light"
        style="box-shadow: 0px 9px 12px -2px #66328E1F;">
        <a href="<?php echo e(route('admin.profit_report_gold')); ?>">
            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000"
                stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler">
                <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
                <path d="M15 6l-6 6l6 6"></path>
            </svg>
        </a>
    </button> Report</h5>

<div class="row mt-5">
    <div class="col-lg-12">
        <div class="card">

            <div class="card-body">
                <div class="row g-3 align-items-center justify-content-between">

                    <!-- LEFT -->
                    <div class="col-12 col-lg-auto">

                        <select id="pageLength" class="form-select">
                            <option value="10">10</option>
                            <option value="25">25</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                            <option value="All">All</option>
                        </select>

                    </div>

                    <div class="col-12 col-lg-auto">

                        <div class="d-flex flex-column flex-sm-row align-items-stretch align-items-sm-center gap-2">


                            <input type="text" id="customSearch" class="form-control" placeholder="Search table...">

                            <button class="btn btn-label-secondary">
                                Export
                            </button>
                        </div>

                    </div>

                </div>

                <div class="table-responsive">
                    <table id="usersTable" class="table table-striped table-bordered align-middle nowrap w-100">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>Date</th>
                                <th>User ID</th>
                                <th>User Name</th>
                                <th>Investment</th>
                                <th>ROI Percentage</th>
                                <th>Credit Amount</th>                  
                                <th>Remark</th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>

                </div>
            </div>
        </div>
    </div>
</div>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script>
    $(document).ready(function() {

     

        let table = $('#usersTable').DataTable({

            processing  : true,
            serverSide  : true,
            ajax        : "<?php echo e(route('admin.gold_roi_history_data', $date)); ?>",
            pageLength  : 10,
            ordering    : false,
            searching   : true,
            info        : true,
            lengthChange: false,

            columnDefs: [{
                targets: '_all',
                className: 'text-nowrap text-center align-middle'
            }],

                    columns: [
                { data: 'DT_RowIndex' },
                { data: 'entry_date' },
                { data: 'user_id' },
                { data: 'user_name' },
                { data: 'investment' },
                { data: 'percentage' },
                { data: 'credit' },
                { data: 'remark' }
            ]
        });

       
        $('#customSearch').on('keyup', function() {
            table.search($(this).val()).draw();
        });

        $('#pageLength').on('change', function() {
            let value = $(this).val() === 'All' ?
                -1 :
                parseInt($(this).val());
            table.page.len(value).draw();

        });

    });
</script>



<?php $__env->stopSection(); ?>
<?php echo $__env->make('Admin.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/omiga_ipl/resources/views/Admin/gold_roi_history.blade.php ENDPATH**/ ?>