<?php $this->load->view('theme/include/header'); ?>

<!--Start Main Content-->
<section>
<div class="main-content">
<div class="row">
<div class="inner-contatier">    
<div class="col-md-12 col-lg-12 col-sm-12 content-title"><h4>Reports</h4></div>
<div class="col-md-12 col-lg-12 col-sm-12">

<?php
$message = $this->session->userdata('success');
if($message){?>
<div class="alert my-alert alert-danger">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Alert! </strong><?php echo $message; ?>
</div>
<?php } ?>



<!--Start Panel-->
<div class="panel panel-default">
    <!-- Default panel contents -->
    <div class="panel-heading">Transfer Report</div>
    <div class="panel-body manage-client">
		<table class="table table-bordered" style="width:100%;" id="report-table">
			<thead>
			    <th>Type</th>
				<th>Code</th>
				<th>Date</th>
				<th>Sender</th>
				<th style="text-align:right">Sending Amount</th>
				<th>Recipent</th>
				<th>Agent</th>
				<th>Status</th>
			</thead>
			<tbody>
			<?php foreach($report_data as $report) {?>
				<tr><td><?php echo ucwords($report->sending_type); ?></td>
					<td><?php echo $report->sending_code; ?></td>
					<td><?php echo $report->sending_date; ?></td>
					<td><?php echo $report->sender_fullname; ?></td>
					<td align="right"><b><?php echo decimalplace($report->sending_amount); ?></b></td>
					<td><?php echo $report->recipent_fullname; ?></td>
					<td><?php echo $report->first_name." ".$report->last_name; ?></td>
					<?php if($report->status=="paid"){ ?>
					<td><span class="label label-success"><?php echo $report->status; ?></span></td>
					<?php }else if($report->status=="sending"){ ?>
					<td><span class="label label-primary"><?php echo $report->status; ?></span></td>
					<?php }else{ ?>
					<td><span class="label label-danger"><?php echo $report->status; ?></span></td>
					<?php } ?>
                   </tr>
			<?php } ?>
			</tbody>
		</table>
    </div>
    <!--End Panel Body-->
</div>
<!--End Panel-->    
    
</div>


</div><!--End Inner container--->
</div><!--End Row-->
</div><!--End Main-content DIV-->
</section><!--End Main-content Section-->

<?php $this->load->view('theme/include/footer'); ?>

<script type="text/javascript">
$(document).ready(function() {

$('#report-table').DataTable( {
    "order": [[2, "desc"]],
	responsive: true,
	"bAutoWidth":false,
	"iDisplayLength": 25,
	dom: 'Bfrtip',
	buttons: [
	'copy', 'csv', 'excel', 'pdf', 'print'
	]
});

document.title = "Transfer Report";

});

</script>
</body>

</html>
