8-4-2
產生各種格式的簽到表
您沒有觀看影片的權限
請先登入,登入後,確認您的權限後,即可觀看影片。
- 先修改
templates\op_tad_signup_actions_show.tpl
原本的PDF簽到表按鈕文字
<a href="<{$xoops_url}>/modules/tad_signup/index.php?op=tad_signup_data_pdf_setup&id=<{$id}>" class="btn btn-info"><i class="fa fa-save" aria-hidden="true"></i> 產生簽到表</a>
- 接著修改
templates\op_tad_signup_data_pdf_setup.tpl
的架構
<h2 class="my"><{$action.title}> 簽到表欄位設定</h2>
<form action="index.php" method="post" id="myForm" enctype="multipart/form-data" class="form-horizontal">
<{$tmt_box}>
<input type="hidden" name="op" value="tad_signup_data_pdf_setup_save">
<input type="hidden" name="action_id" value="<{$action.id}>">
<div class="bar">
<button type="submit" class="btn btn-danger" name="file" value="pdf">
<i class="fa fa-file-pdf-o" aria-hidden="true"></i> pdf 簽到表
</button>
<button type="submit" class="btn btn-primary" name="file" value="word">
<i class="fa fa-file-pdf-o" aria-hidden="true"></i> word 簽到表
</button>
<button type="submit" class="btn btn-success" name="file" value="odt">
<i class="fa fa-file-pdf-o" aria-hidden="true"></i> odt 簽到表
</button>
</div>
</form>
- 先在
index.php
加入過濾,並用 getWord()
來進行嚴格的過濾
$file = Request::getWord('file','pdf');
- 修改
index.php
原本的流程,將轉向改為傳來的檔案值
//儲存pdf的匯出設定
case 'tad_signup_data_pdf_setup_save':
Tad_signup_data::pdf_setup_save($action_id, $pdf_setup_col);
header("location: {$file}_signup.php?id=$action_id");
exit;
link to https://github.com/tadlearn/tad_signup/commit/b9bb190404bf3cbb6ff1fd69986a9486b426789c \