else if($action == 'excel')
{
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:attachment;filename={$diy->name}_".date("Y-m-d").".xls");
$fieldlist = $diy->getFieldList();
echo "<table><tr>";
foreach($fieldlist as $field=>$fielddata)
{
echo "<th>{$fielddata[0]}</th>";
}
echo "<th>状态</th>";
echo "</tr>";
$sql = "SELECT * FROM {$diy->table} ORDER BY id DESC";
$dsql->SetQuery($sql);
$dsql->Execute('t');
while($arr = $dsql->GetArray('t'))
{
echo "<tr>";
foreach($fieldlist as $key => $field)
{
echo "<td>".$arr[$key]."</td>";
}
$status = $arr['ifcheck'] == 1 ? '已审核' : '未审核';
echo "<td>".$status."</td>";
echo "</tr>";
}
echo "</table>";
}
|