Please help with Parse error: syntax error, unexpected T_ELSE line 97
<?php
# coruses.php
# Seth Johnson
# Assingment 3
# ITEC 325
# display grades and gpa from courses
?>
<?php
session_start();
// establish session variable that has name
$_SESSION['name'] = $_POST['name'];
$firstn = $_SESSION['name'];
?>
<html>
<head><title>Assignment 3</title></head>
<style type = "text/css">
div.body
{
border-color: red;
border-style: solid;
border-width: 10px;
padding: 15px;
}
p.border2
{
border-color: black;
border-style: solid;
border-width: 5px;
padding: 10px;
text-align:center;
}
p.bold
{
font-weight:bold;
text-align:center;
}
p.light
{
font-weight:lighter;
text-align:center;
}
</style>
<body>
<div class = "body">
<p class ="border2">PHP file - courses.php</p>
<?php
echo "<p class ='bold'>GPA Details for: $firstn</p>";
?>
<?php
//database connection
require('dbconn.php');
$gpa = $_POST["gpa"];
if($gpa == "allCourses")
echo "<p class ='light'>All Courses <br /></p>";
{
$sqlselrows = "SELECT * FROM $table";
echo "<p style=\"font-weight:bold\">";
if ($result = mysql_query($sqlselrows,$conn))
// { echo "retrieved data from table <br />";}
// else
// { echo "data not retrieved <br />"; }
echo "</p>";
echo "<p class ='light'>";
echo "<table border='2'>";
echo " <th>Semester</th> ";
echo " <th> Department </th> ";
echo " <th> Courses </th> ";
echo " <th> Hours </th> ";
echo " <th> Grade </th> ";
echo " <th> In-Major </th>";
while ($row = mysql_fetch_array($result))
{
echo "<tr>";
for ($i=0;$i<6;$i++)
{
echo "<td>";
echo "$row[$i]";
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
echo "</p>";
}
else
{
if($gpa == "inMajor")
{
echo "<p class ='light'>In-Major Courses <br /></p>";
$sqlselrows = "SELECT * FROM $table WHERE `inMajor`=\'Y\' ";
echo "<p style=\"font-weight:bold\">";
if ($result = mysql_query($sqlselrows,$conn))
// { echo "retrieved data from table <br />";}
// else
// { echo "data not retrieved <br />"; }
echo "</p>";
echo "<p class ='light'>";
echo "<table border='2'>";
echo " <th>Semester</th> ";
echo " <th> Department </th> ";
echo " <th> Courses </th> ";
echo " <th> Hours </th> ";
echo " <th> Grade </th> ";
echo " <th> In-Major </th>";
while ($row = mysql_fetch_array($result))
{
echo "<tr>";
for ($i=0;$i<6;$i++)
{
echo "<td>";
echo "$row[$i]";
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
echo "</p>";
}
else
{
echo "<p class ='light'>ITEC Courses <br /></p>";
$sqlselrows = "SELECT * FROM $table WHERE `dept`=\'ITEC\'";
echo "<p style=\"font-weight:bold\">";
if ($result = mysql_query($sqlselrows,$conn))
// { echo "retrieved data from table <br />";}
// else
// { echo "data not retrieved <br />"; }
echo "</p>";
echo "<p class ='light'>";
echo "<table border='2'>";
echo " <th>Semester</th> ";
echo " <th> Department </th> ";
echo " <th> Courses </th> ";
echo " <th> Hours </th> ";
echo " <th> Grade </th> ";
echo " <th> In-Major </th>";
while ($row = mysql_fetch_array($result))
{
echo "<tr>";
for ($i=0;$i<6;$i++)
{
echo "<td>";
echo "$row[$i]";
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
echo "</p>";
}
}
?>
<p class ="border2">All classes should be lised sorted by semester and
dept.</p>
<p class ="bold">GPA Calculation</p>
<p class ="border2">Grade credits = hrs x grade (4-A, etc.)</p>
</div>
<h2>Source Code</h2>
<p>
<?php
show_source(__FILE__);
?>
</p>
</body>
</html>