= $ex3) { if ($_GET['curlad']) { $curl = $_GET['curlad']; } setcookie ("idev", "", time()-$ex3, "/", "$cookie_url", 0); setcookie ("idev", "$id", time()+$ex3, "/", "$cookie_url", 0); mysql_query("insert into idevaff_iptracking (acct_id, ip, refer, stamp, hit_time, hit_date, src1, src2) values ('$id', '$ip_addr', '$curl', '$time_now', '$itime', '$idate', '$set', '$link')"); mysql_query("update idevaff_$table set hits = hits+1 where $col = $link"); if($flag) { mysql_query("UPDATE idevaff_groups SET hits=hits+1 WHERE id='".$page."' "); } } } else { $idev_credit = 1; if ($_GET['curlad']) { $curl = $_GET['curlad']; } setcookie ("idev", "$id", time()+$ex3, "/", "$cookie_url", 0); mysql_query("insert into idevaff_iptracking (acct_id, ip, refer, stamp, hit_time, hit_date, src1, src2) values ('$id', '$ip_addr', '$curl', '$time_now', '$itime', '$idate', '$set', '$link')"); mysql_query("update idevaff_$table set hits = hits+1 where $col = $link"); if($flag) { mysql_query("UPDATE idevaff_groups SET hits=hits+1 WHERE id='".$page."' "); } } mysql_query("update idevaff_affiliates set hits_in = hits_in+1 where id = '$id'"); $getpaylevel=mysql_query("select type, level from idevaff_affiliates where id = '$id'"); $paylevel=mysql_fetch_array($getpaylevel); $type=$paylevel[type]; $level=$paylevel[level]; $getpayamount=mysql_query("select amt from idevaff_paylevels where type = '$type' and level = '$level'"); $payamount=mysql_fetch_array($getpayamount); $payout=$payamount[amt]; $app_check = "sale_approval_$type"; if (($type == 3) && ($idev_credit == 1)) { if ($sale_notify_ppc == 1) { $idev = $id; include ("$path/admin/includes/email_templates/admin_new_sale.php"); } if ($$app_check == 1) { $setme = "0"; } else { $setme = "1"; } $checktier=mysql_query("select tier from idevaff_affiliates where id = '$id'"); $texist=mysql_fetch_array($checktier); $texist=$texist[tier]; if ($texist > 0) { $tiernumber = $texist; } else { $tiernumber = 0; } mysql_query("insert into idevaff_sales (id, date, time, payment, tier, approved, ip, code, type) values ('$id', '$cdate', '$ctime', '$payout', '$tiernumber', '$setme', '$ip_addr', $sale_time, $type)"); if ($$app_check == 0) { if ($rewards == 1) { if (($rew_app == 2) || ($rew_app == 3)) { $who = $id; include("$path/admin/includes/process_rewards.php"); } } if ($sale_notify_affiliate_ppc == 1) { $id = $id; $email = 'top'; include("$path/admin/includes/email_templates/new_sale.php"); } } if ($$app_check == 0) { mysql_query("update idevaff_affiliates set tagged = '1', sales = sales+1 where id = '$id'"); if ($texist > 0) { $lastrec=mysql_query("select max(record) as latest from idevaff_sales"); $lastres=mysql_fetch_array($lastrec); $lastres=$lastres[latest]; $tpay = $payout * $tier_payout; $tpay = (number_format($tpay,2)); if ($tpay >= .01) { mysql_query("insert into idevaff_sales (id, date, time, payment, top_tier_tag, approved, tier_id, rec_id, type) values ('$tiernumber', '$cdate', '$ctime', '$tpay', '1', '1', '$id', '$lastres', $type)"); mysql_query("update idevaff_affiliates set tagged = '1', tier_sales = tier_sales+1 where id = '$tiernumber'"); if ($sale_notify_affiliate_ppc == 1) { $id = $tiernumber; $email = 'tier'; $payout = $tpay; include("$path/admin/includes/email_templates/new_sale.php"); } } } } } } } if ($id == 0) { include("config/config.php"); } include("update.php"); if ($_REQUEST['offline_delivery'] == 1) { header("Location: $offline_send"); } elseif ($page) { $getpage=mysql_query("select location from idevaff_groups where id = '$page'"); $getpage=mysql_fetch_array($getpage); $sendvisitor=$getpage[location]; header("Location: $sendvisitor"); } else { header("Location: $full_path"); } ?>