:::

9-4-2-13 pdf.php 套用語系

您沒有觀看影片的權限

您沒有觀看影片的權限

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

<?php
use Xmf\Request;
use XoopsModules\Tad_signup\Tad_signup_actions;
use XoopsModules\Tad_signup\Tad_signup_data;
/*-----------引入檔案區--------------*/
require_once __DIR__ . '/header.php';

if (!$_SESSION['can_add']) {
    redirect_header($_SERVER['PHP_SELF'], 3, _TAD_PERMISSION_DENIED);
}

$id = Request::getInt('id');

$action = Tad_signup_actions::get($id);

if ($action['uid'] != $xoopsUser->uid()) {
    redirect_header($_SERVER['PHP_SELF'], 3, _TAD_PERMISSION_DENIED);
}

$title = $action['title'];

$html[] = "<h1>{$title}" . _MD_TAD_SIGNUP_APPLY_LIST . "</h1>";
$html[] = '<table border="1" cellpadding="3">';

$head = Tad_signup_data::get_head($action);

$html[] = "<tr><th>" . implode("</th><th>", $head) . "</th></tr>";

$signup = Tad_signup_data::get_all($action['id']);
foreach ($signup as $signup_data) {
    $iteam = [];
    foreach ($signup_data['tdc'] as $user_data) {
        $iteam[] = implode('|', $user_data);
    }

    if ($signup_data['accept'] === '1') {
        $iteam[] = _MD_TAD_SIGNUP_ACCEPT;
    } elseif ($signup_data['accept'] === '0') {
        $iteam[] = _MD_TAD_SIGNUP_NOT_ACCEPT;
    } else {
        $iteam[] = _MD_TAD_SIGNUP_ACCEPT_NOT_YET;
    }
    $iteam[] = $signup_data['signup_date'];
    $iteam[] = $signup_data['tag'];

    $html[] = "<tr><td>" . implode("</td><td>", $iteam) . "</td></tr>";
}

$html[] = "</table>";

$html_content = implode('', $html);

require_once XOOPS_ROOT_PATH . '/modules/tadtools/tcpdf/tcpdf.php';
$pdf = new TCPDF("L", "mm", "A4", true, 'UTF-8', false);
$pdf->setPrintHeader(false); //不要頁首
$pdf->setPrintFooter(false); //不要頁尾
$pdf->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM); //設定自動分頁
$pdf->setFontSubsetting(true); //產生字型子集(有用到的字才放到文件中)
$pdf->SetFont('droidsansfallback', '', 11, '', true); //設定字型
$pdf->SetMargins(15, 15); //設定頁面邊界,
$pdf->AddPage(); //新增頁面,一定要有,否則內容出不來

$pdf->writeHTML($html_content);

$pdf->Output("{$title}.pdf", 'D');

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


:::

搜尋

QR Code 區塊

https%3A%2F%2Fmail.tad0616.cp27.secserverpros.com%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D1817%26tbsn%3D48

書籍目錄

展開 | 闔起

線上使用者

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

會員: 0

訪客: 370

更多…