<?php
session_start();
// ============ this file shows a form to users to search for provided services
include("../../asset/theme/css/myfunc.php");
include("../../php_crud/my_class.php");
$obj=new my_class();
// ============
$return_tag_active=addslashes(trim($_GET['return_tag']));
$exam_session_value=0;
$exam_name_value="";
$payment_status_value="";
if($return_tag_active==1 || $return_tag_active==2){
	$exam_session_value=$_SESSION['SESSION_FEE_COLLECTION'];
	$exam_name_value=$_SESSION['EXAM_NAME_FEE_COLLECTION'];
	$payment_status_value=$_SESSION['PAYMENT_STATUS_FEE_COLLECTION'];
}
?>
<style type="text/css">
i{
	cursor:pointer;
}
</style>
<script src="module/finance/js/exam_service_fee_collection.js" type="text/javascript"></script>

<?php if($_SESSION['add']=='Y'){ ?>
<div id="load_page">
<div class="row-fluid"  >							
	<legend>
		<div class="widget-header header-color-green">
			<h4 class="lighter smaller" style="font-weight:bold;">Payment Status of Schools</h4>
		</div>
	</legend>
</div>


<div class="row-fluid">

	<form class="form-vertical" >
		
		<input type="hidden" id="branchid" name="branchid" value="<?php echo $_SESSION['LOGIN_BRANCH'];?>"/>
		<!--PAGE CONTENT BEGINS-->
		<!--<div class="row-fluid">-->
		
		<div class="row-fluid" style="background-color:#f5f5f5;-webkit-box-shadow: 0 8px 6px -6px black; -moz-box-shadow: 0 8px 6px -6px black; box-shadow: 0 8px 6px -6px black;">

			<div class="span3">
				<div class="control-group" >
					<label class="control-label" for="form-field-1">Session<font color="#FF0000">*</font></label>
					<div class="controls" id="session_control_fee_collection">
						<select class="select_list" id="session_fee_collection">
							<?php if($exam_session_value != 0){?>
							<option value="<?php echo $exam_session_value;?>"><?php echo $exam_session_value;?></option>
							<?php }else{?>
							<option value="">---SELECT---</option>
							<?php }
								for ($x = date('Y')-5; $x <= date('Y'); $x++) {
							?>
							<option value="<?php echo $x; ?>"><?php echo $x; ?></option>
							<?php } ?>       
						</select>
					</div>
				</div>
			</div>
									
			<div class="span3">
				<div class="control-group">
					<label class="control-label" for="form-field-1">Exam Name</label>
					<div class="controls" id="exam_name_control_fee_collection">
						<select class="select_list" id="exam_name_fee_collection">
						<?php if($exam_name_value != ""){?>
						<option value="<?php echo $exam_name_value;?>"><?php echo $exam_name_value;?></option>
						<?php }else{?>
						<option value="">---SELECT---</option><?php } ?>
							<option value="PSC">PSC</option>
							<option value="JSC">JSC</option>
							<option value="SSC">SSC</option>     
						</select>
					</div>
				</div>
			</div>
								  
			<div class="span3">
				<div class="control-group">
					<label class="control-label" for="form-field-1">Payment Status</label>
					<div class="controls" id="payment_status_control_fee_collection">
						<select class="select_list" id="payment_status_fee_collection">
						<?php if($payment_status_value != ""){
							$payment_status_name="";
							if($payment_status_value == 'U'){
								$payment_status_name = "Unpaid";
							}
							if($payment_status_value == 'PR'){
								$payment_status_name = "Partially Paid";
							}
							if($payment_status_value == 'P'){
								$payment_status_name = "Paid";
							}?>
						<option value="<?php echo $payment_status_value;?>"><?php echo $payment_status_name;?></option>
						<?php }else{?>
							<option value="">--SELECT--</option><?php }?>
							<option value="U">Unpaid</option>
							<option value="PR">Partially Paid</option>
							<option value="P">Paid</option>     
						</select>
					</div>
				</div>
			</div>
			<div class="span3">
				<div class="control-group">
					<label class="control-label" for="form-field-1">&nbsp;</label>
					<div class="controls">
						<button class="btn btn-small btn-success" type="button" id="btn_show_fee_collection_data" onclick="perform_show_fee_collection_data()">
							<i class="icon-ok bigger-100"></i>
							Show
						</button>
						<button class="btn btn-small btn-yellow" type="button" style="visibility:hidden; margine-left: 20px;" id="btn_show_fee_collection_report" onclick="show_payment_report_for_selected_session()">
							Save as PDF
							<i class="icon-print bigger-125 icon-on-right"></i>
						</button>
					</div>
				</div>
			</div>
		</div>
	</form>
</div>
<?php } ?>

<br/>
<div class="row-fluid" id="fee_collection_data_to_show">
</div>

</div>
<div id="modal-rollback-paid-entry" class="modal hide fade  " style="overflow-x:show" tabindex="-1">
	<div class="modal-header no-padding">
		<div class="table-header">
			<button type="button" class="close" data-dismiss="modal">&times;</button>
				Rollback Paid Entry
		</div>
	</div>
	<div class="modal-body " id="rollback_paid_entry_value">
	</div>
	<div class="modal-footer">
		<button class="btn btn-small btn-success pull-left" type="button" id="btn_update_rollback_paid_entry_info" data-dismiss="modal" onclick="perform_update_rollback_payment_info(<?php echo 1;?>)">
			<i class="icon-ok bigger-100"></i>
			Confirm
		</button>
		<button class="btn btn-small btn-danger pull-left" data-dismiss="modal">
			<i class="icon-remove"></i>
			Close
		</button>
	</div>								
</div>
<script>
<?php if($return_tag_active==1 || $return_tag_active==2){
	?>
	perform_show_fee_collection_data();
	<?php
}?>
$('#timepicker1').timepicker({
					minuteStep: 1,
					showSeconds: false,
					showMeridian: false
				})
			
				
				
</script>