<?php require_once("../../student_portal/includes/initialize.php"); 
if (isset($_POST['search'])){
    $formno = $_POST['formno'];
    echo "<script>alert('Welcome')</script>";
    
    
}
// $alldept = ONLINEPAY:: showdept();
// $dprepare ="";
// $allsession = ONLINEPAY:: showsession();
//if (isset($_POST['submit'])){
	//$_SESSION['paytype']=$_POST['paytype'];
	//$_SESSION['depart']=$_POST['depart'];
	//$_SESSION['sess']=$_POST['sess'];
	//$_SESSION['lev']=$_POST['lev'];
	//$_SESSION['view']=$_POST['view'];
	//redirect_to("pages/result_online_payment.php");
	
//}
$tag = $_GET['type'];
$_SESSION['tablename'] =$tag;
//echo $_SESSION['tablename'];
?>


 
  <!--        <head>-->
  <!--          <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>  -->
  <!--         <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />  -->
  <!--         <script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>  -->
  <!--         <script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script> -->
  <!--         <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker.css" />-->
  <!--      <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.js"></script>-->
  <!--</head>-->
           <!-- <script src="javascripts/jquery.min.js"></script>  -->
           <!--<link rel="stylesheet" href="javascripts/bootstrap.min.css" />  -->
           <!--<script src="javascripts/jquery.dataTables.min.js"></script>  -->
           <!--<script src="javascripts/dataTables.bootstrap.min.js"></script>-->
           
           <!--<body>-->
		<div class="container" style="position:relative;">
<form method="POST" action="vreceipt.php">
    <div class="form-group input-group" align="Right">
    <table class="table table-bordered table-hover" align="center">
        <tr>
<div style="margin-top:5px; border-bottom:2px inset #000">
<td>
<label style="margin-left:10px">Form Number</label></label>

<!--<select id="fac" style="width:100px" >-->
<!--<option value="">Choose...</option>-->
<!--<option value="Management Sciences">Management Sciences</option>-->
<!--<option value="Enviromental Studies">Enviromental Studies</option>-->
<!--<option value="Applied Sciences">Applied Sciences</option>-->
<!--<option value="Engineering">Engineering</option>-->
<!--</select>-->
</td>
<td>
    
<input type="text" name="formno">    
    
    
    
</td>
<td>
<!--<div class="col-md-4">-->
    <input type="submit" name="search" id ="search" value="Print receipt" class="btn btn-info" />
<!--</div>-->
</td>

<!--<td>-->
<!--<label style="margin-left:20px" >Department</label>-->
<!--<select id="depart" style="width:100px">-->
<!--<option value="">Choose...</option>-->
<!--<option value="all">All departments</option>-->
<?php //foreach($alldept as $dept){?>
<!--<option value="<?php // echo $dept->department;?>"><?php
//$dprepare= strtolower($dept->department);
//echo ucwords($dprepare);?></option>
<?php //}?>
<!--</select>-->
<!--</td>-->
<!--<td>-->
<!--<label style="margin-left:20px" >Session</label>-->
<!--<select id="sess"  style="width:80px" class="form-control action">-->
<!--<option value="">Choose...</option>-->
<!--<?php //foreach($allsession as $session){?>-->
<!--<option value="<?php //echo $session->session;?>"><?php //echo $session->session?></option>-->
<!--<?php //}?>-->
<!--</select>-->
<!--</td>-->
<!--<td>-->
<!--<label  style="margin-left:20px" >Level</label>-->
<!--<select id="lev" class="form-control action">-->
<!--<option value="">Choose...</option>-->
<!--<option value="ND">ND I</option>-->
<!--<option value="ndii">ND</option>-->
<!--<option value="HND">HND I</option>-->
<!--<option value="hndii">HND II</option>-->
<!--</select>-->
<!--</td>-->
<!--<td>-->
<!--<div class="input-daterange">-->
<!--<div class="col-md-4">-->
<!--    <input type="text" name="start_date" id="start_date" class="form-control" placeholder="From:StartDate"/>-->
<!--</div>-->
<!--<div class="col-md-4">-->
<!--    <input type="text" name="end_date" id="end_date" class="form-control" placeholder="To:EndDate"/>-->
<!--</div>-->
<!--</div>-->
<!--<div>-->


<!--<td>-->
<!--    <div>-->
<!--        <input type="submit" name="Print_pdf" id ="Print_pdf" class="btn btn-danger" value="Print PDF" />-->
<!--    </div>-->
<!--</td>-->
</tr>

</table>
</form>

<!-- <div id="bursar" style="width:878px; height:470px; overflow:scroll; background-color:; margin-left:8px ">-->
                        
                  
                  
<!--</div>-->

<!--<div id="summary" style="width:870px; height:10px; background-color:; margin-left:8px ">-->
                        
                  
                  
<!--</div>-->
<!--</div>-->
</body>
<!--<script src="../javascripts/jquery.min.js"></script>        
<script src="../javascripts/bootstrap.min.js" type="text/javascript"></script>
-->


                               

 
 
  
<script type="text/javascript">
var ptype = <?php echo json_encode($tag);?>;

$(document).ready(function() {
    //e.preventdefault(e);
// 	$('#bursar').DataTable();
	$('#fac').on('change', function(){
	//	alert($('#fac').val());
	if($('#fac').val() != '')
		{
			var fac = $(this).val();
			//alert("value" + faculty);
			$('#depart').attr('disabled', 'disabled');
		}else {
		$('#depart').attr('disabled', 'false');
	}
		 
	})
	
	$('#depart').on('change', function(){
	    //e.preventdefault(e);
	//	alert($('#fac').val());
	if($('#depart').val() != '')
		{
			var dpt = $(this).val();
			//alert("value" + faculty);
			$('#fac').attr('disabled', 'disabled');
		}else {
		$('#depart').attr('disabled', 'false');
	}
		 
	})
	
	$('.input-daterange').datepicker({
  todayBtn:'linked',
  format: "yyyy-mm-dd",
  autoclose: true
 });

	 
$('#btn').on('click', function(e){
    e.preventDefault(e);
    var fac= $('#fac').val();
    var dpt =$('#depart').val();
    var lev = $('#lev').val();
    var ses = $('#sess').val();
    var view = $('#view').val();
    /*	alert(ptype);
    alert(fac);
    alert(dpt);
    alert(lev);
    alert(ses);
    alert(ses);
    */
		
        $.ajax({                    
            method:"POST",
			url: "areceipt.php",
            data:{ptye:ptype,fac:fac,dpt:dpt,lev:lev,ses:ses,view:view},
            success:function(data)
            {
				alert(data);
               $('#bursar').html(data);
            }
        })
    });
    
    $('#search').on("click", function(e){
    e.preventDefault(e);
    
    var formno= $('#formono').val();
    
        {
            $.ajax({
            	url:"./areceipt.php",
            	method:"POST",
            	data:{formno:formno},
            	success:function(data)
            	{
            	   // alert(data);
            		//$('#bursar').html(data);
            	}
            });
        }
 });
 
 
 $('#Print_pdf').on("click", function(e){
    e.preventDefault(e);
        {
    		window.open("bursary_report.php");
        }
 });
    
    
    
    
    
});
</script>