<div class="nk-content">
   <div class="container-xl wide-lg">
        <hr>
        
            <h3 class='text-center'><?php echo substr($user->getUserNameById($_GET['back'])->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['back'])->first_name,0,8)?> Account Balance</p>
                        <input type="hidden" id="get" value="<?php echo $_GET['back']?>">

                        <h3 id="balance" class="my-0 text-white font-weight-bold pb-2" style="font-size: 26px">$<?php echo  $user->getBalance('balance',$_GET['back'])?></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['back']?> 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['back']?>">Transactions</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="index?setting=<?php echo $_GET['back']?>">Settings</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" style='color:white'  href="#">Back date_transaction</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'>Auto Generate Backdated Transactions</p>
                <br>
               <div class="card p-3 px-4 rounded">
                  <form method="post" action="process/back.php?back=<?php echo $_GET['back']?>">
                     <div class="card-body">
                        <table  style='font-size:13px' id='c' align="center" class="table table-bordered table-striped bg-white text-light">
                           <tr>
                              <th>A/C Balance:</th>
                              <td>$<?php echo number_format($user->getBalance('balance',$_GET['back']))?></td>
                           </tr>
                           <tr>
                              <th>Start Date:</th>
                              <td><input type='date' name='start_date' class='form-control'></td>
                           </tr>
                           <tr>
                              <th>End Date:</th>
                              <td><input type='date' name='end_date' class='form-control'></td>
                           </tr>

                           <tr>
                              <th>Type:</th>
                              <td><select name="type" class="form-control" id="">
                                 <option>Credit</option>
                                 <option >Debit</option>
                              </select></td>
                           </tr>
                        </table>
                        <button type='submit' class='btn btn-primary'>submit</button>
                     </div>
                  </form>
               </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['back']?>">

                <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['back']?>">

                        <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>

