9c4bd0232504d0c954bc02a8bbacb1dd2426f09a
[clearscm.git] / maps / php / Space.php
1 <?php \r
2 ////////////////////////////////////////////////////////////////////////////////\r
3 //\r
4 // File:        $RCSFile$\r
5 // Revision:    $Revision: 1.1 $\r
6 // Description: Reports user's database space usage\r
7 // Author:      Andrew@DeFaria.com\r
8 // Created:     Fri Nov 29 14:17:21  2002\r
9 // Modified:    $Date: 2013/06/12 14:05:48 $\r
10 // Language:    PHP\r
11 //\r
12 // (c) Copyright 2000-2006, Andrew@DeFaria.com, all rights reserved.\r
13 //\r
14 ////////////////////////////////////////////////////////////////////////////////\r
15 include "site-functions.php";\r
16 include "MAPS.php";\r
17 ?>\r
18 \r
19 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
20 <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">\r
21 <head>\r
22   <title>MAPS: Space Usage</title>\r
23   <?php \r
24     MAPSHeader ();\r
25     $Userid = ucfirst ($userid);\r
26   ?>\r
27 </head>\r
28 <body>\r
29 <div class="heading">\r
30 <h2 class="header" align="center"><font class="standout">MAPS</font>\r
31 Space Usage for <?php echo $Userid?></h2>\r
32 </div>\r
33 <div class="content">\r
34   <?php\r
35     OpenDB ();\r
36     SetContext ($userid);\r
37     NavigationBar ($userid);\r
38     $space = Space ();\r
39     $one_meg = 1024 * 1024;\r
40 \r
41     if ($space > $one_meg) {\r
42       $space = number_format ($space / $one_meg, 1);\r
43       print "$Userid is using up $space Megabytes of space in the database";\r
44     } elseif ($space > 0) {\r
45       $space = number_format ($space / 1024, 0);\r
46       print "$Userid is using up $space Kbytes of space in the database";\r
47     } else {\r
48       print "$Userid is using up no space in the database";\r
49     } // if\r
50 \r
51     copyright (2001);\r
52   ?>\r
53 </div>\r
54 </body>\r
55 </html>\r