<?php
	error_reporting(0);
	define('INCLUDE_CHECK',true);
	session_start();
	require ('classes/config.php');
	require_once('classes/session.php');
	
?>
<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="ptype" class="form-control" id="ptype">
                                            <option value="">--Payment Type--</option>
                                            <option value="acpfee">Acceptance Fee</option>
                                            <option value="schfee">School Fee</option>
                                        </select>
                                    </td>
                                    <td>
                                    	<select name="sek" class="form-control" id="sek">
                                            <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>
                                    	<select name="level" class="form-control" id="level">
                                            <option value="">--Select level--</option>
                                            <option value="NDII">NDII</option>
                                            <option value="HNDII">HNDII
                                        </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>SESSION</th>
                                            <th>RESPONSE</th>  
                                            <th>AMOUNT</th>          
                                            <th>DATE/TIME</th>
                                        </tr>
                                    </thead>
					<?php
							$_SESSION['sek']= $_POST['sek'];
							$_SESSION['fromdate']= $_POST['fromdate'];
							$_SESSION['todate']= $_POST['todate'];
                            $_SESSION['ptype']= $_POST['ptype'];
                            $_SESSION['level']=$_POST['level'];
                            
						
							echo $_POST[level],$_POST[programme],$_POST[sek],$_POST['ptype'], $_POST['fromdate'], $_POST['todate']; 
							
                        //	if($_POST[fromdate]=="$_SESSION['fromdate']" AND $_POST[todate]=="")
				           $sql = mysql_query("SELECT * FROM tranzact_t
                                                  WHERE date_time BETWEEN '{$_POST['fromdate']}' AND '{$_POST['todate']}';") AND responsecode='00'
                                                  AND ptype='{$_POST['ptype']}'
                                                  AND session='{$_POST['sek']}' AND level='{$_POST['level']}' ;
                            //    else
                              //            $sql = mysql_query("SELECT * FROM tranzact_t
                                //                  WHERE responsecode='00'
                                  //                AND ptype='{$_POST['ptype']}'
                                    //              AND session='{$_POST['sek']}' AND level='{$_POST['level']}'  BETWEEN  '{$_POST['fromdate']}' AND '{$_POST['todate']}';");

                           
                        $i=0;
                        while($row=mysql_fetch_array($sql)){
                        $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['session'];?></td>
                                            <td><?php echo $row['status'];?></td>
                                            <td><?php echo $row['amount'];?></td>
                                            <td><?php echo $row['date_time'];?></td>
                                        </tr>
                                    </tbody>
                          <?php	
							}
									
							?>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                          
                        </div>
                        <!-- /.panel-body --> 
                    </div> 
                    <!-- /.panel -->
                    	<center>
                       		<a href="rpt_web_pay_list_dpt2.php" target="_new" class="btn btn-success">Send to Printer</a>
                            <p>&nbsp;</p>
                        </center>
                    </form>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->

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

    </div>
    <!-- /#wrapper -->
    
<!-- ***************** Modal Operation ******************** -->
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Student Payment Details</h4>
            </div>
            <div class="modal-body">
                <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <th>S/N</th>
                                            <th>PAYMENT ITEMS</th>
                                            <th>AMOUNT</th>
                                        </tr>
                                    </thead>
					<?php
							$_SESSION['sek']= $_POST['session'];
							$_SESSION['courses']= $_POST['courses'];
							$_SESSION['programme']= $_POST['programme'];
							$_SESSION['fromdate']= $_POST['fromdate'];
							$_SESSION['todate']= $_POST['todate'];
							$courses=$_POST['courses'];
						
						$sqlitems = mysql_query("SELECT * FROM tranzact_t_items");
                           
                        $i=0;
                        while($irow=mysql_fetch_array($sqlitems)){
                        $i++;
                        $color=($i%2==0)?"lightblue":"white";
                    ?>
                                    <tbody>
                                        <tr >
                                        	<td><?php echo $i;?></td>
                                            <td><?php echo $irow['fees_description'];?></td>
                                            <td><?php echo $irow['amount'];?></td>
                                        </tr>
                                    </tbody>
                          <?php	
							}
									
							?>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                          
                        </div>
                        <!-- /.panel-body --> 
                    </div> 
                    <!-- /.panel -->
                
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->