<?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'); ?>
<script type="text/javascript">
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
<?php echo $a = jsStr;

	 ?> 
}
</script>
</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>
			Current Articles
		</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" onClick="myFunction(<?php echo $row2['fid']; ?>)" >Edit</a>
</tr>
                        <?php
					  		}
					  		?>
				      </table>
					 
						
			  </div>
					<!-- Table -->
					
			  </div>
			  <!-- End Box -->
				
			  <!-- Box -->
              <div class="box">
                  <!-- Box Head -->
                <div class="box-head">
                  <h2 class="left">Editing Panel</h2>
                </div>
                  <!-- End Box Head -->
                  
            </div>
            <!-- End Box -->

			</div>
			<!-- End Content -->
			
			<!-- Sidebar -->
			<div id="sidebar">
				
				<!-- Box -->
				<div class="box">
					
					<!-- Box Head -->
					<div class="box-head">
						<h2>Editing Panel</h2>
					</div>
					<!-- End Box Head-->
					
					<div class="box-content">
					 <form action="?action=edit" method="post" enctype="multipart/form-data" name="edit">
 					<table width="99%" border="0">
 					  <tr>
 					    <td valign="middle">  Boy's Section&nbsp;
				        <label>
				          <input name="class_b" type="text" disabled required class="size2" id="class_b" onBlur="MM_callJS('myfunction')" value="" readonly />
				        =</label></td>
 					    <td valign="middle">Fee&nbsp;&nbsp; 					      <input name="fee_b" type="text" required class="size2" id="fee_b" /></td>
				      </tr>
 					  <tr>
 					    <td valign="middle">Girls Section &nbsp;
<input name="class_g" type="text" disabled required class="size2" id="class_g" readonly /> 
			            =</td>
 					    <td valign="middle">Fee &nbsp;&nbsp;
				        <input name="fee_g" type="text" required class="size2" id="fee_g" /></td>
				      </tr>
 					  <tr>
 					    <td valign="middle">&nbsp;</td>
 					    <td valign="middle">&nbsp;</td>
				      </tr>
 					  <tr>
 					    <td valign="middle">&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" class="button" value="reset" />&nbsp;</td>
 					    <td valign="middle"> 
                      &nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" class="button" value="Save" />&nbsp;</td>
				      </tr>
				    </table>
<!-- Form Buttons -->
                    <div>
                     
                    </div>
                    <!-- End Form Buttons -->
                     </form>

						<!-- Sort --><!-- End Sort -->
						
					</div>
				</div>
				<!-- End Box -->
			</div>
			<!-- End Sidebar -->
			
			<div class="cl">&nbsp;</div>			
		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
<div id="footer">
	<div class="shell">
		<span class="left">Copyright &copy; 2014 Frontier Public High School</span>
		<span class="right">
			All rights Reserved.
		</span>
	</div>
</div>
<!-- End Footer -->
	
</body>
</html>