<?php
	error_reporting(0);
	define('INCLUDE_CHECK',true);
	session_start();
	require ('classes/config.php');
	require_once('classes/session.php');
	
	
	if(isset($_POST['submit'])){
					$fees = $_POST['fees'];
					$prend = $_POST['prend'];
					$nd1 = $_POST['nd1'];
					$nd2 = $_POST['nd2'];
                                        $nd3 = $_POST['nd3'];
					$hnd1 = $_POST['hnd1'];
					$hnd2 = $_POST['hnd2'];
                                        $hnd3 = $_POST['hnd3'];
					$mode = $_POST['mode'];
                                        $status= $_POST['status'];
					
            		$sql= mysql_query("INSERT INTO payment_setting (fees_description,PreND,NDI,NDII,NDIII,HNDI,HNDII,HNDIII,mode,status) 
						VALUES('$fees','$prend','$nd1','$nd2','$nd3','$hnd1','$hnd2','$hnd3','$mode','$status')") or die(mysql_error());
			header("location: dashboard.php?action=busary_settings");
				            
   }elseif(isset($_POST['submitother'])){
	   				$fees = $_POST['fees'];
					$amount = $_POST['amount'];
					$type = $_POST['type'];
					
            		$sql= mysql_query("INSERT INTO payment_setting_others (fees_description,amount,type) 
						VALUES('$fees','$amount','$type')") or die(mysql_error());
			header("location: dashboard.php?action=busary_settings");	     
   }
?>
<title>OSCOTECH, ESA-OKE :: Admin-Dashboard > Payment Settings</title>


        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">Payment Settings</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            
            <div class="row">
                <div class="col-lg-12">
                	<?php echo $msg; ?>	
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Payment Settings
                        </div>
                        <div class="panel-body">
                            <div class="panel-group" id="accordion">
                                <div class="panel panel-primary">
                                    <div class="panel-heading">
                                        <h4 class="panel-title">
                                            <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" class="collapsed">Student Diffrent Payment Settings</a>
                                        </h4>
                                    </div>
                                    <div id="collapseOne" class="panel-collapse collapse" style="height: 0px;">
                                        <div class="panel-body">
                                    <form method="post" action="" role="form">
                                        <div class="form-group">
                                            <label>Fees Description:</label>
                                            <input class="form-control" placeholder="Fees Description" name="fees" require>
                                        </div>
                                        <div class="form-group">
                                            <label>PreND</label>
                                            <input class="form-control" placeholder="3000" name="prend"  require>
                                        </div>
                                        <div class="form-group">
                                            <label>NDI:</label>
                                            <input class="form-control" placeholder="3000" name="nd1" require>
                                        </div>
                                        <div class="form-group">
                                            <label>NDII:</label>
                                            <input class="form-control" placeholder="3000" name="nd2" require>
                                        </div>
                                        <div class="form-group">
                                            <label>NDIII:</label>
                                            <input class="form-control" placeholder="3000" name="nd3" require>
                                        </div>
                                        <div class="form-group">
                                            <label>HNDI:</label>
                                            <input class="form-control" placeholder="3000" name="hnd1" require>
                                        </div>
                                        <div class="form-group">
                                            <label>HNDII:</label>
                                            <input class="form-control" placeholder="3000" name="hnd2" require>
                                        </div>
                                        <div class="form-group">
                                            <label>HNDIII:</label>
                                            <input class="form-control" placeholder="3000" name="hnd3" require>
                                        </div>
                                        <div class="form-group">
                                        	<label>Mode:</label>
                                            <select name="mode" class="form-control" required >
                                                <option value="">--Select Mode--</option>
                                                <option value="regular">Regular</option>
                                                <option value="dpt">DailyPart-Time</option>
                                                <option value="pt">Weekend Part-Time</option>
                                            </select>
                                    	</div>
                                        <div class="form-group">
                                        	<label>Mode:</label>
                                            <select name="status" class="form-control" required >
                                                <option value="">--Select Mode--</option>
                                                <option value="science">science</option>
                                                <option value="non-science">non-science</option>
                                            </select>
                                    	</div>
                                        	<button type="submit" name="submit" class="btn btn-success">Submit</button>
                                        <button type="reset" class="btn btn-danger" VALUE="CLOSE" ONCLICK="window.location='dashboard.php?action=home'">Close</button>
                                    </form>
                                    <hr />
                                    <div class="panel-body">
                                        <div class="form-group">
                                             <h4>List of Payment</h4>
                                             <table class="table table-striped table-bordered">
                                                <tr>
                                                	<th>S/N</th>
                                                    <th>Fees Description</th>
                                                    <th>PreNd</th>
                                                    <th>NDI</th>
                                                    <th>NDII</th>
                                                    <th>NDIII</th>
                                                    <th>HNDI</th>
                                                    <th>HNDII</th>
                                                    <th>HNDIII</th>
                                                    <th>Mode</th>
                                                    <th>Status</th>
                                                    <th>Option</th>
                                                </tr>
									<?php
            
                                        $key="";
                                        if(isset($_POST['searchtxt']))
                                            $key=$_POST['searchtxt'];
                                        
                                        if($key !="")
                                            $sqlf=mysql_query("SElECT * FROM payment_setting");
                                        else
                                            $sqlf=mysql_query("SElECT * FROM payment_setting");
                                        
                                            
                                           
                                        $i=0;
                                        while($row=mysql_fetch_array($sqlf)){
                                        $i++;
                                        $color=($i%2==0)?"lightblue":"white";
                                    ?>
                                                <tr>
                                                    <td><?php echo $i;?></td>
                                                    <td><?php echo $row['fees_description'];?></td>
                                                    <td><?php echo $row['PreND'];?></td>
                                                   <td><?php echo $row['NDI'];?></td>
                                                   <td><?php echo $row['NDII'];?></td>
                                                   <td><?php echo $row['NDIII'];?></td>
                                                   <td><?php echo $row['HNDI'];?></td>
                                                   <td><?php echo $row['HNDII'];?></td>
                                                    <td><?php echo $row['HNDIII'];?></td>
                                                   <td><?php echo $row['mode'];?></td>
                                                    <td><?php echo $row['status'];?></td>
                                                    <td><a href="#">Edit</a> | <a href="?action=is_deleted_payment&opr=del&rs_id=<?php echo $row['id'];?>">Delete</a></td>
                                                </tr>
                                          <?php }?>
                                             </table>

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

    </div>
    <!-- /#wrapper -->
    </div>
    								<div class="panel panel-warning">
                                    <div class="panel-heading">
                                        <h4 class="panel-title">
                                            <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" class="collapsed">Others Settings</a>
                                        </h4>
                                    </div>
                                    <div id="collapseTwo" class="panel-collapse collapse" style="height: 0px;">
                                        <div class="panel-body">
                                    <form method="post" action="" role="form" name="form2">
                                        <div class="form-group">
                                            <label>Fees Description:</label>
                                            <input class="form-control" placeholder="Fees Description" name="fees" require>
                                        </div>
                                        <div class="form-group">
                                            <label>Amount</label>
                                            <input class="form-control" placeholder="3000" name="amount"  require>
                                        </div>
                                        <div class="form-group">
                                        	<label>Type:</label>
                                            <select name="type" class="form-control" required>
                                                <option value="">--Select Type--</option>
                                                <option value="student">Student</option>
                                                <option value="others">Others</option>
                                            </select>
                                    	</div>
                                        	<button type="submit" name="submitother" class="btn btn-success">Submit</button>
                                        <button type="reset" class="btn btn-danger" VALUE="CLOSE" ONCLICK="window.location='dashboard.php?action=home'">Close</button>
                                    </form>
                                    <hr />
                                    <div class="panel-body">
                                        <div class="form-group">
                                             <h4>List of Others Payment</h4>
                                             <table class="table table-striped table-bordered">
                                                <tr>
                                                	<th>S/N</th>
                                                    <th>Fees Description</th>
                                                    <th>Amount</th>
                                                    <th>Type</th>
                                                    <th>Option</th>
                                                </tr>
									<?php
            
                                        $key="";
                                        if(isset($_POST['searchtxt']))
                                            $key=$_POST['searchtxt'];
                                        
                                        if($key !="")
                                            $sqlf=mysql_query("SElECT * FROM payment_setting_others");
                                        else
                                            $sqlf=mysql_query("SElECT * FROM payment_setting_others");
                                        
                                            
                                           
                                        $i=0;
                                        while($crow=mysql_fetch_array($sqlf)){
                                        $i++;
                                        $color=($i%2==0)?"lightblue":"white";
                                    ?>
                                                <tr>
                                                    <td><?php echo $i;?></td>
                                                    <td><?php echo $crow['fees_description'];?></td>
                                                    <td><?php echo $crow['amount'];?></td>
                                                   <td><?php echo $crow['type'];?></td>
                                                    <td><a href="#">Edit</a> | <a href="?action=is_deleted_payment_others&opr=del&rs_id=<?php echo $row['id'];?>">Delete</a></td>
                                                </tr>
                                          <?php }?>
                                             </table>

                                        </div>
    
   <?php  ?>