<?php
session_start();
include("./sql/conn.php");
Header("Content-type:application/octet-stream");
Header("Accept-Ranges:bytes");
header("Content-Disposition:attachment;filename=kaoshi.xls");
header("Expires:0");
header("Cache-Control:must-revalidate,post-check=0,pre-check=0");
header("Pragma:public");

$result = mysql_query("SELECT * FROM ".$b_qz."_ks where ksnr='".$_SESSION['ksnr']."' ");/// DESC 
while($row = mysql_fetch_array($result))
{
echo $row['id'];
echo "	";
echo $row['name'];
echo "	";
echo $row['dw'];
echo "	";
echo $row['sfz'];
echo "	";
echo $row['tel'];
echo "	";
echo $row['w1'];
echo "	";
if($row['w1time']>1){
echo date('Ymd H:i:s',$row['w1time']);
}else{echo "-";}
echo "	";
if($row['cjtime']>1){
echo date('Ymd H:i:s',$row['cjtime']);
}else{echo "-";}
echo "	";
echo $row['cj'];
echo "	";
echo "\r\n";
}

include("./sql/close.php"); 
?>