  <style type="text/css">
  .frame{
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  height: 100px;
  width: 350px;
  position: relative;
  box-shadow:
  7px 2px 20px 0px #0d6efd, -5px -2px 18px 0px #0d6efd, 7px 7px 20px 0px #0002, 4px 4px 5px 0px #0001, inset 0px 0px 0px 0px #fff9, inset 0px 0px 0px 0px #0001, inset 0px 0px 0px 0px #fff9, inset 0px 0px 0px 0px #0001;
  transition: box-shadow 0.6s cubic-bezier(.79,.21,.06,.81);
  border-radius: 10px;
  }
    .boxs
    {
    padding: 10px;
    text-align: center;
    box-shadow: 0px 0px 10px gray;
    }
    .boxs .bi
    {
    font-size: 23px;
    }
    .span
    {
    font-size: 12px;
    color: #9395a1;
    margin-top: 14px;
    font-weight: 900;
    }
    .boxs:hover
    {
    background: #f7c154;
    }
    .cls
    {
        font-size: 41px;width:100%;
        border:none;
    }
    
    @media only screen and (max-width: 600px) {
  .cls {
    width:100%;
    font-size:18px;
  }
}
    
  </style>

  <?php 
 use App\Helpers\site_helper;
$validation =  \Config\Services::validation();
$session = session();
$this->db = db_connect();
$uusersid =$session->get('uusersid');
$referral1=$this->db->query("SELECT * FROM bind_process WHERE uusersid='".$uusersid."'");
$ref=$referral1->getRow();

if(empty($ref))
{
 $key = "tJuR6dN9AZp9KiAn41avxq64KsyDxa8FIaRjxTf0k1qplZIv1MRnHrS3zQIqHuzZ";
 $secret = "GlRLQS2VGYfa1sOUaS3NIgGmszJOAuxu7Xk0anY1r4ifRmGYVYxoG25LOBnESE67";

}
else
{
 $key = $ref->api_key;
 $secret = $ref->secret_key;
    
}
$total_asset=0;
$api = new Binance\API($key,$secret);
$ticker='';
$balances = $api->balances($ticker);     
if($balances)
  $total_asset = $balances['USDT']['available'];
else
  $total_asset='0';

$session->set('usdt_balance_'.$uusersid,$total_asset);

$buy_bal=curbalance($uusersid);
$profit=curprofit($uusersid);
$bal=str_replace(",","", $buy_bal);


?>

 
  <div class="row">
  <div class="col-lg-12">
  <div class="pairlist-bg bg-primary mt-3">
  <div class="d-mg-flex justify-content-between">
  <div class="row">
  <div class="col-lg-4">
  <div class="pairlist-con">
  <h4 class="text-white mont"><span>Binance assets converted(USDT):</span><?php echo " ".number_format($total_asset,8); ?></h4>
  </div>
  </div>
  <div class="col-lg-4">
    <div class="pairlist-con">
  <h4 class="text-white mont"><span>Total Profit Converted(USDT):</span><?php echo " ".number_format($profit,8); ?></h4>
  </div>
</div>

<div class="col-lg-4">
    <div class="pairlist-con">
  <h4 class="text-white mont"><span>Total asset Balance(USDT):</span><?php echo " ".number_format($bal,8); ?></h4>
  <!-- <a href="" data-bs-toggle="modal" data-bs-target="#BatchModel" data-bs-whatever="@fat" class="btn btn-outline-primary" >Batch setting</a> -->
  </div>
</div>

<!--   <div class="col-lg-4" style="margin-top: 10px;float: left;">
  <div class ="frame" style="float: right;">
  <h4 class="text-white mont"><span style="font-size: 15px; font-weight: 600;">Total Profit converted( USDT ) : <?php echo number_format($balance,2);?></span></h4>
  </div>
  </div>
<?php
$fuel_amount = (($fuel_amount1->amt) - ($fuel_amount2->amt));
?>
<div class="col-lg-4" style="margin-top: 10px;float: left;">
<div class ="frame" style="float: right;">
  <h4 class="text-white mont"><span style="font-size: 15px; font-weight: 600;">Total Fuel converted( USDT ) : <?php echo number_format($fuel_amount,2);?></span></h4></div>
</div> -->

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



<div class="modal fade" id="BatchModel" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Batch settings</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">

<div class="row">

<div class="form-group has-feedback " style="display:block;">
<h6 class="span">Trading Pair</h6>

<div id="bg_color" class="col-lg-4">
<select id="userlist" class="form-select" name="active_list"  style="width:100%;" placeholder="To select users">

<option value="" required>--select--</option>
<?php
$uusersid= $session->get('uusersid');
$this->db = db_connect();
$get_active = $this->db->query("SELECT * from trade_process where  trade_status='0' or trade_status='1' and uusersid='".$uusersid."' ")->getResult();
foreach ($get_active as $keys) 
{
?>

<option value="<?php echo $keys->pair;?>"> <?php echo $keys->pair;?></option>

<?php
}
?>

</select>
</div>
</div>
</div> 
<br>
<br>
<span class="get_active"></span>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</div>





<script type="text/javascript">


$(document).ready(function(){

      var pairs = "";
      $.ajax({
      'method': 'POST',
      'url': '<?php echo base_url("/getPairDetails");?>',
      data:{'pair':pairs},
      success:function(msg)
      {
      if(msg!='')
      {
      $('.get_active').html(msg);   
      }
      else
      {
      }
      }
      });


$('#userlist').on('change',function(){
  
  var pair = $('#userlist').find(":selected").val();
  if(pair)
  {

    $.ajax({
    'method': 'POST',
    'url': '<?php echo base_url("/getPairDetails");?>',
     data:{'pair':pair},
    success:function(msg)
    {
    if(msg!='')
    {
     $('.get_active').html(msg);   
    }
    else
    {
    }
    }
    })


  }
  else
  {

      var pairs = "";
      $.ajax({
      'method': 'POST',
      'url': '<?php echo base_url("/getPairDetails");?>',
      data:{'pair':pairs},
      success:function(msg)
      {
      if(msg!='')
      {
      $('.get_active').html(msg);   
      }
      else
      {
      }
      }
      })
  }
});
});
</script>