Subversion Repositories SmartDukaan

Rev

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

Rev 14776 Rev 14781
Line 362... Line 362...
362
				$this->redirect(array('action' => 'admin_pushnotifications'));
362
				$this->redirect(array('action' => 'admin_pushnotifications'));
363
			}else{
363
			}else{
364
				$message = $this->request->data['User'];
364
				$message = $this->request->data['User'];
365
				$this->loadModel('NotificationCampaign');
365
				$this->loadModel('NotificationCampaign');
366
				$this->NotificationCampaign->create();
366
				$this->NotificationCampaign->create();
367
				$data = array('name'=>$message['name'],'title'=>$message['title'],'type'=>$message['type'],'message'=>$message['message'],'url'=>$message['url']);
367
				$data = array('name'=>$message['name'],'title'=>$message['title'],'type'=>$message['type'],'message'=>$message['message'],'url'=>$message['url'],'expiresat'=>$message['expiresat']);
368
				if($this->NotificationCampaign->save($data)){
368
				if($this->NotificationCampaign->save($data)){
369
					$message['cid'] = $this->NotificationCampaign->getLastInsertId();
369
					$message['cid'] = $this->NotificationCampaign->getLastInsertId();
370
				} else{
370
				} else{
371
					debug($this->NotificationCampaign->validationErrors);
371
					debug($this->NotificationCampaign->validationErrors);
372
					$message['cid'] = $message['name'];
372
					$message['cid'] = $message['name'];
Line 396... Line 396...
396
		    'message'       => $message['message'],
396
		    'message'       => $message['message'],
397
		    'cid'       	=> $message['cid'],
397
		    'cid'       	=> $message['cid'],
398
		    'title'         => $message['title'],
398
		    'title'         => $message['title'],
399
		    'type'      	=> $message['type'],
399
		    'type'      	=> $message['type'],
400
		    'url'		    => $message['url'],
400
		    'url'		    => $message['url'],
-
 
401
		    'expiresat'	    => strtotime($message['expiresat']),
401
		    'vibrate'       => 1,
402
		    'vibrate'       => 1,
402
		    'sound'         => 1,
403
		    'sound'         => 1,
403
		    'largeIcon'     => 'large_icon',
404
		    'largeIcon'     => 'large_icon',
404
		    'smallIcon'     => 'small_icon'
405
		    'smallIcon'     => 'small_icon'
405
		);
406
		);