Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of exporting dedecms dream weaving custom form to excel

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you the method of exporting dedecms dream weaving custom form to excel. I hope you will gain a lot after reading this article. Let's discuss it together.

How do dedecms weave dreams customize the form and export it to excel?

Modify 2 files to let the dream custom form be freely exported to the Excel table.

As follows:

1.\ dede\ templets\ diy_main.htm found

Foreground preview

Export form Excel

2.\ dede\ diy_list.php found

Array ('post',' list', 'edit',' check', 'delete'))

Change to

Array ('post',' list', 'edit',' check', 'delete',' excel'))

Keep finding it.

Else {showmsg ('undefined operation', "- 1");}

Add on top of it

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 ""; foreach ($fieldlist as $field= > $fielddata) {echo "{$fielddata [0]}";} echo "status"; echo ""; $sql = "SELECT * FROM {$diy- > table} ORDER BY id DESC"; $dsql- > SetQuery ($sql) $dsql- > Execute ('t'); while ($arr = $dsql- > GetArray ('t')) {echo ""; foreach ($fieldlist as $key = > $field) {echo ". $arr [$key].";} $status = $arr ['ifcheck'] = = 1? 'audited': 'unaudited'; echo ". $status.; echo";} echo ";} after reading this article, I believe you have some understanding of the method of exporting dedecms dream weaving custom form to excel. Want to know more about it. Welcome to follow the industry information channel. Thank you for your reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report