Ln(0); $this->SetLeftMargin($marge); $this->Cell(9,3.5,$stand." - ",0,0,'L',false,$link); //$this->SetLeftMargin($marge + 9); $this->Cell(55,3.5,$bedrijf,0,1,'L',false,$link); $this->SetLeftMargin($marge); //$this->Ln(0); }else{ //$this->Ln(0); $this->SetLeftMargin($marge); $this->Cell(9,3.5,$stand." - ",0,0,'L',false,$link); //$this->SetLeftMargin($marge + 9); $this->Cell(55,3.5,$parts[0],0,1,'L',false,$link); $this->SetLeftMargin($marge + 9); $this->Cell(55,3.5,$parts[1],0,1,'L',false,$link); $this->SetLeftMargin($marge); $this->Ln(0); } } function Header(){ if($this->PageNo() > 1){ $this->ImageEps(VOLG,0,0,210); }else{ $this->ImageEps(KAFT,0,0,210); } } function replace_expr($check){ $string = $check; $patterns[1] = '/•/'; $replacements[1] = '-'; return preg_replace($patterns, $replacements, $string); } } // PDF SAMENSTELLEN $pdf=new PDF(); $pdf->cMargin = 0; $pdf->SetDisplayMode('fullpage', 'single'); $pdf->AliasNbPages(); $pdf->AddFont('PLAY','','play-regular.php'); $pdf->AddFont('PLAY-B','','play-bold.php'); $pdf->AddPage('P',PAPIER); $pdf->SetFont('PLAY-B','',26); $pdf->SetTextColor(0); $pdf->SetLineWidth(0.4); $pdf->SetDrawColor(RORANJE, GORANJE, BORANJE); $pdf->SetMargins(0, 0, 0); $pdf->SetAutoPageBreak(false); $pdf->SetLeftMargin(52.5); $pdf->SetY(210); $pdf->Cell(105,10,"Catalogus ".date("Y"),'',0,'C'); $pdf->AddPage('P',PAPIER); $pdf->SetLeftMargin(26); $pdf->SetY(23); $pdf->SetFont('PLAY','',26); $pdf->SetTextColor(0); $pdf->Cell(100,6,"Deelnemers",'',0); $pdf->SetFont('PLAY','',8.5); $sql = "SELECT t1.ID, t2.bedrijfsnaam AS bdnaam, t4.standnummer FROM dln_deelnemers t1, dln_catalogus t2, dln_deelnemers_stands t3, dln_stands t4 WHERE t1.catalogus_id = t2.ID AND t1.ID = t3.deelnemers_id AND t3.stands_id = t4.ID AND t1.actief = 1 AND t4.standnummer NOT LIKE 'O%' ORDER BY t2.bedrijfsnaam ASC"; $result = mysql_query($sql); $aantal_inside = mysql_num_rows($result); $sql = "SELECT t1.ID, t2.bedrijfsnaam AS bdnaam, t4.standnummer FROM dln_deelnemers t1, dln_catalogus t2, dln_deelnemers_stands t3, dln_stands t4 WHERE t1.catalogus_id = t2.ID AND t1.ID = t3.deelnemers_id AND t3.stands_id = t4.ID AND t1.actief = 1 AND t4.standnummer LIKE 'O%' ORDER BY t2.bedrijfsnaam ASC"; $result_offsite = mysql_query($sql); $aantal_offsite = mysql_num_rows($result_offsite); $aantal_totaal = $aantal_inside + $aantal_offsite; $kolom_breedte = 84; $marge = 26; $pdf->SetLeftMargin($marge); $pdf->SetY(41); //$paginas = array(); $counter = 0; if($aantal_totaal > 120){ $max_deelnemers = ceil($aantal_totaal/2)+0; }else{ $max_deelnemers = 121; } $max_y = 270; //eerst de normale deelnemers... while ($row = mysql_fetch_array($result)) { $counter++; $link = $pdf->AddLink(); $standnummer = $row['standnummer']; $titel = html_entity_decode($row['bdnaam']); $y_pos = $pdf->GetY(); if($y_pos > $max_y){ $marge = $marge+$kolom_breedte; $pdf->SetY(41); $pdf->SetLeftMargin($marge); } //$pdf->Cell(64,3.5,$standnummer . " - " . $titel,0,1,'L',false,$link); $pdf->wrapper($standnummer, $titel, $link, $marge); if($counter == $max_deelnemers){ $counter = 0; $pdf->AddPage('P',PAPIER); $pdf->SetY(23); $marge = 26; $pdf->SetLeftMargin($marge); $pdf->SetFont('PLAY','',26); $pdf->SetTextColor(0); $pdf->Cell(100,6,"Deelnemers",'',0); $pdf->SetFont('PLAY','',8.5); $pdf->SetY(41); } } $pdf->SetFont('PLAY-B','',12); $pdf->SetTextColor(RORANJE, GORANJE, BORANJE); $pdf->Ln(5); $pdf->Cell(64,5,"Offsite",0,1,'L',false); $pdf->SetFont('PLAY','',8.5); $pdf->SetTextColor(0); //en dan de offsite while ($row = mysql_fetch_array($result_offsite)) { $counter++; $link = $pdf->AddLink(); $standnummer = $row['standnummer']; $titel = html_entity_decode($row['bdnaam']); $y_pos = $pdf->GetY(); if($y_pos > $max_y){ $marge = $marge+$kolom_breedte; $pdf->SetY(41); $pdf->SetLeftMargin($marge); } //$pdf->Cell(64,3.5,$standnummer . " - " . $titel,0,1,'L',false,$link); $pdf->wrapper($standnummer, $titel, $link, $marge); if($counter == $max_deelnemers){ $counter = 0; $pdf->AddPage('P',PAPIER); $marge = 26; $pdf->SetLeftMargin($marge); $pdf->SetY(41); } } $pdf->AddPage('P',PAPIER); $pdf->SetLeftMargin(26); $pdf->SetY(23); $pdf->SetFont('PLAY','',26); $pdf->SetTextColor(0); $pdf->Cell(100,6,"Deelnemers",'',0); $sql = "SELECT t1.ID, t2.cat_contact, t2.adres, t2.huisnummer, t2.toevoegsel, t2.postcode, t2.woonplaats, t2.telefoonnummer, t2.email, t2.website, t2.land, t2.tekst, t2.tekst2, t2.afbeelding, t2.bedrijfsnaam AS bdnaam, t4.standnummer FROM dln_deelnemers t1, dln_catalogus t2, dln_deelnemers_stands t3, dln_stands t4 WHERE t1.catalogus_id=t2.ID AND t1.ID=t3.deelnemers_id AND t3.stands_id=t4.ID AND t1.actief = 1 AND t4.standnummer NOT LIKE 'O%' ORDER BY t2.bedrijfsnaam ASC"; $result = mysql_query($sql); $num_row = mysql_num_rows($result); //echo $num_row; $sql = "SELECT t1.ID, t2.cat_contact, t2.adres, t2.huisnummer, t2.toevoegsel, t2.postcode, t2.woonplaats, t2.telefoonnummer, t2.email, t2.website, t2.land, t2.tekst, t2.tekst2, t2.afbeelding, t2.bedrijfsnaam AS bdnaam, t4.standnummer FROM dln_deelnemers t1, dln_catalogus t2, dln_deelnemers_stands t3, dln_stands t4 WHERE t1.catalogus_id=t2.ID AND t1.ID=t3.deelnemers_id AND t3.stands_id=t4.ID AND t1.actief = 1 AND t4.standnummer LIKE 'O%' ORDER BY t2.bedrijfsnaam ASC"; $result_offsite = mysql_query($sql); $num_row_offsite = mysql_num_rows($result_offsite); $xplaatje = 26; $yplaatje = 47; $counter = 0; $link_counter = 0; while ($row = mysql_fetch_array($result)) { $counter++; $link_counter++; //$page_link = $counter; $pdf->SetLink($link_counter); $standnummer = $row["standnummer"]; $titel = html_entity_decode($row["bdnaam"]); $row['toevoegsel'] == "" ? $toevoegsel = "" : $toevoegsel = " " . $row["toevoegsel"]; $contact = html_entity_decode($row["cat_contact"]); $adres1 = $row["adres"] . " " . $row["huisnummer"].$toevoegsel; $adres2 = $row["postcode"] . " " . $row["woonplaats"]; $row['land'] == "Nederland" ? $adres3 = "" : $adres3 = $row['land']; $tel = $row["telefoonnummer"]; $email = $row["email"]; $website = $row["website"]; $image_file = $row["afbeelding"]; $image_file == "" ? $image_file = "0-O.jpg" : $image_file = $image_file; $tekst1 = $pdf->replace_expr(html_entity_decode(stripslashes($row["tekst"]))); $tekst2 = $pdf->replace_expr(html_entity_decode(stripslashes($row["tekst2"]))); $pdf->SetLeftMargin(107.2); $pdf->SetY($yplaatje); $pdf->Line(105, $yplaatje, 105, (103+$yplaatje)); $pdf->SetFont('PLAY','',13); $pdf->SetTextColor(0); $pdf->MultiCell(80,5,$titel,'',1); $pdf->SetTextColor(RORANJE, GORANJE, BORANJE); $pdf->Cell(100,5,$standnummer,'',1); $pdf->SetFont('PLAY','',8.5); $pdf->SetTextColor(0); $pdf->Ln(2); $pdf->MultiCell(80,3.5,$tekst1,'',1); $pdf->Ln(3.5); $pdf->MultiCell(80,3.5,$tekst2,'',1); $afbeelding = "../../../../deelnemer/afbeeldingen/" . $image_file; $maat = getimagesize($afbeelding); $breedte = $maat[0]; $hoogte = $maat[1]; $verhouding = $breedte/$hoogte; if($verhouding<1){ $h = 76.2; $w = $h*$verhouding; $yplaatje = $yplaatje; $xplaatje = $xplaatje+($h-$w); }else{ $w = 76.2; $h = $w/$verhouding; $yplaatje = $yplaatje+($w-$h); $xplaatje = $xplaatje; } $pdf->SetLeftMargin(26); $naw_pos = $yplaatje + $h + 2; $pdf->SetY($naw_pos); $contact == "" ? $regel1 = "" : $regel1 = $contact."\n"; $adres1 == " " ? $regel2 = "" : $regel2 = $adres1."\n"; $adres2 == " " ? $regel3 = "" : $regel3 = $adres2."\n"; $adres3 == "" ? $regel4 = "" : $regel4 = $adres3."\n"; $tel == "" ? $regel5 = "" : $regel5 = $tel."\n"; $email == "" ? $regel6 = "" : $regel6 = $email."\n"; $website == "" ? $regel7 = "" : $regel7 = $website."\n"; $naw = $regel1 . $regel2 . $regel3 . $regel4 . $regel5 . $regel6 . $regel7; $pdf->MultiCell(76.2,3.5,$naw,0,'R',false); $pdf->Image($afbeelding,$xplaatje,$yplaatje,$w,$h); $yplaatje = 165; $xplaatje = 26; if($counter != $num_row){ if($counter%2 == 0 ){ $pdf->AddPage('P',PAPIER); $pdf->SetLeftMargin(26); $pdf->SetY(23); $pdf->SetFont('PLAY','',26); $pdf->SetTextColor(0); $pdf->Cell(100,6,"Deelnemers",'',0); $xplaatje = 26; $yplaatje = 47; }else{ $pdf->ImageEps("PDF catalogus - volghalf.ai",0,160,210); } } } $pdf->AddPage('P',PAPIER); $pdf->SetLeftMargin(26); $pdf->SetY(23); $pdf->SetFont('PLAY','',26); $pdf->SetTextColor(0); $pdf->Cell(100,6,"Offsite",'',0); $xplaatje = 26; $yplaatje = 47; $counter = 0; while ($row = mysql_fetch_array($result_offsite)) { $counter++; $link_counter++; //$page_link = $counter; $pdf->SetLink($link_counter); $standnummer = $row["standnummer"]; $titel = html_entity_decode($row["bdnaam"]); $row['toevoegsel'] == "" ? $toevoegsel = "" : $toevoegsel = " " . $row["toevoegsel"]; $contact = $row["cat_contact"]; $adres1 = $row["adres"] . " " . $row["huisnummer"].$toevoegsel; $adres2 = $row["postcode"] . " " . $row["woonplaats"]; $row['land'] == "Nederland" ? $adres3 = "" : $adres3 = $row['land']; $tel = $row["telefoonnummer"]; $email = $row["email"]; $website = $row["website"]; $image_file = $row["afbeelding"]; $image_file == "" ? $image_file = "0-O.jpg" : $image_file = $image_file; $tekst1 = $pdf->replace_expr(html_entity_decode(stripslashes($row["tekst"]))); $tekst2 = $pdf->replace_expr(html_entity_decode(stripslashes($row["tekst2"]))); $pdf->SetLeftMargin(107.2); $pdf->SetY($yplaatje); $pdf->Line(105, $yplaatje, 105, (103+$yplaatje)); $pdf->SetFont('PLAY','',13); $pdf->SetTextColor(0); $pdf->MultiCell(80,5,$titel,'',1); $pdf->SetTextColor(RORANJE, GORANJE, BORANJE); $pdf->Cell(100,5,$standnummer,'',1); $pdf->SetFont('PLAY','',8.5); $pdf->SetTextColor(0); $pdf->Ln(2); $pdf->MultiCell(80,3.5,$tekst1,'',1); $pdf->Ln(3.5); $pdf->MultiCell(80,3.5,$tekst2,'',1); $afbeelding = "../../../../deelnemer/afbeeldingen/" . $image_file; $maat = getimagesize($afbeelding); $breedte = $maat[0]; $hoogte = $maat[1]; $verhouding = $breedte/$hoogte; if($verhouding<1){ $h = 76.2; $w = $h*$verhouding; $yplaatje = $yplaatje; $xplaatje = $xplaatje+($h-$w); }else{ $w = 76.2; $h = $w/$verhouding; $yplaatje = $yplaatje+($w-$h); $xplaatje = $xplaatje; } $pdf->SetLeftMargin(26); $naw_pos = $yplaatje + $h + 2; $pdf->SetY($naw_pos); $contact == "" ? $regel1 = "" : $regel1 = $contact."\n"; $adres1 == " " ? $regel2 = "" : $regel2 = $adres1."\n"; $adres2 == " " ? $regel3 = "" : $regel3 = $adres2."\n"; $adres3 == "" ? $regel4 = "" : $regel4 = $adres3."\n"; $tel == "" ? $regel5 = "" : $regel5 = $tel."\n"; $email == "" ? $regel6 = "" : $regel6 = $email."\n"; $website == "" ? $regel7 = "" : $regel7 = $website."\n"; $naw = $regel1 . $regel2 . $regel3 . $regel4 . $regel5 . $regel6 . $regel7; $pdf->MultiCell(76.2,3.5,$naw,0,'R',false); $pdf->Image($afbeelding,$xplaatje,$yplaatje,$w,$h); $yplaatje = 165; $xplaatje = 26; if($counter != $num_row_offsite){ if($counter%2 == 0){ $pdf->AddPage('P',PAPIER); $pdf->SetLeftMargin(26); $pdf->SetY(23); $pdf->SetFont('PLAY','',26); $pdf->SetTextColor(0); $pdf->Cell(100,6,"Offsite",'',0); $xplaatje = 26; $yplaatje = 47; }else{ $pdf->ImageEps("PDF catalogus - volghalf.ai",0,160,210); } } } $pdf->Output($pdf_naam,'D');// D -> voor een directe download. I -> save as, en alles komt goed! ABSOLUUT NIKS NA DE VOLGENDE REGEL PLAATSEN!!!!! ?>