I have the following custiom code to determine a meal choice from a dropdown i have two problems.
1. getting the value of thh meal so i can do a switch on the value.
2. i do this in two different pieces for two meals.
3. when done i need to add two valules together to get a total
4. the variables are defined as hidden variables.
<?php
$favcolor = $form->data['MealM'];
switch ($favcolor) {
case "Salmon":
echo "Your meal choice is Salmon";
$form->data['amt'] = 32;
break;
case "chicken":
echo "Your meal choice is chicken!";
$form->data['amt'] = 26;
break;
case "pork":
echo "Your meal choice is pork!";
$form->data['amt'] =32;
break;
default:
echo "No Match";
}
?>
Below is the addition php which needs to change
<?php
$form->data['cost'] = $form->data['amt'] + $form->data['amt1'];
?>
1. getting the value of thh meal so i can do a switch on the value.
2. i do this in two different pieces for two meals.
3. when done i need to add two valules together to get a total
4. the variables are defined as hidden variables.
<?php
$favcolor = $form->data['MealM'];
switch ($favcolor) {
case "Salmon":
echo "Your meal choice is Salmon";
$form->data['amt'] = 32;
break;
case "chicken":
echo "Your meal choice is chicken!";
$form->data['amt'] = 26;
break;
case "pork":
echo "Your meal choice is pork!";
$form->data['amt'] =32;
break;
default:
echo "No Match";
}
?>
Below is the addition php which needs to change
<?php
$form->data['cost'] = $form->data['amt'] + $form->data['amt1'];
?>