:::

4-4-2 建立「我的報名紀錄」樣板

您沒有觀看影片的權限

您沒有觀看影片的權限

請先登入,登入後,確認您的權限後,即可觀看影片。

  1. 建立 templates\op_tad_signup_data_my.tpl 樣板檔
    <h2 class="my">我的報名紀錄</h2>
    
    <table class="table" data-toggle="table" data-pagination="true" data-search="true" data-mobile-responsive="true">
        <thead>
            <tr>
                <th data-sortable="true">活動名稱</th>
                <th data-sortable="true">活動日期</th>
                <th data-sortable="true">報名日期</th>
                <th data-sortable="true">錄取狀況</th>
            </tr>
        </thead>
        <tbody>
            <{foreach from=$my_signup item=signup_data}>
                <tr>
                    <td>
                        <a href="index.php?id=<{$signup_data.action_id}>">
                            <{$signup_data.action.title}>
                        </a>
                    </td>
                    <td><{$signup_data.action.action_date}></td>
                    <td><{$signup_data.signup_date}></td>
                    <td>
                        <{if $signup_data.accept === '1'}>
                            <div class="text-primary">錄取</div>
                        <{elseif $signup_data.accept === '0'}>
                            <div class="text-muted">未錄取</div>
                        <{else}>
                        <div class="text-warning">尚未公佈</div>
                        <{/if}>
                    </td>
                </tr>
            <{/foreach}>
        </tbody>
    </table>

     

  2. 編輯 class\Tad_signup_data.php 修改 get_all(),以取得活動資料
    //取得所有資料陣列
    public static function get_all($action_id = '', $uid = '', $auto_key = false)
    {
        global $xoopsDB, $xoopsUser;
        /*---略---*/
        while ($data = $xoopsDB->fetchArray($result)) {
            $TadDataCenter->set_col('id', $data['id']);
            $data['tdc'] = $TadDataCenter->getData();
            $data['action'] = Tad_signup_actions::get($data['action_id']);
    
            /*---略---*/
        }
        return $data_arr;
    }

     

link to https://github.com/tadlearn/tad_signup/commit/7bc774600d2743c14fae340e77fa1359db31a835 \


:::

搜尋

QR Code 區塊

https%3A%2F%2Ftad0616.net%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D48%26tbdsn%3D1687

書籍目錄

展開 | 闔起

線上使用者

122人線上 (11人在瀏覽線上書籍)

會員: 0

訪客: 122

更多…