$api_key_user, 'password' => $api_key_pass, 'campaignId' => $campaign_id, 'pageType' => $pageKonnective, 'sessionId' => $session_id, 'userAgent' => $_SERVER['HTTP_USER_AGENT'], 'requestUri' => $requestUri, 'ipAddress' => $_SERVER['REMOTE_ADDR'], 'httpReferer' => $httpReferer ); $Curl_Session = curl_init(); curl_setopt($Curl_Session, CURLOPT_URL, 'https://api.konnektive.com/landers/clicks/import/'); curl_setopt($Curl_Session, CURLOPT_POST, 1); curl_setopt($Curl_Session, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($Curl_Session, CURLOPT_POSTFIELDS, http_build_query($fields)); curl_setopt($Curl_Session, CURLOPT_RETURNTRANSFER, 1); $content = curl_exec($Curl_Session); $ret = json_decode($content); if($ret->result == 'SUCCESS') { $_SESSION['session_id'] = $ret->message->sessionId; $ok=$ret->message; } else{$ok="not ok";} $session_id = $_SESSION['session_id']; function getRealIpAddr() { if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet { $ip=$_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy { $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip=$_SERVER['REMOTE_ADDR']; } return $ip; } function countryByIp(){ $xml = simplexml_load_file("http://www.geoplugin.net/xml.gp?ip=".getRealIpAddr()); $country = $xml->geoplugin_countryCode; if($country==''){$country='US';} return $country; } function getUrlWithSessionId($session_id){ $nr=0; $exist_session=0; $output=''; foreach($_GET as $key=>$val) { if($val!=''){ if($key=='session_id'){$exist_session++;} if($nr==0){$output.='';}else{$output.= '&';} $output.=$key."=".$val; $nr++; } } if($exist_session==0){ if($nr==0){$output.='';}else{$output.= '&';} $output.="session_id=".$session_id; } return $output; } function getUrlWithSessionIdAndWithoutProductId($session_id){ $nr=0; $exist_session=0; $output=''; foreach($_GET as $key=>$val) { if($val!='' and $key!='product_id'){ if($key=='session_id'){$exist_session++;} if($nr==0){$output.='';}else{$output.= '&';} $output.=$key."=".$val; $nr++; } } if($exist_session==0){ if($nr==0){$output.='';}else{$output.= '&';} $output.="session_id=".$session_id; } return $output; } function getCountries(){ $countryArray = array(); $countryArray["US"] = "United States"; $countryArray["GB"] = "United Kingdom"; $countryArray["AU"] = "Australia"; $countryArray["AT"] = "Austria"; $countryArray["AD"] = "Andorra"; $countryArray["AF"] = "Afghanistan"; $countryArray["AG"] = "Antigua and Barbuda"; $countryArray["AI"] = "Anguilla"; $countryArray["AL"] = "Albania"; $countryArray["AM"] = "Armenia"; $countryArray["AO"] = "Angola"; $countryArray["AR"] = "Argentina"; $countryArray["AS"] = "American Samoa"; $countryArray["AW"] = "Aruba"; $countryArray["AX"] = "Aland Islands"; $countryArray["DZ"] = "Algeria"; $countryArray["AZ"] = "Azerbaijan"; $countryArray["BA"] = "Bosnia"; $countryArray["BB"] = "Barbados"; $countryArray["BD"] = "Bangladesh"; $countryArray["BE"] = "Belgium"; $countryArray["BF"] = "Burkina Faso"; $countryArray["BG"] = "Bulgaria"; $countryArray["BH"] = "Bahrain"; $countryArray["BI"] = "Burundi"; $countryArray["BJ"] = "Benin"; $countryArray["BM"] = "Bermuda"; $countryArray["BN"] = "Brunei Darussalam"; $countryArray["BO"] = "Bolivia"; $countryArray["BR"] = "Brazil"; $countryArray["BS"] = "Bahamas"; $countryArray["BT"] = "Bhutan"; $countryArray["BW"] = "Botswana"; $countryArray["BY"] = "Belarus"; $countryArray["BZ"] = "Belize"; $countryArray["VG"] = "British Virgin Islands"; $countryArray["IO"] = "British Indian Ocean"; $countryArray["CA"] = "Canada"; $countryArray["CC"] = "Cocos"; $countryArray["CD"] = "Congo (Democratic Republic of the)"; $countryArray["CF"] = "Central African Republic"; $countryArray["CG"] = "Congo"; $countryArray["CI"] = "Cote D'Ivoire"; $countryArray["CL"] = "Chile"; $countryArray["CM"] = "Cameroon"; $countryArray["CN"] = "China"; $countryArray["CO"] = "Colombia"; $countryArray["CR"] = "Costa Rica"; $countryArray["CU"] = "Cuba"; $countryArray["CV"] = "Cape Verde"; $countryArray["CX"] = "Christmas Island"; $countryArray["CY"] = "Cyprus"; $countryArray["CZ"] = "Czech Republic"; $countryArray["HR"] = "Croatia"; $countryArray["TD"] = "Chad"; $countryArray["KY"] = "Cayman Islands"; $countryArray["KH"] = "Cambodia"; $countryArray["DK"] = "Denmark"; $countryArray["DJ"] = "Djibouti"; $countryArray["DM"] = "Dominica"; $countryArray["DO"] = "Dominican Republic"; $countryArray["EC"] = "Ecuador"; $countryArray["EE"] = "Estonia"; $countryArray["EG"] = "Egypt"; $countryArray["ER"] = "Eritrea"; $countryArray["ET"] = "Ethiopia"; $countryArray["GQ"] = "Equatorial Guinea"; $countryArray["FI"] = "Finland"; $countryArray["FJ"] = "Fiji"; $countryArray["FK"] = "Falkland Islands "; $countryArray["FO"] = "Faroe Islands"; $countryArray["FR"] = "France"; $countryArray["GF"] = "French Guiana"; $countryArray["DE"] = "Germany"; $countryArray["GA"] = "Gabon"; $countryArray["GD"] = "Grenada"; $countryArray["GE"] = "Georgia"; $countryArray["GH"] = "Ghana"; $countryArray["GI"] = "Gibraltar"; $countryArray["GL"] = "Greenland"; $countryArray["GM"] = "Gambia"; $countryArray["GN"] = "Guinea"; $countryArray["GP"] = "Guadeloupe"; $countryArray["GR"] = "Greece"; $countryArray["GT"] = "Guatemala"; $countryArray["GW"] = "Guinea-bissau"; $countryArray["GY"] = "Guyana"; $countryArray["HK"] = "Hong Kong"; $countryArray["HN"] = "Honduras"; $countryArray["HT"] = "Haiti"; $countryArray["HU"] = "Hungary"; $countryArray["IT"] = "Italy"; $countryArray["ID"] = "Indonesia"; $countryArray["IL"] = "Israel"; $countryArray["IM"] = "Isle of Man"; $countryArray["IN"] = "India"; $countryArray["IE"] = "Ireland"; $countryArray["IQ"] = "Iraq"; $countryArray["IR"] = "Iran (Islamic Republic of)"; $countryArray["IS"] = "Iceland"; $countryArray["JE"] = "Jersey"; $countryArray["JM"] = "Jamaica"; $countryArray["JO"] = "Jordan"; $countryArray["JP"] = "Japan"; $countryArray["KE"] = "Kenya"; $countryArray["KG"] = "Kyrgyzstan"; $countryArray["KI"] = "Kiribati"; $countryArray["KP"] = "Korea, North"; $countryArray["KR"] = "Korea, South"; $countryArray["KW"] = "Kuwait"; $countryArray["KZ"] = "Kazakhstan"; $countryArray["LU"] = "Luxembourg"; $countryArray["LA"] = "Lao People's Democratic Republic"; $countryArray["LB"] = "Lebanon"; $countryArray["LI"] = "Liechtenstein"; $countryArray["LR"] = "Liberia"; $countryArray["LS"] = "Lesotho"; $countryArray["LT"] = "Lithuania"; $countryArray["LV"] = "Latvia"; $countryArray["LY"] = "Libyan Arab Jamahiriya"; $countryArray["MA"] = "Morocco"; $countryArray["MC"] = "Monaco"; $countryArray["MD"] = "Moldova"; $countryArray["MG"] = "Madagascar"; $countryArray["MH"] = "Marshall Islands"; $countryArray["MK"] = "Macedonia"; $countryArray["ML"] = "Mali"; $countryArray["MM"] = "Myanmar"; $countryArray["MN"] = "Mongolia"; $countryArray["MQ"] = "Martinique"; $countryArray["MR"] = "Mauritania"; $countryArray["MS"] = "Montserrat"; $countryArray["MT"] = "Malta"; $countryArray["MU"] = "Mauritius"; $countryArray["MV"] = "Maldives"; $countryArray["MW"] = "Malawi"; $countryArray["MX"] = "Mexico"; $countryArray["MY"] = "Malaysia"; $countryArray["MZ"] = "Mozambique"; $countryArray["NA"] = "Namibia"; $countryArray["NE"] = "Niger"; $countryArray["NG"] = "Nigeria"; $countryArray["NI"] = "Nicaragua"; $countryArray["NP"] = "Nepal"; $countryArray["NL"] = "Netherlands"; $countryArray["NR"] = "Nauru"; $countryArray["NZ"] = "New Zealand"; $countryArray["NO"] = "Norway"; $countryArray["MP"] = "Northern Mariana Islands"; $countryArray["OM"] = "Oman"; $countryArray["PA"] = "Panama"; $countryArray["PE"] = "Peru"; $countryArray["PG"] = "Papua New Guinea"; $countryArray["PH"] = "Philippines"; $countryArray["PK"] = "Pakistan"; $countryArray["PL"] = "Poland"; $countryArray["PR"] = "Puerto Rico"; $countryArray["PT"] = "Portugal"; $countryArray["PW"] = "Palau"; $countryArray["PY"] = "Paraguay"; $countryArray["QA"] = "Qatar"; $countryArray["ES"] = "Spain"; $countryArray["RS"] = "Serbia"; $countryArray["SE"] = "Sweden"; $countryArray["SG"] = "Singapore"; $countryArray["PM"] = "Saint Pierre and Miquelon"; $countryArray["RE"] = "Réunion"; $countryArray["RO"] = "Romania"; $countryArray["RU"] = "Russian Federation"; $countryArray["RW"] = "Rwanda"; $countryArray["ZA"] = "South Africa"; $countryArray["SA"] = "Saudi Arabia"; $countryArray["KN"] = "Saint Kitts and Nevis"; $countryArray["CH"] = "Switzerland"; $countryArray["SB"] = "Solomon Islands"; $countryArray["SC"] = "Seychelles"; $countryArray["SD"] = "Sudan"; $countryArray["SH"] = "St. Helena"; $countryArray["SI"] = "Slovenia"; $countryArray["SJ"] = "Svalbard and Jan Mayen Islands"; $countryArray["SK"] = "Slovak Republic"; $countryArray["SL"] = "Sierra Leone"; $countryArray["SM"] = "San Marino"; $countryArray["WS"] = "Samoa"; $countryArray["SN"] = "Senegal"; $countryArray["SO"] = "Somalia"; $countryArray["SR"] = "Suriname"; $countryArray["SY"] = "Syrian Arab Republic"; $countryArray["SZ"] = "Swaziland"; $countryArray["LK"] = "Sri Lanka"; $countryArray["TC"] = "Turks and Caicos Islands "; $countryArray["TG"] = "Togo"; $countryArray["TH"] = "Thailand"; $countryArray["TJ"] = "Tajikistan"; $countryArray["TM"] = "Turkmenistan"; $countryArray["TN"] = "Tunisia"; $countryArray["TO"] = "Tonga"; $countryArray["TR"] = "Turkey"; $countryArray["TT"] = "Trinidad and Tobago"; $countryArray["TV"] = "Tuvalu"; $countryArray["TW"] = "Taiwan"; $countryArray["TZ"] = "Tanzania, United Republic of"; $countryArray["AE"] = "United Arab Emirates"; $countryArray["UA"] = "Ukraine"; $countryArray["UG"] = "Uganda"; $countryArray["UY"] = "Uruguay"; $countryArray["UZ"] = "Uzbekistan"; $countryArray["VA"] = "Vatican City State (Holy See)"; $countryArray["VE"] = "Venezuela"; $countryArray["VI"] = "Virgin Islands, US"; $countryArray["VN"] = "Viet Nam"; $countryArray["VU"] = "Vanuatu"; $countryArray["EH"] = "Western Sahara"; $countryArray["YE"] = "Yemen"; $countryArray["ZM"] = "Zambia"; $countryArray["ZW"] = "Zimbabwe"; return $countryArray; } function getSessionID(){ if(isset($_SESSION['session_id'])){ $session_id = $_SESSION['session_id']; }else{ if(isset($_GET['session_id'])){ $session_id = $_GET['session_id']; }else{ $session_id = ''; } } } //include_once($_SERVER['DOCUMENT_ROOT'].'/konnective/config.php'); // include_once($_SERVER['DOCUMENT_ROOT'].'/konnective/click.php'); //include_once($_SERVER['DOCUMENT_ROOT'].'/konnective/functions.php'); $countryByIp = countryByIp(); $paay_yes_no=0; $paypal=1; if($paypal==0){$display_paypal='display:none;';}else{$display_paypal='';} if(isset($_REQUEST['product_id'])){$prd=$_REQUEST['product_id'];;}else{$prd=$product_1_bottle;} $output=getUrlWithSessionIdAndWithoutProductId($session_id); if(isset($_SESSION['orderId_partial'])){$crm_added=1;}else{$crm_added=0;} $off=0; $off_prod='?product_id='.$product_1_bottle_10off; if($prd==$product_6_bottle_10off){ $ff = '../images-prod/6bottle.png'; $bot_text = $name_6_bottle_10off; $nr_bottles=6; $off=1; $pr_price_retail=69*6; $pr_price=$price_6_bottle_10off; $pr_bottle=44; $you_save=36; $free_bottles=""; } elseif($prd==$product_3_bottle_10off){ $ff = '../images-prod/3bottle.png'; $bot_text = $name_3_bottle_10off; $nr_bottles=3; $off=1; $pr_price_retail=69*3; $pr_price=$price_3_bottle_10off; $pr_bottle=53; $you_save=23; $free_bottles=""; } elseif($prd==$product_1_bottle_10off){ $ff = '../images-prod/1bottle.png'; $bot_text = $name_1_bottle_10off; $nr_bottles=1; $off=1; $pr_price_retail=69; $pr_price=$price_1_bottle_10off; $pr_bottle=62; $you_save=10; $free_bottles=""; } elseif($prd==$product_6_bottle){ $ff = '../images-prod/6bottle.png'; $bot_text = $name_6_bottle; $nr_bottles=6; $off_prod='?product_id='.$product_6_bottle_10off.'&'.$output; $pr_price_retail=69*6; $pr_price=$price_6_bottle; $pr_bottle=49; $you_save=29; $free_bottles=""; } elseif($prd==$product_3_bottle){ $ff = '../images-prod/3bottle.png'; $bot_text = $name_3_bottle; $nr_bottles=3; $off_prod='?product_id='.$product_3_bottle_10off.'&'.$output; $pr_price_retail=69*3; $pr_price=$price_3_bottle; $pr_bottle=59; $you_save=15; $free_bottles=""; } else{ $ff = '../images-prod/1bottle.png'; $bot_text = $name_1_bottle; $nr_bottles=1; $off_prod='?product_id='.$product_1_bottle_10off.'&'.$output; $pr_price_retail=69; $pr_price=$price_1_bottle; $pr_bottle=69; $you_save=0; $free_bottles=""; } include_once($_SERVER['DOCUMENT_ROOT'].'/js/functions.php'); modal_footer_links(); $currancy_symbol='$'; ?>