Skip to content

Commit

Permalink
前台頁面的基本架構
Browse files Browse the repository at this point in the history
  • Loading branch information
tadlearn committed Jul 3, 2021
1 parent 1acb822 commit 2b1e608
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions index.php
Expand Up @@ -3,11 +3,11 @@
// 如「資料表名」= actions,則「模組物件」= Actions
use Xmf\Request;
use XoopsModules\Tadtools\Utility;
use XoopsModules\首字大寫模組目錄\模組物件;
use XoopsModules\Tad_signup\Tad_signup_actions;

/*-----------引入檔案區--------------*/
require_once __DIR__ . '/header.php';
$GLOBALS['xoopsOption']['template_main'] = '模組目錄_index.tpl';
$GLOBALS['xoopsOption']['template_main'] = 'tad_signup_index.tpl';
require_once XOOPS_ROOT_PATH . '/header.php';

/*-----------變數過濾----------*/
Expand All @@ -18,41 +18,41 @@
switch ($op) {

//新增表單
case '資料表名_create':
模組物件::create();
case 'tad_signup_actions_create':
Tad_signup_actions::create();
break;

//新增資料
case '資料表名_store':
$id = 模組物件::store();
case 'tad_signup_actions_store':
$id = Tad_signup_actions::store();
header("location: {$_SERVER['PHP_SELF']}?id=$id");
exit;

//修改用表單
case '資料表名_edit':
模組物件::create($id);
$op = '資料表名_create';
case 'tad_signup_actions_edit':
Tad_signup_actions::create($id);
$op = 'tad_signup_actions_create';
break;

//更新資料
case '資料表名_update':
模組物件::update($id);
case 'tad_signup_actions_update':
Tad_signup_actions::update($id);
header("location: {$_SERVER['PHP_SELF']}?id=$id");
exit;

//刪除資料
case '資料表名_destroy':
模組物件::destroy($id);
case 'tad_signup_actions_destroy':
Tad_signup_actions::destroy($id);
header("location: {$_SERVER['PHP_SELF']}");
exit;

default:
if (empty($id)) {
模組物件::index();
$op = '資料表名_index';
Tad_signup_actions::index();
$op = 'tad_signup_actions_index';
} else {
模組物件::show($id);
$op = '資料表名_show';
Tad_signup_actions::show($id);
$op = 'tad_signup_actions_show';
}
break;
}
Expand All @@ -63,5 +63,5 @@
unset($_SESSION['api_mode']);
$xoopsTpl->assign('toolbar', Utility::toolbar_bootstrap($interface_menu));
$xoopsTpl->assign('now_op', $op);
$xoTheme->addStylesheet(XOOPS_URL . '/modules/模組目錄/css/module.css');
$xoTheme->addStylesheet(XOOPS_URL . '/modules/tad_signup/css/module.css');
require_once XOOPS_ROOT_PATH . '/footer.php';

0 comments on commit 2b1e608

Please sign in to comment.