T
|
thesofa 10/2/2008 |
I have several location that will use my app. They will all have the option to check multiple boxes. let say the user checks material issue but they are in Texas. I need just the email to go to texas not Ohio or other places. material Field Branches field (consists of 4 places) it's a drop down box on the form. This code works for one location: [codebox]If($values["Material_Issue"] == True){ $email="you@who.com"; $message=""; $subject="Cleveland - Root Cause Entry for Material Issue"; foreach($values as $field=>$value) $message.= $field." : ".$value."\r\n"; mail($email, $subject, $message); }[/codebox] I tried this for multiple locations and couldn't get it to work: [codebox]If($values["Material_Issue"] == True){ } elseif($values["Branches"] == "Ohio"){ $email="you@who.com"; $message=""; $subject="Ohio - Root Cause Entry for Material Issue"; foreach($values as $field=>$value) $message.= $field." : ".$value."\r\n"; mail($email, $subject, $message); } elseif($values["Branches"] == "Texas"){ $email="you@who.com"; $message=""; $subject="Texas - Root Cause Entry for Material Issue"; foreach($values as $field=>$value) $message.= $field." : ".$value."\r\n"; mail($email, $subject, $message); }[/codebox] Hope someone can help me with this one. Thx!
|
U
|
Urnso author 10/2/2008 |
That could work. I would need to make another table for the email addresses too (multiple branches = multiple emails). Plus another query to get the data. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=33618&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' /> |
T
|
thesofa 10/2/2008 |
If($values["Material_Issue"] == True)
If($values["Material_Issue"] == True)
If(($values["Material_Issue"] == True) AND ($values["Branches"] == "Ohio"))
|