Oops...I don't think you want to put an "elseif" after an "else". The "else" would cover every condition besides the "if", which would negate the need for another condition check. You might consider using the "switch()" statement instead if you can. The limitation in this case is that your conditions are all different, but you could use "switch(TRUE)" and put your conditions in the case section (not sure if that's as efficient).
I would discourage you from using that bracket placement. There's nothing more frustrating than trying to find a missing or extra bracket, and not having them line up in the code makes it all the more difficult. You should also use liberal indentation in your code to make it more readable.
In your example, the generally-accepted convention is:
if ($eval_total != $student_total)
{
OpenTable();
echo"<tr><td>Not all Peer Evaluation are complete for this course.</td></tr>";
echo"<tr><td><a href='javascript:history.back()'>[ Back ]</a></td></tr>";
CloseTable();
die();
}
else if (($CourseInfo['Course_Year'] == 1) && ($CourseInfo['Peer_Eval'] == 'No')) processM1Grades($Course_Number);
{
//if course year equals 2 they don't do peer evaluation at a course level but after each term so go process the grade.
}
else if ($CourseInfo['Course_Year'] == 2)
{
processM2Grades($Course_Number);
}
else
{
processM1Grades($Course_Number);
//Now check if they are not using peer evaluations if so then go straight to processM1Grades
}
I do it a little different, maybe because I'm a rebel but mostly because I like it better:
if ($eval_total != $student_total)
{
OpenTable();
echo"<tr><td>Not all Peer Evaluation are complete for this course.</td></tr>";
echo"<tr><td><a href='javascript:history.back()'>[ Back ]</a></td></tr>";
CloseTable();
die();
}
else if (($CourseInfo['Course_Year'] == 1) && ($CourseInfo['Peer_Eval'] == 'No')) processM1Grades($Course_Number);
{
//if course year equals 2 they don't do peer evaluation at a course level but after each term so go process the grade.
}
else if ($CourseInfo['Course_Year'] == 2)
{
processM2Grades($Course_Number);
}
else
{
processM1Grades($Course_Number);
//Now check if they are not using peer evaluations if so then go straight to processM1Grades
}
This way each conditional statement stands out, but either way is preferrable.