<?php include('common/header.php'); ?>
  <!-- Main Sidebar Container -->
<?php include('common/sidenav.php'); ?>



  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
  

    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1>Additional Balance History</h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <!--<li class="breadcrumb-item">  <button id="formButton" type="button"  class="btn btn-danger"><i class="fa fa-plus">Add New</i></button></li>
             
              <li class="breadcrumb-item active"><a href="#">Dashboard</a></li>-->
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-12">


            <div class="card">
              <div class="card-header">

                <h3 class="card-title">Lists</h3>
              </div>
        
              <!-- /.card-header -->
              <div class="card-body">
               <table id="example1" class="table table-striped">
                  <thead class="bg bg-danger">
                  <tr>
                    <th>S No</th>
                    <th>Company</th>
                    <th>Balance</th>
                    
                    <th>Date</th>
                    <th>Action</th>
                  </tr>
                  </thead>
                  <tbody>

  <?php
    include('includes/config.php');
      $vendorid = $_GET['id'];
      $no=0;
      $result = mysqli_query($con, "SELECT * FROM `vendorAdditional_balance` as vb  WHERE  vb.vendor_id ='$vendorid' ORDER BY vb.vab_id ASC");
       while($row = mysqli_fetch_assoc($result)) {
       $no++; 
      
          
  ?>
                  <tr>
                      <?php $id = $row['vab_id']; ?>
                    <td><?php echo $no; ?></td>
                  
                    <td><?php echo $row['vendor_id']; ?></td>
                   
                    <td><?php echo $row['add_balance']; ?></td>
                   
                    <td><?php $prdate = $row['balance_date']; 
                      echo date("d/m/Y", strtotime($prdate));  ?></td>
                   
                   
                    <td>
                        <!--<a href="vendoredit.php?id=<?php echo $row['v_id']; ?>">
                  <i class="fas fa-edit"></i>
                          ||-->
                        <a onclick="return confirm('Are you sure <?php echo 'Company:'. $row['vendor_id'];  echo ' Balance:'. $row['add_balance'];  echo ' Date:'. $prdate; ?> ?')"
   href="vendorbaldelete.php?id=<?php echo $id; ?>&vendorid=<?php echo $vendorid; ?>">
    <i style="font-size:15px; color:red;" class="fa fa-trash"></i>
</a>
                        
                    </td>
                    
                  </tr>

                    


    <?php
    }

  
  ?>
 
                  </tbody>
                </table>
                     
                
                
                
                
                
              </div>
              <!-- /.card-body -->
            </div>
            <!-- /.card -->
          </div>
          <!-- /.col -->
        </div>
        <!-- /.row -->
      </div>
      <!-- /.container-fluid -->
    </section>
    <!-- /.content -->



<script>
  //show a confirmation and redirect to the delete profile script
  function deleteProfile() {
    if (confirm("Do you really want to delete your profile?")) {
        //location.href = '/deleteuser.php';
    }
}
</script>


  </div>
  <!-- /.content-wrapper -->


<?php include('common/footer.php'); ?>