<?
/*
Name: Export Structure
URI: http://joesen.f2blog.com/index.php?load=read&id=234
Version: 1.0
Author: Joesen & Korsen
Author URI: http://joesen.f2blog.com
*/
error_reporting (E_ERROR | E_WARNING | E_PARSE);// This will NOT report uninitialized variables
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
define('PMA_GRAB_GLOBALS_INCLUDED', 1);
if (phpversion()<"4.1.0"){
$PHP_SELF=$HTTP_SERVER_VARS['PHP_SELF'];
$HTTP_HOST=$HTTP_SERVER_VARS['HTTP_HOST'];
$REMOTE_ADDR=$HTTP_SERVER_VARS['REMOTE_ADDR'];
}else{
$PHP_SELF=$_SERVER['PHP_SELF'];
$HTTP_HOST=$_SERVER['HTTP_HOST'];
$REMOTE_ADDR=$_SERVER['REMOTE_ADDR'];
}
if (!empty($_GET)) {
$fix_vars = array('_GET');
for ($n = 0; $n < sizeof($fix_vars); ++$n)
{
if (is_array($GLOBALS[$fix_vars[$n]]))
{
while (list($k, $v) = each($GLOBALS[$fix_vars[$n]]))
{
$GLOBALS[$fix_vars[$n]][$k] = $v;
$GLOBALS[$k] = $v;
}
@reset($GLOBALS[$fix_vars[$n]]);
}
}
} else if (!empty($HTTP_GET_VARS)) {
$fix_vars = array('HTTP_GET_VARS');
for ($n = 0; $n < sizeof($fix_vars); ++$n)
{
if (is_array($GLOBALS[$fix_vars[$n]]))
{
while (list($k, $v) = each($GLOBALS[$fix_vars[$n]]))
{
$GLOBALS[$fix_vars[$n]][$k] = $v;
$GLOBALS[$k] = $v;
}
@reset($GLOBALS[$fix_vars[$n]]);
}
}
} // end if
if (!empty($_POST)) {
$fix_vars = array('_POST');
for ($n = 0; $n < sizeof($fix_vars); ++$n)
{
if (is_array($GLOBALS[$fix_vars[$n]]))
{
while (list($k, $v) = each($GLOBALS[$fix_vars[$n]]))
{
$GLOBALS[$fix_vars[$n]][$k] = $v;
$GLOBALS[$k] = $v;
}
@reset($GLOBALS[$fix_vars[$n]]);
}
}
} else if (!empty($HTTP_POST_VARS)) {
$fix_vars = array('HTTP_POST_VARS');
for ($n = 0; $n < sizeof($fix_vars); ++$n)
{
if (is_array($GLOBALS[$fix_vars[$n]]))
{
while (list($k, $v) = each($GLOBALS[$fix_vars[$n]]))
{
$GLOBALS[$fix_vars[$n]][$k] = $v;
$GLOBALS[$k] = $v;
}
@reset($GLOBALS[$fix_vars[$n]]);
}
}
} // end if
}
//Set Server
$dbserver="localhost";
$dbusername="root";
$dbpassword="root";
$mysql_conn=@mysql_connect("$dbserver","$dbusername","$dbpassword") or die("Mysql connect is error.");
if ($action!=""){
$seektable=@implode(";",$arr_seektable);
if ($seektable!=""){
$seektable=";$seektable;";
}
//echo $seektable;
}
//export data
if ($action=="export" && $database!=""){
$temp_title="";
$temp_title.="<html xmlns:o=\"urn:schemas-microsoft-com:office:office\"\n";
$temp_title.="xmlns:x=\"urn:schemas-microsoft-com:office:excel\"\n";
$temp_title.="xmlns=\"http://www.w3.org/TR/REC-html40\">\n";
$temp_title.="\n";
$temp_title.="<head>\n";
$temp_title.="<meta http-equiv=Content-Type content=\"text/html; charset=gb2312\">\n";
$temp_title.="<meta name=ProgId content=Excel.Sheet>\n";
$temp_title.="<meta name=Generator content=\"Microsoft Excel 10\">\n";
$temp_title.="<!--[if gte mso 9]><xml>\n";
$temp_title.="<x:ExcelWorkbook>\n";
$temp_title.="<x:ExcelWorksheets>\n";
$temp_title.="<x:ExcelWorksheet>\n";
$temp_title.="<x:Name></x:Name>\n";
$temp_title.=" <x:WorksheetOptions>\n";
$temp_title.=" <x:DisplayGridlines/>\n";
$temp_title.=" </x:WorksheetOptions>\n";
$temp_title.=" </x:ExcelWorksheet>\n";
$temp_title.=" </x:ExcelWorksheets>\n";
$temp_title.=" </x:ExcelWorkbook>\n";
$temp_title.="</xml><![endif]-->\n";
$temp_title.="<style type=\"text/css\">\n";
$temp_title.="<!--\n";
$temp_title.=".LeftTop {\n";
$temp_title.=" border-top-width: 1pt;\n";
$temp_title.=" border-bottom-width: 0px;\n";
$temp_title.=" border-left-width: 1pt;\n";
$temp_title.=" border-right-width: 0px;\n";
$temp_title.=" border-top-color: #000000;\n";
$temp_title.=" border-right-color: #000000;\n";
$temp_title.=" border-left-color: #000000;\n";
$temp_title.=" border-bottom-color: #000000;\n";
$temp_title.=" border-top-style: solid;\n";
$temp_title.=" border-right-style: solid;\n";
$temp_title.=" border-bottom-style: solid;\n";
$temp_title.=" border-left-style: solid;\n";
$temp_title.=" background: #CCCCCC;\n";
$temp_title.="}\n";
$temp_title.=".LeftTopDash {\n";
$temp_title.=" border-top-width: 1pt;\n";
$temp_title.=" border-bottom-width: 0px;\n";
$temp_title.=" border-left-width: 0.5pt;\n";
$temp_title.=" border-right-width: 0px;\n";
$temp_title.=" border-top-color: #000000;\n";
$temp_title.=" border-right-color: #000000;\n";
$temp_title.=" border-left-color: #000000;\n";
$temp_title.=" border-bottom-color: #000000;\n";
$temp_title.=" border-top-style: solid;\n";
$temp_title.=" border-right-style: solid;\n";
$temp_title.=" border-bottom-style: solid;\n";
$temp_title.=" border-left-style: solid;\n";
$temp_title.=" background: #CCCCCC;\n";
$temp_title.="}\n";
$temp_title.=".Left {\n";
$temp_title.=" border-top-width: 0.5pt;\n";
$temp_title.=" border-bottom-width: 0px;\n";
$temp_title.=" border-left-width: 1pt;\n";
$temp_title.=" border-right-width: 0px;\n";
$temp_title.=" border-top-color: #000000;\n";
$temp_title.=" border-right-color: #000000;\n";
$temp_title.=" border-left-color: #000000;\n";
$temp_title.=" border-bottom-color: #000000;\n";
$temp_title.=" border-top-style: solid;\n";
$temp_title.=" border-right-style: solid;\n";
$temp_title.=" border-bottom-style: solid;\n";
$temp_title.=" border-left-style: solid;\n";
$temp_title.="}\n";
$temp_title.=".LeftDash {\n";
$temp_title.=" border-top-width: 0.5pt;\n";
$temp_title.=" border-bottom-width: 0px;\n";
$temp_title.=" border-left-width: 0.5pt;\n";
$temp_title.=" border-right-width: 0px;\n";
$temp_title.=" border-top-color: #000000;\n";
$temp_title.=" border-right-color: #000000;\n";
$temp_title.=" border-left-color: #000000;\n";
$temp_title.=" border-bottom-color: #000000;\n";
$temp_title.=" border-top-style: solid;\n";
$temp_title.=" border-right-style: solid;\n";
$temp_title.=" border-bottom-style: solid;\n";
$temp_title.=" border-left-style: solid; \n";
$temp_title.="}\n";
$temp_title.=".LeftRight {\n";
$temp_title.=" border-top-width: 0.5pt;\n";
$temp_title.=" border-bottom-width: 0px;\n";
$temp_title.=" border-left-width: 0.5pt;\n";
$temp_title.=" border-right-width: 1pt;\n";
$temp_title.=" border-top-color: #000000;\n";
$temp_title.=" border-right-color: #000000;\n";
$temp_title.=" border-left-color: #000000;\n";
$temp_title.=" border-bottom-color: #000000;\n";
$temp_title.=" border-top-style: solid;\n";
$temp_title.=" border-right-style: solid;\n";
$temp_title.=" border-bottom-style: solid;\n";
$temp_title.=" border-left-style: solid;\n";
$temp_title.="}\n";
$temp_title.=".LeftButtom {\n";
$temp_title.=" border-top-width: 0.5pt;\n";
$temp_title.=" border-bottom-width: 1pt;\n";
$temp_title.=" border-left-width: 1pt;\n";
$temp_title.=" border-right-width: 0px;\n";
$temp_title.=" border-top-color: #000000;\n";
$temp_title.=" border-right-color: #000000;\n";
$temp_title.=" border-left-color: #000000;\n";
$temp_title.=" border-bottom-color: #000000;\n";
$temp_title.=" border-top-style: solid;\n";
$temp_title.=" border-right-style: solid;\n";
$temp_title.=" border-bottom-style: solid;\n";
$temp_title.=" border-left-style: solid; \n";
$temp_title.="}\n";
$temp_title.=".LeftButtomDash {\n";
$temp_title.=" border-top-width: 0.5pt;\n";
$temp_title.=" border-bottom-width: 1pt;\n";
$temp_title.=" border-left-width: 0.5pt;\n";
$temp_title.=" bor