| Line 43... |
Line 43... |
| 43 |
}
|
43 |
}
|
| 44 |
|
44 |
|
| 45 |
public function post() {
|
45 |
public function post() {
|
| 46 |
$storeId = $this->request->query('store_id');
|
46 |
$storeId = $this->request->query('store_id');
|
| 47 |
$userId = $this->request->query('user_id');
|
47 |
$userId = $this->request->query('user_id');
|
| - |
|
48 |
$this->log('storeId '.print_r($storeId,1),'order_trackers');
|
| 48 |
$this->log(print_r($this->request->data,1),'order_trackers');
|
49 |
$this->log('userId '.print_r($userId,1),'order_trackers');
|
| 49 |
if ($this->request->is('post')) {
|
50 |
if ($this->request->is('post')) {
|
| - |
|
51 |
$this->log(print_r($this->request->data,1),'order_trackers');
|
| 50 |
$url = $this->apihost."/track/user/$userId?storeId=$storeId";
|
52 |
$url = $this->apihost.'track/user/'.$userId.'?storeId='.$storeId;
|
| - |
|
53 |
$this->log($url,'order_trackers');
|
| 51 |
$params = array('url'=>$$this->request->data['url'],'html'=>$this->request->data['html']);
|
54 |
//$params = array('url'=>$this->request->data['url'],'html'=>$this->request->data['html']);
|
| 52 |
$jsonVar = json_encode($params);
|
55 |
//$jsonVar = json_encode($params,JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE);
|
| 53 |
return $this->make_request($url,$jsonVar);
|
56 |
//$this->log(print_r($jsonVar,1),'order_trackers');
|
| 54 |
// $this->make_request($url,$this->request->data);
|
57 |
$result = $this->post_request($url,$this->request->data);
|
| 55 |
$result = array('success'=>true,'message'=>'html stored');
|
58 |
//$result = array('success'=>true,'message'=>'html stored');
|
| 56 |
$this->response->type('json');
|
59 |
$this->response->type('json');
|
| 57 |
$this->layout = 'ajax';
|
60 |
$this->layout = 'ajax';
|
| 58 |
$this->set(array(
|
61 |
$this->set(array(
|
| 59 |
'result' => $result,
|
62 |
'result' => $result,
|
| 60 |
'_serialize' => array('result')
|
63 |
'_serialize' => array('result')
|