I want a script that loops through each folder. Each time, it gets the documents from the folder, formats them with the name of the doc and a hyperlink and them displays them in a table that is at least 3 columns wide. The rows will vary for each folder: 2 documents will have one row, 15 documents will have 5, etc.
I can get everything but the logic for the table. It is driving me batty.
Here is what I have so far (and is this the most efficient way of doing it?):
Code: Select all
<?php
for ($year=2012; $year>=2004; $year--) {
echo "<table border='1' width='90%'><tr><th class='columnheader' colspan='3'>".$year."</th></tr>\n";
$file=scandir($year);
$result=count($file)-2;
$columns = 3;
foreach ($file as $key => $value) {
$split = str_split($value, 2);
$NoteMonth = $split[0];
$NoteDay = $split[1];
if (($NoteMonth == ".")||($NoteMonth == "..")) {
} else {
echo "<tr>";
echo "<td><a href='/econ/epd/chiefnotes/".$year."/".$value."'>".(date("F d", mktime(0,0,0,$NoteMonth,$NoteDay, 0)))."</a></td>";
echo "</tr>\n";
}
}
}
echo "</table>\n";
?>
Joe