move code up one directory
[atutor.git] / users / prog_unused.php
1 <?php
2 /****************************************************************/
3 /* ATutor                                                                                                               */
4 /****************************************************************/
5 /* Copyright (c) 2002-2010                                      */
6 /* Inclusive Design Institute                                   */
7 /* http://atutor.ca                                                                                             */
8 /*                                                              */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License  */
11 /* as published by the Free Software Foundation.                                */
12 /****************************************************************/
13 // $Id$
14
15 $_user_location = 'users';
16 define('AT_INCLUDE_PATH', '../include/');
17 require(AT_INCLUDE_PATH.'vitals.inc.php');
18
19 ?>
20 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
21 <html lang="en">
22 <head>
23         <title><?php echo _AT('upload_progress'); ?></title>
24         <?php if ($_GET['frame']) { ?>
25                 <meta http-equiv="refresh" content="3;URL=prog.php?frame=1" /> 
26         <?php } ?>
27         <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
28     <script src="<?php echo $_base_path; ?>jscripts/infusion/InfusionAll.js" type="text/javascript"></script>
29     <script language="javascript" type="text/javascript">
30     //<!--
31     jQuery.noConflict();
32     //-->
33     </script>
34     <script src="<?php echo $_base_path; ?>jscripts/ATutor.js" type="text/javascript"></script>   
35     <link rel="stylesheet" href="../stylesheet.css" type="text/css" />
36     <style id="pref_style" type="text/css"></style> 
37 </head>
38 <body <?php
39         if ($_SESSION['done']) {
40                 echo 'onLoad="parent.window.close();"';
41         }
42
43 ?>>
44
45 <?php if (!$_GET['frame']) { 
46         
47         $_SESSION['done'] = 0;
48         session_write_close();
49 ?>
50 &nbsp;<a href="javascript:window.close();"><?php echo _AT('close'); ?></a>
51 <h3><?php echo _AT('upload_progress'); ?></h3>
52 <p><small><?php echo _AT('window_auto_close'); ?></small></p>
53
54 <br /><br />
55 <table border="0" align="center">
56 <tr>
57         <td><img src="../images/transfer.gif" height="20" width="90" alt="file upload in progress..."></td>
58         <td valign="middle"><iframe src="prog.php?frame=1" width="100" height="25" frameborder="0" scrolling=no marginwidth="0" marginheight="1">
59 </iframe>
60 <?php } else { 
61         if (!$_GET['t']) {
62                 $newest_file_name = '';
63                 $newest_file_time = 0;
64                 // get the name of the temp file.
65                 if ($dir = @opendir('/tmp')) {
66                         while (($file = readdir($dir)) !== false) {
67                                 if ((strlen($file) == 9) && (substr($file, 0, 3) == 'php')) {
68                                         $filedata = stat('/tmp/'.$file);
69                                         if ($filedata['mtime'] > $newest_file_time) {
70                                                 $newest_file_time = $filedata['mtime'];
71                                                 $newest_file_name = $file;
72                                                 $size = $filedata['size'] / 1024;
73                                         }
74                                 }
75                         }
76                         closedir($dir);
77                 }
78         } else {
79                 $filedata = stat('/tmp/'.$_GET['t']);
80                 $size = $filedata['size'] / 1024;
81         }
82
83         echo '<small>';
84         // not sure where these are displayed in the progress popup
85         if ($size == '') {
86                 echo '<strong>Unknown</strong> '._AT('kb');
87         } else {
88                 echo $size.' '._AT('kb');
89         }
90         echo '</small>';
91 } ?></td>
92 </tr>
93 </table>
94 <script type="text/javascript">
95 //<!--
96     <?php require_once(AT_INCLUDE_PATH.'../jscripts/ATutor_js.php'); ?>
97 //-->
98 </script>
99 </body>
100 </html>