setMimeEncoding('application/pdf'); $date = gmdate('D, d M Y H:i:s',time()).' GMT'; $document->setModifiedDate($date); header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); $modelSettings =& $this->getModel('settings'); $batchIds = JRequest::getVar('batchIds',array()); $modelShippingBatchs =& $this->getModel('shippingbatchs'); if ($this->_layout == 'labels') { $batches =& $modelShippingBatchs->getExpeditionLabelsData($batchIds); $document->_margin_top= 0; $document->_margin_bottom=0; $document->_margin_left=0; $document->_margin_right=0; $pdf = new ExpeditionPDF(); $pdf->SetAutoPageBreak(TRUE, $document->_margin_bottom); $modelSettings =& $this->getModel('settings'); $this->assignRef('settings',$modelSettings); $pdf->SetMargins($document->_margin_left, $document->_margin_top, $document->_margin_right); $pdf->SetHeaderMargin($document->_margin_header); $pdf->SetFooterMargin($document->_margin_footer); $pdf->generateLabels($batches); } $dateNow = new JDate(); $dateNow->setOffset(date('Z')/3600.0); $fechaS = $dateNow->toFormat('%Y%m%d_%H%M%S'); $dir = $_SERVER['DOCUMENT_ROOT'] . '/components/com_vxc/labels/'; @mkdir($dir,0777,true); $filename = 'expLabels'.$fechaS.'.pdf'; $this->assignRef('filename',$filename); $this->assignRef('pdf',$pdf); parent::display($tpl); }// function }// class ?>