<!doctype html>
<html lang="en"  class="w-[640px]">
   <head>
   <?php echo view('user/layout/head');?>
   <link href="https://cdn.datatables.net/2.0.8/css/dataTables.dataTables.css">
   </head>
   <style>
      .dt-paging 
      {
      text-align:center;
      margin-top:15px;
      }
      .dt-paging-button
      {
      font-size:20px;
      color:#fff;
      padding:0px 10px 0px 10px;
      }
      .dt-paging .current
      {
      border : 1px solid #0d6efd !important;
      /* border-radius : 20px !important; */
      background : #0d6efd !important;
      }
      .img
      {
      width : 50px;
      height:50px;
      border:none;
      border-radius:23px;
      }
   </style>
   <body class="section-overflow">
      <!--banner start -->
      <section class="banner-bg overall-bg ">
         <div class="container">
         <?php echo view('user/layout/header');?>
         </div>
         <section class="dash-wrap asset-wrap">
            <div class="container">
               <div class="row">
                  <div class="col-12">
                     <div class="income-sec">
                        <div class="total-income d-flex align-items-center">
                           <div class="ref-content text-start">
                              <h5 class="text-white">
                              <span id="total_count"><?php echo $totalItems;?> </span> Records 
                              </h5>
                           </div>
                          
                        </div>
                       
                     </div>
                     <!---banner end---->
                    
                     <div class="transaction mt-4">
                        <div class="container">
                           <div class="row">
                              <div class=" col-12">
                                 <div class="table-responsive trans asset-trans position-relative mb-5">
                                   
                                    <table class="payment-info"  id="example1" style="width:100%">
                                    <thead style="display:none">
                                      <td></td>
                                     
                                    </thead>
                                       <tbody>
                                       <?php 
                                             if($history)
                                             {
                                             foreach($history as $row)
                                             {
                                             
                                              $date = $row->date;
                                              
                                              if($row->type=='activation')
                                              {
                                                  $symbol="-";
                                              }
                                              else
                                              
                                              {
                                                  $symbol="+";
                                              }
                                             
                                              // print_r($date);
                                              
                                              if($row->type=='fuel' || $row->type=='deducted_gaswallet')
                                              {
                                                  $description_check=str_replace('fuel fee deduction for order no','',$row->description);
                                                  
                                                  $get_order=$this->db->query("select * from api_trade_history where order_id='".trim($description_check)."'")->getRow();
                                                  if($get_order)
                                                  {
                                                      $base=substr($get_order->pair,0,-4);
                                                      $pair=$base.'/USDT';
                                                      $description='Fuel Fee &nbsp;: ['.$pair.'&nbsp;TurnOver &nbsp;:&nbsp;'.$get_order->comm_price.']';
                                                  }
                                                  else
                                                  {
                                                      $description='';
                                                  }
                                              }
                                              else
                                              {
                                                  $description=$row->description;
                                              }
                                             
                                             ?>
                                          <tr>
                                             <td>
                                                <div class="asset-trans-content d-flex align-items-center justify-content-between">
                                                   <div class="asset-trans-left text-start">
                                                      <h6 class="aleo text-white mb-0">Team Bonus</h6>
                                                      <small class="text-primary fs-6 py-2 fw-bold lato"><?php echo $date;?></small>
                                                      <h6 class="fw-medium fs-6 mb-0">Remark</h6>
                                                   </div>
                                                   <div class="asset-trans-right text-end">
                                                      <small class="text-primary lato fw-bold "><?php echo $symbol;?>&nbsp;&nbsp;<?php echo number_format($row->amount,4);?></small>
                                                      <h6 class="text-white fs-6 mt-4"><?php echo $description;?></h6>
                                                   </div>
                                                </div>
                                             </td>
                                          </tr>
                                          <?php } } else {?>
                                          <tr>
                                             <td><img src="<?php echo base_url() ;?>/assets/images/norecord1.svg" alt="No records found"></td>
                                          </tr>
                                          <?php } ?>
                                          
                                       </tbody>
                                    </table>

                                   

                                 </div>
                              </div>
                           </div>
                        </div>
                     </div>

                     
                  

                  </div>
               </div>
            </div>
         </section>
         <!--footer start -->
         <?php echo view('user/layout/footer');?>

         <!--footer end -->
      </section>
   
      <?php echo view('user/layout/footer-script');?>
      <script>
         AOS.init({
         });
      </script>
         <script src="https://cdn.datatables.net/2.0.8/js/dataTables.js"></script>
      <script>
         $(document).ready(function() {
           $('#example1').DataTable({
             pagingType: 'full_numbers',
             searching: false,
             info:false,
             lengthChange: false,
             pageLength : 5
             
             
           });
         });
      </script>
    
   </body>
</html>
