<?php 
session_start();
include("include/header.php");

$dtitle = "Mississauga Area School Lunch Catering Service – Catering to Kids lunches"; 
$dtags = "catering for schools, school lunch lady, school lunches delivered, school hot lunch, elementary school lunch, school lunches, hot lunch program, lunch program, public school lunches, lunch programs, school meal program, school food programs, school food program,kids";
$ddesc = "Lunch Pails provides delicious, nutritious, and reliable hot or cold lunches for school children, delivered right to the school - servicing Mississauga, Brampton, West Toronto, Milton, Oakville, Georgetown and Caledon.";

if(trim($_SESSION['pName'])== "" || trim($_SESSION['pID'])=="")
{
	echo "<script>";
	echo "location.replace('orderOnline.php?msgErr=2');";
	echo "</script>";

}

?>
<tr><td width="900" class="fs15 blue">
    <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
	<tr><td width="25"><img src="images/space.gif" width="25" height="1" alt=""></td>
		<td width="850">
      		<table border="0" cellpadding="0" cellspacing="0" width="100%">
            	<tr><td colspan="2">&nbsp;</td></tr>
                <tr><td width="50%" class="homet black"><div id="paAccount">Welcome <b><?=$_SESSION['pName']?></b></div></td>
				<td width="50%" align="right" class="fs12 onlines">

					<?php

					echo "<a href='#' onClick='javascript:window.open(\"edit_parent.php\",\"EDIT ACCOUNT\",\"menubar=1,resizable=1,width=400,height=400,scrollbars=1\");' >EDIT ACCOUNT</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";

					echo "<a href='#' onClick='javascript:window.open(\"add_newstudent.php\",\"ADD STUDENT\",\"menubar=1,resizable=1,width=450,height=400,scrollbars=1\");' >ADD STUDENT</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";

					?>

					
					<a class="deco" href="orderOnline.php?action=LOGOUT" title="Logout">LOGOUT</a>

				</td></tr>

                <tr><td colspan="2"><hr/></td></tr>
                <tr><td colspan="2" class="fs10">&nbsp;</td></tr>
                <tr><td colspan="2" class="fs12">Student(s):</td></tr>
                <tr><td colspan="2"><hr/></td></tr>
				<?php

				$strSql = mysql_query("select c.school_name,a.student_id,a.student_fname,a.student_lname,b.teacher_name,d.grade_name from tr_student a left join tr_teachers b on b.teacher_id=a.teacher left join tr_schools c on c.school_id=a.school_id left join ma_grades d on d.grade_id=a.grade where a.status=1 and a.parent_id='".$_SESSION['pID']."'");
				$rsc=@mysql_num_rows($strSql);		
				if($rsc>0)
				{
					$x=0;
					while($rs=@mysql_fetch_array($strSql))
					{
						$x=$x+1; 
						?>
						<tr><td width="50%" class="fs12 black"><?=$x?>.) <?=trim($rs['student_fname'])." ". trim($rs['student_lname'])?></b></td><td width="50%" align="right" class="fs12 onlines">

						<!-- <a class="deco" href="editAccount.php" title="Edit Student">EDIT STUDENT</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<a class="deco" href="addStudent.php" title="Add Student">VIEW ORDER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<a class="deco" href="addStudent.php" title="Add Student">NEW ORDER -->


						<?php

						$stid=$rs['student_id'];

						echo "<a href='#' onClick='javascript:window.open(\"edit_student.php?id=".$stid."\",\"EDIT STUDENT\",\"menubar=1,resizable=1,width=700,height=400,scrollbars=1\");' >EDIT STUDENT</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";

						echo "<a href='#' onClick='javascript:window.open(\"new_order.php\",\"NEW ORDER\",\"menubar=1,resizable=1,width=700,height=400,scrollbars=1\");' >NEW ORDER</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";

						?>
						</td></tr>
                        <tr><td colspan="2" class="fs12">Teacher Name: <?=trim($rs['teacher_name'])?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?=trim($rs['grade_name'])?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?=trim($rs['school_name'])?></td></tr>
                        <tr><td colspan="2"><hr/></td></tr>
					<?php
					}
				}
				?>                
                <tr><td colspan="2" height="100"></td></tr>
            </table></td>
		<td width="25"><img src="images/space.gif" width="25" height="1" alt=""></td></tr>
 	</table></td></tr>
	<?php
	$school=0;
	$grade=0;
	$tchrID=0;
	$paName="";
	$paEmail="";
	$paPassword="";
	$paPhone="";
	$paCell="";

	$strSql2 = mysql_query("SELECT name,email,password,contact_no,cell_no FROM tr_parent where parent_id='".$_SESSION['pID']."'");
	$rsc2=@mysql_num_rows($strSql2);		
	if($rsc2>0)
	{
		$rs2=@mysql_fetch_array($strSql2);

		$paName=trim($rs2['name']);
		$paEmail=trim($rs2['email']);
		$paPassword=trim($rs2['password']);
		$paPhone=trim($rs2['contact_no']);
		$paCell=trim($rs2['cell_no']);
	}
	

	$strSql3 = mysql_query("SELECT syID FROM ma_schoolyear where sStatus=1 order by syID desc limit 1");
	$rsc3=@mysql_num_rows($strSql3);		
	if($rsc3>0)
	{
		$rsc3=@mysql_fetch_array($strSql3);
		 $yearRef=$rsc3['syID'];
	}

include("include/footer.php");
?>




