<script>
window.print();
window.onfocus=function(){ window.close();}
</script>
<?php
$aryPgAct=array("page_id"=>$pgMod,"action"=>"add");
$aryList=$db->getRows("SELECT * FROM transaction where school_id='".$_SESSION["admin"]["school_id"]."' and type='withdraw' and status=1 and amount!=0 and session='".$_SESSION["admin"]["session"]."'"); $i=0;$total=0;
if(is_array($aryList) && count($aryList)>0)
{
	?>

	<table class="table" >
		<thead>
			<tr>
				<th>Idno</th>
				<th>Expance detail</th>
				<th>Expance date</th>
				<th>Expance amount</th>
                <th>Payment for</th>
			</tr>
		</thead>
		<tbody>
		<?php foreach($aryList as $clist){ $i++; 
		$aryPgAct["id"]=$clist['id'];
		?>
			<tr class="grade<?php if($i%2==0)echo "C";else "U";?>">
				<td><?php echo $clist["rid"] ?></td>
				<td><?php echo $clist["detail"] ?></td>
				<td><?php echo $clist["udate"] ?></td>
				<td><?php echo $clist["amount"];$total+=$clist["amount"]; ?></td>
                <td><?php echo $clist["tfor"] ?></td>
			</tr>
		<?php } ?>
		</tbody>
		<tfoot>
			<tr>
				<th></th>
				<th></th>
				<th>Total</th>
                <th><?php echo $total; ?></th>
                <th></th>
			</tr>
		</tfoot>
	</table>
	<?php
}
else{
	?>
	<div class="alert alert-info">
	  <a class="close" data-dismiss="alert">×</a>
	  <i class="icon icon-warning-sign"></i> <b>Notice</b> Record not found </i>
	</div>
	<?php
}
?>
