<?php
	include("inside/config.php");
	session_start();
	$user=$_SESSION['username'];
	if(empty($user))
	{
		echo "<script>window.location='login.php'</script>";
	}
		
	$currentpage = "feestructure";
	$id=$_REQUEST['id'];
	$sql=mysql_query("select * from `monthly_fee` where `fid`='$id'");
	$row=mysql_fetch_array($sql);
if($_REQUEST['action']=="delete")
	{
		$id=$_REQUEST['id'];
		$sqlDel=mysql_query("delete from `monthly_fee` where `fid`='$id'");
		$type = "ok";
		$msg = "Deletion Successful! ";
	}	
?>
<!DOCTYPE html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>Admin Panel : Frontier Public High School</title>
	<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
<?php include('inside/jsfunctions.php'); ?>
</head>
<body>
<?php include('inside/header.php'); ?>
<!-- Container -->
<div id="container">
	<div class="shell">
		
		<!-- Small Nav -->
		<div class="small-nav">
			<a href="#">Dashboard</a>
			<span>&gt;</span> Fee Structure</div>
		<!-- End Small Nav -->
		
		<!-- Message OK -->		
		<?php if($type=="ok"){ ?>
        <div class="msg msg-ok" id="msgok">
			<p><strong><?php echo $msg; ?></strong></p>
			<a href="#" class="close" onclick="removeOk()">close</a>
		</div>
		<!-- End Message OK -->		
		<?php } ?>
		<!-- Message Error -->
		<?php if($type=="error"){ ?>
		<div class="msg msg-error" id="error">
			<p><strong><?php echo $msg; ?></strong></p>
			<a href="#" class="close" onclick="removeError()">close</a>
		</div>
        <?php } ?>
		<!-- End Message Error -->
		<br />
		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>
			
			<!-- Content -->
		  <div id="content">
				
				<!-- Box -->
			<div class="box">
					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left">Monthly Fee</h2>
				</div>
					<!-- End Box Head -->	

					<!-- Table -->
					<div class="table">
					  <table width="100%" border="0" cellspacing="0" cellpadding="0">
					    <tr>
					      <th colspan="2" align="center" valign="middle">Boys Section</th>
					      <th colspan="3" align="center" valign="middle">Girls Section</th>
				        </tr>

<tr>
  <th class="odd">Class</th>
  <th>Fee</th>
  <th>Class </th>
  <th>Fee</th>
  <th width="110">Action</th>
</tr>
					   
<?php						$serial = 0;
					  		$sql2=mysql_query("select * from `monthly_fee`");
					  		while($row2=mysql_fetch_array($sql2))
					  		{
					  		?>
<tr>
  <td class="odd"><h3><?php echo $row2['Class_b']; ?></h3></td>
  <td><?php echo $row2['Fee_b']; ?></td>
  <td class="odd"><h3><?php echo $row2['Class_g']; ?></h3></td>
  <td><?php echo $row2['Fee_g']; ?></td>
  <td><a  class="ico edit" href="edit-fee.php?id=<?php echo $row2['fid'];?>">Edit</a>
</tr>
                        <?php
					  		}
					  		?>
				      </table>
					 
						
			  </div>
					<!-- Table -->
					
			  </div>
			  <!-- End Box -->
				
			  <!-- Box --><!-- End Box -->

			</div>
			<!-- End Content -->
			
			<!-- Sidebar -->
			<div id="sidebar">
				
				<!-- Box -->
				<div class="box">
					
					<!-- Box Head -->
					<div class="box-head">
						<h2>Management</h2>
					</div>
					<!-- End Box Head-->
					
					<div class="box-content"><!-- Sort --><!-- End Sort -->
						
					</div>
				</div>
				<!-- End Box -->
			</div>
			<!-- End Sidebar -->
			
			<div class="cl">&nbsp;</div>			
		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->
<?php  include("inside/footer.php"); ?></body>
</html>