<?php $__env->startSection('title', 'Trade History'); ?>
<?php $__env->startSection('trade-history', 'active'); ?>
<?php echo $__env->make('adminDashboard.layout.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<div class="main-content">
    <section class="section">
        <div class="section-body">
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-header">
                            <h4>Trade History</h4>
                        </div>
                        <form id="tradeHistoryForm">
                            <?php echo csrf_field(); ?>
                            <div class="card-body">
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label>Search User by Mobile</label>
                                            <input type="text" class="form-control" name="user_mobile"
                                                id="user_mobile" required>
                                            <div id="user_error" class="error"></div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label>Type</label>
                                            <select class="form-control select2" name="bet_type" id="bet_type"
                                                required>
                                                <option value="one_minute">One Minute</option>
                                                <option value="two_minute">Two Minute</option>
                                                <option value="three_minute">Three Minute</option>
                                                <option value="five_minute">Five Minute</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="card-footer text-right p-0">
                                    <input type="submit" class="btn btn-primary mr-1" value="Submit" />
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <section class="section">
        <div class="section-body">
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-header">
                            <h4>Records</h4>
                        </div>
                        <div class="card-body p-0">
                            <div class="table-responsive">
                                <table class="table table-striped table-md">
                                    <tr>
                                        <th>ID</th>
                                        <th>Game ID</th>
                                        <th>Mobile</th>
                                        <th>Value</th>
                                        <th>Result</th>
                                        <th>Amount</th>
                                        <th>Date</th>
                                    </tr>
                                    <tbody id="record_table">
                                        <?php if(count($bettings) > 0): ?>
                                            <?php $__currentLoopData = $bettings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $bet): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <tr>
                                                    <td><?php echo e($bet->id); ?></td>
                                                    <td><?php echo e($bet->game_id); ?></td>
                                                    <td>
                                                        <?php if(isset($bet->user)): ?>
                                                            <?php if(env('DEMO')): ?>
                                                                <?php echo e(substr_replace($bet->user->mobile, '*****', 3, -2)); ?>

                                                            <?php else: ?>
                                                                <?php echo e($bet->user->mobile); ?>

                                                            <?php endif; ?>
                                                        <?php endif; ?>
                                                    </td>
                                                    <td><?php echo e($bet->amount); ?></td>
                                                    <?php if($bet->status == 0): ?>
                                                        <td>Wait</td>
                                                    <?php else: ?>
                                                        <?php if($bet->result == 1): ?>
                                                            <td class="success">Won</td>
                                                        <?php else: ?>
                                                            <td class="error">Lost</td>
                                                        <?php endif; ?>
                                                    <?php endif; ?>
                                                    <?php if($bet->winning_amount != null): ?>
                                                        <td><?php echo e($bet->winning_amount); ?></td>
                                                    <?php else: ?>
                                                        <td>0</td>
                                                    <?php endif; ?>
                                                    <td><?php echo e($bet->created_at); ?></td>
                                                </tr>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php else: ?>
                                            <tr>
                                                <td colspan="7" class="text-center">No Data Found.</td>
                                            </tr>
                                        <?php endif; ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="card-footer text-right" id="pagination">
                            <nav class="d-inline-block">
                                <?php echo e($bettings->links('adminDashboard.pagination')); ?>

                            </nav>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
</div>
<?php echo $__env->make('adminDashboard.layout.footer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php /**PATH /home/shyambabamatka/public_html/zupitogames.com/resources/views/adminDashboard/trade-history.blade.php ENDPATH**/ ?>