Subversion Repositories SmartDukaan

Rev

Rev 11108 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11108 Rev 11169
Line 14... Line 14...
14
		// }
14
		// }
15
		$this->layout->setlayout('layout/layout_main');
15
		$this->layout->setlayout('layout/layout_main');
16
		$this->load->model('home_model');
16
		$this->load->model('home_model');
17
		$this->layoutName= $this->layout->getLayout();
17
		$this->layoutName= $this->layout->getLayout();
18
		$this->layoutName =substr($this->layoutName , 0, strrpos($this->layoutName , "/")).'/';
18
		$this->layoutName =substr($this->layoutName , 0, strrpos($this->layoutName , "/")).'/';
19
		// print_r($this->session->all_userdata());
19
		//print_r($this->session->all_userdata());
20
		
20
		
21
 
21
 
22
	}
22
	}
23
	public function index()
23
	public function index()
24
	{
24
	{
-
 
25
 
25
		$configdata =array();
26
		$configdata =array();
26
		$configdata = $this->config->item('home');
27
		$configdata = $this->config->item('home');
27
		$checkConfig = $this->config->item('home');
28
		$checkConfig = $this->config->item('home');
28
		$cachemodule = array('header','footer','response');
29
		$cachemodule = array('header','footer','response');
29
		$configdata = getCache($configdata,$cachemodule);
30
		$configdata = getCache($configdata,$cachemodule);
Line 56... Line 57...
56
			$str=explode('(', $str[0]);
57
			$str=explode('(', $str[0]);
57
			$str=ltrim($str[1]);
58
			$str=ltrim($str[1]);
58
			$str=rtrim($str);
59
			$str=rtrim($str);
59
			$this->session->set_userdata('mobileBuild',$str);
60
			$this->session->set_userdata('mobileBuild',$str);
60
		}else{
61
		}else{
61
			unset($checkConfig['response'][3]);
62
			unset($checkConfig['response'][2]);
-
 
63
			unset($configdata['module']['response'][2]);
62
			$recommended_accessories = false;
64
			$recommended_accessories = false;
63
		}
65
		}
64
		//standard array
66
		//standard array
65
		$data = array();
67
		$data = array();
66
		//get cache 
68
		//get cache 
Line 80... Line 82...
80
		}
82
		}
81
		//end of get cache
83
		//end of get cache
82
		$this->lessphp->object()->ccompile('assets/css/common.less','assets/css/common.css');
84
		$this->lessphp->object()->ccompile('assets/css/common.less','assets/css/common.css');
83
		$data['stylesheet'] = 'common.css';
85
		$data['stylesheet'] = 'common.css';
84
		if(isset($api) && $api == 1){
86
		if(isset($api) && $api == 1){
-
 
87
			//echo '1';
85
			$data['response']=$this->home_model->getHome($this->input->get(),$this->input->post(),$checkConfig);
88
			$data['response']=$this->home_model->getHome($this->input->get(),$this->input->post(),$checkConfig);
86
		}elseif(!isset($api)){
89
		}elseif(!isset($api)){
-
 
90
			//print_r($configdata['module']);
87
			$data['response']=$this->home_model->getHome($this->input->get(),$this->input->post(),$configdata['module']);
91
			$data['response']=$this->home_model->getHome($this->input->get(),$this->input->post(),$configdata['module']);
88
		}
92
		}
89
		//print_r($data['response']);
93
		//print_r($data['response']);
90
		$tmp = $data['response'];
94
		$tmp = $data['response'];
91
		//set cache to output or renew cache
95
		//set cache to output or renew cache
Line 108... Line 112...
108
		}
112
		}
109
		//print_r($newparams);
113
		//print_r($newparams);
110
		if(!isset($noCache)){
114
		if(!isset($noCache)){
111
			setCache($configdata['module'],$cachemodule,$data['response']);
115
			setCache($configdata['module'],$cachemodule,$data['response']);
112
		}
116
		}
113
		if(!isset($data['response']['response']['home_featured_product']) && empty($data['response']['response']['home_featured_product'])){
117
		// if(!isset($data['response']['response']['home_featured_product']) && empty($data['response']['response']['home_featured_product'])){
114
			$data['response']['response'] = $this->InsertBeforeKey($data['response']['response'],'home_menu','recharge_icons',$tmp['response']['recharge_icons']);
118
		// 	$data['response']['response'] = $this->InsertBeforeKey($data['response']['response'],'home_menu','recharge_icons',$tmp['response']['recharge_icons']);
115
		}else{
119
		// }else{
116
			$data['response']['response'] = $this->InsertBeforeKey($data['response']['response'],'home_featured_product','recharge_icons',$tmp['response']['recharge_icons']);
120
		// 	$data['response']['response'] = $this->InsertBeforeKey($data['response']['response'],'home_featured_product','recharge_icons',$tmp['response']['recharge_icons']);
117
		}
121
		// }
118
		if(!isset($recommended_accessories)){
122
		if(!isset($recommended_accessories)){
119
			$data['response']['response'] = $this->InsertBeforeKey($data['response']['response'],'home_menu','recommended_accessories',$tmp['response']['recommended_accessories']);
123
			$data['response']['response'] = $this->InsertBeforeKey($data['response']['response'],'home_menu','recommended_accessories',$tmp['response']['recommended_accessories']);
120
		}
124
		}
121
		//end of set cache\
125
		//end of set cache\
122
		$this->layout->view('home/home_view',$data);
126
		$this->layout->view('home/home_view',$data);