public function reportUnsubscibePDFAction()
 {
     $this->accessRights(20);
     //Accept Parent Module, Return Main Menu Lists with Active Menu Indicator
     $this->adapter = $this->getServiceLocator()->get('Zend\\Db\\Adapter\\Adapter');
     $pdf = new PdfModel();
     $pdf->setOption('filename', 'unsubscribed-report');
     // Triggers PDF download, automatically appends ".pdf"
     $pdf->setOption('paperSize', 'a4');
     // Defaults to "8x11"
     $pdf->setOption('paperOrientation', 'portrait');
     // Defaults to "portrait"
     $pdf->setTemplate('report/unsubscribed_report_pdf');
     $this->adapter = $this->getServiceLocator()->get('Zend\\Db\\Adapter\\Adapter');
     $usform = new MandrillInfoForm();
     //Get Post Data & Redirect to Filter Function
     $request = $this->getRequest();
     //Get form object
     if ($request->isPost()) {
         $from = $_POST['unsubscribe_from'];
         $to = $_POST['unsubscribe_to'];
         $usform->get('from')->setValue($from);
         $usform->get('to')->setValue($to);
         $result = $this->getUnsubscribeTable()->UnsubscribeList($this->adapter, $from, $to);
     }
     $pdf->setVariables(array('header' => 'Unsubscribed Report', 'unsubscribe_table' => $result));
     $this->downloadFile('unsubscribed-report.pdf');
     //Download File
     return $pdf;
 }
 public function indexAction()
 {
     /**
      * Definindo o layout padrão do boleto
      */
     $this->layout('layout/boleto');
     $request = $this->getRequest();
     $form = new \PhpBoletoZf2\Form\Boleto();
     if ($request->isPost()) {
         $form->setData($request->getPost());
         if ($form->isValid()) {
             $data = $form->getData();
             $boleto = new BoletoBradesco($data);
             $sacado = new Sacado($data);
             $bradesco = $this->getServiceLocator()->get('Boleto\\Bradesco');
             $bradesco->setSacado($sacado)->setBoleto($boleto);
             $dados = $bradesco->prepare();
         }
     }
     switch ($this->params()->fromRoute('format')) {
         case 'html':
         default:
             return new ViewModel(array('dados' => $dados));
             break;
         case 'pdf':
             $pdf = new PdfModel();
             $pdf->setOption('filename', 'boleto-bradesco');
             $pdf->setOption('enable_remote', true);
             $pdf->setOption('paperSize', 'a4');
             // Defaults to "8x11"
             $pdf->setVariables(array('boleto' => $boleto));
             return $pdf;
             break;
     }
 }
Example #3
0
 public function dailyAction()
 {
     $objectManager = $this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager');
     $day = $this->params()->fromQuery('day', null);
     if ($day) {
         $criteria = Criteria::create()->where(Criteria::expr()->isNull('parent'))->andWhere(Criteria::expr()->eq('system', false))->orderBy(array('place' => Criteria::ASC));
         $cats = $objectManager->getRepository('Application\\Entity\\Category')->matching($criteria);
         $eventsbycats = array();
         foreach ($cats as $cat) {
             $category = array();
             $category['name'] = $cat->getName();
             $category['events'] = $objectManager->getRepository('Application\\Entity\\Event')->getEvents($this->zfcUserAuthentication(), $day, null, true, array($cat->getId()));
             $category['childs'] = array();
             foreach ($cat->getChildren() as $subcat) {
                 $subcategory = array();
                 $subcategory['events'] = $objectManager->getRepository('Application\\Entity\\Event')->getEvents($this->zfcUserAuthentication(), $day, null, true, array($subcat->getId()));
                 $subcategory['name'] = $subcat->getName();
                 $category['childs'][] = $subcategory;
             }
             $eventsbycats[] = $category;
         }
         $pdf = new PdfModel();
         $pdf->setVariables(array('events' => $eventsbycats, 'day' => $day));
         $pdf->setOption('paperSize', 'a4');
         $formatter = \IntlDateFormatter::create(\Locale::getDefault(), \IntlDateFormatter::FULL, \IntlDateFormatter::FULL, 'UTC', \IntlDateFormatter::GREGORIAN, 'dd_LL_yyyy');
         $pdf->setOption('filename', 'rapport_du_' . $formatter->format(new \DateTime($day)));
         return $pdf;
     } else {
         // erreur
     }
 }
 /**
  * @return PdfModel
  */
 public function indexAction()
 {
     $em = $this->getServiceLocator()->get('doctrine.entitymanager.orm_default');
     $id = $this->params()->fromRoute('id');
     $helper = new AlboPretorioControllerHelper();
     $records = $helper->recoverWrapperRecordsById(new AlboPretorioArticoliGetterWrapper(new AlboPretorioArticoliGetter($em)), array('id' => $id, 'limit' => 1), $id);
     $pdf = new PdfModel();
     $pdf->setOption('filename', 'albo-pretorio-relata-atto-' . $records[0]['id']);
     $pdf->setOption('paperSize', 'a4');
     $pdf->setOption('paperOrientation', 'landscape');
     $pdf->setVariables(array('record' => $records[0]));
     return $pdf;
 }
 public function pdfAction()
 {
     $id = (int) $this->params()->fromRoute('id', 0);
     $download = (int) $this->params()->fromQuery('download', 0);
     if (!$id) {
         return $this->redirect()->toRoute('welcome', array('action' => 'index'));
     }
     $news = $this->getNewsTable()->getNews($id);
     $pdf = new PdfModel();
     if ($download === 1) {
         $pdf->setOption('filename', rand(111111, 99999999));
     }
     $pdf->setOption('paperSize', 'a4');
     $pdf->setVariables(array('id' => $id, 'news' => $news));
     return $pdf;
 }
Example #6
0
 public function createpdfAction()
 {
     $data = $_POST;
     header('Content-type: text/html; charset=UTF-8');
     //            /*
     $pdf = new PdfModel();
     $pdf->setVariables(array('blueprint' => $data['blueprint'], 'order_table' => $data['order_table']));
     return $pdf;
     //           */
     /*
      return new ViewModel(array(
                'blueprint' => $data['blueprint'],
     
       ));
     */
 }
 /**
  * PDF export
  *
  * @return PdfModel|\Zend\Http\Response
  * @throws \ModelModule\Model\NullException
  */
 public function pdfAction()
 {
     if ($this->getRequest()->isPost()) {
         $this->initializeFrontendWebsite();
         $em = $this->getServiceLocator()->get('doctrine.entitymanager.orm_default');
         $wrapper = new StatoCivileGetterWrapper(new StatoCivileGetter($em));
         $wrapper->setInput(array('numero' => isset($post['numero']) ? $post['numero'] : null, 'anno' => isset($post['anno']) ? $post['anno'] : null, 'sezioneId' => isset($post['sezione']) ? $post['sezione'] : null, 'noScaduti' => isset($post['expired']) ? $post['expired'] : null, 'textSearch' => isset($post['testo']) ? $post['testo'] : null, 'orderBy' => 'sca.id DESC', 'limit' => 1500));
         $wrapper->setupQueryBuilder();
         $records = $wrapper->getRecords();
         $pdf = new PdfModel();
         $pdf->setOption('filename', 'stato-civile-' . date("dmYHis"));
         $pdf->setOption('paperSize', 'a4');
         $pdf->setOption('paperOrientation', 'landscape');
         $pdf->setVariables(array('records' => $records, 'sitename' => $this->layout()->getVariable('sitename')));
         return $pdf;
     }
     return $this->redirectForUnvalidAccess();
 }
 public function pdfAction()
 {
     $this->initializeFrontendWebsite();
     $id = $this->params()->fromRoute('id');
     $em = $this->getServiceLocator()->get('doctrine.entitymanager.orm_default');
     $helper = new ContenutiControllerHelper();
     $wrapper = $helper->recoverWrapperById(new ContenutiGetterWrapper(new ContenutiGetter($em)), array('id' => $id, 'limit' => 1), $id);
     $wrapper->setEntityManager($em);
     $records = $wrapper->addAttachmentsFromRecords($wrapper->getRecords(), array());
     if (empty($records)) {
         return $this->redirectForUnvalidAccess();
     }
     $pdf = new PdfModel();
     $pdf->setOption('filename', Slugifier::slugify($records[0]['titolo']));
     $pdf->setOption('paperSize', 'a4');
     $pdf->setOption('paperOrientation', 'landscape');
     $pdf->setVariables(array('record' => !empty($records) ? $records[0] : null, 'sitename' => $this->layout()->getVariable('sitename')));
     $pdf->setTemplate('common/export/contenuti/contenuti-single-pdf.phtml');
     return $pdf;
 }
 public function reportBuCsrPDFAction()
 {
     $this->accessRights(20);
     //Accept Parent Module, Return Main Menu Lists with Active Menu Indicator
     $pdf = new PdfModel();
     $pdf->setOption('filename', 'bu-csr-overall-report');
     // Triggers PDF download, automatically appends ".pdf"
     $pdf->setOption('paperSize', 'a4');
     // Defaults to "8x11"
     $pdf->setOption('paperOrientation', 'landscape');
     // Defaults to "portrait"
     $pdf->setTemplate('report/bu_csr_overall_pdf');
     //Get Post Data & Redirect to Filter Function
     $request = $this->getRequest();
     //Get form object
     if ($request->isPost()) {
         // To set view variables
         $pdf->setVariables(array('title' => 'BU-CSR Report: Overall Report', 'header' => 'Overall Report', 'media_value_image' => $request->getPost('media_value_image'), 'hits_image' => $request->getPost('hits_image')));
     }
     $this->downloadFile('bu-csr-overall-report.pdf');
     //Download File
     return $pdf;
 }
Example #10
0
 public function dailyAction()
 {
     $objectManager = $this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager');
     $day = $this->params()->fromQuery('day', null);
     if ($day) {
         $daystart = new \DateTime($day);
         $offset = $daystart->getTimezone()->getOffset($daystart);
         $daystart->setTimezone(new \DateTimeZone('UTC'));
         $daystart->add(new \DateInterval("PT" . $offset . "S"));
         $daystart->setTime(0, 0, 0);
         $dayend = new \DateTime($day);
         $dayend->setTimezone(new \DateTimeZone('UTC'));
         $dayend->add(new \DateInterval("PT" . $offset . "S"));
         $dayend->setTime(23, 59, 59);
         $criteria = Criteria::create()->where(Criteria::expr()->isNull('parent'))->andWhere(Criteria::expr()->eq('system', false))->orderBy(array('place' => Criteria::ASC));
         $cats = $objectManager->getRepository('Application\\Entity\\Category')->matching($criteria);
         $eventsbycats = array();
         foreach ($cats as $cat) {
             $category = array();
             $category['name'] = $cat->getName();
             //évènements lisibles par l'utilisateur, du jour spécifié, de la catégorie et non supprimés
             $category['events'] = $objectManager->getRepository('Application\\Entity\\Event')->getEvents($this->zfcUserAuthentication(), $day, null, null, true, array($cat->getId()), array(1, 2, 3, 4));
             $category['childs'] = array();
             foreach ($cat->getChildren() as $subcat) {
                 $subcategory = array();
                 $subcategory['events'] = $objectManager->getRepository('Application\\Entity\\Event')->getEvents($this->zfcUserAuthentication(), $day, null, null, true, array($subcat->getId()), array(1, 2, 3, 4));
                 $subcategory['name'] = $subcat->getName();
                 $category['childs'][] = $subcategory;
             }
             $eventsbycats[] = $category;
         }
         $pdf = new PdfModel();
         $pdf->setVariables(array('events' => $eventsbycats, 'day' => $day, 'logs' => $objectManager->getRepository('Application\\Entity\\Log'), 'opsups' => $objectManager->getRepository('Application\\Entity\\Log')->getOpSupsChanges($daystart, $dayend, false, 'ASC')));
         $pdf->setOption('paperSize', 'a4');
         $formatter = \IntlDateFormatter::create(\Locale::getDefault(), \IntlDateFormatter::FULL, \IntlDateFormatter::FULL, 'UTC', \IntlDateFormatter::GREGORIAN, 'dd_LL_yyyy');
         $pdf->setOption('filename', 'rapport_du_' . $formatter->format(new \DateTime($day)));
         return $pdf;
     } else {
         // erreur
     }
 }
 public function exportPdfAction()
 {
     $pdf = new PdfModel();
     $pdf->setOption('filename', 'monthly-report');
     // Triggers PDF download, automatically appends ".pdf"
     $pdf->setOption('paperSize', 'a4');
     // Defaults to "8x11"
     $pdf->setOption('paperOrientation', 'landscape');
     // Defaults to "portrait"
     $pdf->setVariables(array('message' => 'Hello'));
     return $pdf;
     $this->checkAuth();
     $request = $this->getRequest();
     $draw = $request->getPost('draw', 1);
     $start = $request->getPost('start', 0);
     $length = $request->getPost('length', 10);
     $search = $request->getPost('search', '');
     $columns = $request->getPost('columns', '');
     $orders = $request->getPost('order', '');
     $search = $search['value'];
     $tasks = $this->databaseService->getListTask(null, null, $search, $columns, $orders, null, null);
     $data = new DataTablesObject();
     $data->draw = $draw;
     foreach ($tasks as $task) {
         $item = new TaskListItem();
         $item->DT_RowId = $task->id;
         $item->custumer = $task->custumer;
         $item->certificate = $task->certificate;
         $item->process_name = $task->process_name;
         $item->agency_name = $task->agency_name;
         $item->cost_sell = number_format($task->cost_sell);
         $item->custumer_pay = number_format($this->databaseService->getTotalPay($task->id, Config::PAY_CUSTUMER));
         $item->date_open = Date::changeDateSQLtoVN($task->date_open);
         $item->date_end = Date::changeDateSQLtoVN($task->date_end);
         $item->process_name = $task->process_name;
         $item->provider_name = $task->provider_name;
         $item->cost_buy = number_format($task->cost_buy);
         $item->provider_pay = number_format($this->databaseService->getTotalPay($task->id, Config::PAY_PROVIDER));
         $item->date_open_pr = Date::changeDateSQLtoVN($task->date_open_pr);
         $item->date_end_pr = Date::changeDateSQLtoVN($task->date_end_pr);
         $item->assign_name = $task->assign_name;
         $item->reporter_name = $task->reporter_name;
         array_push($data->data, $item);
     }
     echo \Zend\Json\Json::encode($data, false);
     exit;
 }
Example #12
0
 public function exportPdfAction()
 {
     $pdf = new PdfModel();
     $pdf->setVariables($this->exportAction());
     return $pdf;
 }
 public function reportEventListPDFAction()
 {
     $this->accessRights(20);
     //Accept Parent Module, Return Main Menu Lists with Active Menu Indicator
     $pdf = new PdfModel();
     $pdf->setOption('filename', 'event-list-report');
     // Triggers PDF download, automatically appends ".pdf"
     $pdf->setOption('paperSize', 'a4');
     // Defaults to "8x11"
     $pdf->setOption('paperOrientation', 'landscape');
     // Defaults to "portrait"
     $pdf->setTemplate('media-report/event_list_pdf');
     $media_report = new MediaReport($this->serviceLocator());
     $event_list = $media_report->eventList();
     //Get Post Data & Redirect to Filter Function
     $request = $this->getRequest();
     //Get form object
     if ($request->isPost()) {
         // To set view variables
         $pdf->setVariables(array('title' => 'Media Redbook', 'header' => 'Event List', 'event_list_value_image' => $request->getPost('event_list_image'), 'events' => $event_list));
     }
     $this->downloadFile('event-list-report.pdf');
     //Download File
     return $pdf;
 }
 public function exportProfilePdfAction()
 {
     $this->accessRights(17);
     //Accept Parent Module, Return Main Menu Lists with Active Menu Indicator
     $pdf = new PdfModel();
     $pdf->setOption('filename', 'Media-profile-pdf');
     // Triggers PDF download, automatically appends ".pdf"
     $pdf->setOption('paperSize', 'a4');
     // Defaults to "8x11"
     $pdf->setOption('paperOrientation', 'landscape');
     // Defaults to "portrait"
     $pdf->setTemplate('media-profile/media_profile_pdf');
     $id = (int) $this->params()->fromRoute('id', 0);
     //relation or friend of a specific profile
     $relation_name = $this->getMediaProfileTable()->fetchSpecificRelation($this->serviceLocator(), $id);
     //get specific media profile from table
     $media_profile = $this->getMediaProfileTable()->getMediaProfile($this->serviceLocator(), $id);
     //Get Post Data & Redirect to Filter Function
     $request = $this->getRequest();
     //Get form object
     if ($request->isPost()) {
         // To set view variables
         $pdf->setVariables(array('title' => 'Media Redbook', 'header' => 'Media Profile', 'media_profile' => $media_profile, 'media_profile_id' => $id, 'media_profile_educations' => $this->getMediaProfileTable()->getMediaProfileEducation($this->serviceLocator(), $id), 'media_profile_careers' => $this->getMediaProfileTable()->getMediaProfileCareer($this->serviceLocator(), $id), 'media_profile_latest_career' => $this->getMediaProfileTable()->getMediaProfileLatestCareer($this->serviceLocator(), $id), 'access_rights' => $this->getSubModuleAccessRights(17), 'relation_name' => $relation_name));
     }
     $this->downloadFile('media_profile.pdf');
     //Download File
     return $pdf;
 }
 public function visioncronAction()
 {
     ini_set('default_charset', 'UTF-8');
     ini_set('display_errors', 0);
     ini_set('max_execution_time', 0);
     //echo mb_internal_encoding(); exit;
     $sm = $this->getServiceLocator();
     $users = $this->getService()->getUserforPdf();
     $i = 0;
     foreach ($users as $key => $user) {
         try {
             if (isset($user['company_id']) && $user['company_id'] != '') {
                 $pdf = '';
                 $pdfView = '';
                 $eng = '';
                 $detail = array();
                 //if($user['id']==94){
                 $result = $this->getService()->getVisionsInArrayByCompany($user['company_id']);
                 if (!empty($result)) {
                     $m = 0;
                     foreach ($result as $k => $vision) {
                         $perspectives = $this->getPerspectiveService()->viewPerspectiveByVision($vision['id']);
                         $data = array();
                         $res = array();
                         $percentage = array();
                         $milestonesCount = 0;
                         $milestones = '';
                         if (!empty($perspectives)) {
                             foreach ($perspectives as $perspective) {
                                 if (isset($perspective['id'])) {
                                     $data[$perspective['id']]['perspective'] = $perspective['name'];
                                     $goals = $this->getGoalService()->getGoalsAndKpiInArrayByPerspective($perspective['id']);
                                     $data[$perspective['id']]['goals'] = $goals['data'];
                                     $milestonesCount = $goals['count'];
                                     $milestones = $goals['milestones'];
                                 }
                             }
                             foreach ($data as $key1 => $value1) {
                                 foreach ($value1['goals'] as $key2 => $value2) {
                                     foreach ($value2['kpis'] as $key3 => $value3) {
                                         foreach ($value3['milestones'] as $milestone) {
                                             /*$diff = $milestone['actualValue'] - $milestone['targetValue'];
                                               $actual[] = $milestone['actualValue'];
                                               $target[] = $milestone['targetValue'];*/
                                             if ($milestone['actualValue'] != '' && $milestone['targetValue'] != '') {
                                                 $diff = $milestone['actualValue'] - $milestone['targetValue'];
                                                 $diff = abs($diff) / $milestone['targetValue'];
                                                 $percentage[] = number_format($diff * 100, 0, ',', '.');
                                             }
                                         }
                                     }
                                 }
                             }
                             /*$actualv = array_sum($actual);
                               $targetv = array_sum($target);
                               $diff = $actualv - $targetv;*/
                             //print_r($percentage); exit;
                             //echo count($percentage).'ppp'; exit;
                             $average = array_sum($percentage) / count($percentage);
                             $average = number_format($average, 0, ',', '.');
                             if ($average > 10) {
                                 $res['percentage'] = $average;
                                 $res['icon'] = 'icon_signal_red.png';
                                 $res['text'] = 'In Gefahr';
                                 $res['color'] = 'red';
                                 $res['circle'] = 'red_circle.png';
                             } elseif ($average <= 10 && $average >= 5) {
                                 $res['percentage'] = $average;
                                 $res['icon'] = 'icon_signal_orange.png';
                                 $res['text'] = 'Kritisch';
                                 $res['color'] = 'orange';
                                 $res['circle'] = 'orange_circle.png';
                             } elseif ($average == 0) {
                                 $res['percentage'] = $average;
                                 $res['icon'] = 'icon_signal_grey.png';
                                 $res['text'] = 'Kritisch';
                                 $res['color'] = 'grey';
                                 $res['circle'] = 'grey_circle.png';
                             } else {
                                 $res['percentage'] = $average;
                                 $res['icon'] = 'icon_signal_green.png';
                                 $res['text'] = 'Im Plan';
                                 $res['color'] = 'green';
                                 $res['circle'] = 'green_circle.png';
                             }
                             $result[$k]['res'] = $res;
                             // get goals by perspectives
                             $detail[$m]['grid'] = $this->renderPerspectiveGridElement($data, $milestonesCount, $milestones);
                             $detail[$m]['milestones'] = $milestones;
                             $detail[$m]['v_name'] = $vision['name'];
                             $detail[$m]['description'] = $vision['description'];
                             $m++;
                         }
                     }
                     //echo '<pre>'; print_r($result); exit;
                     $pdf = new PdfModel();
                     $pdf->setOption('paperSize', 'a4');
                     // Defaults to "8x11"
                     $pdf->setOption('paperOrientation', 'landscape');
                     // Defaults to "portrait"
                     $pdf->setTerminal(true);
                     //$pdf->setTemplate('application/index/visioncron.phtml');
                     $pdf->setVariables(array('result' => $result, 'detail' => $detail));
                     $pdfView = new ViewModel($pdf);
                     $pdfView->setTerminal(true)->setTemplate('application/index/visioncron.phtml')->setVariables(array('result' => $result, 'detail' => $detail));
                     $html = $this->getServiceLocator()->get('viewpdfrenderer')->getHtmlRenderer()->render($pdfView);
                     $eng = $this->getServiceLocator()->get('viewpdfrenderer')->getEngine();
                     $eng->load_html($html);
                     try {
                         $eng->render();
                     } catch (\Exception $e) {
                         echo $key;
                         die;
                     }
                     $pdfCode = $eng->output();
                     //$file_to_save = $_SERVER['DOCUMENT_ROOT'].'/attachments/vision_detail_'.$key.'.pdf';
                     //file_put_contents($file_to_save, $pdfCode);
                     $eng = new DOMPDF();
                     $this->getServiceLocator()->get('viewpdfrenderer')->setEngine($eng);
                     /*if($i==10){
                           echo $i .'<br /> count = '.count($data);
                           break;
                       }*/
                     $i++;
                     // Email
                     $from = $this->getSenderEmail();
                     $to = $user['login'];
                     //$from = '*****@*****.**';
                     //$to = '*****@*****.**';
                     $subject = "Ihre Strategieübersicht";
                     $textBody = $this->getVisionEmailTemplate($user['first_name'] . ' ' . $user['last_name']);
                     $body = $this->setBodyHtml($textBody, $pdfCode, 'vision_detail_' . time() . '.pdf');
                     $message = new Mail\Message();
                     $message->setFrom($from, 'Incoverage')->addTo($to)->setSubject($subject);
                     $message->setEncoding("UTF-8");
                     $message->setBody($body);
                     $transport = new SmtpTransport();
                     if ($this->getDefaultConfig()['user_module']['using_gmail']) {
                         $transport->setOptions($this->getSMTPOptions());
                     }
                     $transport->send($message);
                     echo '--------Email sent to ' . $user['login'] . ' ------ <br /><br />';
                 }
                 //}
             }
         } catch (Exception $e) {
             echo 'Caught exception: ', $e->getMessage(), "\n";
         }
         //break;
     }
     echo '<br /> Cron Done';
     exit;
 }
 public function generatepdfAction()
 {
     //$id = $this->getRequest()->getPost('id');
     $pdf = new PdfModel();
     $adapter = new NewsListAdapter($this->serviceLocator());
     $id = (int) $this->params()->fromRoute('id');
     $result = iterator_to_array($adapter->getNewsView($id));
     $filename = str_replace(" ", "_", $result[0]['title']);
     $pdf->setOption("filename", $filename);
     $pdf->setVariables(array('news' => $result));
     return $pdf;
 }
 public function perCompanyPDFAction()
 {
     $this->accessRights(20);
     //Accept Parent Module, Return Main Menu Lists with Active Menu Indicator
     $pdf = new PdfModel();
     $pdf->setOption('filename', 'bu_csr_report_per_company' . date('Y-m-d'));
     // Triggers PDF download, automatically appends ".pdf"
     $pdf->setOption('paperSize', 'a4');
     // Defaults to "8x11"
     $pdf->setOption('paperOrientation', 'landscape');
     // Defaults to "portrait"
     $pdf->setTemplate('report/bu_csr_per_company_pdf');
     //Get Post Data & Redirect to Filter Function
     $request = $this->getRequest();
     //Get form object
     //Date Range Function
     $date_from = $request->getPost('date_from');
     $date_to = $request->getPost('date_to');
     //Graph images
     $mv_image = $this->saveTempImg($request->getPost('mv_image'));
     $hits_image = $this->saveTempImg($request->getPost('hits_image'));
     if ($request->isPost()) {
         // To set view variables
         $pdf->setVariables(array('title' => 'BU Overall Report Per Company', 'header' => 'BU Overall Per Company', 'mv_image' => $mv_image, 'hits_image' => $hits_image, 'top_5_media_values' => $this->getBuCsrTable()->top5Values('Media Values', 0, $date_from, $date_to), 'top_5_hits' => $this->getBuCsrTable()->top5Values('Hits', 0, $date_from, $date_to), 'media_values' => $this->getBuCsrTable()->top5Details('Media Values', $date_from, $date_to, $this->getBuCsrTable()->top5Values('Media Values', 0, $date_from, $date_to)), 'hits_values' => $this->getBuCsrTable()->top5Details('Hits', $date_from, $date_to, $this->getBuCsrTable()->top5Values('Hits', 0, $date_from, $date_to))));
     }
     $this->downloadFile('bu-overall-report-per-company.pdf');
     //Download File
     return $pdf;
 }