|
<?php
Require_once (".. /.. /config/sys_config.php "); Configuration file
Require_once (".. /.. /include/db_class.php ");
Header ("content-type:text/html; charset= $page _code "); Page encoding
Header ("Content-type:application/vnd.ms-excel");
Header ("Content-disposition:attachment;filename=". Mb_convert_encoding ("Customer Information Report", "GBK", $page _code). ". XLS ");
Header ("Pragma:no-cache");
Header ("expires:0");
$usersid = intval ($_get[' uid ')); User ID
The output reads as follows:
Output table Header
Echo iconv ("Utf-8", "gb2312", "Customer Name"). " ";
Echo iconv ("Utf-8", "gb2312", "Telephone"). " ";
Echo iconv ("Utf-8", "gb2312", "Address"). " ";
Echo iconv ("Utf-8", "gb2312", "Add Date"). " ";
echo ""; Line Wrap
$SQLSTR = "SELECT * from clients where usersid=32 order by clientsid Desc";
$rows = $db-> Select ($SQLSTR);
$num = count ($rows); Total Customers
for ($i = 0; $i < $num; $i + +)
{
Echo iconv ("Utf-8", "gb2312", $rows [$i][clientsname]). " ";
Echo iconv ("Utf-8", "gb2312", $rows [$i][clientsphone]). " ";
Echo iconv ("Utf-8", "gb2312", $rows [$i][clientsaddress]). " ";
Echo iconv ("Utf-8", "gb2312", $rows [$i][clientstime]). " ";
echo ""; Line Wrap
}
?>
|