|
PCCS MySQLDatabase Admin Tool version 1.3.4
|
/ -> index.php
1 <?php
2 //////////////////////////////////////////////////////////////////////////////////////////////////////////// 3 // coder: Chauncey Thorn 4 // email: cthorn 5 /************************************************************************
6 PCCS MySQLDatabase Admin Tool
7 Copyright (C) Chauncey Thorn
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; either version 2
12 of the License, or (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA , USA.
22 **************************************************************************/
23 // We don't need anyone passing args to this script 24
25 // Make sure no one tries to pass a arg to this script 26
27 if($HTTP_SERVER_VARS["argc"] != 0) // If someone is trying to pass an argument
28 Header("Location: $PHP_SELF"); // Then reload the page argument-free
29
30 // Get include files
31 require('mysqldb_app_includes.php');
32
33 // Use header function ...
34 common_header($str_mainTitle);
35
36 pageTop("PCCS MySQLAdmin Tool version ". $appversion,"600");
37
38
39 $link_array = array(
40 "$str_dbusers" => "mysqldb_newuser.php",
41 "$str_installscriptlink" => "installscript/mysqldb_installscript.php",
42 "$str_createwebacct" => "mysqldb_create_webuser.php",
43 "LOGOUT" => "logout.php"
44 );
45
46 print "<BR>";
47 print "<CENTER>";
48 navBar($link_array);
49 print "</CENTER>";
50 print "<BR>";
51
52 ?>
53 </TD></TR></TABLE>
54
55 <P>
56 <TABLE>
57 <TR>
58 <TD valign=top>
59
60 <?php
61 print "<center>";
62 // show mysql database icon
63 displayImage("../images/mysqldb.gif");
64 print "</center>";
65 print "<p>";
66 print " <A HREF=$MySQLManual CLASS=noul
67 onMouseOver=\"window.status='$str_readmysqldoc'; return
68 true;\" onMouseOut=\"window.status=' '; return true;\" TARGET=_new>$str_readmysqldoc</A> ";
69
70 print "<P>";
71 print " <A HREF=mysqldb_admin.php CLASS=noul onMouseOver=\"window.status='$str_database'; return
72 true;\" onMouseOut=\"window.status=' '; return true;\">$str_database</A> ";
73 print "<BR>";
74
75 print " <A HREF=mysqldb_qrytool.php CLASS=noul onMouseOver=\"window.status='QUERY TOOL'; return
76 true;\" onMouseOut=\"window.status=' '; return true;\" >QUERY TOOL</A> ";
77 print "<BR>";
78
79
80 print " <A HREF=mysqldb_help.php?help=helpsystem CLASS=noul
81 onMouseOver=\"window.status='HELP'; return
82 true;\" onMouseOut=\"window.status=' '; return true;\" >HELP</A> ";
83 print "<BR>";
84
85 print "<P>";
86
87 // print "<BR> <a href=mysqldb_admpanel.php?action=getdbname CLASS=link>$str_createdb</a>";
88 print " <A HREF=mysqldb_viewlogs.php CLASS=noul onMouseOver=\"window.status='VIEW SYSLOG'; return
89 true;\" onMouseOut=\"window.status=' '; return true;\" >VIEW SYSLOGS</A> ";
90 print "<BR>"; print "<BR>";
91 print " <a href=mysqldb_admpanel.php?action=flush_t CLASS=noul
92 onMouseOver=\"window.status='$str_flushtables'; return
93 true;\" onMouseOut=\"window.status=' '; return true;\">$str_flushtables</a>";
94 print "<BR>";
95 print " <a href=mysqldb_admpanel.php?action=flush_h CLASS=noul
96 onMouseOver=\"window.status='$str_flushhosts'; return
97 true;\" onMouseOut=\"window.status=' '; return true;\">$str_flushhosts</a>";
98 print "<BR>";
99 print " <a href=mysqldb_admpanel.php?action=flush_s CLASS=noul
100 onMouseOver=\"window.status='$str_flushstatus'; return
101 true;\" onMouseOut=\"window.status=' '; return true;\">$str_flushstatus</a>";
102 print "<BR>";
103 print " <a href=mysqldb_admpanel.php?action=flush_l CLASS=noul onMouseOver=\"window.status='$str_flushlogs'; return
104 true;\" onMouseOut=\"window.status=' '; return true;\">$str_flushlogs</a>";
105 print "<BR>";
106 print " <a href=mysqldb_admpanel.php?action=show_ps CLASS=noul onMouseOver=\"window.status='$str_processes'; return
107 true;\" onMouseOut=\"window.status=' '; return true;\">$str_processes</a>";
108 print "<BR>";
109 print " <a href=mysqldb_admpanel.php?action=show_var CLASS=noul
110 onMouseOver=\"window.status='$str_variables'; return
111 true;\" onMouseOut=\"window.status=' '; return true;\">$str_variables</a>";
112 print "<BR>";
113 print "<P>";
114
115
116 ?>
117 </TD>
118
119
120 <TD valign=top>
121 <?php
122 // common_header($str_mainTitle);
123
124 // See how many databases are available 125
126 $cntdbs = mysql_list_dbs();
127 $number_of_databases = mysql_num_rows($cntdbs);
128
129 // Count the number of users in the User table 130
131 $cntusers = mysql_db_query("mysql","SELECT User FROM user") or die("Count Query Failed:");
132 $number_of_users = mysql_num_rows($cntusers);
133
134 print "<CENTER>";
135 print "<P>";
136
137
138
139 print "<P>";
140 print "<P>
141 <FONT SIZE=-1>";
142
143 print "<P>";
144
145 print "There are <FONT COLOR=red>" . $number_of_databases . "</FONT> Databases on this server";
146 print "<br>";
147 print "There are <FONT COLOR=red>" . $number_of_users . "</FONT> different accounts in the mysql.user on this server";
148 print "<P>";
149 require('mysqldb_sysinfo.php');
150 print "<u>MySQL Server $display_mysql_version Info</u> " . ': ' . sys_chostname() . ' (' . sys_ip_addr() . ') ' . "\n";
151
152 print "<P>";
153
154 // Display some system stats...
155
156 $result = mysql_db_query("mysql","SHOW STATUS");
157 while($row = mysql_fetch_array($result)) {
158 $num = mysql_numrows($result);
159 $var1 = $row["Variable_name"];
160 $var2 = $row["Value"];
161 if ($var1 == "Questions"):
162 print ("$str_questions : $var2 ");
163 endif;
164
165 if ($var1 == "Uptime"):
166 print ("$str_systemuptime : $var2 ");
167 print "<BR>";
168 endif;
169
170 if ($var1 == "tables"):
171 print ("$str_ables : $var2 ");
172 endif;
173
174 if ($var1 == "files"):
175 print ("$str_iles : $var2 ");
176 print "<BR>";
177 endif;
178
179 if ($var1 == "d_tables"):
180 print ("$str_dtables : $var2 <BR> ");
181 endif;
182
183 if ($var1 == "Running_threads"):
184 print ("$str_runningthreads : $var2 ");
185 endif;
186
187 }
188 $var2 = "<FONT COLOR=red>$var2</FONT>";
189 print "<P>";
190 print "<P>";
191 print "</CENTER>";
192 print "<P>";
193
194
195 print "</FONT></b><br>";
196
197 pageBottom();
198 footer();
199 ?>
| |