<?php
//	error_reporting(0);
	define('INCLUDE_CHECK',true);
	session_start();
	require ('classes/config2.php');
	require_once('classes/session.php');
	
	$faculty = $_SESSION['accessed_level'];
?>
<title>OSCOTECH, ESA-OKE :: Admin-Dashboard > Online WebPayment List</title>

<script type="text/javascript" language="javascript"> 
<!-- 
function DoThisAgain() { 
var myW = window.open("","myW","height=550,width=750,scrollbars=no,resizable=no,toolbar=no,statusbar=yes,location=center,dependent=yes") 
} 
--> 
function setFocus()
{
$('#myModal').on('shown.bs.modal', function () {
    $('#fno').focus();
})
}
</script>


        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">Online WebPayment List</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                	<div class="well" style="background:#FFF">
                    	<form method="post" action="" role="form">                        	
                        	<div class="form-group input-group">
                        	<table class="table table-bordered table-hover">
                            	<tr>
                                	<td>
                                         <select name="department" id="department"  class="form-control">
                                          <option value="">-- Select Department -- </option>
                                            <?php 
                                            	require ('classes/config2.php');
                                            	require_once('classes/session.php');
                                                    $getdept = ("SELECT dept FROM department");
                                                    $result = $conn->query($getdept);
                                                   // while($row = mysql_fetch_array($getdept)){
                                                   while($row = $result->fetch_assoc()) {
                                                ?>
                                                    <option value="<?php echo $row['dept'] ?>"><?php echo $row['dept']?></option>
                                                <?php
                                                    }
                                            ?>
                                        </select>
                                	</td>
                                        
                                        <td>
                                    	<select name="level" class="form-control" id="level">
                                            <option value="">--Select Level--</option>
                                           <!-- <option value="NDI">NDI</option>
                                            <option value="NDII">NDII</option>-->
                                            <option value="NDII">NDII</option>
                                            <option value="HNDII">HNDII</option>
                                            <!--<option value="HNDII">HNDII</option>
                                            <option value="HNDII">HNDIII</option> -->
                                        </select>
                                      </td>
                                    
                                    <td>
                                    	<select name="ptype" class="form-control" id="ptype">
                                            <option value="">--Select Session--</option>
                                            <option value="schfee">School Fee</option>
                                            <option value="acpfee">Acceptance Fee</option>
                                        </select>
                                    </td>
                                    <td>
                                    	<select name="session" class="form-control" id="session">
                                            <option value="">--Select Session--</option>
                                            <option value="2016/2017">2016/2017</option>
                                            <option value="2017/2018">2017/2018</option>
                                            <option value="2018/2019">2018/2019</option>
                                        </select>
                                    </td>
                                    <td>
                                    	<div class="input-group date form_date col-md-11" data-date="" data-date-format="yyyy-mm-dd" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
				                       		<input type="text" class="form-control" placeholder="From: yyyy-mm-dd" name="fromdate" title="Uploading Date " autocomplete="on">
											<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                                       </div>
                                    </td>
                                    <td>
                                    	<div class="input-group date form_date col-md-11" data-date="" data-date-format="yyyy-mm-dd" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
				                       		<input type="text" class="form-control" placeholder="To: yyyy-mm-dd"name="todate" title="Uploading Date " autocomplete="on" >
                                            <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                                       </div>
                                    </td>
                                	<td>
                                        <span class="input-group-btn">
                                            <input type="submit" class="btn btn-danger" name="btnsearch" value="Search" id="button-search" title="Search Student">
                                        </span>
                                    </td>
                             	</tr>
                            </table>
                            </div>
                        </form>
                    </div>
                    <form action="" method="post">
                    <div class="panel panel-primary chat-panel">
                        <div class="panel-heading ">
                            Payment Details Table
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <th>S/N</th>
                                            <th>MATRIC. NO</th>
                                            <th>TRAN. REF</th>
                                            <th>SURNAME</th>
                                            <th>OTHER NAME</th>
                                            <th>DEPARTMENT</th>
                                            <th>LEVEL</th>
                                            <th>DESCR.</th>  
                                            <th>AMOUNT</th>          
                                            <th>DATE/TIME</th>
                                        </tr>
                                    </thead>
					<?php/*
							$_SESSION['sek']= $_POST['session'];
							$_SESSION['courses']= $_POST['courses'];
							$_SESSION['level']= $_POST['level'];
                            $_SESSION['programme']= $_POST['programme'];
							$_SESSION['fromdate']= $_POST['fromdate'];
							$_SESSION['todate']= $_POST['todate'];
							$_SESSION['fromdate1']= $_POST['fromdate']." "."00:00:00";
							$_SESSION['todate1']= $_POST['todate']." "."00:00:00";
							$courses=$_POST['courses'];
                                                        $_SESSION['ptype']= $_POST['ptype'];
						
							echo $courses,$_POST[level],$_POST[programme],$_POST[session],$_POST['ptype'];
							
                        	if($_POST[programme]=="" AND $_POST[fromdate]=="" AND $_POST[todate]==""){
				           $sql ="SELECT * FROM schoolfees_tranzact
                                                  WHERE responsecode='00'
                                                  AND department='{$_POST['courses']}'
                                                  AND level='{$_POST['level']}'
                                                  AND ptype='{$_POST['ptype']}'
                                                  AND session='{$_POST['session']}'";
                               $res1 = $conn->query($sql); 
                        	}
                                elseif ($_POST[programme]==""){
                                           $sql = "SELECT * FROM schoolfees_tranzact
                                                  WHERE responsecode='00'
                                                  AND department='{$_POST['courses']}'
                                                  AND level='{$_POST['level']}'
                                                  AND ptype='{$_POST['ptype']}'
                                                  AND date_time Between '{$_SESSION['fromdate']}' AND '{$_SESSION['todate']}'
                                                  AND session='{$_POST['session']}'";
                                     $res1 = $conn->query($sql);
                                }
                           
                      //  $i=0;
                      //  while($row=mysql_fetch_array($sql)){
                       // $i++;
                      //  $color=($i%2==0)?"lightblue":"white";
                        
                        
                          while($row = $result->fetch_assoc()) {
                        $i++;
                        $color=($i%2==0)?"lightblue":"white";
                    ?>
                                    <tbody>
                                        <tr >
                                            <td><?php echo $i;?></td>
                                            <td><?php echo $row['fno'];?></td>
                                            <td><?php echo $row['txn_ref'];?></td>
                                            <td><?php echo $row['surname'];?></td>
                                            <td><?php echo $row['othername'];?></td>
                                            <td><?php echo $row['department'];?></td>
                                            <td><?php echo $row['level'];?></td>
                                            <td><?php echo $row['status'];?></td>
                                            <td><?php echo $row['amount'];?></td>
                                            <td><?php echo $row['date_time'];?></td>
                                         <!--   <td><a href="?action=update_student&opr=upd&rs_id=<?php echo $row['txn_ref'];?>" title="Details"><strong>DETAILS</strong></a></td> -->
                                        </tr>
                                    </tbody>
                          <?php	
							}
								*/	
							?>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                          
                        </div>
                        <!-- /.panel-body --> 
                    </div> 
                    <!-- /.panel -->
                    	<center>
                    	    <a href="rpt_web_pay_list.php" target="_new" class="btn btn-success">SEND TO PRINTER</a> 
                    	    <a href="rpt_web_pay_list_dpt.php" target="_new" class="btn btn-warning">Print NDI/HNDI Daily Partime</a> 
                       		 <a href="rpt_web_pay_list_pu.php" target="_new" class="btn btn-danger">Print NDI Jambite</a> 
                       		 <a href="rpt_web_pay_list_ft.php" target="_new" class="btn btn-primary">Print HNDI Full Time</a>
                           <!-- <input type="submit" class="btn btn-success" value="SEND TO PRINTER" name="adm" />-->
                            <p>&nbsp;</p>
                        </center>
                        <center>
                    	    <a href="rpt_web_pay_list_dpt.php" target="_new" class="btn btn-success">Print NDII/HNDII Daily Partime</a> 
                       		 <a href="rpt_web_pay_list_ft.php" target="_new" class="btn btn-default">Print NDII/HNDII Full Time</a>
                           <!-- <input type="submit" class="btn btn-success" value="SEND TO PRINTER" name="adm" />-->
                            <p>&nbsp;</p>
                        </center>
                    </form>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->

        </div>
        <!-- /#page-wrapper -->
       

    </div>
    <!-- /#wrapper -->
    
