Search the Community
Showing results for tags 'eslseif'.
-
I am fairly new to PHP and I was tasked with migrading an app that runs on php 4+ enviroment into a 5.4 enviroment and I am getting warnings becasue its very old code, but I also would lie to know if there is a better way of writing the fallowing script of php code. It checks weather a member has attended a course and if so it charges a price if not its a different price and so on. Any help would be very appriciated. <?phpif ($semattend == 'MEMBER-ATTENDED') {$total = "<tr> <td height="30" align="right"><p><font color="#FF9900">*</font><font size="2">Total: </font></p></td> <td height="30" colspan="3" align="left"><font size="2"><input type="hidden" id = "amount" value="1299" name="amount" size="28">$1,299</font></td> </tr> <tr> <td colspan="3" align="left"><p>Search results indicate that you belong to a member instituion and have completed the Essentials of SEM course</p></td> </tr> <input type="hidden" id = "semstatus" value="MEMBER-ATTENDED" name=semstatus"> <input type="hidden" id = "attended" value="Attended Course" name="attended"> <input type="hidden" id = "member" value="Member" name="member">";} elseif ($semattend == 'MEMBER-NOTATTENDED') {$total = "<tr> <td height="30" align="right"><p><font color="#FF9900">*</font><font size="2">Total: </font></p></td> <td height="30" colspan="3" align="left"><font size="2"><input type="hidden" id = "amount" value="1799" name="amount" size="28">$1,799</font></td> </tr> <tr> <td colspan="3" align="left"><p>Search results indicate that you belong to a member instituion and have not completed the Essentials of SEM course</p></td> </tr> <input type="hidden" id = "semstatus" value="MEMBER-NOTATTENDED" name=semstatus"> <input type="hidden" id = "attended" value="Not Attended Course" name="attended"> <input type="hidden" id = "member" value="Member" name="member">"; } elseif ($semattend == 'NONMEMBER-ATTENDED') {$total = "<tr> <td height="30" align="right"><p><font color="#FF9900">*</font><font size="2">Total: </font></p></td> <td height="30" colspan="3" align="left"><font size="2"><input type="hidden" id = "amount" value="1599" name="amount" size="28">$1,599</font></td> </tr> <tr> <td colspan="3" align="left"><p>Search results indicate that you do not belong to a member instituion and have completed the Essentials of SEM course</p></td> </tr> <input type="hidden" id = "semstatus" value="NONMEMBER-ATTENDED" name=semstatus"> <input type="hidden" id = "attended" value="Attended Course" name="attended"> <input type="hidden" id = "member" value="Non Member" name="member">"; } elseif ($semattend == 'NONMEMBER-NOTATTENDED') {$total = "<tr> <td height="30" align="right"><p><font color="#FF9900">*</font><font size="2">Total: </font></p></td> <td height="30" colspan="3" align="left"><font size="2"><input type="hidden" id = "amount" value="2099" name="amount" size="28">$2,099</font></td> </tr> <tr> <td colspan="3" align="left"><p>Search results indicate that you do not belong to a member instituion and have not completed the Essentials of SEM course</p></td> </tr> <input type="hidden" id = "semstatus" value="NONMEMBER-NOTATTENDED" name=semstatus"> <input type="hidden" id = "attended" value="Not Attended Course" name="attended"> <input type="hidden" id = "member" value="Non Member" name="member">"; }echo $total;?>