Subversion Repositories SmartDukaan

Rev

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

Rev 14891 Rev 15085
Line 290... Line 290...
290
	        		$this->loadModel('ActivationCode');
290
	        		$this->loadModel('ActivationCode');
291
	        		$exists = $this->ActivationCode->findByCode(strtoupper($referrer));
291
	        		$exists = $this->ActivationCode->findByCode(strtoupper($referrer));
292
	        		$this->log(print_r($exists,1),'activations');
292
	        		$this->log(print_r($exists,1),'activations');
293
	        		if(empty($exists)){
293
	        		if(empty($exists)){
294
	        			$result = array('success'=>false,'message'=>'Invalid referral code');
294
	        			$result = array('success'=>false,'message'=>'Invalid referral code');
295
	        			unset($this->request->data['referrer']);
295
	        			// unset($this->request->data['referrer']);
296
	        			$updateRequired = false;
296
	        			$updateRequired = false;
297
	        		}
297
	        		}
298
	        		$this->request->data['activated'] = 1;
298
	        		$this->request->data['activated'] = 1;
299
	        	}	        		
299
	        	}	        		
300
	        	if($updateRequired){
300
	        	if($updateRequired){
Line 452... Line 452...
452
		$data = array('notification_campaign_id'=>$message['cid'],'user_id'=>$user_id,'status'=>$res['success']);
452
		$data = array('notification_campaign_id'=>$message['cid'],'user_id'=>$user_id,'status'=>$res['success']);
453
		$this->Pushnotification->create();
453
		$this->Pushnotification->create();
454
		$this->Pushnotification->save($data);
454
		$this->Pushnotification->save($data);
455
		// Close connection
455
		// Close connection
456
		curl_close($ch);
456
		curl_close($ch);
457
		$this->log("For $user_id ".$registatoin_ids[0]." ".print_r($result,1),'notifiactions');
457
		$this->log("For $user_id ".$registatoin_ids[0]." ".print_r($result,1),'pushnotifications');
458
	}
458
	}
459
 
459
 
460
	public function admin_index() {		
460
	public function admin_index() {		
461
		$this->User->recursive = 0;
461
		$this->User->recursive = 0;
462
		$options = array('limit'=>100,'order'=>array('id'=>'desc'));
462
		$options = array('limit'=>100,'order'=>array('id'=>'desc'));