<?php $this->include('rs/utils.php')?>
<?= $this->extend('rs/template-user'); ?>
<?= $this->section('content'); ?>

  
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>

  
	  <div class="card shadow mb-4">
		<div class="card-header py-3">
		<h4 class="m-0 font-weight-bold text-primary">Transactions</h4>
		</div>
		<div class="card-body">
			<div class="filters-menu" style="display:none">
				<form action="" method="post" accept-charset="utf-8">
						<button  id="btnFilter" type='submit' class="btn btn-primary btn-sm" value="Apply filter">Apply filter</button>
				</form>
			</div>
			
			
			
		
			<div class="table-responsive">
				
				<table class="table table-sm  small" id="dataTableLarge"  "paging"="false" width="99%" cellspacing="0">
					<thead>
						<tr>
							<th class="priority-2">Code</th>
							<th>Date created</th>
							<th>Status</th>
							<th>Seller</th>
							<th>Buyer</th>
							<th>Edit</th>
							
						</tr>
					</thead>
					
					<tbody>
						<?php
						if(isset($transactions)){ 
							$i=0;
							$sta="In process";
							foreach ($transactions as $items): 
								
						?>
						
						<tr>
							<td class="priority-2"><?php echo formatCode($items['trans_code']); ?></td>
							<td><?php echo $items['created_at']; ?></td>
							<td><?php echo $items['step_name']; ?></td>  	
							<td><?php echo $items['buyer']; ?></td>  	
							<td><?php echo $items['seller']; ?></td>  	
							<td><a href="<?php echo site_url('transactions/detail/'.$items['trans_code']);?>"  title="Details" class="btn btn-outline-success btn-sm"><i class="fas fa-fw fa-edit"></i></a></td>
							
							
						</tr>
						<?php $i++ ?>
							
					<?php endforeach; ?>
					<?php }?>
					
					</tbody>
				</table>
			</div>
		</div>
	</div>

			
		

<?= $this->endsection(); ?>