<?php
//	error_reporting(0);
	define('INCLUDE_CHECK',true);
	session_start();
	require ('classes/config2.php');
	require_once('classes/session.php');
	
	
?>
<title>OSCOTECH, ESA-OKE :: Admin-Dashboard > Form Editing</title>


        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">Payment Verification</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">
                                <input type="text" class="form-control" placeholder="Search Matric number"name="searchtxt" title="Enter name for search " autocomplete="off">
                                <span class="input-group-btn">
                                    <input type="submit" class="btn btn-danger" name="btnsearch" value="Search" id="button-search" title="Search Student">
                                </span>
                            </div>
                        </form>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Student 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>MATRICNO</th>
                                            <th>FORM NO</th>
                                            <th>SURNAME</th>
                                            <th>OTHERNAMES</th>            
                                            <th>TRANS ID</th>
                                            <th>DEPARTMENT</th>
                                            <th>PHONE</th>
                                            <th>PROGRAMME</th>
                                            <th>STATUS</th>
                                        <!--    <th>EDIT</th> -->
                                        </tr>
                                    </thead>
					<?php
                        $key="";
                        if(isset($_POST['searchtxt']))
                            $key=$_POST['searchtxt'];
                        
                        if($key !="")
                            $sql="Select student_activity_level.matricno,student_activity_level.formno,schoolfees_tranzact.formno,schoolfees_tranzact.surname,schoolfees_tranzact.othernames,schoolfees_tranzact.department,
                            schoolfees_tranzact.level, schoolfees_tranzact.responsecode,schoolfees_tranzact.amount,schoolfees_tranzact.txt_ref,schoolfees_tranzact.status
	                            FROM student_activity_level, schoolfees_tranzact
                                WHERE student_activity_level.matricno='$key' AND student_activity_level.formno=schoolfees_tranzact.formno
                                 AND (schoolfees_tranzact.level='ND II' or schoolfees_tranzact.level='HND II')
                                 AND schoolfees_tranzact.responsecode='00'";
                              $result = $conn1->query($sql);  
                       // else
                         //   $sql=mysql_query("SELECT * FROM admission_students_details LIMIT 2");
                        
                            
                           
                        $i=0;
                       // while($row=mysql_fetch_array($sql)){
                        while($row = $result->fetch_assoc()) {
							$emailS=$row['email'];
                            // $_SESSION['adm_status']= $row['status'];
                        $i++;
                        $color=($i%2==0)?"lightblue":"white";
                    ?>
                                    <tbody>
                                        <tr >
                                        	<td><?php echo $i;?></td>
                                            <td><?php echo $row['matricno'];?></td>
                                            <td><?php echo $row['formno'];?></td>
                                            <td><?php echo $row['surname'];?></td>
                                            <td><?php echo $row['othernames'];?></td>
                                            <td><?php echo $row['txt_ref'];?></td>
                                            <td><?php echo $row['department'];?></td>
                                            <td><?php echo $row['amount'];?></td>
                                            <td><?php echo $row['level'];?></td>
                                            <td><?php echo $row['status'];?></td>
                                       <!--     <td><a href="?action=update_student&opr=upd&rs_id=<?php echo $row['id'];?>" title="Update"><img src="images/icon-48-edit.png" /></a></td> -->
                                        </tr>
                                    </tbody>
                          <?php	
							}														
							?>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                            
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Account 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>USERNAME</th>
                                            <th>PASSWORD</th>
                                            <th>SURNAME</th>            
                                            <th>OTHER NAMES</th>
                                            <th>EMAIL</th>
                                        </tr>
                                    </thead>
					<?php
                        $key="";
                        if(isset($_POST['searchtxt']))
                            $key=$_POST['searchtxt'];
                        
                        if($key !="")
                            $sql=mysql_query("SElECT * FROM admission_account WHERE email='$emailS'");
                        else
                         //    $sql=mysql_query("SELECT * FROM admission_students_details LIMIT 2");
                        
                            
                           
                        $k=0;
                        while($row=mysql_fetch_array($sql)){
							$cardidS=$row['cardid'];
							$idS=$row['id'];
                        $k++;
                        $color=($k%2==0)?"lightblue":"white";
                    ?>
                                    <tbody>
                                        <tr >
                                        	<td><?php echo $k;?></td>
                                            <td><?php echo $row['username'];?></td>
                                            <td><?php echo $row['password'];?></td>
                                            <td><?php echo $row['surname'];?></td>
                                            <td><?php echo $row['othernames'];?></td>
                                            <td><?php echo $row['email'];?></td>
                                        </tr>
                                    </tbody>
                          <?php	
							}
							?>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                            
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Card 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>CARD SERIAL NUMBER</th>
                                            <th>STATUS</th>
                                            <th>USED BY</th>
                                            <th>LOGIN DATE</th>            
                                        </tr>
                                    </thead>
					<?php
                        $key="";
                        if(isset($_POST['searchtxt']))
                            $key=$_POST['searchtxt'];
                        
                        if($key !="")
                            $sql=mysql_query("SElECT * FROM admission_cards WHERE id='$cardidS' OR acctbyid='$idS' LIMIT 1");
                        else
                         //    $sql=mysql_query("SELECT * FROM admission_students_details LIMIT 2");
                        
                            
                           
                        $c=0;
                        while($row=mysql_fetch_array($sql)){
                        $c++;
                        $color=($c%2==0)?"lightblue":"white";
						$_SESSION['cardidk']=$row['id'];
                    ?>
                                    <tbody>
                                        <tr >
                                        	<td><?php echo $c;?></td>
                                            <td><?php echo $row['serial_no'];?></td>
                                            <td><?php echo $row['status'];?></td>
                                            <td><?php echo $row['usedbyid'];?></td>
                                            <td><?php echo $row['log_time'];?></td>
                                        </tr>
                                    </tbody>
                          <?php	
							}
							?>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                            
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->

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

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