Subversion Repositories SmartDukaan

Rev

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

Rev 17838 Rev 17844
Line 93... Line 93...
93
 
93
 
94
	public function add() {
94
	public function add() {
95
		$this->layout = 'innerpages';
95
		$this->layout = 'innerpages';
96
		$pinval = 232104;
96
		$pinval = 232104;
97
		setcookie('pin', $pinval, -1, '/');
97
		setcookie('pin', $pinval, -1, '/');
98
		$nameval = "Supermans";
98
		$nameval = "Roman";
99
		setcookie('name', $nameval, -1, '/');
99
		setcookie('name', $nameval, -1, '/');
100
 
100
 
101
		if ($this->request->is('post')) {
101
		if ($this->request->is('post')) {
102
			$data = $this->request->data;
102
			$data = $this->request->data;
103
			if($data['name'] == "")
103
			if($data['name'] == "")
Line 131... Line 131...
131
		}
131
		}
132
		
132
		
133
		// debug($_COOKIE['pin']);
133
		// debug($_COOKIE['pin']);
134
		$url = "http://dtr:8057/pincodeValidation/".$_COOKIE['pin'];
134
		$url = "http://dtr:8057/pincodeValidation/".$_COOKIE['pin'];
135
		$getstate =$this->make_request($url , null);
135
		$getstate =$this->make_request($url , null);
-
 
136
		// debug($getstate);
136
		$getstateval = "";
137
		$getstateval = "";
137
		if($getstate != "{}"){
138
		if($getstate != "{}"){
138
			$getstateval =ucwords(strtolower($getstate['state']));
139
			$getstateval =ucwords(strtolower($getstate['state']));
139
		}
140
		}
140
		$this->set(compact('getstateval'));
141
		$this->set(compact('getstateval'));
Line 145... Line 146...
145
	 	{
146
	 	{
146
	 		echo "Hello";
147
	 		echo "Hello";
147
	 	}
148
	 	}
148
	 }
149
	 }
149
 
150
 
-
 
151
	 public function getstate($pin_val){
-
 
152
	 	$this->autoRender = false;	
-
 
153
		$this->request->onlyAllow('ajax');
-
 
154
		$url = "http://dtr:8057/pincodeValidation/".$pin_val;
-
 
155
		$getstate =$this->make_request($url , null);
-
 
156
		// $getstate['state'] =  ucwords(strtolower($getstate['state']));
-
 
157
		$nothing = "nothing";
-
 
158
		if($getstate != "{}"){
-
 
159
			$getstate['state'] =  ucwords(strtolower($getstate['state']));
-
 
160
			
-
 
161
		}
-
 
162
		return json_encode($getstate);
-
 
163
	 }
-
 
164
 
150
	 public function isServicable($pin){
165
	 public function isServicable($pin){
151
	 	$this->autoRender = false;	
166
	 	$this->autoRender = false;	
152
		$this->request->onlyAllow('ajax');
167
		$this->request->onlyAllow('ajax');
153
		// $url = "http://shop2020.in:8080/mobileapi/address!serviceable?pincode=".$pin;
168
		// $url = "http://shop2020.in:8080/mobileapi/address!serviceable?pincode=".$pin;
154
		// $response = $this->make_request($url,null);
169
		// $response = $this->make_request($url,null);