Subversion Repositories SmartDukaan

Rev

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

Rev 13946 Rev 14098
Line 121... Line 121...
121
	public function admin_index() {
121
	public function admin_index() {
122
		$url = $this->apihost."discountInfo/getAllCategoryDiscount";
122
		$url = $this->apihost."discountInfo/getAllCategoryDiscount";
123
		$response = $this->make_request($url,null);
123
		$response = $this->make_request($url,null);
124
		$this->set('categoryDiscounts',$response);
124
		$this->set('categoryDiscounts',$response);
125
		$this->loadModel('Category');
125
		$this->loadModel('Category');
126
		$categories = $this->Category->find('list');
126
		// $categories = $this->Category->find('list');
-
 
127
		$categories = Configure::read('Categories');
127
		$this->set('categories',$categories);
128
		$this->set('categories',$categories);
128
	}
129
	}
129
 
130
 
130
/**
131
/**
131
 * admin_view method
132
 * admin_view method
Line 175... Line 176...
175
 * @throws NotFoundException
176
 * @throws NotFoundException
176
 * @param string $id
177
 * @param string $id
177
 * @return void
178
 * @return void
178
 */
179
 */
179
	public function admin_edit($id = null) {
180
	public function admin_edit($id = null) {
180
		if (!$this->CategoryDiscount->exists($id)) {
181
		// if (!$this->CategoryDiscount->exists($id)) {
181
			throw new NotFoundException(__('Invalid category discount'));
182
		// 	throw new NotFoundException(__('Invalid category discount'));
182
		}
183
		// }
183
		if ($this->request->is(array('post', 'put'))) {
184
		if ($this->request->is(array('post', 'put'))) {
184
			if ($this->CategoryDiscount->save($this->request->data)) {
185
			if ($this->CategoryDiscount->save($this->request->data)) {
185
				$this->Session->setFlash(__('The category discount has been saved.'));
186
				$this->Session->setFlash(__('The category discount has been saved.'));
186
				return $this->redirect(array('action' => 'index'));
187
				return $this->redirect(array('action' => 'index'));
187
			} else {
188
			} else {