xxb/module/file/view/export2csv.html.php
2023-10-23 15:51:36 +08:00

27 lines
749 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* The export2csv view file of file module of XXB.
*
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd., www.zentao.net)
* @license ZOSL (https://zpl.pub/page/zoslv1.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package file
* @version $Id$
* @link https://xuanim.com
*/
?>
<?php
$count = count($fields);
echo '"'. implode('","', $fields) . '"' . "\n";
foreach($rows as $row)
{
echo '"';
$i = 0;
foreach($fields as $fieldName => $fieldLabel)
{
isset($row->$fieldName) ? print(str_replace('",', '"', strip_tags($row->$fieldName))) : print('');
if(++$i < $count) echo '","';
}
echo '"' . "\n";
}