Support Incident Tracker GIT4.x
ftp_file_details.php
Go to the documentation of this file.
00001 <?php
00002 // ftp_file_details.php -
00003 //
00004 // SiT (Support Incident Tracker) - Support call tracking system
00005 // Copyright (C) 2010-2011 The Support Incident Tracker Project
00006 // Copyright (C) 2000-2009 Salford Software Ltd. and Contributors
00007 //
00008 // This software may be used and distributed according to the terms
00009 // of the GNU General Public License, incorporated herein by reference.
00010 //
00011 
00012 // Author: Ivan Lucas <ivanlucas[at]users.sourceforge.net>
00013 
00014 // This Page Is Valid XHTML 1.0 Transitional!   4Nov05
00015 
00016 require ('core.php');
00017 $permission = PERM_FILE_PUBLISH; // Publish Files to FTP site
00018 require (APPLICATION_LIBPATH . 'functions.inc.php');
00019 
00020 // This page requires authentication
00021 require (APPLICATION_LIBPATH . 'auth.inc.php');
00022 
00023 // display file details
00024 include (APPLICATION_INCPATH . 'htmlheader.inc.php');
00025 
00026 // External Vars
00027 $id = clean_int($_REQUEST['id']);
00028 $title = $strFTPFileDetails;
00029 
00030 $sql = "SELECT * FROM `{$dbFiles}` WHERE id='{$id}' AND category='ftp' ";
00031 $result = mysql_query($sql);
00032 if (mysql_error()) trigger_error("MySQL Query Error ".mysql_error(), E_USER_WARNING);
00033 $obj = mysql_fetch_object($result);
00034 
00035 // calculate filesize
00036 $j = 0;
00037 $ext = array($strBytes, $strKBytes, $strMBytes, $strGBytes, $strTBytes);
00038 $pretty_file_size = $obj->size;
00039 while ($pretty_file_size >= pow(1024,$j)) ++$j;
00040 $pretty_file_size = round($pretty_file_size / pow(1024,$j-1) * 100) / 100 . ' ' . $ext[$j-1];
00041 
00042 echo "<h2>{$title}</h2>";
00043 echo "<table summary='file-details' align='center' width='60%' class='vertical'>";
00044 echo "<tr><th>File:</th><td><img src='".getattachmenticon($obj->filename)."' alt=\"{$obj->filename} ({$pretty_file_size})\" border='0' />";
00045 echo "<strong>{$obj->filename}</strong> ({$pretty_file_size})</td></tr>";
00046 if ($obj->path == '')
00047 {
00048     $ftp_path = $CONFIG['ftp_path'];
00049 }
00050 else
00051 {
00052     $ftp_path = $CONFIG['ftp_path'].mb_substr($obj->path,1).'/';
00053 }
00054 
00055 echo "<tr><th>Location:</th><td><a href='ftp://{$CONFIG['ftp_hostname']}{$ftp_path}{$obj->filename}'><code>'ftp://{$CONFIG['ftp_hostname']}{$ftp_path}{$obj->filename}</code></a></td></tr>";
00056 echo "<tr><th>Title:</th><td>{$obj->shortdescription}</td></tr>";
00057 echo "<tr><th>Web Category:</th><td>{$obj->webcategory}</td></tr>";
00058 echo "<tr><th>Description:</th><td>{$obj->longdescription}</td></tr>";
00059 echo "<tr><th>File Version:</th><td>{$obj->fileversion}</td></tr>";
00060 echo "<tr><th>File Date:</th><td>".ldate($CONFIG['dateformat_filedatetime'], $obj->filedate)." <strong>by</strong> ".user_realname($obj->userid, TRUE)."</td></tr>";
00061 
00062 if ($obj->expiry > 0)
00063 {
00064     echo "<tr><th>Expiry:</th><td>".ldate($CONFIG['dateformat_filedatetime'], $obj->expiry)."</td></tr>";
00065 }
00066 echo "</table>\n";
00067 echo "<p align='center'>";
00068 echo "<a href='ftp_delete.php?id={$id}'>Delete this file</a> | ";
00069 echo "<a href='ftp_edit_file.php?id={$id}'>Describe and Publish this file</a></p>";
00070 include (APPLICATION_INCPATH . 'htmlfooter.inc.php');
00071 ?>