Subversion Repositories SmartDukaan

Rev

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

Rev 19874 Rev 20444
Line 24... Line 24...
24
 * admin_index method
24
 * admin_index method
25
 *
25
 *
26
 * @return void
26
 * @return void
27
 */
27
 */
28
	public function admin_index() {
28
	public function admin_index() {
-
 
29
		if(isset($this->request->query('clear-cache'))){
-
 
30
			$clearCacheApiUrl = $this->apihost."/resetCache/?type=itemCashBack";
-
 
31
			$response = $this->make_request($clearCacheApiUrl,null);
-
 
32
			$response = json_encode($response);
-
 
33
			$this->set('clear', $response[1]=='Cache cleared.'?'Cache Cleared Successfully':'Could not clear cache');
-
 
34
		}
29
		$type = $this->request->query('type');
35
		$type = $this->request->query('type');
30
		$search = $this->request->query('search');
36
		$search = $this->request->query('search');
31
		$page = $this->request->query('page');
37
		$page = $this->request->query('page');
32
		if(!isset($page)){
38
		if(!isset($page)){
33
			$page = 1;
39
			$page = 1;
Line 41... Line 47...
41
		}
47
		}
42
		else 
48
		else 
43
		{
49
		{
44
			$url = $this->apihost."getItemCashback?offset=".$offset."&limit=".$limit;
50
			$url = $this->apihost."getItemCashback?offset=".$offset."&limit=".$limit;
45
		}
51
		}
46
		
52
		echo $url;
47
// 		$url = $this->apihost."getItemCashback/?limit=$limit&offset=$offset";
53
// 		$url = $this->apihost."getItemCashback/?limit=$limit&offset=$offset";
48
		$response = $this->make_request($url,null);
54
		$response = $this->make_request($url,null);
49
		$this->set('cashbacks', $response);
55
		$this->set('cashbacks', $response);
50
		$this->set('page',$page);
56
		$this->set('page',$page);
51
	}
57
	}