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