2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
15 define('TR_INCLUDE_PATH', '../include/');
16 require(TR_INCLUDE_PATH.'vitals.inc.php');
17 session_write_close();
19 $lang_variable = 'tile_progress';
21 $lang_variable = 'upload_progress';
25 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
26 <html lang="<?php echo $myLang->getCode(); ?>">
28 <title><?php echo _AT($lang_variable); ?></title>
29 <?php if ($_GET['frame']) { ?>
30 <META HTTP-EQUIV="refresh" content="3;URL=prog.php?frame=1">
32 <link rel="stylesheet" href="<?php echo $_base_path; ?>themes/<?php echo $_SESSION['prefs']['PREF_THEME']; ?>/styles.css" type="text/css" />
33 <meta http-equiv="Content-Type" content="text/html; <?php echo $myLang->getCharacterSet(); ?>" />
36 if ($_SESSION['done']) {
37 echo 'onload="parent.window.close();"';
41 if (!$_GET['frame']) { ?>
42 <a href="javascript:window.close();"><?php echo _AT('close'); ?></a>
43 <h3><?php echo _AT($lang_variable); ?></h3>
44 <p><small><?php echo _AT('window_auto_close'); ?></small></p>
47 <table border="0" align="center">
49 <td><img src="<?php echo TR_BASE_HREF; ?>images/transfer.gif" height="20" width="90" alt="<?php echo _AT($lang_variable); ?>"></td>
50 <td valign="middle"><iframe src="home/prog.php?frame=1" width="100" height="25" frameborder="0" scrolling="no" marginwidth="0" marginheight="1">
53 $tmp_dir = ini_get('upload_tmp_dir') . DIRECTORY_SEPARATOR;
55 $newest_file_name = '';
56 $newest_file_time = 0;
57 // get the name of the temp file.
58 if ($dir = @opendir($tmp_dir)) {
59 while (($file = readdir($dir)) !== false) {
60 if ((strlen($file) == 9) && (substr($file, 0, 3) == 'php')) {
61 $filedata = stat($tmp_dir . $file);
62 if ($filedata['mtime'] > $newest_file_time) {
63 $newest_file_time = $filedata['mtime'];
64 $newest_file_name = $file;
65 $size = $filedata['size'] / 1024;
72 $filedata = stat($tmp_dir . $_GET['t']);
73 $size = $filedata['size'] / TR_KBYTE_SIZE;
75 // not sure where these are displayed in the progress popup
78 echo '<em>'._AT('unknown').' </em> '._AT('kb');
80 echo number_format($size, 2).' '._AT('kb');