"") { # header("location:/"); # exit; } header("Content-type:application/vnd.ms-excel"); header("Content-Disposition:filename=".date("Ymd")."_schedulelist.xls"); $sql="select * from 4seasondb.schedule where Date_start >= '".date("Y")."-01-01' order by Date_start asc"; sql($sql,$result,$num); echo "日期 星期 天數 活動內容 活動類型 報名資格 活動簡介 領隊嚮導講師 報名專線 集合時間地點 備註說明\n"; for($i=0;$i<$num;$i++) { fetch($db,$result,$i); $sql="select * from 4seasondb.member, 4seasondb.schedule_leader where member.Memberno=schedule_leader.Memberno and schedule_leader.FID='{$db["ID"]}' "; sql($sql,$result_leader,$num_leader); $name=""; $phone=""; for($j=0;$j<$num_leader;$j++) { fetch($db_leader,$result_leader,$j); $name=$name." {$db_leader["Name"]}/"; $phone=$phone." {$db_leader["Mobile"]}/"; } echo "{$db["Date_start"]} ".iconv("utf-8","big5",$week[date("w",strtotime($db["Date_start"]))])." {$db["Day"]} ".iconv("utf-8","big5",$db["Title"])." ".iconv("utf-8","big5",$db["Sch_style"])." ".iconv("utf-8","big5",$db["Sch_type1"].$db["Sch_type2"].$db["Sch_type3"].$db["Sch_type4"])." ".iconv("utf-8","big5",$db["Introduction"])." ".iconv("utf-8","big5",$name)." {$phone} ".iconv("utf-8","big5",$db["Meetplace"])." ".iconv("utf-8","big5",$db["Note"])."\n"; } ?>