<? global $vis_language; ?>
<? if($time_tracking != -1): ?>
<div class="table-responsive scroll-x">		
<table class="table table-hover b-t b-light m-b-none" data-ride="datatables">
<thead class="table_head">
	<tr>
		<th class="txt_nowrap"><? echo $vis_language['TXTDESCRIPTION']; ?></th>
		<th class="txt_nowrap"><? echo $vis_language['TXTBILLTIME']; ?></th>
		<th class="txt_nowrap"><? echo $vis_language['TXTWORKTIME']; ?></th>
		<th class="txt_nowrap"><? echo $vis_language['TXTAMOUNT']; ?></th>
		<th class="txt_nowrap"><? echo $vis_language['TXTSTAFF']; ?></th>
		<th class="txt_nowrap"><? echo $vis_language['TXTCREATEDON']; ?></th>
		<th class="txt_nowrap"><? echo $vis_language['TXTMODIFIEDON']; ?></th>
		
	</tr>
</thead>
<tbody>
<? $total_bill_time = $total_work_time = $total_amount = 00; ?>	
<? for($i=0;$i<count($time_tracking);$i++){ ?>		
		<tr>
			<td><? echo $time_tracking[$i]['description'];?></td>
			<td><? echo $time_tracking[$i]['bill_time'];?></td>
			<td><? echo $time_tracking[$i]['work_time'];?></td>
			<td><? echo $time_tracking[$i]['amount'];?></td>
			<td><? echo $time_tracking[$i]['staff_name'];?></td>
			<td><? echo format_datetime($time_tracking[$i]['created_date']);?></td>
			<td><? echo format_datetime($time_tracking[$i]['modified_date']);?></td>
			
		</tr>
		<? 
			$total_bill_time = $total_bill_time + $time_tracking[$i]['bill_time']; 
			$total_work_time = $total_work_time + $time_tracking[$i]['work_time'];
			$total_amount = $total_amount + $time_tracking[$i]['amount'];
	}	
?>
<tr><td align="center" class="font-bold"><? echo $vis_language['TXTTOTAL']; ?></td><td><?php echo $total_bill_time.' '.$vis_language['TXTMIN']; ?></td><td><?php echo $total_work_time.' '.$vis_language['TXTMIN']; ?></td><td><?php echo number_format($total_amount,2).' '.$currency; ?></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
</tbody>
</table>
</div>
<? else: ?>
<? include(VIS_PATH_TEMPLATE.'no_record_yet.php'); ?>
<? endif; ?>
<script type="text/javascript">
	$(document).ready(function() {	
	$('[data-ride="datatables"]').dataTable({		
		   "bpaginate": false,
			"sDom": 't', "bAutoWidth": false,
			"aoColumns": [
				null,
				null,
				null,
				null,
				null,
				null,
				{ "bSortable": false }
			]
		});
	});
</script>
