<?php session_start(); 
if($_SESSION["username"]=="")
{
 	echo "You are not Logged in Please <a href='signin.php'>Sign in </a> First ";
}
elseif($_SESSION["usertype"]=="Parents")
{
 	echo "You are not Authorized This Page <a href='parents.php'>Back </a> ";
}
else
{
include 'dbc.php';
$today=date("Y-m-d");
$userid=$_SESSION["userid"];
$rowSQL = mysql_query( "SELECT MAX( id ) AS max FROM `admission`;" );
$row = mysql_fetch_array( $rowSQL );
$largestNumber = $row['max'];
$largestNumber = $largestNumber +1;
$sql3="Select * from addclass where user_id='$userid'";
$data3=mysql_query($sql3) or die ("Error:" . mysql_error());
$rows3=mysql_num_rows($data3);
?>
<HTML>
<HEAD>
<TITLE>MIND TECH SOLUTION</TITLE>
<link rel="stylesheet" type="text/css" href="ddlevelsfiles/ddlevelsmenu-base.css" />
<link rel="stylesheet" type="text/css" href="ddlevelsfiles/ddlevelsmenu-topbar.css" />
<link rel="stylesheet" type="text/css" href="ddlevelsfiles/ddlevelsmenu-sidebar.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<style>
<style type="text/css">
<!--
.style1 {font-weight: bold}
.style2 {color: #FFFFFF}
.style4 {
	font-family: Tahoma;
	font-size: 12px;
	font-weight: bold;
}
-->
</style>
<script type="text/javascript" src="ddlevelsfiles/ddlevelsmenu.js">

/***********************************************
* All Levels Navigational Menu- (c) Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>

</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<!-- ImageReady Slices (home final.psd) -->
<TABLE WIDTH=1000 BORDER=0 CELLPADDING=0 CELLSPACING=0 align=center>
  <TR>
    <TD COLSPAN=3 bgcolor="#2365ED"><div align="center"><img src="logo copy.jpg" width="134" height="130"></div></TD>
    <TD COLSPAN=9 bgcolor="#2365ED"><table width="561" border="0" align="left">
     
	  <tr>
        <td width="555" height="97" align="center" valign="middle"><p align="center" class="style28">
		<h1><font face="Palatino Linotype" color="#FFFFFF"><? echo "" . $_SESSION["userid"]; ?></font></h1>
		</p></td>
      </tr>
      <tr>
        <td height="49" align="center" valign="middle"><a href="signin.php"></a></td>
      </tr>
    </table></TD>
    <TD COLSPAN=2 bgcolor="#2365ED"><a href="http://www.facebook.com"></a></TD>
    <TD width="49" bgcolor="#2365ED"><a href="http://www.twitter.com"></a></TD>
    <TD width="56" bgcolor="#2365ED"><a href="signin.php">Signout</a><a href="http://www.youtube.com"></a></TD>
  </TR>
  <TR>
    <TD COLSPAN=16 bgcolor="#2365ED"><div id="ddtopmenubar" class="mattblackmenu">
<?php include("includes/menu.php") ?></TD>
  </TR>
  <TR>
    <TD COLSPAN=16 align=center></TD>
  </TR>
  <TR>
    <TD COLSPAN=16 bgcolor="#2365ED">&nbsp;</TD>
  </TR>
  <TR>
    <TD height="26" COLSPAN=16 bgcolor="#000045"><p align="center" class="style36 style2"><strong>School Leaving  Form </strong></p></TD>
  </TR>
  <TR>
    <TD height="282" colspan="16" valign="top" bgcolor="#FFFF66">
	
      <table width="703" border="0" align="center">
	  <form action="leaving_app.php" method="post">
        <tr>
          <td colspan="4"><?php 
	  if(isset($_GET['Message'])){
    echo $_GET['Message'];
}
	?></td>
          </tr>
        <tr>
          <td><span class="style4">Admission #</span></td>
          <td><span class="style4">
            <input name="std_rollno" type="text" id="std_rollno"  size="25"/>
          </span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><span class="style4">This is to certify that </span></td>
          <td><span class="style4">
            <input name="std_name" type="text" id="std_name" size="25"/>
          </span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><span class="style4">Son / Daughter of </span></td>
          <td><span class="style4">
            <input name="father_name" type="text" id="father_name" size="25"/>
          </span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><span class="style4">was admitted to this school on  </span></td>
          <td><span class="style4">
            <input name="adate" type="text" id="adate" value="<? echo $today ?>" size="25"/>
          </span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><span class="style4">and left on </span></td>
          <td><span class="style4">
            <input name="ldate" type="text" id="ldate" value="<? echo $today ?>" size="25"/>
          </span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><span class="style4">He She was studying in class <span class="style2"></span></span></td>
          <td><span class="style4">
            <select name="class_name" id="class_name">
              <?php
  while($user_data3=mysql_fetch_array($data3))
  {
  ?>
              <option value="<? echo $user_data3['subname']; ?>"><? echo $user_data3["subname"]; ?></option>
              <?php
  }
  ?>
            </select>
          </span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><span class="style4">His / Her date of birth in accourdnace with the school record is </span></td>
          <td><span class="style4">
            <input name="dob" type="text" id="dob" value="<? echo $today ?>" size="25"/>
          </span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><strong>He / She has been promoted to class </strong></td>
          <td><span class="style4">
            <input name="fno" type="text" id="fno" value="0" size="25"/>
          </span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
		
        <tr>
          <td>&nbsp;</td>
          <td><div align="right">
            <input type="submit" value="Save" />
          </div></td>
          <td><input type="reset" name="Submit2" value="Refresh"></td>
          <td>&nbsp;</td>
        </tr>
		</form>
      </table>
    </TD>
  </TR>
  <TR>
    <TD height="27" COLSPAN=16 bgcolor="#2365ED"><?php

include 'dbc.php';


$userid=$_SESSION["userid"];
$result = mysql_query("SELECT * FROM leaving where user_id='$userid' ORDER BY id desc");
echo "<table border=1 width=80% align=center bgcolor=#FFFF66>";
echo "<tr>";
echo "<th bgcolor=yellow> ID </th>";
echo "<th bgcolor=yellow> Date </th>";
echo "<th bgcolor=yellow> Admission # </th>";
echo "<th bgcolor=yellow> Student Name </th>";
echo "<th bgcolor=yellow> Father Name </th>";
echo "<th bgcolor=yellow> Admission Date </th>";
echo "<th bgcolor=yellow> Leave Date </th>";
echo "<th bgcolor=yellow> Class Name </th>";
echo "<th bgcolor=yellow> Date of birth </th>";
echo "<th bgcolor=yellow> Promoted </th>";

echo "</tr>";
while($row = mysql_fetch_array($result))
 
  {
  $id = $row['id'];	
   echo "<tr>";
echo "<td>" .$row['id'] . "</td>";
echo "<td>" .$row['date'] . "</td>";
 echo "<td>" .$row['std_rollno'] . "</td>";
 echo "<td>" .$row['std_name'] . "</td>";
    echo "<td>" .$row['father_name'] . "</td>";
     echo "<td>" .$row['adate'] . "</td>";
   
  echo "<td>" .$row['ldate'] . "</td>";
    echo "<td>" .$row['class_name'] . "</td>";
	 
	  echo "<td>" .$row['dob'] . "</td>";
echo "<td>" .$row['fno'] . "</td>";
	   
		
		   
		  echo"<td> <a href ='print_leaving.php?id=$id'>Print</a>";
		
  echo "</tr>";


  }
 
echo "</table>";

?></TD>
  </TR>
  
  <TR>
  
	
	</TD>
  </TR>
  
</TABLE>
<!-- End ImageReady Slices -->
</BODY>
</HTML>
<?Php
}
?>