[ PHPXref.com ] [ Generated: Sun Jul 20 20:12:55 2008 ] [ Scout Tracker 0.13 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/includes/ -> view_document.php (source)

   1  <?php
   2  if ($script_name = basename($HTTP_SERVER_VARS["SCRIPT_NAME"]) == "view_document.php" ) {
   3   print "<meta http-equiv=\"refresh\" content=\"0; URL=../index.php\">";
   4   exit;
   5  }
   6  
   7  print "<h2>Documents</h2>";
   8  
   9  $cnt = 0;
  10  $pdf = 'N';
  11  
  12  print "<table class=white border=1 width=50%>
  13    <tr align=center>
  14      <td width=50%><b>File Name</td>
  15      <td><b>Description</td>
  16      <td width=35px ><b>Type</td>
  17    </tr>";
  18  
  19  $sql = mysql_query("SELECT * FROM tbl_files where view='Y' ORDER BY filename ASC");
  20  
  21  while ($row = mysql_fetch_assoc($sql)) {
  22    $key = $row['filename'];
  23    $file_name = str_replace('_',' ',$row['filename']);
  24    $description = stripslashes($row['description']);
  25    $type = split('/',$row['filetype']);
  26    $type = $type[count($type) - 1];
  27    $type = strtoupper($type);
  28    if ($type == 'PDF') {
  29     $type = "<img src=./images/pdficon.gif width=30 height=30>";
  30     $pdf = 'Y';
  31    } else if ($type == 'VND.MS-EXCEL') {
  32     $type = "<img src=./images/xlsimage.gif width=30 height=30>";
  33    } else if ($type == 'MSWORD') {
  34     $type = "<img src=./images/docimage.gif width=30 height=30>";
  35    }
  36    
  37    $cnt += 1;
  38    print "<tr>";
  39    print "<td>&nbsp<a href=./download_document.php?file=$key>$file_name</a></td><td>$description</td><td align=center>$type</td></tr>";
  40  }
  41  mysql_free_result($sql);
  42  
  43  print "</table>\n";
  44  print "<p>Adobe Acrobat Reader is required to view all PDF documents.
  45    <br><a href=http://www.adobe.com/products/acrobat/readermain.html target=_blank><img src=./images/getacro.gif></a></p>";
  46  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]