<?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";
}
