|
|
|
export ดาค้าเบจ เป้น excel ... ไฟล์ excel ที่ได้มันเป็นภาษาไทยอะครับ แก้ไงดี ขอบคุณครับ |
|
|
|
|
|
|
|
ไฟล์ excel ที่ได้มันเป็นภาษาไทยอะครับ แก้ไงดี ขอบคุณครับ
Code (PHP)
// Query Database
$result=mysql_db_query($dbname,"select id,prename,name,sname,grade from appdata where course='$courseid' and sec='$section'")
// Send Header
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");;
header("Content-Disposition: attachment;filename=$courseid-$sec.xls "); // à¹à¸¥à¹‰à¸§à¸™à¸µà¹ˆà¸à¹‡à¸Šà¸·à¹ˆà¸à¹„ฟล์
header("Content-Transfer-Encoding: binary ");
// XLS Data Cell
xlsBOF();
xlsWriteLabel(1,0,"Student Register $semester/$year");
xlsWriteLabel(2,0,"COURSENO : ");
xlsWriteLabel(2,1,"$courseid");
xlsWriteLabel(3,0,"TITLE : ");
xlsWriteLabel(3,1,"$title");
xlsWriteLabel(4,0,"SETION : ");
xlsWriteLabel(4,1,"$sec");
xlsWriteLabel(6,0,"NO");
xlsWriteLabel(6,1,"ID");
xlsWriteLabel(6,2,"Gender");
xlsWriteLabel(6,3,"Name");
xlsWriteLabel(6,4,"Lastname");
$xlsRow = 7;
while(list($id,$prename,$name,$sname,$grade)=mysql_fetch_row($result)) {
++$i;
xlsWriteNumber($xlsRow,0,"$i");
xlsWriteNumber($xlsRow,1,"$id");
xlsWriteLabel($xlsRow,2,"$prename");
xlsWriteLabel($xlsRow,3,"$name");
xlsWriteLabel($xlsRow,4,"$sname");
$xlsRow++;
}
xlsEOF();
exit();
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2011-08-08 19:18:39 |
By :
gunbell |
View :
925 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|