本文整理汇总了PHP中Pdf::setFooter方法的典型用法代码示例。如果您正苦于以下问题:PHP Pdf::setFooter方法的具体用法?PHP Pdf::setFooter怎么用?PHP Pdf::setFooter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pdf
的用法示例。
在下文中一共展示了Pdf::setFooter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: outputPdfFileComplianceComplete
public function outputPdfFileComplianceComplete($strReportName, $arrResults, $booOutputHtml = false)
{
$strHtml = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"https://www.iworkaudit.com/includes/css/report.css\" /></head>";
$strHtml .= "<body><div>";
$strHtml .= "<table><tr><td>";
$strHtml .= "<h1>Youaudit Report</h1>";
$strHtml .= "<h2>" . $strReportName . "</h2>";
$strHtml .= "</td><td class=\"right\">";
$logo = 'logo.png';
$strHtml .= "<img alt=\"Youaudit\" src='brochure/logo/" . $logo . "'>";
$strHtml .= "</td></tr></table>";
$strHtml .= "<table class=\"report\">";
$strHtml .= "<thead>";
$strHtml .= "<tr>";
$strHtml .= "<th>Date</th>";
$strHtml .= "<th>QR Code</th>";
$strHtml .= "<th>Serial No</th>";
$strHtml .= "<th>Manufacturer & Model</th>";
$strHtml .= "<th>Category</th>";
$strHtml .= "<th>Check Name</th>";
$strHtml .= "<th>Mandatory</th>";
$strHtml .= "</tr>";
$strHtml .= "</thead><tbody>";
foreach ($arrResults as $test) {
$strHtml .= "<tr>";
$date_ex = explode('-', $test['test_date']);
$test['test_date'] = $date_ex[2] . "-" . $date_ex[1] . "-" . $date_ex[0];
$strHtml .= "<td>" . $test['test_date'] . "</td>";
$strHtml .= "<td><a href=\"/iwa/items/view/" . $test['test_item_id'] . "\">" . $test['barcode'] . "</a></td>";
$strHtml .= "<td>" . $test['serial_number'] . "</td>";
$strHtml .= "<td>" . $test['manufacturer'] . " " . $test['model'] . "</td>";
$strHtml .= "<td>" . $test['name'] . "</td>";
$strHtml .= "<td>" . $test['test_type_name'] . "</td>";
if ($test['test_type_mandatory'] == 1) {
$strHtml .= "<td>Yes</td>";
} else {
$strHtml .= "<td>No</td>";
}
$strHtml .= "</tr>";
}
$strHtml .= "</tbody>";
$strHtml .= "<tfoot><tr>";
$strHtml .= "</table>";
$strHtml .= "<p>Produced by " . $this->session->userdata('objSystemUser')->firstname . " " . $this->session->userdata('objSystemUser')->lastname . " (" . $this->session->userdata('objSystemUser')->username . ") on " . date('d/m/Y') . "</p>";
$strHtml .= "</div></body></html>";
if (!$booOutputHtml) {
$this->load->library('Mpdf');
$mpdf = new Pdf('en-GB', 'A4');
$mpdf->setFooter('{PAGENO} of {nb}');
$mpdf->WriteHTML($strHtml);
$mpdf->Output("iwareport_" . date('Ymd_His') . ".pdf", "D");
} else {
echo $strHtml;
die;
}
}
示例2: outputPdfFile
//.........这里部分代码省略.........
$strHtml .= $arrDate[2] . "/" . $arrDate[1] . "/" . $arrDate[0];
} else {
$strHtml .= "Unknown";
}
break;
case 'datetime':
$arrDateTime = explode(' ', $objItem->{$arrReportField['strFieldReference']});
$strTime = $arrDateTime[1];
$arrDate = explode('-', $arrDateTime[0]);
$strHtml .= $arrDate[2] . "/" . $arrDate[1] . "/" . $arrDate[0] . " " . $strTime;
break;
case 'pat_result':
if ($objItem->{$arrReportField['strFieldReference']} === null) {
$strHtml.="-";
} else {
if ($objItem->{$arrReportField['strFieldReference']} == 1) {
$strHtml.="Pass";
} else {
$strHtml.="Fail";
}
}
break;
case 'price':
$strHtml .= $currency . $objItem->{$arrReportField['strFieldReference']};
break;
case 'img':
if ($objItem['photo_id']) {
if (strpos($objItem['photo_id'], ',')) {
$photos = explode(',', $objItem['photo_id']);
for ($i = 0; $i < count($photos); $i++) {
$image = $this->db->select('path')->where('id', $photos[$i])->get('photos')->row();
$strHtml .= "<img width='20' height='20' src='" . base_url() . $image->path . "'>";
}
} else {
$image = $this->db->select('path')->where('id', $objItem['photo_id'])->get('photos')->row();
$strHtml .= "<img width='20' height='20' src='" . base_url() . $image->path . "'>";
}
}
}
} else {
$strHtml .= $objItem[$arrReportField['strFieldReference']];
}
if (array_key_exists('arrFooter', $arrReportField) && array_key_exists('booTotal', $arrReportField['arrFooter'])) {
if (array_key_exists($arrReportField['strFieldReference'], $arrTotals)) {
$arrTotals[$arrReportField['strFieldReference']] += $objItem[$arrReportField['strFieldReference']];
} else {
$arrTotals[$arrReportField['strFieldReference']] = $objItem[$arrReportField['strFieldReference']];
}
}
$strHtml .= "</td>";
}
$strHtml .= "</tr>";
}
$strHtml .= "</tbody>";
$strHtml .= "<tfoot><tr>";
foreach ($arrFields as $arrReportField) {
if (array_key_exists('arrFooter', $arrReportField)) {
if (array_key_exists('booTotal', $arrReportField['arrFooter']) && $arrReportField['arrFooter']['booTotal']) {
$strHtml .= "<td>";
if (array_key_exists('strConversion', $arrReportField) && ($arrReportField['strConversion'] == "price")) {
$strHtml .= $currency;
}
$strHtml .= $arrTotals[$arrReportField['strFieldReference']];
$strHtml .= "</td>";
} else {
if (array_key_exists('booTotalLabel', $arrReportField['arrFooter']) && $arrReportField['arrFooter']['booTotalLabel']) {
$strHtml .= "<td";
if (array_key_exists('intColSpan', $arrReportField['arrFooter']) && ($arrReportField['arrFooter']['intColSpan'] > 0)) {
$strHtml .= " colspan=\"" . $arrReportField['arrFooter']['intColSpan'] . "\"";
}
$strHtml .= " class=\"right\">";
$strHtml .= "Totals</td>";
}
}
}
}
$strHtml .= "</tr></tfoot>";
$strHtml .= "</table>";
$strHtml .= "<p>Produced by " . $arrPageData['arrSessionData']["objSystemUser"]->firstname . " " . $arrPageData['arrSessionData']["objSystemUser"]->lastname . " (" . $arrPageData['arrSessionData']["objSystemUser"]->username . ") on " . date('d/m/Y') . "</p>";
$strHtml .= "</div></body></html>";
if (!$booOutputHtml) {
$this->load->library('Mpdf');
$mpdf = new Pdf('en-GB', 'A4');
$mpdf->setFooter('{PAGENO} of {nb}');
$mpdf->WriteHTML($strHtml);
$mpdf->Output("YouAudit_" . date('Ymd_His') . ".pdf", "D");
} else {
echo $strHtml;
die();
}
}
示例3: mailroutine
function mailroutine($customer_data)
{
$new_file = $_SERVER['DOCUMENT_ROOT'] . '/iwa/excel_file/isareport_' . date('Ymd_His') . '.pdf';
$curr_count = (int) $this->count_routine;
$total_count = count($customer_data);
if ($total_count > $curr_count) {
if ((int) $customer_data[$this->count_routine]['account_id'] > 0) {
$table = $this->getDues($customer_data[$this->count_routine]['account_id'], $customer_data[$this->count_routine]['id']);
$this->load->library('Mpdf');
$mpdf = new Pdf('en-GB', 'A4');
$mpdf->setFooter('{PAGENO} of {nb}');
$mpdf->WriteHTML($table);
$mpdf->Output($new_file, "F");
$this->load->library('email');
$this->email->from("tickets@iworkaudit.com", "Due Compliance");
// $this->email->to('dharmendra@ignisitsolutions.com');
$this->email->to($customer_data[$this->count_routine]['username']);
$this->email->subject('Due Compliance List');
$this->email->message('Due Compliance list is attached with pdf (Testing) ');
$this->email->attach($new_file);
$this->email->send();
$this->count_routine = $this->count_routine + 1;
$this->email->clear(TRUE);
$this->mailroutine($customer_data);
} else {
$this->count_routine = $this->count_routine + 1;
$this->mailroutine($customer_data);
}
}
}
示例4: outputPdfFile
//.........这里部分代码省略.........
if (!empty($manu)) {
foreach ($manu as $man) {
if ($man == '') {
$strHtml .= "N/A";
$strHtml .= "<br>";
} else {
$strHtml .= $man;
$strHtml .= "<br>";
}
}
} else {
$strHtml .= "N/A";
}
break;
case 'manufacturer':
$manufacturer = json_decode($objItem['manufacturer']);
if (!empty($manufacturer)) {
foreach ($manufacturer as $manufact) {
if ($manufact == '') {
$strHtml .= "N/A";
$strHtml .= "<br>";
} else {
$strHtml .= $manufact;
$strHtml .= "<br>";
}
}
} else {
$strHtml .= "N/A";
}
break;
}
} else {
$strHtml .= $objItem[$arrReportField['strFieldReference']];
}
if (array_key_exists('arrFooter', $arrReportField) && array_key_exists('booTotal', $arrReportField['arrFooter'])) {
if (array_key_exists($arrReportField['strFieldReference'], $arrTotals)) {
$arrTotals[$arrReportField['strFieldReference']] += $objItem[$arrReportField['strFieldReference']];
} else {
$arrTotals[$arrReportField['strFieldReference']] = $objItem[$arrReportField['strFieldReference']];
}
}
$strHtml .= "</td>";
}
$strHtml .= "</tr>";
}
$strHtml .= "</tbody>";
$strHtml .= "<tfoot><tr>";
foreach ($arrFields as $arrReportField) {
if (array_key_exists('arrFooter', $arrReportField)) {
if (array_key_exists('booTotal', $arrReportField['arrFooter']) && $arrReportField['arrFooter']['booTotal']) {
$strHtml .= "<td>";
if (array_key_exists('strConversion', $arrReportField) && ($arrReportField['strConversion'] == "price")) {
$strHtml .= $currency;
}
$strHtml .= $arrTotals[$arrReportField['strFieldReference']];
$strHtml .= "</td>";
} else {
if (array_key_exists('booTotalLabel', $arrReportField['arrFooter']) && $arrReportField['arrFooter']['booTotalLabel']) {
$strHtml .= "<td";
if (array_key_exists('intColSpan', $arrReportField['arrFooter']) && ($arrReportField['arrFooter']['intColSpan'] > 0)) {
$strHtml .= " colspan=\"" . $arrReportField['arrFooter']['intColSpan'] . "\"";
}
$strHtml .= " class=\"right\">";
$strHtml .= "Totals</td>";
}
}
}
}
$strHtml .= "</tr></tfoot>";
$strHtml .= "</table>";
if (($arrPageData['arrSessionData']["objAdminUser"])) {
$strHtml .= "<p>Produced by " . $arrPageData['arrSessionData']["objAdminUser"]->firstname . " " . $arrPageData['arrSessionData']["objAdminUser"]->lastname . " (" . $arrPageData['arrSessionData']["objAdminUser"]->username . ") on " . date('d/m/Y') . "</p>";
$strHtml .= "</div></body></html>";
} else {
$strHtml .= "<p>Produced by " . $arrPageData['arrSessionData']['YouAuditSystemAdmin']['firstname'] . " " . $arrPageData['arrSessionData']['YouAuditSystemAdmin']['lastname'] . " (" . $arrPageData['arrSessionData']['YouAuditSystemAdmin']['username'] . ") on " . date('d/m/Y') . "</p>";
$strHtml .= "</div></body></html>";
}
if (!$booOutputHtml) {
$this->load->library('Mpdf');
$mpdf = new Pdf('en-GB', 'A4');
$mpdf->setFooter('{PAGENO} of {nb}');
$mpdf->WriteHTML($strHtml);
$mpdf->Output("YouAudit_" . date('Ymd_His') . ".pdf", "D");
} else {
echo $strHtml;
die();
}
}
示例5: exportPdfFile
public function exportPdfFile($allData, $filename = "isareport") {
$this->load->model('accounts_model');
$booOutputHtml = false;
$data['allData'] = $allData;
$data['title'] = $filename;
// $data['accountDetails'] = $this->accounts_model->getOne($this->session->userdata('objSystemUser')->accountid);
$strHtml = $this->load->view('items/exporttopdf', $data, true);
// echo $strHtml;die;
if (!$booOutputHtml) {
$this->load->library('Mpdf');
$mpdf = new Pdf('en-GB', 'A4');
$mpdf->setHeader($filename);
$mpdf->setFooter('{PAGENO} of {nb}');
$mpdf->WriteHTML($strHtml);
$mpdf->Output("$filename.pdf", "D");
} else {
echo $strHtml;
die();
}
}
示例6: outputPdfFile
//.........这里部分代码省略.........
$strHtml .= "</tr>";
$strHtml .= "</thead><tbody>";
$arrTotals = array();
foreach ($arrResults as $objItem) {
$strHtml .= "<tr>";
foreach ($arrFields as $arrReportField) {
$strHtml .= "<td style='height:50px'>";
if (array_key_exists('strConversion', $arrReportField)) {
switch ($arrReportField['strConversion']) {
case 'date':
$arrDate = explode('-', $objItem->{$arrReportField['strFieldReference']});
if (count($arrDate) > 1) {
$strHtml .= $arrDate[2] . "/" . $arrDate[1] . "/" . $arrDate[0];
} else {
$strHtml .= "Unknown";
}
break;
case 'datetime':
$arrDateTime = explode(' ', $objItem->{$arrReportField['strFieldReference']});
$strTime = $arrDateTime[1];
$arrDate = explode('-', $arrDateTime[0]);
$strHtml .= $arrDate[2] . "/" . $arrDate[1] . "/" . $arrDate[0] . " " . $strTime;
break;
case 'owner':
if ($objItem['owner'] == 1) {
$strHtml.="Yes";
} else {
$strHtml.="No";
}
break;
case 'price':
$strHtml .= $currency . $objItem->{$arrReportField['strFieldReference']};
break;
}
} else {
$strHtml .= $objItem[$arrReportField['strFieldReference']];
}
if (array_key_exists('arrFooter', $arrReportField) && array_key_exists('booTotal', $arrReportField['arrFooter'])) {
if (array_key_exists($arrReportField['strFieldReference'], $arrTotals)) {
$arrTotals[$arrReportField['strFieldReference']] += $objItem[$arrReportField['strFieldReference']];
} else {
$arrTotals[$arrReportField['strFieldReference']] = $objItem[$arrReportField['strFieldReference']];
}
}
$strHtml .= "</td>";
}
$strHtml .= "</tr>";
}
$strHtml .= "</tbody>";
$strHtml .= "<tfoot><tr>";
foreach ($arrFields as $arrReportField) {
if (array_key_exists('arrFooter', $arrReportField)) {
if (array_key_exists('booTotal', $arrReportField['arrFooter']) && $arrReportField['arrFooter']['booTotal']) {
$strHtml .= "<td>";
if (array_key_exists('strConversion', $arrReportField) && ($arrReportField['strConversion'] == "price")) {
$strHtml .= $currency;
}
$strHtml .= $arrTotals[$arrReportField['strFieldReference']];
$strHtml .= "</td>";
} else {
if (array_key_exists('booTotalLabel', $arrReportField['arrFooter']) && $arrReportField['arrFooter']['booTotalLabel']) {
$strHtml .= "<td";
if (array_key_exists('intColSpan', $arrReportField['arrFooter']) && ($arrReportField['arrFooter']['intColSpan'] > 0)) {
$strHtml .= " colspan=\"" . $arrReportField['arrFooter']['intColSpan'] . "\"";
}
$strHtml .= " class=\"right\">";
$strHtml .= "Totals</td>";
}
}
}
}
$strHtml .= "</tr></tfoot>";
$strHtml .= "</table>";
$strHtml .= "<p>Produced by " . $this->session->userdata('objSystemUser')->firstname . " " . $this->session->userdata('objSystemUser')->lastname . " (" . $this->session->userdata('objSystemUser')->username . ") on " . date('d/m/Y') . "</p>";
$strHtml .= "</div></body></html>";
if (!$booOutputHtml) {
$this->load->library('Mpdf');
$mpdf = new Pdf('en-GB', 'A4');
$mpdf->setFooter('{PAGENO} of {nb}');
$mpdf->WriteHTML($strHtml);
$mpdf->Output("YouAudit_" . date('Ymd_His') . ".pdf", "D");
} else {
echo $strHtml;
die();
}
}