Subversion Repositories SmartDukaan

Rev

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

Rev 14098 Rev 14099
Line 120... Line 120...
120
			$this->Session->setFlash(__('The skuscheme has been deleted.'));
120
			$this->Session->setFlash(__('The skuscheme has been deleted.'));
121
		} else {
121
		} else {
122
			$this->Session->setFlash(__('The skuscheme could not be deleted. Please, try again.'));
122
			$this->Session->setFlash(__('The skuscheme could not be deleted. Please, try again.'));
123
		}
123
		}
124
		return $this->redirect(array('action' => 'index'));
124
		return $this->redirect(array('action' => 'index'));
-
 
125
	}
-
 
126
 
-
 
127
	public function admin_dp(){		
-
 
128
		$page = $this->request->query('page');
-
 
129
		if(!isset($page)){
-
 
130
			$page = 1;
125
	}}
131
		}
-
 
132
		$limit = Configure::read('admindashboardlimit');
-
 
133
		$offset = ($page - 1)*$limit;
-
 
134
		$url = $this->apihost."dealerPrices/getAllDealerPrice/?limit=$limit&offset=$offset";
-
 
135
		$response = $this->make_request($url,null);
-
 
136
		$this->set('dealerprices',$response);
-
 
137
		$this->set('page',$page);
-
 
138
	}
-
 
139
 
-
 
140
	public function admin_adddp() {
-
 
141
		if ($this->request->is('post')) {
-
 
142
			$data = $this->request->data['Skuscheme'];
-
 
143
			$url = $this->apihost."dealerPrices/addDealerPrice";
-
 
144
			$jsonVar = json_encode($data, JSON_NUMERIC_CHECK );
-
 
145
			$response = $this->make_request($url,$jsonVar);
-
 
146
			if (key($response)) {
-
 
147
				$this->Session->setFlash(current($response));
-
 
148
				return $this->redirect(array('action' => 'admin_dp'));
-
 
149
			} else {
-
 
150
				$this->Session->setFlash(current($response));
-
 
151
			}			
-
 
152
		}
-
 
153
	}
-
 
154
}