| 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/usagrantapplications.org/ |
Upload File : |
<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/inc/php_header.php');
$do_session = $_GET['s'];
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;
}
}
$initial_fee = $_INITIAL_FEE;
$monthly_fee = $_MONTHLY_FEE;
$vsa_price = $_VSA_PRICE;
$special_order = $_GET['so'];
if (isset($_POST['so'])) { $special_order = $_POST['so'];}
$_POST['so'] = $special_order;
$tc = (! isset($_POST['tc'])) ? 'none': $_POST['tc'];
$cc_fname = $_GET['cc_fname'];
if (isset($_POST['cc_fname'])) { $cc_fname = $_POST['cc_fname'];}
$cc_lname = $_GET['cc_lname'];
if (isset($_POST['cc_lname'])) { $cc_lname = $_POST['cc_lname'];}
$cc_addr = $_GET['cc_addr'];
if (isset($_POST['cc_addr'])) { $cc_addr = $_POST['cc_addr'];}
$cc_city = $_GET['cc_city'];
if (isset($_POST['cc_city'])) { $cc_city = $_POST['cc_city'];}
$cc_zip = $_GET['cc_zip'];
if (isset($_POST['cc_zip'])) { $cc_zip = $_POST['cc_zip'];}
$cc_state = $_GET['cc_state'];
if (isset($_POST['cc_state'])) { $cc_state = $_POST['cc_state'];}
$cc_country = $_GET['cc_country'];
if (isset($_POST['cc_country'])) { $cc_country = $_POST['cc_country'];}
$cc_phonearea = $_GET['cc_phonearea'];
if (isset($_POST['cc_phonearea'])) { $cc_phonearea = $_POST['cc_phonearea'];}
$cc_phoneprefix = $_GET['cc_phoneprefix'];
if (isset($_POST['cc_phoneprefix'])) { $cc_phoneprefix = $_POST['cc_phoneprefix'];}
$cc_phoneextension = $_GET['cc_phoneextension'];
if (isset($_POST['cc_phoneextension'])) { $cc_phoneextension = $_POST['cc_phoneextension'];}
$cc_phonearea2 = $_GET['cc_phonearea2'];
if (isset($_POST['cc_phonearea2'])) { $cc_phonearea2 = $_POST['cc_phonearea2'];}
$cc_phoneprefix2 = $_GET['cc_phoneprefix2'];
if (isset($_POST['cc_phoneprefix2'])) { $cc_phoneprefix2 = $_POST['cc_phoneprefix2'];}
$cc_phoneextension2 = $_GET['cc_phoneextension2'];
if (isset($_POST['cc_phoneextension2'])) { $cc_phoneextension2 = $_POST['cc_phoneextension2'];}
$cc_email = $_GET['cc_email'];
if (isset($_POST['cc_email'])) { $cc_email = $_POST['cc_email'];}
$cc_type = $_GET['cc_type'];
if (isset($_POST['cc_type'])) { $cc_type = $_POST['cc_type'];}
$cc_num = $_GET['cc_num'];
if (isset($_POST['cc_num'])) { $cc_num = $_POST['cc_num'];}
$cc_month = $_GET['cc_month'];
if (isset($_POST['cc_month'])) { $cc_month = $_POST['cc_month'];}
$cc_year = $_GET['cc_year'];
if (isset($_POST['cc_year'])) { $cc_year = $_POST['cc_year'];}
$cc_cvv = $_GET['cc_cvv'];
if (isset($_POST['cc_cvv'])) { $cc_cvv = $_POST['cc_cvv'];}
$cc_lead_id = $_GET['cc_lead_id'];
if (isset($_POST['cc_lead_id'])) { $cc_lead_id = $_POST['cc_lead_id'];}
$app_gender = $_GET['app_gender'];
if (isset($_POST['app_gender'])) { $app_gender = $_POST['app_gender'];}
$app_age = $_GET['app_age'];
if (isset($_POST['app_age'])) { $app_age = $_POST['app_age'];}
$app_citizenship = $_GET['app_citizenship'];
if (isset($_POST['app_citizenship'])) { $app_citizenship = $_POST['app_citizenship'];}
$app_amount_needed = $_GET['app_amount_needed'];
if (isset($_POST['app_amount_needed'])) { $app_amount_needed = $_POST['app_amount_needed'];}
$app_usedescription = $_GET['app_usedescription'];
if (isset($_POST['app_usedescription'])) { $app_usedescription = $_POST['app_usedescription'];}
$app_uniqueness = $_GET['app_uniqueness'];
if (isset($_POST['app_uniqueness'])) { $app_uniqueness = $_POST['app_uniqueness'];}
$submitted = $_POST['submitted'];
$application = $_POST['application'];
$ipaddress = $_SERVER['REMOTE_ADDR'];
if (isset($_POST['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'] = 'usaga';
$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'] = 'usaga';
$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(!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['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'] = 'usaga';
$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['sendemail'] = 'yes';
$postfields['billing_amount'] = number_format($_INITIAL_FEE,2);
$postfields['rebill_amount'] = number_format($_MONTHLY_FEE,2);
$postfields['next_bill_date'] = $_MONTHLY_TRIAL;
if ($special_order == '1')
{
$postfields['billing_amount'] = number_format($_MONTHLY_FEE,2);
$postfields['referer'] = 'VSA';
}
/*
* Temporary deny of all AMEX cards
*/
$result = false;
$errormessage = '';
if($postfields['cc_num']{0} == 3) //Deny all AMEX
{
$errormessage = "We do not accept American Express. Please use another card. Thank you.";
}
else
{
$lcapi = new LCAPI();
$result = $lcapi->CreateUser($postfields);
}
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 = "order_form.php";
$page = ($special_order == '1') ? "special_order_form.php" : $page;
include($page);
exit();
}
else
{
// Successful transaction
// Send the user an email.
$partial_cc_num = "****" . substr($cc_num,12);
include("confirm.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 = true;
include("order_form.php");
}
exit();
}