Subversion Repositories SmartDukaan

Rev

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

Rev 19793 Rev 19825
Line 304... Line 304...
304
		}
304
		}
305
		$response = $this->make_request($url,'{}');
305
		$response = $this->make_request($url,'{}');
306
		
306
		
307
		return json_encode($response);
307
		return json_encode($response);
308
	}
308
	}
-
 
309
	
-
 
310
	public function admin_editretailer($id){
-
 
311
		if($this->request->is('post') || $this->request->is('put')){
-
 
312
			$retdet = $this->request->data['Retailer'];
-
 
313
			$cur_date = date('Y-m-d H:i:s', time());
-
 
314
			if($retdet['tinNumber'] == '' || empty($retdet['tinNumber']))
-
 
315
			{
-
 
316
				$upquery = "update retailers set title = '".$retdet['storeName']."' , address = '".$retdet['completeAddress']."',pin = ".$retdet['pin'].",tinnumber = NULL,city = '".$retdet['city']."',state='".$retdet['state']."' , modified='".$cur_date."' where id =".$retdet['id']."";
-
 
317
			}
-
 
318
			else{
-
 
319
				$upquery = "update retailers set title = '".$retdet['storeName']."' , address = '".$retdet['completeAddress']."',pin = ".$retdet['pin'].",tinnumber = ".$retdet['tinNumber'].",city = '".$retdet['city']."',state='".$retdet['state']."' , modified='".$cur_date."' where id =".$retdet['id']."";
-
 
320
			}
-
 
321
			
-
 
322
			
-
 
323
			
-
 
324
			$this->Retailer->query($upquery);
-
 
325
			$this->redirect("retailerverify/".$retdet['id']."/".$retdet['tinNumber']);
-
 
326
		}
-
 
327
		if($id !=null){
-
 
328
			$opt['conditions'] = array('id' => $id);
-
 
329
			$retailer = $this->Retailer->find('first',$opt);
-
 
330
			$this->set(compact('retailer'));
-
 
331
			
-
 
332
		}
-
 
333
	}
309
}
334
}