<?php
/*******************************************************************************
** File : fod_att.php **
** Author : G.Ramkumar **
** Description : Dispalying the attachments **
** Date : 14/07/2005 **
** Last Modified : 02/08/2005 **
** PHP Version : 5.0.3 **
** **
*******************************************************************************/
$dir="login/tmp/attachments";
if (is_dir($dir))
{
if ($dh = opendir($dir))
{
while (($file = readdir($dh)) !== false)
{
if(($file != ".") && ($file != ".."))
{
$img=explode(".",$file);
if($img[0]==$id)
{
$path=pathinfo($file);
$name=$path['extension'];
if($name == "jpg" || $name =="gif" || $name =="bmp" )
$image='<img src="login/tmp/attachments/'.$file.'" border="0" alt="'.trim($Fodspotnews_res[0]['alt_tag']).'" width="'.$width__.'" hspace="10" height="'.$height__.'">';
if($name =="doc" || $name=="rtf" || $name=="txt" || $name=="ppt" || $name=="xls" || $name=="pdf" || $name=="wmv")
{
if($name=="doc")
$icon='<img src="images/doc.gif" border="0">';
if($name=="ppt")
$icon='<img src="images/ppt.gif" border="0">';
if($name=="xls")
$icon='<img src="images/xls.gif" border="0">';
if($name=="rtf")
$icon='<img src="images/doc.gif" border="0">';
if($icon!="")
$link=$icon.' <a href="attachments.php?id='.$file.'" class="contblack" target="new">'.$file.'</a>';
else
$link='<ul><li><a href="attachments.php?id='.$file.'" class="contblack" target="new">'.$file.'</a></li></ul>';
}
}
}
}
closedir($dh);
}
}
?>