"Eigenschaften", 2 => "Features"); $beschreibung = array(1 => "Beschreibung", 2 => "Overview"); $td = array(1 => "Technische Daten", 2 => "Specifications"); $tdb = array(1 => "Technisches Datenblatt", 2 => "Technical datasheet"); $bild = array(1 => "Bild", 2 => "Product image"); $zubehoer = array(1 => "Zubehr", 2 => "Accessories"); $aenderungen = array(1 => "nderungen und Irrtmer vorbehalten. Abbildungen hnlich", 2 => "Subject to errors and modifications. Images can be similar."); $stand = array(1 => "Stand ", 2 => ""); $seite = array(1 => "Seite", 2 => "Page"); $db = array(1 => "Datenblatt", 2 => "Datasheet"); include ("../../config_kat.inc.php"); /*$sql = "SELECT * FROM technische_daten"; $read = mysql_query ($sql); while ($row = mysql_fetch_object ($read)) { $s = "INSERT INTO technische_daten (artID, merkmalID, tdWerte) VALUES ('1', '$row->merkmalID', '$row->tdWerte')"; mysql_query ($s); }*/ define('FPDF_FONTPATH','font/'); require('../../pdf_create/fpdf.php'); $sql = "SELECT * FROM artikel WHERE artID = '$_REQUEST[id]'"; $read = mysql_query ($sql); $artikel = mysql_fetch_array ($read); if (is_array ($artikel)) { foreach ($artikel as $key => $value) { $artikel[$key] = str_replace ("ü", "", $artikel[$key]); $artikel[$key] = str_replace ("Ü", "", $artikel[$key]); $artikel[$key] = str_replace ("ä", "", $artikel[$key]); $artikel[$key] = str_replace ("Ä", "", $artikel[$key]); $artikel[$key] = str_replace ("ö", "", $artikel[$key]); $artikel[$key] = str_replace ("Ö", "", $artikel[$key]); $artikel[$key] = str_replace (" ", " ", $artikel[$key]); $artikel[$key] = str_replace (""", "\"", $artikel[$key]); $artikel[$key] = str_replace ("ß", "", $artikel[$key]); $artikel[$key] = str_replace ("&", "&", $artikel[$key]); } } $sqlw = "SELECT * FROM warengruppe WHERE warengruppeID = '$artikel[warengruppeID]'"; $readw = mysql_query ($sqlw); $warengruppe = mysql_fetch_array ($readw); if (is_array ($warengruppe)) { foreach ($warengruppe as $key => $value) { $warengruppe[$key] = str_replace ("ü", "", $warengruppe[$key]); $warengruppe[$key] = str_replace ("Ü", "", $warengruppe[$key]); $warengruppe[$key] = str_replace ("ä", "", $warengruppe[$key]); $warengruppe[$key] = str_replace ("Ä", "", $warengruppe[$key]); $warengruppe[$key] = str_replace ("ö", "", $warengruppe[$key]); $warengruppe[$key] = str_replace ("Ö", "", $warengruppe[$key]); $warengruppe[$key] = str_replace (" ", " ", $warengruppe[$key]); $warengruppe[$key] = str_replace (""", "\"", $warengruppe[$key]); $warengruppe[$key] = str_replace ("ß", "", $warengruppe[$key]); $warengruppe[$key] = str_replace ("&", "&", $warengruppe[$key]); } } page::data ($pdf); page::head ($pdf, $artikel, $warengruppe); page::foot ($pdf, $stand, $seite, $aenderungen); page::artikel ($pdf, $artikel); page::tech_daten ($pdf, $artikel, $warengruppe, $td, $zubehoer, $stand, $seite, $aenderungen); page::output ($pdf, $artikel, $db); class page { function data ($pdf) { global $pdf; $orientation= 'P'; $unit = 'pt'; $format = 'A4'; $pdf = new FPDF ($orientation, $unit, $format); $pdf->AliasNbPages (); $pdf->Open (); $pdf->SetFont ('Arial', '', 10); $pdf->SetDisplayMode ('fullpage', 'default'); $pdf->SetCreator ('Luna HD'); $pdf->SetAuthor ('Luna HD'); $pdf->SetSubject ("Subject"); $pdf->SetTitle ("Titel"); $pdf->SetDrawColor ( 255, 0, 0); $pdf->SetAutoPageBreak (false); $pdf->AddPage (); } function head ($pdf, $artikel, $warengruppe) { global $pdf; $pdf->SetFont ('Arial', 'B', 12); $pdf->SetTextColor (8, 62, 115); $pdf->SetXY (370, 20); // $pdf->Text (30, 20, $warengruppe[warenGruppe]); $pdf->SetFont ('Arial', '', 8); $pdf->SetTextColor (0, 0, 0); $sql_kd = "SELECT * FROM kunden WHERE kdID = '$_REQUEST[x]' AND kdNummer = '$_REQUEST[y]'"; $read_kd = mysql_query ($sql_kd); $row_kd = mysql_fetch_object ($read_kd); if ($row_kd->optkdStatus == 1) { if ($row_kd->optkdLogo == 1) { if (file_exists ('../../pictures/logo/' . $row_kd->kdLogo)) { $pdf->Image ('../../pictures/logo/' . $row_kd->kdLogo, 27, 15, 100, 0, jpg); } } } else { $pdf->Image ('../../pictures/logo.jpg', 27, 15, 100, 0, jpg); } //$pdf->Text (30, 41, $artikel[artKText1]); //$pdf->Text (30, 50, $artikel[artKText2]); } function artikel ($pdf, $artikel) { global $pdf; $pic = "SELECT * FROM pic_to_art, pictogramme WHERE pic_to_art.artID = '$_REQUEST[id]' AND pic_to_art.picID = pictogramme.picID ORDER BY pictogramme.picPosition ASC"; $readpic = mysql_query($pic); if (mysql_num_rows($readpic) > 0){ $abstand = 30; } $pdf->SetFont ('Arial', 'B', 16); $pdf->SetTextColor (26, 26, 24); $pdf->Text (30, 70, $artikel[artBez]); if ($artikel[artProduktBild]) { $pdf->Image ('../../pictures/produkte/' . $artikel[artProduktBild], 350, 40, 180, 0, png); } $sql = "SELECT * FROM hauptmerkmale WHERE artID = '$_REQUEST[id]' ORDER BY hmPos ASC"; $read = mysql_query ($sql); $y = 80; $pdf->SetFont ('Arial', '', 9); $pdf->SetTextColor (8, 62, 115); //$pdf->Text (270, $y, 'Produktmerkmale:'); $pdf->SetTextColor (0, 0, 0); $pdf->SetFont ('Arial', 'B', 9); $y = $y + 2; while ($row = mysql_fetch_array ($read)) { if (is_array ($row)) { foreach ($row as $key => $value) { $row[$key] = str_replace ("ü", "", $row[$key]); $row[$key] = str_replace ("Ü", "", $row[$key]); $row[$key] = str_replace ("ä", "", $row[$key]); $row[$key] = str_replace ("Ä", "", $row[$key]); $row[$key] = str_replace ("ö", "", $row[$key]); $row[$key] = str_replace ("Ö", "", $row[$key]); $row[$key] = str_replace (" ", " ", $row[$key]); $row[$key] = str_replace (""", "\"", $row[$key]); $row[$key] = str_replace ("ß", "", $row[$key]); $row[$key] = str_replace ("&", "&", $row[$key]); } } $y = $y + 12; $pdf->Text (30, $y, ' ' . $row[hmBeschreibung]); } $pdf->SetFont ('Arial', '', 9); $pdf->SetTextColor (8, 62, 115); //$pdf->Text (30, 200, 'Beschreibung:'); $pdf->SetXY (27, 180); $pdf->SetTextColor (0, 0, 0); $pdf->SetFont ('Arial', '', 8); $pdf->MultiCell (0, 10, strip_tags ($artikel[artAusText])); $y = $pdf->GetY(); while ($rowpic = mysql_fetch_object($readpic)){ $pdf->Image ('../../pictures/pictogramme/'. $rowpic->picFile, 27 + $abstand_left, $y + 10, 35, 0, png); $abstand_left += 40; } } function tech_daten ($pdf, $artikel, $warengruppe, $td, $zubehoer, $stand, $seite, $aenderungen) { global $pdf; $pic = "SELECT * FROM pic_to_art WHERE artID = '$_REQUEST[id]'"; $readpic = mysql_query($pic); if (mysql_num_rows($readpic) > 0){ $abstand = 30; } $x = 27; $y = 270 + $abstand; $pdf->SetFont ('Arial', '', 9); $pdf->SetFillColor (191, 231, 248); $pdf->SetXY ($x, $y); $pdf->Cell (260, 15, $td[$_SESSION[language]], 0, 1, L, 1); $sql = "SELECT technische_daten.tdWerte as tdWerte, merkmal.merkmalBeschreibung as merkmalBeschreibung FROM technische_daten, merkmal WHERE technische_daten.artID = '$_REQUEST[id]' AND merkmal.merkmalID = technische_daten.merkmalID ORDER BY merkmal.merkmalPos"; $read = mysql_query ($sql); $l = 0; $y += 18; $pdf->SetFont ('Arial', '', 8); while ($row = mysql_fetch_array ($read)) { if (is_array ($row)) { foreach ($row as $key => $value) { $row[$key] = str_replace ("ü", "", $row[$key]); $row[$key] = str_replace ("Ü", "", $row[$key]); $row[$key] = str_replace ("ä", "", $row[$key]); $row[$key] = str_replace ("Ä", "", $row[$key]); $row[$key] = str_replace ("ö", "", $row[$key]); $row[$key] = str_replace ("Ö", "", $row[$key]); $row[$key] = str_replace (" ", " ", $row[$key]); $row[$key] = str_replace (""", "\"", $row[$key]); $row[$key] = str_replace ("ß", "", $row[$key]); $row[$key] = str_replace ("&", "&", $row[$key]); $row[$key] = str_replace ("
", "\r\n", $row[$key]); } } $l++; if ($l % 2 == 1) { $pdf->SetFillColor (242, 241, 241); } else { $pdf->SetFillColor (204, 204, 204); } $pdf->SetXY ($x + 131, $y); $pdf->MultiCell (129, 15, $row[tdWerte], 0, L, 1); $gy = $pdf->GetY (); $pdf->SetXY ($x, $y); $pdf->MultiCell (128, $gy - $y, '', 0, L, 1); $pdf->SetXY ($x, $y); $pdf->MultiCell (128, 15, $row[merkmalBeschreibung], 0, L, 1); $y = $gy + 3; $page = $pdf->PageNo (); if ($y > 740 && $x == 27 && $page == 1) { $y = 270 + $abstand; $x = 300; } if ($y > 740 && $x == 27 && $page > 1) { $y = 100; $x = 300; } if ($y > 740 && $x == 300) { $pdf->AddPage (); page::head ($pdf, $artikel, $warengruppe); page::foot ($pdf, $stand, $seite, $aenderungen); $y = 100; $x = 27; $pdf->SetFont ('Arial', 'B', 16); $pdf->SetTextColor (26, 26, 24); $pdf->Text (30, 80, $artikel[artBez]); $pdf->SetFont ('Arial', '', 8); $pdf->SetTextColor (0, 0, 0); } } $y += 5; if ($x == 27) { $x = 300; $y = 275 + $abstand; } if ($artikel[artMZeichnung]) { list($swidth, $sheight) = getimagesize('../../pictures/produkte/' . $artikel[artMZeichnung]); $bildhoehe = ceil(260 * $sheight / $swidth); if (($y + $bildhoehe) > 760) { $pdf->AddPage (); page::head ($pdf, $artikel, $warengruppe); page::foot ($pdf, $stand, $seite, $aenderungen); $y = 100; $x = 27; $pdf->SetFont ('Arial', 'B', 16); $pdf->SetTextColor (26, 26, 24); $pdf->Text (30, 80, $artikel[artBez]); } $pdf->Image ('../../pictures/produkte/' . $artikel[artMZeichnung], $x, $y, 260, 0, jpg); $y += $bildhoehe; } $sql = "SELECT artikel.artBez as artBez, artikel.artNummer as artNummer, artikel.artKText1 as artKText FROM artikel, zubehoer WHERE zubehoer.artID = '$_REQUEST[id]' AND artikel.artID = zubehoer.zubehoerID ORDER BY artikel.artPos ASC"; $read = mysql_query ($sql); $az = mysql_num_rows ($read); $sy = $az * 15; if ($az > 0) { if ($y > (700 - $sy) && $x == 300) { $pdf->AddPage (); page::head ($pdf, $artikel, $warengruppe); page::foot ($pdf, $stand, $seite, $aenderungen); $y = 100; $x = 27; $pdf->SetFont ('Arial', 'B', 12); $pdf->SetTextColor (8, 62, 115); $pdf->Text (30, 90, $artikel[artBez]); } $pdf->SetXY ($x, $y); $pdf->SetFillColor (191, 231, 248); if (mysql_num_rows ($read) > 0) { $pdf->SetFont ('Arial', '', 9); $pdf->Cell (260, 15, $zubehoer[$_SESSION[language]], 0, 1, L, 1); $pdf->SetFont ('Arial', '', 8); } $l = 0; $y += 18; while ($row = mysql_fetch_array ($read)) { if (is_array ($row)) { foreach ($row as $key => $value) { $row[$key] = str_replace ("ü", "", $row[$key]); $row[$key] = str_replace ("Ü", "", $row[$key]); $row[$key] = str_replace ("ä", "", $row[$key]); $row[$key] = str_replace ("Ä", "", $row[$key]); $row[$key] = str_replace ("ö", "", $row[$key]); $row[$key] = str_replace ("Ö", "", $row[$key]); $row[$key] = str_replace (" ", " ", $row[$key]); $row[$key] = str_replace (""", "\"", $row[$key]); $row[$key] = str_replace ("ß", "", $row[$key]); $row[$key] = str_replace ("&", "&", $row[$key]); } } $l++; if ($l % 2 == 1) { $pdf->SetFillColor (242, 241, 241); } else { $pdf->SetFillColor (204, 204, 204); } $pdf->SetXY ($x + 131, $y); $pdf->MultiCell (129, 15, $row[artKText], 0, L, 1); $gy = $pdf->GetY (); $pdf->SetXY ($x, $y); $pdf->MultiCell (128, $gy - $y, '', 0, L, 1); $pdf->SetXY ($x, $y); $pdf->MultiCell (128, 15, $row[artBez], 0, L, 1); $y = $gy + 3; $page = $pdf->PageNo (); if ($y > 750 && $x == 27 && $page == 1) { $y = 270 + $abstand; $x = 300; } if ($y > 750 && $x == 27 && $page > 1) { $y = 100; $x = 300; } if ($y > 750 && $x == 300) { $pdf->AddPage (); page::head ($pdf, $artikel, $warengruppe); page::foot ($pdf, $stand, $seite, $aenderungen); $y = 100; $x = 27; $pdf->SetFont ('Arial', 'B', 12); $pdf->SetTextColor (0, 0, 0); $pdf->Text (30, 90, $artikel[artBez]); $pdf->SetFont ('Arial', '', 8); $pdf->SetTextColor (0, 0, 0); } } } } function foot ($pdf, $stand, $seite, $aenderungen) { global $pdf; $sql = "SELECT DATE_FORMAT(stand, '%d.%c.%Y') as stand FROM stand WHERE artID = '$_REQUEST[id]'"; $read = mysql_query ($sql); $row = mysql_fetch_object ($read); $pdf->SetLineWidth (0.5); $pdf->SetDrawColor (204, 204, 204); $pdf->Line (27, 817, 560, 817); $pdf->SetFont ('Arial', '', 7); $pdf->SetTextColor (0, 158, 227); $pdf->SetY (797); $pdf->SetFont ('Arial', '', 8); $sql_kd = "SELECT * FROM kunden WHERE kdID = '$_REQUEST[x]' AND kdNummer = '$_REQUEST[y]'"; $read_kd = mysql_query ($sql_kd); $row_kd = mysql_fetch_object ($read_kd); if ($row_kd->optkdStatus == 1) { $firmenanschrift = ''; if ($row_kd->optkdFirma == 1) { $firmenanschrift .= $row_kd->kdFirma . ' | '; } if ($row_kd->optkdAnsprechpartner == 1) { $firmenanschrift .= $row_kd->kdAnsprechpartner . ' | '; } if ($row_kd->optkdStrasse == 1) { $firmenanschrift .= $row_kd->kdStrasse . ' | '; } if ($row_kd->optplzstr == 1) { $firmenanschrift .= $row_kd->kdPlz . ' ' . $row_kd->kdOrt; } $pdf->Cell (535, 0, $firmenanschrift, 0, 1, C); $pdf->SetY (807); $kontaktzeile = ''; if ($row_kd->optkdTelefon == 1) { $kontaktzeile .= 'Tel.: ' . $row_kd->kdTelefon . ' | '; } if ($row_kd->optkdTelefax == 1) { $kontaktzeile .= 'Fax: ' . $row_kd->kdTelefax . ' | '; } if ($row_kd->optkdEmail == 1) { $kontaktzeile .= $row_kd->kdEmail . ' | '; } if ($row_kd->optkdInternet == 1) { $kontaktzeile .= $row_kd->kdInternet; } $pdf->Cell (535, 0 , $kontaktzeile, 0, 1, C); } else { // $pdf->Cell (535, 0, 'lunaHD GmbH | Lange Wand 3 | 33719 Bielefeld', 0, 1, C); // $pdf->SetY (807); // $pdf->Cell (535, 0, 'Tel. +49 521 5560030-0 | FAX: +49 521 5560030-9 | info@luna-hd.de', 0, 1, C); } $pdf->SetY (825); $pdf->SetFont ('Arial', '', 7); $pdf->Cell (544, 0, $aenderungen[$_SESSION[language]], 0, 1, C); $pdf->Cell (544, 0, ' lunaHD GmbH', 0, 1, L); $pdf->Cell (544, 0, $stand[$_SESSION[language]] . $row->stand . ' | ' . $seite[$_SESSION[language]] .' '. $pdf->PageNo () . '/{nb}', 0, 1, R); $pdf->SetFont ('Arial', '', 9); $pdf->SetTextColor (0, 0, 0); } function output ($pdf, $artikel, $db) { $sql = "SELECT * FROM artikel WHERE artID = '$_REQUEST[id]'"; $read = mysql_query ($sql); $row = mysql_fetch_object ($read); global $pdf; global $artikel; $pdf->Output ($db[$_SESSION[language]] . '_' . $row->artBez . '.pdf', 'D'); $pdf->Close (); } } ?>