<?php
// If this file is not included from the MMHTTPDB possible hacking problem.
if (!function_exists('create_error')){
die();
}
define('MYSQL_NOT_EXISTS', create_error("Your PHP server doesn't have the MySQL module loaded or you can't use the mysql_(p)connect functions."));
define('CONN_NOT_OPEN_GET_TABLES', create_error('The Connection is not opened when trying to retrieve the tables. Please refer to www.interaktonline.com for more information.'));
define('CONN_NOT_OPEN_GET_DB_LIST', create_error('The Connection is not opened when trying to retrieve the database list. Please refer to www.interaktonline.com for more information.'));
if (!function_exists('mysql_connect') || !function_exists('mysql_pconnect') || !extension_loaded('mysql')){
echo MYSQL_NOT_EXISTS;
die();
}
// Now let's handle the crashes or any other PHP errors that we can catch
function KT_ErrorHandler($errno, $errstr, $errfile, $errline) {
global $f, $already_sent;
$errortype = array (
1 => "Error",
2 => "Warning",
4 => "Parsing Error",
8 => "Notice",
16 => "Core Error",
32 => "Core Warning",
64 => "Compile Error",
128 => "Compile Warning",
256 => "User Error",
512 => "User Warning",
1024=> "User Notice",
2048=> "E_ALL",
2049=> "PHP5 E_STRICT"
);
$str = sprintf("[%s]\n%s:\t%s\nFile:\t\t'%s'\nLine:\t\t%s\n\n", date('d-m-Y H:i:s'),(isset($errortype[@$errno])?$errortype[@$errno]:('Unknown '.$errno)),@$errstr,@$errfile,@$errline);
if (error_reporting() != 0) {
@fwrite($f, $str);
if (@$errno == 2 && isset($already_sent) && !$already_sent==true){
$error = '<ERRORS>'."\n";
$error .= '<ERROR><DESCRIPTION>An Warning Type error appeared. The error is logged into the log file.</DESCRIPTION></ERROR>'."\n";
$error .= '</ERRORS>'."\n";
$already_sent = true;
echo $error;
}
}
}
if ($debug_to_file){
$old_error_handler = set_error_handler("KT_ErrorHandler");
}
class MySqlConnection
{
/*
// The 'var' keyword is deprecated in PHP5 ... we will define these variables at runtime.
var $isOpen;
var $hostname;
var $database;
var $username;
var $password;
var $timeout;
var $connectionId;
var $error;
*/
function MySqlConnection($ConnectionString, $Timeout, $Host, $DB, $UID, $Pwd)
{
$this->isOpen = false;
$this->timeout = $Timeout;
$this->error = '';
if( $Host ) {
$this->hostname = $Host;
}
elseif( ereg("host=([^;]+);", $ConnectionString, $ret) ) {
$this->hostname = $ret[1];
}
if( $DB ) {
$this->database = $DB;
}
elseif( ereg("db=([^;]+);", $ConnectionString, $ret) ) {
$this->database = $ret[1];
}
if( $UID ) {
$this->username = $UID;
}
elseif( ereg("uid=([^;]+);", $ConnectionString, $ret) ) {
$this->username = $ret[1];
}
if( $Pwd ) {
$this->password = $Pwd;
}
elseif( ereg("pwd=([^;]+);", $ConnectionString, $ret) ) {
$this->password = $ret[1];
}
}
function Open()
{
$this->connectionId = mysql_connect($this->hostname, $this->username, $this->password);
if (isset($this->connectionId) && $this->connectionId && is_resource($this->connectionId))
{
$this->isOpen = ($this->database == "") ? true : mysql_select_db($this->database, $this->connectionId);
}
else
{
$this->isOpen = false;
}
}
function TestOpen()
{
return ($this->isOpen) ? '<TEST status=true></TEST>' : $this->HandleException();
}
function Close()
{
if (is_resource($this->connectionId) && $this->isOpen)
{
if (mysql_close($this->connectionId))
{
$this->isOpen = false;
unset($this->connectionId);
}
}
}
function GetTables($table_name = '')
{
$xmlOutput = "";
if ($this->isOpen && isset($this->connectionId) && is_resource($this->connectionId)){
// 1. mysql_list_tables and mysql_tablename are deprecated in PHP5
// 2. For backward compatibility GetTables don't have any parameters
if ($table_name === ''){
$table_name = @$_POST['Database'];
}
$sql = ' SHOW TABLES FROM ' . $table_name;
$results = mysql_query($sql, $this->connectionId) or $this->HandleException();
$xmlOutput = "<RESULTSET><FIELDS>";
// Columns are referenced by index, so Schema and
// Catalog must be specified even though they are not supported
$xmlOutput .= '<FIELD><NAME>TABLE_CATALOG</NAME></FIELD>'; // column 0 (zero-based)
$xmlOutput .= '<FIELD><NAME>TABLE_SCHEMA</NAME></FIELD>'; // column 1
$xmlOutput .= '<FIELD><NAME>TABLE_NAME</NAME></FIELD>'; // column 2
$xmlOutput .= "</FIELDS><ROWS>";
if (is_resource($results) && mysql_num_rows($results) > 0){
while ($row = mysql_fetch_array($results)){
$xmlOutput .= '<ROW><VALUE/><VALUE/><VALUE>' . $row[0]. '</VALUE></ROW>';
}
}
$xmlOutput .= "</ROWS></RESULTSET>";
}
return $xmlOutput;
}
function GetViews()
{
// not supported
return "<RESULTSET><FIELDS></FIELDS><ROWS></ROWS></RESULTSET>";
}
function GetProcedures()
{
// not supported
return "<RESULTSET><FIELDS></FIELDS><ROWS></ROWS></RESULTSET>";
}
function GetColumnsOfTable($TableName)
{
$xmlOutput = "";
$query = "DESCRIBE $TableName";
$result = mysql_query($query) or $this->HandleException();
if ($result)
{
$xmlOutput = "<RESULTSET><FIELDS>";
// Columns are referenced by index, so Schema and
// Catalog must be specified even though they are not supported
$xmlOutput .= "<FIELD><NAME>TABLE_CATALOG</NAME></FIELD>"; // column 0 (zero-based)
$xmlOutput .= "<FIELD><NAME>TABLE_SCHEMA</NAME></FIELD>"; // column 1
$xmlOutput .= "<FIELD><NAME>TABLE_NAME</NAME></FIELD>"; // column 2
$xmlOutput .= "<FIELD><NAME>COLUMN_NAME</NAME></FIELD>";
$xmlOutput .= "<FIELD><NAME>DATA_TYPE</NAME></FIELD>";
$xmlOutput .= "<FIELD><NAME>IS_NULLABLE</NAME></FIELD>";
$xmlOutput .= "<FIELD><NAME>COLUMN_SIZE</NAME></FIELD>";
$xmlOutput .= "</FIELDS><ROWS>";
// The fields returned from DESCRIBE are: Field, Type, Null, Key, Default, Extra
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$xmlOutput .= "<ROW><VALUE/><VALUE/><VALUE/>";
// Separate type from size. Format is: type(size)
if (ereg("(.*)\\((.*)\\)", $row["Type"], $ret))
{
$type = $ret[1];
$size = $ret[2];
}
else
{
$type = $row["Type"];
$size = "";
}
// MySQL sets nullable to "YES" or "", so we need to set "NO"
$null = $row["Null"];
if ($null == "")
$null = "NO";
$xmlOutput .= "<VALUE>" . $row["Field"] . "</VALUE>";
$xmlOutput .= "<VALUE>" . $type . "</VALUE>";
$xmlOutput .= "<VALUE>" . $null . "</VALUE>";
$xmlOutput .= "<VALUE>" . $size . "</VALUE></ROW>";
}
mysql_free_result($result);
$xmlOutput .= "</ROWS></RESULTSET>";
}
return $xmlOutput;
}
function GetParametersOfProcedure($ProcedureName, $SchemaName, $CatalogName)
{
// not supported on MySQL
return '<RESULTSET><FIELDS></FIELDS><ROWS></ROWS></RESULTSET>';
}
function ExecuteSQL($aStatement, $MaxRows)
{
if ( get_magic_quotes_gpc() )
{
$aStatement = stripslashes( $aStatement ) ;
}
$xmlOutput = "";
$result = mysql_query($aStatement) or $this->HandleException();
if (isset($result) && is_resource($result))
{
$xmlOutput = "<RESULTSET><FIELDS>";
$fieldCount = mysql_num_fields($result);
for ($i=0; $i < $fieldCount; $i++)
{
$meta = mysql_fetch_field($result);
if ($meta)
{
$xmlOutput .= '<FIELD';
$xmlOutput .= ' type="' . $meta->type;
$xmlOutput .= '" max_length="' . $meta->max_length;
$xmlOutput .= '" table="' . $meta->table;
$xmlOutput .= '" not_null="' . $meta->not_null;
$xmlOutput .= '" numeric="' . $meta->num
没有合适的资源?快使用搜索试试~ 我知道了~
基于LAMP技术的“交换网中继资源管理系统”
共76个文件
php:41个
jpg:24个
inc:3个
需积分: 9 5 下载量 178 浏览量
2010-09-06
11:21:00
上传
评论
收藏 1.62MB RAR 举报
温馨提示
数据库连接参数:$db_conn = new mysqli ('localhost','ziyuan','ziyuan001','ziyuan'),照着用户名密码建个库,导入SQL文件就可以了。 内置两个操作员:“huowz”、“hwz”,密码都是“1111”。其中“huowz”可以管理所有数据,“hwz”只能管理本地数据。 2008年为了更好的适应交换网的维护模式向集中化、智能化发展的需要,设计并实现了《交换网中继端口资源管理系统》,该系统实现了省、市两级操作员管理、数据自动备份、故障快速定位等功能。特别是贝尔交换机的模块故障,在长途光缆导致部分PCM模块中断的情况下,以前需要逐模块查询应用局向并查出该局向中断电路数量才能确定影响程度,在本系统中,只要将故障模块号批量输入查询窗口就可以一次查出所有受影响局向及故障率,还可以一键查询受影响局向下所有模块号,其中故障模块以红色标示,因此可以快速确定影响范围及程度,对故障处理起到一定的指导作用。
资源推荐
资源详情
资源评论
收起资源包目录
ziyuan.rar (76个子文件)
ziyuan
Untitled-1.html 2KB
deljudian.php 1KB
delzhongji.php 1KB
zylines.unl 859B
register.php 5KB
addjudian.php 3KB
newsubnumber.php 11KB
logout.php 400B
modreg.php 3KB
index.php 3KB
working.php 164B
help.html 8KB
connectdb.inc 183B
zhongjixinxi.php 2KB
duankouxinxi.php 3KB
showalarmdk.php 5KB
untitled.php 312B
selectgongdan.php 2KB
menuFrame.php 3KB
mainFrameset.php 646B
footFrame.html 357B
showdk.php 5KB
selectzj.php 2KB
showjudian.php 2KB
_mmServerScripts
mysql.php 12KB
MMHTTPDB.php 4KB
image
jdxx.jpg 70KB
chaxunjg.jpg 158KB
deljd.jpg 64KB
dkxx.jpg 91KB
delzj.jpg 65KB
zhuce.jpg 67KB
adddk.jpg 90KB
xianyouzj.jpg 127KB
alarminput.jpg 57KB
cancle.swf 3KB
alarminfo.jpg 45KB
chaxundk.jpg 79KB
used.jpg 37KB
login.swf 3KB
zhongjigl.jpg 93KB
zhuti.jpg 94KB
judiandk.jpg 185KB
style1.css 1KB
addzj.jpg 76KB
modjd.jpg 71KB
modzj.jpg 78KB
addduankou.jpg 93KB
zjxx.jpg 76KB
zhongjidk.jpg 105KB
moddk.jpg 96KB
denglu.jpg 60KB
addjudian.jpg 69KB
headFrame.php 628B
judianxx.php 2KB
yitijiao.php 4KB
adddk.php 2KB
members_only.php 384B
modduankou.php 4KB
addzj.php 4KB
addduankou.php 5KB
footFrame.inc 238B
user-main.php 2KB
showzj.php 2KB
f_forms.php 6KB
moddkxx.php 2KB
modzjxx.php 1KB
selectdk.php 2KB
shiyonglv.php 2KB
inputsubnum.php 2KB
modjdxx.php 1KB
modzhongji.php 2KB
members.inc 276B
alarmdk.php 1KB
modjudian.php 2KB
ziyuan.sql 5KB
共 76 条
- 1
资源评论
huowz
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功