請先登入,登入後,確認您的權限後,即可觀看影片。
text/csv
,
;
"
templates\op_tad_signup_actions_show.tpl
<a href="<{$xoops_url}>/modules/tad_signup/csv.php?id=<{$id}>" class="btn btn-primary"><i class="fa fa-file-text-o" aria-hidden="true"></i> 匯出CSV</a>
csv.php
<?php use Xmf\Request; use XoopsModules\Tad_signup\Tad_signup_actions; require_once __DIR__ . '/header.php'; if (!$_SESSION['can_add']) { redirect_header($_SERVER['PHP_SELF'], 3, "您沒有權限使用此功能"); } $id = Request::getInt('id'); $action = Tad_signup_actions::get($id); if ($action['uid'] != $xoopsUser->uid()) { redirect_header($_SERVER['PHP_SELF'], 3, "您沒有權限使用此功能"); } $csv = []; $head_row = explode("\n", $action['setup']); $head = []; foreach ($head_row as $head_data) { $cols = explode(',', $head_data); if (strpos($cols[0], '#') === false) { $head[] = str_replace('*', '', trim($cols[0])); } } $head[] = '錄取'; $head[] = '報名日期'; $head[] = '身份'; $csv[] = implode(',', $head); $content = implode("\n", $csv); $content = mb_convert_encoding($content, 'Big5'); header("Content-type: text/csv"); header("Content-Disposition: attachment; filename= {$action['title']}報名名單.csv"); echo $content; exit;
$head_row = explode("\n", $action['setup']); $head = []; foreach ($head_row as $head_data) { $cols = explode(',', $head_data); if (strpos($cols[0], '#') === false) { $head[] = str_replace('*', '', trim($cols[0])); } }
$TadDataCenter = new TadDataCenter('tad_signup'); $head = $TadDataCenter->getAllColItems($action['setup']);
tadtools/class/TadDataCenter.php 必須是 2021/10/29 日以後的版本,可至此下載覆蓋
link to https://github.com/tadlearn/tad_signup/commit/1511364b797f1a615f849316ed26b345a1bd4e8c \
進階搜尋
59人線上 (6人在瀏覽線上書籍)
會員: 0
訪客: 59