Exemplo n.º 1
12
function generarPdf($num)
{
    $pdf = new FPDF('P');
    $pdf->AddPage();
    $pdf->Image('../../../public_html/imagenes/logoclaro.png', 40, 50, 120);
    $pdf->SetTitle("Notificación al denunciante", true);
    $pdf->Image('../../../public_html/imagenes/logoivss.png', 20, 7, 13);
    $pdf->SetFont('Arial', '', 6);
    //$pdf->Text(40,10,utf8_decode('hola'));
    //$nombre = "Prob".date('m-d-Y').".pdf";
    $pdf->Output("Prob{$num}.pdf", 'F');
}
Exemplo n.º 2
3
 function export_order($id)
 {
     global $FANNIE_OP_DB, $FANNIE_ROOT;
     $dbc = FannieDB::get($FANNIE_OP_DB);
     $order = new PurchaseOrderModel($dbc);
     $order->orderID($id);
     $order->load();
     $items = new PurchaseOrderItemsModel($dbc);
     $items->orderID($id);
     $vendor = new VendorsModel($dbc);
     $vendor->vendorID($order->vendorID());
     $vendor->load();
     $contact = new VendorContactModel($dbc);
     $contact->vendorID($order->vendorID());
     $contact->load();
     if (!class_exists('FPDF')) {
         include_once $FANNIE_ROOT . 'src/fpdf/fpdf.php';
     }
     $pdf = new FPDF('P', 'mm', 'Letter');
     $pdf->AddPage();
     $pdf->SetFont('Arial', '', '12');
     $pdf->Cell(100, 5, 'Vendor: ' . $vendor->vendorName(), 0, 0);
     $pdf->Cell(100, 5, 'Date: ' . date('Y-m-d'), 0, 0);
     $pdf->Ln();
     $pdf->Cell(100, 5, 'Phone: ' . $contact->phone(), 0, 0);
     $pdf->Cell(100, 5, 'Fax: ' . $contact->fax(), 0, 0);
     $pdf->Ln();
     $pdf->Cell(100, 5, 'Email: ' . $contact->email(), 0, 0);
     $pdf->Cell(100, 5, 'Website: ' . $contact->website(), 0, 0);
     $pdf->Ln();
     $pdf->MultiCell(0, 5, "Ordering Info:\n" . $contact->notes(), 'B');
     $pdf->Ln();
     $cur_page = 0;
     $pdf->SetFontSize(10);
     foreach ($items->find() as $obj) {
         if ($cur_page != $pdf->PageNo()) {
             $cur_page = $pdf->PageNo();
             $pdf->Cell(25, 5, 'SKU', 0, 0);
             $pdf->Cell(20, 5, 'Order Qty', 0, 0);
             $pdf->Cell(30, 5, 'Brand', 0, 0);
             $pdf->Cell(65, 5, 'Description', 0, 0);
             $pdf->Cell(20, 5, 'Case Size', 0, 0);
             $pdf->Cell(20, 5, 'Est. Cost', 0, 0);
             $pdf->Ln();
         }
         $pdf->Cell(25, 5, $obj->sku(), 0, 0);
         $pdf->Cell(20, 5, $obj->quantity(), 0, 0, 'C');
         $pdf->Cell(30, 5, $obj->brand(), 0, 0);
         $pdf->Cell(65, 5, $obj->description(), 0, 0);
         $pdf->Cell(20, 5, $obj->caseSize(), 0, 0, 'C');
         $pdf->Cell(20, 5, sprintf('%.2f', $obj->caseSize() * $obj->unitCost() * $obj->quantity()), 0, 0);
         $pdf->Ln();
     }
     $pdf->Output('order_export.pdf', 'D');
 }
Exemplo n.º 3
3
 public function drawPDF()
 {
     $pdf = new \FPDF('L', 'mm', 'Letter');
     $pdf->SetMargins(3.175, 3.175, 3.175);
     $pdf->SetAutoPageBreak(false);
     if (\COREPOS\Fannie\API\FanniePlugin::isEnabled('CoopDealsSigns')) {
         $this->font = 'Gill';
         $this->alt_font = 'GillBook';
         define('FPDF_FONTPATH', dirname(__FILE__) . '/../../../modules/plugins2.0/CoopDealsSigns/noauto/fonts/');
         $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
     }
     $pdf->SetFont($this->font, '', 16);
     $data = $this->loadItems();
     $width = 136.52;
     $height = 105;
     $top = 90;
     $left = 15;
     $effective_width = $width - 2 * $left;
     foreach ($data as $item) {
         $pdf->AddPage();
         $column = 1;
         // right aligned
         $price = $this->printablePrice($item);
         $pdf->SetXY($left + $width * $column, $top);
         $pdf->SetFontSize($this->SMALL_FONT);
         $pdf->Cell($effective_width, 10, $item['brand'], 0, 1, 'C');
         $pdf->SetX($left + $width * $column);
         $pdf->SetFontSize($this->MED_FONT);
         $pdf->MultiCell($effective_width, 12, $item['description'], 0, 'C');
         $pdf->SetX($left + $width * $column);
         $pdf->SetFontSize($this->BIG_FONT);
         $pdf->Cell($effective_width, 25, $price, 0, 1, 'C');
         $y_pos = $pdf->GetY();
         if ($item['startDate'] != '' && $item['endDate'] != '') {
             // intl would be nice
             $datestr = $this->getDateString($item['startDate'], $item['endDate']);
             $pdf->SetXY($left + $width * $column, $top + ($height - 40));
             $pdf->SetFontSize($this->SMALL_FONT);
             $pdf->Cell($effective_width, 20, $datestr, 0, 1, 'R');
         }
         if ($item['originName'] != '') {
             $pdf->SetXY($left + $width * $column, $y_pos);
             $pdf->SetFontSize($this->SMALL_FONT);
             if (strlen($item['originName']) < 50) {
                 $pdf->Cell($effective_width, 20, $item['originName'], 0, 1, 'L');
             } else {
                 $pdf->Cell($effective_width, 20, $item['originShortName'], 0, 1, 'L');
             }
         }
     }
     $pdf->Output('WfcProdSingle.pdf', 'I');
 }
Exemplo n.º 4
2
 private function generate_pdf($srcText, $dest)
 {
     // Set some document variables
     $author = "";
     $x = 50;
     $text = "<<<EOT" . $srcText . "EOT";
     // Create fpdf object
     $pdf = new FPDF('P', 'pt', 'Letter');
     // Set base font to start
     $pdf->SetFont('Times', 'B', 24);
     // Add a new page to the document
     $pdf->addPage();
     // Set the x,y coordinates of the cursor
     $pdf->SetXY($x, 50);
     // Write 'Simple PDF' with a line height of 1 at the current position
     $pdf->Write(25, 'Simple PDF');
     // Reset the font
     $pdf->SetFont('Courier', 'I', 10);
     // Set the font color
     $pdf->SetTextColor(255, 0, 0);
     // Reset the cursor, write again.
     $pdf->SetXY($x, 75);
     $pdf->Cell(0, 11, "By: {$author}", 'B', 2, 'L', false);
     // Place an image on the pdf document
     //$pdf->Image('graph.jpg', $x, 100, 150, 112.5, 'JPG');
     // Reset font, color, and coordinates
     $pdf->SetFont('Arial', '', 12);
     $pdf->SetTextColor(0, 0, 0);
     $pdf->SetXY($x, 250);
     // Write out a long text blurb.
     $pdf->write(13, $srcText);
     //        echo "<pre>";
     //        print_r($pdf);exit;
     $fileName = substr($dest, 0, strpos($dest, '.')) . "_" . time() . '.pdf';
     $pdf->Output($fileName, 'F');
 }
 /**
  * Performs the raw output of the PDF file
  *
  * @param  FPDF    $newpdf        The PDF object to write to file
  * @param  string  $storage_path  Path to save the file to, or NULL if sending to browser
  * @param  string  $filename      Filename to use if sending the file to the browser (including extension)
  */
 protected function output_pdf_file(&$newpdf, $storage_path, $filename)
 {
     if ($storage_path === NULL) {
         $newpdf->Output($filename, 'I');
     } else {
         $newpdf->Output($storage_path, 'F');
     }
 }
Exemplo n.º 6
1
 function preprocess()
 {
     if (FormLib::get_form_value('start', False) !== False) {
         $pdf = new FPDF('P', 'in', 'Letter');
         $pdf->SetMargins(0.5, 0.5, 0.5);
         $pdf->SetAutoPageBreak(False, 0.5);
         $pdf->AddPage();
         $start = FormLib::get_form_value('start');
         $x = 0.5;
         $y = 0.5;
         $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
         $pdf->SetFont('Gill', '', 16);
         for ($i = 0; $i < 40; $i++) {
             $current = $start + $i;
             $pdf->SetXY($x, $y);
             $pdf->Cell(1.75, 0.5, $current, 0, 0, 'C');
             $pdf->Cell(1.75, 0.5, $current, 0, 0, 'C');
             if ($i % 2 == 0) {
                 $x += 1.75 * 2 + 0.5;
             } else {
                 $x = 0.5;
                 $y += 0.5;
             }
         }
         $pdf->Close();
         $pdf->Output("mem stickers {$start}.pdf", "I");
         return False;
     }
     return True;
 }
Exemplo n.º 7
1
 public static function makePdfFile($filename, $content)
 {
     if (PdfUtils::$imported == FALSE) {
         require_once 'libs/fpdf/fpdf.php';
     }
     PdfUtils::$imported = true;
     $pdf = new FPDF();
     $pdf->AddPage();
     $pdf->SetFont('Arial', 'B', 16);
     //$pdf->Cell(40,10,'Hello World!');
     $pdf->Write(5, $content);
     $pdf->Output($filename, 'F');
 }
Exemplo n.º 8
0
 public function post_id_handler()
 {
     if (!is_array($this->id)) {
         $this->id = array($this->id);
     }
     $today = date("F j, Y");
     $pdf = new FPDF('L', 'in', array(3.5, 5.0));
     $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
     $primary = "";
     $pdf->SetAutoPageBreak(true, 0);
     $pdf->SetFont("Gill", "", 10);
     //Meat of the statement
     foreach ($this->id as $card_no) {
         $account = \COREPOS\Fannie\API\member\MemberREST::get($card_no);
         $pdf->AddPage();
         $pdf->SetXY(3.0, 1.45);
         foreach ($account['customers'] as $c) {
             if ($c['accountHolder']) {
                 $pdf->Cell(2, 0.25, $c['firstName'] . ' ' . $c['lastName'], "", 1, "L");
                 break;
             }
         }
         $pdf->SetX(3.0);
         $pdf->Cell(2, 0.25, $account['addressFirstLine'], "", 1, "L");
         if ($account['addressSecondLine']) {
             $pdf->SetX(3.0);
             $pdf->Cell(2, 0.25, $account['addressSecondLine'], "", 1, "L");
         }
         $pdf->SetX(3.0);
         $str = $account['city'] . ", " . $account['state'] . " " . $account['zip'];
         $pdf->Cell(2, 0.25, $str, "", 1, "L");
     }
     $pdf->Output('member postcards.pdf', 'D');
     return false;
 }
Exemplo n.º 9
0
 function geraEtiquetasPDF($qrcode, $qnt, $nome)
 {
     $pdf = new FPDF("P", "pt", "A4");
     $pdf->AddPage();
     $posY = 3;
     $posX = 5;
     $controle = 0;
     $qntElementos = 1;
     for ($k = 1; $k <= 80; $k += 4) {
         // linha
         for ($j = 1; $j <= 5; $j++) {
             // coluna
             $pdf->Image("../etiquetas/{$qrcode[$controle]}.png", $posX, $posY, 114, 38);
             $controle++;
             $posX += 119;
             if ($qntElementos == $qnt) {
                 $k = 80;
                 $j = 5;
             }
             $qntElementos++;
         }
         if ($posY < 748) {
             $posY += 45;
         }
         $posX = 3;
     }
     $pdf->Output("../relatorios/etiquetas/{$nome}.pdf", "F");
 }
Exemplo n.º 10
0
 public function create_matrix()
 {
     $matrix = array();
     $position = '';
     $pdf = new FPDF();
     $pdf->AddPage();
     $pdf->SetFont('Arial', 'B', 16);
     $pdf->Cell(12, 10, ' ', 1, 0, 'C');
     $pdf->Cell(12, 10, 'A', 1, 0, 'C');
     $pdf->Cell(12, 10, 'B', 1, 0, 'C');
     $pdf->Cell(12, 10, 'C', 1, 0, 'C');
     $pdf->Cell(12, 10, 'D', 1, 0, 'C');
     $pdf->Cell(12, 10, 'E', 1, 0, 'C');
     $pdf->Cell(12, 10, 'F', 1, 0, 'C');
     $pdf->Cell(12, 10, 'G', 1, 0, 'C');
     $pdf->Cell(12, 10, 'H', 1, 0, 'C');
     $pdf->Ln(10);
     for ($i = 1; $i <= $this->rows; $i++) {
         $letra = 'A';
         $pdf->Cell(12, 10, $i, 1, 0, 'C');
         for ($j = 0; $j < $this->cols; $j++) {
             $matrix[$i][$j] = rand($this->min, $this->max);
             $pdf->Cell(12, 10, $matrix[$i][$j], 1, 0, 'C');
             $position .= $letra . $i . '-' . $matrix[$i][$j] . ';';
             ++$letra;
         }
         $pdf->Ln(10);
     }
     $pdf->Output('accessMatrix.pdf', 'D');
     return $position;
 }
Exemplo n.º 11
0
 function pdf()
 {
     $this->load->library('cfpdf');
     $pdf = new FPDF('P', 'mm', 'A4');
     $pdf->AddPage();
     $pdf->SetFont('Arial', 'B', 'L');
     $pdf->Cell(10, 7, 'No', 1, 0);
     $pdf->cell(30, 7, 'Tanggal', 1, 0);
     $pdf->cell(30, 7, 'Operator', 1, 0);
     $pdf->cell(38, 7, 'Total', 1, 1);
     // tampilkan dari database
     $pdf->SetFont('Arial', 'B', 'L');
     $data = $this->model_transaksi->laporan_default();
     $no = 1;
     foreach ($data->result() as $d) {
         $total = 0;
     }
     $pdf->SetFont('Arial', 'B', 'L');
     $pdf->Cell(10, 7, $no, 1, 0);
     $pdf->cell(30, 7, $d->tanggal_transaksi, 1, 0);
     $pdf->cell(30, 7, $d->nama_lengkap, 1, 0);
     $pdf->cell(38, 7, '', 1, 1);
     // end
     $pdf->cell(67, 7, 'total', 1, 0, 'L');
     $pdf->cell(38, 7, '', 1, 0);
     $pdf->Output();
 }
Exemplo n.º 12
0
function generatePDF($print_id, $print_type = 1)
{
    include "config.php";
    require_once 'fpdf/fpdf.php';
    $db = go\DB\DB::create($db_params, 'mysql');
    $db->query('SET CHARACTER SET cp1251');
    $get_print = $db->query('SELECT `finish_number`, `valve_type_id` FROM {numbers} WHERE `print_id`=?', array($_GET['print_id']))->assoc();
    $get_print_info = $db->query('SELECT DISTINCT(`nm`.`order`) as `order`, `us`.`name` as `name`, `nm`.`print_id` as `print_id` FROM {numbers} `nm` LEFT JOIN {users} `us` ON (`nm`.`user_id` = `us`.`id`) WHERE `print_id`=?', array($_GET['print_id']))->row();
    define('FPDF_FONTPATH', 'fpdf/fonts');
    $pdf = new FPDF("L", "mm", array("88", "7"));
    $pdf->AddFont('Arial-BoldMT', 'B', 'arial_bold.php');
    $pdf->SetFont('Arial-BoldMT', 'B', 11);
    $pdf->SetTextColor(0);
    //Add info for this order
    $pdf->AddPage('L');
    $pdf->SetAutoPageBreak(false);
    $pdf->SetXY(0, 0);
    $pdf->Cell(43, 7, $get_print_info['name'], 0, 0, "C", 0);
    $pdf->Cell(4, 7, '', 0, 0, "C", 0);
    $pdf->Cell(43, 7, $get_print_info['order'], 0, 0, "C", 0);
    //End of add
    for ($i = 0; $i < count($get_print); $i++) {
        $pdf->AddPage('L');
        $pdf->SetAutoPageBreak(false);
        $pdf->SetXY(0, 0);
        $pdf->Cell(43, 7, 'Ser.: ' . $get_print[$i]['finish_number'], 0, 0, "C", 0);
        $pdf->Cell(4, 7, '', 0, 0, "C", 0);
        if ($i + $print_type < count($get_print)) {
            $pdf->Cell(43, 7, 'Ser.: ' . $get_print[$i + $print_type]['finish_number'], 0, 0, "C", 0);
        }
        $pdf->SetAutoPageBreak(false);
        $i += $print_type;
    }
    return $pdf->Output($get_print_info['print_id'] . '.pdf', 'I');
}
Exemplo n.º 13
0
 public function Output($name = 'mescontacts.pdf', $dest = 'I')
 {
     Header('Pragma: public');
     error_reporting(0);
     parent::Output($name, $dest);
     error_reporting($this->report);
 }
Exemplo n.º 14
0
function generate_pdf($prenote)
{
    require_once 'fpdf17/fpdf.php';
    $pdf = new FPDF();
    $length = count($prenote->product);
    $pdf->Open();
    $pdf->AddPage('P', array(50, 49 + $length * 8));
    $pdf->SetFont('Arial', '', 9);
    $pdf->Image($prenote->folio . '.png', 3, 2, 35, 15, 'PNG');
    $pdf->Text(7, 20, $prenote->folio);
    $pdf->Text(5, 24, $prenote->clientName);
    $pdf->Text(5, 26, '------------------------------');
    $product = $prenote->product;
    $c = 0;
    for ($i = 0; $i < $length; $i++) {
        $pdf->Text(5, 29 + $c, utf8_decode($product[$i]->Description));
        $pdf->Text(5, 33 + $c, $product[$i]->scanCode);
        $pdf->Text(20, 33 + $c, $product[$i]->Quantity);
        $precio_cantidad = $product[$i]->Quantity * $product[$i]->Price;
        $pdf->Text(28, 33 + $c, '$' . $precio_cantidad);
        $c += 8;
    }
    $c -= 8;
    $pdf->Text(5, 35 + $c, '------------------------------');
    $pdf->Text(25, 38 + $c, $prenote->narticles);
    $pdf->Text(5, 38 + $c, '$' . $prenote->total);
    $pdf->Text(5, 42 + $c, $prenote->id_employee);
    $pdf->Text(10, 42 + $c, $prenote->employeeName);
    $pdf->Text(5, 46 + $c, $prenote->store_id);
    $pdf->Text(10, 46 + $c, $prenote->store_name);
    $pdf->Text(5, 50 + $c, $prenote->cotizationNumber);
    $pdf->Text(5, 54 + $c, $prenote->date);
    $pdf->Output($prenote->folio . '.pdf', 'F');
}
 public function actionHelloWorld()
 {
     $pdf = new FPDF();
     $pdf->AddPage();
     $pdf->SetFont('Arial', 'B', 16);
     $pdf->Cell(40, 10, 'Hello World!');
     $pdf->Output();
 }
Exemplo n.º 16
0
 public function generarPDF($codigos, $estab)
 {
     $pdf = new FPDF();
     $pdf->AddPage();
     $pdf->SetFont('Arial', 'B', 16);
     $pos_y = 10;
     $pdf->Cell(0, 12, "Codigos para los pinchos de " . $estab, 0, 0, "C");
     foreach ($codigos as $codigo) {
         $pdf->Ln();
         $pdf->Cell(0, 10, $codigo->getId(), 0, 0, "C");
     }
     $pdf->Output("codigos.pdf", "D");
 }
Exemplo n.º 17
0
 function getPdf($image)
 {
     require JPATH_SITE . "/components/com_flexpaper/fpdf/fpdf.php";
     $filePath = JPATH_SITE . "/components/com_flexpaper/output/certificate.pdf";
     $pdf = new FPDF('L', 'mm');
     $pdf->SetLeftMargin(0);
     $pdf->SetRightMargin(0);
     $pdf->SetTopMargin(0);
     $pdf->SetAutoPageBreak(false);
     $pdf->AddPage();
     $pdf->Image($image);
     $pdf_file = $pdf->Output($filePath, 'F');
     return $pdf_file;
 }
Exemplo n.º 18
0
 public function execute()
 {
     $pdf = new FPDF();
     $pdf->AddPage();
     $pdf->SetFont("helvetica", "B", 16);
     $pdf->Cell(0, 10, "Hello world!", 0, 1);
     $pdf->Ln();
     $pdf->SetFont("helvetica", "", 12);
     $pdf->SetFillColor(192, 192, 192);
     $pdf->Cell(40, 10, "Back", 1, 0, "C", 1);
     $pdf->Link(10, 30, 40, 10, "/demos");
     $pdf->Output();
     $this->output->disable();
 }
Exemplo n.º 19
0
function EWD_UFAQ_Export_To_PDF()
{
    require_once EWD_UFAQ_CD_PLUGIN_PATH . '/FPDF/fpdf.php';
    if ($Category != "EWD_UFAQ_ALL_CATEGORIES") {
        $category_array = array('taxonomy' => 'ufaq-category', 'field' => 'slug', 'terms' => $Category->slug);
    }
    $params = array('posts_per_page' => -1, 'post_type' => 'ufaq');
    $faqs = get_posts($params);
    $PDFPasses = array("FirstPageRun", "SecondPageRun", "Final");
    foreach ($PDFPasses as $PDFRun) {
        $pdf = new FPDF();
        $pdf->AddPage();
        if ($PDFRun == "SecondPageRun" or $PDFRun == "Final") {
            $pdf->SetFont('Arial', 'B', 14);
            $pdf->Cell(20, 10, "Page #");
            $pdf->Cell(20, 10, "Article Title");
            $pdf->Ln();
            $pdf->SetFont('Arial', '', 12);
            foreach ($ToC as $entry) {
                $pdf->Cell(20, 5, "  " . $entry['page']);
                $pdf->MultiCell(0, 5, $entry['title']);
                $pdf->Ln();
            }
            unset($ToC);
        }
        foreach ($faqs as $faq) {
            $PostTitle = strip_tags(html_entity_decode($faq->post_title));
            $PostText = strip_tags(html_entity_decode($faq->post_content));
            $PostText = str_replace("&#91;", "[", $PostText);
            $PostText = str_replace("&#93;", "]", $PostText);
            $pdf->AddPage();
            $Entry['page'] = $pdf->page;
            $Entry['title'] = $PostTitle;
            $pdf->SetFont('Arial', 'B', 15);
            $pdf->MultiCell(0, 10, $PostTitle);
            $pdf->Ln();
            $pdf->SetFont('Arial', '', 12);
            $pdf->MultiCell(0, 10, $PostText);
            $ToC[] = $Entry;
            unset($Entry);
        }
        if ($PDFRun == "FirstPageRun" or $PDFRun == "SecondPageRun") {
            $pdf->Close();
        }
        if ($PDFRun == "Final") {
            $pdf->Output('Ultimate-FAQ-Manual.pdf', 'D');
        }
    }
}
Exemplo n.º 20
0
 /**
  * Recibe un array con los datos del pedido otro con las lineas de dicho pedido y un booleano que le 
  * indica si el pdf es para mostrar o para enviar por correo y se encarga de rellenar el pdf con los datos recibidos
  * @param type $pedido
  * @param type $lineas
  * @param type $enviar
  */
 public function PedidoPdf($pedido, $lineas, $enviar = false)
 {
     $pdf = new FPDF();
     $pdf->AddPage();
     $pdf->SetFont('Arial', 'B', 14);
     $pdf->Cell(40, 7, "Pedido: " . $pedido['idpedido'], 0);
     $pdf->Cell(70, 7, "Estado: " . $pedido['estado_ped'], 0);
     $pdf->Cell(70, 7, "Fecha: " . $pedido['fecha_pedido'], 0);
     $pdf->Ln();
     $pdf->Ln();
     $pdf->Ln();
     $pdf->Cell(70, 7, "Nombre del producto", 1);
     $pdf->Cell(26, 7, "Cantidad", 1);
     $pdf->Cell(40, 7, "Precio", 1);
     $pdf->Cell(40, 7, "Precio Final *", 1);
     $pdf->Ln();
     foreach ($lineas as $linea) {
         $pdf->Cell(70, 7, $linea['nombrepro'], 1);
         $pdf->Cell(26, 7, $linea['cantidad'], 1);
         $pdf->Cell(40, 7, $linea['preciopro'] . iconv('UTF-8', 'windows-1252', '€'), 1);
         $pdf->Cell(40, 7, $linea['precio_ped'] . iconv('UTF-8', 'windows-1252', '€'), 1);
         $pdf->Ln();
     }
     $pdf->Ln();
     $pdf->Ln();
     $pdf->Cell(100, 7, "Total del pedido: " . $pedido['total_ped'] . iconv('UTF-8', 'windows-1252', '€'), 1);
     $pdf->Ln();
     $pdf->Ln();
     $pdf->Ln();
     $pdf->Cell(100, 7, "* Impuestos y descuento aplicados ", 0);
     if ($enviar == false) {
         $pdf->Output();
     } else {
         $pdf->Output('F', 'asset/pedidocorreo/pedido.pdf', true);
     }
 }
Exemplo n.º 21
0
 function generate_news_pdf($news)
 {
     $imagePath = $_SERVER['DOCUMENT_ROOT'] . 'news_app/uploads/news_images/';
     require $_SERVER['DOCUMENT_ROOT'] . 'news_app/app/libraries/FPDF/fpdf.php';
     $pdf = new FPDF();
     $pdf->AliasNbPages();
     $pdf->AddPage();
     $pdf->SetFont('Arial', 'B', 16);
     // Title
     //$pdf->Ln(4);
     $pdf->Write(1, $news->title);
     //$pdf->Ln(10);
     $pdf->Image($imagePath . $news->news_image, 50, 30, 'C');
     //$pdf->Ln(16);
     $pdf->SetFont('Arial', '', 12);
     $pdf->Write(5, $news->news_text);
     $pdf->Output();
 }
Exemplo n.º 22
0
function create_pdf()
{
    define('FPDF_FONTPATH', 'font/');
    require 'fpdf.php';
    $unique_id = $_GET['unq'];
    $invoid = $_POST['invoid'];
    // post the form in page 2
    $invonm = $_POST['invonm'];
    // name
    $invopc = $_POST['invopc'];
    // postcode
    $invoad = $_POST['invoad'];
    // address
    $invoem = $_POST['invoem'];
    // email
    $invoph = $_POST['invoph'];
    // telephone
    $invoss = $_POST['invoss'];
    // services
    $invotl = $_POST['invotl'];
    // total
    $invode = $_POST['invode'];
    // date
    $invost = $_POST['invost'];
    // unique stamp
    // $invid = $_SESSION['invoice_id'];
    // $invnm = $_SESSION['invoice_name'];
    // $invad = $_SESSION['invoice_address'];
    // $invem = $_SESSION['invoice_email'];
    // $invpc = $_SESSION['invoice_postcode'];
    $pdf = new FPDF();
    $pdf->AddPage();
    $pdf->Image('img/logo.jpg');
    $pdf->SetFont('Arial', '', '12');
    $pdf->Cell(0, -6, 'Invoice date: ' . $invode, 0, 1, "R");
    $pdf->Cell(0, -6, 'UIS: ' . $invost, 0, 1, "R");
    $pdf->Cell(0, 24, '', 0, 1, "L");
    $pdf->Cell(0, 6, 'Customer Name: ' . $invonm, 0, 1, "L");
    $pdf->Cell(0, 6, 'Address: ' . $invoad, 0, 1, "L");
    $pdf->Cell(0, 6, 'Postcode: ' . $invopc, 0, 1, "L");
    $pdf->Cell(0, 6, 'Telephone: ' . $invoph, 0, 1, "L");
    $pdf->Output();
}
Exemplo n.º 23
0
function UsersTrafficPeriodPDF()
{
    //require('chart.php');
    require 'lib/fpdf.php';
    global $SAMSConf;
    global $DATE;
    $DB = new SAMSDB();
    $sdate = $DATE->sdate();
    $edate = $DATE->edate();
    $bdate = $DATE->BeginDate();
    $eddate = $DATE->EndDate();
    $size = "";
    if (isset($_GET["size"])) {
        $size = $_GET["size"];
    }
    require "reportsclass.php";
    $dateselect = new DATESELECT($DATE->sdate(), $DATE->edate());
    $lang = "./lang/lang.{$SAMSConf->LANG}";
    require $lang;
    define('FPDF_FONTPATH', 'lib/font/');
    require 'lib/fpdf.php';
    $pdfFile = new FPDF();
    $pdfFile->Open();
    $pdfFile->AddFont('Nimbus', '', 'Nimbus.php');
    $pdfFile->SetAuthor("SQUID Account Management System");
    $pdfFile->SetCreator("Created by SAMS2");
    $pdfFile->SetTitle("SAMS2 users statistic");
    //      UsersTrafficPeriodPDF();
    $pdfFile->AddPage();
    $pdfFile->SetFont('Nimbus', '', 15);
    //$pdfFile->SetFont('SUSESerif-Roman','',16);
    $pdfFile->SetXY(50, 15);
    echo " {$usersbuttom_2_traffic_UsersTrafficPeriod_1}<BR>{$usersbuttom_2_traffic_UsersTrafficPeriod_2}<br>";
    $pdfFile->Write(0, " {$usersbuttom_2_traffic_UsersTrafficPeriod_1}<BR>{$usersbuttom_2_traffic_UsersTrafficPeriod_2}");
    $pdfFile->Output();
}
Exemplo n.º 24
0
    $pdf->Cell(45, 10, "Kashiwa-shi Chiba-ken Japan");
    $pdf->setXY(30, 12);
    $pdf->Cell(45, 10, "277-0053");
    $startPosition = 45;
    $pdf->SetFont('Arial', "", 12);
    $pdf->setXY(30, $startPosition);
    $pdf->Cell(45, 10, trim($address[0]));
    $pdf->SetFont('Arial', "", 10);
    if (isset($address[6]) && $address[6] != "") {
        $pdf->setXY(30, $startPosition += 5);
        $pdf->Cell(45, 10, trim($address[6]));
    }
    $pdf->setXY(30, $startPosition += 5);
    $pdf->Cell(45, 10, trim($address[1]));
    $pdf->setXY(30, $startPosition += 5);
    $pdf->Cell(45, 10, trim($address[2]) . ', ' . trim($address[3]) . ' ' . trim($address[4]));
    $pdf->setXY(30, $startPosition += 5);
    $pdf->Cell(45, 10, trim($address[5]));
}
$pdf->Output();
function getAddressFromCSV($fileName)
{
    $addresses = array();
    if (($handle = fopen($fileName, "r")) !== FALSE) {
        while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
            $addresses[] = $data;
        }
        fclose($handle);
    }
    return $addresses;
}
Exemplo n.º 25
0
            mysqli_close($db);
            $nbrdates = mysqli_num_rows($rowsdates);
            for ($f = 0; $f < $nbrdates; $f++) {
                $rowd = mysqli_fetch_array($rowsdates);
                $dates = $dates . getDatefr($rowd["date_session"]) . "\n";
            }
            $courrier->SetFont('SourceSansPro-Semibold', '', 12);
            $titre = $rowa['session_titre'] . " : ";
            $courrier->Write(7, $titre);
            $courrier->Ln();
            $courrier->SetFont('SourceSansPro-LightItalic', '', 12);
            $courrier->Write(5, $rowa['session_detail']);
            $courrier->Ln(7);
            $courrier->SetFont('SourceSansPro-Regular', '', 12);
            $courrier->Multicell(0, 7, $dates, 0, 'L', false);
            $courrier->Ln();
            $dates = "";
        }
    } else {
        $courrier->SetFont('SourceSansPro-Regular', '', 12);
        $courrier->Write(5, utf8_decode("Vous n'êtes inscrit à aucune session sur liste d'attente."));
    }
    $courrier->Ln(15);
}
/* politesse */
//$courrier->Image('../img/logos_courrier.jpg',10,275,35);
$courrier->SetFont('SourceSansPro-Regular', '', 8);
$courrier->SetXY(10, 270);
$courrier->MultiCell(0, 5, $politesse, 'T', 'C', false);
$courrier->Output();
Exemplo n.º 26
0
            $pdf->SetFont('Arial', '', 12);
            $pdf->Cell(80, 6, "", 0, 1);
            $tok = strtok($addresslist, "@");
            $counter = 0;
            while ($tok !== false) {
                $ldapFilter = "cn=" . $tok;
                $sr = ldap_search($ds, $ldapDomain, $ldapFilter);
                $info = ldap_get_entries($ds, $sr);
                $text = $info[0]["givenname"][0] . " " . $info[0]["sn"][0] . "\n" . $info[0]["mozillahomestreet"][0] . "\n" . $info[0]["mozillahomepostalcode"][0] . " " . $info[0]["mozillahomelocalityname"][0] . "\n" . $info[0]["mozillahomecountryname"][0];
                $pdf->MultiCell(80, 6, utf8_decode($text), "T", 1);
                $pdf->Cell(80, 6, "", 0, 1);
                $counter = $counter + 1;
                $tok = strtok("@");
            }
        }
    }
} else {
    $line1 = $_REQUEST['line1'];
    $line2 = $_REQUEST['line2'];
    $line3 = $_REQUEST['line3'];
    $line4 = $_REQUEST['line4'];
    $line5 = $_REQUEST['line5'];
    $pdf->SetFont('Arial', 'B', 18);
    $pdf->Cell(40, 10, utf8_decode($line1), 0, 1);
    $pdf->Cell(40, 10, utf8_decode($line2), 0, 1);
    $pdf->Cell(40, 10, utf8_decode($line3), 0, 1);
    $pdf->Cell(40, 10, utf8_decode($line4), 0, 1);
    $pdf->Cell(40, 10, utf8_decode($line5), 0, 0);
}
$pdf->Output("addressoutput.pdf", "I");
Exemplo n.º 27
0
<?php

include 'fpdf153/fpdf.php';
include 'seguridad.php';
include 'seguridad_usu.php';
include 'conectaBD.php';
$correo = $_SESSION["usuario"];
$id = $_REQUEST[id];
$usuario = ejecutaConsulta("Select * from usuario where id='{$id}' and correo='{$correo}';");
$nombre = html_entity_decode(pg_result($usuario, 0, 'nombre'));
$ape1 = html_entity_decode(pg_result($usuario, 0, 'ape1'));
$linea = $nombre . " " . $ape1;
$pdf = new FPDF(L, cm, A4);
$pdf->AddPage();
$pdf->SetFont('Arial', '', 16);
$pdf->Image('img/certifCastellano.jpg', 0, 0, 29.7, 21);
$pdf->MultiCell(27.7, 16, $linea, 0, C);
$pdf->Output('certificado.pdf', I);
Exemplo n.º 28
0
                    $pdf->Cell($catw, $cath, $report['summary'][$cat]['value'], 0, 0, 'C', 1);
                    $x_coord += $catw;
                    $pdf->SetXY($x_coord, $y_coord);
                }
                // deal with locked scores...
                if ($report['locked']['hasLocked']) {
                    $pdf->SetTextColor(255, 0, 0);
                    $pdf->Cell($overallavw, $cath, $report['locked']['lockedGrade'], 0, 1, 'C', 1);
                    $pdf->SetTextColor(0, 0, 0);
                } else {
                    $pdf->Cell($overallavw, $cath, $report['overallCalculatedAverage'], 0, 1, 'C', 1);
                }
                $x_coord = $lm;
                $y_coord += $cath;
            }
            /** end while fetch students**/
        }
        /** end if class has cats **/
    }
    /** end foreach class **/
    // Now trigger download 'D' rather than inline 'I' as inline not working with multiple pages.
    if ($download) {
        $pdf->Output($filename, 'D');
    } else {
        $pdf->Output($filename, 'I');
    }
}
/** end if($_SESSION[$_CONF['sess_name'].'_isTeacher']) **/
?>
		
Exemplo n.º 29
0
            }
            //Receipt AMT number in block (9)
            $pdf->SetXY(10, 120 + 5);
            $pdf->SetFont("Times", "", 12);
            $pdf->Cell(40, 12, "{$currency_code} : {$originalamt}", "", 0, 'L');
            $pdf->Line(10, $pdf->GetY() + 9, $pdf->GetX() + 30, $pdf->GetY() + 9);
            $pdf->Line(10, $pdf->GetY() + 10, $pdf->GetX() + 30, $pdf->GetY() + 10);
            $pdf->SetFont("Times", "", 8);
            $pdf->SetXY(10, 127);
            /*
            if($account_type==4)
            $paymentmethodtext="Cheque";
            else
            $paymentmethodtext="Cash";
            $pdf->Cell(0,10,"Payment Method: $paymentmethodtext","",'L');
            */
            //Prepared By (10)
            $pdf->SetXY(120, 110 + 5);
            $pdf->SetFont("Times", "", 10);
            $pdf->Cell(40, 12, "Prepared By:", "", 0, 'L');
            //	$pdf->Line(10,$pdf->GetY()+9,$pdf->GetX()+30,$pdf->GetY()+9);
            $pdf->Line(120, $pdf->GetY() + 20, 180, $pdf->GetY() + 20);
        }
        //if checked
    }
    //end of array
    //$pdf->Ln();
    //$pdf->MultiCell(0,10,"$receipt_idarr","",'L');
    $pdf->Output("bpartnerstatement.pdf", "I");
    exit(1);
}
Exemplo n.º 30
-2
 public function imprimir()
 {
     $segmento = $this->uri->segment(3);
     if ($segmento) {
         $data = $this->pedidos_model->obtener_detalle_pedido($segmento);
         //$this->output->set_content_type('application/json')->set_output(json_encode($data->result()[0]));
         $pdf = new FPDF();
         $pdf->AddPage();
         $pdf->SetFont('Arial', 'B', 10);
         $pdf->Cell(30, 5, 'DETALLE DEL PEDIDO No.' . $data->result()[0]->idPedidos, 0, 1);
         $pdf->Output();
     }
 }