| Line 53... |
Line 53... |
| 53 |
if ($this->request->is('post')) {
|
53 |
if ($this->request->is('post')) {
|
| 54 |
$this->log(print_r($this->request->data,1),'pushnotifications');
|
54 |
$this->log(print_r($this->request->data,1),'pushnotifications');
|
| 55 |
$data = $this->request->data;
|
55 |
$data = $this->request->data;
|
| 56 |
$data['type'] = $data['result'];
|
56 |
$data['type'] = $data['result'];
|
| 57 |
$data['status'] = 1;
|
57 |
$data['status'] = 1;
|
| 58 |
$data['response_time'] = date('Y-m-d h:i:s',strtotime($data['timestamp']));
|
58 |
$data['response_time'] = date('Y-m-d H:i:s',strtotime($data['timestamp']));
|
| 59 |
$data['notification_campaign_id'] = $data['cid'];
|
59 |
$data['notification_campaign_id'] = $data['cid'];
|
| 60 |
unset($data['result']);
|
60 |
unset($data['result']);
|
| 61 |
unset($data['cid']);
|
61 |
unset($data['cid']);
|
| 62 |
unset($data['timestamp']);
|
62 |
unset($data['timestamp']);
|
| - |
|
63 |
if(empty($data['user_id'])){
|
| - |
|
64 |
unset($data['user_id']);
|
| - |
|
65 |
}
|
| 63 |
$this->log(print_r($data,1),'pushnotifications');
|
66 |
$this->log(print_r($data,1),'pushnotifications');
|
| 64 |
$this->Pushnotification->create();
|
67 |
$this->Pushnotification->create();
|
| 65 |
if ($this->Pushnotification->save($data)) {
|
68 |
if ($this->Pushnotification->save($data)) {
|
| 66 |
// $this->Session->setFlash(__('The pushnotification has been saved.'));
|
69 |
// $this->Session->setFlash(__('The pushnotification has been saved.'));
|
| 67 |
// return $this->redirect(array('action' => 'index'));
|
70 |
// return $this->redirect(array('action' => 'index'));
|