Update of /cvsroot/openfirst/base/config
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19760
Modified Files:
index.php
Log Message:
Add encryption selection option to setup, show database statistics if they are supported by the database server type which is selected (currently supports mysql and mssql); this functionality is based loosely on the phpBB statistics
Index: index.php
===================================================================
RCS file: /cvsroot/openfirst/base/config/index.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** index.php 1 Nov 2003 18:16:07 -0000 1.6
--- index.php 5 Apr 2004 10:26:50 -0000 1.7
***************
*** 38,41 ****
--- 38,80 ----
</tr>
</table>
+
+ <?php
+ // The statistics feature is loosely inspired by that of phpBB.
+
+ if($dbasetype == "mysql" || $dbasetype == "mssql") { ?>
+ <table>
+ <tr>
+ <th colspan="2">Statistics</th>
+ </tr>
+ <tr>
+ <th>Database Version</th><td>
+ <?php
+ if($dbasetype == "mysql") {
+ $v = ofirst_dbfetch_object(ofirst_dbquery("SELECT VERSION() AS mysql_version"));
+ echo("MySQL $v->mysql_version");
+ } elseif($dbasetype == "mssql") {
+ echo("Microsoft SQL Server");
+ }
+ ?></td>
+ </tr>
+ <tr>
+ <th>Database Size</th><td>
+ <?php
+ if($dbasetype == "mysql") {
+ $dbsize = 0;
+ $dq = ofirst_dbquery("SHOW TABLE STATUS FROM $sqldatabase");
+ while($d = ofirst_dbfetch_object($dq)) {
+ $dbsize += $d->Data_length + $d->Index_length;
+ }
+ echo (int) (($dbsize + 0.5) / 1024 * 10) / 10 . " KB";
+ } elseif($dbasetype == "mssql") {
+ $s = ofirst_dbfetch_object(ofirst_dbquery("SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize FROM sysfiles"));
+ echo (int) (( $s->dbsize + 0.5) / 1024 * 10) / 10 . " KB";
+ }
+ ?>
+ </table>
+ <?php } ?>
+
+ <br>
<table width="50%">
<tr>
|