<?php echo $__env->make('admin/header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<div class="page-container">
    <!-- Content Wrapper START -->
    <div class="main-content">        
        <div class="card">
            <div class="card-body">
                <?php if(session('success')): ?>
                <div class="alert alert-success mb-1 mt-1">
                    <?php echo e(session('success')); ?>

                </div>
                <?php endif; ?>
                <div class="row">
                    <div class="col-md-12 col-lg-12">                        
                        <div class="d-flex justify-content-between align-items-center">
                            <h5>Charge Setting</h5>
                            <div>
                                <button data-toggle="modal" data-target="#modelCharge" class="btn btn-sm btn-primary">Add Charge</button>
                            </div>
                        </div>
                        <div class="m-t-30">
                            <div class="table-responsive">
                                <table class="table table-hover table-bordered">
                                    <thead>
                                        <tr>
                                            <th>Amount start</th>
                                            <th>Amount End</th>
                                            <th>Payin Charge</th>
                                            <th>Payout Charge</th>
                                            <th>Payin Charge type</th>
                                            <th>Payout Charge type</th>
                                            <th>Date</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php if(!@empty($userCharge)): ?>
                                            <?php $__currentLoopData = $userCharge; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <tr>
                                                    <td><?php echo e($rows->start_amount); ?></td>
                                                    <td><?php echo e($rows->end_amount); ?></td>
                                                    <td><?php echo e($rows->payin_charge); ?></td>
                                                    <td><?php echo e($rows->payout_charge); ?></td>
                                                    <td><?php echo e($rows->payin_charge_type); ?></td>
                                                    <td><?php echo e($rows->payout_charge_type); ?></td>
                                                    <td><?php echo e($rows->created_at); ?></td>
                                                </tr>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>                                                                                        
                                        <?php endif; ?>                                                                                      
                                    </tbody>
                                </table>                                    
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="col-md-12 col-lg-12">                        
                        <div class="d-flex justify-content-between align-items-center">
                            <h5>Recharge Commission</h5>
                            <div>
                                <button data-toggle="modal" data-target="#modelRechargeCommission"  class="btn btn-sm btn-primary">Add Recharge Commission</button>
                            </div>
                        </div>
                            <div class="m-t-30">
                                <div class="table-responsive">
                                    <table class="table table-hover table-bordered">
                                        <thead>
                                            <tr>
                                                <th>Operator</th>
                                                <th>Commission</th>
                                                <th>Commission Type</th>
                                                <th>Date</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php if(!@empty($RechargeCommission)): ?>
                                                <?php $__currentLoopData = $RechargeCommission; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <tr>
                                                        <td><?php echo e($rows->operator); ?></td>
                                                        <td><?php echo e($rows->commission); ?></td>
                                                        <td><?php echo e($rows->type); ?></td>
                                                        <td><?php echo e($rows->created_at); ?></td>
                                                    </tr>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>                                                                                        
                                            <?php endif; ?>                                                                                      
                                        </tbody>
                                    </table>                                   
                                </div>
                            </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="col-md-12 col-lg-12">                        
                        <div class="d-flex justify-content-between align-items-center">
                            <h5>Platform Charge</h5>
                            <div>
                                <button data-toggle="modal" data-target="#modelPlatformCharge"  class="btn btn-sm btn-primary">Add platform charge</button>
                            </div>
                        </div>
                            <div class="m-t-30">
                                <div class="table-responsive">
                                    <table class="table table-hover table-bordered">
                                        <thead>
                                            <tr>
                                                <th>Charge(%)</th> 
                                                <th>GST(%)</th>                                                
                                                <th>Date</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php if(!@empty($PlatformCharge)): ?>
                                                <?php $__currentLoopData = $PlatformCharge; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <tr>
                                                        <td><?php echo e($rows->charge); ?></td>  
                                                        <td><?php echo e($rows->gst); ?></td>                                                      
                                                        <td><?php echo e($rows->created_at); ?></td>
                                                    </tr>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>                                                                                        
                                            <?php endif; ?>                                            
                                        </tbody>
                                    </table>                                    
                                </div>
                            </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="col-md-12 col-lg-12">                        
                        <div class="d-flex justify-content-between align-items-center">
                            <h5>Ip Address Setting</h5>
                            <div>
                                <button data-toggle="modal" data-target="#modelIp"  class="btn btn-sm btn-primary">Add IP</button>
                            </div>
                        </div>
                            <div class="m-t-30">
                                <div class="table-responsive">
                                    <table class="table table-hover table-bordered">
                                        <thead>
                                            <tr>                                                
                                                <th>Ip Address</th>                                                
                                                <th>Date</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php if(!@empty($userIps)): ?>
                                                <?php $__currentLoopData = $userIps; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <tr>
                                                        <td><?php echo e($rows->ipAddress); ?></td>                                                        
                                                        <td><?php echo e($rows->created_at); ?></td>
                                                    </tr>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>                                                                                        
                                            <?php endif; ?>                                           
                                        </tbody>
                                    </table>                                    
                                </div>
                            </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="col-md-12 col-lg-12">                        
                        <div class="d-flex justify-content-between align-items-center">
                            <h5>Bank Account</h5>
                            <div>
                               
                            </div>
                        </div>
                            <div class="m-t-30">
                                <div class="table-responsive">
                                    <table class="table table-hover table-bordered">
                                        <thead>
                                            <tr>                                                
                                            <th>Date</th>                                                        
                                            <th>Name</th>
                                            <th>Account Number</th>
                                            <th>IFSC</th>
                                            <th>Pancard</th>
                                            <th>Aadhaar</th>
                                            <th>Aadhaar</th>
                                            <th>Cheque</th>
                                            <th>Status</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        <?php if(!empty($BankAccount)): ?>

                                            <?php $__currentLoopData = $BankAccount; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                            <tr>

                                                <td><?php echo e($rows->created_at); ?></td>                                                                                                                                                                                
                                                <td><?php echo e($rows->beneName); ?></td>
                                                <td><?php echo e($rows->beneAccount); ?></td>     
                                                <td><?php echo e($rows->beneIfsc); ?></td>  
                                                <td>
                                                <a href="<?php echo e(asset('public/uploads/')); ?>/<?php echo e($rows->pancard); ?>" target="_blank">
                                                    <img src="<?php echo e(asset('public/uploads/')); ?>/<?php echo e($rows->pancard); ?>" alt="" style="height: 100px;width: 80px;" >
                                                </a>
                                                </td>  
                                                <td>
                                                <a href="<?php echo e(asset('public/uploads/')); ?>/<?php echo e($rows->addhaarFront); ?>" target="_blank">
                                                    <img src="<?php echo e(asset('public/uploads/')); ?>/<?php echo e($rows->addhaarFront); ?>" alt="" style="height: 100px;width: 80px;">
                                                </a>
                                                </td>  
                                                <td>
                                                <a href="<?php echo e(asset('public/uploads/')); ?>/<?php echo e($rows->addhaarBank); ?>" target="_blank">
                                                    <img src="<?php echo e(asset('public/uploads/')); ?>/<?php echo e($rows->addhaarBank); ?>" alt="" style="height: 100px;width: 80px;">
                                                </a>
                                                </td>  
                                                <td>
                                                <a href="<?php echo e(asset('public/uploads/')); ?>/<?php echo e($rows->cancelCheque); ?>" target="_blank">
                                                    <img src="<?php echo e(asset('public/uploads/')); ?>/<?php echo e($rows->cancelCheque); ?>" alt="" style="height: 100px;width: 80px;">
                                                </a>
                                                </td>                                                          
                                                <td>
                                                    <?php if($rows->status == 1): ?>
                                                        <button class="btn btn-sm btn-success">
                                                            Approved
                                                        </button>
                                                    <?php else: ?>
                                                        <button class="btn btn-sm btn-danger" onClick="approveBank(<?php echo e($rows->id); ?>)">
                                                        PENDING
                                                        </button>
                                                    <?php endif; ?>

                                                </td>                                           

                                            </tr>

                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                            <?php endif; ?>                                      
                                        </tbody>
                                    </table>                                    
                                </div>
                            </div>
                    </div>
                </div>
            </div>
        </div>


    </div>
</div>

 <!-- model charge-->
 <div class="modal fade" id="modelCharge">
    <div class="modal-dialog modal-dialog-scrollable">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalScrollableTitle">Add User Charge</h5>
                <button type="button" class="close" data-dismiss="modal">
                    <i class="anticon anticon-close"></i>
                </button>
            </div>
            <div class="modal-body">
                <form action="<?php echo e(url('admin/save-user-charge')); ?>" method="POST">
                    <?php echo csrf_field(); ?>
                    <div class="form-row">
                        <div class="form-group col-md-6">
                            <label for="inputEmail4">Amount Start</label>
                            <input type="text" class="form-control" name="start_amount" placeholder="Amount Start">
                        </div>
                        <div class="form-group col-md-6">
                            <label for="inputPassword4">Amount End</label>
                            <input type="text" class="form-control" name="end_amount" placeholder="Amount End">
                        </div>
                   
                        <div class="form-group col-md-6">
                            <label for="inputAddress">Payin Charge</label>
                            <input type="text" class="form-control" name="payin_charge" placeholder="Payin Charge">
                        </div>
                        <div class="form-group col-md-6">
                            <label for="inputAddress2">Payin Charge Type</label>
                            <select class="form-control" name="payin_charge_type">
                                <option value="P">Percent(%)</option>
                                <option value="F">Flat</option>
                            </select>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="inputAddress">payout Charge</label>
                            <input type="text" class="form-control" name="payout_charge" placeholder="payout Charge">
                        </div>
                        <div class="form-group col-md-6">
                            <label for="inputAddress2">payout Charge Type</label>
                            <select class="form-control" name="payout_charge_type">
                                <option value="P">Percent(%)</option>
                                <option value="F">Flat</option>
                            </select>
                        </div>
                        <input type="hidden" name="userid" value="<?php echo e($userId); ?>"/>
                    </div>                                    
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Save Charge</button>
                </div>
            </form>
        </div>
    </div>
</div>

 <!-- model charge-->
 <div class="modal fade" id="modelRechargeCommission">
    <div class="modal-dialog modal-dialog-scrollable modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalScrollableTitle">Add Recharge Commission</h5>
                <button type="button" class="close" data-dismiss="modal">
                    <i class="anticon anticon-close"></i>
                </button>
            </div>
            <div class="modal-body">
                <form action="<?php echo e(url('admin/save-user-comm')); ?>" method="POST">
                    <?php echo csrf_field(); ?>
                    <div class="form-row">
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="operator[]" value="Airtel" readonly>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="comm[]" placeholder="commission">
                        </div>
                        <input type="hidden" class="form-control" name="operatorcode[]" placeholder="A">
                        <div class="form-group col-md-4">
                            <select class="form-control" name="commtype[]">
                                <option value="P">Percent(%)</option>
                                <option value="F">Flat</option>
                            </select>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="operator[]" value="BSNL-TOPUP" readonly>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="comm[]" placeholder="commission">
                        </div>
                        <input type="hidden" class="form-control" name="operatorcode[]" placeholder="BT">
                        <div class="form-group col-md-4">
                            <select class="form-control" name="commtype[]">
                                <option value="P">Percent(%)</option>
                                <option value="F">Flat</option>
                            </select>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="operator[]" value="BSNL-STV" readonly>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="comm[]" placeholder="commission">
                        </div>
                        <input type="hidden" class="form-control" name="operatorcode[]" placeholder="BR">
                        <div class="form-group col-md-4">
                            <select class="form-control" name="commtype[]">
                                <option value="P">Percent(%)</option>
                                <option value="F">Flat</option>
                            </select>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="operator[]" value="JIO" readonly>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="comm[]" placeholder="commission">
                        </div>
                        <input type="hidden" class="form-control" name="operatorcode[]" placeholder="RC">
                        <div class="form-group col-md-4">
                            <select class="form-control" name="commtype[]">
                                <option value="P">Percent(%)</option>
                                <option value="F">Flat</option>
                            </select>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="operator[]" value="Vodafone Idea (VI)" readonly>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="comm[]" placeholder="commission">
                        </div>
                        <input type="hidden" class="form-control" name="operatorcode[]" placeholder="V">
                        <div class="form-group col-md-4">
                            <select class="form-control" name="commtype[]">
                                <option value="P">Percent(%)</option>
                                <option value="F">Flat</option>
                            </select>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="operator[]" value="Airtel Digital DTH TV" readonly>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="comm[]" placeholder="commission">
                        </div>
                        <input type="hidden" class="form-control" name="operatorcode[]" placeholder="ATV">
                        <div class="form-group col-md-4">
                            <select class="form-control" name="commtype[]">
                                <option value="P">Percent(%)</option>
                                <option value="F">Flat</option>
                            </select>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="operator[]" value="DISH TV" readonly>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="comm[]" placeholder="commission">
                        </div>
                        <input type="hidden" class="form-control" name="operatorcode[]" placeholder="DTV">
                        <div class="form-group col-md-4">
                            <select class="form-control" name="commtype[]">
                                <option value="P">Percent(%)</option>
                                <option value="F">Flat</option>
                            </select>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="operator[]" value="SUNDIRECT DTH TV" readonly>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="comm[]" placeholder="commission">
                        </div>
                        <input type="hidden" class="form-control" name="operatorcode[]" placeholder="STV">
                        <div class="form-group col-md-4">
                            <select class="form-control" name="commtype[]">
                                <option value="P">Percent(%)</option>
                                <option value="F">Flat</option>
                            </select>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="operator[]" value="TATA PLAY DTH TV" readonly>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="comm[]" placeholder="commission">
                        </div>
                        <input type="hidden" class="form-control" name="operatorcode[]" placeholder="TTV">
                        <div class="form-group col-md-4">
                            <select class="form-control" name="commtype[]">
                                <option value="P">Percent(%)</option>
                                <option value="F">Flat</option>
                            </select>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="operator[]" value="VIDEOCON DTH TV" readonly>
                        </div>
                        <div class="form-group col-md-4">
                            <input type="text" class="form-control" name="comm[]" placeholder="commission">
                        </div>
                        <input type="hidden" class="form-control" name="operatorcode[]" placeholder="VTV">
                        <div class="form-group col-md-4">
                            <select class="form-control" name="commtype[]">
                                <option value="P">Percent(%)</option>
                                <option value="F">Flat</option>
                            </select>
                        </div>
                        <input type="hidden" name="userid" value="<?php echo e($userId); ?>"/>
                    </div>                                    
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Save Charge</button>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- model Ip-->
<div class="modal fade" id="modelIp">
    <div class="modal-dialog modal-dialog-scrollable">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalScrollableTitle">Add IP Address</h5>
                <button type="button" class="close" data-dismiss="modal">
                    <i class="anticon anticon-close"></i>
                </button>
            </div>
                <div class="modal-body">
                <form action="<?php echo e(url('admin/save-user-ip')); ?>" method="POST">
                <?php echo csrf_field(); ?>
                <div class="form-group">
                    <label for="inputAddress">IP Address</label>
                    <input type="text" class="form-control" name="ipaddress" placeholder="IP Address">
                </div>
                <div class="form-group">
                    <label for="inputAddress">MPIN</label>
                    <input type="text" class="form-control" name="mpin" placeholder="M-PIN" required>
                </div> 
                <input type="hidden" name="userid" value="<?php echo e($userId); ?>"/>
                    
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Save Ip</button>
                </div>
            </form>
        </div>
    </div>
</div>


<!-- model Ip-->
<div class="modal fade" id="modelPlatformCharge">
    <div class="modal-dialog modal-dialog-scrollable">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalScrollableTitle">Add Platform Charge</h5>
                <button type="button" class="close" data-dismiss="modal">
                    <i class="anticon anticon-close"></i>
                </button>
            </div>
                <div class="modal-body">
                <form action="<?php echo e(url('admin/save-user-platform-charge')); ?>" method="POST">
                <?php echo csrf_field(); ?>
                <div class="form-group">
                    <label for="inputAddress">Platform Charge (%)</label>
                    <input type="text" class="form-control" name="platform_charge" placeholder="Platform Charge" required>
                </div>
                <div class="form-group">
                    <label for="inputAddress">Gst (%)</label>
                    <input type="text" class="form-control" name="gst" placeholder="Gst" value="18" required>
                </div>
                <input type="hidden" name="userid" value="<?php echo e($userId); ?>"/>
                    
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Save</button>
                </div>
            </form>
        </div>
    </div>
</div>

<script>    



    function approveBank(id){

        var csrfToken = $('meta[name="csrf-token"]').attr('content');
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': csrfToken
            }
        });
        var url = '<?php echo e(url('/admin/update-users-bank')); ?>';
        $.ajax({
            type: 'POST',
            url: url,
            data: {
                'id':id,
            },
            success: function (response) {
               alert(response);
               location.reload();
            }
        });
    }
</script>


<?php echo $__env->make('admin/footer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/resources/views/admin/manage-user-charge.blade.php ENDPATH**/ ?>