当前位置: 首页>>代码示例>>PHP>>正文


PHP HTML2FPDF::AddPage方法代码示例

本文整理汇总了PHP中HTML2FPDF::AddPage方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML2FPDF::AddPage方法的具体用法?PHP HTML2FPDF::AddPage怎么用?PHP HTML2FPDF::AddPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTML2FPDF的用法示例。


在下文中一共展示了HTML2FPDF::AddPage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 function event_espresso_generat_pdf($name = "Invoice", $content)
 {
     require_once 'html2fpdf.php';
     //exit($content);
     $pdf = new HTML2FPDF('P', 'mm', 'Letter');
     $pdf->AddPage();
     $pdf->WriteHTML($content);
     $pdf->Output($name . '.pdf', 'D');
 }
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:9,代码来源:generate_pdf.php

示例2: define

 static function html2pdf($html, $encode = "SJIS")
 {
     //echo 1;exit;
     //$html=self::pdf_change_encode($html,$encode);
     define('FPDF_FONTPATH', ROOT . 'lib/html2fpdf/font/');
     include ROOT . 'lib/html2fpdf/jphtml2fpdf.php';
     $pdf = new HTML2FPDF("l", "mm", "A4");
     $pdf->Open();
     $pdf->SetCompression(false);
     $pdf->SetDisplayMode("real");
     $pdf->UseCSS();
     $pdf->UsePRE();
     $pdf->AddSJISFont();
     $pdf->setBasePath("");
     $pdf->AddPage();
     //ファイル情報
     $pdf->SetAuthor("HPX");
     $pdf->Bookmark("HPX");
     $pdf->SetTitle("HPX");
     $pdf->SetCreator("HPX");
     // 本文
     $pdf->SetMargins(10, 10);
     $pdf->DisplayPreferences('HideWindowUI');
     //$pdf->SetFont( HideWindowUI,"",8);
     $pdf->WriteHTML($html);
     // 出力
     $pdf->Output('doc.pdf', 'D');
     exit;
 }
开发者ID:tranngocthang89,项目名称:basephpmvc,代码行数:29,代码来源:View.php

示例3: Create

 function Create()
 {
     $this->content = utf8_decode($this->_ParseHTML($this->content));
     $pdf = new HTML2FPDF();
     $pdf->ShowNOIMG_GIF();
     $pdf->DisplayPreferences('HideWindowUI');
     $pdf->AddPage();
     $pdf->WriteHTML($this->content);
     $pdf->Output(\Cx\Lib\FileSystem\FileSystem::replaceCharacters($this->title));
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:10,代码来源:pdf.class.php

示例4: PDF_html_2_pdf

function PDF_html_2_pdf($data)
{
    global $auth;
    $pdf = new HTML2FPDF();
    $pdf->UseCSS();
    $pdf->UseTableHeader();
    $pdf->AddPage();
    $pdf->WriteHTML(AdjustHTML($data));
    $pdf->Output();
}
开发者ID:BackupTheBerlios,项目名称:ascore,代码行数:10,代码来源:lib_PDF.php

示例5: Pdf_do

 public function Pdf_do($config = array())
 {
     $source_name = $config['name'];
     $task_name = $config['output'];
     require 'htmlofpdf/html2fpdf.php';
     $pdf = new HTML2FPDF();
     $pdf->AddGBFont('GB', 'GB2312');
     $pdf->AddPage();
     $fp = fopen($source_name, "r");
     $strContent = fread($fp, filesize($source_name));
     fclose($fp);
     $pdf->WriteHTML(iconv("UTF-8", "GB2312", $strContent));
     ob_clean();
     $pdf->Output($task_name, true);
 }
开发者ID:coffeehb,项目名称:w3a_SOC,代码行数:15,代码来源:Pdf_smart.php

示例6: createPDF

 public function createPDF($url)
 {
     $url = 'http://clients.skiify.com/eximagen/en/boligrafos-plasticos/430-boligrafo-pilot.html';
     require_once '/html2pdf/html2fpdf.php';
     // Create new HTML2PDF class for an A4 page, measurements in mm
     $pdf = new HTML2FPDF('P', 'mm', 'A4');
     $buffer = file_get_contents($url);
     var_dump($buffer);
     // Optional top margin
     $pdf->SetTopMargin(1);
     $pdf->AddPage();
     // Control the x-y position of the html
     $pdf->SetXY(0, 0);
     $pdf->WriteHTML($buffer);
     // The 'D' arg forces the browser to download the file
     $pdf->Output('MyFile.pdf', 'D');
 }
开发者ID:Eximagen,项目名称:3m,代码行数:17,代码来源:converttopdf.php

示例7: pdf

 function pdf()
 {
     exit("deactivated for now...");
     if ($ID = Director::urlParam("ID")) {
         if ($invoice = DataObject::get_one("ShopInvoice", "PublicURL = '" . Convert::Raw2SQL($ID) . "'")) {
             $this->Invoice = $invoice;
             if (!isset($_REQUEST['view'])) {
                 //generate pdf
                 require dirname(__FILE__) . '/Thirdparty/html2fpdf/html2fpdf.php';
                 //to get work HTML2PDF
                 error_reporting(E_ALL ^ (E_NOTICE | E_DEPRECATED));
                 $pdf = new HTML2FPDF();
                 $pdf->AddPage();
                 $pdfPath = $invoice->generatePDF();
                 $outputPath = TEMP_FOLDER . "/shopsystem/";
                 $outputFile = $outputPath . $invoice->PublicURL . ".pdf";
                 $fp = fopen($pdfPath, "r");
                 $strContent = fread($fp, filesize($pdfPath));
                 fclose($fp);
                 $pdf->WriteHTML($strContent);
                 $pdf->Output($outputFile);
                 header('Content-type: application/pdf');
                 header('Content-Disposition: attachment; filename="invoice.pdf"');
                 echo file_get_contents($outputFile);
                 //PDF file is generated successfully!
                 exit;
             }
             if (isset($_REQUEST['remove'])) {
                 //remove invoice from public by generating a new public url
                 $invoice->PublicURL = ShopInvoice::generatePublicURL();
                 $invoice->write();
             }
         }
     }
     return array();
 }
开发者ID:pstaender,项目名称:ShopSystem,代码行数:36,代码来源:ShopInvoice.php

示例8:

' . $arrNichesRecord[0]["Section"] . '
</td>
<td>
' . $arrNichesRecord[0]["row"] . '
</td>
<td>
' . $arrNichesRecord[0]["columns"] . '
</td>
</tr>
</table>
<br />

<label> <strong>Extra 1</strong></label>
<label class="text">
' . $UrnExtra1 . '</label>
<br/>
<br/>
<label> <strong>Extra 2</strong></label>
<label class="text">' . $UrnExtra2 . '</label>
<br/>
<br />

</body>
</html>
';
$pdf = new HTML2FPDF();
$pdf->AliasNbPages();
//$pdf->Footer($varFooter);
$pdf->AddPage();
$pdf->WriteHTML($varStrContent);
$pdf->Output('urns_detail.pdf', 'D');
开发者ID:saurabhs4,项目名称:niches,代码行数:31,代码来源:urns_detail_print.php

示例9: iconv

 /**
  * convert html to pdf
  *
  * @param string $doc_src	path to source file, include filename
  * @param string $doc_dst	path to output file, include filename
  */
 function html2pdf($doc_src, $doc_dst)
 {
     require_once LIB_PATH . 'html2fpdf/html2fpdf.php';
     $strContent = @file_get_contents($doc_src);
     $strContent = iconv('utf-8', 'gbk', $strContent);
     $pdf = new HTML2FPDF();
     $pdf->AddPage();
     $pdf->writeHTML($strContent);
     $pdf->Output($doc_dst);
 }
开发者ID:xindalu,项目名称:evolve,代码行数:16,代码来源:FileCovert.php

示例10: DisplayPDF

 function DisplayPDF($smarty, $invoicetype, $template)
 {
     require_once 'pdf-invoices/html2pdf/html2fpdf.php';
     $pdf = new HTML2FPDF();
     $pdf->DisplayPreferences('HideWindowUI');
     $pdf->AddPage();
     $pdf->WriteHTML($this->GetHTML($smarty, $invoicetype, $template));
     // TODO: find a better name
     return $pdf->Output('Invoice_' . date("d/m/Y-H:i") . '.pdf', 'I');
 }
开发者ID:sayemk,项目名称:a2billing,代码行数:10,代码来源:A2B_invoice.php

示例11: createPDF

 function createPDF()
 {
     global $smarty;
     $smarty = new Smarty();
     templateAssignInvoice('smarty', $this);
     templateAssignSystemvars('smarty');
     $smarty->assign('invoice_heading', 'Faktura');
     $pdf = new HTML2FPDF();
     $pdf->DisplayPreferences('HideWindowUI');
     $pdf->AddPage();
     $pdf->WriteHTML($smarty->fetch('file:invoice.tpl'));
     $pdf->Output('invoice/invoice' . $this->invoice_id . '.pdf');
     $smarty->assign('invoice_heading', 'Fakturakopi');
     $pdf = new HTML2FPDF();
     $pdf->DisplayPreferences('HideWindowUI');
     $pdf->AddPage();
     $pdf->WriteHTML($smarty->fetch('file:invoice.tpl'));
     $pdf->Output('invoice/invoice' . $this->invoice_id . '_copy.pdf');
 }
开发者ID:HNygard,项目名称:JM-booking,代码行数:19,代码来源:invoice.class.php

示例12: OutputReport

 public function OutputReport($szOutputBuffer, &$szErrorStr)
 {
     global $gl_root_path;
     // Helper variable, init with buffer
     $szFinalOutput = $szOutputBuffer;
     $res = SUCCESS;
     // Simple HTML Output!
     if ($this->_outputFormat == REPORT_OUTPUT_HTML) {
         // do nothing
     } else {
         if ($this->_outputFormat == REPORT_OUTPUT_PDF) {
             // Convert into PDF!
             include_once $gl_root_path . 'classes/html2fpdf/html2fpdf.php';
             //			$pdf=new HTML2FPDF('landscape');
             $pdf = new HTML2FPDF();
             $pdf->UseCss(true);
             $pdf->AddPage();
             //			$pdf->SetFontSize(12);
             $pdf->WriteHTML($szOutputBuffer);
             $szFinalOutput = $pdf->Output('', 'S');
             // Output to STANDARD Input!
         }
     }
     // Simple HTML Output!
     if ($this->_outputTarget == REPORT_TARGET_STDOUT) {
         // Check if we need another header
         if ($this->_outputFormat == REPORT_OUTPUT_PDF) {
             Header('Content-Type: application/pdf');
         }
         // Kindly output to browser
         echo $szFinalOutput;
         $res = SUCCESS;
     } else {
         if ($this->_outputTarget == REPORT_TARGET_FILE) {
             // Get Filename first
             if (isset($this->_arrOutputTargetDetails['filename'])) {
                 // Get Filename property
                 $szFilename = $this->_arrOutputTargetDetails['filename'];
                 // Create file and Write Report into it!
                 $handle = @fopen($szFilename, "w");
                 if ($handle === false) {
                     $szErrorStr = "Could not create '" . $szFilename . "'!";
                     $res = ERROR;
                 } else {
                     fwrite($handle, $szFinalOutput);
                     fflush($handle);
                     fclose($handle);
                     // For result
                     $szErrorStr = "Results were saved into '" . $szFilename . "'";
                     $res = SUCCESS;
                 }
             } else {
                 $szErrorStr = "The parameter 'filename' was missing.";
                 $res = ERROR;
             }
         }
     }
     // return result
     return $res;
 }
开发者ID:chinaares,项目名称:loganalyzer,代码行数:60,代码来源:report.class.php

示例13: getContent


//.........这里部分代码省略.........
    }
    global $sourceFolder;
    global $moduleFolder;
    require_once $sourceFolder . "/" . $moduleFolder . "/" . $moduleType . ".lib.php";
    $page = new $moduleType();
    if (!$page instanceof module) {
        displayerror("The module \"{$moduleType}\" does not implement the inteface module</div>");
        return "";
    }
    $createperms_query = " SELECT * FROM " . MYSQL_DATABASE_PREFIX . "permissionlist where perm_action = 'create' AND page_module = '" . $moduleType . "'";
    $createperms_result = mysql_query($createperms_query);
    if (mysql_num_rows($createperms_result) < 1) {
        displayerror("The action \"create\" does not exist in the module \"{$moduleType}\"</div>");
        return "";
    }
    $availableperms_query = "SELECT * FROM " . MYSQL_DATABASE_PREFIX . "permissionlist where perm_action != 'create' AND page_module = '" . $moduleType . "'";
    $availableperms_result = mysql_query($availableperms_query);
    $permlist = array();
    while ($value = mysql_fetch_assoc($availableperms_result)) {
        array_push($permlist, $value['perm_action']);
    }
    array_push($permlist, "view");
    $class_methods = get_class_methods($moduleType);
    foreach ($permlist as $perm) {
        if (!in_array("action" . ucfirst($perm), $class_methods)) {
            displayerror("The action \"{$perm}\" does not exist in the module \"{$moduleType}\"</div>");
            return "";
        }
    }
    if ($action == "pdf") {
        if (isset($_GET['depth'])) {
            $depth = $_GET['depth'];
        } else {
            $depth = 0;
        }
        if (!is_numeric($depth)) {
            $depth = 0;
        }
        global $TITLE;
        global $sourceFolder;
        require_once "{$sourceFolder}/modules/pdf/html2fpdf.php";
        $pdf = new HTML2FPDF();
        $pdf->setModuleComponentId($moduleComponentId);
        $pdf->AddPage();
        $pdf->WriteHTML($page->getHtml($userId, $moduleComponentId, "view"));
        $cp = array();
        $j = 0;
        if ($depth == -1) {
            $cp = child($pageId, $userId, $depth);
            if ($cp[0][0]) {
                for ($i = 0; $cp[$i][0] != NULL; $i++) {
                    require_once $sourceFolder . "/" . $moduleFolder . "/" . $cp[$i][2] . ".lib.php";
                    $page1 = new $cp[$i][2]();
                    $modCompId = $cp[$i][5];
                    $pdf->setModuleComponentId($modCompId);
                    $pdf->AddPage();
                    $pdf->WriteHTML($page1->getHtml($userId, $modCompId, "view"));
                }
            }
        } else {
            if ($depth > 0) {
                $cp = child($pageId, $userId, $depth);
                --$depth;
                while ($depth > 0) {
                    $count = count($cp);
                    for ($j; $j < $count; $j++) {
                        $cp = array_merge((array) $cp, (array) child($cp[$j][0], $userId, $depth));
                    }
                    --$depth;
                }
                if ($cp[0][0]) {
                    for ($i = 0; isset($cp[$i]); $i++) {
                        require_once $sourceFolder . "/" . $moduleFolder . "/" . $cp[$i][2] . ".lib.php";
                        $page1 = new $cp[$i][2]();
                        $modCompId = $cp[$i][5];
                        $pdf->setModuleComponentId($modCompId);
                        $pdf->AddPage();
                        $pdf->WriteHTML($page1->getHtml($userId, $modCompId, "view"));
                    }
                }
            }
        }
        $filePath = $sourceFolder . "/uploads/temp/" . $TITLE . ".pdf";
        while (file_exists($filePath)) {
            $filePath = $sourceFolder . "/uploads/temp/" . $TITLE . "-" . rand() . ".pdf";
        }
        $pdf->Output($filePath);
        header("Pragma: public");
        header("Expires: 0");
        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
        header("Cache-Control: private", false);
        header("Content-Type: application/pdf");
        header("Content-Disposition: attachment; filename=\"" . basename($filePath) . "\";");
        header("Content-Transfer-Encoding: binary");
        header("Content-Length: " . filesize($filePath));
        @readfile("{$filePath}");
        unlink($filePath);
    }
    return $page->getHtml($userId, $moduleComponentId, $action);
}
开发者ID:rubulh,项目名称:pragyan,代码行数:101,代码来源:content.lib.php

示例14: HandlePDF

function HandlePDF($pagename)
{
    global $WikiTitle;
    // modify WikiTitle
    $WikiTitle = str_replace(' ', '_', $WikiTitle);
    $WikiTitle = html_entity_decode($WikiTitle);
    // read wiki page !
    //$page = ReadPage($pagename);
    $page = RetrieveAuthPage($pagename, 'read', true, READPAGE_CURRENT);
    //$date['modif'] = filemtime($_SERVER['DOCUMENT_ROOT'].'/wiki.d/'.$pagename);
    // define variable
    $xyz['author'] = 'by ' . $page['author'];
    // pdf author
    $xyz['name']['page'] = str_replace('.', '_', $pagename);
    // page name
    $xyz['name']['pdf'] = $WikiTitle . '_' . $xyz['name']['page'] . '.pdf';
    // pdf name
    $xyz['text'] = mv_breakpage($page['text']);
    // to transform breakpage markup
    $xyz['title'] = $WikiTitle . ' : page ' . $xyz['name']['page'];
    // pdf title
    $xyz['path'] = $_SERVER["DOCUMENT_ROOT"];
    // return root path of your site web
    $xyz['url'] = 'http://' . HOST . URI;
    // pdf URL
    // transform text to html !
    $html = change_code(MarkupToHTML($pagename, $xyz['text']));
    /*** for test ! ***
    	echo $xyz['text'];
    	echo "\n HTML : ".$html;
    	/** */
    //out pass memory server
    ini_set('memory_limit', '24M');
    ini_set('max_execution_time', 0);
    //  declare a new object pdf
    $pdf = new HTML2FPDF();
    // Disactive elements HTML ... cause bad support !
    $pdf->DisableTags('<span>');
    $pdf->DisableTags('<dl>');
    $pdf->DisableTags('<dt>');
    $pdf->DisableTags('<dd>');
    // generals informations
    $pdf->SetCompression(1);
    $pdf->SetAuthor($xyz['author']);
    $pdf->SetTitle($xyz['title']);
    // method implemented by me to return in footer pdf generated.
    $pdf->PutHREF($xyz['url']);
    // method implemented by html2pdf author !
    $pdf->setBasePath($xyz['path']);
    // to implement path of your site ; need it for include correctly the image on pdf !
    $pdf->UseCSS(false);
    // to recognize CSS ... run correctly ?
    $pdf->UsePRE(false);
    // to recognize element PRE in your code HTML ... but, really bad support !
    // build the page PDF
    $pdf->AddPage();
    $pdf->WriteHTML($html);
    $pdf->Output($xyz['name']['pdf'], I);
    /**/
    // retabli valeur serveur
    ini_set('memory_limit', MEM);
    ini_set('max_execution_time', MAX_TIME);
}
开发者ID:powellc,项目名称:friends-neighbors_com,代码行数:63,代码来源:pmwiki2pdf.php

示例15: getAdvancedReportPDF


//.........这里部分代码省略.........
        $i_isok = !$i_rSet2->EOF;
    }
    if ($i_isok) {
        $i_isok = $i_rSet3 = $g_db->SelectLimit("SELECT * FROM " . $srv_settings['table_prefix'] . "tests WHERE testid=" . $i_rSet2->fields['testid'], 1);
    }
    if ($i_isok) {
        $i_isok = !$i_rSet3->EOF;
    }
    if ($i_isok) {
        $i_isok = $i_rSet3->fields['rtemplateid'] > 0 && ($i_rSet3->fields['test_reportgradecondition'] == 0 || $i_rSet3->fields['test_reportgradecondition'] >= $i_rSet2->fields['gscale_gradeid']);
    }
    if ($i_isok) {
        $i_isok = $i_rSet6 = $g_db->SelectLimit("SELECT * FROM " . $srv_settings['table_prefix'] . "users WHERE id=" . $i_rSet2->fields['id'], 1);
    }
    if ($i_isok) {
        $i_isok = !$i_rSet6->EOF;
    }
    $i_result_detailed_1_items = array();
    $i_result_detailed_2_items = array();
    $i_result_detailed_3_items = array();
    $i_result_detailed_4_items = array();
    if ($i_isok) {
        $i_isok = $i_rSet7 = $g_db->Execute("SELECT * FROM " . $srv_settings['table_prefix'] . "results_answers, " . $srv_settings['table_prefix'] . "questions WHERE resultid=" . $resultid . " AND " . $srv_settings['table_prefix'] . "results_answers.questionid=" . $srv_settings['table_prefix'] . "questions.questionid ORDER BY result_answerid");
    }
    if ($i_isok) {
        $i_questionno = 0;
        while (!$i_rSet7->EOF) {
            $i_questionno++;
            $i_answers = array();
            $i_rSet5 = $g_db->Execute("SELECT answer_text, answer_correct FROM " . $srv_settings['table_prefix'] . "answers WHERE questionid=" . $i_rSet7->fields['questionid'] . " ORDER BY answerid");
            if (!$i_rSet5) {
                showDBError(__FILE__, 5);
            } else {
                $i_answerno = 1;
                while (!$i_rSet5->EOF) {
                    $i_answers[$i_answerno] = $i_rSet5->fields['answer_text'];
                    $i_answers_correct[$i_answerno] = $i_rSet5->fields['answer_correct'];
                    $i_answerno++;
                    $i_rSet5->MoveNext();
                }
                $i_rSet5->Close();
            }
            $i_detailed_correct = $i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_CORRECT;
            $i_result_detailed_3_items[$i_questionno] = $i_questionno . '. ' . getTruncatedHTML($i_rSet7->fields['question_text'], 0);
            $i_result_detailed_1_items[$i_questionno] = $i_result_detailed_3_items[$i_questionno] . '<br />';
            $i_result_detailed_1_items[$i_questionno] .= $lngstr['email_answer_iscorrect'] . ($i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_UNDEFINED ? $lngstr['label_undefined'] : ($i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_CORRECT ? $lngstr['label_yes'] : ($i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_PARTIALLYCORRECT ? $lngstr['label_partially'] : $lngstr['label_no']))) . '<br />';
            $i_result_detailed_1_items[$i_questionno] .= $lngstr['email_answer_points'] . $i_rSet7->fields['result_answer_points'] . '<br />';
            if (!$i_detailed_correct) {
                $i_result_detailed_2_items[$i_questionno] = $i_result_detailed_1_items[$i_questionno];
            }
            $i_result_detailed_3_items[$i_questionno] = '<tr><td>' . $i_result_detailed_3_items[$i_questionno] . '</td></tr>';
            for ($i = 1; $i < $i_answerno; $i++) {
                switch ($i_rSet7->fields['question_type']) {
                    case QUESTION_TYPE_MULTIPLECHOICE:
                    case QUESTION_TYPE_TRUEFALSE:
                        $i_answers_given = (int) $i_rSet7->fields['result_answer_text'];
                        $i_result_detailed_3_items[$i_questionno] .= '<tr><td><img src="images/button-checkbox-' . ($i_answers_correct[$i] ? '2' : ($i == $i_answers_given ? '4' : '0')) . '.gif" width=13 height=13> &nbsp; ' . $i_answers[$i] . '</tr>';
                        break;
                    case QUESTION_TYPE_MULTIPLEANSWER:
                        $i_answers_given = explode(QUESTION_TYPE_MULTIPLEANSWER_BREAK, $i_rSet7->fields['result_answer_text']);
                        $i_result_detailed_3_items[$i_questionno] .= '<tr><td><img src="images/button-checkbox-' . ($i_answers_correct[$i] ? '2' : (in_array($i, $i_answers_given) ? '4' : '0')) . '.gif" width=13 height=13> &nbsp; ' . $i_answers[$i] . '</tr>';
                        break;
                    case QUESTION_TYPE_FILLINTHEBLANK:
                        $i_result_detailed_3_items[$i_questionno] .= '<tr><td>' . nl2br($i_answers[$i]) . '</td></tr>';
                        break;
                }
            }
            if ($i_rSet7->fields['question_type'] == QUESTION_TYPE_ESSAY) {
                $i_result_detailed_3_items[$i_questionno] .= '<tr><td>' . nl2br($i_rSet7->fields['result_answer_text']) . '</td></tr>';
            }
            $i_result_detailed_3_items[$i_questionno] .= '<tr><td>' . $lngstr['email_answer_points'] . $i_rSet7->fields['result_answer_points'] . '</td></tr>';
            if (!$i_detailed_correct) {
                $i_result_detailed_4_items[$i_questionno] = $i_result_detailed_3_items[$i_questionno];
            }
            $i_rSet7->MoveNext();
        }
        $i_rSet7->Close();
        $i_result_detailed_1_text = implode('<br />', $i_result_detailed_1_items);
        $i_result_detailed_2_text = implode('<br />', $i_result_detailed_2_items);
        $i_result_detailed_3_text = '<table cellpadding=0 cellspacing=0 border=0 width="100%">' . implode("\n", $i_result_detailed_3_items) . '</table>';
        $i_result_detailed_4_text = '<table cellpadding=0 cellspacing=0 border=0 width="100%">' . implode("\n", $i_result_detailed_4_items) . '</table>';
        $i_result_detailed_5_text = '';
        $i_result_detailed_6_text = '';
        $i_pdf = eventOnQueryCustomReportPDF();
        if (empty($i_pdf)) {
            $i_pdf = new HTML2FPDF();
            $i_pdf->AddPage();
            $i_pdf->SetFont('Arial', '', 11);
            $i_pdf->SetTextColor(0, 0, 0);
            $g_vars['page']['grade'] = getGradeData($i_rSet2->fields['gscaleid'], $i_rSet2->fields['gscale_gradeid']);
            $g_vars['page']['subjects'] = getTestResultSubjectsData($resultid);
            $i_template_body = getReportTemplate(array('rtemplateid' => $i_rSet3->fields['rtemplateid'], 'username' => $i_rSet6->fields['username'], 'email' => $i_rSet6->fields['email'], 'title' => $i_rSet6->fields['user_title'], 'firstname' => $i_rSet6->fields['user_firstname'], 'lastname' => $i_rSet6->fields['user_lastname'], 'middlename' => $i_rSet6->fields['user_middlename'], 'address' => $i_rSet6->fields['user_address'], 'city' => $i_rSet6->fields['user_city'], 'state' => $i_rSet6->fields['user_state'], 'zip' => $i_rSet6->fields['user_zip'], 'country' => $i_rSet6->fields['user_country'], 'phone' => $i_rSet6->fields['user_phone'], 'fax' => $i_rSet6->fields['user_fax'], 'mobile' => $i_rSet6->fields['user_mobile'], 'pager' => $i_rSet6->fields['user_pager'], 'ipphone' => $i_rSet6->fields['user_ipphone'], 'webpage' => $i_rSet6->fields['user_webpage'], 'icq' => $i_rSet6->fields['user_icq'], 'msn' => $i_rSet6->fields['user_msn'], 'aol' => $i_rSet6->fields['user_aol'], 'gender' => $i_rSet6->fields['user_gender'], 'birthday' => $i_rSet6->fields['user_birthday'], 'husbandwife' => $i_rSet6->fields['user_husbandwife'], 'children' => $i_rSet6->fields['user_children'], 'trainer' => $i_rSet6->fields['user_trainer'], 'photo' => $i_rSet6->fields['user_photo'], 'company' => $i_rSet6->fields['user_company'], 'cposition' => $i_rSet6->fields['user_cposition'], 'department' => $i_rSet6->fields['user_department'], 'coffice' => $i_rSet6->fields['user_coffice'], 'caddress' => $i_rSet6->fields['user_caddress'], 'ccity' => $i_rSet6->fields['user_ccity'], 'cstate' => $i_rSet6->fields['user_cstate'], 'czip' => $i_rSet6->fields['user_czip'], 'ccountry' => $i_rSet6->fields['user_ccountry'], 'cphone' => $i_rSet6->fields['user_cphone'], 'cfax' => $i_rSet6->fields['user_cfax'], 'cmobile' => $i_rSet6->fields['user_cmobile'], 'cpager' => $i_rSet6->fields['user_cpager'], 'cipphone' => $i_rSet6->fields['user_cipphone'], 'cwebpage' => $i_rSet6->fields['user_cwebpage'], 'cphoto' => $i_rSet6->fields['user_cphoto'], 'ufield1' => $i_rSet6->fields['user_ufield1'], 'ufield2' => $i_rSet6->fields['user_ufield2'], 'ufield3' => $i_rSet6->fields['user_ufield3'], 'ufield4' => $i_rSet6->fields['user_ufield4'], 'ufield5' => $i_rSet6->fields['user_ufield5'], 'ufield6' => $i_rSet6->fields['user_ufield6'], 'ufield7' => $i_rSet6->fields['user_ufield7'], 'ufield8' => $i_rSet6->fields['user_ufield8'], 'ufield9' => $i_rSet6->fields['user_ufield9'], 'ufield10' => $i_rSet6->fields['user_ufield10'], 'test_name' => $i_rSet3->fields['test_name'], 'result_id' => $resultid, 'result_date' => getDateLocal($lngstr['language']['date_format_full'], $i_rSet2->fields['result_datestart']), 'result_time_spent' => getTimeFormatted($i_rSet2->fields['result_timespent']), 'result_time_exceeded' => $i_rSet2->fields['result_timeexceeded'] > 0 ? $lngstr['label_yes'] : $lngstr['label_no'], 'result_points_scored' => $i_rSet2->fields['result_points'], 'result_points_possible' => $i_rSet2->fields['result_pointsmax'], 'result_percents' => $i_rSet2->fields['result_pointsmax'] > 0 ? round($i_rSet2->fields['result_points'] * 100 / $i_rSet2->fields['result_pointsmax']) : 0, 'result_grade' => $g_vars['page']['grade']['name'], 'result_grade_feedback' => $g_vars['page']['grade']['feedback'], 'result_subjects' => $g_vars['page']['subjects'], 'result_detailed_1' => $i_result_detailed_1_text, 'result_detailed_2' => $i_result_detailed_2_text, 'result_detailed_3' => $i_result_detailed_3_text, 'result_detailed_4' => $i_result_detailed_4_text, 'result_detailed_5' => $i_result_detailed_5_text, 'result_detailed_6' => $i_result_detailed_6_text));
            $i_pdf->WriteHTML($i_template_body);
        }
    } else {
        $i_pdf = false;
    }
    ob_end_clean();
    return $i_pdf;
}
开发者ID:skyview059,项目名称:e-learning-website,代码行数:101,代码来源:getfile-1.inc.php


注:本文中的HTML2FPDF::AddPage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。