public function pdfObjectsDetails($result) { global $dateformat, $baseURL, $instDir, $objObserver, $loggedUser, $objLocation, $objInstrument, $objPresentations; $result = $this->sortResult($result); $pdf = new Cezpdf('a4', 'landscape'); $pdf->selectFont($instDir . 'lib/fonts/Helvetica.afm'); $bottom = 40; $bottomsection = 30; $top = 550; $header = 570; $footer = 10; $xleft = 20; $xmid = 431; $fontSizeSection = 10; $fontSizeText = 8; $descriptionLeadingSpace = 20; $sectionBarSpace = 3; $deltalineSection = 2; $deltaline = $fontSizeText + 4; $pagenr = 0; $y = 0; $xbase = $xmid; $sectionBarHeight = $fontSizeSection + 4; $SectionBarWidth = 400 + $sectionBarSpace; $theDate = date('d/m/Y'); $pdf->addTextWrap($xleft, $header, 100, 8, utf8_decode($theDate)); if ($loggedUser && $objObserver->getObserverProperty($loggedUser, 'name') && $objLocation->getLocationPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdlocation'), 'name') && $objInstrument->getInstrumentPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdtelescope'), 'name')) { $pdf->addTextWrap($xleft, $footer, $xmid + $SectionBarWidth, 8, utf8_decode(html_entity_decode(LangPDFMessage19 . $objObserver->getObserverProperty($loggedUser, 'firstname') . ' ' . $objObserver->getObserverProperty($loggedUser, 'name') . ' ' . LangPDFMessage20 . $objInstrument->getInstrumentPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdtelescope'), 'name') . ' ' . LangPDFMessage21 . $objLocation->getLocationPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdlocation'), 'name'))), 'center'); } $pdf->addTextWrap($xleft, $header, $xmid + $SectionBarWidth, 10, utf8_decode(html_entity_decode($_GET['pdfTitle'])), 'center'); $pdf->addTextWrap($xmid + $SectionBarWidth - $sectionBarSpace - 100, $header, 100, 8, utf8_decode(LangPDFMessage22 . '1'), 'right'); while (list($key, $valueA) = each($result)) { $con = $valueA['objectconstellation']; if ($y < $bottom) { $y = $top; if ($xbase == $xmid) { if ($pagenr++) { $pdf->newPage(); $pdf->addTextWrap($xleft, $header, 100, 8, utf8_decode($theDate)); if ($loggedUser && $objObserver->getObserverProperty($loggedUser, 'name') && $objLocation->getLocationPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdlocation'), 'name') && $objInstrument->getInstrumentPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdtelescope'), 'name')) { $pdf->addTextWrap($xleft, $footer, $xmid + $SectionBarWidth, 8, utf8_decode(html_entity_decode(LangPDFMessage19 . $objObserver->getObserverProperty($loggedUser, 'name') . ' ' . $objObserver->getObserverProperty($loggedUser, 'firstname') . ' ' . LangPDFMessage20 . $objInstrument->getInstrumentPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdtelescope'), 'name') . ' ' . LangPDFMessage21 . $objLocation->getLocationPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdlocation'), 'name'))), 'center'); } $pdf->addTextWrap($xleft, $header, $xmid + $SectionBarWidth, 10, utf8_decode(html_entity_decode($_GET['pdfTitle'])), 'center'); $pdf->addTextWrap($xmid + $SectionBarWidth - $sectionBarSpace - 100, $header, 100, 8, utf8_decode(LangPDFMessage22 . $pagenr), 'right'); } $xbase = $xleft; } else { $xbase = $xmid; } } $pdf->addTextWrap($xbase, $y, 30, $fontSizeText, utf8_decode($valueA['objectseen'])); // seen $pdf->addTextWrap($xbase + 30, $y, 40, $fontSizeText, utf8_decode($valueA['objectlastseen'])); // last seen $pdf->addTextWrap($xbase + 70, $y, 85, $fontSizeText, utf8_decode('<b>' . '<c:alink:' . $baseURL . 'index.php?indexAction=detail_object&object=' . urlencode($valueA['objectname']) . '>' . $valueA['showname'])); // object $pdf->addTextWrap($xbase + 150, $y, 30, $fontSizeText, utf8_decode('</c:alink></b>' . $valueA['objecttype'])); // type $pdf->addTextWrap($xbase + 180, $y, 20, $fontSizeText, utf8_decode($valueA['objectconstellation'])); // constellation $pdf->addTextWrap($xbase + 200, $y, 17, $fontSizeText, utf8_decode($objPresentations->presentationInt1($valueA['objectmagnitude'], 99.90000000000001, '')), 'left'); // mag $pdf->addTextWrap($xbase + 217, $y, 18, $fontSizeText, utf8_decode($objPresentations->presentationInt1($valueA['objectsurfacebrightness'], 99.90000000000001, '')), 'left'); // sb $pdf->addTextWrap($xbase + 235, $y, 60, $fontSizeText, utf8_decode($objPresentations->raToStringHM($valueA['objectra']) . ' ' . $objPresentations->decToString($valueA['objectdecl'], 0))); // ra - decl $pdf->addTextWrap($xbase + 295, $y, 55, $fontSizeText, utf8_decode($valueA['objectsize'] . '/' . $objPresentations->presentationInt($valueA['objectpa'], 999, "-"))); // size $pdf->addTextWrap($xbase + 351, $y, 17, $fontSizeText, utf8_decode($objPresentations->presentationInt1($valueA['objectcontrast'], '', '')), 'left'); // contrast $pdf->addTextWrap($xbase + 368, $y, 17, $fontSizeText, utf8_decode((int) $valueA['objectoptimalmagnification']), 'left'); // magnification $pdf->addTextWrap($xbase + 380, $y, 20, $fontSizeText, utf8_decode('<b>' . $valueA[$loggedUser ? $objObserver->getObserverProperty($loggedUser, 'standardAtlasCode', 'urano') : 'urano'] . '</b>'), 'right'); // atlas page $y -= $deltaline; if (array_key_exists('objectlistdescription', $valueA) && $valueA['objectlistdescription']) { $theText = $objPresentations->br2nl($valueA['objectlistdescription']); $theText = $pdf->addTextWrap($xbase + $descriptionLeadingSpace, $y, $xmid - $xleft - $descriptionLeadingSpace - 10, $fontSizeText, '<i>' . utf8_decode($theText)); $y -= $deltaline; while ($theText) { if ($y < $bottomsection) { $y = $top; if ($xbase == $xmid) { if ($pagenr++) { $pdf->newPage(); $pdf->addTextWrap($xleft, $header, 100, 8, utf8_decode($theDate)); if ($objObserver->getObserverProperty($loggedUser, 'name') && $objLocation->getLocationPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdlocation'), 'name') && $objInstrument->getInstrumentPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdtelescope'), 'name')) { $pdf->addTextWrap($xleft, $footer, $xmid + $SectionBarWidth, 8, utf8_decode(html_entity_decode(LangPDFMessage19 . $objObserver->getObserverProperty($loggedUser, 'name') . ' ' . $objObserver->getObserverProperty($loggedUser, 'firstname') . LangPDFMessage20 . $objInstrument->getInstrumentPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdtelescope'), 'name') . ' ' . LangPDFMessage21 . $objLocation->getLocationPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdlocation'), 'name'))), 'center'); } $pdf->addTextWrap($xleft, $header, $xmid + $SectionBarWidth, 10, utf8_decode(html_entity_decode($_GET['pdfTitle'])), 'center'); $pdf->addTextWrap($xmid + $SectionBarWidth - $sectionBarSpace - 100, $header, 100, 8, utf8_decode(LangPDFMessage22 . $pagenr), 'right'); } $xbase = $xleft; if ($sort) { $y -= $deltalineSection; $pdf->rectangle($xbase - $sectionBarSpace, $y - $sectionBarSpace, $SectionBarWidth, $sectionBarHeight); $pdf->addText($xbase, $y, $fontSizeSection, utf8_decode($GLOBALS[${$sort}])); $y -= $deltaline + $deltalineSection; } } else { $xbase = $xmid; if ($sort) { $y -= $deltalineSection; $pdf->rectangle($xbase - $sectionBarSpace, $y - $sectionBarSpace, $SectionBarWidth, $sectionBarHeight); $pdf->addText($xbase, $y, $fontSizeSection, utf8_decode($GLOBALS[${$sort}])); $y -= $deltaline + $deltalineSection; } } } $theText = $pdf->addTextWrap($xbase + $descriptionLeadingSpace, $y, $xmid - $xleft - $descriptionLeadingSpace - 10, $fontSizeText, utf8_decode($theText)); $y -= $deltaline; } $pdf->addText(0, 0, 10, '</i>'); } elseif (array_key_exists('objectdescription', $valueA) && $valueA['objectdescription']) { $theText = $objPresentations->br2nl($valueA['objectdescription']); $theText = $pdf->addTextWrap($xbase + $descriptionLeadingSpace, $y, $xmid - $xleft - $descriptionLeadingSpace - 10, $fontSizeText, '<i>' . utf8_decode($theText)); $y -= $deltaline; while ($theText) { if ($y < $bottomsection) { $y = $top; if ($xbase == $xmid) { if ($pagenr++) { $pdf->newPage(); $pdf->addTextWrap($xleft, $header, 100, 8, utf8_decode($theDate)); if ($objObserver->getObserverProperty($loggedUser, 'name') && $objLocation->getLocationPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdlocation'), 'name') && $objInstrument->getInstrumentPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdtelescope'), 'name')) { $pdf->addTextWrap($xleft, $footer, $xmid + $SectionBarWidth, 8, utf8_decode(html_entity_decode(LangPDFMessage19 . $objObserver->getObserverProperty($loggedUser, 'name') . ' ' . $objObserver->getObserverProperty($loggedUser, 'firstname') . LangPDFMessage20 . $objInstrument->getInstrumentPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdtelescope'), 'name') . ' ' . LangPDFMessage21 . $objLocation->getLocationPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdlocation'), 'name'))), 'center'); } $pdf->addTextWrap($xleft, $header, $xmid + $SectionBarWidth, 10, utf8_decode(html_entity_decode($_GET['pdfTitle'])), 'center'); $pdf->addTextWrap($xmid + $SectionBarWidth - $sectionBarSpace - 100, $header, 100, 8, utf8_decode(LangPDFMessage22 . $pagenr), 'right'); } $xbase = $xleft; if ($sort) { $y -= $deltalineSection; $pdf->rectangle($xbase - $sectionBarSpace, $y - $sectionBarSpace, $SectionBarWidth, $sectionBarHeight); $pdf->addText($xbase, $y, $fontSizeSection, utf8_decode($GLOBALS[${$sort}])); $y -= $deltaline + $deltalineSection; } } else { $xbase = $xmid; if ($sort) { $y -= $deltalineSection; $pdf->rectangle($xbase - $sectionBarSpace, $y - $sectionBarSpace, $SectionBarWidth, $sectionBarHeight); $pdf->addText($xbase, $y, $fontSizeSection, utf8_decode($GLOBALS[${$sort}])); $y -= $deltaline + $deltalineSection; } } } $theText = $pdf->addTextWrap($xbase + $descriptionLeadingSpace, $y, $xmid - $xleft - $descriptionLeadingSpace - 10, $fontSizeText, utf8_decode($theText)); $y -= $deltaline; } $pdf->addText(0, 0, 10, '</i>'); } } $pdf->Stream(); }