| 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/ptcfinance/application/controllers/ |
Upload File : |
<?php
/***************************************************************
* Catabatic Technology Pvt. Ltd.
* File Name :IndexController.php
* File Description :Index controller for manage home page
* Created By : Praveen Kumar
* Created Date: 10-September-2014
***************************************************************/
class SearchController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
$aConfig = $this->getInvokeArg('bootstrap')->getOptions();
$this->deviceBasePath = @$aConfig['deviceBasePath'];
//Start Code for tiled list menu on home page
$menu = new Application_Model_Menu();
//Start Code for tiled list menu on home page
$headerMenuData = $menu->getAllTopMenuList('content_menu');
// echo '<pre>';print_r($headerMenuData); die;
$this->view->headerMenu = $headerMenuData;
$footerMenuData = $menu->getAllTopMenuList('footer_menu_column1');
// echo "<pre>";print_r($footerMenuData);die;
$this->view->footerMenu = $footerMenuData;
}
public function indexAction()
{
$menu = new Application_Model_Menu();
$cms = new Application_Model_Cms();
$page_details = $cms->getPageDetails();
$this->view->headTitle()->prepend($page_details['page_title']);
$this->view->headMeta()->appendName("description", $page_details['page_description']);
$this->view->headMeta()->appendName("keyword", $page_details['page_keywords']);
//Start Search Code Here
if ($this->getRequest()->isPost()) {
$getData = $this->getRequest()->getPost();
//echo "<pre>";print_r($getData); die;
if($getData){
$search_keyword = $this->sanitize_data($getData['search_keyword']);
// echo $search_keyword; die;
$search_list = $cms->getSearchListByKeyword($search_keyword);
//echo "<pre>";print_r($searcl_list);die;
$this->view->search_list = $search_list;
$this->view->search_keyword = $search_keyword;
}
}
//End Search Code Here
}
public function sanitize_data($input_data) {
$searchArr=array("document","write","alert","%","@","$",";","+","|","#","<",">",")","(","'","\'",",");
$input_data1 = str_replace("script","",$input_data);
$input_data1 = str_replace("iframe","",$input_data1);
$input_data1 = str_replace("exec","",$input_data1);
$input_data1 = str_replace("delete","",$input_data1);
$input_data2 = str_replace("exe","",$input_data1);
$input_data3 = str_replace($searchArr,"",$input_data2);
return htmlentities(stripslashes($input_data3), ENT_QUOTES);
}
}