| 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.org/ |
Upload File : |
<?php
require_once("{$_SERVER['DOCUMENT_ROOT']}/assets/includes/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'];
$cc_country = $_REQUEST['cc_country'];
$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'];
$user_id = $_REQUEST['user_id'];
$initial_subscription_fee = (isset($_REQUEST['cc_amount']) && is_numeric($_REQUEST['cc_amount'])) ? $_REQUEST['cc_amount'] : $_INITIAL_FEE;
if ($do_session == '1')
{
foreach($_SESSION as $key=>$value)
{
$_POST[$key] = $value;
}
}
else
{
foreach ($_SESSION as $key=>$value)
{
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":
$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'];
$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 (!$result) {
$error_message = "There was an unexpected error.";
} else if($result->status == 'Failure') {
// failed transaction - show alert message
$error_message = $result->errormessage;
} else {
include('confirm_subscription.php');
exit();
}
include('order_research_service_form.php');
exit();
break;
//continue to confirmation page
case "No Thanks":
$lcapi = new LCAPI();
$postfields = array();
$postfields['site'] = $_SITE_CODE;
$postfields['user_id'] = $user_id;
$lcapi->PostFields("https://surfcrm.com/lcapi/SendEmail.php",$postfields);
include('confirm.php');
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;
$lcapi = new LCAPI();
$result = $lcapi->CreateLead($postfields);
if (!$result) {
$errormessage = $lcapi->response->errormessage;
} else {
$postfields = array();
$cc_lead_id = trim($lcapi->response->userid);
// 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(!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['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;
if ($special_order == '1') {
$initial_subscription_fee = $_VSA_PRICE;
$postfields['referer'] = 'VSA';
}
$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($postfields['cc_num']{0} == 3) {
$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) {
if($postfields['cc_num']{0} != 3) {
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_new.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");
}
} 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_new.php");
}
exit();
}
break;
}