Skip to content

Commit

Permalink
寫入 PDF 設定
Browse files Browse the repository at this point in the history
  • Loading branch information
tadlearn committed Aug 14, 2021
1 parent 5c186e4 commit 176afe2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
18 changes: 16 additions & 2 deletions class/Tad_signup_data.php
Expand Up @@ -593,12 +593,26 @@ public static function pdf_setup($action_id)
$action = Tad_signup_actions::get($action_id);
$xoopsTpl->assign('action', $action);

$TadDataCenter = new TadDataCenter('tad_signup');
$TadDataCenter->set_col('pdf_setup_id', $action_id);
$pdf_setup_col = $TadDataCenter->getData('pdf_setup_col', 0);
$to_arr = explode(',', $pdf_setup_col);

// 製作標題
$from_arr = self::get_head($action);
$head_arr = self::get_head($action);
$from_arr = array_diff($head_arr, $to_arr);

$to_arr = $hidden_arr = [];
$hidden_arr = [];

$tmt_box = Tmt::render('pdf_setup_col', $from_arr, $to_arr, $hidden_arr, true, false);
$xoopsTpl->assign('tmt_box', $tmt_box);
}

//儲存pdf的匯出設定
public static function pdf_setup_save($action_id, $pdf_setup_col = '')
{
$TadDataCenter = new TadDataCenter('tad_signup');
$TadDataCenter->set_col('pdf_setup_id', $action_id);
$TadDataCenter->saveCustomData(['pdf_setup_col' => [$pdf_setup_col]]);
}
}
7 changes: 7 additions & 0 deletions index.php
Expand Up @@ -15,6 +15,7 @@
$action_id = Request::getInt('action_id');
$accept = Request::getInt('accept');
$files_sn = Request::getInt('files_sn');
$pdf_setup_col = Request::getString('pdf_setup_col');

/*-----------執行動作判斷區----------*/
switch ($op) {
Expand Down Expand Up @@ -134,6 +135,12 @@
Tad_signup_data::pdf_setup($id);
break;

//儲存pdf的匯出設定
case 'tad_signup_data_pdf_setup_save':
Tad_signup_data::pdf_setup_save($action_id, $pdf_setup_col);
header("location: pdf_signup.php?id=$action_id");
exit;

default:
if (empty($id)) {
Tad_signup_actions::index($xoopsModuleConfig['only_enable']);
Expand Down

0 comments on commit 176afe2

Please sign in to comment.