本文整理汇总了PHP中PDF::FancyTable方法的典型用法代码示例。如果您正苦于以下问题:PHP PDF::FancyTable方法的具体用法?PHP PDF::FancyTable怎么用?PHP PDF::FancyTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDF
的用法示例。
在下文中一共展示了PDF::FancyTable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$pdf->Ln(10);
$pdf->SetFont('Arial', '', 14);
$pdf->Cell(70);
$pdf->SetFont('', 'B', 14);
$pdf->Cell(50, 11, 'Consommation d\'électricité :', 0, 0, 'C');
$pdf->Ln(12);
$pdf->SetFont('', '', 10);
$nbrelignesmaxPAC = 17;
if (count($data) > $nbrelignesmaxPAC) {
for ($key = 0; $key < $nbrelignesmaxPAC; $key++) {
$datapage1[] = $data[$key];
}
for ($key = $nbrelignesmaxPAC; $key < count($data); $key++) {
$datapage2[] = $data[$key];
}
$pdf->FancyTable($header, $datapage1);
$pdf->AddPage();
$pdf->Ln(4);
$pdf->SetFont('', 'B', 14);
$pdf->Cell(70);
$pdf->Cell(50, 11, 'Liste du matériel - suite', 0, 0, 'C');
$pdf->Ln(12);
$pdf->SetFont('', '', 10);
$pdf->FancyTable($header, $datapage2);
$pdf->Ln(4);
} else {
$pdf->FancyTable($header, $data);
}
$pdf->Ln(10);
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(70);
示例2: printUsers
function printUsers()
{
$db = $this->conn;
$result = mysqli_query($db, "SELECT * FROM system_users WHERE deleted=0");
$num = 0;
$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->SetFont('Arial', '', 12);
$data = array();
while ($row = mysqli_fetch_array($result)) {
$num++;
$name = $row['first_name'] . " " . $row['middle_name'] . ' ' . $row['last_name'];
$appointment = $row['appointment'];
$email = $row['email'];
$role = $row['role'];
$data[] = [$num, $name, $appointment, $email, $role];
}
$pdf->AddPage();
$pdf->FancyTable($data);
$pdf->Output("../files/List of Users.pdf");
}
示例3: while
} while ($row = mysqli_fetch_array($result));
}
}
//fin de la definicion de la clase extendida de fpdf
//----------------------------------------------------
//conexion a la base de datos
require_once '../../lib/config.php';
// $conn = mysqli_connect("localhost","root","");
// mysqli_select_db("prally", $conn);
$result = mysqli_query($conn, "SELECT codigo, nombre, materia, telefono from maestros");
//devuelve true si se pudo hacer la consulta, y falso en caso contrario
//si hay registros insertados
if (mysqli_num_rows($result)) {
$pdf = new PDF('L', 'mm', 'Letter');
//Titulos de las columnas
$encabezados = array(utf8_decode('Código'), 'Nombre', 'Materia', utf8_decode('Teléfono'));
$pdf->SetFont('Arial', '', 12);
$pdf->AddPage();
$pdf->Write(10, 'Listado de los Profesores del Rally', '');
$pdf->Ln();
$pdf->FancyTable($encabezados, $result);
//dibuja la tabla con la funcion FancyTable
//<img src="../../images/participantes/$row['foto']" width='50px' height='60px'/>
$pdf->Output();
} else {
echo "¡ La base de datos está vacia !";
}
// }else {
// echo "Estás accediendo a una página restringida, para ver su contenido debes estar registrado.<br />
// <a href='../../login/acceso.php'>Ingresar</a>";
// }
示例4: downloadpdf
function downloadpdf($getid = "")
{
require 'fpdf/pdf.php';
$filter["fillter"] = "";
if ($getid) {
$filter["fillter"] = $getid;
$data['fillter'] = $getid;
} else {
$data['fillter'] = "";
$filter["fillter"] = "";
}
$pdf = new PDF();
$pdf->mytitle('Master list');
$results = $this->masterlist_model->GetAllrecords($filter);
$regions_arr = $this->masterlist_model->GetAllRegion();
// Column headings
$header = array('S.No', 'Profile Title', 'Date of Birth', 'Profession', 'User Kind', 'Region', 'Affiliate', 'Status');
// Data loading
$data = array();
$i = 1;
$stas = array('1' => 'AVAILABLE', '2' => 'PENDING', '3' => 'READY', '4' => 'USED');
foreach ($results as $key => $objRow) {
$regions_arr;
$strregion = "";
$tmpcounter = 1;
if (!empty($objRow['region_id'])) {
$tmp_arr = explode(",", $objRow['region_id']);
$tmpcount = count($tmp_arr);
if (!empty($tmp_arr)) {
foreach ($tmp_arr as $key => $value) {
if ($tmpcounter < $tmpcount) {
$str = ",";
} else {
$str = " ";
}
$strregion .= $regions_arr[$value] . $str;
$tmpcounter++;
}
}
}
if (!empty($objRow["status"])) {
$status = $objRow["status"];
} else {
$status = "";
}
if (!empty($objRow["title"])) {
$title = $objRow["title"];
} else {
$title = "-";
}
if (!empty($objRow["kind"])) {
$kind = $objRow["kind"];
} else {
$kind = "-";
}
if (!empty($objRow["username"])) {
$username = stripslashes($objRow["username"]);
} else {
$username = "-";
}
if (!empty($objRow["dob"])) {
$dob = $objRow["dob"];
} else {
$dob = "-";
}
if (!empty($objRow["category"])) {
$category_s = $objRow["category"];
} else {
$category_s = "-";
}
$stasget = $stas[$status] ? $stas[$status] : "";
$data[] = array($i, $title, $dob, $category_s, $kind, $strregion, $username, $stasget);
$i++;
}
$pdf->SetFont('Arial', '', 10);
$pdf->AddPage();
//echo '<pre>';print_r($data);exit;
$pdf->FancyTable($header, $data);
ob_end_clean();
// $pdf->Output();
$pdf->Output('masterlist' . time() . '.pdf', 'D');
/*
$stas = array('1'=>'AVAILABLE','2'=>'PENDING','3' => 'READY','4'=> 'USED');
$header = array('S.No', 'Profile Title', 'User Kind', 'Region','Affiliate','Status');
// Data loading
$data[] = array(1,"Title","Kind","Region,data","username",$stas[1]);
$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times','',12);
$pdf->FancyTable($header,$data);
ob_end_clean();
$pdf->Output('masterlist'.time().'.pdf', 'D');
exit;
*/
}
示例5: getpath
_getCFDI('Receptor');
_getCFDI('Domicilio');
_getConceptos();
_getCFDI('Impuestos');
_getCFDI('Traslado');
_getTFD('TimbreFiscalDigital');
$data['version'] = getpath("//@Version");
if (is_array($data['version'])) {
$data['version'] = $data['version'][0];
}
$data['version'] = trim($data['version']);
if (is_array($data['version'])) {
$data['version'] = $data['version'][0];
}
$data['sellocfd'] = getpath("//@selloCFD");
$data['sellosat'] = getpath("//@selloSAT");
$data['no_cert_sat'] = getpath("//@noCertificadoSAT");
}
$i = 0;
foreach ($data['Concepto'] as $key => $val) {
$d = 0;
foreach ($val as $k => $v) {
$header[$d] = $k;
$d++;
$body[$i][$k] = $v;
}
$i++;
}
$pdf = new PDF('P', 'mm', 'Letter');
$pdf->FancyTable($header, $data['Concepto']);
$pdf->Output();
示例6: PDF
$this->Cell($w[2], 4, $row['size'], 'LRT' . $B, 0, 'L', $fill);
$this->Cell($w[3], 4, $row['color'], 'LRT' . $B, 0, 'L', $fill);
$this->Cell($w[4], 4, $row['description'], 'LRT' . $B, 0, 'L', $fill);
$this->Cell($w[5], 4, $row['checked_out_to'], 'LRT' . $B, 0, 'L', $fill);
$this->Cell($w[6], 4, $row['item_condition'], 'LRT' . $B, 0, 'L', $fill);
$this->Cell($w[7], 4, $row['usable'], 'LRT' . $B, 0, 'L', $fill);
$this->Cell($w[8], 4, $row['note'], 'LRT' . $B, 0, 'L', $fill);
$this->Ln();
$rows_printed++;
$rows_this_page++;
if ($rows_this_page >= 60) {
break;
}
}
$this->Cell(array_sum($w), 0, '', 'T');
return $rows_printed;
}
}
$pdf = new PDF();
$pdf->SetMargins(4, 5, 4);
//Column titles
$header = $_SESSION['inv_headers'];
//Data loading
$data = $_SESSION['inv_array'];
$pdf->SetFont('Arial', '', 12);
$rows_printed = 0;
while ($rows_printed < count($data)) {
$pdf->AddPage();
$rows_printed = $pdf->FancyTable($header, $data, $rows_printed);
}
$pdf->Output();
示例7: fopen
$pdf->Cell(80, 8, $shipping->address2, 0, 1);
}
$pdf->Cell(80, 8, $shipping->city . ' ' . $shipping->state . ' ' . $shipping->zip, 0, 1);
$pdf->Ln(20);
if ($order_id != '' && $order_id != false) {
$pdf->Cell(60, 8, 'Order: MCH' . $order_id, 0, 0);
} else {
$pdf->Cell(60, 8, 'Order Number Not Available', 0, 0);
}
$pdf->Cell(60, 8, 'Date of order: ' . format::format_date($order->date_created), 0, 1);
$pdf->Cell(60, 8, 'Requested Delivery Date: ' . format::format_date($order->order_delivery_date), 0, 2);
$pdf->Ln(15);
$order_products = Basket::getBasketContentForOrder($id);
$order_subtotal = 0;
$shipping = $order->shipping_total;
//$tax = $order->tax;
$string = '';
foreach ($order_products as $product) {
$pr = Product::getProductById($product->product_id);
$order_subtotal += $product->subtotal;
$string .= $pr->name . ';' . $product->qty . ';' . $pr->price . ';' . $product->subtotal . "\r\n";
}
$myFile = '/tmp/file.txt';
$fh = fopen($myFile, 'w');
fwrite($fh, $string);
fclose($fh);
$data = $pdf->LoadData($myFile);
unlink($myFile);
$table_header = array('Quantity', 'Product');
$pdf->FancyTable($table_header, $data);
$pdf->Output();
示例8: PDF
// $ww=$w[4];
// else
// $ww=$w[$key1+1];
// $this->Cell($ww,6,utf8_decode($value),'LR',0,'L',$fill);
// }
// if($key==$inicial+17)
// break;
// $this->Ln();
// $fill = !$fill;
// }
// // Línea de cierre
// $this->Cell(array_sum($w),1,'','T');
}
}
$pdf = new PDF('L', 'mm', 'A4');
// Títulos de las columnas
$header = ['header' => array('REQUERIMIENTO ' . $this->R . ' %', 'PRUEBA ' . $this->P . ' %', 'ENTREVISTAS ' . $this->E . ' %')];
// Carga de datos
$inicial = 0;
$headerData = $this->data['Concurso'];
$pdf->headerData = $headerData;
for ($i = 1; $i <= 1; $i++) {
$pdf->AddPage();
$pdf->Header1($headerData);
$pdf->SetFont('Arial', 'B', 9);
$pdf->FancyTable($header, $this->colMO);
$pdf->AliasNbPages();
$inicial += 17;
}
$pdf->Output();
//Alcansan 18
示例9: PDF
}
if (mysql_num_rows($cancha2) > 0) {
$turno2 = mysql_result($cancha2, 0, 0);
}
if (mysql_num_rows($cancha3) > 0) {
$turno3 = mysql_result($cancha3, 0, 0);
}
$this->Cell($w[0], 6, $i . ":00", 'LR', 0, 'C', $fill);
$this->Cell($w[1], 6, $turno1, 'LR', 0, 'L', $fill);
$this->Cell($w[2], 6, $turno2, 'LR', 0, 'L', $fill);
$this->Cell($w[3], 6, $turno3, 'LR', 0, 'L', $fill);
$this->Ln();
$fill = !$fill;
}
// Línea de cierre
$this->Cell(array_sum($w), 0, '', 'T');
}
}
$pdf = new PDF();
$pdf->SetFont('Arial', '', 10);
// Títulos de las columnas
$header = array("Hora", "Cancha 1( -15 min)", "Cancha 2( 0 min)", "Cancha 3( 15 min)");
// Carga de datos
$data = $resPrimerUltimoTurno;
$pdf->AddPage();
$pdf->FancyTable($header, $data, $serviciosTurnos, $fecha);
$nombreTurno = "Turno-" . $fecha . ".pdf";
$pdf->Output($nombreTurno, 'D');
?>
示例10: iconv
$pdf->SetFont('Arial', '', 7);
$pdf->Cell(80, 5, 'Alma Mater Wear GbR | Donnersbergerstrasse 8 | 80624 Muenchen', '', 0, 'L', false);
$pdf->SetFont('Arial', '', 10);
$pdf->SetXY(20, 60);
$pdf->Cell(80, 5, iconv('UTF-8', 'windows-1252', $user->gender) . " " . iconv('UTF-8', 'windows-1252', $user->firstname) . " " . iconv('UTF-8', 'windows-1252', $user->lastname), '', 0, 'L', false);
$pdf->SetXY(20, 65);
$pdf->Cell(80, 5, iconv('UTF-8', 'windows-1252', $user->street), '', 0, 'L', false);
$pdf->SetXY(20, 70);
$pdf->Cell(80, 5, iconv('UTF-8', 'windows-1252', $user->ort), 0, 'L', false);
//Rechnungsdaten
$pdf->SetFont('Arial', '', 7);
$pdf->SetXY(125, 130);
$pdf->Cell(30, 5, 'Rechnungsdatum:', '', 0, 'R', false);
$pdf->SetXY(155, 130);
$pdf->Cell(30, 5, date("d.m.Y"), '', 0, 'L', false);
$pdf->SetXY(125, 135);
$pdf->Cell(30, 5, 'Rechnungsnummer.:', '', 0, 'R', false);
$pdf->SetXY(155, 135);
$pdf->Cell(30, 5, $bestellnr . "-" . $y, '', 0, 'L', false);
$pdf->SetFont('Arial', '', 10);
//Tabelle mit Bestelldetails
$pdf->SetXY(20, 130);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(30, 5, 'Rechnung', '', 0, 'L', false);
$pdf->SetFont('Arial', '', 10);
$pdf->SetXY(20, 150);
$pdf->FancyTable($header, $data, $subtotal, $discount, $price);
$pdf->SetFont('Arial', 'I', 8);
$pdf->Cell(100, 5, iconv("UTF-8", "ISO-8859-1", 'Sofern nicht anders angegeben, entspricht das Liefer-/Leistungsdatum dem Rechnungsdatum.'), '', 2, 'L', false);
$pdf->Cell(100, 5, iconv("UTF-8", "ISO-8859-1", 'Gemäß §19 UStG wird keine Umsatzsteuer berechnet.'), '', 2, 'L', false);
$pdf->Output("../invoices/" . $bestellnr . "-" . $y . ".pdf", 'F');
示例11: PDF
// Línea de cierre
$this->Cell(array_sum($w), 1, '', 'T');
}
}
$pdf = new PDF('L', 'mm', 'A4');
// Títulos de las columnas
$header = ['header' => array('No.', 'NOMBRES', 'MERITO', 'OPOSICION', 'TOTAL'), 'meritos' => $this->data['meritos'], 'oposicion' => $this->data['oposicion']];
$numcolumM = count($this->data['meritos']);
$numcolumO = count($this->data['oposicion']);
$Cmo = array($numcolumM, $numcolumO);
// Carga de datos
$data = $this->data['AspirantesROW'];
$npages = ceil(count($data) / 18);
$inicial = 0;
$headerData = $this->data['Concurso'];
$pdf->headerData = $headerData;
for ($i = 1; $i <= $npages; $i++) {
$pdf->AddPage();
$pdf->Header1($headerData);
$pdf->SetFont('Arial', 'B', 9);
$pdf->FancyTable($header, $data, $Cmo, $inicial);
$pdf->AliasNbPages();
$inicial += 17;
}
$pdf->Output();
//Alcansan 18
?>
示例12: array
$this->SetTextColor(255);
$this->SetDrawColor(0, 0, 0);
$this->SetLineWidth(0.3);
$this->SetFont('', 'B');
// En-tête
$w = array(38, 20, 20, 20, 20, 60);
for ($j = 0; $j < count($data); $j++) {
$this->SetX(15);
for ($i = 0; $i < count($w); $i++) {
$this->Cell($w[$i], 11, $data[$j][$i], 1, 0, 'C', true);
}
$this->Ln();
// Restauration des couleurs et de la police
$this->SetX(15);
$this->SetFillColor(224, 235, 255);
$this->SetTextColor(0);
$this->SetFont('');
}
// Trait de terminaison
$this->MultiCell(array_sum($w), 0, '', 'T');
}
}
$pdf = new PDF('P', 'mm', 'A4');
// Titres des colonnes
//$header = array('Collaborateurs', 'JW', 'ABS', 'CP','RTT','MAL.','SS','WE','Nb.TR','GSM','PEE','13eme mois','Commission','Avance','Prime','Commentaires');
// Chargement des données
$data = json_decode(utf8_decode($_POST['tab_tr']));
$pdf->SetFont('Courier', '', 11);
$pdf->AddPage();
$pdf->FancyTable($data);
$pdf->Output();
示例13: fopen
}
$pdf->Cell(60, 8, 'Payment Method: ' . $order->payment_method, 0, 1);
$pdf->Cell(60, 8, 'Shipping Method: ' . $order->shipping_method, 0, 1);
//$pdf->Cell(60,8, 'Discounts: '. $order->discounts ,0,1);
//$pdf->MultiCell(180,8, 'Discounts: '. $order->discounts ,0,'L',false);
if ($order->comment) {
//$pdf->Cell(60,8, 'Comment: '. $order->comment ,0,0);
$comment = str_replace(',', ",\n", $order->comment);
$pdf->MultiCell(180, 8, 'Comment: ' . $comment, 0, 'L', false);
}
$pdf->Ln(15);
$order_products = Basket::getBasketContentForOrder($id);
$order_subtotal = 0;
$shipping = $order->shipping_total;
$total = $order->order_total;
$string = '';
foreach ($order_products as $product) {
$pr = Product::getProductById($product->product_id);
$order_subtotal += $product->subtotal;
$basket = ORM::factory('orders_basket', $product->id);
$string .= $pr->name . ';' . $product->qty . ';' . ($basket->rate ? $basket->rate : $basket->packaging_rate) . ';' . $product->subtotal . "\r\n";
}
$myFile = '/tmp/file.txt';
$fh = fopen($myFile, 'w');
fwrite($fh, $string);
fclose($fh);
$data = $pdf->LoadData($myFile);
unlink($myFile);
$table_header = array('Product', 'Quantity', 'Unit Price', 'Total');
$pdf->FancyTable($table_header, $data, $order_subtotal, $shipping, $total);
$pdf->Output();
示例14: foreach
$this->SetDrawColor(200, 200, 200);
$this->SetLineWidth(0.1);
$this->SetTextColor(0);
$this->SetFont('Arial', '', 9);
//Data
$fill = 0;
$B = 'B';
foreach ($data as $row) {
$this->Cell($w[0], 6, $row[0], 'LR' . $B, 0, 'L', $fill);
$this->Cell($w[1], 6, $row[1], 'LR' . $B, 0, 'L', $fill);
$this->Cell($w[2], 6, $row[2], 'LR' . $B, 0, 'L', $fill);
$this->Cell($w[3], 6, $row[3], 'LR' . $B, 0, 'L', $fill);
$this->Cell($w[4], 6, $row[4], 'LR' . $B, 0, 'L', $fill);
$this->Cell($w[5], 6, $row[5], 'LR' . $B, 0, 'L', $fill);
$this->Ln();
//$fill=!$fill;
//if($B == 'B') $B = '';
//else $B = 'B';
}
$this->Cell(array_sum($w), 0, '', 'T');
}
}
$pdf = new PDF();
//Column titles
$header = $_SESSION['pg_header'];
//Data loading
$data = $_SESSION['pg_array'];
$pdf->SetFont('Arial', '', 12);
$pdf->AddPage();
$pdf->FancyTable($header, $data, $_SESSION['pg_crewmember_name']);
$pdf->Output();
示例15: foreach
$this->SetFont('Arial', '', '11');
// Data table
$fill = false;
$j = 1;
foreach ($data as $row) {
$this->Cell($w[0], 1, $j, 'L', 0, 'C', $fill);
$this->Cell($w[1], 1, $row[0], '', 0, 'L', $fill);
$this->Cell($w[2], 1, $row[1], 'R', 0, 'L', $fill);
$this->Cell($w[3], 1, $row[2], 'R', 0, 'L', $fill);
$this->Cell($w[4], 1, $row[3], 'R', 0, 'L', $fill);
$this->Cell($w[5], 1, $row[4], 'R', 0, 'L', $fill);
$this->Cell($w[6], 1, $row[5], 'R', 0, 'C', $fill);
$this->Ln();
$fill = !$fill;
$j++;
}
// Closing line
$this->Cell(array_sum($w), 0, '', '');
}
}
$pdf = new PDF('L', 'cm', 'A4');
//ukuran kertas
// Nama Kolom Heading
$header = array('No', 'Kode Sponsor', 'Nama Sponsor');
// Data loading
$query = "select kode_sponsor,nama_sponsor";
$data = $pdf->LoadDataFromSQL($query);
$pdf->SetFont('Arial', '', 9);
$pdf->AddPage();
$pdf->FancyTable($header, $data);
$pdf->Output();