Example #1
0
function TABLE_LIST($database)
{
    $q = new mysql();
    $array = $q->TABLES_LIST($database);
    $page = CurrentPageName();
    $tpl = new templates();
    //$array[$Name]=array($dbsize,$dbsize_text,$Rows,$Max_data_length);
    $perfrom_mysqlcheck = $tpl->javascript_parse_text("{perform_mysql_check}");
    $html = "<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n<thead class='thead'>\n\t<tr>\n\t\t<th>{table}</th>\n\t\t<th>{table_size}</th>\n\t\t<th>{rows_number}</th>\n\t</tr>\n</thead>\n<tbody class='tbody'>";
    while (list($num, $ligne) = each($array)) {
        if ($ligne[0] == null) {
            $ligne[0] = "0";
        }
        $dbsize = $ligne[0];
        $dbsize_text = $ligne[1];
        $Rows = $ligne[2];
        $Max_data_length = $ligne[3];
        $status = TABLE_STATUS($Max_data_length, $dbsize);
        if ($classtr == "oddRow") {
            $classtr = null;
        } else {
            $classtr = "oddRow";
        }
        $mysqlcheck = imgtootltip("tables-failed-22.png", "MySQL check", "MysqlCheck('{$num}')");
        $html = $html . "\n\t\t<tr class={$classtr}>\n\t\t\t<td><code style='font-size:16px;font-weight:bold'>{$num}</code></td>\n\t\t\t<td width=1%><code style='font-size:16px;font-weight:bold'>{$dbsize_text}</code></td>\n\t\t\t<td width=1%><code style='font-size:16px;font-weight:bold'>{$Rows}</code></td>\n\t\t</tr>\n\t\t<tr class={$classtr}>\n\t\t\t<td width=1% colspan=4 align='right' >\n\t\t\t\t<table style='width:100%' style='background-color: transparent;'>\n\t\t\t\t\t<tr style='background-color: transparent;'>\n\t\t\t\t\t\t<td width=99% style='background-color: transparent;'>{$mysqlcheck}</td>\n\t\t\t\t\t\t<td width=1% nowrap style='background-color: transparent;'><i style='font-size:13px'>{$status}</i></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>";
    }
    $html = $html . "</table>\n\t<script>\n\n\tvar x_MysqlCheck= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue);return;}\t\n\t\t\n\t}\t\t\n\t\n\tfunction MysqlCheck(table){\n\t\tif(confirm('{$perfrom_mysqlcheck}\\n{$database}/'+table)){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('mysql-check',table);\n\t\t\tXHR.appendData('database',table);\t\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',x_MysqlCheck);\n\t\t\t}\n\t\t}\t\n\n\t</script>\n\t\t\n\t\n\t\n\t\n\t";
    return $html;
}
Example #2
0
function TABLE_LIST($database)
{
    $q = new mysql();
    $array = $q->TABLES_LIST($database);
    //$array[$Name]=array($dbsize,$dbsize_text,$Rows,$Max_data_length);
    $html = "<table style='width:100%'>\n\t<tr>\n\t\t<th>&nbsp;</th>\n\t\t<th>{table}</th>\n\t\t<th>{table_size}</th>\n\t\t<th>{rows_number}</th>\n\t\t<th>{status}</th>\n\t</tr>";
    while (list($num, $ligne) = each($array)) {
        if ($ligne[0] == null) {
            $ligne[0] = "0";
        }
        $dbsize = $ligne[0];
        $dbsize_text = $ligne[1];
        $Rows = $ligne[2];
        $Max_data_length = $ligne[3];
        $status = TABLE_STATUS($Max_data_length, $dbsize);
        $html = $html . "<tr " . CellRollOver($js) . ">\n\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t<td><code style='font-size:12px;font-weight:bold'>{$num}</code></td>\n\t\t<td width=1%><code style='font-size:12px;font-weight:bold'>{$dbsize_text}</code></td>\n\t\t<td width=1%><code style='font-size:12px;font-weight:bold'>{$Rows}</code></td>\n\t\t<td width=1%>{$status}</td>\n\t\t</tr>";
    }
    $html = $html . "</table>";
    return $html;
}