:::

6-5-4 讓候補功能生效

您沒有觀看影片的權限

您沒有觀看影片的權限

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

  1. 先讓報名者看得見候補名額
  2. 修改 templates\op_tad_signup_actions_show.tpl:(顯示可否報名圖示的判斷也順便改一下)
    <h2 class="my">
        <{if $enable && ($number + $candidate) > $signup|@count && $end_date|strtotime >= $smarty.now}>
            <i class="fa fa-check text-success" aria-hidden="true"></i>
        <{else}>
            <i class="fa fa-times text-danger" aria-hidden="true"></i>
        <{/if}>
        <{$title}>
        <!--略-->
    </h2>
    
    <!--略-->
    
    <h3 class="my">
        已報名表資料
        <small>
            <i class="fa fa-calendar-check-o" aria-hidden="true"></i> 報名截止日期:<{$end_date}>
            <i class="fa fa-users" aria-hidden="true"></i> 報名人數上限:<{$number}>
            <{if $candidate}><span data-toggle="tooltip" title="可候補人數">(<{$candidate}>)</span><{/if}>
        </small>
    </h3>

     

  3. 修改 templates\op_tad_signup_data_create.tpl:(顯示可否報名圖示的判斷也順便改一下)
    <h2 class="my">
        <{if $action.enable}>
            <i class="fa fa-check text-success" aria-hidden="true"></i>
        <{else}>
            <i class="fa fa-times text-danger" aria-hidden="true"></i>
        <{/if}>
        <{$action.title}>
        <!--略--></small>
    </h2>
    
    <!--略-->
    
    <h3 class="my">
        報名表
        <small>
            <i class="fa fa-calendar-check-o" aria-hidden="true"></i> 報名截止日期:<{$action.end_date}>
            <i class="fa fa-users" aria-hidden="true"></i> 報名人數上限:<{$action.number}> 
            <{if $action.candidate}><span data-toggle="tooltip" title="可候補人數">(<{$action.candidate}>)</span><{/if}>
        </small>
    </h3>

     

  4. 修改 templates\op_tad_signup_data_show.tpl:(顯示可否報名圖示的判斷也順便改一下)
    <h2 class="my">
        <{if $action.enable}>
            <i class="fa fa-check text-success" aria-hidden="true"></i>
        <{else}>
            <i class="fa fa-times text-danger" aria-hidden="true"></i>
        <{/if}>
        <{$action.title}>
        <!--略-->
    </h2>
    
    <!--略-->
    
    <h3 class="my">
        報名表
        <small>
            <i class="fa fa-calendar-check-o" aria-hidden="true"></i> 報名截止日期:<{$action.end_date}>
            <i class="fa fa-users" aria-hidden="true"></i> 報名人數上限:<{$action.number}>
            <{if $action.candidate}><span data-toggle="tooltip" title="可候補人數">(<{$action.candidate}>)</span><{/if}>
        </small>
    </h3>

     

  5. 修改 templates\op_tad_signup_actions_index.tpl:(顯示「立即報名」按鈕以及可否報名圖示的判斷也順便改一下)
    <td>
        <{if $action.enable && ($action.number + $action.candidate) > $action.signup|@count && $action.end_date|strtotime >= $smarty.now}>
            <i class="fa fa-check text-success" data-toggle="tooltip" title="報名中" aria-hidden="true"></i>
        <{else}>
            <i class="fa fa-times text-danger" data-toggle="tooltip" title="無法報名" aria-hidden="true"></i>
        <{/if}>
        <a href="<{$xoops_url}>/modules/tad_signup/index.php?id=<{$action.id}>"><{$action.title}></a>
    </td>
        <!--略-->
    <td>
        <{$action.signup|@count}>/<{$action.number}>
        <{if $action.candidate}><span data-toggle="tooltip" title="可候補人數">(<{$action.candidate}>)</span><{/if}>
    </td>
    <td>
        <!--略-->
    
        <{if $action.enable && ($action.number+$action.candidate) > $action.signup|@count && $xoops_isuser && $action.end_date|strtotime >= $smarty.now}>
            <a href="<{$xoops_url}>/modules/tad_signup/index.php?op=tad_signup_data_create&action_id=<{$action.id}>" class="btn btn-sm btn-info"><i class="fa fa-plus" aria-hidden="true"></i> 立即報名</a>
        <{else}>
            <!--略-->
        <{/if}>
    </td>

     

  6. 修改 templates\blocks\action_list.tpl:(顯示可否報名圖示的判斷也順便改一下)
    <small>
        名額<{$action.number}>
        <{if $action.candidate}><span data-toggle="tooltip" title="可候補人數">(<{$action.candidate}>)</span><{/if}>
        人,已報名<{$action.signup|@count}>人
    </small>
    <div>
        <{if $action.enable && ($action.number + $action.candidate) > $action.signup|@count && $action.end_date|strtotime >= $smarty.now}>
            <i class="fa fa-check text-success" data-toggle="tooltip" title="報名中" aria-hidden="true"></i>
        <{else}>
            <i class="fa fa-times text-danger" data-toggle="tooltip" title="無法報名" aria-hidden="true"></i>
        <{/if}>
        <!--略-->
    </div>

     

  7. 修改 templates\blocks\action_signup.tpl:(顯示「立即報名」按鈕以及可否報名圖示的判斷也順便改一下)
    <h2 class="my">
        <{if $block.enable && ($block.number + $block.candidate) > $block.signup|@count && $block.end_date|strtotime >= $smarty.now}>
            <!--略-->
        <{/if}>
        <{$block.title}>
    </h2>
    
    <!--略-->
    
    <h4 class="my">
        <small>
            <!--略-->
                <i class="fa fa-users" aria-hidden="true"></i> 報名狀況:<{$block.signup|@count}>/<{$block.number}>
                <{if $block.candidate}><span data-toggle="tooltip" title="可候補人數">(<{$block.candidate}>)</span><{/if}>
            </div>
        </small>
    </h4>
    
    <div class="text-center my-2">
        <a href="<{$xoops_url}>/modules/tad_signup/index.php?op=tad_signup_data_create&action_id=<{$block.id}>" class="btn btn-lg btn-info <{if !($block.enable && ($block.number+$block.candidate) > $block.signup|@count && $xoops_isuser && $block.end_date|strtotime >= $smarty.now)}>disabled<{/if}>"><i class="fa fa-plus" aria-hidden="true"></i> 立即報名</a>
    </div>

     

  8. 最後只要修改 錄影時忘了加這段,記得加
    //編輯表單
    public static function create($action_id, $id = '')
    {
        /*--略--*/ 
    
        $action = Tad_signup_actions::get($action_id, true);
        $action['signup'] = Tad_signup_data::get_all($action_id);
        if (time() > strtotime($action['end_date'])) {
            redirect_header($_SERVER['PHP_SELF'], 3, "已報名截止,無法再進行報名或修改報名");
        } elseif (!$action['enable']) {
            redirect_header($_SERVER['PHP_SELF'], 3, "該報名已關閉,無法再進行報名或修改報名");
        } elseif (count($action['signup']) >= ($action['number'] + $action['candidate'])) {
            redirect_header($_SERVER['PHP_SELF'], 3, "人數已滿,無法再進行報名");
        }
        /*--略--*/ 
    }

     

link to https://github.com/tadlearn/tad_signup/commit/777728fdee9e11d27d115bdb734ad94eb8fb5005 \


:::

搜尋

QR Code 區塊

https%3A%2F%2Ftad0616.cp22.secserverpros.com%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D1740%26tbsn%3D48

書籍目錄

展開 | 闔起

線上使用者

339人線上 (149人在瀏覽線上書籍)

會員: 0

訪客: 339

更多…