<?php 
include("../../db.php");


 $_SESSION["admin"]["session"]=$_REQUEST['session'];
 $_SESSION["admin"]["school_id"]= $_REQUEST['school_id'];




$between="";
if(isset($_GET["tfrom"]) && isset($_GET["tto"])){
$between=" and udate between '".$_GET["tfrom"]."' and '".$_GET["tto"]."' ";

   $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"]."' $between"); 

//echo $db->getlastQuery()."<br />".$db->getErMsg();
$i=0;$total=0;
if(is_array($aryList) && count($aryList)>0)
{
	
			$tndate = date('Y/m/d', strtotime('-1 days',strtotime($_GET["tto"])));
			//echo $tndate." ".$fdate
			?>
            <center><h5><p style="float:right">Expense Date: 
			<?php if(strtotime($tndate)==strtotime($_GET["tfrom"])){echo date("d-M-Y",strtotime($tndate));?> - <?php echo date("l",strtotime($tndate));}
			else echo date("d-M-Y",strtotime($_GET["tfrom"])) ." to ".date("d-M-Y",strtotime($tndate)); ?></p> <p>Expense Detail</p>	</h5></center>

	<table class="table" >
		<thead>
			<tr>
				<th width="10%">Serial No</th>
				<!--<th width="10%">Receipt No</th>-->
                <th width="20%">Expance date</th>
				<th width="50%">Expense detail</th>
				
				<th width="10%">Expense amount</th>
                <th width="10%">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 $i; ?></td>
				<!--<td><?php echo  $clist["exp_id"]; ?></td>-->
                <td><?php echo date("d-M-Y",strtotime($clist["udate"])); ?></td>
				<td><?php echo $clist["detail"] ?></td>
				
				<td><?php echo $clist["amount"];$total+=$clist["amount"]; ?></td>
                <td><?php echo $clist["tfor"] ?></td>
			</tr>
		<?php } ?>
		</tbody>
		<tfoot>
			<tr>
				<td></td>
				<td style="color:red">Total</th>
                <td></td>
                <td></td>
                <td style="color:red" id="completeFeeShw"><?php echo $total; ?></th>
                <td></td>
			</tr>
		</tfoot>
	</table>  Print Date : <?php echo date('d-M-Y'); ?>
	<?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
}
}
?>
</div>
	<style>.top-bar-minimize{display:none;}
thead, tfoot {display: table-header-group;}
.top-bar+.well,.accordion .accordion-heading+.accordion-body{display: inline-block !important;width: 100% !important;overflow: inherit !important;} 
.dynamic{display:none}
table td {
padding: 6px !important;
}
legend{line-height: 16px;font-weight:100;}



 .gmaps{margin:0;padding:0;height:400px;border-radius:0 0 5px 5px;overflow:hidden;box-sizing:content-box}
 .gmaps>div>div:nth-child(3),.gmaps>div>div:nth-child(2){display:none}
 .gmaps img{max-width:none}
 .gmaps.map-small{height:200px}
 table.dataTable td,table.dataTable th{padding:12px 0;line-height:24px}
 .table-bordered.table{background-color:#eee;border:1px solid #c2c2c2;box-shadow:0 1px 0 white}
 .table-bordered.table tbody>tr:nth-child(odd)>td,.table-bordered.table .table tbody>tr:nth-child(odd)>td,.table-bordered.table .data-table tbody>tr:nth-child(odd)>td,.table-bordered.table .table-striped tbody>tr:nth-child(odd)>th,.table-bordered.table .table tbody>tr:nth-child(odd)>th,.table-bordered.table .data-table tbody>tr:nth-child(odd)>th,.table-bordered.table tbody tr,.table-bordered.table tbody td,.table-bordered.table th,.table-bordered.table td{border:0;box-shadow:none}
 .table-bordered.table tbody>tr:nth-child(odd)>td,.table-bordered.table .table tbody>tr:nth-child(odd)>td,.table-bordered.table .data-table tbody>tr:nth-child(odd)>td,.table-bordered.table .table-striped tbody>tr:nth-child(odd)>th,.table-bordered.table .table tbody>tr:nth-child(odd)>th,.table-bordered.table .data-table tbody>tr:nth-child(odd)>th,.table-bordered.table tbody tr,.table-bordered.table tbody td,.table-bordered.table th,.table-bordered.table td{border-bottom:1px solid #c2c2c2;border-top:1px solid white}
 .table-bordered.table tbody tr:last-child td{border-bottom:0}
 table.dataTable{margin:0 auto;clear:both;width:100%}
 table.dataTable thead th{cursor:pointer;*cursor:hand}
 table.dataTable thead tr{background:#3B5999}
 .table thead{background:crimson;color:#fff;}
 table.dataTable tfoot th,table.dataTable thead th,table.dataTable thead td{font-weight:bold;background-image:-moz-linear-gradient(bottom,rgba(0,0,0,0.05) 0,rgba(255,255,255,0.05) 100%);background-image:-o-linear-gradient(bottom,rgba(0,0,0,0.05) 0,rgba(255,255,255,0.05) 100%);background-image:-webkit-linear-gradient(bottom,rgba(0,0,0,0.05) 0,rgba(255,255,255,0.05) 100%);background-image:linear-gradient(bottom,rgba(0,0,0,0.05) 0,rgba(255,255,255,0.05) 100%);color:#fff;border-bottom:1px solid #c2c2c2;-webkit-box-shadow:0 2px 0 #fff;-moz-box-shadow:0 2px 0 #fff;box-shadow:0 2px 0 #fff}
 table.dataTable tfoot th:first-child,table.dataTable thead th:first-child{padding-left:20px}
 table.dataTable thead th{border-top:1px solid #c2c2c2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.7),0 2px 0 white;-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.7),0 2px 0 white;box-shadow:inset 0 1px 0 rgba(255,255,255,0.7),0 2px 0 white}
 table.dataTable td.center,table.dataTable td.dataTables_empty{text-align:center}
 .dataTables_length select{max-width:50px}
 .dataTables_wrapper{position:relative;clear:both;*zoom:1}
 th.center{text-align:center}

 .dataTables_processing{position:absolute;top:50%;left:50%;width:250px;height:30px;margin-left:-125px;margin-top:-15px;padding:14px 0 2px 0;border:1px solid #ddd;text-align:center;color:#999;background-color:white}
 table.dataTable thead th:active,table.dataTable thead td:active{outline:0}
 .dataTables_scroll{clear:both}
 .dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}
 .gallery{padding:24px}
 .gallery .element{display:inline-block;padding:0 1.5% 3% 1.5%;position:relative;text-align:center;width:16%}
 .gallery .element .img-polaroid{padding:5%;border-radius:5px;border:0;background-color:#fcfcfc;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,1),0 2px 4px rgba(0,0,0,0.08),inset 0 -1px 0 rgba(0,0,0,0.25);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,1),0 2px 4px rgba(0,0,0,0.08),inset 0 -1px 0 rgba(0,0,0,0.25);box-shadow:inset 0 1px 0 rgba(255,255,255,1),0 2px 4px rgba(0,0,0,0.08),inset 0 -1px 0 rgba(0,0,0,0.25)}
 .gallery .element a .icon-eye-open,.gallery .element a .icon-eye-open:hover{position:absolute;z-index:1006;color:white;text-shadow:0 -1px 0 rgba(0,0,0,0.3);vertical-align:center;background-color:rgba(0,0,0,0.7);border-radius:200em;left:50%;top:44%;margin-left:-26px;margin-top:-25px;width:52px;height:50px;padding:.70em .5em;box-sizing:border-box}
 .img-polaroid{padding:10px;box-sizing:border-box}
 .gallery img{zoom:1;filter:alpha(opacity=75);opacity:.75}
 .gallery img:hover{filter:alpha(opacity=100);opacity:1}
 
 .table,.data-table{margin-bottom:0}
 .table-striped,.table,.data-table{color:blue;font-weight:bolder;width:100%}
 .table-striped th,.table th,.data-table th,.table-striped td,.table td,.data-table td{padding:8px;text-align:left;vertical-align:top}
 .table-striped th,.table th,.data-table th{font-weight:bold}
 .table-striped thead th,.table thead th,.data-table thead th{vertical-align:bottom}
 .table-striped thead th:first-child,.table thead th:first-child,.data-table thead th:first-child{padding-left:20px}
 .table-striped thead th:last-child,.table thead th:last-child,.data-table thead th:last-child{padding-right:20px}
 .table-striped tbody i,.table tbody i,.data-table tbody i{color:#cacaca}
 .table-striped tbody td:first-child,.table tbody td:first-child,.data-table tbody td:first-child{padding-left:20px}
 .table-striped tbody td:last-child,.table tbody td:last-child,.data-table tbody td:last-child{padding-right:20px}
 .table-striped tbody td,.table tbody td,.data-table tbody td,.table-striped tbody th,.table tbody th,.data-table tbody th{background-image:-moz-linear-gradient(bottom,rgba(0,0,0,0.01) 0,rgba(255,255,255,0.01) 100%);background-image:-o-linear-gradient(bottom,rgba(0,0,0,0.01) 0,rgba(255,255,255,0.01) 100%);background-image:-webkit-linear-gradient(bottom,rgba(0,0,0,0.01) 0,rgba(255,255,255,0.01) 100%);background-image:linear-gradient(bottom,rgba(0,0,0,0.01) 0,rgba(255,255,255,0.01) 100%);border-bottom:1px solid #c2c2c2;-webkit-box-shadow:0 2px 0 #fff;-moz-box-shadow:0 2px 0 #fff;font-weight:800;box-shadow:0 2px 0 #fff}
 .st{font-weight:800;}
 .controls .input-block-level{font-weight:800;}
 .table-striped tbody .small,.table tbody .small,.data-table tbody .small{text-align:right;color:#c3c3c3}
 .table-striped tbody>tr:nth-child(odd)>td,.table tbody>tr:nth-child(odd)>td,.data-table tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th,.table tbody>tr:nth-child(odd)>th,.data-table tbody>tr:nth-child(odd)>th{background-color:#f9f9f9;background-image:-moz-linear-gradient(bottom,rgba(0,0,0,0.03) 0,rgba(255,255,255,0.03) 100%);background-image:-o-linear-gradient(bottom,rgba(0,0,0,0.03) 0,rgba(255,255,255,0.03) 100%);background-image:-webkit-linear-gradient(bottom,rgba(0,0,0,0.03) 0,rgba(255,255,255,0.03) 100%);background-image:linear-gradient(bottom,rgba(0,0,0,0.03) 0,rgba(255,255,255,0.03) 100%);border-bottom:1px solid #c2c2c2}
 table .btn{padding:0 6px;margin-right:0;margin-left:2px !important;}
 table .right .btn{float:right}
 table.dataTable thead th.right,table.dataTable tfoot th.right{text-align:right;padding-right:20px}
</style>