I'm sure this is probably fairly easy but I'm not sure how to go about creating my idea and so I'm looking for someone to lead me in the right direction.
Here's the idea. I have a flash system built where by users can select certain options when building a product. Not all options need to be selected, although selecting certain options is mandatory. Once the user is done, they confirm and place their order. Flash then passes all variables (option settings etc) to a PHP page. Using PHP I check to see which options have been selected and which options haven't been selected. This is done similar to the following:
Code: Select all
if ($_POST['option1'] != ""){
$txtMessage .= "<strong>Option 1 Details</strong><br />";
$txtMessage .= "Detail 1: " . $_POST['option1detail1'] . "<br />";
$txtMessage .= "Detail 2: " . $_POST['option1detail2'] . "<br />";
$txtMessage .= "Detail 3: " . $_POST['option1detail3'] . "<br />";
}
if ($_POST['option2'] != ""){
$txtMessage .= "<strong>Option 1 Details</strong><br />";
$txtMessage .= "Detail 1: " . $_POST['option2detail1'] . "<br />";
$txtMessage .= "Detail 2: " . $_POST['option2detail2'] . "<br />";
$txtMessage .= "Detail 3: " . $_POST['option2detail3'] . "<br />";
}
if ($_POST['option3'] != ""){
$txtMessage .= "<strong>Option 1 Details</strong><br />";
$txtMessage .= "Detail 1: " . $_POST['option3detail1'] . "<br />";
$txtMessage .= "Detail 2: " . $_POST['option3detail2'] . "<br />";
$txtMessage .= "Detail 3: " . $_POST['option3detail3'] . "<br />";
}
//Mandatory Information
$txtMessage .= "<strong>Option 4 Details</strong><br />";
$txtMessage .= "Detail 1: " . $_POST['option4detail1'] . "<br />";
$txtMessage .= "Detail 2: " . $_POST['option4detail2'] . "<br />";
$txtMessage .= "Detail 3: " . $_POST['option4detail3'] . "<br />";
As you can see from above, I have complied all of the options into the $txtMessage variable, which can then be sent as part of an HTML email or displayed as a print out page for the user.
The problem with my approach is that each option section will appear one right after each other in the email or print out. This is very unprofessional looking and not good for the trees (too much wasted space per page requires more paper when printing).
A much better approach would be to display each selected option section dynamically in a 2 or 3 column approach. In other words, as PHP determines which sections have been selected, it will organize these sections into a row of 2 or 3 columns before beginning a new row.
Hopefully this makes sense. The result should provide me with a much cleaner and organized order report while allowing the user to use much less paper during printing.
I appreciate any suggestions. Thanks!
Olimess