Hello!
I was wondering if someone can take a look at the following if and else statement and point out what I have written incorrectly. In its current form, I cannot get it to work. So, essentially, I'm trying to construct an if conditional statement within another if statement.
$var_test ="25";
$play_envir ="Open Play";
//In my complete code; $play_envir variable could be any of the following:"Open Play, Robotic Training, Coaching Session "
if($var_test >'0' )
//if credit exists, payment will be deducted from credit
{
if ( $play_envir == "Open Play" ) {
echo "Your fee for today is <font color='white'>$$open_play.00</font> <br /><img border='0' src='images/form-flashing-arrow.gif' width='45' height='26'><span style='background-color:white'><font color='green' size='5'>Payment Will be Deducted from your Credit on file!</font></span><br /> <font color='white' size='3'>Thank you $firstname, and have a great work-out!</font>";
}
elseif ( $play_envir == "Robotic Training" ) {
echo "Your fee for today is <font color='white'>$$robotic_play.00 per 30 minute block</font> <br /><img border='0' src='images/form-flashing-arrow.gif' width='45' height='26'><span style='background-color:white'><font color='green' size='5'>Payment Will be Deducted from your Credit on file!</font></span><br /><font color='white' size='3'>Thank you $firstname, and have a great work-out!</font>";
}
elseif ( $play_envir == "Coaching Session" ) {
echo "<font color='red'>Please see Club Management for today's coaching fee</font><br /><font color='white' size='3'>Thank you $firstname, and have a great work-out!</font>";
}
elseif ( $play_envir == "Open Play and Coaching Session" ) {
echo "<font color='red'>Please see Club Management for today's fee</font><br /><font color='white' size='3'>Thank you $firstname, and have a great work-out!</font>";
}
elseif ( $play_envir == "Robotic Training and Coaching Session" ) {
echo "<font color='red'>Please see Club Management for today's fee</font><br /><font color='white' size='3'>Thank you $firstname, and have a great work-out!</font>";
}
elseif ( $play_envir == "Open Play and Robotic Training" ) {
echo "For these selections, please pay a <font color='white'>$$play_combo.00 deposit</font>, the balance after playing!<br /><font color='red' size='8'><img border='0' src='images/form-flashing-arrow.gif' width='65' height='36'>Please Pay First!</font><br /><font color='white' size='3'>Thank you $firstname, and have a great work-out!</font>";
}
elseif ( $play_envir == "Open Play and Robotic Training and Coaching Session" ) {
echo "<font color='red'>Please see Club Management for today's fee</font><br /><font color='white' size='3'>Thank you $firstname, and have a great work-out!</font>";
}
}
// else we need a payment amount indicated
else
{
if ($play_envir == "Open Play" ) {
echo "Your fee for today is <font color='white'>$$open_play.00</font> <br /><font color='red' size='8'><img border='0' src='images/form-flashing-arrow.gif' width='65' height='36'>Please Pay First!</font><br /> <font color='white' size='3'>Thank you $firstname, and have a great work-out!</font>";
}
if ( $play_envir == "Robotic Training" ) {
echo "Your fee for today is <font color='white'>$$robotic_play.00 per 30 minute block</font> <br /><font color='red' size='8'><img border='0' src='images/form-flashing-arrow.gif' width='65' height='36'>Please Pay First!</font><br /><font color='white' size='3'>Thank you $firstname, and have a great work-out!</font>";
}
elseif ( $play_envir == "Coaching Session" ) {
echo "<font color='red'>Please see Club Management for today's coaching fee</font><br /><font color='white' size='3'>Thank you $firstname, and have a great work-out!</font>";
}
elseif ( $play_envir == "Open Play and Coaching Session" ) {
echo "<font color='red'>Please see Club Management for today's fee</font><br /><font color='white' size='3'>Thank you $firstname, and have a great work-out!</font>";
}
elseif ( $play_envir == "Robotic Training and Coaching Session" ) {
echo "<font color='red'>Please see Club Management for today's fee</font><br /><font color='white' size='3'>Thank you $firstname, and have a great work-out!</font>";
}
elseif ( $play_envir == "Open Play and Robotic Training" ) {
echo "For these selections, please pay a <font color='white'>$$play_combo.00 deposit</font>, the balance after playing!<br /><font color='red' size='8'><img border='0' src='images/form-flashing-arrow.gif' width='65' height='36'>Please Pay First!</font><br /><font color='white' size='3'>Thank you $firstname, and have a great work-out!</font>";
}
elseif ( $play_envir == "Open Play and Robotic Training and Coaching Session" ) {
echo "<font color='red'>Please see Club Management for today's fee</font><br /><font color='white' size='3'>Thank you $firstname, and have a great work-out!</font>";
}
}
I would appreciate any thoughts on this.
Mossa