POST TIME:2017-11-12 23:35
1、\dede\templets\diy_main.htm 找到
前臺預(yù)覽</a> |
| <a href="diy_list.php?action=excel&diyid={dede:field.diyid/}" target="_blank">導(dǎo)出表單Excel</a> |
else { showmsg('未定義操作', "-1"); } |
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>狀態(tài)</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>"; } |