public function drawPDF() { $pdf = new \FPDF('P', 'mm', 'Letter'); $pdf->SetMargins(0, 3.175, 0); $pdf->SetAutoPageBreak(false); define('FPDF_FONTPATH', dirname(__FILE__) . '/noauto/fonts/'); $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php'); $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Heavy.php'); $pdf->AddFont('GillBook', '', 'GillSansMTPro-Book.php'); $pdf->SetFont('Gill', '', 16); $data = $this->loadItems(); $count = 0; $sign = 0; $width = 53.975; $height = 68.95999999999999; $top = 20; $left = 5.175; $effective_width = $width - 2 * $left; $pdf->SetDrawColor(0, 0, 0); $pdf->SetLineWidth(0.2); foreach ($data as $item) { if ($count % 16 == 0) { $pdf->AddPage(); // draw tick marks for cutting $pdf->Line(2, $height + 1.5, 6, $height + 1.5); $pdf->Line(2, 2 * $height + 1.5, 6, 2 * $height + 1.5); $pdf->Line(2, 3 * $height + 1.5, 6, 3 * $height + 1.5); $pdf->Line($width, 2, $width, 6); $pdf->Line(2 * $width, 2, 2 * $width, 6); $pdf->Line(3 * $width, 2, 3 * $width, 6); $pdf->Line($width, 4 * $height - 4, $width, 4 * $height); $pdf->Line(2 * $width, 4 * $height - 4, 2 * $width, 4 * $height); $pdf->Line(3 * $width, 4 * $height - 4, 3 * $width, 4 * $height); $pdf->Line(4 * $width - 6, $height + 1.5, 4 * $width - 2, $height + 1.5); $pdf->Line(4 * $width - 6, 2 * $height + 1.5, 4 * $width - 2, 2 * $height + 1.5); $pdf->Line(4 * $width - 6, 3 * $height + 1.5, 4 * $width - 2, 3 * $height + 1.5); $sign = 0; } $row = floor($sign / 4); $column = $sign % 4; $price = $item['normal_price']; if ($item['scale']) { if (substr($price, 0, 1) != '$') { $price = sprintf('$%.2f', $price); } $price .= ' /lb.'; } elseif (isset($item['signMultiplier'])) { $price = $this->formatPrice($item['normal_price'], $item['signMultiplier']); } else { $price = $this->formatPrice($item['normal_price']); } $pdf->Image(dirname(__FILE__) . '/cd_head_16.png', $left - 2 + $width * $column, $top - 17 + $row * $height, $width - 6); $pdf->SetXY($left + $width * $column, $top + $row * $height - 2); $pdf->SetFont('Gill', 'B', $this->SMALL_FONT); $font_shrink = 0; while (true) { $pdf->SetX($left + $width * $column); $y = $pdf->GetY(); $pdf->MultiCell($effective_width, 6, strtoupper($item['brand']), 0, 'C'); if ($pdf->GetY() - $y > 6) { $pdf->SetFillColor(0xff, 0xff, 0xff); $pdf->Rect($left + $width * $column, $y, $left + $width * $column + $effective_width, $pdf->GetY(), 'F'); $font_shrink++; if ($font_shrink >= $this->SMALL_FONT) { break; } $pdf->SetFontSize($this->MED_FONT - $font_shrink); $pdf->SetXY($left + $width * $column, $y); } else { break; } } $pdf->SetX($left + $width * $column); $pdf->SetFont('Gill', '', $this->MED_FONT); $font_shrink = 0; while (true) { $pdf->SetX($left + $width * $column); $y = $pdf->GetY(); $pdf->MultiCell($effective_width, 6, $item['description'], 0, 'C'); if ($pdf->GetY() - $y > 12) { $pdf->SetFillColor(0xff, 0xff, 0xff); $pdf->Rect($left + $width * $column, $y, $left + $width * $column + $effective_width, $pdf->GetY(), 'F'); $font_shrink++; if ($font_shrink >= $this->MED_FONT) { break; } $pdf->SetFontSize($this->MED_FONT - $font_shrink); $pdf->SetXY($left + $width * $column, $y); } else { if ($pdf->GetY() - $y < 12) { $words = explode(' ', $item['description']); $multi = ''; for ($i = 0; $i < floor(count($words) / 2); $i++) { $multi .= $words[$i] . ' '; } $multi = trim($multi) . "\n"; for ($i = floor(count($words) / 2); $i < count($words); $i++) { $multi .= $words[$i] . ' '; } $item['description'] = trim($multi); $pdf->SetFillColor(0xff, 0xff, 0xff); $pdf->Rect($left + $width * $column, $y, $left + $width * $column + $effective_width, $pdf->GetY(), 'F'); $pdf->SetXY($left + $width * $column, $y); $pdf->MultiCell($effective_width, 6, $item['description'], 0, 'C'); } break; } } $pdf->SetX($left + $width * $column); $pdf->SetFont('GillBook', '', $this->SMALLER_FONT); $item['size'] = strtolower($item['size']); if (substr($item['size'], -1) != '.') { $item['size'] .= '.'; // end abbreviation w/ period $item['size'] = str_replace('fz.', 'fl oz.', $item['size']); } if (substr($item['size'], 0, 1) == '.') { $item['size'] = '0' . $item['size']; // add leading zero on decimal qty } if (strlen(ltrim($item['upc'], '0')) < 5 && $item['scale']) { $item['size'] = 'PLU# ' . ltrim($item['upc'], '0'); // show PLU #s on by-weight } $pdf->Cell($effective_width, 6, $item['size'], 0, 1, 'C'); $pdf->SetXY($left + $width * $column, $top + $height * $row + ($height - $top - 18)); $pdf->SetFont('Gill', '', $this->BIG_FONT); $pdf->MultiCell($effective_width, 10, $price, 0, 'C'); if ($item['startDate'] != '' && $item['endDate'] != '') { // intl would be nice $datestr = date('M d', strtotime($item['startDate'])) . chr(0x96) . date('M d', strtotime($item['endDate'])); $pdf->SetXY($left + $width * $column, $top + $height * $row + ($height - $top - 7)); $pdf->SetFont('GillBook', '', $this->SMALLEST_FONT); $pdf->Cell($effective_width + 4, 6, strtoupper($datestr), 0, 1, 'R'); } if ($item['upc'] != '') { $pdf->SetXY($left - 2 + $width * $column, $top + $height * $row + ($height - $top - 7)); $pdf->SetFont('GillBook', '', $this->SMALLEST_FONT); $pdf->Cell($effective_width, 6, $item['upc'], 0, 1, 'L'); } $pdf->Image(dirname(__FILE__) . '/' . $this->footer_image, $left - 2 + $width * $column, $top + $height * $row + ($height - $top - 2), $width - 6); $count++; $sign++; } $pdf->Output('Signage16UpP.pdf', 'I'); }
function __construct($products, $order, $filename, $save = false) { App::import('vendor', 'fpdf/fpdf'); $orientation = 'P'; $unit = 'pt'; $format = 'A4'; $margin = 40; $pdf = new FPDF($orientation, $unit, $format); App::import('Helper', 'Time'); $timeHelper = new TimeHelper(); setlocale(LC_MONETARY, 'th_TH'); $pdf->AddPage(); $pdf->SetTopMargin($margin); $pdf->SetLeftMargin($margin); $pdf->SetRightMargin($margin); $pdf->SetAutoPageBreak(true, $margin); $pdf->SetY($pdf->GetY() + 60); $pdf->SetFont('Arial', 'B', 10); $pdf->SetTextColor(0); $pdf->SetFillColor(255); $pdf->SetLineWidth(1); $pdf->Cell(50, 25, "Order ID: ", 'LT', 0, 'L'); $pdf->SetFont('Arial', ''); $pdf->Cell(50, 25, $order['Order']['id'], 'T', 0, 'L'); $pdf->SetFont('Arial', 'B'); $pdf->Cell(100, 25, 'Customer Name: ', 'T', 0, 'L'); $pdf->SetFont('Arial', ''); $pdf->Cell(316, 25, $order['User']['name'], 'TR', 1, 'L'); $pdf->SetFont('Arial', 'B'); $pdf->Cell(100, 25, "Delivery Date: ", 'LT', 0, 'L'); $pdf->SetFont('Arial', ''); $pdf->Cell(416, 25, $timeHelper->format($format = 'd-m-Y', $order['Delivery']['date']), 'TR', 1, 'L'); $pdf->SetFont('Arial', 'B', '10'); $current_y = $pdf->GetY(); $current_x = $pdf->GetX(); $cell_width = 30; $pdf->MultiCell($cell_width, 25, "No.\n ", 'LTR', 'C'); $pdf->SetXY($current_x + $cell_width, $current_y); $pdf->Cell(250, 25, "Description", 'LTR', 0, 'C'); $current_y = $pdf->GetY(); $current_x = $pdf->GetX(); $cell_width = 48; $pdf->MultiCell($cell_width, 25, "Number Ordered", 'LTR', 'C'); $pdf->SetXY($current_x + $cell_width, $current_y); $current_y = $pdf->GetY(); $current_x = $pdf->GetX(); $cell_width = 48; $pdf->MultiCell($cell_width, 25, "Number Supplied", 'LTR', 'C'); $pdf->SetXY($current_x + $cell_width, $current_y); $current_y = $pdf->GetY(); $current_x = $pdf->GetX(); $cell_width = 70; $pdf->MultiCell($cell_width, 25, "Amount per Unit", 'LTR', 'C'); $pdf->SetXY($current_x + $cell_width, $current_y); $current_y = $pdf->GetY(); $current_x = $pdf->GetX(); $cell_width = 70; $pdf->MultiCell($cell_width, 25, "Amount\n ", 'LTR', 'C'); $pdf->SetY($pdf->GetY() - 25); $pdf->SetFont('Arial', ''); $pdf->SetFillColor(238); $pdf->SetLineWidth(0.2); $pdf->SetY($pdf->GetY() + 25); $num = 1; $number_ordered = 0; $number_supplied = 0; foreach ($products as $product) { $pdf->Cell(30, 20, $num++, 1, 0, 'L'); $pdf->Cell(250, 20, $product['Product']['short_description'], 1, 0, 'L'); $pdf->Cell(48, 20, $product['LineItem']['quantity'], 1, 0, 'R'); $number_ordered += $product['LineItem']['quantity']; $pdf->Cell(48, 20, $product['LineItem']['quantity_supplied'], 1, 0, 'R'); $number_supplied += $product['LineItem']['quantity_supplied']; $pdf->Cell(70, 20, money_format("%i", $product['Product']['selling_price']), 1, 0, 'R'); $pdf->Cell(70, 20, money_format("%i", $product['LineItem']['total_price_supplied']), 1, 1, 'R'); } $pdf->SetX($pdf->GetX() + 30); $pdf->SetFont('Arial', 'B'); $pdf->Cell(250, 20, "TOTALS", 1); $pdf->SetFont('Arial', ''); $pdf->Cell(48, 20, $number_ordered, 1, 0, 'R'); $pdf->Cell(48, 20, $number_supplied, 1, 0, 'R'); $pdf->Cell(70, 20, "N.A.", 1, 0, 'R'); $pdf->Cell(70, 20, money_format("%i", $order['Order']['total_supplied']), 1, 1, 'R'); $pdf->SetY($pdf->GetY() + 25); $pdf->SetFont('Arial', 'B'); $pdf->Cell(80, 20, "Amount Paid: "); $pdf->SetFont('Arial', ''); $pdf->Cell(80, 20, money_format("%i", $order['Order']['total']), 0, 1); $pdf->SetFont('Arial', 'B'); $pdf->Cell(80, 20, "Actual Amount: "); $pdf->SetFont('Arial', ''); $pdf->Cell(80, 20, money_format("%i", $order['Order']['total_supplied']), 0, 1); $pdf->SetFont('Arial', 'B'); $pdf->Cell(80, 20, "Rebate Amount: "); $pdf->SetFont('Arial', ''); $pdf->Cell(80, 20, money_format("%i", $order['Order']['total'] - $order['Order']['total_supplied']), 0, 1); if ($save) { $pdf->Output($filename, 'F'); } else { $pdf->Output($filename, 'I'); } }
function __construct($lineItems, $lineItemTotals, $filename, $save = false) { App::import('vendor', 'fpdf/fpdf'); $orientation = 'P'; $unit = 'pt'; $format = 'A4'; $margin = 40; $pdf = new FPDF($orientation, $unit, $format); App::import('Helper', 'Time'); $timeHelper = new TimeHelper(); setlocale(LC_MONETARY, 'th_TH'); $pdf->AddPage(); $pdf->SetTopMargin($margin); $pdf->SetLeftMargin($margin); $pdf->SetRightMargin($margin); $pdf->SetAutoPageBreak(true, $margin); $pdf->SetY($pdf->GetY() + 60); $pdf->SetFont('Arial', 'B', 10); $pdf->SetTextColor(0); $pdf->SetFillColor(255); $pdf->SetLineWidth(1); $pdf->SetFont('Arial', 'B', '10'); $current_y = $pdf->GetY(); $current_x = $pdf->GetX(); $cell_width = 30; $pdf->MultiCell($cell_width, 25, "No.\n ", 'LTR', 'C'); $pdf->SetXY($current_x + $cell_width, $current_y); $pdf->Cell(250, 25, "Description", 'LTR', 0, 'C'); $current_y = $pdf->GetY(); $current_x = $pdf->GetX(); $cell_width = 48; $pdf->MultiCell($cell_width, 25, "# Ordered", 'LTR', 'C'); $pdf->SetXY($current_x + $cell_width, $current_y); $current_y = $pdf->GetY(); $current_x = $pdf->GetX(); $cell_width = 48; $pdf->MultiCell($cell_width, 25, "# Supplied", 'LTR', 'C'); $pdf->SetXY($current_x + $cell_width, $current_y); $current_y = $pdf->GetY(); $current_x = $pdf->GetX(); $cell_width = 70; $pdf->MultiCell($cell_width, 25, "Amount Wholesale", 'LTR', 'C'); $pdf->SetXY($current_x + $cell_width, $current_y); $current_y = $pdf->GetY(); $current_x = $pdf->GetX(); $cell_width = 70; $pdf->MultiCell($cell_width, 25, "Amount Retail", 'LTR', 'C'); $pdf->SetY($pdf->GetY() - 25); $pdf->SetFont('Arial', ''); $pdf->SetFillColor(238); $pdf->SetLineWidth(0.2); $pdf->SetY($pdf->GetY() + 25); $num = 1; $number_ordered = 0; $number_supplied = 0; foreach ($lineItems as $lineItem) { $pdf->Cell(30, 20, $num++, 1, 0, 'L'); $pdf->Cell(250, 20, $lineItem['Product']['short_description'], 1, 0, 'L'); $pdf->Cell(48, 20, $lineItem['LineItem']['ordered'], 1, 0, 'R'); $pdf->Cell(48, 20, $lineItem['LineItem']['supplied'], 1, 0, 'R'); $pdf->Cell(70, 20, money_format("%i", $lineItem['LineItem']['amount_wholesale']), 1, 0, 'R'); $pdf->Cell(70, 20, money_format("%i", $lineItem['LineItem']['amount_retail']), 1, 1, 'R'); } $pdf->SetX($pdf->GetX() + 30); $pdf->SetFont('Arial', 'B'); $pdf->Cell(250, 20, "TOTALS", 1); $pdf->SetFont('Arial', ''); $pdf->Cell(48, 20, $lineItemTotals['LineItem']['ordered'], 1, 0, 'R'); $pdf->Cell(48, 20, $lineItemTotals['LineItem']['ordered'], 1, 0, 'R'); $pdf->Cell(70, 20, money_format("%i", $lineItemTotals['LineItem']['amount_wholesale']), 1, 0, 'R'); $pdf->Cell(70, 20, money_format("%i", $lineItemTotals['LineItem']['amount_retail']), 1, 1, 'R'); if ($save) { $pdf->Output($filename, 'F'); } else { $pdf->Output($filename, 'I'); } }
function exportPDF($strsql, $product) { $mysql_server_name = SERVER_NAME; // mysql server name $mysql_username = USER_NAME; // mysql user name $mysql_password = USER_PASSWORD; // mysql user password $mysql_database = DB_NAME; // mysql database name $savename = date("Y-m-d H:i:s"); $conn = mysql_connect($mysql_server_name, $mysql_username, $mysql_password); // 从表中提取信息的sql语句 // 执行sql查询 $result = mysql_db_query($mysql_database, $strsql, $conn); // 获取查询结果 $row = mysql_fetch_row($result); $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 15); $pdf->SetFont('', 'B', '15'); $pdf->SetFillColor(255, 255, 255); $pdf->SetTextColor(128); $pdf->SetDrawColor(92, 92, 92); $pdf->SetLineWidth(0.3); $pdf->Write(40, $product); $pdf->Ln(); //title $pdf->SetFont('', 'B', '9'); $pdf->SetFillColor(128, 128, 128); $pdf->SetTextColor(255); $pdf->SetDrawColor(92, 92, 92); $pdf->SetLineWidth(0.3); // 显示字段名称 //echo "</b><tr></b>"; //$pdf->Cell(mysql_field_len($result, $i),7,mysql_field_name($result, $i),1,0,'C',true); $pdf->Cell(80, 8, 'Product', 1, 0, 'L', true); $pdf->Cell(80, 8, 'Sub-product', 1, 0, 'L', true); $pdf->Ln(); //contents $pdf->SetFillColor(255, 255, 255); $pdf->SetTextColor(128); $pdf->SetDrawColor(92, 92, 92); //echo "</tr></b>"; // 定位到第一条记录 mysql_data_seek($result, 0); // 循环取出记录 $tmp = 'tmp'; while ($row = mysql_fetch_row($result)) { //echo "<tr></b>"; for ($i = 0; $i < mysql_num_fields($result); $i++) { if ($i == 0 && $tmp == $row[$i]) { $pdf->Cell(80, 8, '', 1, 0, 'L', true); } elseif ($i == 0 && $tmp != $row[$i]) { $pdf->Cell(80, 8, $row[$i], 1, 0, 'L', true); $tmp = $row[$i]; } else { $pdf->Cell(80, 8, $row[$i], 1, 0, 'L', true); } } //echo "</tr></b>"; $pdf->Ln(); } $pdf->Output("{$savename}.pdf", 'D'); // release mysql_free_result($result); // disconnection mysql_close($conn); }
$pdf->SetDrawColor(0, 0, 0); $pdf->Ln(); $pdf->Ln(); // Fondo $pdf->Image("../images/fondo.gif", 0, 30, 297, 180); // Logo $pdf->Image("../qualidad/doc-" . $_SESSION['base'] . "/logo-certificado.jpg", 10, 12, 60, 30); // 2/1 proporcional // Salto de línea $pdf->Ln(25); $altura = 10; $fill = false; $espacioBlancoIzda = 70; $pdf->SetFillColor(255, 255, 255); $pdf->SetDrawColor(200, 200, 200); $pdf->SetLineWidth(0.1); $pdf->SetFont('Arial', 'B', 18); $pdf->Cell(280, 50, 'CERTIFICADO DE ASISTENCIA', 0, 1, 'C'); $pdf->Ln(1); $pdf->SetFont('Arial', '', 18); $pdf->Cell($espacioBlancoIzda, $altura, '', 0, 0, 'L'); $pdf->Cell(0, $altura, 'Qualidad Consulting de Sistemas, S.L., CERTIFICA', 0, 0, 'L'); $pdf->Ln(); $pdf->Cell($espacioBlancoIzda, $altura, '', 0, 0, 'L', $fill); $pdf->Cell(15, $altura, 'que ', 0, 0, 'L', $fill); $pdf->SetFont('Arial', 'I', 18); $width = strlen($empleado) * 4; $pdf->Cell($width, $altura, 'D. ' . utf8_decode($empleado), 0, 0, 'L', $fill); $pdf->SetFont('Arial', '', 18); $pdf->Cell(20, $altura, ' ha realizado el curso', 0, 0, 'L', $fill); $pdf->Ln();
/** * print_result4 * print all the jobs realized by member since reference date selected in the second part (start date to share job between member) * * @param array $arr : * @param array $arr['team'] team with param (login, nom, adresse, code, commune, tel1, tel2, mail) * @param array $arr['team2'] team2 with param (login, total_job, total_jobv2, liste_job) * @param date $arr['date_ref'] format DD/MM/YYYY date selected to begin share job between member * @param string $arr['date_debut'] date of the begin of the selected month format : DD/MM/YYYY * @param string $arr['date_fin'] date of the end of the selected month format : DD/MM/YYYY * @param array $arr['agenda'] array of schedule for the month sort by job and by login * @return json json of ok */ public static function print_result4($arr) { try { require 'fpdf/fpdf.php'; require 'fpdi/fpdi.php'; $filename = 'planning/'; if (!file_exists($filename)) { if (!mkdir($filename, 0755, true)) { die('Echec lors de la création des répertoires...'); } } if ($arr['cas'] == 1) { $pdf = new FPDF(); } $intersect = array_uintersect($arr['team'], $arr['team2'], 'compareDeepValue'); if (isset($_SESSION['login2'])) { $info_veto = requetemysql::info_veterinaire(array('login' => strtolower($_SESSION['login']))); if (empty($info_veto)) { throw new Exception("Erreur dans la recherche des informations sur le vétérinaire"); } else { $info_veto = json_decode($info_veto, true); } } $transformation_object = array_map(function ($e) { return is_object($e) ? $e->login : $e['login']; }, $arr['team2']); // var_error_log("liste_pointv2"); // var_error_log($transformation_object); foreach ($intersect as $info_veto2) { if ($arr['cas'] == 2) { $pdf = new FPDF(); } $mon_index = array_search($info_veto2->login, $transformation_object); var_error_log($mon_index); $pdf->AddPage(); $pdf->Image('../images/logo/essai1.jpg', 10, 6, 30); if (isset($_SESSION['login2'])) { $pdf->SetFont('Times', '', 18); $titre3 = utf8_decode(stripslashes(ucfirst($info_veto[0]['nom']))); $w = $pdf->GetStringWidth(stripslashes($titre3)) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, $titre3, 0, 'C'); $pdf->Ln(); $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['adresse']))) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['adresse'])), 0, 'C'); $pdf->Ln(); $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune']))) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune'])), 0, 'C'); $pdf->Ln(); $pdf->SetFont('Times', '', 12); $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['tel']))) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['tel'])), 0, 'C'); $pdf->Ln(15); } $pdf->Cell(90); $pdf->MultiCell(85, 5, requetemysql::gestion_string_maj($info_veto2->nom) . "\n" . requetemysql::gestion_string_norm($info_veto2->adresse) . "\n" . requetemysql::gestion_string_norm($info_veto2->code) . ' ' . requetemysql::gestion_string_norm($info_veto2->commune), 0, 'C'); $pdf->Ln(25); $pdf->MultiCell(85, 5, "Le " . date("d.m.y"), 0, 'L'); if (isset($_SESSION['login2'])) { $pdf->MultiCell(85, 5, requetemysql::gestion_string_maj(TXT_CHARGEMENT_EXPORT8 . stripslashes(ucfirst($info_veto[0]['nom']))), 0, 'L'); } else { $pdf->MultiCell(85, 5, requetemysql::gestion_string_maj(TXT_CHARGEMENT_EXPORT23), 0, 'L'); } $pdf->SetFont('Times', '', 18); $pdf->SetFillColor(153, 153, 153); $pdf->SetTextColor(0, 0, 0); $pdf->SetDrawColor(153, 153, 153); $pdf->SetLineWidth(0.3); $pdf->SetFont('', 'B'); $pdf->MultiCell(0, 12, utf8_decode(TXT_CHARGEMENT_EXPORT24 . requetemysql::gestion_string_maj(htmlentities($info_veto2->login)) . " sur la période du :" . requetemysql::gestion_string_norm($arr['date_ref']) . " au " . requetemysql::gestion_string_norm($arr['date_fin'])), 0, '', true); // Largeurs des colonnes $w = array(190 / 6, 190 / 6, 190 / 6, 190 / 2); $header = array(utf8_decode(TXT_CHARGEMENT_EXPORT26), utf8_decode(TXT_CHARGEMENT_EXPORT27) . " " . requetemysql::gestion_string_norm($arr['date_ref']) . "-" . requetemysql::gestion_string_norm($arr['date_debut']), utf8_decode(TXT_CHARGEMENT_EXPORT27) . " " . requetemysql::gestion_string_norm($arr['date_ref']) . "-" . requetemysql::gestion_string_norm($arr['date_fin']), utf8_decode(TXT_CHARGEMENT_EXPORT28)); // Données $pdf->SetFont('Times', '', 8); // En-tête for ($i = 0; $i < count($header); $i++) { $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C'); } $pdf->Ln(); foreach ($arr['team2'][$mon_index]->total_job as $row) { foreach ($row as $k => $v) { $pdf->Cell($w[0], 6, requetemysql::gestion_string_maj($k), 1, 0, 'C'); $pdf->Cell($w[1], 6, requetemysql::gestion_string_maj($v), 1, 0, 'C'); foreach ($arr['team2'][$mon_index]->total_jobv2 as $row2) { foreach ($row2 as $k2 => $v2) { if ($k2 == $k) { $pdf->Cell($w[2], 6, requetemysql::gestion_string_maj($v2), 1, 0, 'C'); } } } $retour1 = true; foreach ($arr['team2'][$mon_index]->liste_job as $row3) { foreach ($row3 as $k3 => $v3) { if ($k3 == $k) { $retour1 = false; $pdf->MultiCell($w[3], 6, requetemysql::gestion_string_maj(implode(",", $v3)) . " " . $arr['agenda'][$k][$info_veto2->login], 1, 'L', false); } } } if ($retour1) { $pdf->Ln(); } } } // Trait de terminaison $pdf->Cell(array_sum($w), 0, '', 'T'); $pdf->Ln(20); if ($arr['cas'] == 2) { $mon_url = $filename . 'resume_activite_' . requetemysql::gestion_string_maj(htmlentities($info_veto2->login)) . '_' . uniqid() . '.pdf'; //$pdf->Output($mon_url, F); $pdf->Output('../' . $mon_url, F); $filename = $mon_url; $files_name = explode("/", $filename); if (!preg_match("#^[a-z0-9._-]+@(hotmail|live|msn).[a-z]{2,4}\$#", $info_veto2->mail)) { $passage_ligne = "\r\n"; } else { $passage_ligne = "\n"; } //=====Déclaration des messages au format texte et au format HTML. $message_txt = TXT_CHARGEMENT_EXPORT32 . $info_veto2->nom . TXT_CHARGEMENT_EXPORT33 . stripslashes(ucfirst($info_veto[0]['nom'])) . TXT_CHARGEMENT_EXPORT34 . requetemysql::gestion_string_norm($arr['date_ref']) . " - " . requetemysql::gestion_string_norm($arr['date_fin']); $message_txt .= TXT_CHARGEMENT_EXPORT35; $message_txt = utf8_decode($message_txt); $message_html = TXT_CHARGEMENT_EXPORT36 . $info_veto2->nom . TXT_CHARGEMENT_EXPORT37 . stripslashes(ucfirst($info_veto[0]['nom'])) . TXT_CHARGEMENT_EXPORT38 . requetemysql::gestion_string_norm($arr['date_ref']) . " - " . requetemysql::gestion_string_norm($arr['date_fin']) . " : </p>"; $message_html .= TXT_CHARGEMENT_EXPORT39; $message_html = utf8_decode($message_html); //=====Lecture et mise en forme de la pièce jointe analyse. $fichier = fopen('../' . $filename, "r"); $attachement = fread($fichier, filesize('../' . $filename)); $attachement = chunk_split(base64_encode($attachement)); fclose($fichier); //========== //========== //=====Création de la boundary $boundary = "-----=" . md5(rand()); $boundary_alt = "-----=" . md5(rand()); //========== //=====Définition du sujet. $sujet = TXT_CHARGEMENT_EXPORT40; //========= //=====Création du header de l'e-mail $header = "From: \"" . NOMMAILSERVEUR . "\"<" . MAILSERVEUR . ">" . $passage_ligne; $header .= "Reply-to: \"" . NOMMAILSERVEUR . "\" <" . MAILSERVEUR . ">" . $passage_ligne; $header .= "Bcc: \"archives urgences vet\" <*****@*****.**>" . $passage_ligne; $header .= "MIME-Version: 1.0" . $passage_ligne; $header .= "Content-Type: multipart/mixed;" . $passage_ligne . " boundary=\"{$boundary}\"" . $passage_ligne; //=====Création du message. $message = $passage_ligne . "--" . $boundary . $passage_ligne; $message .= "Content-Type: multipart/alternative;" . $passage_ligne . " boundary=\"{$boundary_alt}\"" . $passage_ligne; $message .= $passage_ligne . "--" . $boundary_alt . $passage_ligne; //=====Ajout du message au format texte. $message .= "Content-Type: text/plain; charset=\"ISO-8859-1\"" . $passage_ligne; $message .= "Content-Transfer-Encoding: 8bit" . $passage_ligne; $message .= $passage_ligne . $message_txt . $passage_ligne; //========== $message .= $passage_ligne . "--" . $boundary_alt . $passage_ligne; //=====Ajout du message au format HTML $message .= "Content-Type: text/html; charset=\"ISO-8859-1\"" . $passage_ligne; $message .= "Content-Transfer-Encoding: 8bit" . $passage_ligne; $message .= $passage_ligne . $message_html . $passage_ligne; //========== $message .= $passage_ligne . "--" . $boundary_alt . "--" . $passage_ligne; //========== $message .= $passage_ligne . "--" . $boundary . $passage_ligne; //=====Ajout de la pièce jointe. $message .= "Content-Type: application/pdf; name=\"" . $files_name[count($files_name) - 1] . "\"" . $passage_ligne; $message .= "Content-Transfer-Encoding: base64" . $passage_ligne; $message .= "Content-Disposition: attachment; filename=\"" . $files_name[count($files_name) - 1] . "\"" . $passage_ligne; $message .= $passage_ligne . $attachement . $passage_ligne . $passage_ligne; //========== $message .= $passage_ligne . "--" . $boundary . "--" . $passage_ligne; //=====Envoi de l'e-mail. mail($info_veto2->mail, $sujet, $message, $header); //========== usleep(100000); } } if ($arr['cas'] == 1) { $mon_url = $filename . 'resume_activite_' . uniqid() . '.pdf'; //$pdf->Output($mon_url, F); $pdf->Output('../' . $mon_url, F); return json_encode($mon_url); } else { if ($arr['cas'] == 2) { return json_encode("ok"); } } } catch (Exception $e) { return 'Exception -> '; var_dump($e->getMessage()); } }
$part3[0] = ''; $part4 = array(); $part4[0] = ''; $serverTotal = array(); $serverTotal[0] = ''; $grandServerTotal = 0; $oneTimeTotal = 600; $pdf = new FPDF(); $pdf->AddPage(); $pdf->Image('./pdf/images/dss_logo.jpg'); $pdf->SetFont('Arial', '', '12'); $pdf->Cell(0, 10, 'Budgetary Quote for Hosting', 0, 1, 'C'); $pdf->Cell(0, 10, '**** This is not a formal proposal. Formal design required. ****', 0, 1, 'C'); $pdf->Cell(95, 10, 'Date: ' . date('m/d/y'), 0, 0, 'L'); $pdf->Cell(95, 10, 'Contact: ' . $salesperson, 0, 1, 'R'); $pdf->SetLineWidth(0.8); $pdf->SetDrawColor(160, 160, 160); $pdf->Line(10, 53, 200, 53); $pdf->SetFont('', 'B', '14'); $pdf->Cell(130, 15, 'Description', 0, 0, 'L'); $pdf->Cell(30, 15, 'Monthly', 0, 0, 'R'); $pdf->Cell(30, 15, 'One-Time', 0, 1, 'R'); $serversOnList = $_POST['servers-on-list']; if ($serversOnList == 0) { $pdf->SetFont('', 'I', '12'); $pdf->Cell(130, 5, 'No cloud server configurations', 0, 1, 'L'); } else { $driveTotal = 0; for ($i = 1; $i <= $serversOnList; ++$i) { $pdf->SetFont('', '', '12'); $pdf->Cell(130, 5, $_POST['server_name' . $i], 0, 0, 'L');
require "fpdf/fpdf.php"; $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont("Helvetica", "B", 22); $pdf->Cell(0, 20, "Certificate", "B", 1, "C"); $pdf->Ln(); $pdf->SetFont("Helvetica", "B", 16); $pdf->Cell(0, 20, "OF PHP Knowledge", "I", 0, "C"); $pdf->Ln(); $pdf->Cell(0, 20, "Issued to VitoshAcademy.Com", "I", 0, "C"); $pdf->Ln(); $pdf->Cell(0, 20, "By VitoshAcademy.Com", "I", 0, "C"); $pdf->Ln(); $pdf->SetFont("Helvetica", "B", 11); $pdf->SetDrawColor(255, 0, 255); $pdf->SetLineWidth(0.1); $pdf->SetFillColor(192, 192, 192); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(25, 5, "N", "LTR", 0, "C", 1); $pdf->Cell(25.1, 5, "N * 11", "LTR", 0, "C", 1); $pdf->Cell(25.2, 5, "N * 13", "LTR", 0, "C", 1); $pdf->Cell(25.3, 5, "N * 17", "LTR", 0, "C", 1); $pdf->Cell(25.4, 5, "N * 19", "LTR", 0, "C", 1); $pdf->Cell(25.5, 5, "N * 23", "LTR", 0, "C", 1); $pdf->Cell(25.6, 5, "N * 31", "LTR", 0, "C", 1); $pdf->Ln(); $bool_draw = True; for ($w = 7; $w <= 50; $w = $w + 7) { if ($bool_draw == True) { $pdf->SetFillColor(105, 110, 115); $pdf->SetTextColor(1, 300, 1);
function genpdf($idfacture, $idpaiement, $date, $payeur, $type, $mode, $montant, $initiales, $no_cheque, $organisme, $obs) { $xreg = 1.5; $yreg = 3.5; $pdf = new FPDF('P', 'mm', 'A4'); $pdf->AddPage(); //logo $pdf->Image('img/logo.jpg', 10 + $xreg, 14 + $yreg, 12, 10, 'jpg'); $pdf->SetLineWidth(0.4); $pdf->Rect(4 + $xreg, 7 + $yreg, 196, 30); //rectangle global $pdf->Line(4 + $xreg, 13 + $yreg, 200 + $xreg, 13 + $yreg); //1ere barre horizontale $pdf->Line(27 + $xreg, 7 + $yreg, 27 + $xreg, 37 + $yreg); //1ere barre verticale $pdf->Line(77 + $xreg, 7 + $yreg, 77 + $xreg, 37 + $yreg); //2nd barre verticale $pdf->Line(127 + $xreg, 7 + $yreg, 127 + $xreg, 37 + $yreg); //3eme barre verticale $pdf->Line(152 + $xreg, 7 + $yreg, 152 + $xreg, 37 + $yreg); //4eme barre verticale $pdf->Line(177 + $xreg, 7 + $yreg, 177 + $xreg, 37 + $yreg); //5eme barre verticale $pdf->SetLineWidth(0.2); $pdf->Line(27 + $xreg, 21 + $yreg, 200 + $xreg, 21 + $yreg); //1ere barre fine horizontale $pdf->Line(4 + $xreg, 31 + $yreg, 200 + $xreg, 31 + $yreg); //2nd barre fine horizontale $pdf->SetFont('Arial', '', 8); $pdf->SetXY(4 + $xreg, 7 + $yreg); $pdf->Cell(23, 7, utf8_decode('DATE'), 0, 1, 'C'); $pdf->SetXY(27 + $xreg, 7 + $yreg); $pdf->Cell(50, 7, utf8_decode('NOM de la partie versante'), 0, 1, 'C'); $pdf->SetXY(27 + $xreg, 13 + $yreg); $pdf->Cell(50, 7, utf8_decode('Reçu de M.'), 0, 1, ''); $pdf->SetXY(77 + $xreg, 7 + $yreg); $pdf->Cell(50, 7, utf8_decode('DESIGNATION DES PRODUITS'), 0, 1, 'C'); $pdf->SetXY(127 + $xreg, 7 + $yreg); $pdf->Cell(25, 3.5, utf8_decode('VERSEMENT'), 0, 1, 'C'); $pdf->SetXY(127 + $xreg, 9.5 + $yreg); $pdf->Cell(25, 3.5, utf8_decode('en numéraire'), 0, 1, 'C'); $pdf->SetXY(152 + $xreg, 7 + $yreg); $pdf->Cell(25, 7, utf8_decode('CHEQUES'), 0, 1, 'C'); $pdf->SetXY(177 + $xreg, 7 + $yreg); $pdf->Cell(25, 7, utf8_decode('DIVERS'), 0, 1, 'C'); //data $pdf->SetXY(4 + $xreg, 25 + $yreg); $pdf->Cell(23, 7, "No. " . $idpaiement, 0, 1, 'C'); $pdf->SetXY(4 + $xreg, 31 + $yreg); $pdf->Cell(23, 7, standarddateformat($date), 0, 1, 'C'); $pdf->SetXY(27 + $xreg, 31 + $yreg); $pdf->Cell(50, 7, utf8_decode($obs), 0, 1, ''); $pdf->SetXY(27 + $xreg, 21 + $yreg); $pdf->Cell(50, 10, strtoupper(utf8_decode($payeur)), 0, 1, 'C'); switch ($mode) { case 'num': $pdf->SetXY(125 + $xreg + $xreg, 21 + $yreg); break; case 'chq': $pdf->SetXY(150 + $xreg + $xreg, 19 + $yreg); break; default: $pdf->SetXY(175 + $xreg + $xreg, 21 + $yreg); break; } $pdf->Cell(25, 10, utf8_decode(trispace($montant) . ' FCP'), 0, 1, 'C'); $pdf->SetXY(150 + $xreg + $xreg, 23 + $yreg); $pdf->Cell(25, 10, utf8_decode($organisme . ' ' . $no_cheque), 0, 1, 'C'); $pdf->SetXY(77 + $xreg + $xreg, 13 + $yreg); $pdf->Cell(50, 10, utf8_decode('Facture n° ' . $idfacture), 0, 1, 'C'); $pdf->SetXY(77 + $xreg + $xreg, 21 + $yreg); $pdf->Cell(50, 10, utf8_decode($type), 0, 1, 'C'); $pdf->SetXY(77 + $xreg + $xreg, 29 + $yreg); $pdf->Cell(50, 10, utf8_decode('Receveur ' . $initiales), 0, 1, 'C'); $pdf->Output(); }
private function makePdf($Desenhos, $Conjuntos, $Pesos, $naome) { define('FPDF_FONTPATH', "./assets/template/font/"); $pdf = new FPDF(); $pdf->AddPage(); $pdf->Image(base_url('assets/template/img/logo-Steel4web-600.png'), 10, 6, 30); $pdf->Ln(4); $pdf->SetFont('Arial', '', 12); $w = array(50, 30, 50, 14, 23, 23); $cabeca = array('Projeto', 'Empresa', 'Responsavel', 'Vrs', 'Contr.', 'Data'); $content = array('GR0-00f3', 'Vipal', 'Vitor Lima', '01', 'Web3d', '20/01/2016'); for ($i = 0; $i < count($cabeca); $i++) { $pdf->Cell($w[$i], 8, $cabeca[$i], 1, 0, 'C'); } $pdf->Ln(); $pdf->SetFont('Arial', '', 8); for ($i = 0; $i < count($cabeca); $i++) { $pdf->Cell($w[$i], 6, $content[$i], 1, 0, 'C'); } $pdf->Ln(20); $pdf->SetFont('Arial', '', 14); $header = array('Desenho', 'Tipologia', 'Peso Total(KG)'); $total = array('TOTAL GRD', '-', $Pesos['total']); $data = array('Desenho', 'Conjunto', 'Tipologia', 'Quantidade', 'Peso Unid.(Kg)', 'Peso Total(Kg)'); $w2 = array(50, 80, 60); $pdf->SetLineWidth(0.3); for ($i = 0; $i < count($header); $i++) { $pdf->Cell($w2[$i], 8, $header[$i], 1, 0, 'C'); } $pdf->Ln(); $pdf->SetFont('Arial', 'B', 12); for ($i = 0; $i < count($total); $i++) { $pdf->Cell($w2[$i], 6, $total[$i], 'LRB', 0, 'C'); } $pdf->Ln(); foreach ($Desenhos as $des) { $pdf->SetFont('Arial', 'B', 10); // $pdf->SetTextColor(46,46,135); $dese = array($des, $Conjuntos[$des][0]['DES_PEZ'], $Pesos[$des]); for ($i = 0; $i < count($dese); $i++) { $pdf->Cell($w2[$i], 6, $dese[$i], 'LRB', 0, 'C'); } $pdf->Ln(); /* $pdf->SetFont('Arial','',10); $pdf->SetTextColor(0,0,0); foreach($Conjuntos as $conju){ foreach($conju as $conj){ if($conj['FLG_DWG'] == $des){ $pdf->Cell($w[0],6,$conj['FLG_DWG'],'LRB',0,'C'); $pdf->Cell($w[1],6,$conj['MAR_PEZ'],'LRB',0,'C'); $pdf->Cell($w[2],6,$conj['DES_PEZ'],'LRB',0,'C'); $pdf->Cell($w[3],6,$conj['QTA_PEZ'],'LRB',0,'C'); $pdf->Cell($w[4],6,$conj['PESO_QTA'],'LRB',0,'C'); $pdf->Cell($w[5],6,$conj['peso'],'LRB',0,'C'); $pdf->Ln(); } } } */ } $NamePdf = $naome . '.pdf'; $pdf->Cell(array_sum($w), 0, '', 'T'); $pdf->Output('D', $NamePdf); }
$couleur_rgb_prim = func_SetRgbValueFromHex($coul_prim); $couleur_rgb_sec = func_SetRgbValueFromHex($coul_sec); define('FPDF_FONTPATH', './font/'); require './fpdf.php'; $lycee = "IUT"; $ville = "POITIERS"; $auteur = "Sébastien CELLES"; $auteur_mail = "*****@*****.**"; $tick = array("no" => 0, "small" => 1, "big" => 2, "verybig" => 3); $width = array("normal" => 0.1, "bold" => 0.35, "normal-bold" => 0.25); $pdf = new FPDF(); $pdf->Open(); $pdf->SetAuthor($auteur); $pdf->SetTitle('Génération de papiers spéciaux'); $pdf->SetMargins(0, 0); $pdf->SetLineWidth($width["normal"]); $pdf->SetAutoPageBreak(1); $pdf->SetFont('Arial', '', 8); $pdf->SetTextColor(0, 0, 0); $date = date("d/m/Y à H:i:s"); switch ($_REQUEST['papier']) { // Génération papier quadrillé 5mm x 5mm case 1: for ($page = 1; $page <= $nb_papier; $page++) { $pdf->AddPage(); $pdf->SetDrawColor($couleur_rgb_sec[0], $couleur_rgb_sec[1], $couleur_rgb_sec[2]); for ($i = 10; $i <= 280; $i += 5) { $pdf->Line(10, $i, 200, $i); } for ($i = 10; $i <= 200; $i += 5) { $pdf->Line($i, 10, $i, 280);
function creation_resume($animal_id, $info_analyse, $info_radio, $info_formulaire, $variable) { $filename = '../sauvegarde/animaux/' . $animal_id; if (!file_exists($filename)) { if (!mkdir($filename, 0755, true)) { die('Echec lors de la création des répertoires...'); } } $info_veto = requetemysql::info_veterinaire(array('login' => strtolower($_SESSION['login']))); if (empty($info_veto)) { throw new Exception("Erreur dans la recherche des informations sur le vétérinaire"); } else { $info_veto = json_decode($info_veto, true); } if ($_SESSION['login'] != $_SESSION['login2']) { $info_veto2 = requetemysql::info_veterinaire(array('login' => strtolower($_SESSION['login2']))); if (empty($info_veto2)) { throw new Exception("Erreur dans la recherche des informations sur le vétérinaire qui a réalisé la consultation"); } else { $info_veto2 = json_decode($info_veto2, true); } } $pdf = new FPDF(); $pdf->AddPage(); $pdf->Image('../image/logo/essai1.jpg', 10, 6, 30); $pdf->SetFont('Times', '', 18); $titre3 = utf8_decode(stripslashes(ucfirst($info_veto[0]['nom']))); $w = $pdf->GetStringWidth(stripslashes($titre3)) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, $titre3, 0, 'C'); $pdf->Ln(); $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['adresse']))) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['adresse'])), 0, 'C'); $pdf->Ln(); $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune']))) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune'])), 0, 'C'); $pdf->Ln(); $pdf->SetFont('Times', '', 12); $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['tel']))) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['tel'])), 0, 'C'); $pdf->Ln(20); $pdf->MultiCell(85, 5, "Le " . date("d.m.y"), 0, 'L'); $pdf->SetFont('Times', 'B', 12); $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Résumé de la consultation du " . $info_formulaire['date_consultation'] . ", concernant :" . $_POST['caracteristique']), '0', 'L'); $pdf->SetFont('Times', '', 12); if ($_SESSION['login'] != $_SESSION['login2']) { $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Cette consultation a été réalisée par " . $info_veto2[0]['nom_vet'] . ", exerçant à :" . $info_veto2[0]['adresse'] . " " . $info_veto2[0]['code'] . " " . $info_veto2[0]['commune'] . ". Téléphone :" . $info_veto2[0]['tel']), '0', 'L'); $pdf->Ln(); } $pdf->SetFont('Times', '', 14); $pdf->SetFillColor(153, 153, 153); $pdf->SetTextColor(0, 0, 0); $pdf->SetDrawColor(153, 153, 153); $pdf->SetLineWidth(0.3); $pdf->MultiCell(190, 10, requetemysql::gestion_string_maj("Motif de consultation :" . $info_formulaire['barre_resume']), '0', 'L', true); $pdf->Ln(); $pdf->SetFont('Times', '', 12); $pdf->MultiCell(190, 5, requetemysql::gestion_string_maj("Détail :" . $info_formulaire['clinique']), 0, 'L'); $pdf->Ln(15); $pdf->Cell(50, 20, utf8_decode("signature du vétérinaire :"), 0, 0, false); if (count($info_analyse) > 0) { $pdf->AddPage(); $pdf->Image('../image/logo/essai1.jpg', 10, 6, 30); $pdf->SetFont('Times', '', 18); $titre3 = utf8_decode(stripslashes(ucfirst($info_veto[0]['nom']))); $w = $pdf->GetStringWidth(stripslashes($titre3)) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, $titre3, 0, 'C'); $pdf->Ln(); $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['adresse']))) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['adresse'])), 0, 'C'); $pdf->Ln(); $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune']))) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune'])), 0, 'C'); $pdf->Ln(); $pdf->SetFont('Times', '', 12); $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['tel']))) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['tel'])), 0, 'C'); $pdf->Ln(20); $pdf->MultiCell(85, 5, "Le " . date("d.m.y"), 0, 'L'); $pdf->SetFont('Times', 'B', 12); $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Résultat d'analyse du " . $info_formulaire['date_consultation'] . ", concernant :" . $_POST['caracteristique']), '0', 'L'); $pdf->SetFont('Times', '', 12); if ($_SESSION['login'] != $_SESSION['login2']) { $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Ces analyses ont été réalisées par " . $info_veto2[0]['nom_vet'] . ", exerçant à :" . $info_veto2[0]['adresse'] . " " . $info_veto2[0]['code'] . " " . $info_veto2[0]['commune'] . ". Téléphone :" . $info_veto2[0]['tel']), '0', 'L'); } $pdf->Ln(); // Largeurs des colonnes $w = array(190 / 4, 190 / 6, 190 / 6, 190 / 4, 190 / 6); $header = array(utf8_decode('Référence'), utf8_decode('Résultat'), utf8_decode('Unité'), utf8_decode('Méthode'), utf8_decode("date d'analyse")); // En-tête for ($i = 0; $i < count($header); $i++) { $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C'); } $pdf->Ln(); // Données foreach ($info_analyse as $row) { $pdf->Cell($w[0], 6, requetemysql::gestion_string_maj($row['nom']), 'LR', 0, 'C'); $pdf->Cell($w[1], 6, requetemysql::gestion_string_norm($row['resultat']), 'LR', 0, 'R'); $pdf->Cell($w[2], 6, requetemysql::gestion_string_norm($row['unite']), 'LR', 0, 'C'); $pdf->Cell($w[3], 6, requetemysql::gestion_string_norm($row['methode']), 'LR', 0, 'C'); $pdf->Cell($w[4], 6, requetemysql::gestion_string_norm($row['ma_date']), 'LR', 0, 'C'); $pdf->Ln(); } // Trait de terminaison $pdf->Cell(array_sum($w), 0, '', 'T'); $pdf->Ln(8); $pdf->Cell(50, 20, utf8_decode("Commentaire :"), 'LTB', 0, false); $pdf->MultiCell(0, 20, requetemysql::gestion_string_maj($info_formulaire['commentaire']), 'TRB', 'L', false); } if (count($info_radio) > 0 || $info_formulaire['result_radio'] != '') { $pdf->AddPage(); $pdf->Image('../image/logo/essai1.jpg', 10, 6, 30); $pdf->SetFont('Times', '', 18); $titre3 = utf8_decode(stripslashes(ucfirst($info_veto[0]['nom']))); $w = $pdf->GetStringWidth(stripslashes($titre3)) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, $titre3, 0, 'C'); $pdf->Ln(); $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['adresse']))) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['adresse'])), 0, 'C'); $pdf->Ln(); $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune']))) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune'])), 0, 'C'); $pdf->Ln(); $pdf->SetFont('Times', '', 12); $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['tel']))) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['tel'])), 0, 'C'); $pdf->Ln(20); $pdf->MultiCell(85, 5, "Le " . date("d.m.y"), 0, 'L'); $pdf->SetFont('Times', 'B', 12); $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Compte-rendu de l'examen radiologique du " . $info_formulaire['date_consultation'] . ", concernant :" . $_POST['caracteristique']), '0', 'L'); $pdf->SetFont('Times', '', 12); if ($_SESSION['login'] != $_SESSION['login2']) { $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Ces radios ont été réalisées par " . $info_veto2[0]['nom_vet'] . ", exerçant à :" . $info_veto2[0]['adresse'] . " " . $info_veto2[0]['code'] . " " . $info_veto2[0]['commune'] . ". Téléphone :" . $info_veto2[0]['tel']), '0', 'L'); } $pdf->Ln(); // Largeurs des colonnes $w = array(190 / 4, 190 / 4, 190 / 4, 190 / 4); $header = array(utf8_decode('Personnel exposé aux RX'), utf8_decode('constantes'), utf8_decode('date'), utf8_decode('Zone radiographiée')); // En-tête for ($i = 0; $i < count($header); $i++) { $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C'); } $pdf->Ln(); // Données foreach ($info_radio as $row) { $pdf->Cell($w[0], 6, requetemysql::gestion_string_maj($row['perso']), 'LR', 0, 'R'); $pdf->Cell($w[1], 6, requetemysql::gestion_string_norm($row['expo']), 'LR', 0, 'R'); $pdf->Cell($w[2], 6, requetemysql::gestion_string_norm($row['ma_date']), 'LR', 0, 'C'); $pdf->Cell($w[3], 6, requetemysql::gestion_string_norm($row['zone']), 'LR', 0, 'C'); $pdf->Ln(); } // Trait de terminaison $pdf->Cell(array_sum($w), 0, '', 'T'); $pdf->Ln(4); $pdf->MultiCell(0, 10, utf8_decode("Résultat de la lecture de cliché :"), 'LTRB', 'C', false); $pdf->Ln(4); $pdf->Write(5, requetemysql::gestion_string_maj($info_formulaire['result_radio'])); } $mon_url = '../sauvegarde/animaux/' . $_POST['animal_id'] . '/resume_consult_' . $variable . '.pdf'; $pdf->Output($mon_url, F); return $mon_url; }
function facturarform($idFactura) { global $db, $hoy, $tmIdUsuario, $facturado; $pdf = new FPDF(); // Manda datos al FPDF. $pdf->Open(); $pdf->SetMargins(20, 20, 20); $pdf->AddPage(); $cont = 0; $row = 100; // inicio de renglon para los conceptos. // Moneda $moneda = getValueTable("moneda", "FT_TMA", "id_factura", $idFactura); $idCliente = getValueTable("id_cliente", "FT_TMA", "id_factura", $idFactura); //actualizar flg_proforma para indicar que ya se puede mandar a imprimir la factura $sql = "update FT_TMA set flg_proforma='1' where id_factura='{$idFactura}'"; $db->query($sql); // Datos del cliente $sql = "select * from FT_CLIENTE where id_cliente='{$idCliente}'"; $db->query($sql); while ($db->next_record()) { $cliente = $db->f(cliente); $tel = $db->f(tel); $rfc = $db->f(rfc); $calle = $db->f(calle); $noExt = $db->f(no_ext); $noInt = $db->f(no_int); $colonia = $db->f(colonia); $cp = $db->f(cp); $ciudad = $db->f(ciudad); $edo = $db->f(edo); } // Encabezado $pdf->Image('../images/msc.jpg', 8, 16, 13); $pdf->Image('../images/rfc2.jpg', 5, 235, 25); $pdf->Image('../images/mscblackF.jpg', 25, 80, 150); $pdf->SetFont('Arial', 'B', 15); //$pdf->Text(65,20,"RECIBASE"); $pdf->SetFont('Arial', 'B', 11); $pdf->Text(25, 23, "MEDITERRANEAN SHIPPING COMPANY MÉXICO, S.A. DE C.V."); $pdf->SetFont('Arial', 'B', 9); $pdf->Text(153, 23, "AS AGENTS ONLY"); $pdf->SetFont('Arial', 'B', 6); //DIRECCION OFICINA MATRIZ $pdf->Text(5, 30, "OFICINA MATRIZ"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(2, 32, "AV. BENJAMIN FRANKLIN No 204"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(2, 34, "PISO 1 COL ESCANDON C.P. 11800"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(1, 36, "DELEG. MIGUEL HIDALGO, MEXICO DF"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(9, 38, "TEL50917070"); //DIRECCION OFICINA ALTAMIRA $pdf->SetFont('Arial', 'B', 6); $pdf->Text(35, 29, "SUC. ALTAMIRA"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(35, 31, "AV. RIO TMESI KM0+700"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(30, 33, "EDIF. TORRE MULTIMODAL DESP. 306"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(32, 35, "C.P. 69600 PUERTO INDUSTRIAL"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(38, 37, "ALTAMIRA, TAMPS."); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(37, 39, "TEL: 01 833 260-3200"); //DIRECCION OFICINA GUADALAJARA $pdf->SetFont('Arial', 'B', 6); $pdf->Text(62, 30, "SUC. GUADALAJARA"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(65, 32, "RUBEN DARIO No 217"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(60, 34, "COL.CIRCUNVALACION VALLARTA"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(62, 36, "C.P. 44680 GUADALAJARA JAL."); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(66, 38, "TEL: 01 33 3630-4460"); //DIRECCION OFICINA MANZANILLO $pdf->SetFont('Arial', 'B', 6); $pdf->Text(92, 30, "SUC. MANZANILLO"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(90, 32, "CALLE 20 DE NOVIEMBRE No 11"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(92, 34, "COL.BUROCRATA C.P.28250"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(96, 36, "MANZANILLO, COL."); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(95, 38, "TEL: 01 314 332-3055"); //DIRECCION OFICINA MAZATLAN $pdf->SetFont('Arial', 'B', 6); $pdf->Text(122, 29, "SUC. MANZATLAN"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(118, 31, "AV. EMILIO BARRAGAN No 63 DESP. 102"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(123, 33, "EDIF. CENTRO MARITIMO"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(123, 35, "CO. CENTRO C.P. 82000"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(125, 37, "MAZATLAN SINALOA"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(125, 39, "TEL. 01 569 985-0844"); //DIRECCION OFICINA VERACRUZ $pdf->SetFont('Arial', 'B', 6); $pdf->Text(152, 29, "SUC. VERACRUZ"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(153, 31, "AV. 5 DE MAYO No 961"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(152, 33, "DEPTO 2 ENTRE JUAREZ"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(153, 35, "Y EMPARAM COL. CENTRO"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(152, 37, "C.P. 91700 VERACRUZ VER"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(152, 39, "TEL. 01 229 931-0416"); //DIRECCION OFICINA MONTERREY $pdf->SetFont('Arial', 'B', 6); $pdf->Text(182, 29, "SUC. MONTERREY"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(183, 31, "AV. ZARAGOZA No 1000"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(182, 33, "DESP. 1010 COL. CENTRO"); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(182, 35, "C.P. 54000 MONTERREY N.L."); $pdf->SetFont('Arial', 'B', 4); $pdf->Text(184, 37, "TEL. 01 83 5345-1010"); //LINEA HORIZONTAL $pdf->SetLineWidth(0.2); $pdf->Line(5, 40, 140, 40); $pdf->SetFont('Arial', 'B', 6); $pdf->Text(10, 43, "CLIENTE : "); $pdf->SetFont('Arial', 'B', 10); // Cliente $pdf->Text(24, 43, $cliente); $pdf->Text(24, 49, $calle); if (!empty($cp)) { $cpT = "C.P. {$cp}"; } else { $cpT = ""; } $dir = "{$noExt} {$noInt} {$colonia} {$cpT}"; $pdf->SetFont('Arial', 'B', 6); $pdf->Text(10, 50, "DIRECCION : "); $pdf->SetFont('Arial', 'B', 10); $pdf->Text(24, 52, $dir); $pdf->SetFont('Arial', 'B', 6); $pdf->Text(10, 58, "TEL : "); $pdf->Text(60, 58, "R.F.C."); $pdf->SetFont('Arial', 'B', 10); $pdf->Text(24, 58, $tel); $pdf->Text(70, 58, $rfc); $pdf->SetFont('Arial', 'B', 6); $pdf->Text(10, 61, "CIUDAD : "); $pdf->SetFont('Arial', 'B', 10); $pdf->Text(24, 61, $ciudad); $pdf->Text(60, 64, $edo); //LINEA HORIZONTAL $pdf->SetLineWidth(0.2); $pdf->Line(156, 57, 193, 57); $pdf->SetLineWidth(0.2); $pdf->Line(5, 64, 140, 64); //LINEA VERTICAL $pdf->SetLineWidth(0.2); $pdf->Line(5, 40, 5, 64); $pdf->SetLineWidth(0.2); //$pdf->Line(140,40,140,64); $pdf->Line(140, 40, 140, 64); //VERTICAL FECHA $pdf->SetLineWidth(0.2); $pdf->Line(156, 57, 156, 70); $pdf->SetLineWidth(0.2); $pdf->Line(193, 57, 193, 70); $pdf->SetLineWidth(0.2); $pdf->Line(165, 57, 165, 70); $pdf->SetLineWidth(0.2); $pdf->Line(180, 57, 180, 70); //LINEA HORIZONTAL $pdf->SetLineWidth(0.2); $pdf->Line(156, 62, 193, 62); $pdf->SetLineWidth(0.2); $pdf->Line(156, 70, 193, 70); $pdf->SetFont('Arial', 'B', 6); $pdf->Text(158, 60, "DIA"); $pdf->SetFont('Arial', 'B', 6); $pdf->Text(170, 60, "MES"); $pdf->SetFont('Arial', 'B', 6); $pdf->Text(183, 60, "AÑO"); $pdf->SetFont('Arial', 'B', 12); $pdf->Text(163, 45, "PRO-FORMA"); $pdf->SetFont('Arial', '', 12); $pdf->Text(168, 52, "{$idFactura}"); //LINEA HORIZONTAL $pdf->SetLineWidth(0.2); $pdf->Line(3, 84, 205.5, 84); $pdf->SetLineWidth(0.2); $pdf->Line(3, 90, 205.5, 90); $pdf->SetLineWidth(0.2); $pdf->Line(3, 235, 205, 235); $pdf->SetLineWidth(0.2); $pdf->Line(45, 283, 190, 283); $pdf->SetLineWidth(0.2); $pdf->Line(20, 295, 190, 295); $pdf->SetFont('Arial', '', 6); $pdf->Text(4, 88, "CANT."); $pdf->SetFont('Arial', '', 6); $pdf->Text(60, 88, "DESCRIPCIÓN"); $pdf->SetFont('Arial', '', 6); $pdf->Text(140, 88, "P. UNITARIO"); $pdf->SetFont('Arial', '', 6); $pdf->Text(180, 88, "P. UNITARIO"); //LINEA VERTICAL $pdf->SetLineWidth(0.2); $pdf->Line(3, 84, 3, 235); $pdf->SetLineWidth(0.2); $pdf->Line(205.5, 84, 205.5, 235); $pdf->SetLineWidth(0.2); $pdf->Line(13, 84, 13, 235); $pdf->SetLineWidth(0.2); $pdf->Line(123, 84, 123, 235); $pdf->SetLineWidth(0.2); $pdf->Line(168, 84, 168, 235); $pdf->SetLineWidth(0.2); $pdf->Line(20, 283, 20, 295); $pdf->SetLineWidth(0.2); $pdf->Line(190, 283, 190, 295); //$pdf->Image('../images/rfc2.JPG',8,16,13); $pdf->SetFont('Arial', 'B', 6); $pdf->Text(21, 283, "IMPORTE CON LETRA"); //Selecciona la fecha emitida $fecha = getValueTable("femitida", "FT_TMA", "id_factura", $idFactura); //MESES //Poner formato de Fecha de Captura $ano = substr($fecha, 0, 4); $mes = substr($fecha, 5, 2); $dia = substr($fecha, 8, 2); $mesC = date("F", mktime(0, 0, 0, $mes, $dia, $ano)); if ($mesC == "January") { $mc = "ENERO"; } if ($mesC == "February") { $mc = "FEBRERO"; } if ($mesC == "March") { $mc = "MARZO"; } if ($mesC == "April") { $mc = "ABRIL"; } if ($mesC == "May") { $mc = "MAYO"; } if ($mesC == "June") { $mc = "JUNIO"; } if ($mesC == "July") { $mc = "JULIO"; } if ($mesC == "August") { $mc = "AGOSTO"; } if ($mesC == "September") { $mc = "SEP"; } if ($mesC == "October") { $mc = "OCT"; } if ($mesC == "November") { $mc = "NOV"; } if ($mesC == "December") { $mc = "DIC"; } //$fecha_final=$dia."/".$mc."/".$ano; //$pdf->Text(162,44,$fecha_final); // Fecha $pdf->Text(160, 67, $dia); $pdf->Text(168, 67, $mc); $pdf->Text(184, 67, $ano); /*$pdf->Text(24,67,"HONDURAS"); $pdf->Text(66,67,"HONDURAS"); $pdf->Text(120,67,$rfc);*/ //Imprimir Conceptos $sql = "select id_fac_rel from FT_REL_CONCEPTO_PRO where id_factura='{$idFactura}'"; $db->query($sql); while ($db->next_record()) { $idFacRel = $db->f(id_fac_rel); } unset($totalG); if (empty($idFacRel)) { $sql = "select * from FT_REL_CONCEPTO where id_factura='{$idFactura}'"; } else { $sql = "select * from FT_REL_CONCEPTO_PRO where id_factura='{$idFactura}'"; } $db->query($sql); while ($db->next_record()) { $idConcepto = $db->f(id_concepto); $conceptoConta = getValueTable("concepto", "FT_CONCEPTO", "id_concepto", $idConcepto); $conceptoImp = $db->f(concepto_imp); $cantidad = $db->f(cantidad); $precioU = $db->f(preciou); $iva = $db->f(iva); $importeT = $db->f(importe); $descpT = $db->f(descp); //$long= strlen($importeT); //$importeU= $importeT; //$longU= strlen($importeU); //Imprimir los conceptos //Cantidad $pdf->Text(4, $row, $cantidad); //IDENTIFICAMOS QUE CONCEPTO MANDAMOS A IMPRESION if (empty($conceptoImp)) { $concepto = $conceptoConta; } else { $concepto = $conceptoImp; } //Concepto $pdf->SetFont('Courier', 'B', 10); $pdf->Text(15, $row, $concepto); $concepto = ""; $precioU = number_format($precioU, 2); $longU = strlen($precioU); //Importe Unitario switch ($longU) { case "4": //$precioU= number_format($precioU,2); $pdf->Text(136, $row, $precioU); //0.00 break; case "5": //$precioU=number_format($precioU,2); $pdf->Text(134.8, $row, $precioU); //136.9 ; 00.00 break; case "6": //$precioU=number_format($precioU,2); $pdf->Text(133.7, $row, $precioU); //134.7 : 000.00 break; case "7": //$precioU=number_format($precioU,2); $pdf->Text(130.5, $row, $precioU); //130.5 ; 0000.00 break; case "8": //$precioU=number_format($precioU,2); $pdf->Text(131.9, $row, $precioU); //128.4 ; 0,000.00 break; case "9": //$precioU=number_format($precioU,2); $pdf->Text(130.9, $row, $precioU); //128.4 ; 00,000.00 break; case "10": //$precioU=number_format($precioU,2); $pdf->Text(129.5, $row, $precioU); //128.4 ; 000,000.00 break; case "12": //$precioU=number_format($precioU,2); $pdf->Text(127.7, $row, $precioU); //128.4 ; 0,000,000.00 break; } $totalG = $totalG + $importeT; //$importeT=number_format($importeT,2); $long = strlen($importeT); //Importe Total switch ($long) { case "4": //$importeT=number_format($importeT,2); $pdf->Text(182.0, $row, $importeT); //184 break; case "5": //$importeT=number_format($importeT,2); $pdf->Text(180.9, $row, $importeT); //181.9 break; case "6": //$importeT=number_format($importeT,2); $pdf->Text(179.7, $row, $importeT); //179.7 break; case "7": //$importeT=number_format($importeT,2); $pdf->Text(175.5, $row, $importeT); //175.5 break; case "8": //$importeT=number_format($importeT,2); $pdf->Text(178.0, $row, $importeT); //173.4 break; case "9": //$importeT=number_format($importeT,2); $pdf->Text(176.9, $row, $importeT); //173.4 break; case "10": //$importeT=number_format($importeT,2); $pdf->Text(175.9, $row, $importeT); //173.4 break; case "12": //$importeT=number_format($importeT,2); $pdf->Text(173.9, $row, $importeT); //173.4 break; } /*$descp = getValueTable("descp","FT_TMA","id_factura",$idFactura); if (!empty($descp)) { //Descripcion $descpT=$descp; }*/ if (!empty($descpT)) { $descp = $descpT; } else { $descp = getValueTable("descp", "FT_TMA", "id_factura", $idFactura); } $cadena = substr($direccion, 0, 67); $cadena2 = substr($direccion, 67); $lenght = strlen($cadena); if (!$lenght == 67) { $pdf->Text(28, 54, $cadena); } else { $pdf->Text(28, 54, $cadena); $pdf->Text(28, 57, $cadena2); } /* $cadenax = substr($descp,0,67); $cadena2x = substr($descp,67); $lenght = strlen($cadenax); if(!$lenght == 67){ $pdf->SetFont('Courier','B',8); $pdf->Text(20,$row+3,$cadenax); }else{ $pdf->SetFont('Courier','B',8); $pdf->Text(20,$row+3,$cadenax); $pdf->Text(20,$row+6,$cadena2x); } */ $caddes = strlen($descp); $inid = 0; $find = 60; //$posd=175; //$pos=0; $row += 3; while ($caddes > 0) { $datad[] = substr($descp, $inid, $find); $inid = $inid + 60; $find = $find; $caddes = $caddes - 60; //$pdf->Text(90,$s,$description); //$s=$s+3; foreach ($datad as $line) { $pdf->SetFont('Courier', 'B', 8); $pdf->Text(20, $row, $line); $row = $row + 3; unset($datad); } } /*if(!empty($descpT)){ $arrT= explode("|",$descpT); $row+=3; foreach ($arrT as $tx){ $pdf->Text(30,$row,$tx); $row+=3; } $row+=2; } else { $row+=4; }*/ //} //CALCULAR EL IVA Y EL SUBTOTAL MANUALMENTE. //$totalG=$totalG+$importeT; $tlIva = $tlIva + $iva; } /* //VER IMPRESOS LOS CONTENEDORES CAPTURADOS. $sql="select f.id_msc_bl_conte as id_msc_bl_conte, f.id_bl_conte as id_bl_conte "; $sql.="from FT_TMA_BL_CONTE f, BL_CONTE b, EXPO e "; $sql.="where f.id_bl_conte=b.id_bl_conte and b.id_bl=e.Id_expo and f.id_factura='$idFactura' order by e.Bl "; $db->query($sql); while( $db->next_record() ){ $idFBlConte= $db->f(id_msc_bl_conte); $idBlConte= $db->f(id_bl_conte); $idBl= getValueTable("id_bl","BL_CONTE","id_bl_conte",$idBlConte); $idConte= getValueTable("id_contenedor","BL_CONTE","id_bl_conte",$idBlConte); $idTipo= getValueTable("id_equipo","CONTENEDOR","id_contenedor",$idConte); $bl = getValueTable("Bl","EXPO","Id_expo",$idBl); $conte = getValueTable("numero","CONTENEDOR","Id_contenedor",$idConte); $tipo = getValueTable("equipo","EQUIPO","Id_equipo",$idTipo); $blConteTipo.="[".$bl."/".$conte."-".$tipo."]"; } $descp=$blConteTipo; $caddes = strlen($descp); $inid=0; $find=60; //$posd=175; //$pos=0; $row+=4; while ($caddes > 0) { $datad[]=substr($descp,$inid,$find); $inid=$inid+60; $find=$find; $caddes=$caddes-60; //$pdf->Text(90,$s,$description); //$s=$s+3; foreach ( $datad as $line ) { $pdf->SetFont('Courier','B',8); $pdf->Text(20,$row,$line); $row=$row+3; unset($datad); } } //LEYENDA OBLIGATORIA EN LA FACTURA $pdf->SetFont('Courier','B',10); $pdf->Text(15,232,"EL PAGO DE ESTA FACTURA SE HACE EN UNA SOLA EXHIBICION"); //VER No CARACTERES Y SEPARAR LA CADENA DE 90 EN 90 PARA DESCRIPTION /* $descp = getValueTable("descp","FT_TMA","id_factura",$idFactura); $caddes = strlen($descp); $inid=0; $find=90; //$posd=175; //$pos=0; $row+=3; while ($caddes > 0) { $datad[]=substr($descp,$inid,$find); $inid=$inid+90; $find=$find; $caddes=$caddes-90; //$pdf->Text(90,$s,$description); //$s=$s+3; foreach ( $datad as $line ) { $pdf->Text(13,$row,$line); $row=$row+2; unset($datad); } }*/ //Total,Iva,Subtotal //$totalG=number_format($totalG,2); $totalT = $totalG + $tlIva; //$totalT=number_format($totalT,2); /*$totalT= getValueTable("total","FT_TMA","id_factura",$idFactura); $totalG= getValueTable("subtotal","FT_TMA","id_factura",$idFactura); $tlIva= getValueTable("iva","FT_TMA","id_factura",$idFactura);*/ $totalT2 = str_replace(",", "", $totalT); if (preg_match("/^(\\d+)\\.{0,2}/", $totalT2, $part)) { $importeInt = $part[1]; } $importeLetra = traducirCifra($importeInt); //( ereg( "\.([0-9]+)", $totalT2, $regs ) )?$centavos=$regs[1]:$centavos="00"; if (preg_match("/\\.([0-9]+)/", $totalT2, $regs)) { $centavos = $regs[1]; } else { $centavos = "00"; } //( ereg( "\.([0-9]+{2})", $totalT2, $regs ) )?$centavos=$regs[1]:$centavos="00"; $nameMoneda = getValueTable("moneda", "INFO", "id_info", 1); $nameMoneda = strtoupper($nameMoneda); if ($moneda == "2") { $txtImporte = "{$importeLetra} {$nameMoneda} {$centavos}/100 M.N."; } elseif ($moneda == "1") { $txtImporte = "{$importeLetra} DOLARES {$centavos}/100 CTS"; } $pdf->SetFont('Arial', 'B', 10); //Imprimir Total $longSub = strlen($totalG); //$pdf->Text(170,215,$longSub); $rowImp = 245; switch ($longSub) { case "1": $pdf->Text(155, $rowImp, "SUBTOTAL:"); $totalG = number_format($totalG, 2); $pdf->Text(183, $rowImp, $totalG); break; case "2": $pdf->Text(155, $rowImp, "SUBTOTAL:"); $totalG = number_format($totalG, 2); $pdf->Text(186, $rowImp, $totalG); break; case "3": $pdf->Text(155, $rowImp, "SUBTOTAL:"); $totalG = number_format($totalG, 2); $pdf->Text(183, $rowImp, $totalG); break; case "4": $pdf->Text(155, $rowImp, "SUBTOTAL:"); $totalG = number_format($totalG, 2); $pdf->Text(183, $rowImp, $totalG); //179.9 break; case "5": $pdf->Text(155, $rowImp, "SUBTOTAL:"); $totalG = number_format($totalG, 2); $pdf->Text(175.9, $rowImp, $totalG); break; case "6": $pdf->Text(155, $rowImp, "SUBTOTAL:"); $totalG = number_format($totalG, 2); $pdf->Text(181.7, $rowImp, $totalG); //181.7 break; case "7": $pdf->Text(155, $rowImp, "SUBTOTAL:"); $totalG = number_format($totalG, 2); $pdf->Text(182.5, $rowImp, $totalG); //177.5 break; case "8": $pdf->Text(155, $rowImp, "SUBTOTAL:"); $totalG = number_format($totalG, 2); $pdf->Text(175.4, $rowImp, $totalG); break; case "9": $pdf->Text(155, $rowImp, "SUBTOTAL:"); $totalT = number_format($totalT, 2); $pdf->Text(171.4, $rowImp, $totalG); break; case "10": $pdf->Text(155, $rowImp, "SUBTOTAL:"); $totalT = number_format($totalT, 2); $pdf->Text(170.4, $rowImp, $totalG); break; } // Imprimir Iva $longIva = strlen($tlIva); $rowImpX = 255; switch ($longIva) { case "1": $pdf->Text(155, $rowImpX, "IVA:"); $tlIva = number_format($tlIva, 2); $pdf->Text(184, $rowImpX, $tlIva); break; case "2": $pdf->Text(155, $rowImpX, "IVA:"); $tlIva = number_format($tlIva, 2); $pdf->Text(185, $rowImpX, $tlIva); break; case "3": $pdf->Text(155, $rowImpX, "IVA:"); $tlIva = number_format($tlIva, 2); $pdf->Text(186, $rowImpX, $tlIva); break; case "4": $pdf->Text(155, $rowImpX, "IVA:"); $tlIva = number_format($tlIva, 2); $pdf->Text(186, $rowImpX, $tlIva); break; case "5": $pdf->Text(155, $rowImpX, "IVA:"); $tlIva = number_format($tlIva, 2); $pdf->Text(183.9, $rowImpX, $tlIva); break; case "6": $pdf->Text(155, $rowImpX, "IVA:"); $tlIva = number_format($tlIva, 2); $pdf->Text(185.7, $rowImpX, $tlIva); break; case "7": $pdf->Text(155, $rowImpX, "IVA:"); $tlIva = number_format($tlIva, 2); $pdf->Text(177.5, $rowImpX, $tlIva); break; case "8": $tlIva = number_format($tlIva, 2); $pdf->Text(175.4, $rowImpX, $tlIva); break; case "9": //$pdf->Text(155,$row,"TOTAL : "); $pdf->Text(155, $rowImpX, "IVA:"); $tlIva = number_format($tlIva, 2); $pdf->Text(171.4, $rowImpX, $tlIva); break; case "10": //$pdf->Text(155,$row,"TOTAL : "); $pdf->Text(155, $rowImpX, "IVA:"); $tlIva = number_format($tlIva, 2); $pdf->Text(170.4, $rowImpX, $tlIva); break; } //Imprimir Total $longT = strlen($totalT); $rowImpY = 265; switch ($longT) { case "1": $pdf->Text(155, $rowImpY, "TOTAL : "); $totalT = number_format($totalT2, 2); $pdf->Text(183, $rowImpY, $totalT); break; case "2": $pdf->Text(155, $rowImpY, "TOTAL : "); $totalT = number_format($totalT2, 2); $pdf->Text(183, $rowImpY, $totalT); break; case "3": $pdf->Text(155, $rowImpY, "TOTAL : "); $totalT = number_format($totalT2, 2); $pdf->Text(183, $rowImpY, $totalT); break; case "4": $pdf->Text(155, $rowImpY, "TOTAL : "); $totalT = number_format($totalT2, 2); $pdf->Text(183, $rowImpY, $totalT); //183 break; case "5": $pdf->Text(155, $rowImpY, "TOTAL : "); $totalT = number_format($totalT2, 2); $pdf->Text(183.9, $rowImpY, $totalT); //180.9 break; case "6": $pdf->Text(155, $rowImpY, "TOTAL : "); $totalT = number_format($totalT2, 2); $pdf->Text(181.7, $rowImpY, $totalT); //178.7 break; case "7": $pdf->Text(155, $rowImpY, "TOTAL : "); $totalT = number_format($totalT2, 2); $pdf->Text(177.5, $rowImpY, $totalT); //174.5 break; case "8": $pdf->Text(155, $rowImpY, "TOTAL : "); $totalT = number_format($totalT2, 2); $pdf->Text(175.4, $rowImpY, $totalT); //172.4 break; case "9": $pdf->Text(155, $rowImpY, "TOTAL : "); $totalT = number_format($totalT2, 2); $pdf->Text(171.4, $rowImpY, $totalT); //171.4 break; case "10": $pdf->Text(155, $rowImpY, "TOTAL : "); $totalT = number_format($totalT2, 2); $pdf->Text(171.4, $rowImpY, $totalT); //170.4 break; } $pdf->SetFont('Arial', 'B', 10); $pdf->Text(25, 290, $txtImporte); //LEYENDA OBLIGATORIA EN LA FACTURA $pdf->SetFont('Courier', 'B', 10); $pdf->Text(15, 232, "EL PAGO DE ESTA FACTURA SE HACE EN UNA SOLA EXHIBICION"); //------------------------------------------ //SACAMOS LA INFORMACION DE LOS CONTENEDORES //------------------------------------------ $numContes = 0; $sql = "select f.id_msc_bl_conte as id_msc_bl_conte, f.id_bl_conte as id_bl_conte "; $sql .= "from FT_TMA_BL_CONTE f, BL_CONTE b, EXPO e "; $sql .= "where f.id_bl_conte=b.id_bl_conte and b.id_bl=e.Id_expo and f.id_factura='{$idFactura}' order by e.Bl "; $db->query($sql); while ($db->next_record()) { //NUMERO DE CONTENEDORES PARA IMPRIMIR $numContes = $numContes + 1; $idFBlConte = $db->f(id_msc_bl_conte); $idBlConte = $db->f(id_bl_conte); $idBl = getValueTable("id_bl", "BL_CONTE", "id_bl_conte", $idBlConte); $idConte = getValueTable("id_contenedor", "BL_CONTE", "id_bl_conte", $idBlConte); $idTipo = getValueTable("id_equipo", "CONTENEDOR", "id_contenedor", $idConte); $bl = getValueTable("Bl", "EXPO", "Id_expo", $idBl); $conte = getValueTable("numero", "CONTENEDOR", "Id_contenedor", $idConte); $tipo = getValueTable("equipo", "EQUIPO", "Id_equipo", $idTipo); $blConteTipo .= "[" . $bl . "|" . $conte . "|" . $tipo . "]"; $blsS = $blsS . "," . $bl; $conteS = $conteS . "," . $conte; } $numContesLine = $numContes / 4; $numLine = $row + $numContesLine; //---------------------------------------------------- //PREGUNTAMOS SI NO SE REQUIERE UN ARCHIVO ANEXO ENTRA //---------------------------------------------------- //$anexo=1; if ($anexo == 0) { if ($numLine <= 220) { //$descp=$blConteTipo; $descp = "Bls: {$blsS} // Conte: {$conteS}"; $caddes = strlen($descp); $inid = 0; $find = 72; //$posd=175; //$pos=0; $row += 3; $rowPdf2 = 10; $flgPdf2 = 0; while ($caddes > 0) { if ($flgPdf2 == 0) { $datad[] = substr($descp, $inid, $find); $inid = $inid + 72; $find = $find; $caddes = $caddes - 72; } } if (!empty($datad)) { foreach ($datad as $line) { $pdf->SetFont('Courier', 'B', 7); $pdf->Text(15, $row, $line); $row = $row + 3; unset($datad); } } } else { //---------------------------- //CONTENEDORES EN LA HOJA No 2 //---------------------------- // ENCABEZADO $pdf->SetFont('Courier', 'B', 12); $row = $row + 10; $pdf->Text(15, $row, "{$numContes} CONTENEDORES SEGUN RELACION ANEXA"); $pdf->AddPage(); $pdf->Image('../images/msc.jpg', 8, 1, 15); $pdf->Image('../images/mscblackF.jpg', 25, 80, 150); $pdf->SetFont('Courier', 'B', 10); $pdf->Text(75, 12, "ANEXO DE CONTENEDORES"); $pdf->SetFont('Arial', 'B', 12); $pdf->Text(35, 7, "MEDITERRANEAN SHIPPING COMPANY MEXICO, S.A. DE C.V."); $numFactura = getValueTable("folio", "FT_TMA", "id_factura", $idFactura); $pdf->SetFont('Arial', 'B', 9); $pdf->Text(165, 12, "FACTURA : {$numFactura}"); //LINEA HORIZONTAL $pdf->SetLineWidth(0.5); $pdf->Line(5, 17, 205, 17); $pdf->SetLineWidth(0.5); $pdf->Line(5, 2, 205, 2); $pdf->SetLineWidth(0.5); $pdf->Line(5, 295, 205, 295); //LINEA VERTICAL $pdf->SetLineWidth(0.5); $pdf->Line(5, 2, 5, 295); $pdf->SetLineWidth(0.5); $pdf->Line(205.5, 2, 205.5, 295); $numeroAnexos = $numeroAnexos - 1; //----------------------------- $rowPdf2 = 20; //MANDAMOS A IMPRESION LOS NUMEROS DE CONTENEDORES EN EL PDF2 //$descp=$blConteTipo; $desc = "Bls : {$blsS} // Conte: {$conteS}"; $caddes = strlen($descp); $inid = 0; $find = 126; //$posd=175; //$pos=0; $row += 4; //$rowPdf2=10; //$flgPdf2=0; while ($caddes > 0) { $datad[] = substr($descp, $inid, $find); $inid = $inid + 126; $find = $find; $caddes = $caddes - 126; $linePdf2 = $linePdf2 + 1; } //AGREGAR LAS HOJAS QUE SEAN NECESARIAS PARA IMPRIMIR TODOS LOS CONTENEDORES if (!empty($datad)) { foreach ($datad as $line) { $conta = $conta + 1; $contaLine = $contaLine + 1; $pdf->SetFont('Courier', 'B', 7); $pdf->Text(5, $rowPdf2, $contaLine); $pdf->Text(10, $rowPdf2, $line); $rowPdf2 = $rowPdf2 + 3; unset($datad); if ($conta == 92) { $conta = ""; // ENCABEZADO $pdf->AddPage(); $pdf->Image('../images/msc.jpg', 8, 1, 15); $pdf->Image('../images/mscblackF.jpg', 25, 80, 150); $pdf->SetFont('Courier', 'B', 10); $pdf->Text(75, 12, "ANEXO DE CONTENEDORES"); $pdf->SetFont('Arial', 'B', 12); $pdf->Text(35, 7, "MEDITERRANEAN SHIPPING COMPANY MEXICO, S.A. DE C.V."); $pdf->SetFont('Arial', 'B', 9); $pdf->Text(165, 12, "FACTURA : {$numFactura}"); //LINEA HORIZONTAL $pdf->SetLineWidth(0.5); $pdf->Line(5, 17, 205, 17); $pdf->SetLineWidth(0.5); $pdf->Line(5, 2, 205, 2); $pdf->SetLineWidth(0.5); $pdf->Line(5, 295, 205, 295); //LINEA VERTICAL $pdf->SetLineWidth(0.5); $pdf->Line(5, 2, 5, 295); $pdf->SetLineWidth(0.5); $pdf->Line(205.5, 2, 205.5, 295); $rowPdf2 = 20; } } } } } else { //---------------------------- //CONTENEDORES EN LA HOJA No 2 //---------------------------- // ENCABEZADO $pdf->SetFont('Courier', 'B', 12); $row = $row + 10; $pdf->Text(15, $row, "{$numContes} CONTENEDORES SEGUN RELACION ANEXA"); $pdf->AddPage(); $pdf->Image('../images/msc.jpg', 8, 1, 15); $pdf->Image('../images/mscblackF.jpg', 25, 80, 150); $pdf->SetFont('Courier', 'B', 10); $pdf->Text(75, 12, "ANEXO DE CONTENEDORES"); $pdf->SetFont('Arial', 'B', 12); $pdf->Text(35, 7, "MEDITERRANEAN SHIPPING COMPANY MEXICO, S.A. DE C.V."); $numFactura = getValueTable("folio", "FT_TMA", "id_factura", $idFactura); $pdf->SetFont('Arial', 'B', 9); $pdf->Text(165, 12, "FACTURA : {$numFactura}"); //LINEA HORIZONTAL $pdf->SetLineWidth(0.5); $pdf->Line(5, 17, 205, 17); $pdf->SetLineWidth(0.5); $pdf->Line(5, 2, 205, 2); $pdf->SetLineWidth(0.5); $pdf->Line(5, 295, 205, 295); //LINEA VERTICAL $pdf->SetLineWidth(0.5); $pdf->Line(5, 2, 5, 295); $pdf->SetLineWidth(0.5); $pdf->Line(205.5, 2, 205.5, 295); $numeroAnexos = $numeroAnexos - 1; //----------------------------- $rowPdf2 = 20; //MANDAMOS A IMPRESION LOS NUMEROS DE CONTENEDORES EN EL PDF2 $descp = $blConteTipo; $caddes = strlen($descp); $inid = 0; $find = 126; //$posd=175; //$pos=0; $row += 4; //$rowPdf2=10; //$flgPdf2=0; while ($caddes > 0) { $datad[] = substr($descp, $inid, $find); $inid = $inid + 126; $find = $find; $caddes = $caddes - 126; $linePdf2 = $linePdf2 + 1; } //AGREGAR LAS HOJAS QUE SEAN NECESARIAS PARA IMPRIMIR TODOS LOS CONTENEDORES foreach ($datad as $line) { $conta = $conta + 1; $contaLine = $contaLine + 1; $pdf->SetFont('Courier', 'B', 7); $pdf->Text(5, $rowPdf2, $contaLine); $pdf->Text(10, $rowPdf2, $line); $rowPdf2 = $rowPdf2 + 3; unset($datad); if ($conta == 92) { $conta = ""; // ENCABEZADO $pdf->AddPage(); $pdf->Image('../images/msc.jpg', 8, 1, 15); $pdf->Image('../images/mscblackF.jpg', 25, 80, 150); $pdf->SetFont('Courier', 'B', 10); $pdf->Text(75, 12, "ANEXO DE CONTENEDORES"); $pdf->SetFont('Arial', 'B', 12); $pdf->Text(35, 7, "MEDITERRANEAN SHIPPING COMPANY MEXICO, S.A. DE C.V."); $pdf->SetFont('Arial', 'B', 9); $pdf->Text(165, 12, "FACTURA : {$numFactura}"); //LINEA HORIZONTAL $pdf->SetLineWidth(0.5); $pdf->Line(5, 17, 205, 17); $pdf->SetLineWidth(0.5); $pdf->Line(5, 2, 205, 2); $pdf->SetLineWidth(0.5); $pdf->Line(5, 295, 205, 295); //LINEA VERTICAL $pdf->SetLineWidth(0.5); $pdf->Line(5, 2, 5, 295); $pdf->SetLineWidth(0.5); $pdf->Line(205.5, 2, 205.5, 295); $rowPdf2 = 20; } } } $pdf->Output(); }
$pdf->setfont('arial', 'B', 10); $pdf->multicell(0, 4, 'ISSQN COM RETENÇÃO NA FONTE', 0, "C", 0); $pdf->ln(5); $altura = 6; $pdf->setfont('arial', 'B', 8); $pdf->cell(130, $altura, 'TOMADOR DO SERVIÇO', 1, 0, "C", 0); $pdf->cell(60, $altura, 'DADOS DA PLANILHA', 1, 1, "C", 0); $pdf->setfont('arial', '', 8); $pdf->cell(130, $altura, 'NOME : ' . strtoupper($z01_nome), 1, 0, "L", 0); $pdf->cell(60, $altura, 'CODIGO : ' . db_formatar($planilha, 's', '0', 4, 'e'), 1, 1, "L", 0); $pdf->cell(130, $altura, 'INSCRIÇÃO : ' . $q20_inscr, 1, 0, "L", 0); $pdf->cell(60, $altura, 'COMPETÊNCIA : ' . db_formatar($q20_mes, 's', '0', 2, 'e') . '/' . $q20_ano, 1, 1, "L", 0); $pdf->multicell(190, $altura, 'OBSERVAÇÃO : Os valores registrados nesta planilha somente serão considerados após o pagamento desta guia.', 1, "L", 0); $linha = 65; for ($i = 0; $i < 2; $i++) { $pdf->SetLineWidth(0.05); //$pdf->SetDash(1,1); $pdf->Line(5, $linha - 2, 205, $linha - 2); // linha tracejada horizontal //$pdf->SetDash(); $pdf->Line(47, $linha, 47, $linha + 9); $pdf->Line(63, $linha, 63, $linha + 9); $pdf->SetLineWidth(0.6); $pdf->Line(10, $linha + 9, 195, $linha + 9); $pdf->SetLineWidth(0.2); $pdf->Line(10, $linha + 17, 195, $linha + 17); $pdf->Line(10, $linha + 25, 195, $linha + 25); $pdf->Line(10, $linha + 33, 195, $linha + 33); $pdf->Line(10, $linha + 41, 195, $linha + 41); $pdf->Line(149, $linha + 49, 195, $linha + 49); $pdf->Line(149, $linha + 57, 195, $linha + 57);
} } } $imgo = $map->drawlegend(); $nomer = $imgo->imagepath . "leg" . $nomeImagem . ".PNG"; $imgo->saveImage($nomer); $pathlegenda = $dir_tmp . "/" . basename($imgo->imageurl) . "/" . basename($nomer); $titulo = $_GET['titulo']; substituiCon($map_file, $postgis_mapa); require dirname(__FILE__) . '/../../pacotes/fpdf/fpdf.php'; $pdf = new FPDF("L", "mm", "A4"); $pdf->SetAutoPageBreak(false); $pdf->SetDisplayMode(70, "single"); $pdf->SetMargins(0, 0, 0); $pdf->AddPage("L"); $pdf->SetLineWidth(0.6); $wMapaMax = 222; $hMapaMax = 171; $mapasize = getimagesize($pathMapa); $wMapa = $mapasize[0]; $hMapa = $mapasize[1]; if ($wMapa / $wMapaMax > $hMapa / $hMapaMax) { $nW = $wMapaMax; $nH = $hMapa * $nW / $wMapa; } else { $nH = $hMapaMax; $nW = $wMapa * $nH / $hMapa; } $pdf->Rect(3, 3, $nW + 69, 14, 'D'); //Título $pdf->SetFont('Arial', 'B', 18);
} include ("./fpdf/fpdf.php"); $pdf = new FPDF ( 'P', 'mm', 'A4' ); $pdf->SetMargins ( 1, 1, 1 ); $pdf->Open (); $pdf->AddPage (); $pdf->Image ( "imagenes/formato.jpg", 1, 1, 202 ); $pdf->SetFillColor ( 255, 255, 255 ); $pdf->SetTextColor ( 0 ); $pdf->SetDrawColor ( 0, 0, 0 ); $pdf->SetLineWidth ( .2 ); $pdf->SetFont ( 'Arial', 'B', 9 ); $pdf->Text ( 30, 43, $ren ["rfc"] ); $pdf->Text ( 88, 43, $ren ["curp"] ); $pdf->Text ( 174, 41, campo ( $ren ["folio"], 10, 2 ) ); $pdf->SetFont ( 'Arial', 'B', 8 ); $sql = "select upp as cveupp, razonsocial as upp, titular from empresa limit 1"; $res_emp = mysqli_query ( $conexion, $sql ); $ren_emp = mysqli_fetch_array ( $res_emp ); $titularupp = $ren_emp ["titular"]; $pdf->Text ( 17, 56, $ren_emp ["upp"] );
/** * Generate one PDF page with the parsed elements * @author Pablo Dall'Oglio */ public function generate() { $this->AddPage($this->orientation, $this->format); $style = ''; foreach ($this->elements as $element) { if (isset($element['class'])) { switch ($element['class']) { case 'Rectangle': if ($element['shadowoffset'] > 0) { $this->setFillColorRGB($element['shadowcolor']); $this->Rect($element['x'] + $element['shadowoffset'], $element['y'] + $element['shadowoffset'], $element['width'], $element['height'], 'F'); } parent::SetLineWidth($element['linewidth']); $this->setDrawColorRGB($element['linecolor']); $this->setFillColorRGB($element['fillcolor']); $mode = $element['linewidth'] > 0 ? 'FD' : 'F'; parent::Rect($element['x'], $element['y'], $element['width'], $element['height'], $mode); break; case 'Ellipse': $x = $element['x'] + $element['width'] / 2; $y = $element['y'] + $element['height'] / 2; if ($element['shadowoffset'] > 0) { $fillc = $this->rgb2int255($element['shadowcolor']); parent::SetFillColor($fillc[0], $fillc[1], $fillc[2]); $this->ellipse($x + $element['shadowoffset'], $y + $element['shadowoffset'], $element['width'] / 2, $element['height'] / 2, 'F'); } $mode = $element['linewidth'] > 0 ? 'FD' : 'F'; parent::SetLineWidth($element['linewidth']); $this->setDrawColorRGB($element['linecolor']); $this->setFillColorRGB($element['fillcolor']); $this->ellipse($x, $y, $element['width'] / 2, $element['height'] / 2, $mode); break; case 'Text': $height_factor['Courier'] = 0.335; $height_factor['Arial'] = 0.39; $height_factor['Times'] = 0.42; $text = str_replace(array_keys($this->replaces), array_values($this->replaces), $element['text']); $x = $element['x'] - 2; $y = $element['y'] + $element['size'] * $height_factor[$element['font']] - 30 * (1 / $element['size']); if ($element['shadowoffset'] > 0) { $this->setFontColorRGB($element['shadowcolor']); parent::SetFont($element['font'], $style, $element['size']); $this->writeHTML($x + $element['shadowoffset'], $y + $element['shadowoffset'], $text); } parent::SetFont($element['font'], $style, $element['size']); $this->setFontColorRGB($element['color']); $this->writeHTML($x, $y, $text); break; case 'Line': parent::SetLineWidth($element['linewidth']); $this->setDrawColorRGB($element['linecolor']); parent::Line($element['x'], $element['y'], $element['x2'], $element['y2']); break; case 'Image': if (file_exists($element['file'])) { parent::Image($element['file'], $element['x'], $element['y'], $element['width'], $element['height']); } break; } } } }
$row11 = $resulta[10]; $column_code1 = $column_code1.$row1."\n"; $column_code2 = $column_code2.$row2."\n"; $column_code3 = $column_code3.$row3."\n"; $column_code4 = $column_code4.$row4."\n"; $column_code5 = $column_code5.$row5."\n"; $column_code6 = $column_code6.$row6."\n"; $column_code7 = $column_code7.$row7."\n"; $column_code8 = $column_code8.$row8."\n"; $column_code9 = $column_code9.$row9."\n"; $column_code10 = $column_code10.$row10."\n"; $column_code11 = $column_code11.$row11."\n"; } */ $pdf->SetLineWidth(2); $pdf->Line(0, 45, 360, 45); $pdf->SetLineWidth(0); $pdf->Cell(270, 5, '', 0, 1, 'C'); $pdf->Cell(270, 5, '', 0, 1, 'C'); $Y_Label_position = 50; $Y_Table_Position = 55; $pdf->SetFont('Arial', 'B', 8); $pdf->SetY($Y_Label_position); $pdf->SetX(5); $pdf->Cell(15, 5, 'AMOUNT PAID', 1, 0, 'C'); $pdf->SetX(20); $pdf->Cell(50, 5, 'DATE', 1, 0, 'C'); $pdf->SetX(70); $pdf->Cell(50, 5, 'O.R. NUMBER', 1, 0, 'C'); $pdf->SetX(120);
$pdf->Ln(); } // Zeilenumbrüche einfügen $pdf->Ln(); $pdf->Ln(); // Schriftgrad einstellen $pdf->SetFont('Arial', 'B', 10); $pdf->Cell(20, 6, utf8_decode('MwSt-Satz'), 0, 0, 'R'); $pdf->Cell(15, 6, utf8_decode('Flüge'), 0, 0, 'C'); $pdf->Cell(27, 6, utf8_decode('Ges.-Umsatz'), 0, 0, 'R'); // Zeilenumbruch einfügen $pdf->Ln(); // vertikale Y-Position ermitteln $y = $pdf->getY(); // Linienbreite einstellen, 0.2 mm $pdf->SetLineWidth(0.2); // Linie(n) zeichnen $pdf->Line(25, $y, 90, $y); // Schriftgrad einstellen $pdf->SetFont('Arial', '', 10); // Variable zur Aufsumierung der Umsätze anlegen $umsatz_ges = 0.0; foreach ($umsaetze['gesamtumsatz'] as $key => $val) { $pdf->Cell(20, 6, sprintf('%s %%', number_format($key, 2, ',', '')), 0, 0, 'R'); $pdf->Cell(15, 6, $val['fluege'], 0, 0, 'C'); $pdf->Cell(27, 6, sprintf('%s EUR', number_format($val['summe'], 2, ',', '')), 0, 0, 'R'); // Umsatz aufsumieren $umsatz_ges += $val['summe']; // Zeilenumbruch einfügen $pdf->Ln(); }
$pdf->AliasNbPages(); //Primera página $pdf->AddPage(); $id_ticket = $_GET['id_ticket']; // Imagen de encabezado $pdf->Image("./images/banner4.jpg", 10, 0, 180, 40, "JPG", ""); // Titulo del Reporte $pdf->SetFont('Arial', 'B', 20); $pdf->SetY(45); $pdf->Cell(50, 10, 'Detalle del Ticket No. ' . $id_ticket); // Configuracion de colores $pdf->SetY(60); $pdf->SetFillColor(224, 235, 255); $pdf->SetTextColor(0); $pdf->SetDrawColor(128, 0, 0); $pdf->SetLineWidth(0.3); $pdf->SetFont('', 'B'); if ($result = $obj_modelo->GetDetalleTicket($id_ticket)) { if ($obj_conexion->GetNumberRows($result) > 0) { // Establecemos la cabecera de la tabla $pdf->SetFont('Arial', 'B', 10); $pdf->SetTextColor(128, 0, 0); $pdf->Cell(20, 7, 'Numero', 1, 0, 'C', true); $pdf->Cell(40, 7, 'Sorteo', 1, 0, 'C', true); //$pdf->Cell(30,7,'Hora Sorteo',1,0,'C',true); $pdf->Cell(30, 7, 'Signo', 1, 0, 'C', true); $pdf->Cell(30, 7, 'Monto', 1, 0, 'C', true); $pdf->Cell(40, 7, 'Apuesta Ganadora', 1, 0, 'C', true); $pdf->SetFont('Arial', '', 8); while ($row = $obj_conexion->GetArrayInfo($result)) { if ($row['monto'] != 0) {
{ $pdf->Text(109, 55,($ident_ville)); } else { $pdf->Text(109, 50,($ident_ville)); } if ($choix=="rappel") { $pdf->SetFont('DejaVu','B',24); $pdf->SetTextColor(190, 190, 190); $pdf->Text(65, 50,'RAPPEL'); $pdf->SetTextColor(0, 0, 0); } $pdf->SetFont('DejaVu','B',18); $pdf->Text(39, 75,'LETTRE D\'INFORMATION AUX FAMILLES'); $pdf->SetLineWidth(0,2); $pdf->SetDrawColor(0, 0, 0); $pdf->Rect(30, 67.5, 145, 10, 'D'); $pdf->SetFont('DejaVu','',12); $pdf->Text(20, 90,'Madame, Monsieur,'); $ident = "A notre connaissance, l'élève ".$nom_eleve[$i]." ".$prenom_eleve[$i]." de la classe de ".$division[$i].","; $pdf->Text(20, 100, ($ident)); $pdf->Text(20, 110,('n\'a pas assisté au(x) cours suivant(s)')); //tableau $pdf->SetX(30); $pdf->SetY(120); $pdf->SetFont('DejaVu','',9.5); $pdf->Cell(55, 5, 'Du', 1, 0, '', ''); $pdf->Cell(55, 5, 'Au', 1, 0, '', ''); $pdf->Cell(22, 5, 'Type', 1, 0, 'C', '');