I've got a complex problem (to me).
I have a page in which a user enters a beginning date and an end day (the difference +1 is duration). The next page (portion shown below) provides an html page with several arrays of array[$itin]. I want to place a checkbox and the logic that will "duplicate" the previous entries values into that array slot.
For instance, Day 1 is unique, day 2 is unique, days 3 and 4 are identical to day 2. Instead of re-entering the day 2 title and description, a checkbox is selected and nothing more needs to be done.
Following that, how do I generate the SQL statement to insert these array elements into a table?
Thanks.
<?php
for($itin = 1; $itin <= $duration; $itin++)
{
echo "<td>Day $itin Title: ";
if($itin==1){
echo "</td><tr><td>\n";
} else {
$itinm1= $itin -1;
echo " <input type=\"checkbox\" name=\"duplicate\" value=\"Repeat\"> Repeat of day $itinm1</td><tr><td>\n";
}
echo "<input type='text' size=50 MAXLENGTH-125 value=\"Day #$itin Title\" name='title[$itin]' /></td><tr>\n";
echo "<input type=\"hidden\" name=\"day\" value=\"day[$itin]\">
";
echo "<input type=\"hidden\" name=\"tourid\" value=\"tourid[$itin]\">
";
echo "<td>Day $itin Description: </td><tr><td>
<textarea rows=\"4\" cols=\"47\" name='desc[$itin] wrap=\"physical\"' />Enter the description of Day #$itin here.</textarea></td><tr>
";
} ?>