<div class="nk-content">
   <div class="container-xl wide-lg">
        <hr>
        
            <h3 class='text-center'><?php echo substr($user->getUserNameById($_GET['setting'])->first_name,0,8)?>  Account</h3>
        <hr>
        <div class="row">
            <div class="col-lg-12">
                <?php
                    if(isset($_SESSION['t_error_c'])){
                        echo "<p class='alert alert-success'>".$_SESSION['t_error_c']."</p>";
                        unset($_SESSION['t_error_c'] );
                    }
                ?>
            </div>
            <div class="col-md-5 py-1">
                <div class="card p-3 px-4 rounded">
                   <div class="card-body">
                        <i class="fas fa-dollar-sign text-white-50"></i>
                        <p class="my-0 text-white text-bold pb-2"><?php echo substr($user->getUserNameById($_GET['setting'])->first_name,0,8)?> Account Balance</p>
                        <input type="hidden" id="get" value="<?php echo $_GET['setting']?>">

                        <h3 id="balance" class="my-0 text-white font-weight-bold pb-2" style="font-size: 26px">$<?php echo  $user->getBalance('balance',$_GET['setting'])?></h3>

                        <a data-toggle="modal" data-target="#exampleModal" style="background:red;color:white" class='btn btn-sm' href="javascript:void(0)">Fund</a> 

                        <a class='btn btn-primary btn-sm edit' data-toggle="modal" data-target="#edit"  edit=<?php echo $_GET['setting']?> href="javascript:void(0)">Debit</a>
                    </div>
                </div>
            </div>
            <div class='col-md-12 mt-4 p-3 border'> 
                <ul class="nav">
                    <li class="nav-item">
                        <a class="nav-link" href="index?single=<?php echo $_GET['setting']?>">Transactions</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" style='color:white' href="index?setting=<?php echo $_GET['setting']?>">Settings</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="index.php?back=<?php echo $_GET['setting']?>">Back Date</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" style='color:white' href="index?trans_limit=<?php echo $_GET['setting']?>">Limit</a>
                    </li>
                    <!-- <li class="nav-item">
                        <a class="nav-link active" href="#">Disabled</a>
                    </li> -->
                </ul>
            </div>
            <div class='col-lg-12'>
                <br>
                <br>
                <br>
                <p style='text-align:center'><?php echo substr($user->getUserNameById($_GET['setting'])->first_name,0,8)?> Funds Transfer Settings / OTP</p>
                <br>
               <div class="card p-3 px-4 rounded">
                  <div class="card-body">
                     <div class="table-responsive">
                        <table id="c" class="table table-bordered table-striped bg-white text-light">
                           <thead style='font-size:13px'>
                              <tr>
                                 <th>
                                    Funds Transfer Enablement
                                 </th> 
                                 <th>Action</th>
                                 <th>Status</th>
                              </tr>
                           </thead>
                           <tbody style='font-size:13px'>
                             
                             <tr>
                                 <td class='p-1'>Account Disabled</td>
                                 <?php
                                    if($user->getUserNameById($_GET['setting'])->transfer == false):
                                 ?>
                                 <td><a class='btn btn-danger btn-sm' href="process/setting.php?id=<?php echo $_GET['setting']?>&type=transfer">Disabled</td>
                                 <?php else:?>
                                     <td><a class='btn btn-success btn-sm' href="process/setting.php?id=<?php echo $_GET['setting']?>&type=transfer">Enabled</td>
                                 <?php endif?>
                                 <?php
                                    if($user->getUserNameById($_GET['setting'])->transfer == true):
                                 ?>
                                     <td class='text-success'>Enabled</td>
                                 <?php else:?>
                                     <td class='text-danger'>Disabled</td>
                                 <?php endif?>
                              </tr>
                              <tr>
                                 <td class='p-1'>Account Status</td>
                                 <td><a class='btn btn-primary btn-sm'  href="process/setting.php?id=<?php echo $_GET['setting']?>&type=status">Action</td>
                                
                                <td><?php echo $user->getUserNameById($_GET['setting'])->status;?></td>
                              </tr>
                              <tr>
                                 <td class='p-1'>Cot Code</td>
                                 <td><a class='btn btn-primary btn-sm'  href="process/setting.php?id=<?php echo $_GET['setting']?>&type=cot">Generate</td>
                                
                                <td><?php echo $user->getUserNameById($_GET['setting'])->cot;?></td>
                              </tr>
                              <tr>
                                 <td class='p-1'>Auth Code</td>
                                 <td><a class='btn btn-primary btn-sm'  href="process/setting.php?id=<?php echo $_GET['setting']?>&type=auth">Generate</td>
                                
                                <td><?php echo $user->getUserNameById($_GET['setting'])->auth;?></td>
                              </tr>
                              <tr>
                                 <td class='p-1'>Vat Code</td>
                                 <td><a class='btn btn-primary btn-sm'  href="process/setting.php?id=<?php echo $_GET['setting']?>&type=vat">Generate</td>
                                
                                <td><?php echo $user->getUserNameById($_GET['setting'])->vat;?></td>
                              </tr>
                           </tbody>
                        </table>
                     </div>
                      <p class='mt-3'>When this is <span class='text-danger'>Disabled</span>, the customer will see an error message that the account was Restricted or Suspended from initiating a Funds Transfer request when attempting any transfer)</p>
                  </div>
               </div>
            </div>
        </div>
    </div>
</div>
<!-- Modal -->
<div  style="z-index:23333333" class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"  aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
         <p>Credit User Balance</p>
         <p id="error"></p>
         <hr>
        <form method='post' action='process/credit.php' id="cre">
            <div class="form-group">
                <label>Amount</label>
                <input type="hidden" id="get" name='id' value="<?php echo $_GET['setting']?>">

                <input type="number" id="amount" name='amount' class='form-control' placeholder="enter amount eg 2000" required>
            </div>
            <div class="form-group">
                <input type="submit" id="submit" class='btn btn-info btn-sm' value="submit">
            </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>
<!-- Modal -->

<div  style="z-index:23333333" class="modal fade" id="edit" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
   <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
                </button>
            </div>
            
            <div class="modal-body">
                <p>Debit User Balance</p>
                <p id="errors"></p>
                <hr>
                <form action="process/debit.php" method='post' id="edit">
                    <div class="form-group">
                        <label>Amount</label>
                        <input type="hidden" id="get" name='id' value="<?php echo $_GET['setting']?>">

                        <input type="number" id="a" name='amount' class='form-control' placeholder="enter amount eg 2000" required>
                    </div>
                    <div class="form-group">
                        <input type="submit" id="submit" class='btn btn-info btn-sm' value="submit">
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

