403Webshell
Server IP : 103.48.194.25  /  Your IP : 216.73.216.74
Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33
System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64
User : sieuthimay ( 1016)
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/namduongmarket.com-bk/public_html/site/components/search/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/namduongmarket.com-bk/public_html/site/components/search/controllers/search.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Search extends MX_Controller 
{
	function __construct()
	{
		parent::__construct();
		$this->load->model('search_model','search');
		$this->load->model('sanpham/sanpham_model','sanpham');
		$this->load->model('common_model','cm');
	}
	
	public function index()
	{
		$display = 12;
		$data['title'] = 'Kết quả tìm kiếm' ;
		
		$view = $this->input->get('view');
		$keyword = $this->input->get('query');
		$type = $this->input->get('type'); //trit($keyword);
		$type = !empty($type)? $type : 'product';
		
		if($view=='json')
		{
			$q 		= $this->input->get('q');
			$total 	= $this->search->count_keyword($q);
			$list 	= $this->search->search_keyword($q,$display);
			$req 	= $this->map_json($list);
			
			$res['results_total'] = $total;
			$res['results'] = $req;
			echo json_encode($res);
			return;
		}
		
		$data['start'] = (int) $this->uri->segment(3);
		
		$config['base_url'] 	= site.'tim-kiem/';  
		$data['num'] 			= $this->search->count_keyword($keyword);
		$config['total_rows'] 	= $data['num'];
		$config['per_page'] 	= $display;
		$config['uri_segment'] 	= 3;
		$config['num_links'] 	= 3;
		$this->pagination->initialize($config);   
		$data['pagination'] 	= $this->pagination->create_links();
		
		$data['list'] 			= $this->search->search_keyword($keyword,$config['per_page']);
		
		$data['type'] = $type;
		$data['keyword'] = $keyword;
		
		$data['page'] = 'search/index' ;
		$this->load->view('skin', $data);
	}
	
	function map_json($list)
	{
		/*"results_total": 14,
		"results": [
		{
			"title": "Samsung Galaxy J6+",
			"url": "/samsung-galaxy-j6",
			"thumb": "//bizweb.dktcdn.net/thumb/compact/100/348/133/products/636733807755769304-samsung-galaxy-j6-plus-den-1.jpg?v=1551711648480",
			"price": "4.290.000₫",
			"id": 13870714
		},*/
		$arr = array();
		foreach ($list as $rs):
			$obj = new stdClass();
			$obj->id = $rs->proid;
			$obj->title = $rs->pro_name;
			$obj->url = site."san-pham/".alias($rs->pro_name).'-'.$rs->proid.'.html';
			$obj->thumb = urlimg."products/800/".$rs->proimg;
			$obj->price = $rs->price;
			array_push($arr,$obj);
		endforeach ;

		return $arr;
	}
	
	public function keyword($alias='',$start=0)
	{
		if(empty($alias)) redirect();
		$data['title'] = 'Kết quả tìm kiếm' ;
		
		$alias = str_replace(".html","",$alias);
		$rs = $this->search->get_alias($alias);
		if($rs)
		{
			$data['title'] = 'Tìm theo từ khóa : '.$rs->keyname ;
			
			$arr_proid = explode(",",$rs->list_pro);
			$data['list'] = $this->search->get_product($arr_proid);
				
			$data['start'] = $start; 
			$config['base_url'] = site.'tu-khoa/'.$alias;  
			$data['num'] = $this->search->count_product($arr_proid);
			$config['total_rows'] 	= $data['num'];
			$config['per_page'] 	= 4;
			$config['uri_segment'] 	= 3;
			$config['num_links'] 	= 3 ;
			$this->pagination->initialize($config);   
			$data['pagination'] 	= $this->pagination->create_links();
			
			$data['rs'] = $rs;
			$data['keyword'] = $rs->keyname;
			
			$data['page'] = 'search/keyword' ;
			$this->load->view('skin', $data);
		}
		else redirect();
		
		/*$row = $this->search->get_listid($keyword);
		if($row)
		{
			$data['list'] = $this->search->get_search($row->list_pro,$product_cat); 
			$data['list_news'] = $this->search->get_news($row->list_news); 
			
			$data['start'] = (int) $this->uri->segment(3) ; 
			$config['base_url'] = site.'tim-kiem/';  
			$data['num'] = $this->search->count_search($keyword,$product_cat);
			$config['total_rows'] = $data['num'];
			$config['per_page'] = 4;
			$config['uri_segment'] = 3;
			$config['num_links'] = 3 ;
			$this->pagination->initialize($config);   
			$data['pagination'] = $this->pagination->create_links();
			
			$this->load->model('home/home_model','home');
			$data['list_banner'] = $this->home->slidehome(); 
			$data['banner_doitac'] = $this->home->get_banner_doitac('200x78'); 
			
			$data['page'] = 'search/keyword' ;
			$this->load->view('skin', $data);
		}
		else redirect();*/
	}
	
}

?>

Youez - 2016 - github.com/yon3zu
LinuXploit