| 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/dcb/application/controllers/ |
Upload File : |
<?php
/* * *************************************************************
* Catabatic Technology Pvt. Ltd.
* File Name :IndexController.php
* File Description :Index controller for manage home page
* Created By : Prashant Kumar Gupta
* Created Date: 10-September-2024
* ************************************************************* */
class CmsController extends Zend_Controller_Action {
public function init() {
/* Initialize action controller here */
$aConfig = $this->getInvokeArg('bootstrap')->getOptions();
$this->deviceBasePath = $aConfig['deviceBasePath'];
$controller_name = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
$action_name = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
$cms = new Application_Model_Cms();
$page_details = $cms->getPageDetails();
$this->page_title = $page_details['page_title'];
$this->page_description = $page_details['page_description'];
$this->page_keywords = $page_details['page_keywords'];
//Start Code for tiled list menu on home page
$menu = new Application_Model_Menu();
$responsive_menu_list = $menu->getAllTopMenuList();
//echo "<pre>";print_r($tiled_menus);die;
$this->view->responsive_menu_list_arr = $responsive_menu_list;
//For Mobile Menu
$responsive_mobile_menu_list = $menu->getAllTopMobileOrderMenuList();
//echo "<pre>";print_r($tiled_menus);die;
$this->view->responsive_mobile_menu_list = $responsive_mobile_menu_list;
}
/**
* index() method is used
* @param content_menu_link_id string
* @return object
*/
public function indexAction() {
//Start Code for quick menu
echo "index";
exit;
}
/**
* sitemap() method is used to dispaly sitemap
* @param NULL
* @return NULL
*/
public function sitemapAction() {
//Call Model Here
$menu = new Application_Model_Menu();
//Start Code for quick menu
$quickLinkColumn1Data = $menu->getQuickLinkColumn123DataList($type = 'quick_link_column1');
//echo "<pre>";print_r($quickLinkColumn1Data);die;
$this->view->quickLinkColumn1 = $quickLinkColumn1Data;
$quickLinkColumn2Data = $menu->getQuickLinkColumn123DataList($type = 'quick_link_column2');
$this->view->quickLinkColumn2 = $quickLinkColumn2Data;
$quickLinkColumn3Data = $menu->getQuickLinkColumn123DataList($type = 'quick_link_column3');
$this->view->quickLinkColumn3 = $quickLinkColumn3Data;
//End Code for quick menu
//Start sitemap code here
$this->view->headTitle()->prepend($this->page_title);
$this->view->headMeta()->appendName("description", $this->page_description);
$this->view->headMeta()->appendName("keyword", $this->page_keywords);
$menu_list = $menu->getAllMenuList();
//echo "<pre>";print_r($menu_list);die;
$this->view->menu_list = $menu_list;
//End sitemap code here
//Start Code for footer menu
$footerMenuColumn1Data = $menu->getQuickLinkColumn123DataList($type = 'footer_menu_column1');
$this->view->footerMenuColumn1 = $footerMenuColumn1Data;
$footerMenuColumn2Data = $menu->getQuickLinkColumn123DataList($type = 'footer_menu_column2');
$this->view->footerMenuColumn2 = $footerMenuColumn2Data;
$footerMenuColumn3Data = $menu->getQuickLinkColumn123DataList($type = 'footer_menu_column3');
$this->view->footerMenuColumn3 = $footerMenuColumn3Data;
//End Code for footer menu
}
/**
* showpage() method is used to get all content menu and details by page url
* @param page string
* @return object
*/
public function showpageAction() {
// die('jdjdjjdjd');
$menu = new Application_Model_Menu();
$cms = new Application_Model_Cms();
require_once $this->deviceBasePath . 'library/Catabatic/MobileDetect.php';
$mobile_detect = new Catabatic_MobileDetect();
//Start Code for quick menu
$quickLinkColumn1Data = $menu->getQuickLinkColumn123DataList($type = 'quick_link_column1');
//echo "<pre>";print_r($quickLinkColumn1Data);die;
$this->view->quickLinkColumn1 = $quickLinkColumn1Data;
$quickLinkColumn2Data = $menu->getQuickLinkColumn123DataList($type = 'quick_link_column2');
$this->view->quickLinkColumn2 = $quickLinkColumn2Data;
$quickLinkColumn3Data = $menu->getQuickLinkColumn123DataList($type = 'quick_link_column3');
$this->view->quickLinkColumn3 = $quickLinkColumn3Data;
//End Code for quick menu
//Start Code for footer menu
$footerMenuColumn1Data = $menu->getQuickLinkColumn123DataList($type = 'footer_menu_column1');
$this->view->footerMenuColumn1 = $footerMenuColumn1Data;
$footerMenuColumn2Data = $menu->getQuickLinkColumn123DataList($type = 'footer_menu_column2');
$this->view->footerMenuColumn2 = $footerMenuColumn2Data;
$footerMenuColumn3Data = $menu->getQuickLinkColumn123DataList($type = 'footer_menu_column3');
$this->view->footerMenuColumn3 = $footerMenuColumn3Data;
//End Code for footer menu
if ($mobile_detect->isMobile() == "mobile") {
$deviceType = "mobile";
} else if ($mobile_detect->isTablet() == "tablet") {
$deviceType = "mobile";
} else {
$deviceType = "desktop";
}
//echo $deviceType;
$page_url = $this->getRequest()->getParam("page");
$ppage_url = $this->getRequest()->getParam("ppage");
//----------Get left menu by page url------------//
$getMenuData = $menu->getMenuListByPageUrl($page_url); //10,9
//echo '<pre>';print_r($getMenuData);exit;
$this->view->parentId = $getMenuData;
$parent_details = $menu->getAllParentDetailsArrayById($getMenuData['parent_id']);
$this->view->parent_name = $parent_details['level'];
$this->view->parent_url = $parent_details['url'];
//echo '<pre>';print_r($parent_details);exit;
$checkChileList = $menu->getChildListById($getMenuData['id']);
//echo $checkChileList;
$this->view->checkChileList = $checkChileList;
if ($getMenuData['id'] != "" && ($getMenuData['parent_id'] == 0 && $getMenuData['parent_id'] != "")) {
//echo "roort yes";die;
$this->__getLeftMenuListById($getMenuData['id']);
} else if (@$getMenuData['id'] != "" && @$getMenuData['parent_id'] != 0) {
//echo "yes1"; die; //9,8
//Second Lb menu id
$getParentIdData = $menu->getLastParentIdByParentId(@$getMenuData['parent_id']);
// echo "<pre>";print_r($getParentIdData);
if (@$getParentIdData['id'] != "" && @$getParentIdData['parent_id'] != 0) {
//8,2
//Third Lb menu id
$this->view->also_vist = "third";
$getSubParentIdData = $menu->getLastParentIdByParentId(@$getParentIdData['parent_id']);
// echo "<pre>";print_r($getSubParentIdData);
if (@$getSubParentIdData['id'] != "" && @$getSubParentIdData['parent_id'] != 0) {
//2,0
//Fourth Lb menu id
$this->view->also_vist = "fourth";
$getSubSubParentIdData = $menu->getLastParentIdByParentId($getSubParentIdData['parent_id']);
//echo "<pre>";print_r($getSubSubParentIdData);
if (@$getSubSubParentIdData['id'] != "" && @$getSubSubParentIdData['parent_id'] != 0) {
//echo "fifth"; die;
} else if (@$getSubSubParentIdData['id'] != "" && (@$getSubSubParentIdData['parent_id'] == 0 && @$getSubSubParentIdData['parent_id'] != "")) {
//echo "root yes";die;
$this->__getLeftMenuListById(@$getSubSubParentIdData['id']);
}
} else if ($getSubParentIdData['id'] != "" && (@$getSubParentIdData['parent_id'] == 0 && @$getSubParentIdData['parent_id'] != "")) {
//echo "Third";die;
$this->__getLeftMenuListById($getSubParentIdData['id']);
}
} else if (@$getParentIdData['id'] != "" && (@$getParentIdData['parent_id'] == 0 && @$getParentIdData['parent_id'] != "")) {
$this->__getLeftMenuListById(@$getParentIdData['id']);
}
}
if ($page_url != "" && $ppage_url == "") {
$fpage_url = $page_url;
} else if ($page_url != "" && $ppage_url != "") {
$fpage_url = $ppage_url;
}
$page_content_data = $cms->getPageContentByPageUrl($page_url, $deviceType);
// echo "<pre>";print_r($page_content_data); die();
$page_content = $cms->getPageContentByPageUrl($fpage_url, $deviceType);
$template_type = $page_content['content_template_type'];
$content_menu_link_id = $page_content['content_menu_link_id'];
if ($content_menu_link_id) {
$content_menu_list = $cms->getAllContentMenuList($content_menu_link_id);
} else {
$content_menu_list = array();
}
$page_content['content_menu_list'] = $content_menu_list;
//----------Display Meta Title,Keywords and Description in view page---------------//
$meta_title = str_replace("Dcb", "DCB", ucwords(strtolower(@$page_content['meta_title'])));
if ($meta_title != "") {
$meta_title_val = $meta_title;
} else {
$meta_title_val = "DCB";
}
$meta_keywords = ucwords(strtolower(@$page_content['meta_keywords']));
$meta_description = ucwords(strtolower(@$page_content['meta_description']));
$this->view->headTitle()->prepend($meta_title_val);
$this->view->headMeta()->appendName("description", $meta_description);
$this->view->headMeta()->appendName("keyword", $meta_keywords);
$this->view->schemapageName = ucwords(strtolower((str_replace('DCB', '', $page_content['page_name']))));
$this->view->schemapageUrl = $page_content['page_key'];
$this->view->schemadescription = $page_content['meta_description'];
$html = $page_content['page_description'];
$technologyArray = $technologyArray1 = $technologyArray2 = array();
$pattern2 = '/<div class="technology brdrnone">(.*?)<\/div>/s';
preg_match_all($pattern2, $html, $matches2);
if (!empty($matches2[1])) {
$g=0;
foreach ($matches2[1] as $value) {
$technologyArray1[$g] = $value;
$g++;
}
}
$pattern1 = '/<div class="technology">(.*?)<\/div>/s';
preg_match_all($pattern1, $html, $matches1);
if (!empty($matches1[1])) {
$g=1;
foreach ($matches1[1] as $value) {
$technologyArray2[$g] = $value;
$g++;
}
}
$technologyArray = array_merge($technologyArray1,$technologyArray2);
$thelanguageArray = array();
$pattern = '/<div class="thelanguage">(.*?)<\/div>/s';
preg_match_all($pattern, $html, $matches);
if (!empty($matches[1])) {
$g=0;
foreach ($matches[1] as $value) {
$thelanguageArray[$g] = $value;
$g++;
}
}
$this->view->faqData = array(0=>array_combine($technologyArray, $thelanguageArray));
//echo "<pre>";print_r($this->view->faqData);exit;
$this->view->page_content = $page_content;
$page_content_menu_link_id = $page_content_data['content_menu_link_id'];
$page_content_menu_list = $cms->getAllContentMenuList($page_content_menu_link_id);
$this->view->page_title = $page_content_data['page_title'];
//$this->view->heading_h1 = $page_content_data['heading_h1'];
$this->view->template_type = $template_type;
Zend_Session::start();
$s = new Zend_Session_Namespace('pageName');
$s->sess_page_name = $page_url;
$s->sess_ppage_name = $ppage_url;
$s->page_title = $page_content_data['page_title'];
$this->view->mainpage_key = $page_content_data['page_key'];
$this->view->page_content_menu_list = $page_content_menu_list;
if (($page_content_data['page_key'] == "board-of-directors") || $page_content_data['page_key'] == "senior-management") {
$board_list = $cms->getBoardListByBoardType($page_content_data['page_key']);
//echo "<pre>";print_r($board_list);die;
$this->view->board_list = $board_list;
}
$ppage_url_int = $ppage_url;
if ($page_url != "" && $ppage_url_int != "") {
$board_details = $cms->getBoardDetailsByBoardType($page_url, $ppage_url_int);
//echo "<pre>";print_r($board_details);die;
$this->view->board_details = $board_details;
}
if ($page_url == "our-customer") {
$our_customer = $cms->getListCustomerContact();
$this->view->our_customer = $our_customer;
}
if (($page_content_data['page_key'] == "forex-rates" || $ppage_url == "forex-rates") && ($template_type == "forex_rates")) {
$forex_file_path = "userdata/forex/cardrate.txt";
$this->view->frates = $forex_file_path;
}
$this->view->template_type = $template_type;
//echo $template_type; die;
if ($template_type == "title_and_image") {
$this->render("template1");
} else if ($template_type == "half_text_and_half_image") {
$this->render("template2");
} else if ($template_type == "half_text_and_half_image_and_content_withlink") {
$this->render("template3");
} else if ($template_type == "half_text_and_half_image_content_withlink_diffposition") {
$this->render("template4");
} else if ($template_type == "half_text_and_half_image_orcontentlink_withtitle_diffposition") {
$this->render("template5");
} else if ($template_type == "full_text_and_half_image") {
$this->render("template6");
} else if ($template_type == "faq_and_half_image_orwithlink") {
$this->render("template7");
} else if ($template_type == "board_listing") {
$this->render("template8");
} else if ($template_type == "board_directors") {
$this->render("template10");
} else if ($template_type == "forex_rates") {
$this->render("forex-rates");
} else {
$this->render("view");
}
}
/**
* __getLeftMenuListById() method is used to get all menu list by page url
* @param page string
* @return object
*/
private function __getLeftMenuListById($menu_id) {
//Start Code for quick menu
$menu = new Application_Model_Menu();
$firstlb_menus = $menu->getAllFirstLbMenuListById($menu_id);
$all_menu_list_arr = array();
foreach ($firstlb_menus as $firstlb_menus_list) {
$secondlb_menus = $menu->getAllSecondORThirdOrFourthLbMenuListById($firstlb_menus_list['id']);
$secondlb_menus_list_arr = array();
foreach ($secondlb_menus as $secondlb_menus_list) {
$thirdlb_menus = $menu->getAllSecondORThirdOrFourthLbMenuListById($secondlb_menus_list['id']);
$allthirdlb_menusarr = $menu->getAllThirdOrFourthLbMenuListArrayById($secondlb_menus_list['id']);
$allseclb_parentarr = $menu->getAllParentDetailsArrayById($secondlb_menus_list['parent_id']);
$thirdlb_menus_list_arr = array();
foreach ($thirdlb_menus as $thirdlb_menus_list) {
$fourthlb_menus = $menu->getAllSecondORThirdOrFourthLbMenuListById($thirdlb_menus_list['id']);
$allfourthlb_menusarr = $menu->getAllThirdOrFourthLbMenuListArrayById($thirdlb_menus_list['id']);
$allthirdlb_parentarr = $menu->getAllParentDetailsArrayById($thirdlb_menus_list['parent_id']);
$fourthlb_menus_list_arr = array();
foreach ($fourthlb_menus as $fourthlb_menus_list) {
$allfifthlb_menusarr = $menu->getAllThirdOrFourthLbMenuListArrayById($fourthlb_menus_list['id']);
$allfourthlb_parentarr = $menu->getAllParentDetailsArrayById($fourthlb_menus_list['parent_id']);
$fifthlb_menus_list_arr = array('life-term-plans', 'life-endowment-plans');
$fourthlb_menus_list_arr[] = array(
'id' => $fourthlb_menus_list['id'],
'IsDisclaimer' => $fourthlb_menus_list['IsDisclaimer'],
'parent_id' => $fourthlb_menus_list['parent_id'],
'level_name' => $fourthlb_menus_list['level'],
'sub_level_name' => $fourthlb_menus_list['sub_level_name'],
'url' => $fourthlb_menus_list['url'],
'external_url' => $fourthlb_menus_list['external_url'],
'image' => $fourthlb_menus_list['image'],
'fourthlb_parent_url' => $allfourthlb_parentarr['url'],
'fifthlb_menu_count' => 0,
'fifthlb_menu' => $fifthlb_menus_list_arr,
'fifthlb_submenu_url' => $allfifthlb_menusarr
);
}
$thirdlb_menus_list_arr[] = array(
'id' => $thirdlb_menus_list['id'],
'IsDisclaimer' => $thirdlb_menus_list['IsDisclaimer'],
'parent_id' => $thirdlb_menus_list['parent_id'],
'level_name' => $thirdlb_menus_list['level'],
'sub_level_name' => $thirdlb_menus_list['sub_level_name'],
'url' => $thirdlb_menus_list['url'],
'external_url' => $thirdlb_menus_list['external_url'],
'image' => $thirdlb_menus_list['image'],
'thirdlb_parent_url' => $allthirdlb_parentarr['url'],
'fourthlb_menu_count' => count($fourthlb_menus_list_arr),
'fourthlb_menu' => $fourthlb_menus_list_arr,
'fourthlb_submenu_url' => $allfourthlb_menusarr['sub_url']
);
}
$secondlb_menus_list_arr[] = array(
'id' => $secondlb_menus_list['id'],
'IsDisclaimer' => $secondlb_menus_list['IsDisclaimer'],
'parent_id' => $secondlb_menus_list['parent_id'],
'level_name' => $secondlb_menus_list['level'],
'sub_level_name' => $secondlb_menus_list['sub_level_name'],
'url' => $secondlb_menus_list['url'],
'external_url' => $secondlb_menus_list['external_url'],
'image' => $secondlb_menus_list['image'],
'seclb_parent_url' => $allseclb_parentarr['url'],
'thirdlb_menu_count' => count($thirdlb_menus_list_arr),
'thirdlb_menu' => $thirdlb_menus_list_arr,
'thirdlb_submenu_url' => $allthirdlb_menusarr['sub_url']
);
}
$all_menu_list_arr[] = array(
'id' => $firstlb_menus_list['id'],
'IsDisclaimer' => $firstlb_menus_list['IsDisclaimer'],
'parent_id' => $firstlb_menus_list['parent_id'],
'level_name' => $firstlb_menus_list['level'],
'sub_level_name' => $firstlb_menus_list['sub_level_name'],
'url' => $firstlb_menus_list['url'],
'external_url' => $firstlb_menus_list['external_url'],
'image' => $firstlb_menus_list['image'],
'secondlb_menu_count' => count($secondlb_menus_list_arr),
'secondlb_menu' => $secondlb_menus_list_arr
);
}
//echo "<pre>";print_r($all_menu_list_arr);die;
$this->view->all_leftmenu_list = $all_menu_list_arr;
}
}