Skip to content

Commit

Permalink
讓無法報名的活動也能顯示出來
Browse files Browse the repository at this point in the history
  • Loading branch information
tadlearn committed Jul 17, 2021
1 parent f68fd76 commit 43a433f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion class/Tad_signup_actions.php
Expand Up @@ -235,7 +235,7 @@ public static function get_all($only_enable = true, $auto_key = false)

$and_enable = $only_enable ? "and `enable` = '1' and `action_date` >= now() " : '';

$sql = "select * from `" . $xoopsDB->prefix("tad_signup_actions") . "` where 1 $and_enable";
$sql = "select * from `" . $xoopsDB->prefix("tad_signup_actions") . "` where 1 $and_enable order by `enable`, `action_date` desc";

//Utility::getPageBar($原sql語法, 每頁顯示幾筆資料, 最多顯示幾個頁數選項);
$PageBar = Utility::getPageBar($sql, $xoopsModuleConfig['show_number'], 10);
Expand Down
2 changes: 2 additions & 0 deletions class/Tad_signup_data.php
Expand Up @@ -55,6 +55,8 @@ public static function create($action_id, $id = '')
$action = Tad_signup_actions::get($action_id, true);
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']) {
redirect_header($_SERVER['PHP_SELF'], 3, "人數已滿,無法再進行報名");
}
Expand Down
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -104,7 +104,7 @@

default:
if (empty($id)) {
Tad_signup_actions::index();
Tad_signup_actions::index($xoopsModuleConfig['only_enable']);
$op = 'tad_signup_actions_index';
} else {
Tad_signup_actions::show($id);
Expand Down

0 comments on commit 43a433f

Please sign in to comment.