dedecmsHow to export a customized form to excel?
Modify 2 files to allow Dreamweaver to customize it Freely export defined forms to Excel tables.
Recommended learning: Dream Weaver cms
Modify the tutorial as follows:
1. \dede\templets\diy_main.htm found
Front desk preview
<a href="diy_list.php?action=excel&diyid={dede:field.diyid/}" target="_blank">导出表单Excel</a>
2. \dede\diy_list.php Find
array('post', 'list', 'edit', 'check', 'delete'))
and change it to
array('post', 'list', 'edit', 'check', 'delete', 'excel'))
Continue to find
else { showmsg('未定义操作', "-1"); }
in Add
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>"; }to it
The above is the detailed content of How to export dedecms' custom form to excel. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Notepad++7.3.1
Easy-to-use and free code editor
