<div class="row">
    <div class="col-sm-12 col-md-12">
        <div class="card">
            <div class="card-header">
                <div class="d-flex justify-content-between align-items-center">
                    <div>
                        <h6 class="fs-17 font-weight-600 mb-0"><?php echo (!empty($title)?esc($title):null) ?></h6>
                    </div>
                    <div class="text-right">
                        
                    </div>
                </div>
            </div>
            <div class="card-body">                
                <?php $sl=1;

                if (!empty($transaction)){ ?>

                
                    <!-- <h3 class="text-center">My Address:- &nbsp; &nbsp; <?php //echo esc($values->to_wallet); ?></h3> -->
                <table class="table table-bordered table-hover" id="example">
                    <thead>
                        <tr> 
                            <th><?php echo display('sl_no') ?></th>
                            <th><?php echo display('user_id') ?></th>
                            <th><?php echo display('source_address'); ?></th>
                            <th><?php echo display('receiver_address'); ?></th>
                            <th><?php echo display('txn_hash'); ?></th>
                            <th><?php echo display('status') ?></th>
                            <th><?php echo display('token') ?></th>
                        </tr>
                    </thead>
                     <tbody>
                    <?php foreach ($transaction as  $values) { ?> 

                        
                        <tr>
                            <td><?php echo esc($sl++); ?></td>       
                            <td><a href="<?php echo base_url("backend/user/user_details/$values->user_id")?>"><?php echo esc($values->user_id); ?></a></td>
                            <?php 
                                if(!empty($values->from_wallet)){
                                  $selltxlength = strlen($values->from_wallet);
                                  $startprint   = $selltxlength-5;
                                
                                }
                            ?>
                            <td><?php echo @empty($values->from_wallet)?'--':('<a href="'.@$values->explorer_url.'address/'.$values->from_wallet.'" target="_blank">'.substr($values->from_wallet,0,5).'..'.substr($values->from_wallet,$startprint,$selltxlength).'</a>');?></td>
                            <?php 
                                if(!empty($values->to_wallet)){
                                  $selltxlength = strlen($values->to_wallet);
                                  $startprint   = $selltxlength-5;
                                
                                }
                            ?>
                            <td>
                                <?php echo @empty($values->to_wallet)|| @$values->to_wallet=='Local'?'--':('<a href="'.@$values->explorer_url.'address/'.$values->to_wallet.'" target="_blank">'.substr($values->to_wallet,0,5).'..'.substr($values->to_wallet,$startprint,$selltxlength).'</a>');?></td>
                            <?php 
                                if(!empty($values->txn_hash)){
                                  $selltxlength = strlen($values->txn_hash);
                                  $startprint   = $selltxlength-5;
                                
                                }
                            ?>
                            <td><a href="<?php echo @$values->explorer_url."tx/".$values->txn_hash?>" target="_blank"><?php echo (esc(@$values->is_blockchain=='0')?'Local':(empty($values->txn_hash)?'--':(esc(@empty($values->txn_hash))?'--':substr($values->txn_hash,0,5)."..".substr($values->txn_hash,$startprint,$selltxlength)))); ?></a></td>
                            <td>
                                <?php if($values->status==0){?>
                                        <i title='<?php echo display('cancel')?>' class='far fa-times-circle mr-2 fs-20 text-danger'></i>
                                    <?php } else if($values->status==1){?>

                                        <i title='<?php echo display('success')?>' class='fas fa-check mr-2 fs-20 text-success'></i>
                                    <?php } else { ?>
                                        <i title='<?php echo display('cancel')?>' class='fas fa-spinner fa-pulse mr-2 fs-20 text-warning'></i>
                                <?php } ?>
                            </td>
                            <td><?php echo esc(@$values->token_amount); ?></td>
                        </tr>
                       
                                            
                    
                     <?php  } ?>
                     <tr>
                            <td colspan="5" class="text-right"><b>Total Coin<?php //echo esc($coin_setup->symbol); ?></b></td>
                            <td><b><?php echo esc($total_token->total); ?></b></td>
                        </tr> 
                    </tbody>
                </table>
                <?php  }else { ?>
                    <center><h3 class="text-danger">No Data Available</h3></center>
                <?php } ?>

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