$allRows[] = $res->fields; $res->MoveNext(); } } if (!empty($allRows)) { reset($allRows); ksort($allRows); } if (empty($export)) { echo "\n\t<table cellspacing=0 cellpadding=1 border=0>\n\t <TR " . $COLORS['BaseBorderTableBgcolor'] . ">\n\t\t<td>\n\t<table cellspacing=1 cellpadding=4 border=0><TR " . $COLORS['BaseTablesBgcolor'] . "><TH> </TH><TH>" . $GUI_LANG['TheDescriptionIsAccessible'] . ":</TH><TH>" . $GUI_LANG['PhoneNumber'] . "</TH><TH>" . $GUI_LANG['Description'] . "</TH><TH> </TH>"; } else { $expor_excel->MontaConteudo(0, 0, $GUI_LANG['PhoneNumber']); $expor_excel->MontaConteudo(0, 1, $GUI_LANG['Description']); $expor_excel->MontaConteudo(1, 0, " "); $expor_excel->MontaConteudo(1, 1, " "); $expor_excel->mid_sqlparaexcel(); } if (!empty($allRows)) { $linha = 0; while (list($key, $row) = each($allRows)) { $FontColor = ''; $FontColorEnd = ''; if (ereg($MobileCallsR, $row[1])) { $FontColor = "<font " . $COLORS['MobileCalls'] . ">"; $FontColorEng = "</font>"; } elseif (ereg($InternationalCalls, $row[1])) { $FontColor = "<font " . $COLORS['InternationalCalls'] . ">"; $FontColorEng = "</font>"; } elseif (ereg($LongDistanceCalls, $row[1])) { $FontColor = "<font " . $COLORS['LongDistanceCalls'] . ">"; $FontColorEng = "</font>";
<?php if ($table == "") { echo "Se requiere el nombre de la tabla en la variable <b>table</b>"; exit; } // parametros do seu servidor require "../config/variables.php"; //echo DB_USER."++".$table; $usuario = DB_USER; $senha = DB_PASS; $banco = DB_NAME; $conexao = mysql_connect(DB_HOST, $usuario, $senha); mysql_select_db($banco, $conexao); require "excel_lib.php"; //Estanciar $mid_excel = new MID_SQLPARAExel(); $mid_excel2 = new MID_SQLPARAExel(); // data to the file(Dados para o arquivo) $sql = "select * from " . $table; //ex.: //$mid_excel->mid_sqlparaexcel("DataBaseName", "TABLEname", RECORDSET, "FILEname"); $mid_excel->mid_sqlparaexcel(DB_NAME, $table, $sql, "jmm1"); //$mid_excel->mid_sqlparaexcel(DB_NAME, $table, $sql, "111111111"); //$mid_excel->mid_sqlparaexcel(DB_NAME, $table, $sql, "222222222");