| 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
require_once($_SERVER['DOCUMENT_ROOT']."/inc/php_header.php");
if(!empty($_POST)) {
foreach($_POST as $key=>$value) {
$_SESSION[$key] = $value;
}
}
foreach($_SESSION as $key=>$value) {
if($key=='prm') { continue; }
$_POST[$key] = $value;
$_REQUEST[$key] = $value;
}
if(!empty($_GET['prm'])) {
$prm_arr = explode('|',UnCryptify($_GET['prm']));
$prm = array();
$prm['cid'] = $prm_arr[0];
$prm['sid'] = $prm_arr[1];
$prm['initial'] = $prm_arr[2];
$prm['monthly'] = $prm_arr[3];
$_SESSION['prm'] = $prm;
}
if(empty($_POST) && empty($_SESSION['cc_fname'])) {
header("Location: /");
exit();
}
$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'];
$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'];
$cc_lead_id = $_REQUEST['cc_lead_id'];
$app_gender = $_REQUEST['app_gender'];
$app_age = $_REQUEST['app_age'];
$app_citizenship = $_REQUEST['app_citizenship'];
$app_granttype = $_REQUEST['granttype'];
$user_id = $_REQUEST['user_id'];
$initial_subscription_fee = (isset($_REQUEST['cc_amount']) && is_numeric($_REQUEST['cc_amount'])) ? $_REQUEST['cc_amount'] : $initial_subscription_fee;
$app_amount_needed = $_REQUEST['app_amount_needed'];
$app_usedescription = $_REQUEST['app_usedescription'];
$do_session = $_GET['s'];
if ($do_session == '1')
{
foreach($_SESSION as $key=>$value)
{
if($key!='upsell_tracking_version' && $key!='keywords') {
unset($_SESSION[$key]);
}
}
}
else
{
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":
$postfields = array();
$postfields['user_id'] = $user_id;
$postfields['sendemail'] = 'yes';
$postfields['email_type'] = 'Confirmation Subscription Id 2';
$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[]=".$monthly_subscription_fee;
$subscriptions_params .= "&subscription_trial[]=".$monthly_subscription_trial;
$result = false;
$errormessage = '';
$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($_SESSION['upsell_tracking_version']=='site order before') {
include('confirm.php');
exit();
} else {
if(empty($cc_email)) {
$cc_email = $_SESSION['auth_user'];
$cc_zip = $_SESSION['auth_pass'];
}
header('Location: login.php?user='.urlencode($cc_email).'&pass='.urlencode($cc_zip));
exit();
}
exit();
break;
//continue to confirmation page
case "No Thanks":
if($_SESSION['upsell_tracking_version']=='site order before') {
include('confirm.php');
exit();
} else {
header('Location: login.php?u='.urlencode($cc_email).'&p='.urlencode($cc_zip));
exit();
}
break;
//initial order page
default:
/*$errors = array();
if(empty($_REQUEST['category_id'])) {
$errors[] = "Please Select A Funding Category.";
}
if(empty($_REQUEST['cc_fname'])) {
$errors[] = "Please Enter Your First Name.";
}
if(empty($_REQUEST['cc_lname'])) {
$errors[] = "Please Enter Your Last Name.";
}
if(empty($_REQUEST['cc_addr'])) {
$errors[] = "Please Enter Your Address.";
}
if(empty($_REQUEST['cc_city'])) {
$errors[] = "Please Enter Your City.";
}
if(empty($_REQUEST['cc_state'])) {
$errors[] = "Please Enter Your State.";
}
if(empty($_REQUEST['cc_zip'])) {
$errors[] = "Please Enter Your Zip Code.";
}
if(empty($_REQUEST['cc_phonearea']) || empty($_REQUEST['cc_phoneprefix']) || empty($_REQUEST['cc_phoneextension'])) {
$errors[] = "Please Enter Your Phone Number.";
}
if(empty($_REQUEST['cc_email'])) {
$errors[] = "Please Enter Your Email Address.";
}
if(empty($_REQUEST['app_gender'])) {
$errors[] = "Please Select Your Gender.";
}
if(empty($_REQUEST['app_citizenship'])) {
$errors[] = "Please Select Your Citizenship.";
}
if(empty($_REQUEST['app_age'])) {
$errors[] = "Please Enter Your Age.";
}
if(empty($_REQUEST['app_amount_needed'])) {
$errors[] = "Please Enter The Amount Of Money You Need.";
}
if(empty($_REQUEST['app_usedescription'])) {
$errors[] = "Please Describe What You Will Use The Money For.";
}
if(empty($_REQUEST['app_uniqueness'])) {
$errors[] = "Please Explain What Makes You Unique.";
}
if(!empty($errors)) {
if(isset($_REQUEST['lp_version'])) {
$querystring = "";
foreach($_REQUEST as $k=>$v) {
$querystring .= ($querystring=='') ? "?$k=$v" : "&$k=$v";
}
foreach($errors as $v) {
$querystring .= ($querystring=='') ? "?errors[]=$v" : "&errors[]=$v";
}
header("Location: /".$_REQUEST['lp_version'].'/index.php'.$querystring);
} else {
header("Location: /index.php".$querystring);
}
exit();
}*/
$types_of_grants = array();
switch ($app_granttype) {
case "business_funding":
$grants = $businessgrants;
break;
case "real_estate_funding":
$grants = $realestategrants;
break;
case "education_tuition_funding":
$grants = $educationgrants;
break;
case "personal_assistance":
$grants = $personalgrants;
break;
case "women":
$grants = $women;
break;
case "seniors":
$grants = $seniors;
break;
case "minorities":
$grants = $minorities;
break;
case "1st_time_home":
case "faith":
case "non_profit":
case "disabled":
$grants = array();
break;
default:
$grants = $businessgrants;
break;
}
$counter = 0;
$combined_types = "";
foreach ($grants as $grant) {
$grantnumber = "granttype_" . $counter;
$grantselected = $_REQUEST[$grantnumber];
if (! strcmp($grantselected,"")==0) {
$types_of_grants[] = $grantselected;
$combined_types .= $grantselected . ",";
}
$counter++;
}
$app_granttype_other = $_REQUEST['granttype_other'];
$combined_types .= $app_granttype_other;
$app_amount_needed = $_REQUEST['app_amount_needed'];
$app_usedescription = $_REQUEST['app_usedescription'];
$app_uniqueness = $_REQUEST['app_uniqueness'];
$submitted = $_REQUEST['submitted'];
$application = $_REQUEST['application'];
$ipaddress = $_SERVER['REMOTE_ADDR'];
if (! strcmp($application,"") == 0) {
// 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'];
if(!empty($_SESSION['prm'])) {
$postfields['sid'] = $_SESSION['prm']['sid'];
$postfields['cid'] = $_SESSION['prm']['cid'];
}
$lcapi = new LCAPI();
$result = $lcapi->CreateLead($postfields);
if (!$result) {
$errormessage = $lcapi->response->errormessage;
} else {
$lead_id = $lcapi->response->userid;
$lead_id = trim($lead_id);
$cc_lead_id = $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['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['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 (! strcmp($submitted,"") == 0) {
$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['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'] = '';
//$postfields['billing_amount'] = $initial_subscription_fee;
//$postfields['rebill_amount'] = '0.00';
//$postfields['next_bill_date'] = 'never';
if ($special_order == '1') {
$initial_subscription_fee = $_VSA_PRICE;
$postfields['referer'] = 'VSA';
}
if(!empty($_SESSION['prm'])) {
$initial_subscription_fee = $_SESSION['prm']['initial'];
$postfields['sid'] = $_SESSION['prm']['sid'];
$postfields['cid'] = $_SESSION['prm']['cid'];
$postfields['billing_amount'] = $initial_subscription_fee;
$postfields['rebill_amount'] = $initial_subscription_fee;
$postfields['referer'] = 'SYN';
$postfields['source'] = 'chat';
$postfields['rep'] = $_SESSION['prm']['sid'];
}
$subscriptions_params = "subscriptions[]=1"; //right now just using the defaults for site access subscription
$subscriptions_params .= "&subscription_amount[]=".$initial_subscription_fee;
if(!empty($_SESSION['prm'])) {
$subscriptions_params .= "&subscriptions[]=2&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) {
echo '<!-- ';
var_dump($lcapi->response);
echo ' -->';
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";
include($page);
exit();
} else {
// Successful transaction
// Send the user an email.
//$partial_cc_num = "****" . substr($cc_num,12);
$user_id = trim($lcapi->response->userid);
$success_message = "Your account has successfully been created.";
//include("order_research_service_form.php"); //currently using the upsell pages
//include('confirm.php');
$lcapi = new LCAPI();
$postfields = array();
$postfields['site'] = $_SITE_CODE;
$postfields['user_id'] = $user_id;
$lcapi->PostFields("https://surfcrm.com/lcapi/SendEmail.php",$postfields);
//if(rand(0,1)) {
if(true) { //Always before as of 4/21/2014
$_SESSION['upsell_tracking_version'] = 'site order before';
include("order_research_service_before.php");
exit();
} else {
$_SESSION['upsell_tracking_version'] = 'site order after';
include("confirm.php");
exit();
}
exit();
}
} else {
// Display the initial form
if ($cc_fname == '' || $cc_lname == '') {
header("Location: /");
exit();
}
if ($special_order == "1") {
include("special_order_form.php");
} else {
$use_vsa = false;
include("order_form.php");
}
exit();
}
break;
}