ajoute un test sur l'ouverture correct du dossier

This commit is contained in:
Rodolphe Quiedeville 2003-06-18 16:41:04 +00:00
parent 945e7f209b
commit 4eb1b70db4

View File

@ -151,31 +151,32 @@ if ($socid > 0)
$handle=opendir($upload_dir); $handle=opendir($upload_dir);
print '<table width="100%" border="1" cellpadding="3" cellspacing="0">'; if ($handle)
while (($file = readdir($handle))!==false)
{ {
if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
print '<table width="100%" border="1" cellpadding="3" cellspacing="0">';
while (($file = readdir($handle))!==false)
{ {
print '<tr><td>'; if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
echo '<a href="/document/societe/'.$socid.'/'.$file.'">'.$file.'</a>'; {
print "</td>\n"; print '<tr><td>';
echo '<a href="/document/societe/'.$socid.'/'.$file.'">'.$file.'</a>';
print '<td align="right">'.filesize($upload_dir."/".$file). ' bytes</td>'; print "</td>\n";
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($upload_dir."/".$file)).'</td>';
print '<td align="right">'.filesize($upload_dir."/".$file). ' bytes</td>';
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($upload_dir."/".$file)).'</td>';
print '<td>';
echo '<a href="'.$PHP_SELF.'?socid='.$socid.'&action=delete&urlfile='.urlencode($file).'">Delete</a>';
print "</td></tr>\n";
}
}
print '<td>'; print "</table>";
echo '<a href="'.$PHP_SELF.'?socid='.$socid.'&action=delete&urlfile='.urlencode($file).'">Delete</a>';
print "</td></tr>\n"; closedir($handle);
}
} }
print "</table>";
closedir($handle);
} }
else else
{ {