| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/usa_sites/usafundingapplications.ai/ |
Upload File : |
<?php
session_start();
require_once($_SERVER['DOCUMENT_ROOT'].'/inc/php_header.php');
if(!$_POST) {
header("Location: /");
exit();
}
$do_session = $_GET['s'];
$special_order = $_REQUEST['so'];
$tc = (!isset($_REQUEST['tc'])) ? 'none': $_REQUEST['tc'];
$cc_fname = $_REQUEST['cc_fname'];
$cc_lname = $_REQUEST['cc_lname'];
$cc_addr = $_REQUEST['cc_addr'];
$cc_city = $_REQUEST['cc_city'];
$cc_zip = $_REQUEST['cc_zip'];
$cc_state = $_REQUEST['cc_state'];
if(!empty($cc_zip) && (empty($cc_city) || empty($cc_state))) {
$zip_json = file_get_contents("http://surfcrm.com/lcapi/Zip2City.php?zip=".$cc_zip);
$zip_info = json_decode($zip_json,true);
$cc_city = $zip_info['city'];
$cc_state = $zip_info['state'];
}
$cc_country = $_REQUEST['cc_country'];
if(!empty($_REQUEST['phone_full'])) {
$pn = preg_replace('/[^0-9]/','',$_REQUEST['phone_full']);
$_REQUEST['cc_phonearea'] = substr($pn,0,3);
$_REQUEST['cc_phoneprefix'] = substr($pn,3,3);
$_REQUEST['cc_phoneextension'] = substr($pn,6,4);
$_POST['cc_phonearea'] = substr($pn,0,3);
$_POST['cc_phoneprefix'] = substr($pn,3,3);
$_POST['cc_phoneextension'] = substr($pn,6,4);
}
$cc_phonearea = $_REQUEST['cc_phonearea'];
$cc_phoneprefix = $_REQUEST['cc_phoneprefix'];
$cc_phoneextension = $_REQUEST['cc_phoneextension'];
$cc_phonearea2 = $_REQUEST['cc_phonearea2'];
$cc_phoneprefix2 = $_REQUEST['cc_phoneprefix2'];
$cc_phoneextension2 = $_REQUEST['cc_phoneextension2'];
$cc_email = $_REQUEST['cc_email'];
$cc_type = $_REQUEST['cc_type'];
$cc_num = $_REQUEST['cc_num'];
$partial_cc_num = "****" . substr($cc_num,12);
$cc_month = $_REQUEST['cc_month'];
$cc_year = $_REQUEST['cc_year'];
$cc_cvv = $_REQUEST['cc_cvv'];
$cardholder_name = $_REQUEST['cardholder_name'];
$billing_street_address = $_REQUEST['billing_street_address'];
$billing_city = $_REQUEST['billing_city'];
$billing_state = $_REQUEST['billing_state'];
$billing_zip = $_REQUEST['billing_zip'];
$cc_lead_id = $_REQUEST['cc_lead_id'];
$app_gender = $_REQUEST['app_gender'];
$app_age = $_REQUEST['app_age'];
$app_citizenship = $_REQUEST['app_citizenship'];
$user_id = $_REQUEST['user_id'];
$agreement = $_REQUEST['agree2terms'];
$app_amount_needed = $_REQUEST['app_amount_needed'];
$app_usedescription = $_REQUEST['app_usedescription'];
$initial_subscription_fee = (isset($_REQUEST['cc_amount']) && is_numeric($_REQUEST['cc_amount'])) ? $_REQUEST['cc_amount'] : $_INITIAL_FEE;
$monthly_subscription_fee = $_MONTHLY_FEE;
$monthly_subscription_trial = 30;
if(!empty($_REQUEST['form_version'])) {
$_SESSION['form_version'] = $_REQUEST['form_version'];
}
if ($do_session == '1')
{
foreach($_SESSION as $key=>$value)
{
$_POST[$key] = $value;
}
}
else
{
/*foreach ($_SESSION as $key=>$value)
{
if($key!='upsell_tracking_version' && $key!='form_version' && $key!='keywords') {
unset($_SESSION[$key]);
}
}*/
foreach ($_POST as $key=>$value)
{
$_SESSION[$key] = $value;
}
}
/*
* IE doesn't see <input type='image' /> exactly as a submit button, it does however add the (x,y) coordinate to the submitted form values (name_x, name_y)
*/
if($_REQUEST['submit_add_subscription_x'] || $_REQUEST['submit_add_subscription']) {
$_REQUEST['submit'] = 'Add Subscription'; //please add grant research to my subsctiptions
} else if($_REQUEST['submit_no_thanks_x'] || $_REQUEST['submit_no_thanks']) {
$_REQUEST['submit'] = 'No Thanks'; //do not add grant research to my subscriptions
} else {
$_REQUEST['submit'] = 'Default'; //the original order page
}
switch($_REQUEST['submit']) {
//submitted second order page
case "Add Subscription":
$foo = file_get_contents('https://surfcrm.com/lcapi/TrackUpsellButton.php?site_code='.$_SITE_CODE.'&client_id='.$user_id.'&response=Yes&upsell_version='.urlencode($_SESSION['upsell_tracking_version']).'&upsell_version_description='.urlencode($_SESSION['upsell_tracking_version_description']));
$postfields = array();
$postfields['user_id'] = $user_id;
$postfields['sendemail'] = 'yes';
$postfields['email_type'] = 'Confirmation Subscription Id 3';
$postfields['site'] = $_SITE_CODE;
$postfields['ipaddress'] = $_SERVER['REMOTE_ADDR'];
$postfields['source'] = (!empty($_SESSION['upsell_tracking_version'])) ? $_SESSION['upsell_tracking_version'] : 'site order';
$postfields['rep'] = '';
$subscriptions_params = "subscriptions[]=2"; //right now just using the defaults for grant research subscription
$subscriptions_params .= "&subscription_amount[]=29.95";
$subscriptions_params .= "&subscription_trial[]=30";
$subscriptions_params .= "&subscriptions[]=3"; //right now just using the defaults for grant research subscription
$subscriptions_params .= "&subscription_amount[]=5.00";
$subscriptions_params .= "&subscription_trial[]=30";
$result = false;
$errormessage = '';
//Check if they already have the upsell
include_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/mysql.php');
$db = new MySQL('db.syndbs.com', 'lc2user', 'SYN57CRUZ', 'lc2admin');
$res = $db->get_results("SELECT reseller_id
FROM lc2usaga_lc.lc_clients_subscriptions
WHERE reseller_id='".$db->clean($user_id)."'
AND subscription_id='2'");
$result = (object) array();
if(!empty($res)) {
$result->status = 'Success';
} else {
$lcapi = new LCAPI();
$result = $lcapi->PostFields("https://surfcrm.com/lcapi/AddUserSubscriptions.php?$subscriptions_params",$postfields);
}
if(empty($_SESSION['upsell_tracking_version'])) {
$_SESSION['upsell_tracking_version'] = 'order member';
}
file_get_contents('https://surfcrm.com/lcapi/UpsellTracking.php?site_code='.urlencode($_SITE_CODE).'&version='.urlencode($_SESSION['upsell_tracking_version']).'&type=click');
if(empty($cc_email)) {
$cc_email = $_SESSION['auth_user'];
$cc_zip = $_SESSION['auth_pass'];
}
header("Location: confirm_v5.php");
//header('location: /vx/usa/members/?user='.$cc_email.'&pass='.$cc_zip.'&login_source=order_form');
exit();
if(true || $_SESSION['upsell_tracking_version']=='site order before' || $_SESSION['upsell_tracking_version']=='site order before v2') {
/*if($_SESSION['form_version']=='v4') {
include('confirm_v4.php');
} elseif($_SESSION['form_version']=='v5' || $_SESSION['form_version']=='v6' || $_SESSION['form_version']=='v7') {
include('confirm_v5.php');
} else {
include('confirm.php');
}*/
foreach($_REQUEST as $k=>$v) {
$_SESSION[$k] = $v;
}
header("Location: confirm_v5.php");
exit();
} else {
if(empty($cc_email)) {
$cc_email = $_SESSION['auth_user'];
$cc_zip = $_SESSION['auth_pass'];
}
header('Location: /vx/usa/members/?user='.urlencode($cc_email).'&pass='.urlencode($cc_zip).'&login_source=order_form');
//header('Location: v5/login.php?user='.urlencode($cc_email).'&pass='.urlencode($cc_zip));
exit();
}
break;
//continue to confirmation page
case "No Thanks":
$foo = file_get_contents('https://surfcrm.com/lcapi/TrackUpsellButton.php?site_code='.$_SITE_CODE.'&client_id='.$user_id.'&response=No&upsell_version='.urlencode($_SESSION['upsell_tracking_version']).'&upsell_version_description='.urlencode($_SESSION['upsell_tracking_version_description']));
if(empty($cc_email)) {
$cc_email = $_SESSION['auth_user'];
$cc_zip = $_SESSION['auth_pass'];
}
header("Location: confirm_v5.php");
//header('location: /vx/usa/members/?user='.$cc_email.'&pass='.$cc_zip.'&login_source=order_form');
exit();
if(true || $_SESSION['upsell_tracking_version']=='site order before' || $_SESSION['upsell_tracking_version']=='site order before v2') {
/*if($_SESSION['form_version']=='v4') {
include('confirm_v4.php');
} elseif($_SESSION['form_version']=='v5' || $_SESSION['form_version']=='v6' || $_SESSION['form_version']=='v7') {
include('confirm_v5.php');
} else {
include('confirm.php');
}*/
foreach($_REQUEST as $k=>$v) {
$_SESSION[$k] = $v;
}
header("Location: confirm_v5.php");
exit();
} else {
if(empty($cc_email)) {
$cc_email = $_SESSION['auth_user'];
$cc_zip = $_SESSION['auth_pass'];
}
header('Location: /vx/usa/members/?user='.urlencode($cc_email).'&pass='.urlencode($cc_zip).'&login_source=order_form');
//header('Location: login.php?user='.urlencode($cc_email).'&pass='.urlencode($cc_zip));
exit();
}
break;
//initial order page
default:
$cc_lead_id = '';
if (isset($_REQUEST['category_id'])) {
// We need to get a lead_id from the learning Center API
$postfields = array();
$postfields['fname'] = $cc_fname;
$postfields['lname'] = $cc_lname;
$postfields['address'] = $cc_addr;
$postfields['city'] = $cc_city;
$postfields['state'] = $cc_state;
$postfields['zip'] = $cc_zip;
$postfields['country'] = $cc_country;
$postfields['phone'] = $cc_phonearea . $cc_phoneprefix . $cc_phoneextension;
$postfields['phone2'] = $cc_phonearea2 . $cc_phoneprefix2 . $cc_phoneextension2;
$postfields['email'] = $cc_email;
$postfields['site'] = $_SITE_CODE;
$postfields['referer'] = $tc;
$postfields['ipaddress'] = $_SERVER['REMOTE_ADDR'];
$postfields['tc'] = $tc;
$postfields['sid'] = (isset($_REQUEST['sid']) && $_REQUEST['sid'] != '') ? $_REQUEST['sid'] : NULL;
$postfields['cid'] = (isset($_REQUEST['cid']) && $_REQUEST['cid'] != '') ? $_REQUEST['cid'] : NULL;
//=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=
$inform_me = $_REQUEST['inform_me'];
//=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=
$postfields['inform_me'] = $inform_me;
$postfields['form_filled_out'] = $_REQUEST['form_filled_out'];
$postfields['keywords'] = $_SESSION['keywords'];
$lcapi = new LCAPI();
$result = $lcapi->CreateLead($postfields);
if (!$result) {
$errormessage = $lcapi->response->errormessage;
} else {
$postfields = array();
$cc_lead_id = trim($lcapi->response->userid);
//Campaign Tracker (lc2{$site}_lc.campaign_tracking)
if(!empty($_SESSION['campaign_tracking_id'])) {
require_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/dinc.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/vx_/site_info.php');
$db->query("UPDATE lc2{$siteCode}_lc.campaign_tracking
SET lead_id='".clean($cc_lead_id)."'
WHERE id='".clean($_SESSION['campaign_tracking_id'])."'");
} else {
//Check anyway
require_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/dinc.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/vx_/site_info.php');
$db->query("UPDATE lc2{$siteCode}_lc.campaign_tracking ct
LEFT JOIN lc2{$siteCode}_lc.lc_leads l ON ct.ip_address=l.ip_address
SET ct.lead_id=l.id
WHERE ct.ip_address='".clean($_SERVER['REMOTE_ADDR'])."' AND DATE(ct.ts)=CURDATE() AND l.id='".clean($cc_lead_id)."'");
}
// We need to add the application information to the lead_profile DB via surfcrm.com
$url = "https://surfcrm.com/lcapi/leadprofile.php";
$postfields['aff_id'] = $_SITE_CODE;
$postfields['lead_id'] = $cc_lead_id;
$postfields['category_id'] = $_POST['category_id'];
$postfields['gender'] = $_POST['app_gender'];
$postfields['age'] = $_POST['app_age'];
$postfields['citizenship'] = $_POST['app_citizenship'];
$postfields['money'] = $_POST['app_amount_needed'];
$postfields['description'] = $_POST['app_usedescription'];
$postfields['uniqueness'] = $_POST['app_uniqueness'];
$postfields['phone'] = $cc_phonearea . $cc_phoneprefix . $cc_phoneextension;
$postfields['tracking_code'] = $tc;
$postfields['ethnicity'] = $_POST['ethnicity'];
$postfields['employment_status'] = $_POST['employment_status'];
$postfields['ip_address'] = $_SERVER['REMOTE_ADDR'];
$app_uniqueness = $_REQUEST['app_uniqueness'];
/*if($postfields['category_id']=='2') { //education/tuition
$postfields['diploma'] = $_POST['diploma'];
$postfields['online_business'] = $_POST['online_business'];
$postfields['serious_scale'] = $_POST['serious_scale'];
$postfields['college'] = $_POST['college'];
$postfields['degree'] = $_POST['degree'];
$postfields['willing_second_degree'] = $_POST['willing_second_degree'];
$postfields['have_computer'] = $_POST['have_computer'];
}*/
if($postfields['category_id']=='1') { //business
$postfields['operating_capital'] = $_POST['operating_capital'];
$postfields['wages'] = $_POST['wages'];
$postfields['marketing'] = $_POST['marketing'];
$postfields['training'] = $_POST['training'];
$postfields['building'] = $_POST['building'];
$postfields['construction'] = $_POST['construction'];
$postfields['equipment'] = $_POST['equipment'];
$postfields['technology'] = $_POST['technology'];
$postfields['licensing'] = $_POST['licensing'];
$postfields['inventory'] = $_POST['inventory'];
$postfields['other'] = $_POST['other'];
$postfields['business_profile'] = '1';
$postfields['own_business'] = $_POST['own_business'];
$postfields['business_structured'] = $_POST['business_structured'];
$postfields['living_trust'] = $_POST['living_trust'];
$postfields['how_many_employees'] = $_POST['how_many_employees'];
$postfields['annual_revenue'] = $_POST['annual_revenue'];
$postfields['name_of_business'] = $_POST['name_of_business'];
$postfields['has_website'] = $_POST['has_website'];
$postfields['website'] = $_POST['website'];
$postfields['defendant_lawsuit'] = $_POST['defendant_lawsuit'];
$postfields['sued_protected'] = $_POST['sued_protected'];
$postfields['putting_money_into_business'] = $_POST['putting_money_into_business'];
$postfields['putting_money_how_much'] = $_POST['putting_money_how_much'];
}
/*
$postfields['filed_bankruptcy'] = $_POST['filed_bankruptcy'];
$postfields['what_chapter'] = $_POST['what_chapter'];
$postfields['date_filed'] = $_POST['date_filed'];
$postfields['bankruptcy_result'] = $_POST['bankruptcy_result'];
$postfields['considered_bankruptcy'] = $_POST['considered_bankruptcy'];
$postfields['considered_why'] = $_POST['considered_why'];
$postfields['behind_on_bills'] = $_POST['behind_on_bills'];
$postfields['how_far_behind'] = $_POST['how_far_behind'];
$postfields['amount_of_unsecured_debt'] = $_POST['amount_of_unsecured_debt'];
$postfields['owe_backtaxes'] = $_POST['owe_backtaxes'];
$tax_years = array();
if(!empty($_POST['bankruptcy_which_year'])) {
foreach($_POST['bankruptcy_which_year'] as $k=>$v) {
if(!empty($v) && !empty($_POST['bankruptcy_amount_owed'][$k])) {
$tax_years[] = array('which_year'=>$v,'amount_owed'=>$_POST['bankruptcy_amount_owed'][$k]);
}
}
}
$postfields['tax_years'] = json_encode($tax_years);
$postfields['wages_garnished'] = $_POST['wages_garnished'];
$postfields['garnished_amount'] = $_POST['garnished_amount'];
$postfields['have_judgements'] = $_POST['have_judgements'];
$postfields['harrased_by_creditors'] = $_POST['harrased_by_creditors'];
$postfields['rent_or_own'] = $_POST['rent_or_own'];
$postfields['value_of_home'] = $_POST['value_of_home'];
$postfields['deliquent_on_mortgage'] = $_POST['deliquent_on_mortgage'];
$postfields['dependents_in_home'] = $_POST['dependents_in_home'];
$postfields['average_monthly_income'] = $_POST['average_monthly_income'];
$postfields['other_income_sources'] = $_POST['other_income_sources'];
$postfields['in_lawsuit'] = $_POST['in_lawsuit'];
$postfields['lawsuit_explain'] = $_POST['lawsuit_explain'];
$postfields['open_to_debt_relief'] = $_POST['open_to_debt_relief'];
*/
$postfields['describe_credit'] = $_POST['describe_credit'];
$postfields['want_to_improve_credit'] = $_POST['want_to_improve_credit'];
$postfields['turned_down_for_loan'] = $_POST['turned_down_for_loan'];
$postfields['main_goal_for_good_credit'] = $_POST['main_goal_for_good_credit'];
$postfields['goal_time_frame'] = $_POST['goal_time_frame'];
$postfields['how_serious'] = $_POST['how_serious'];
$postfields['talk_to_specialist'] = $_POST['talk_to_specialist'];
$postfields['give_permission_for_specialist'] = $_POST['give_permission_for_specialist'];
/*$postfields['applied_ssd'] = $_POST['applied_ssd'];
$postfields['currently_applying'] = $_POST['currently_applying'];
$postfields['denied_ssd'] = $_POST['denied_ssd'];
$postfields['when_denied'] = $_POST['when_denied'];
$postfields['why_denied'] = $_POST['why_denied'];
$postfields['stopped_work'] = $_POST['stopped_work'];
$postfields['why_cant_work'] = $_POST['why_cant_work'];
$postfields['out_of_work_12_months'] = $_POST['out_of_work_12_months'];
$postfields['treatment'] = $_POST['treatment'];
$postfields['worked_5_years'] = $_POST['worked_5_years'];
$postfields['have_attorney'] = $_POST['have_attorney'];
$postfields['result_of_military'] = $_POST['result_of_military'];
$postfields['can_prove_disability'] = $_POST['can_prove_disability'];
$postfields['currently_receiving_benefits'] = $_POST['currently_receiving_benefits'];
$postfields['currently_receiving_benefits_which'] = $_POST['currently_receiving_benefits_which'];
$postfields['thinking_of_applying'] = $_POST['thinking_of_applying'];
$postfields['between_30_and_64'] = $_POST['between_30_and_64'];
$postfields['talk_to_successful_advocacy'] = $_POST['talk_to_successful_advocacy'];
$postfields['condition_name'] = $_POST['condition_name'];
$postfields['best_phone_number'] = $_POST['best_phone_number'];
$postfields['what_is_age'] = $_POST['what_is_age'];*/
if(!empty($_POST['subcategories'])) {
$query = '';
foreach($_POST['subcategories'] as $id) {
$query .= ($query != '') ? '&subcategories[]='.$id : '?subcategories[]='.$id;
}
$url .= $query;
}
$response = getPage($url,$method='post',$postfields,"","","","","");
}
}
if (isset($_POST['submitted'])) {
$postfields = array();
$postfields['fname'] = $cc_fname;
$postfields['lname'] = $cc_lname;
$postfields['address'] = $cc_addr;
$postfields['city'] = $cc_city;
$postfields['state'] = $cc_state;
$postfields['zip'] = $cc_zip;
$postfields['country'] = $cc_country;
$postfields['phone'] = $cc_phonearea . $cc_phoneprefix . $cc_phoneextension;
$postfields['email'] = $cc_email;
$postfields['sendemail'] = 'no';
$postfields['cc_num'] = $cc_num;
$postfields['cc_exp_month'] = $cc_month;
$postfields['cc_exp_year'] = $cc_year;
$postfields['cc_cvv'] = $cc_cvv;
$postfields['cardholder_name'] = $cardholder_name;
$postfields['billing_street_address'] = $billing_street_address;
$postfields['billing_city'] = $billing_city;
$postfields['billing_state'] = $billing_state;
$postfields['billing_zip'] = $billing_zip;
$postfields['leadid'] = $cc_lead_id;
$postfields['site'] = $_SITE_CODE;
$postfields['referer'] = $tc;
$postfields['ipaddress'] = $_SERVER['REMOTE_ADDR'];
$postfields['tc'] = $tc;
$postfields['sid'] = (isset($_REQUEST['sid']) && $_REQUEST['sid'] != '') ? $_REQUEST['sid'] : NULL;
$postfields['cid'] = (isset($_REQUEST['cid']) && $_REQUEST['cid'] != '') ? $_REQUEST['cid'] : NULL;
$postfields['source'] = 'site order';
$postfields['rep'] = '';
if ($special_order == '1') {
$initial_subscription_fee = $_VSA_PRICE;
$postfields['referer'] = 'VSA';
}
$postfields['send_login_text'] = (empty($_REQUEST['send_login_text'])) ? '0' : $_REQUEST['send_login_text'];
$postfields['text_phone'] = (empty($_REQUEST['text_phone'])) ? '' : preg_replace('/[^0-9]/','',$_REQUEST['text_phone']);
if(!empty($_REQUEST['include_monthly_fee_order_form'])) {
//This has the upsell page built in to the order form
$postfields['source'] = 'order page v2';
}
$subscriptions_params = "subscriptions[]=1"; //right now just using the defaults for site access subscription
$subscriptions_params .= "&subscription_amount[]=".$initial_subscription_fee;
/*
* Temporary deny of all AMEX cards
*/
$result = false;
$errormessage = '';
//Deny all AMEX
if(false /*$postfields['cc_num']{0} == 3*/) { //we accept AMEX as of 1/8/2013
$errormessage = "We do not accept American Express. Please use another card. Thank you.";
} else {
$lcapi = new LCAPI();
$result = $lcapi->CreateUser($postfields, $subscriptions_params);
}
if(!$result) {
require_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/mysql.php');
$res = $db->query("SELECT id FROM lc2{$_SITE_CODE}_lc.lc_reseller WHERE email='".clean($postfields['email'])."' AND DATE(date_ordered)=CURDATE()");
if(!empty($res[0]['id'])) {
$result = true;
$lcapi->response->userid = $res[0]['id'];
}
}
if (!$result) {
if(true /*$postfields['cc_num']{0} != 3*/) { //we accept AMEX as of 1/8/2013
if($lcapi->response->errormessage) {
$errormessage = $lcapi->response->errormessage;
} else {
$errormessage = "There was an unexpected error. Please notify customer support.";
}
}
// failed transaction - show alert message
$error_message = $errormessage;
/*$page = ($special_order == '1') ? "special_order_form.php" : "order_form.php";
if($_SESSION['form_version']=='v4' || $_SESSION['form_version']=='v5' || $_SESSION['form_version']=='v6') {
include('order_form_v5.php');
} elseif($_SESSION['form_version']=='v4') {
include('order_form_v4.php');
} elseif($_SESSION['form_version']=='v7') {
include('order_form_v7.php');
} else {
include($page);
}*/
$rand2 = rand(1,4);
if($rand2==1) {
include('order_form_v5.php');
}
if($rand2==2) {
include('order_form_v4_icons.php');
}
if($rand2==3) {
include('order_form_v4_images.php');
}
if($rand2==4) {
include('order_form_v2.php');
}
exit();
} else {
// Successful transaction
// Send the user an email.
//$partial_cc_num = "****" . substr($cc_num,12);
$user_id = trim($lcapi->response->userid);
//Campaign Tracker (lc2{$site}_lc.campaign_tracking)
if(!empty($_SESSION['campaign_tracking_id'])) {
require_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/dinc.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/vx_/site_info.php');
$db->query("UPDATE lc2{$siteCode}_lc.campaign_tracking
SET client_id='".clean($user_id)."'
WHERE id='".clean($_SESSION['campaign_tracking_id'])."'");
} else {
//Check anyway
require_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/dinc.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/vx_/site_info.php');
$db->query("UPDATE lc2{$siteCode}_lc.campaign_tracking ct
LEFT JOIN lc2{$siteCode}_lc.lc_leads l ON ct.ip_address=l.ip_address
LEFT JOIN lc2{$siteCode}_lc.lc_reseller r ON r.id=l.customerID
SET ct.client_id=r.id
WHERE ct.ip_address='".clean($_SERVER['REMOTE_ADDR'])."' AND r.id='".clean($user_id)."'");
}
$success_message = "Your account has successfully been created.";
$lcapi = new LCAPI();
$postfields = array();
$postfields['site'] = $_SITE_CODE;
$postfields['user_id'] = $user_id;
if(!empty($_REQUEST['include_monthly_fee_order_form'])) {
//This has the upsell page built in to the order form
$postfields['email_type'] = 'Welcome';
$_SESSION['upsell_tracking_version'] = 'order page v2';
$_SESSION['upsell_tracking_version_description'] = 'built into order page';
file_get_contents('https://surfcrm.com/lcapi/UpsellTracking.php?site_code='.urlencode($_SITE_CODE).'&client_id='.urlencode($user_id).'&version='.urlencode($_SESSION['upsell_tracking_version']).'&type=impression');
if(!empty($_REQUEST['include_monthly_fee'])) {
$postfields['email_type'] = 'Confirmation Subscription Id 3';
$foo = file_get_contents('https://surfcrm.com/lcapi/TrackUpsellButton.php?site_code='.$_SITE_CODE.'&client_id='.$user_id.'&response=Yes&upsell_version='.urlencode($_SESSION['upsell_tracking_version']).'&upsell_version_description='.urlencode($_SESSION['upsell_tracking_version_description']));
$postfields2 = array();
$postfields2['user_id'] = $user_id;
$postfields2['sendemail'] = 'no';
$postfields2['email_type'] = 'Confirmation Subscription Id 3';
$postfields2['site'] = $_SITE_CODE;
$postfields2['ipaddress'] = $_SERVER['REMOTE_ADDR'];
$postfields2['source'] = (!empty($_SESSION['upsell_tracking_version'])) ? $_SESSION['upsell_tracking_version'] : 'site order';
$postfields2['rep'] = '';
$subscriptions_params2 = "subscriptions[]=2"; //right now just using the defaults for grant research subscription
$subscriptions_params2 .= "&subscription_amount[]=29.95";
$subscriptions_params2 .= "&subscription_trial[]=30";
$subscriptions_params2 .= "&subscriptions[]=3"; //right now just using the defaults for grant research subscription
$subscriptions_params2 .= "&subscription_amount[]=0.00";
$subscriptions_params2 .= "&subscription_trial[]=30";
$result = false;
$errormessage = '';
//Check if they already have the upsell
include_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/mysql.php');
$db = new MySQL('db.syndbs.com', 'lc2user', 'SYN57CRUZ', 'lc2admin');
$res = $db->get_results("SELECT reseller_id
FROM lc2usaga_lc.lc_clients_subscriptions
WHERE reseller_id='".$db->clean($user_id)."'
AND subscription_id='2'");
$result = (object) array();
if(!empty($res)) {
$result->status = 'Success';
} else {
$lcapi = new LCAPI();
$result = $lcapi->PostFields("https://surfcrm.com/lcapi/AddUserSubscriptions.php?$subscriptions_params2",$postfields2);
}
} else {
$foo = file_get_contents('https://surfcrm.com/lcapi/TrackUpsellButton.php?site_code='.$_SITE_CODE.'&client_id='.$user_id.'&response=No&upsell_version='.urlencode($_SESSION['upsell_tracking_version']).'&upsell_version_description='.urlencode($_SESSION['upsell_tracking_version_description']));
}
}
$lcapi->PostFields("https://surfcrm.com/lcapi/SendEmail.php",$postfields);
//update order form tracking page
$postfields = array();
$postfields['site'] = $_SITE_CODE;
$postfields['lead_id'] = $cc_lead_id;
$postfields['client_id'] = $user_id;
$lcapi->PostFields("https://surfcrm.com/lcapi/FormCCImpressionTrackingSale.php",$postfields);
//if(rand(0,1)) {
if(true) { //Always before as of 4/21/2014
/*$_SESSION['upsell_tracking_version'] = 'site order before';
if(rand(0,1)) {
include('order_research_service_before_v2.2.php');
} else {
if($_SESSION['form_version']=='v4') {
include('order_research_service_before_v4.php');
} elseif($_SESSION['form_version']=='v5' || $_SESSION['form_version']=='v6' || $_SESSION['form_version']=='v7') {
include('order_research_service_before_v5.php');
} else {
include("order_research_service_before.php");
}
}*/
/*$num = rand(0,3);
if($num==0) {
include("order_research_service_before_v3.2.php");
} elseif($num==1) {
include("order_research_service_before_v4.2.php");
} elseif($num==2) {
include("order_research_service_before_v5.2.php");
} else {
include("order_research_service_before_v6.2.php");
}
include("order_research_service_before_v6.2.php");
exit();
*/
//Turned off the upsell page 11/08/2017
//header("Location: confirm_v5.php");
//exit();
// Turned back on 12/12/2017
$_SESSION['user_id'] = $user_id;
if(!empty($_REQUEST['include_monthly_fee_order_form'])) {
//This has the upsell page built in to the order form
header("Location: confirm_v5.php");
exit();
}
//$rand = rand(1,3);
//if($rand==1) {
//Only v7 04/05/2019
/*$rand = rand(1,2);
if($rand==1) {
header("Location: /order_research_service_before_v7.php");
} else {
header("Location: /order_research_service_before_v10.php");
}*/
//v7 40%, v10 40%, v12 20% 02/27/2020
/*$rand = rand(1,10);
if($rand<=4) {
header("Location: /order_research_service_before_v7.php");
} elseif($rand<=8) {
header("Location: /order_research_service_before_v10.php");
} else {
header("Location: /order_research_service_before_v12.php");
}*/
//v7 20%, v10 20%, v12 20%, v13 40% 03/02/2020
//v10 100% 03/03/2020
header("Location: /order_research_service_before_v10.php");
/*$rand = rand(1,10);
if($rand<=4) {
header("Location: /order_research_service_before_v13.php");
} elseif($rand<=6) {
header("Location: /order_research_service_before_v12.php");
} elseif($rand<=8) {
header("Location: /order_research_service_before_v10.php");
} else {
header("Location: /order_research_service_before_v7.php");
}*/
//} elseif($rand==2) {
// header("Location: /order_research_service_before_v6.2.php");
//} else {
// header("Location: /order_research_service_before_v9.php");
//}
exit();
//include("order_research_service_before_v6.2.php");
exit();
} else {
$_SESSION['upsell_tracking_version'] = 'site order after';
if($_SESSION['form_version']=='v4') {
include('confirm_v4.php');
} elseif($_SESSION['form_version']=='v5' || $_SESSION['form_version']=='v6' || $_SESSION['form_version']=='v7') {
include('confirm_v5.php');
} else {
include("confirm.php");
}
exit();
}
//include("order_research_service_form.php");
//exit();
}
} else {
// Display the initial form
if ($cc_fname == '' || $cc_lname == '') {
if($_SESSION['form_version']=='v4') {
header("Location: /application_v4.php");
} elseif($_SESSION['form_version']=='v6') {
header("Location: /v6/");
} elseif($_SESSION['form_version']=='v5') {
header("Location: /v5/");
} elseif($_SESSION['form_version']=='v7') {
header("Location: /v7/");
} else {
header("Location: /");
}
exit();
}
if ($special_order == "1") {
include("special_order_form.php");
} else {
$use_vsa = false;
/*if($_SESSION['form_version']=='v4' || $_SESSION['form_version']=='v5' || $_SESSION['form_version']=='v6') {
include('order_form_v5.php');
} elseif($_SESSION['form_version']=='v4') {
include('order_form_v4.php');
} elseif($_SESSION['form_version']=='v7') {
include('order_form_v7.php');
} else {
include("order_form.php");
}*/
$rand2 = rand(1,4);
if($rand2==1) {
include('order_form_v5.php');
}
if($rand2==2) {
include('order_form_v4_icons.php');
}
if($rand2==3) {
include('order_form_v4_images.php');
}
if($rand2==4) {
include('order_form_v2.php');
}
//include('order_form_v2.php');
exit();
}
exit();
}
break;
}