how to do this processing....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,
 
Would anyone have some logic ideas on how to do this processing given
the following HTML?
 
<form action="insert_threads_patterns.php" method="POST">
<tr>
                <td class="adminthreadsDisplayHeader"
align="center">Selected?</td>
                <td class="adminthreadsDisplayHeader"
align="left">Manufacturer</td>
                <td class="adminthreadsDisplayHeader"
align="left">Colour #</td>
                <td class="adminthreadsDisplayHeader"
align="left">Colour</td>
                <td class="adminthreadsDisplayHeader" align="center">Can
Order?</td>
</tr>
<input type="hidden" name="thread_index" value="1">
<input type="hidden" name="pattern_index" value="2">
 
<tr valign="top">
                <td class="adminthreadsDisplayText"
align="center"><input type="checkbox" name="select[]" value="1" ></td>
                <td class="adminThreadsDisplayText"
align="left">DMC</td>
                <td class="adminthreadsDisplayText"
align="left">B5200</td>
                <td class="adminthreadsDisplayText" align="left">Snow
white</td>
                <td class="adminthreadsDisplayText"
align="center"><input type="checkbox" name="avail[]" value="1" ></td>
</tr>
 
<input type="hidden" name="thread_index" value="2">
<input type="hidden" name="pattern_index" value="2">
 
<tr valign="top">
                <td class="adminthreadsDisplayText"
align="center"><input type="checkbox" name="select[]" value="1"
checked></td>
                <td class="adminThreadsDisplayText"
align="left">DMC</td>
                <td class="adminthreadsDisplayText"
align="left">001</td>
                <td class="adminthreadsDisplayText"
align="left">white</td>
                <td class="adminthreadsDisplayText"
align="center"><input type="checkbox" name="avail[]" value="1"
checked></td>
</tr>
 
<input type="hidden" name="thread_index" value="3">
<input type="hidden" name="pattern_index" value="2">
 
<tr valign="top">
                <td class="adminthreadsDisplayText"
align="center"><input type="checkbox" name="select[]" value="1" ></td>
                <td class="adminThreadsDisplayText"
align="left">DMC</td>
                <td class="adminthreadsDisplayText"
align="left">ecru</td>
                <td class="adminthreadsDisplayText"
align="left">ecru</td>
                <td class="adminthreadsDisplayText"
align="center"><input type="checkbox" name="avail[]" value="1" ></td>
</tr>
 
<input type="hidden" name="thread_index" value="4">
<input type="hidden" name="pattern_index" value="2">
 
<tr valign="top">
                <td class="adminthreadsDisplayText"
align="center"><input type="checkbox" name="select[]" value="1" ></td>
                <td class="adminThreadsDisplayText"
align="left">DMC</td>
                <td class="adminthreadsDisplayText"
align="left">150</td>
                <td class="adminthreadsDisplayText" align="left">ultra
very dark ...</td>
                <td class="adminthreadsDisplayText"
align="center"><input type="checkbox" name="avail[]" value="1" ></td>
</tr>
<tr valign="top">
                <td colspan="5"><input type="submit" value="Save"
name="addIt" class="adminInputBox"></td>
</tr>
</form>
 
If a displayed record was selected (select[]) then store the
corresponding pattern_index and thread_index into a table.
 
Additionally, if the avail{} checkbox was selected for the corresponding
records then store the value of "1" in the table as well.
 
Sample table output would look like:
 
+----+---------------+--------------+-------+
| id | pattern_index | thread_index | avail |
+----+---------------+--------------+-------+
|  1 |             2 |            2 |     1 |
|  2 |             2 |            5 |     0 |
|  3 |             2 |           14 |     1 |
+----+---------------+--------------+-------+
 
Any ideas? *begging here*
 
Thanks!
 
Aaron

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux