Welcome to MAPS 2.0
[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">Space Usage for <?php echo $Userid?></h2>
31 </div>
32 <div class="content">
33   <?php
34     OpenDB();
35     SetContext ($userid);
36     NavigationBar ($userid);
37
38     $space = Space();
39
40     $one_meg = 1024 * 1024;
41
42     if ($space > $one_meg) {
43       $space = number_format ($space / $one_meg, 1);
44       print "$Userid is using up $space Megabytes of space in the database";
45     } elseif ($space > 0) {
46       $space = number_format ($space / 1024, 0);
47       print "$Userid is using up $space Kbytes of space in the database";
48     } else {
49       print "$Userid is using up no space in the database";
50     } // if
51
52     CloseDB();
53
54     copyright (2001);
55   ?>
56 </div>
57 </body>
58 </html>