| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/junkdata/holidays.tripjack.comOLDSEP11bak/library/Helper/ |
Upload File : |
<?php
class Zend_Controller_Action_Helper_Custom extends Zend_Controller_Action_Helper_Abstract {
public function __construct() {
$this->getTravelPlanStatusName = API_CUSTOMER_STATUS_PLAN_TYPE_LIST;
}
public function getStatiPages(){
$this->objMdl = new Admin_Model_CRUD();
$staticPage = $this->objMdl->rv_select_all( 'tbl_static_pages' , ['identifier','page_title'], ['status'=>'Activate'], ['sid'=>'ASC']);
return $staticPage;
}
public function getcontactQuery(){
$this->objMdl = new Admin_Model_CRUD();
$contactquery = $this->objMdl->rv_select_row( 'tbl_query' , ['*'], ['status'=>1], ['id'=>'ASC'] , 1 );
return $contactquery;
}
public function getContactDetailForFooter() {
$this->objMdl = new Admin_Model_CRUD();
$data = $this->objMdl->selectOne("tbl_query", ['*'], ['status' => 1]);
return $data;
}
public function selectSocialLinksForFooterLink() {
$this->objMdl = new Admin_Model_CRUD();
$staticPage = $this->objMdl->rv_select_all("tbl_social_links", ['name', 'link'], ['status' => 1], ['id' => 'DESC'], 10);
return $staticPage;
}
public function staticPageLink() {
$this->objMdl = new Admin_Model_CRUD();
$staticPage = $this->objMdl->rv_select_all('tbl_static_pages', ['identifier', 'page_title'], ['status' => 'Activate' , 'isb2b' => 1 ], ['sid' => 'ASC']);
return $staticPage;
}
public function exportToExcel($sheetTitle, $arrFieldLabel, $arrFieldValue) {
/*if (count($arrFieldLabel) != count($arrFieldValue[0])) {
throw new Exception("Column Count mismatch");
}*/
require_once __DIR__ . '/../PHPExcel/Classes/PHPExcel.php';
$intColCount = count($arrFieldLabel);
$intStartCol = chr(65);
$intEndCol = chr(65 + $intColCount - 1);
//$objPHPExcel = new PHPExcel_Classes_PHPExcel;
$objPHPExcel = new PHPExcel();
// Set document properties
$objPHPExcel->getProperties()->setCreator("Pardeep Panchal")
->setLastModifiedBy("Pardeep Panchal")
->setTitle("Pardeep Panchal")
->setSubject("Pardeep Panchal")
->setDescription("Pardeep Panchal")
->setKeywords("Pardeep Panchal")
->setCategory("Pardeep Panchal");
$objPHPExcel->getActiveSheet()
->getStyle($intStartCol . '1:' . $intEndCol . '1')
->getFill()
->setFillType(PHPExcel_Style_Fill::FILL_SOLID)
->getStartColor()
->setARGB('A6ADA8');
$objPHPExcel->getActiveSheet()->getStyle('C1')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->setCellValue('C1', $sheetTitle);
$rowCount = 2;
/* * *******Setting Label value************ */
$col = 0;
foreach ($arrFieldLabel as $label) {
$objPHPExcel->getActiveSheet()->getColumnDimension($intStartCol)->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getStyle($intStartCol . $rowCount . ':' . $intEndCol . $rowCount)->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowCount, $label);
$col++;
$intStartCol++;
}
/* * *******Setting rowwise coloumn value************ */
$rowCount = 3;
while (list($key, $value) = each($arrFieldValue)) {
$col = 0;
//echo "<pre>";print_r($value);//exit;
foreach ($value as $field) {
$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowCount, $field);
$col++;
}
$rowCount++;
}
// Rename worksheet
$objPHPExcel->getActiveSheet()->setTitle($sheetTitle);
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
$objPHPExcel->setActiveSheetIndex(0);
// Redirect output to a client�s web browser (Excel2007)
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="' . $sheetTitle . '.xlsx"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
ob_end_clean();
$objWriter->save('php://output');
exit;
}
public function getStatiPagesAboutUsContent(){
$this->objMdl = new Admin_Model_CRUD();
$aboutUsPage = $this->objMdl->rv_select_row( 'tbl_static_pages' , ['page_description'], ['identifier'=>'about-us'], ['sid'=>'ASC']);
return $aboutUsPage;
}
}