$interlinspaco = 4.05; } $pdf->write($linlargxo * 1.7, uni("persona nomo; nomo; adresaldonaj^o; strato; pos^tkodo; urbo; lando; telefono; telefakso; retpos^to")); $pdf->ln($interlinspaco); $pdf->ln($interlinspaco); // $demando = "select p.ID,pn.ID,p.nomo, personanomo,l.nomo,retposxto,adresaldonajxo,strato,posxtkodo,urbo,lando,telefono,telefakso,retposxto from partoprenantoj as p, partoprenoj as pn, landoj as l where pn.partoprenantoID=p.ID and l.ID=lando and renkontigxoID='".$_SESSION["renkontigxo"]->datoj[ID]."' and alvenstato='a' order by personanomo,p.nomo"; $demando = datumbazdemando(array("p.ID", "pn.ID", "p.nomo", "personanomo", "l.nomo", "retposxto", "adresaldonajxo", "strato", "posxtkodo", "urbo", "lando", "telefono", "telefakso"), array("partoprenantoj" => "p", "partoprenoj" => "pn", "landoj" => "l"), array("pn.partoprenantoID = p.ID", "l.ID = lando", "alvenstato = 'a'"), "renkontigxoID", array("order" => "personanomo, p.nomo")); echo "<BR><BR>"; $rezulto = sql_faru($demando); $koloro = 0; while ($row = mysql_fetch_array($rezulto, MYSQL_BOTH)) { eoecho($row[personanomo] . " " . $row[2] . "<BR>"); if ($bunta == "JES") { switch ($koloro % 4) { case 0: $pdf->SetTextColor(200, 0, 0); break; case 1: $pdf->SetTextColor(0, 0, 255); break; case 2: $pdf->SetTextColor(0, 150, 0); break; default: $pdf->SetTextColor(0, 0, 0); break; } $koloro++; } $pdf->write($linlargxo, uni($row[personanomo] . " " . $row[2] . "; " . $row[adresaldonajxo] . " " . $row[strato] . "; " . $row[posxtkodo] . "; " . $row[urbo] . "; " . $row[4] . "; " . $row[telefono] . "; " . $row[telefakso] . "; " . $row[retposxto])); $pdf->ln($interlinspaco);
public function create_pdf_oferte_old($title, $desc, $products) { $CI =& get_instance(); $CI->load->helper('ufpdf'); $CI->load->helper('data_helper'); $CI->load->model('mysql'); $CI->load->library('session'); $pdf = new UFPDF('P', 'mm', 'A4'); $pdf->AddPage(); //titlu oferta $pdf->AddFont('TimesNewRomanPSMT', '', 'times.php'); $pdf->SetFont('TimesNewRomanPSMT', '', 16); // $pdf->AddFont('TimesNewRomanPSMT','','times.php'); // $pdf->SetFont('TimesNewRomanPSMT','',12); // $pdf->SetFont('Arial','B',16); $pdf->Cell(0, 0, $title); $pdf->Ln(5); // rind nou //descrire oferta $pdf->SetFont('TimesNewRomanPSMT', '', 10); $pdf->MultiCell(0, 5, $desc); $pdf->Ln(5); $i = 0; foreach ($products as $item) { $i++; //info suprafata $pdf->SetFont('Arial', 'B', 11); $pdf->Cell(0, 0, 'Info Suprafata publicitara Nr' . $i); $pdf->Ln(8); // rind nou //adresa link $pdf->SetTextColor(0, 136, 204); $pdf->SetFont('Arial', 'B', 11); $pdf->Cell(0, 0, $item['adresa'], '', '', '', false, 'http://www.marplo.net/jocuri'); $pdf->Ln(5); // rind nou //numar de inventar $pdf->SetFont('Arial', '', 10); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(0, 0, 'Numarul de inventar: #' . $item['inv']); $pdf->Ln(8); // rind nou //pret $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 0, 'Pret: ' . $item['price'] . ' euro'); $pdf->Ln(10); // rind nou //dimensiunea $pdf->SetFont('Arial', 'B', 8); $pdf->Cell(0, 0, 'Dimensiuni: ' . $item['format']); $pdf->Ln(5); // rind nou //foto if ($item['image'] and file_exists($_SERVER['DOCUMENT_ROOT'] . $item['image'])) { $pdf->Cell(0, 0, 'Foto'); $pdf->Ln(2); // rind nou $pdf->Image('.' . $item['image']); $pdf->Ln(20); // rind nou } else { $pdf->Ln(20); } // rind nou } //footer $pdf->SetFont('Arial', 'B', 6); $pdf->Cell(0, 0, 'Trendseter Copyright 2011', '', '', 'C'); $pdf->Ln(5); // rind nou // Tilte pdf $page_title = 'Oferta_' . date('d_m_Y_H:i:s'); $pdf->output('./uploads/offerts/' . $page_title . '.pdf', 'F'); $CI->mysql->insert('offerts_pdf', array('uid' => $CI->session->userdata('uid'), 'pdf' => './uploads/offerts/' . $page_title . '.pdf')); return './uploads/offerts/' . $page_title . '.pdf'; }