Advertisement
Advertisement
| 04.19.2008 at 01:13PM PDT, ID: 23336986 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: |
<?php
// declare what url to look in and count each file within that directory
$dir = "images/temp/member/";
$count = count(glob($dir . "*"));
// test if count has found the files in the temp image dir.
echo "count is";
echo $count;
// Open the folder for display
$dir_handle = @opendir($dir) or die("Unable to open $dir");
// asign the amount of files in the temp dir above to the variable $nFish
$nFish = $count;
echo "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"array3.php\">\n";
echo " <table width=\"600\" border=\"0\">\n";
echo " <tr>\n";
echo " <td><p>Amount of Fish (" . $nFish . ")</p>\n";
echo " <p> </p></td>\n";
echo " <td>fish_type</td>\n";
echo " <td>bait</td>\n";
echo " <td>notes</td>\n";
echo " <td>Date</td>\n";
echo " <td>Image Preview</td>\n";
echo " </tr>\n";
for ($i = 1; $i <= $nFish; $i++) {
echo " <tr>\n";
echo " <td><div align=\"center\">" . $i . "</div></td>\n";
echo " <td><input name=\"fish_type_$i\" type=\"text\" id=\"fish_type_$i\" /></td>\n";
echo " <td><input name=\"bait_$i\" type=\"text\" id=\"bait_$i\" /></td>\n";
echo " <td><input name=\"notes_$i\" type=\"text\" id=\"notes_$i\" /></td>\n";
echo " <td><input type=\"text\" id=\"date$i\" name=\"date$i\" /></td>\n";
echo " <td><button id=\"trigger\">Click here for Calendar</button></td>";
echo " <td><img src=\"images/bart_logo.jpg\" width=\"264\" height=\"102\" /></td><br>";
echo " </tr>\n";
?>
<script type="text/javascript">
Calendar.setup(
{
inputField : "date<?php echo $i; ?>", // ID of the input field
ifFormat : "%Y-%m-%d", // the date format
button : "trigger" // ID of the button
}
);
</script>
<?php
echo " </tr>\n";
}
echo " <tr>\n";
echo " <td colspan=\"4\"><div align=\"center\">\n";
echo " <input type=\"submit\" name=\"Submit\" value=\"Submit\" />\n";
echo " </div></td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</form>\n";
?>
|