| Line 15... |
Line 15... |
| 15 |
if(!isset($currentclient))
|
15 |
if(!isset($currentclient))
|
| 16 |
{$currentclient = $this -> session -> userdata('current_client');}*/
|
16 |
{$currentclient = $this -> session -> userdata('current_client');}*/
|
| 17 |
|
17 |
|
| 18 |
$currentclient = $this -> config -> item('current_client');
|
18 |
$currentclient = $this -> config -> item('current_client');
|
| 19 |
$this -> load -> config($currentclient);
|
19 |
$this -> load -> config($currentclient);
|
| 20 |
// $model = $currentclient.'_model';
|
20 |
$model = $currentclient.'_model';
|
| 21 |
// $this->load->model($model);
|
21 |
$this->load->model($model);
|
| 22 |
// $url = $this->config->item('curl_base_url').'tracking';
|
22 |
$url = $this->config->item('curl_base_url').'tracking';
|
| 23 |
// $params = array();
|
23 |
$params = array();
|
| 24 |
// if (isset($_SERVER['HTTP_REFERER'])){
|
24 |
if (isset($_SERVER['HTTP_REFERER'])){
|
| 25 |
// $params['referer'] = $_SERVER['HTTP_REFERER'];
|
25 |
$params['referer'] = $_SERVER['HTTP_REFERER'];
|
| 26 |
// }else{
|
26 |
}else{
|
| 27 |
// $params['referer'] = '';
|
27 |
$params['referer'] = '';
|
| 28 |
// }
|
28 |
}
|
| 29 |
// if(isset($_GET['afid']) && !empty($_GET['afid'])){
|
29 |
if(isset($_GET['afid']) && !empty($_GET['afid'])){
|
| 30 |
// $params['afid'] = $_GET['afid'];
|
30 |
$params['afid'] = $_GET['afid'];
|
| 31 |
// }else{
|
31 |
}else{
|
| 32 |
// $params['afid'] = '';
|
32 |
$params['afid'] = '';
|
| 33 |
// }
|
33 |
}
|
| 34 |
// if(isset($_GET['utm_source']) && !empty($_GET['utm_source'])){
|
34 |
if(isset($_GET['utm_source']) && !empty($_GET['utm_source'])){
|
| 35 |
// $params['utm_source'] = $_GET['utm_source'];
|
35 |
$params['utm_source'] = $_GET['utm_source'];
|
| 36 |
// }else{
|
36 |
}else{
|
| 37 |
// $params['utm_source'] = '';
|
37 |
$params['utm_source'] = '';
|
| 38 |
// }
|
38 |
}
|
| 39 |
// $this->mcurl->add_call('tracking','post',$url,$params);
|
39 |
$this->mcurl->add_call('tracking','post',$url,$params);
|
| 40 |
// $response = $this->mcurl->execute($url);
|
40 |
$response = $this->mcurl->execute($url);
|
| 41 |
// $data['response'] = $response['tracking']['response'];
|
41 |
$data['response'] = $response['tracking']['response'];
|
| 42 |
// $response = $this->magento_model->product_list($data);
|
42 |
$response = $this->magento_model->product_list($data);
|
| 43 |
// if(isset($response[0]->response) && !empty($response[0]->response)){
|
43 |
if(isset($response[0]->response) && !empty($response[0]->response)){
|
| 44 |
// foreach ($response[0]->response as $key => $value) {
|
44 |
foreach ($response[0]->response as $key => $value) {
|
| 45 |
// if($value->maxAge != -1){
|
45 |
if($value->maxAge != -1){
|
| 46 |
// $expires = time()+$value->maxAge;
|
46 |
$expires = time()+$value->maxAge;
|
| 47 |
// $newdata = (object) array( "name" => $value->name, "value" => $value->value, "expires"=>$expires,"path"=>$value->path,"secure"=>$value->secure);
|
47 |
$newdata = (object) array( "name" => $value->name, "value" => $value->value, "expires"=>$expires,"path"=>$value->path,"secure"=>$value->secure);
|
| 48 |
// $cookieData = (object) array( "data" => $newdata);
|
48 |
$cookieData = (object) array( "data" => $newdata);
|
| 49 |
// setcookie( "$value->name", json_encode( $cookieData ), $expires , "$value->path",'',$value->secure);
|
49 |
setcookie( "$value->name", json_encode( $cookieData ), $expires , "$value->path",'',$value->secure);
|
| 50 |
// }else{
|
50 |
}else{
|
| 51 |
// $newdata = (object) array( "name" => $value->name, "value" => $value->value, "expires"=>$value->maxAge,"path"=>$value->path,"secure"=>$value->secure);
|
51 |
$newdata = (object) array( "name" => $value->name, "value" => $value->value, "expires"=>$value->maxAge,"path"=>$value->path,"secure"=>$value->secure);
|
| 52 |
// $cookieData = (object) array( "data" => $newdata);
|
52 |
$cookieData = (object) array( "data" => $newdata);
|
| 53 |
// setcookie( "$value->name", json_encode( $cookieData ), $value->maxAge , "$value->path",'',$value->secure);
|
53 |
setcookie( "$value->name", json_encode( $cookieData ), $value->maxAge , "$value->path",'',$value->secure);
|
| 54 |
// }
|
54 |
}
|
| 55 |
// }
|
55 |
}
|
| 56 |
// }
|
56 |
}
|
| 57 |
|
57 |
|
| 58 |
|
58 |
|
| 59 |
}
|
59 |
}
|
| 60 |
|
60 |
|
| 61 |
|
61 |
|